(function(global2, factory) { typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.WalletKit = {})); })(this, function(exports2) { var _a, _b, _c; "use strict"; var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; function getDefaultExportFromCjs(x2) { return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2; } function getAugmentedNamespace(n2) { if (n2.__esModule) return n2; var f2 = n2.default; if (typeof f2 == "function") { var a2 = function a3() { if (this instanceof a3) { return Reflect.construct(f2, arguments, this.constructor); } return f2.apply(this, arguments); }; a2.prototype = f2.prototype; } else a2 = {}; Object.defineProperty(a2, "__esModule", { value: true }); Object.keys(n2).forEach(function(k2) { var d2 = Object.getOwnPropertyDescriptor(n2, k2); Object.defineProperty(a2, k2, d2.get ? d2 : { enumerable: true, get: function() { return n2[k2]; } }); }); return a2; } var web3_min = { exports: {} }; /*! For license information please see web3.min.js.LICENSE.txt */ (function(module2, exports3) { !function(e2, t2) { module2.exports = t2(); }(self, () => (() => { var e2 = { 81645: (e3, t3, r3) => { var n2 = function(e4) { var t4 = "function" == typeof Symbol && Symbol.iterator, r4 = t4 && e4[t4], n3 = 0; if (r4) return r4.call(e4); if (e4 && "number" == typeof e4.length) return { next: function() { return e4 && n3 >= e4.length && (e4 = void 0), { value: e4 && e4[n3++], done: !e4 }; } }; throw new TypeError(t4 ? "Object is not iterable." : "Symbol.iterator is not defined."); }, i2 = function(e4) { return e4 && e4.__esModule ? e4 : { default: e4 }; }; Object.defineProperty(t3, "__esModule", { value: true }), t3.chains = t3._getInitializedChains = void 0; var o2 = i2(r3(87295)), a2 = i2(r3(31227)), s2 = i2(r3(40439)), u2 = i2(r3(37098)), c2 = i2(r3(17687)), f2 = i2(r3(49422)); function d2(e4) { var t4, r4, i3 = { 1: "mainnet", 3: "ropsten", 4: "rinkeby", 42: "kovan", 5: "goerli", 11155111: "sepolia" }, d3 = { mainnet: o2.default, ropsten: a2.default, rinkeby: s2.default, kovan: u2.default, goerli: c2.default, sepolia: f2.default }; if (e4) try { for (var l2 = n2(e4), h2 = l2.next(); !h2.done; h2 = l2.next()) { var p2 = h2.value, b2 = p2.name; i3[p2.chainId.toString()] = b2, d3[b2] = p2; } } catch (e5) { t4 = { error: e5 }; } finally { try { h2 && !h2.done && (r4 = l2.return) && r4.call(l2); } finally { if (t4) throw t4.error; } } return d3.names = i3, d3; } t3._getInitializedChains = d2, t3.chains = d2(); }, 425: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.EIPs = void 0, t3.EIPs = { 1153: r3(96561), 1559: r3(77523), 2315: r3(83339), 2537: r3(26769), 2565: r3(17897), 2718: r3(62170), 2929: r3(88436), 2930: r3(96213), 3198: r3(25491), 3529: r3(20070), 3540: r3(52256), 3541: r3(21871), 3554: r3(47225), 3607: r3(3968), 3651: r3(29496), 3670: r3(74290), 3675: r3(98571), 3855: r3(64551), 3860: r3(94300), 4345: r3(74818), 4399: r3(68372), 5133: r3(4759) }; }, 7002: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.hardforks = void 0, t3.hardforks = [["chainstart", r3(60114)], ["homestead", r3(62800)], ["dao", r3(7197)], ["tangerineWhistle", r3(22302)], ["spuriousDragon", r3(90716)], ["byzantium", r3(26985)], ["constantinople", r3(35993)], ["petersburg", r3(4064)], ["istanbul", r3(83166)], ["muirGlacier", r3(42946)], ["berlin", r3(20015)], ["london", r3(61250)], ["shanghai", r3(5553)], ["arrowGlacier", r3(51971)], ["grayGlacier", r3(31088)], ["mergeForkIdTransition", r3(49347)], ["merge", r3(88648)]]; }, 3863: (e3, t3, r3) => { var n2, i2 = r3(29033).Buffer, o2 = r3(28847)(r3(3355)), a2 = (n2 = function(e4, t4) { return n2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e5, t5) { e5.__proto__ = t5; } || function(e5, t5) { for (var r4 in t5) Object.prototype.hasOwnProperty.call(t5, r4) && (e5[r4] = t5[r4]); }, n2(e4, t4); }, function(e4, t4) { if ("function" != typeof t4 && null !== t4) throw new TypeError("Class extends value " + String(t4) + " is not a constructor or null"); function r4() { this.constructor = e4; } n2(e4, t4), e4.prototype = null === t4 ? Object.create(t4) : (r4.prototype = t4.prototype, new r4()); }), s2 = function() { return s2 = Object.assign || function(e4) { for (var t4, r4 = 1, n3 = arguments.length; r4 < n3; r4++) for (var i3 in t4 = arguments[r4]) Object.prototype.hasOwnProperty.call(t4, i3) && (e4[i3] = t4[i3]); return e4; }, s2.apply(this, arguments); }, u2 = function(e4) { var t4 = "function" == typeof Symbol && Symbol.iterator, r4 = t4 && e4[t4], n3 = 0; if (r4) return r4.call(e4); if (e4 && "number" == typeof e4.length) return { next: function() { return e4 && n3 >= e4.length && (e4 = void 0), { value: e4 && e4[n3++], done: !e4 }; } }; throw new TypeError(t4 ? "Object is not iterable." : "Symbol.iterator is not defined."); }; Object.defineProperty(t3, "__esModule", { value: true }), t3.ConsensusAlgorithm = t3.ConsensusType = t3.Hardfork = t3.Chain = t3.CustomChain = void 0; var c2, f2, d2, l2, h2, p2 = r3(38291), b2 = r3(64628), y2 = r3(33062), v2 = r3(81645), m2 = r3(7002), g2 = r3(425); !function(e4) { e4.PolygonMainnet = "polygon-mainnet", e4.PolygonMumbai = "polygon-mumbai", e4.ArbitrumRinkebyTestnet = "arbitrum-rinkeby-testnet", e4.xDaiChain = "x-dai-chain", e4.OptimisticKovan = "optimistic-kovan", e4.OptimisticEthereum = "optimistic-ethereum"; }(c2 = t3.CustomChain || (t3.CustomChain = {})), (h2 = t3.Chain || (t3.Chain = {}))[h2.Mainnet = 1] = "Mainnet", h2[h2.Ropsten = 3] = "Ropsten", h2[h2.Rinkeby = 4] = "Rinkeby", h2[h2.Kovan = 42] = "Kovan", h2[h2.Goerli = 5] = "Goerli", h2[h2.Sepolia = 11155111] = "Sepolia", function(e4) { e4.Chainstart = "chainstart", e4.Homestead = "homestead", e4.Dao = "dao", e4.TangerineWhistle = "tangerineWhistle", e4.SpuriousDragon = "spuriousDragon", e4.Byzantium = "byzantium", e4.Constantinople = "constantinople", e4.Petersburg = "petersburg", e4.Istanbul = "istanbul", e4.MuirGlacier = "muirGlacier", e4.Berlin = "berlin", e4.London = "london", e4.ArrowGlacier = "arrowGlacier", e4.GrayGlacier = "grayGlacier", e4.MergeForkIdTransition = "mergeForkIdTransition", e4.Merge = "merge", e4.Shanghai = "shanghai"; }(f2 = t3.Hardfork || (t3.Hardfork = {})), (l2 = t3.ConsensusType || (t3.ConsensusType = {})).ProofOfStake = "pos", l2.ProofOfWork = "pow", l2.ProofOfAuthority = "poa", (d2 = t3.ConsensusAlgorithm || (t3.ConsensusAlgorithm = {})).Ethash = "ethash", d2.Clique = "clique", d2.Casper = "casper"; var w2 = function(e4) { function t4(t5) { var r4, n3, i3, o3, a3 = this; (a3 = e4.call(this) || this)._supportedHardforks = [], a3._eips = [], a3._customChains = null !== (i3 = t5.customChains) && void 0 !== i3 ? i3 : [], a3._chainParams = a3.setChain(t5.chain), a3.DEFAULT_HARDFORK = null !== (o3 = a3._chainParams.defaultHardfork) && void 0 !== o3 ? o3 : f2.Istanbul; try { for (var s3 = u2(a3._chainParams.hardforks), c3 = s3.next(); !c3.done; c3 = s3.next()) { var d3 = c3.value; d3.forkHash || (d3.forkHash = a3._calcForkHash(d3.name)); } } catch (e5) { r4 = { error: e5 }; } finally { try { c3 && !c3.done && (n3 = s3.return) && n3.call(s3); } finally { if (r4) throw r4.error; } } return a3._hardfork = a3.DEFAULT_HARDFORK, t5.supportedHardforks && (a3._supportedHardforks = t5.supportedHardforks), t5.hardfork && a3.setHardfork(t5.hardfork), t5.eips && a3.setEIPs(t5.eips), a3; } return a2(t4, e4), t4.custom = function(e5, r4) { var n3; void 0 === r4 && (r4 = {}); var i3 = null !== (n3 = r4.baseChain) && void 0 !== n3 ? n3 : "mainnet", o3 = s2({}, t4._getChainParams(i3)); if (o3.name = "custom-chain", "string" != typeof e5) return new t4(s2({ chain: s2(s2({}, o3), e5) }, r4)); if (e5 === c2.PolygonMainnet) return t4.custom({ name: c2.PolygonMainnet, chainId: 137, networkId: 137 }, r4); if (e5 === c2.PolygonMumbai) return t4.custom({ name: c2.PolygonMumbai, chainId: 80001, networkId: 80001 }, r4); if (e5 === c2.ArbitrumRinkebyTestnet) return t4.custom({ name: c2.ArbitrumRinkebyTestnet, chainId: 421611, networkId: 421611 }, r4); if (e5 === c2.xDaiChain) return t4.custom({ name: c2.xDaiChain, chainId: 100, networkId: 100 }, r4); if (e5 === c2.OptimisticKovan) return t4.custom({ name: c2.OptimisticKovan, chainId: 69, networkId: 69 }, s2({ hardfork: f2.Berlin }, r4)); if (e5 === c2.OptimisticEthereum) return t4.custom({ name: c2.OptimisticEthereum, chainId: 10, networkId: 10 }, s2({ hardfork: f2.Berlin }, r4)); throw new Error("Custom chain ".concat(e5, " not supported")); }, t4.forCustomChain = function(e5, r4, n3, i3) { var o3 = t4._getChainParams(e5); return new t4({ chain: s2(s2({}, o3), r4), hardfork: n3, supportedHardforks: i3 }); }, t4.isSupportedChainId = function(e5) { var t5 = (0, v2._getInitializedChains)(); return Boolean(t5.names[e5.toString()]); }, t4._getChainParams = function(e5, t5) { var r4 = (0, v2._getInitializedChains)(t5); if ("number" == typeof e5 || y2.BN.isBN(e5)) { if (e5 = e5.toString(), r4.names[e5]) return r4[r4.names[e5]]; throw new Error("Chain with ID ".concat(e5, " not supported")); } if (r4[e5]) return r4[e5]; throw new Error("Chain with name ".concat(e5, " not supported")); }, t4.prototype.setChain = function(e5) { var r4, n3; if ("number" == typeof e5 || "string" == typeof e5 || y2.BN.isBN(e5)) { var i3; i3 = this._customChains && this._customChains.length > 0 && Array.isArray(this._customChains[0]) ? this._customChains.map(function(e6) { return e6[0]; }) : this._customChains, this._chainParams = t4._getChainParams(e5, i3); } else { if ("object" !== (0, o2.default)(e5)) throw new Error("Wrong input format"); if (this._customChains.length > 0) throw new Error("Chain must be a string, number, or BN when initialized with customChains passed in"); try { for (var a3 = u2(["networkId", "genesis", "hardforks", "bootstrapNodes"]), s3 = a3.next(); !s3.done; s3 = a3.next()) { var c3 = s3.value; if (void 0 === e5[c3]) throw new Error("Missing required chain parameter: ".concat(c3)); } } catch (e6) { r4 = { error: e6 }; } finally { try { s3 && !s3.done && (n3 = a3.return) && n3.call(a3); } finally { if (r4) throw r4.error; } } this._chainParams = e5; } return this._chainParams; }, t4.prototype.setHardfork = function(e5) { var t5, r4; if (!this._isSupportedHardfork(e5)) throw new Error("Hardfork ".concat(e5, " not set as supported in supportedHardforks")); var n3 = false; try { for (var i3 = u2(m2.hardforks), o3 = i3.next(); !o3.done; o3 = i3.next()) o3.value[0] === e5 && (this._hardfork !== e5 && (this._hardfork = e5, this.emit("hardforkChanged", e5)), n3 = true); } catch (e6) { t5 = { error: e6 }; } finally { try { o3 && !o3.done && (r4 = i3.return) && r4.call(i3); } finally { if (t5) throw t5.error; } } if (!n3) throw new Error("Hardfork with name ".concat(e5, " not supported")); }, t4.prototype.getHardforkByBlockNumber = function(e5, t5) { var r4, n3; e5 = (0, y2.toType)(e5, y2.TypeOutput.BN), t5 = (0, y2.toType)(t5, y2.TypeOutput.BN); var i3, o3, a3, s3 = f2.Chainstart; try { for (var c3 = u2(this.hardforks()), d3 = c3.next(); !d3.done; d3 = c3.next()) { var l3 = d3.value; if (null !== l3.block) e5.gte(new y2.BN(l3.block)) && (s3 = l3.name), t5 && l3.td && (t5.gte(new y2.BN(l3.td)) ? i3 = l3.name : o3 = a3), a3 = l3.name; else if (null != t5 && void 0 !== l3.td && null !== l3.td && t5.gte(new y2.BN(l3.td))) return l3.name; } } catch (e6) { r4 = { error: e6 }; } finally { try { d3 && !d3.done && (n3 = c3.return) && n3.call(c3); } finally { if (r4) throw r4.error; } } if (t5) { var h3 = "block number: ".concat(e5, " (-> ").concat(s3, "), "); if (i3 && !this.hardforkGteHardfork(s3, i3)) { var p3 = "HF determined by block number is lower than the minimum total difficulty HF"; throw h3 += "total difficulty: ".concat(t5, " (-> ").concat(i3, ")"), new Error("".concat(p3, ": ").concat(h3)); } if (o3 && !this.hardforkGteHardfork(o3, s3)) throw p3 = "Maximum HF determined by total difficulty is lower than the block number HF", h3 += "total difficulty: ".concat(t5, " (-> ").concat(o3, ")"), new Error("".concat(p3, ": ").concat(h3)); } return s3; }, t4.prototype.setHardforkByBlockNumber = function(e5, t5) { var r4 = this.getHardforkByBlockNumber(e5, t5); return this.setHardfork(r4), r4; }, t4.prototype._chooseHardfork = function(e5, t5) { if (void 0 === t5 && (t5 = true), e5) { if (t5 && !this._isSupportedHardfork(e5)) throw new Error("Hardfork ".concat(e5, " not set as supported in supportedHardforks")); } else e5 = this._hardfork; return e5; }, t4.prototype._getHardfork = function(e5) { var t5, r4, n3 = this.hardforks(); try { for (var i3 = u2(n3), o3 = i3.next(); !o3.done; o3 = i3.next()) { var a3 = o3.value; if (a3.name === e5) return a3; } } catch (e6) { t5 = { error: e6 }; } finally { try { o3 && !o3.done && (r4 = i3.return) && r4.call(i3); } finally { if (t5) throw t5.error; } } throw new Error("Hardfork ".concat(e5, " not defined for chain ").concat(this.chainName())); }, t4.prototype._isSupportedHardfork = function(e5) { var t5, r4; if (!(this._supportedHardforks.length > 0)) return true; try { for (var n3 = u2(this._supportedHardforks), i3 = n3.next(); !i3.done; i3 = n3.next()) if (e5 === i3.value) return true; } catch (e6) { t5 = { error: e6 }; } finally { try { i3 && !i3.done && (r4 = n3.return) && r4.call(n3); } finally { if (t5) throw t5.error; } } return false; }, t4.prototype.setEIPs = function(e5) { var t5, r4, n3 = this; void 0 === e5 && (e5 = []); var i3 = function(t6) { if (!(t6 in g2.EIPs)) throw new Error("".concat(t6, " not supported")); var r5 = o3.gteHardfork(g2.EIPs[t6].minimumHardfork); if (!r5) throw new Error("".concat(t6, " cannot be activated on hardfork ").concat(o3.hardfork(), ", minimumHardfork: ").concat(r5)); g2.EIPs[t6].requiredEIPs && g2.EIPs[t6].requiredEIPs.forEach(function(r6) { if (!e5.includes(r6) && !n3.isActivatedEIP(r6)) throw new Error("".concat(t6, " requires EIP ").concat(r6, ", but is not included in the EIP list")); }); }, o3 = this; try { for (var a3 = u2(e5), s3 = a3.next(); !s3.done; s3 = a3.next()) i3(s3.value); } catch (e6) { t5 = { error: e6 }; } finally { try { s3 && !s3.done && (r4 = a3.return) && r4.call(a3); } finally { if (t5) throw t5.error; } } this._eips = e5; }, t4.prototype.param = function(e5, t5) { var r4, n3, i3 = null; try { for (var o3 = u2(this._eips), a3 = o3.next(); !a3.done; a3 = o3.next()) { var s3 = a3.value; if (null !== (i3 = this.paramByEIP(e5, t5, s3))) return i3; } } catch (e6) { r4 = { error: e6 }; } finally { try { a3 && !a3.done && (n3 = o3.return) && n3.call(o3); } finally { if (r4) throw r4.error; } } return this.paramByHardfork(e5, t5, this._hardfork); }, t4.prototype.paramByHardfork = function(e5, t5, r4) { var n3, i3, o3, a3; r4 = this._chooseHardfork(r4); var s3 = null; try { for (var c3 = u2(m2.hardforks), f3 = c3.next(); !f3.done; f3 = c3.next()) { var d3 = f3.value; if ("eips" in d3[1]) { var l3 = d3[1].eips; try { for (var h3 = (o3 = void 0, u2(l3)), p3 = h3.next(); !p3.done; p3 = h3.next()) { var b3 = p3.value, y3 = this.paramByEIP(e5, t5, b3); s3 = null !== y3 ? y3 : s3; } } catch (e6) { o3 = { error: e6 }; } finally { try { p3 && !p3.done && (a3 = h3.return) && a3.call(h3); } finally { if (o3) throw o3.error; } } } else { if (!d3[1][e5]) throw new Error("Topic ".concat(e5, " not defined")); void 0 !== d3[1][e5][t5] && (s3 = d3[1][e5][t5].v); } if (d3[0] === r4) break; } } catch (e6) { n3 = { error: e6 }; } finally { try { f3 && !f3.done && (i3 = c3.return) && i3.call(c3); } finally { if (n3) throw n3.error; } } return s3; }, t4.prototype.paramByEIP = function(e5, t5, r4) { if (!(r4 in g2.EIPs)) throw new Error("".concat(r4, " not supported")); var n3 = g2.EIPs[r4]; if (!(e5 in n3)) throw new Error("Topic ".concat(e5, " not defined")); return void 0 === n3[e5][t5] ? null : n3[e5][t5].v; }, t4.prototype.paramByBlock = function(e5, t5, r4) { var n3 = this.activeHardforks(r4), i3 = n3[n3.length - 1].name; return this.paramByHardfork(e5, t5, i3); }, t4.prototype.isActivatedEIP = function(e5) { var t5, r4; if (this.eips().includes(e5)) return true; try { for (var n3 = u2(m2.hardforks), i3 = n3.next(); !i3.done; i3 = n3.next()) { var o3 = i3.value[1]; if (this.gteHardfork(o3.name) && "eips" in o3 && o3.eips.includes(e5)) return true; } } catch (e6) { t5 = { error: e6 }; } finally { try { i3 && !i3.done && (r4 = n3.return) && r4.call(n3); } finally { if (t5) throw t5.error; } } return false; }, t4.prototype.hardforkIsActiveOnBlock = function(e5, t5, r4) { var n3; void 0 === r4 && (r4 = {}), t5 = (0, y2.toType)(t5, y2.TypeOutput.BN); var i3 = null !== (n3 = r4.onlySupported) && void 0 !== n3 && n3; e5 = this._chooseHardfork(e5, i3); var o3 = this.hardforkBlockBN(e5); return !(!o3 || !t5.gte(o3)); }, t4.prototype.activeOnBlock = function(e5, t5) { return this.hardforkIsActiveOnBlock(null, e5, t5); }, t4.prototype.hardforkGteHardfork = function(e5, t5, r4) { var n3, i3; void 0 === r4 && (r4 = {}); var o3, a3 = void 0 !== r4.onlyActive && r4.onlyActive; e5 = this._chooseHardfork(e5, r4.onlySupported), o3 = a3 ? this.activeHardforks(null, r4) : this.hardforks(); var s3 = -1, c3 = -1, f3 = 0; try { for (var d3 = u2(o3), l3 = d3.next(); !l3.done; l3 = d3.next()) { var h3 = l3.value; h3.name === e5 && (s3 = f3), h3.name === t5 && (c3 = f3), f3 += 1; } } catch (e6) { n3 = { error: e6 }; } finally { try { l3 && !l3.done && (i3 = d3.return) && i3.call(d3); } finally { if (n3) throw n3.error; } } return s3 >= c3 && -1 !== c3; }, t4.prototype.gteHardfork = function(e5, t5) { return this.hardforkGteHardfork(null, e5, t5); }, t4.prototype.hardforkIsActiveOnChain = function(e5, t5) { var r4, n3, i3; void 0 === t5 && (t5 = {}); var o3 = null !== (i3 = t5.onlySupported) && void 0 !== i3 && i3; e5 = this._chooseHardfork(e5, o3); try { for (var a3 = u2(this.hardforks()), s3 = a3.next(); !s3.done; s3 = a3.next()) { var c3 = s3.value; if (c3.name === e5 && null !== c3.block) return true; } } catch (e6) { r4 = { error: e6 }; } finally { try { s3 && !s3.done && (n3 = a3.return) && n3.call(a3); } finally { if (r4) throw r4.error; } } return false; }, t4.prototype.activeHardforks = function(e5, t5) { var r4, n3; void 0 === t5 && (t5 = {}); var i3 = [], o3 = this.hardforks(); try { for (var a3 = u2(o3), s3 = a3.next(); !s3.done; s3 = a3.next()) { var c3 = s3.value; if (null !== c3.block) { if (null != e5 && e5 < c3.block) break; t5.onlySupported && !this._isSupportedHardfork(c3.name) || i3.push(c3); } } } catch (e6) { r4 = { error: e6 }; } finally { try { s3 && !s3.done && (n3 = a3.return) && n3.call(a3); } finally { if (r4) throw r4.error; } } return i3; }, t4.prototype.activeHardfork = function(e5, t5) { void 0 === t5 && (t5 = {}); var r4 = this.activeHardforks(e5, t5); if (r4.length > 0) return r4[r4.length - 1].name; throw new Error("No (supported) active hardfork found"); }, t4.prototype.hardforkBlock = function(e5) { var t5 = this.hardforkBlockBN(e5); return (0, y2.toType)(t5, y2.TypeOutput.Number); }, t4.prototype.hardforkBlockBN = function(e5) { e5 = this._chooseHardfork(e5, false); var t5 = this._getHardfork(e5).block; return null == t5 ? null : new y2.BN(t5); }, t4.prototype.hardforkTD = function(e5) { e5 = this._chooseHardfork(e5, false); var t5 = this._getHardfork(e5).td; return null == t5 ? null : new y2.BN(t5); }, t4.prototype.isHardforkBlock = function(e5, t5) { e5 = (0, y2.toType)(e5, y2.TypeOutput.BN), t5 = this._chooseHardfork(t5, false); var r4 = this.hardforkBlockBN(t5); return !!r4 && r4.eq(e5); }, t4.prototype.nextHardforkBlock = function(e5) { var t5 = this.nextHardforkBlockBN(e5); return (0, y2.toType)(t5, y2.TypeOutput.Number); }, t4.prototype.nextHardforkBlockBN = function(e5) { e5 = this._chooseHardfork(e5, false); var t5 = this.hardforkBlockBN(e5); return null === t5 ? null : this.hardforks().reduce(function(e6, r4) { var n3 = new y2.BN(r4.block); return n3.gt(t5) && null === e6 ? n3 : e6; }, null); }, t4.prototype.isNextHardforkBlock = function(e5, t5) { e5 = (0, y2.toType)(e5, y2.TypeOutput.BN), t5 = this._chooseHardfork(t5, false); var r4 = this.nextHardforkBlockBN(t5); return null !== r4 && r4.eq(e5); }, t4.prototype._calcForkHash = function(e5) { var t5, r4, n3 = i2.from(this.genesis().hash.substr(2), "hex"), o3 = i2.alloc(0), a3 = 0; try { for (var s3 = u2(this.hardforks()), c3 = s3.next(); !c3.done; c3 = s3.next()) { var f3 = c3.value, d3 = f3.block; if (0 !== d3 && null !== d3 && d3 !== a3) { var l3 = i2.from(d3.toString(16).padStart(16, "0"), "hex"); o3 = i2.concat([o3, l3]); } if (f3.name === e5) break; null !== d3 && (a3 = d3); } } catch (e6) { t5 = { error: e6 }; } finally { try { c3 && !c3.done && (r4 = s3.return) && r4.call(s3); } finally { if (t5) throw t5.error; } } var h3 = i2.concat([n3, o3]), p3 = (0, y2.intToBuffer)((0, b2.buf)(h3) >>> 0).toString("hex"); return "0x".concat(p3); }, t4.prototype.forkHash = function(e5) { e5 = this._chooseHardfork(e5, false); var t5 = this._getHardfork(e5); if (null === t5.block && void 0 === t5.td) throw new Error("No fork hash calculation possible for future hardfork"); return void 0 !== t5.forkHash ? t5.forkHash : this._calcForkHash(e5); }, t4.prototype.hardforkForForkHash = function(e5) { var t5 = this.hardforks().filter(function(t6) { return t6.forkHash === e5; }); return t5.length >= 1 ? t5[t5.length - 1] : null; }, t4.prototype.genesis = function() { return this._chainParams.genesis; }, t4.prototype.genesisState = function() { var e5, t5; switch (this.chainName()) { case "mainnet": return r3(Object(function() { var e6 = new Error("Cannot find module './genesisStates/mainnet.json'"); throw e6.code = "MODULE_NOT_FOUND", e6; }())); case "ropsten": return r3(Object(function() { var e6 = new Error("Cannot find module './genesisStates/ropsten.json'"); throw e6.code = "MODULE_NOT_FOUND", e6; }())); case "rinkeby": return r3(Object(function() { var e6 = new Error("Cannot find module './genesisStates/rinkeby.json'"); throw e6.code = "MODULE_NOT_FOUND", e6; }())); case "kovan": return r3(Object(function() { var e6 = new Error("Cannot find module './genesisStates/kovan.json'"); throw e6.code = "MODULE_NOT_FOUND", e6; }())); case "goerli": return r3(Object(function() { var e6 = new Error("Cannot find module './genesisStates/goerli.json'"); throw e6.code = "MODULE_NOT_FOUND", e6; }())); case "sepolia": return r3(Object(function() { var e6 = new Error("Cannot find module './genesisStates/sepolia.json'"); throw e6.code = "MODULE_NOT_FOUND", e6; }())); } if (this._customChains && this._customChains.length > 0 && Array.isArray(this._customChains[0])) try { for (var n3 = u2(this._customChains), i3 = n3.next(); !i3.done; i3 = n3.next()) { var o3 = i3.value; if (o3[0].name === this.chainName()) return o3[1]; } } catch (t6) { e5 = { error: t6 }; } finally { try { i3 && !i3.done && (t5 = n3.return) && t5.call(n3); } finally { if (e5) throw e5.error; } } return {}; }, t4.prototype.hardforks = function() { return this._chainParams.hardforks; }, t4.prototype.bootstrapNodes = function() { return this._chainParams.bootstrapNodes; }, t4.prototype.dnsNetworks = function() { return this._chainParams.dnsNetworks; }, t4.prototype.hardfork = function() { return this._hardfork; }, t4.prototype.chainId = function() { return (0, y2.toType)(this.chainIdBN(), y2.TypeOutput.Number); }, t4.prototype.chainIdBN = function() { return new y2.BN(this._chainParams.chainId); }, t4.prototype.chainName = function() { return this._chainParams.name; }, t4.prototype.networkId = function() { return (0, y2.toType)(this.networkIdBN(), y2.TypeOutput.Number); }, t4.prototype.networkIdBN = function() { return new y2.BN(this._chainParams.networkId); }, t4.prototype.eips = function() { return this._eips; }, t4.prototype.consensusType = function() { var e5, t5, r4, n3 = this.hardfork(); try { for (var i3 = u2(m2.hardforks), o3 = i3.next(); !o3.done; o3 = i3.next()) { var a3 = o3.value; if ("consensus" in a3[1] && (r4 = a3[1].consensus.type), a3[0] === n3) break; } } catch (t6) { e5 = { error: t6 }; } finally { try { o3 && !o3.done && (t5 = i3.return) && t5.call(i3); } finally { if (e5) throw e5.error; } } return r4 || this._chainParams.consensus.type; }, t4.prototype.consensusAlgorithm = function() { var e5, t5, r4, n3 = this.hardfork(); try { for (var i3 = u2(m2.hardforks), o3 = i3.next(); !o3.done; o3 = i3.next()) { var a3 = o3.value; if ("consensus" in a3[1] && (r4 = a3[1].consensus.algorithm), a3[0] === n3) break; } } catch (t6) { e5 = { error: t6 }; } finally { try { o3 && !o3.done && (t5 = i3.return) && t5.call(i3); } finally { if (e5) throw e5.error; } } return r4 || this._chainParams.consensus.algorithm; }, t4.prototype.consensusConfig = function() { var e5, t5, r4, n3 = this.hardfork(); try { for (var i3 = u2(m2.hardforks), o3 = i3.next(); !o3.done; o3 = i3.next()) { var a3 = o3.value; if ("consensus" in a3[1] && (r4 = a3[1].consensus[a3[1].consensus.algorithm]), a3[0] === n3) break; } } catch (t6) { e5 = { error: t6 }; } finally { try { o3 && !o3.done && (t5 = i3.return) && t5.call(i3); } finally { if (e5) throw e5.error; } } if (r4) return r4; var s3 = this.consensusAlgorithm(); return this._chainParams.consensus[s3]; }, t4.prototype.copy = function() { var e5 = Object.assign(Object.create(Object.getPrototypeOf(this)), this); return e5.removeAllListeners(), e5; }, t4; }(p2.EventEmitter); t3.default = w2; }, 89658: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)); function i2(e4) { if (Array.isArray(e4)) { for (var t4 = [], r4 = 0, n3 = 0; n3 < e4.length; n3++) { var o3 = i2(e4[n3]); t4.push(o3), r4 += o3.length; } return p2.apply(void 0, [s2(r4, 192)].concat(t4)); } var a3 = m2(e4); return 1 === a3.length && a3[0] < 128 ? a3 : p2(s2(a3.length, 128), a3); } function o2(e4, t4, r4) { if (r4 > e4.length) throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds"); return e4.slice(t4, r4); } function a2(e4) { if (0 === e4[0]) throw new Error("invalid RLP: extra zeros"); return l2(d2(e4)); } function s2(e4, t4) { if (e4 < 56) return Uint8Array.from([e4 + t4]); var r4 = y2(e4), n3 = y2(t4 + 55 + r4.length / 2); return Uint8Array.from(h2(n3 + r4)); } function u2(e4) { var t4 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; if (null == e4 || 0 === e4.length) return Uint8Array.from([]); var r4 = c2(m2(e4)); if (t4) return r4; if (0 !== r4.remainder.length) throw new Error("invalid RLP: remainder must be zero"); return r4.data; } function c2(e4) { var t4, r4, n3, i3, s3, u3 = [], f3 = e4[0]; if (f3 <= 127) return { data: e4.slice(0, 1), remainder: e4.slice(1) }; if (f3 <= 183) { if (t4 = f3 - 127, n3 = 128 === f3 ? Uint8Array.from([]) : o2(e4, 1, t4), 2 === t4 && n3[0] < 128) throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed"); return { data: n3, remainder: e4.slice(t4) }; } if (f3 <= 191) { if (r4 = f3 - 182, e4.length - 1 < r4) throw new Error("invalid RLP: not enough bytes for string length"); if ((t4 = a2(o2(e4, 1, r4))) <= 55) throw new Error("invalid RLP: expected string length to be greater than 55"); return { data: n3 = o2(e4, r4, t4 + r4), remainder: e4.slice(t4 + r4) }; } if (f3 <= 247) { for (i3 = o2(e4, 1, t4 = f3 - 191); i3.length; ) s3 = c2(i3), u3.push(s3.data), i3 = s3.remainder; return { data: u3, remainder: e4.slice(t4) }; } if ((t4 = a2(o2(e4, 1, r4 = f3 - 246))) < 56) throw new Error("invalid RLP: encoded list too short"); var d3 = r4 + t4; if (d3 > e4.length) throw new Error("invalid RLP: total length is larger than the data"); for (i3 = o2(e4, r4, d3); i3.length; ) s3 = c2(i3), u3.push(s3.data), i3 = s3.remainder; return { data: u3, remainder: e4.slice(d3) }; } Object.defineProperty(t3, "__esModule", { value: true }), t3.RLP = t3.utils = t3.decode = t3.encode = void 0, t3.encode = i2, t3.decode = u2; var f2 = Array.from({ length: 256 }, function(e4, t4) { return t4.toString(16).padStart(2, "0"); }); function d2(e4) { for (var t4 = "", r4 = 0; r4 < e4.length; r4++) t4 += f2[e4[r4]]; return t4; } function l2(e4) { var t4 = Number.parseInt(e4, 16); if (Number.isNaN(t4)) throw new Error("Invalid byte sequence"); return t4; } function h2(e4) { if ("string" != typeof e4) throw new TypeError("hexToBytes: expected string, got " + (0, n2.default)(e4)); if (e4.length % 2) throw new Error("hexToBytes: received invalid unpadded hex"); for (var t4 = new Uint8Array(e4.length / 2), r4 = 0; r4 < t4.length; r4++) { var i3 = 2 * r4; t4[r4] = l2(e4.slice(i3, i3 + 2)); } return t4; } function p2() { for (var e4 = arguments.length, t4 = new Array(e4), r4 = 0; r4 < e4; r4++) t4[r4] = arguments[r4]; if (1 === t4.length) return t4[0]; for (var n3 = t4.reduce(function(e5, t5) { return e5 + t5.length; }, 0), i3 = new Uint8Array(n3), o3 = 0, a3 = 0; o3 < t4.length; o3++) { var s3 = t4[o3]; i3.set(s3, a3), a3 += s3.length; } return i3; } function b2(e4) { return new TextEncoder().encode(e4); } function y2(e4) { if (e4 < 0) throw new Error("Invalid integer as argument, must be unsigned!"); var t4 = e4.toString(16); return t4.length % 2 ? "0".concat(t4) : t4; } function v2(e4) { return e4.length >= 2 && "0" === e4[0] && "x" === e4[1]; } function m2(e4) { if (e4 instanceof Uint8Array) return e4; if ("string" == typeof e4) return v2(e4) ? h2((t4 = "string" != typeof (r4 = e4) ? r4 : v2(r4) ? r4.slice(2) : r4).length % 2 ? "0".concat(t4) : t4) : b2(e4); var t4, r4; if ("number" == typeof e4 || "bigint" == typeof e4) return e4 ? h2(y2(e4)) : Uint8Array.from([]); if (null == e4) return Uint8Array.from([]); throw new Error("toBytes: received unsupported type " + (0, n2.default)(e4)); } t3.utils = { bytesToHex: d2, concatBytes: p2, hexToBytes: h2, utf8ToBytes: b2 }, t3.RLP = { encode: i2, decode: u2 }; }, 75058: (e3, t3, r3) => { var n2 = Object.create ? function(e4, t4, r4, n3) { void 0 === n3 && (n3 = r4); var i3 = Object.getOwnPropertyDescriptor(t4, r4); i3 && !("get" in i3 ? !t4.__esModule : i3.writable || i3.configurable) || (i3 = { enumerable: true, get: function() { return t4[r4]; } }), Object.defineProperty(e4, n3, i3); } : function(e4, t4, r4, n3) { void 0 === n3 && (n3 = r4), e4[n3] = t4[r4]; }, i2 = Object.create ? function(e4, t4) { Object.defineProperty(e4, "default", { enumerable: true, value: t4 }); } : function(e4, t4) { e4.default = t4; }, o2 = function(e4, t4) { var r4 = "function" == typeof Symbol && e4[Symbol.iterator]; if (!r4) return e4; var n3, i3, o3 = r4.call(e4), a3 = []; try { for (; (void 0 === t4 || t4-- > 0) && !(n3 = o3.next()).done; ) a3.push(n3.value); } catch (e5) { i3 = { error: e5 }; } finally { try { n3 && !n3.done && (r4 = o3.return) && r4.call(o3); } finally { if (i3) throw i3.error; } } return a3; }; Object.defineProperty(t3, "__esModule", { value: true }), t3.BaseTransaction = void 0; var a2 = function(e4) { if (e4 && e4.__esModule) return e4; var t4 = {}; if (null != e4) for (var r4 in e4) "default" !== r4 && Object.prototype.hasOwnProperty.call(e4, r4) && n2(t4, e4, r4); return i2(t4, e4), t4; }(r3(3863)), s2 = r3(33062), u2 = r3(87325), c2 = function() { function e4(e5, t4) { this.cache = { hash: void 0, dataFee: void 0 }, this.activeCapabilities = [], this.DEFAULT_CHAIN = a2.Chain.Mainnet, this.DEFAULT_HARDFORK = a2.Hardfork.Istanbul; var r4 = e5.nonce, n3 = e5.gasLimit, i3 = e5.to, o3 = e5.value, u3 = e5.data, c3 = e5.v, f2 = e5.r, d2 = e5.s, l2 = e5.type; this._type = new s2.BN((0, s2.toBuffer)(l2)).toNumber(), this.txOptions = t4; var h2 = (0, s2.toBuffer)("" === i3 ? "0x" : i3), p2 = (0, s2.toBuffer)("" === c3 ? "0x" : c3), b2 = (0, s2.toBuffer)("" === f2 ? "0x" : f2), y2 = (0, s2.toBuffer)("" === d2 ? "0x" : d2); this.nonce = new s2.BN((0, s2.toBuffer)("" === r4 ? "0x" : r4)), this.gasLimit = new s2.BN((0, s2.toBuffer)("" === n3 ? "0x" : n3)), this.to = h2.length > 0 ? new s2.Address(h2) : void 0, this.value = new s2.BN((0, s2.toBuffer)("" === o3 ? "0x" : o3)), this.data = (0, s2.toBuffer)("" === u3 ? "0x" : u3), this.v = p2.length > 0 ? new s2.BN(p2) : void 0, this.r = b2.length > 0 ? new s2.BN(b2) : void 0, this.s = y2.length > 0 ? new s2.BN(y2) : void 0, this._validateCannotExceedMaxInteger({ value: this.value, r: this.r, s: this.s }), this._validateCannotExceedMaxInteger({ gasLimit: this.gasLimit }, 64), this._validateCannotExceedMaxInteger({ nonce: this.nonce }, 64, true); } return Object.defineProperty(e4.prototype, "transactionType", { get: function() { return this.type; }, enumerable: false, configurable: true }), Object.defineProperty(e4.prototype, "type", { get: function() { return this._type; }, enumerable: false, configurable: true }), e4.prototype.supports = function(e5) { return this.activeCapabilities.includes(e5); }, e4.prototype.validate = function(e5) { void 0 === e5 && (e5 = false); var t4 = []; return this.getBaseFee().gt(this.gasLimit) && t4.push("gasLimit is too low. given ".concat(this.gasLimit, ", need at least ").concat(this.getBaseFee())), this.isSigned() && !this.verifySignature() && t4.push("Invalid Signature"), e5 ? t4 : 0 === t4.length; }, e4.prototype.getBaseFee = function() { var e5 = this.getDataFee().addn(this.common.param("gasPrices", "tx")); return this.common.gteHardfork("homestead") && this.toCreationAddress() && e5.iaddn(this.common.param("gasPrices", "txCreation")), e5; }, e4.prototype.getDataFee = function() { for (var e5 = this.common.param("gasPrices", "txDataZero"), t4 = this.common.param("gasPrices", "txDataNonZero"), r4 = 0, n3 = 0; n3 < this.data.length; n3++) 0 === this.data[n3] ? r4 += e5 : r4 += t4; if (r4 = new s2.BN(r4), (void 0 === this.to || null === this.to) && this.common.isActivatedEIP(3860)) { var i3 = Math.ceil(this.data.length / 32), o3 = new s2.BN(this.common.param("gasPrices", "initCodeWordCost")).imuln(i3); r4.iadd(o3); } return r4; }, e4.prototype.toCreationAddress = function() { return void 0 === this.to || 0 === this.to.buf.length; }, e4.prototype.isSigned = function() { var e5 = this, t4 = e5.v, r4 = e5.r, n3 = e5.s; return 0 === this.type ? !!(t4 && r4 && n3) : !(void 0 === t4 || !r4 || !n3); }, e4.prototype.verifySignature = function() { try { var e5 = this.getSenderPublicKey(); return 0 !== (0, s2.unpadBuffer)(e5).length; } catch (e6) { return false; } }, e4.prototype.getSenderAddress = function() { return new s2.Address((0, s2.publicToAddress)(this.getSenderPublicKey())); }, e4.prototype.sign = function(e5) { if (32 !== e5.length) { var t4 = this._errorMsg("Private key must be 32 bytes in length."); throw new Error(t4); } var r4 = false; 0 === this.type && this.common.gteHardfork("spuriousDragon") && !this.supports(u2.Capability.EIP155ReplayProtection) && (this.activeCapabilities.push(u2.Capability.EIP155ReplayProtection), r4 = true); var n3 = this.getMessageToSign(true), i3 = (0, s2.ecsign)(n3, e5), o3 = i3.v, a3 = i3.r, c3 = i3.s, f2 = this._processSignature(o3, a3, c3); if (r4) { var d2 = this.activeCapabilities.indexOf(u2.Capability.EIP155ReplayProtection); d2 > -1 && this.activeCapabilities.splice(d2, 1); } return f2; }, e4.prototype._getCommon = function(e5, t4) { var r4; if (t4) { var n3 = new s2.BN((0, s2.toBuffer)(t4)); if (e5) { if (!e5.chainIdBN().eq(n3)) { var i3 = this._errorMsg("The chain ID does not match the chain ID of Common"); throw new Error(i3); } return e5.copy(); } return a2.default.isSupportedChainId(n3) ? new a2.default({ chain: n3, hardfork: this.DEFAULT_HARDFORK }) : a2.default.forCustomChain(this.DEFAULT_CHAIN, { name: "custom-chain", networkId: n3, chainId: n3 }, this.DEFAULT_HARDFORK); } return null !== (r4 = null == e5 ? void 0 : e5.copy()) && void 0 !== r4 ? r4 : new a2.default({ chain: this.DEFAULT_CHAIN, hardfork: this.DEFAULT_HARDFORK }); }, e4.prototype._validateCannotExceedMaxInteger = function(e5, t4, r4) { var n3, i3; void 0 === t4 && (t4 = 256), void 0 === r4 && (r4 = false); try { for (var a3 = function(e6) { var t5 = "function" == typeof Symbol && Symbol.iterator, r5 = t5 && e6[t5], n4 = 0; if (r5) return r5.call(e6); if (e6 && "number" == typeof e6.length) return { next: function() { return e6 && n4 >= e6.length && (e6 = void 0), { value: e6 && e6[n4++], done: !e6 }; } }; throw new TypeError(t5 ? "Object is not iterable." : "Symbol.iterator is not defined."); }(Object.entries(e5)), u3 = a3.next(); !u3.done; u3 = a3.next()) { var c3 = o2(u3.value, 2), f2 = c3[0], d2 = c3[1]; switch (t4) { case 64: if (r4) { if (null == d2 ? void 0 : d2.gte(s2.MAX_UINT64)) { var l2 = this._errorMsg("".concat(f2, " cannot equal or exceed MAX_UINT64 (2^64-1), given ").concat(d2)); throw new Error(l2); } } else if (null == d2 ? void 0 : d2.gt(s2.MAX_UINT64)) throw l2 = this._errorMsg("".concat(f2, " cannot exceed MAX_UINT64 (2^64-1), given ").concat(d2)), new Error(l2); break; case 256: if (r4) { if (null == d2 ? void 0 : d2.gte(s2.MAX_INTEGER)) throw l2 = this._errorMsg("".concat(f2, " cannot equal or exceed MAX_INTEGER (2^256-1), given ").concat(d2)), new Error(l2); } else if (null == d2 ? void 0 : d2.gt(s2.MAX_INTEGER)) throw l2 = this._errorMsg("".concat(f2, " cannot exceed MAX_INTEGER (2^256-1), given ").concat(d2)), new Error(l2); break; default: throw l2 = this._errorMsg("unimplemented bits value"), new Error(l2); } } } catch (e6) { n3 = { error: e6 }; } finally { try { u3 && !u3.done && (i3 = a3.return) && i3.call(a3); } finally { if (n3) throw n3.error; } } }, e4.prototype._getSharedErrorPostfix = function() { var e5 = ""; try { e5 = this.isSigned() ? (0, s2.bufferToHex)(this.hash()) : "not available (unsigned)"; } catch (t5) { e5 = "error"; } var t4 = ""; try { t4 = this.isSigned().toString(); } catch (t5) { e5 = "error"; } var r4 = ""; try { r4 = this.common.hardfork(); } catch (e6) { r4 = "error"; } return "tx type=".concat(this.type, " hash=").concat(e5, " nonce=").concat(this.nonce, " value=").concat(this.value, " ") + "signed=".concat(t4, " hf=").concat(r4); }, e4; }(); t3.BaseTransaction = c2; }, 660: (e3, t3, r3) => { var n2, i2 = r3(29033).Buffer, o2 = (n2 = function(e4, t4) { return n2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e5, t5) { e5.__proto__ = t5; } || function(e5, t5) { for (var r4 in t5) Object.prototype.hasOwnProperty.call(t5, r4) && (e5[r4] = t5[r4]); }, n2(e4, t4); }, function(e4, t4) { if ("function" != typeof t4 && null !== t4) throw new TypeError("Class extends value " + String(t4) + " is not a constructor or null"); function r4() { this.constructor = e4; } n2(e4, t4), e4.prototype = null === t4 ? Object.create(t4) : (r4.prototype = t4.prototype, new r4()); }), a2 = function() { return a2 = Object.assign || function(e4) { for (var t4, r4 = 1, n3 = arguments.length; r4 < n3; r4++) for (var i3 in t4 = arguments[r4]) Object.prototype.hasOwnProperty.call(t4, i3) && (e4[i3] = t4[i3]); return e4; }, a2.apply(this, arguments); }; Object.defineProperty(t3, "__esModule", { value: true }); var s2 = r3(33062), u2 = r3(75058), c2 = r3(87325), f2 = r3(53789), d2 = i2.from(2 .toString(16).padStart(2, "0"), "hex"), l2 = function(e4) { function t4(t5, r4) { void 0 === r4 && (r4 = {}); var n3, i3, o3 = this; (o3 = e4.call(this, a2(a2({}, t5), { type: 2 }), r4) || this).DEFAULT_HARDFORK = "london"; var u3 = t5.chainId, d3 = t5.accessList, l3 = t5.maxFeePerGas, h2 = t5.maxPriorityFeePerGas; if (o3.common = o3._getCommon(r4.common, u3), o3.chainId = o3.common.chainIdBN(), !o3.common.isActivatedEIP(1559)) throw new Error("EIP-1559 not enabled on Common"); o3.activeCapabilities = o3.activeCapabilities.concat([1559, 2718, 2930]); var p2 = f2.AccessLists.getAccessListData(null != d3 ? d3 : []); if (o3.accessList = p2.accessList, o3.AccessListJSON = p2.AccessListJSON, f2.AccessLists.verifyAccessList(o3.accessList), o3.maxFeePerGas = new s2.BN((0, s2.toBuffer)("" === l3 ? "0x" : l3)), o3.maxPriorityFeePerGas = new s2.BN((0, s2.toBuffer)("" === h2 ? "0x" : h2)), o3._validateCannotExceedMaxInteger({ maxFeePerGas: o3.maxFeePerGas, maxPriorityFeePerGas: o3.maxPriorityFeePerGas }), o3.gasLimit.mul(o3.maxFeePerGas).gt(s2.MAX_INTEGER)) { var b2 = o3._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)"); throw new Error(b2); } if (o3.maxFeePerGas.lt(o3.maxPriorityFeePerGas)) throw b2 = o3._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)"), new Error(b2); if (o3.v && !o3.v.eqn(0) && !o3.v.eqn(1)) throw b2 = o3._errorMsg("The y-parity of the transaction should either be 0 or 1"), new Error(b2); if (o3.common.gteHardfork("homestead") && (null === (n3 = o3.s) || void 0 === n3 ? void 0 : n3.gt(c2.N_DIV_2))) throw b2 = o3._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid"), new Error(b2); return o3.common.isActivatedEIP(3860) && (0, f2.checkMaxInitCodeSize)(o3.common, o3.data.length), (null === (i3 = null == r4 ? void 0 : r4.freeze) || void 0 === i3 || i3) && Object.freeze(o3), o3; } return o2(t4, e4), Object.defineProperty(t4.prototype, "senderR", { get: function() { return this.r; }, enumerable: false, configurable: true }), Object.defineProperty(t4.prototype, "senderS", { get: function() { return this.s; }, enumerable: false, configurable: true }), Object.defineProperty(t4.prototype, "yParity", { get: function() { return this.v; }, enumerable: false, configurable: true }), t4.fromTxData = function(e5, r4) { return void 0 === r4 && (r4 = {}), new t4(e5, r4); }, t4.fromSerializedTx = function(e5, r4) { if (void 0 === r4 && (r4 = {}), !e5.slice(0, 1).equals(d2)) throw new Error("Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ".concat(2, ", received: ").concat(e5.slice(0, 1).toString("hex"))); var n3 = s2.rlp.decode(e5.slice(1)); if (!Array.isArray(n3)) throw new Error("Invalid serialized tx input: must be array"); return t4.fromValuesArray(n3, r4); }, t4.fromRlpSerializedTx = function(e5, r4) { return void 0 === r4 && (r4 = {}), t4.fromSerializedTx(e5, r4); }, t4.fromValuesArray = function(e5, r4) { if (void 0 === r4 && (r4 = {}), 9 !== e5.length && 12 !== e5.length) throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx)."); var n3 = function(e6, t5) { var r5 = "function" == typeof Symbol && e6[Symbol.iterator]; if (!r5) return e6; var n4, i4, o4 = r5.call(e6), a4 = []; try { for (; (void 0 === t5 || t5-- > 0) && !(n4 = o4.next()).done; ) a4.push(n4.value); } catch (e7) { i4 = { error: e7 }; } finally { try { n4 && !n4.done && (r5 = o4.return) && r5.call(o4); } finally { if (i4) throw i4.error; } } return a4; }(e5, 12), i3 = n3[0], o3 = n3[1], a3 = n3[2], u3 = n3[3], c3 = n3[4], f3 = n3[5], d3 = n3[6], l3 = n3[7], h2 = n3[8], p2 = n3[9], b2 = n3[10], y2 = n3[11]; return (0, s2.validateNoLeadingZeroes)({ nonce: o3, maxPriorityFeePerGas: a3, maxFeePerGas: u3, gasLimit: c3, value: d3, v: p2, r: b2, s: y2 }), new t4({ chainId: new s2.BN(i3), nonce: o3, maxPriorityFeePerGas: a3, maxFeePerGas: u3, gasLimit: c3, to: f3, value: d3, data: l3, accessList: null != h2 ? h2 : [], v: void 0 !== p2 ? new s2.BN(p2) : void 0, r: b2, s: y2 }, r4); }, t4.prototype.getDataFee = function() { if (this.cache.dataFee && this.cache.dataFee.hardfork === this.common.hardfork()) return this.cache.dataFee.value; var t5 = e4.prototype.getDataFee.call(this); return t5.iaddn(f2.AccessLists.getDataFeeEIP2930(this.accessList, this.common)), Object.isFrozen(this) && (this.cache.dataFee = { value: t5, hardfork: this.common.hardfork() }), t5; }, t4.prototype.getUpfrontCost = function(e5) { void 0 === e5 && (e5 = new s2.BN(0)); var t5 = s2.BN.min(this.maxPriorityFeePerGas, this.maxFeePerGas.sub(e5)).add(e5); return this.gasLimit.mul(t5).add(this.value); }, t4.prototype.raw = function() { return [(0, s2.bnToUnpaddedBuffer)(this.chainId), (0, s2.bnToUnpaddedBuffer)(this.nonce), (0, s2.bnToUnpaddedBuffer)(this.maxPriorityFeePerGas), (0, s2.bnToUnpaddedBuffer)(this.maxFeePerGas), (0, s2.bnToUnpaddedBuffer)(this.gasLimit), void 0 !== this.to ? this.to.buf : i2.from([]), (0, s2.bnToUnpaddedBuffer)(this.value), this.data, this.accessList, void 0 !== this.v ? (0, s2.bnToUnpaddedBuffer)(this.v) : i2.from([]), void 0 !== this.r ? (0, s2.bnToUnpaddedBuffer)(this.r) : i2.from([]), void 0 !== this.s ? (0, s2.bnToUnpaddedBuffer)(this.s) : i2.from([])]; }, t4.prototype.serialize = function() { var e5 = this.raw(); return i2.concat([d2, s2.rlp.encode(e5)]); }, t4.prototype.getMessageToSign = function(e5) { void 0 === e5 && (e5 = true); var t5 = this.raw().slice(0, 9), r4 = i2.concat([d2, s2.rlp.encode(t5)]); return e5 ? (0, s2.keccak256)(r4) : r4; }, t4.prototype.hash = function() { if (!this.isSigned()) { var e5 = this._errorMsg("Cannot call hash method if transaction is not signed"); throw new Error(e5); } return Object.isFrozen(this) ? (this.cache.hash || (this.cache.hash = (0, s2.keccak256)(this.serialize())), this.cache.hash) : (0, s2.keccak256)(this.serialize()); }, t4.prototype.getMessageToVerifySignature = function() { return this.getMessageToSign(); }, t4.prototype.getSenderPublicKey = function() { var e5; if (!this.isSigned()) { var t5 = this._errorMsg("Cannot call this method if transaction is not signed"); throw new Error(t5); } var r4 = this.getMessageToVerifySignature(); if (this.common.gteHardfork("homestead") && (null === (e5 = this.s) || void 0 === e5 ? void 0 : e5.gt(c2.N_DIV_2))) throw t5 = this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid"), new Error(t5); var n3 = this, i3 = n3.v, o3 = n3.r, a3 = n3.s; try { return (0, s2.ecrecover)(r4, i3.addn(27), (0, s2.bnToUnpaddedBuffer)(o3), (0, s2.bnToUnpaddedBuffer)(a3)); } catch (e6) { throw t5 = this._errorMsg("Invalid Signature"), new Error(t5); } }, t4.prototype._processSignature = function(e5, r4, n3) { var i3 = a2(a2({}, this.txOptions), { common: this.common }); return t4.fromTxData({ chainId: this.chainId, nonce: this.nonce, maxPriorityFeePerGas: this.maxPriorityFeePerGas, maxFeePerGas: this.maxFeePerGas, gasLimit: this.gasLimit, to: this.to, value: this.value, data: this.data, accessList: this.accessList, v: new s2.BN(e5 - 27), r: new s2.BN(r4), s: new s2.BN(n3) }, i3); }, t4.prototype.toJSON = function() { var e5 = f2.AccessLists.getAccessListJSON(this.accessList); return { chainId: (0, s2.bnToHex)(this.chainId), nonce: (0, s2.bnToHex)(this.nonce), maxPriorityFeePerGas: (0, s2.bnToHex)(this.maxPriorityFeePerGas), maxFeePerGas: (0, s2.bnToHex)(this.maxFeePerGas), gasLimit: (0, s2.bnToHex)(this.gasLimit), to: void 0 !== this.to ? this.to.toString() : void 0, value: (0, s2.bnToHex)(this.value), data: "0x" + this.data.toString("hex"), accessList: e5, v: void 0 !== this.v ? (0, s2.bnToHex)(this.v) : void 0, r: void 0 !== this.r ? (0, s2.bnToHex)(this.r) : void 0, s: void 0 !== this.s ? (0, s2.bnToHex)(this.s) : void 0 }; }, t4.prototype.errorStr = function() { return this._getSharedErrorPostfix() + " maxFeePerGas=".concat(this.maxFeePerGas, " maxPriorityFeePerGas=").concat(this.maxPriorityFeePerGas); }, t4.prototype._errorMsg = function(e5) { return "".concat(e5, " (").concat(this.errorStr(), ")"); }, t4; }(u2.BaseTransaction); t3.default = l2; }, 97613: (e3, t3, r3) => { var n2, i2 = r3(29033).Buffer, o2 = (n2 = function(e4, t4) { return n2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e5, t5) { e5.__proto__ = t5; } || function(e5, t5) { for (var r4 in t5) Object.prototype.hasOwnProperty.call(t5, r4) && (e5[r4] = t5[r4]); }, n2(e4, t4); }, function(e4, t4) { if ("function" != typeof t4 && null !== t4) throw new TypeError("Class extends value " + String(t4) + " is not a constructor or null"); function r4() { this.constructor = e4; } n2(e4, t4), e4.prototype = null === t4 ? Object.create(t4) : (r4.prototype = t4.prototype, new r4()); }), a2 = function() { return a2 = Object.assign || function(e4) { for (var t4, r4 = 1, n3 = arguments.length; r4 < n3; r4++) for (var i3 in t4 = arguments[r4]) Object.prototype.hasOwnProperty.call(t4, i3) && (e4[i3] = t4[i3]); return e4; }, a2.apply(this, arguments); }; Object.defineProperty(t3, "__esModule", { value: true }); var s2 = r3(33062), u2 = r3(75058), c2 = r3(87325), f2 = r3(53789), d2 = i2.from(1 .toString(16).padStart(2, "0"), "hex"), l2 = function(e4) { function t4(t5, r4) { void 0 === r4 && (r4 = {}); var n3, i3, o3 = this; (o3 = e4.call(this, a2(a2({}, t5), { type: 1 }), r4) || this).DEFAULT_HARDFORK = "berlin"; var u3 = t5.chainId, d3 = t5.accessList, l3 = t5.gasPrice; if (o3.common = o3._getCommon(r4.common, u3), o3.chainId = o3.common.chainIdBN(), !o3.common.isActivatedEIP(2930)) throw new Error("EIP-2930 not enabled on Common"); o3.activeCapabilities = o3.activeCapabilities.concat([2718, 2930]); var h2 = f2.AccessLists.getAccessListData(null != d3 ? d3 : []); if (o3.accessList = h2.accessList, o3.AccessListJSON = h2.AccessListJSON, f2.AccessLists.verifyAccessList(o3.accessList), o3.gasPrice = new s2.BN((0, s2.toBuffer)("" === l3 ? "0x" : l3)), o3._validateCannotExceedMaxInteger({ gasPrice: o3.gasPrice }), o3.gasPrice.mul(o3.gasLimit).gt(s2.MAX_INTEGER)) { var p2 = o3._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER"); throw new Error(p2); } if (o3.v && !o3.v.eqn(0) && !o3.v.eqn(1)) throw p2 = o3._errorMsg("The y-parity of the transaction should either be 0 or 1"), new Error(p2); if (o3.common.gteHardfork("homestead") && (null === (n3 = o3.s) || void 0 === n3 ? void 0 : n3.gt(c2.N_DIV_2))) throw p2 = o3._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid"), new Error(p2); return o3.common.isActivatedEIP(3860) && (0, f2.checkMaxInitCodeSize)(o3.common, o3.data.length), (null === (i3 = null == r4 ? void 0 : r4.freeze) || void 0 === i3 || i3) && Object.freeze(o3), o3; } return o2(t4, e4), Object.defineProperty(t4.prototype, "senderR", { get: function() { return this.r; }, enumerable: false, configurable: true }), Object.defineProperty(t4.prototype, "senderS", { get: function() { return this.s; }, enumerable: false, configurable: true }), Object.defineProperty(t4.prototype, "yParity", { get: function() { return this.v; }, enumerable: false, configurable: true }), t4.fromTxData = function(e5, r4) { return void 0 === r4 && (r4 = {}), new t4(e5, r4); }, t4.fromSerializedTx = function(e5, r4) { if (void 0 === r4 && (r4 = {}), !e5.slice(0, 1).equals(d2)) throw new Error("Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ".concat(1, ", received: ").concat(e5.slice(0, 1).toString("hex"))); var n3 = s2.rlp.decode(e5.slice(1)); if (!Array.isArray(n3)) throw new Error("Invalid serialized tx input: must be array"); return t4.fromValuesArray(n3, r4); }, t4.fromRlpSerializedTx = function(e5, r4) { return void 0 === r4 && (r4 = {}), t4.fromSerializedTx(e5, r4); }, t4.fromValuesArray = function(e5, r4) { if (void 0 === r4 && (r4 = {}), 8 !== e5.length && 11 !== e5.length) throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx)."); var n3 = function(e6, t5) { var r5 = "function" == typeof Symbol && e6[Symbol.iterator]; if (!r5) return e6; var n4, i4, o4 = r5.call(e6), a4 = []; try { for (; (void 0 === t5 || t5-- > 0) && !(n4 = o4.next()).done; ) a4.push(n4.value); } catch (e7) { i4 = { error: e7 }; } finally { try { n4 && !n4.done && (r5 = o4.return) && r5.call(o4); } finally { if (i4) throw i4.error; } } return a4; }(e5, 11), i3 = n3[0], o3 = n3[1], a3 = n3[2], u3 = n3[3], c3 = n3[4], f3 = n3[5], d3 = n3[6], l3 = n3[7], h2 = n3[8], p2 = n3[9], b2 = n3[10]; return (0, s2.validateNoLeadingZeroes)({ nonce: o3, gasPrice: a3, gasLimit: u3, value: f3, v: h2, r: p2, s: b2 }), new t4({ chainId: new s2.BN(i3), nonce: o3, gasPrice: a3, gasLimit: u3, to: c3, value: f3, data: d3, accessList: null != l3 ? l3 : [], v: void 0 !== h2 ? new s2.BN(h2) : void 0, r: p2, s: b2 }, r4); }, t4.prototype.getDataFee = function() { if (this.cache.dataFee && this.cache.dataFee.hardfork === this.common.hardfork()) return this.cache.dataFee.value; var t5 = e4.prototype.getDataFee.call(this); return t5.iaddn(f2.AccessLists.getDataFeeEIP2930(this.accessList, this.common)), Object.isFrozen(this) && (this.cache.dataFee = { value: t5, hardfork: this.common.hardfork() }), t5; }, t4.prototype.getUpfrontCost = function() { return this.gasLimit.mul(this.gasPrice).add(this.value); }, t4.prototype.raw = function() { return [(0, s2.bnToUnpaddedBuffer)(this.chainId), (0, s2.bnToUnpaddedBuffer)(this.nonce), (0, s2.bnToUnpaddedBuffer)(this.gasPrice), (0, s2.bnToUnpaddedBuffer)(this.gasLimit), void 0 !== this.to ? this.to.buf : i2.from([]), (0, s2.bnToUnpaddedBuffer)(this.value), this.data, this.accessList, void 0 !== this.v ? (0, s2.bnToUnpaddedBuffer)(this.v) : i2.from([]), void 0 !== this.r ? (0, s2.bnToUnpaddedBuffer)(this.r) : i2.from([]), void 0 !== this.s ? (0, s2.bnToUnpaddedBuffer)(this.s) : i2.from([])]; }, t4.prototype.serialize = function() { var e5 = this.raw(); return i2.concat([d2, s2.rlp.encode(e5)]); }, t4.prototype.getMessageToSign = function(e5) { void 0 === e5 && (e5 = true); var t5 = this.raw().slice(0, 8), r4 = i2.concat([d2, s2.rlp.encode(t5)]); return e5 ? (0, s2.keccak256)(r4) : r4; }, t4.prototype.hash = function() { if (!this.isSigned()) { var e5 = this._errorMsg("Cannot call hash method if transaction is not signed"); throw new Error(e5); } return Object.isFrozen(this) ? (this.cache.hash || (this.cache.hash = (0, s2.keccak256)(this.serialize())), this.cache.hash) : (0, s2.keccak256)(this.serialize()); }, t4.prototype.getMessageToVerifySignature = function() { return this.getMessageToSign(); }, t4.prototype.getSenderPublicKey = function() { var e5; if (!this.isSigned()) { var t5 = this._errorMsg("Cannot call this method if transaction is not signed"); throw new Error(t5); } var r4 = this.getMessageToVerifySignature(); if (this.common.gteHardfork("homestead") && (null === (e5 = this.s) || void 0 === e5 ? void 0 : e5.gt(c2.N_DIV_2))) throw t5 = this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid"), new Error(t5); var n3 = this, i3 = n3.yParity, o3 = n3.r, a3 = n3.s; try { return (0, s2.ecrecover)(r4, i3.addn(27), (0, s2.bnToUnpaddedBuffer)(o3), (0, s2.bnToUnpaddedBuffer)(a3)); } catch (e6) { throw t5 = this._errorMsg("Invalid Signature"), new Error(t5); } }, t4.prototype._processSignature = function(e5, r4, n3) { var i3 = a2(a2({}, this.txOptions), { common: this.common }); return t4.fromTxData({ chainId: this.chainId, nonce: this.nonce, gasPrice: this.gasPrice, gasLimit: this.gasLimit, to: this.to, value: this.value, data: this.data, accessList: this.accessList, v: new s2.BN(e5 - 27), r: new s2.BN(r4), s: new s2.BN(n3) }, i3); }, t4.prototype.toJSON = function() { var e5 = f2.AccessLists.getAccessListJSON(this.accessList); return { chainId: (0, s2.bnToHex)(this.chainId), nonce: (0, s2.bnToHex)(this.nonce), gasPrice: (0, s2.bnToHex)(this.gasPrice), gasLimit: (0, s2.bnToHex)(this.gasLimit), to: void 0 !== this.to ? this.to.toString() : void 0, value: (0, s2.bnToHex)(this.value), data: "0x" + this.data.toString("hex"), accessList: e5, v: void 0 !== this.v ? (0, s2.bnToHex)(this.v) : void 0, r: void 0 !== this.r ? (0, s2.bnToHex)(this.r) : void 0, s: void 0 !== this.s ? (0, s2.bnToHex)(this.s) : void 0 }; }, t4.prototype.errorStr = function() { var e5, t5; return this._getSharedErrorPostfix() + " gasPrice=".concat(this.gasPrice, " accessListCount=").concat(null !== (t5 = null === (e5 = this.accessList) || void 0 === e5 ? void 0 : e5.length) && void 0 !== t5 ? t5 : 0); }, t4.prototype._errorMsg = function(e5) { return "".concat(e5, " (").concat(this.errorStr(), ")"); }, t4; }(u2.BaseTransaction); t3.default = l2; }, 42339: (e3, t3, r3) => { var n2 = Object.create ? function(e4, t4, r4, n3) { void 0 === n3 && (n3 = r4); var i3 = Object.getOwnPropertyDescriptor(t4, r4); i3 && !("get" in i3 ? !t4.__esModule : i3.writable || i3.configurable) || (i3 = { enumerable: true, get: function() { return t4[r4]; } }), Object.defineProperty(e4, n3, i3); } : function(e4, t4, r4, n3) { void 0 === n3 && (n3 = r4), e4[n3] = t4[r4]; }, i2 = function(e4) { return e4 && e4.__esModule ? e4 : { default: e4 }; }; Object.defineProperty(t3, "__esModule", { value: true }), t3.FeeMarketEIP1559Transaction = t3.TransactionFactory = t3.AccessListEIP2930Transaction = t3.Transaction = void 0; var o2 = r3(53088); Object.defineProperty(t3, "Transaction", { enumerable: true, get: function() { return i2(o2).default; } }); var a2 = r3(97613); Object.defineProperty(t3, "AccessListEIP2930Transaction", { enumerable: true, get: function() { return i2(a2).default; } }); var s2 = r3(89562); Object.defineProperty(t3, "TransactionFactory", { enumerable: true, get: function() { return i2(s2).default; } }); var u2 = r3(660); Object.defineProperty(t3, "FeeMarketEIP1559Transaction", { enumerable: true, get: function() { return i2(u2).default; } }), function(e4, t4) { for (var r4 in e4) "default" === r4 || Object.prototype.hasOwnProperty.call(t4, r4) || n2(t4, e4, r4); }(r3(87325), t3); }, 53088: (e3, t3, r3) => { var n2, i2 = r3(29033).Buffer, o2 = (n2 = function(e4, t4) { return n2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e5, t5) { e5.__proto__ = t5; } || function(e5, t5) { for (var r4 in t5) Object.prototype.hasOwnProperty.call(t5, r4) && (e5[r4] = t5[r4]); }, n2(e4, t4); }, function(e4, t4) { if ("function" != typeof t4 && null !== t4) throw new TypeError("Class extends value " + String(t4) + " is not a constructor or null"); function r4() { this.constructor = e4; } n2(e4, t4), e4.prototype = null === t4 ? Object.create(t4) : (r4.prototype = t4.prototype, new r4()); }), a2 = function() { return a2 = Object.assign || function(e4) { for (var t4, r4 = 1, n3 = arguments.length; r4 < n3; r4++) for (var i3 in t4 = arguments[r4]) Object.prototype.hasOwnProperty.call(t4, i3) && (e4[i3] = t4[i3]); return e4; }, a2.apply(this, arguments); }; Object.defineProperty(t3, "__esModule", { value: true }); var s2 = r3(33062), u2 = r3(87325), c2 = r3(75058), f2 = r3(53789), d2 = function(e4) { function t4(t5, r4) { void 0 === r4 && (r4 = {}); var n3, i3 = this; if ((i3 = e4.call(this, a2(a2({}, t5), { type: 0 }), r4) || this).common = i3._validateTxV(i3.v, r4.common), i3.gasPrice = new s2.BN((0, s2.toBuffer)("" === t5.gasPrice ? "0x" : t5.gasPrice)), i3.gasPrice.mul(i3.gasLimit).gt(s2.MAX_INTEGER)) { var o3 = i3._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)"); throw new Error(o3); } if (i3._validateCannotExceedMaxInteger({ gasPrice: i3.gasPrice }), i3.common.gteHardfork("spuriousDragon")) if (i3.isSigned()) { var c3 = i3.v, d3 = i3.common.chainIdBN().muln(2); (c3.eq(d3.addn(35)) || c3.eq(d3.addn(36))) && i3.activeCapabilities.push(u2.Capability.EIP155ReplayProtection); } else i3.activeCapabilities.push(u2.Capability.EIP155ReplayProtection); return i3.common.isActivatedEIP(3860) && (0, f2.checkMaxInitCodeSize)(i3.common, i3.data.length), (null === (n3 = null == r4 ? void 0 : r4.freeze) || void 0 === n3 || n3) && Object.freeze(i3), i3; } return o2(t4, e4), t4.fromTxData = function(e5, r4) { return void 0 === r4 && (r4 = {}), new t4(e5, r4); }, t4.fromSerializedTx = function(e5, t5) { void 0 === t5 && (t5 = {}); var r4 = s2.rlp.decode(e5); if (!Array.isArray(r4)) throw new Error("Invalid serialized tx input. Must be array"); return this.fromValuesArray(r4, t5); }, t4.fromRlpSerializedTx = function(e5, r4) { return void 0 === r4 && (r4 = {}), t4.fromSerializedTx(e5, r4); }, t4.fromValuesArray = function(e5, r4) { if (void 0 === r4 && (r4 = {}), 6 !== e5.length && 9 !== e5.length) throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx)."); var n3 = function(e6, t5) { var r5 = "function" == typeof Symbol && e6[Symbol.iterator]; if (!r5) return e6; var n4, i4, o4 = r5.call(e6), a4 = []; try { for (; (void 0 === t5 || t5-- > 0) && !(n4 = o4.next()).done; ) a4.push(n4.value); } catch (e7) { i4 = { error: e7 }; } finally { try { n4 && !n4.done && (r5 = o4.return) && r5.call(o4); } finally { if (i4) throw i4.error; } } return a4; }(e5, 9), i3 = n3[0], o3 = n3[1], a3 = n3[2], u3 = n3[3], c3 = n3[4], f3 = n3[5], d3 = n3[6], l2 = n3[7], h2 = n3[8]; return (0, s2.validateNoLeadingZeroes)({ nonce: i3, gasPrice: o3, gasLimit: a3, value: c3, v: d3, r: l2, s: h2 }), new t4({ nonce: i3, gasPrice: o3, gasLimit: a3, to: u3, value: c3, data: f3, v: d3, r: l2, s: h2 }, r4); }, t4.prototype.raw = function() { return [(0, s2.bnToUnpaddedBuffer)(this.nonce), (0, s2.bnToUnpaddedBuffer)(this.gasPrice), (0, s2.bnToUnpaddedBuffer)(this.gasLimit), void 0 !== this.to ? this.to.buf : i2.from([]), (0, s2.bnToUnpaddedBuffer)(this.value), this.data, void 0 !== this.v ? (0, s2.bnToUnpaddedBuffer)(this.v) : i2.from([]), void 0 !== this.r ? (0, s2.bnToUnpaddedBuffer)(this.r) : i2.from([]), void 0 !== this.s ? (0, s2.bnToUnpaddedBuffer)(this.s) : i2.from([])]; }, t4.prototype.serialize = function() { return s2.rlp.encode(this.raw()); }, t4.prototype._getMessageToSign = function() { var e5 = [(0, s2.bnToUnpaddedBuffer)(this.nonce), (0, s2.bnToUnpaddedBuffer)(this.gasPrice), (0, s2.bnToUnpaddedBuffer)(this.gasLimit), void 0 !== this.to ? this.to.buf : i2.from([]), (0, s2.bnToUnpaddedBuffer)(this.value), this.data]; return this.supports(u2.Capability.EIP155ReplayProtection) && (e5.push((0, s2.toBuffer)(this.common.chainIdBN())), e5.push((0, s2.unpadBuffer)((0, s2.toBuffer)(0))), e5.push((0, s2.unpadBuffer)((0, s2.toBuffer)(0)))), e5; }, t4.prototype.getMessageToSign = function(e5) { void 0 === e5 && (e5 = true); var t5 = this._getMessageToSign(); return e5 ? (0, s2.rlphash)(t5) : t5; }, t4.prototype.getDataFee = function() { return this.cache.dataFee && this.cache.dataFee.hardfork === this.common.hardfork() ? this.cache.dataFee.value : (Object.isFrozen(this) && (this.cache.dataFee = { value: e4.prototype.getDataFee.call(this), hardfork: this.common.hardfork() }), e4.prototype.getDataFee.call(this)); }, t4.prototype.getUpfrontCost = function() { return this.gasLimit.mul(this.gasPrice).add(this.value); }, t4.prototype.hash = function() { return Object.isFrozen(this) ? (this.cache.hash || (this.cache.hash = (0, s2.rlphash)(this.raw())), this.cache.hash) : (0, s2.rlphash)(this.raw()); }, t4.prototype.getMessageToVerifySignature = function() { if (!this.isSigned()) { var e5 = this._errorMsg("This transaction is not signed"); throw new Error(e5); } var t5 = this._getMessageToSign(); return (0, s2.rlphash)(t5); }, t4.prototype.getSenderPublicKey = function() { var e5, t5 = this.getMessageToVerifySignature(); if (this.common.gteHardfork("homestead") && (null === (e5 = this.s) || void 0 === e5 ? void 0 : e5.gt(u2.N_DIV_2))) { var r4 = this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid"); throw new Error(r4); } var n3 = this, i3 = n3.v, o3 = n3.r, a3 = n3.s; try { return (0, s2.ecrecover)(t5, i3, (0, s2.bnToUnpaddedBuffer)(o3), (0, s2.bnToUnpaddedBuffer)(a3), this.supports(u2.Capability.EIP155ReplayProtection) ? this.common.chainIdBN() : void 0); } catch (e6) { throw r4 = this._errorMsg("Invalid Signature"), new Error(r4); } }, t4.prototype._processSignature = function(e5, r4, n3) { var i3 = new s2.BN(e5); this.supports(u2.Capability.EIP155ReplayProtection) && i3.iadd(this.common.chainIdBN().muln(2).addn(8)); var o3 = a2(a2({}, this.txOptions), { common: this.common }); return t4.fromTxData({ nonce: this.nonce, gasPrice: this.gasPrice, gasLimit: this.gasLimit, to: this.to, value: this.value, data: this.data, v: i3, r: new s2.BN(r4), s: new s2.BN(n3) }, o3); }, t4.prototype.toJSON = function() { return { nonce: (0, s2.bnToHex)(this.nonce), gasPrice: (0, s2.bnToHex)(this.gasPrice), gasLimit: (0, s2.bnToHex)(this.gasLimit), to: void 0 !== this.to ? this.to.toString() : void 0, value: (0, s2.bnToHex)(this.value), data: "0x" + this.data.toString("hex"), v: void 0 !== this.v ? (0, s2.bnToHex)(this.v) : void 0, r: void 0 !== this.r ? (0, s2.bnToHex)(this.r) : void 0, s: void 0 !== this.s ? (0, s2.bnToHex)(this.s) : void 0 }; }, t4.prototype._validateTxV = function(e5, t5) { if (void 0 !== e5 && e5.ltn(37) && !e5.eqn(27) && !e5.eqn(28)) throw new Error("Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ".concat(e5)); var r4; if (void 0 !== e5 && (!t5 || t5.gteHardfork("spuriousDragon")) && !e5.eqn(27) && !e5.eqn(28)) if (t5) { var n3 = t5.chainIdBN().muln(2); if (!e5.eq(n3.addn(35)) && !e5.eq(n3.addn(36))) throw new Error("Incompatible EIP155-based V ".concat(e5, " and chain id ").concat(t5.chainIdBN(), ". See the Common parameter of the Transaction constructor to set the chain id.")); } else { var i3; i3 = e5.subn(35).isEven() ? 35 : 36, r4 = e5.subn(i3).divn(2); } return this._getCommon(t5, r4); }, t4.prototype._unsignedTxImplementsEIP155 = function() { return this.common.gteHardfork("spuriousDragon"); }, t4.prototype._signedTxImplementsEIP155 = function() { if (!this.isSigned()) { var e5 = this._errorMsg("This transaction is not signed"); throw new Error(e5); } var t5 = this.common.gteHardfork("spuriousDragon"), r4 = this.v, n3 = this.common.chainIdBN().muln(2); return (r4.eq(n3.addn(35)) || r4.eq(n3.addn(36))) && t5; }, t4.prototype.errorStr = function() { return this._getSharedErrorPostfix() + " gasPrice=".concat(this.gasPrice); }, t4.prototype._errorMsg = function(e5) { return "".concat(e5, " (").concat(this.errorStr(), ")"); }, t4; }(c2.BaseTransaction); t3.default = d2; }, 89562: (e3, t3, r3) => { var n2 = r3(29033).Buffer; Object.defineProperty(t3, "__esModule", { value: true }); var i2 = r3(33062), o2 = r3(42339), a2 = function() { function e4() { } return e4.fromTxData = function(e5, t4) { if (void 0 === t4 && (t4 = {}), "type" in e5 && void 0 !== e5.type) { var r4 = new i2.BN((0, i2.toBuffer)(e5.type)).toNumber(); if (0 === r4) return o2.Transaction.fromTxData(e5, t4); if (1 === r4) return o2.AccessListEIP2930Transaction.fromTxData(e5, t4); if (2 === r4) return o2.FeeMarketEIP1559Transaction.fromTxData(e5, t4); throw new Error("Tx instantiation with type ".concat(r4, " not supported")); } return o2.Transaction.fromTxData(e5, t4); }, e4.fromSerializedData = function(e5, t4) { if (void 0 === t4 && (t4 = {}), e5[0] <= 127) { var r4 = void 0; switch (e5[0]) { case 1: r4 = 2930; break; case 2: r4 = 1559; break; default: throw new Error("TypedTransaction with ID ".concat(e5[0], " unknown")); } return 1559 === r4 ? o2.FeeMarketEIP1559Transaction.fromSerializedTx(e5, t4) : o2.AccessListEIP2930Transaction.fromSerializedTx(e5, t4); } return o2.Transaction.fromSerializedTx(e5, t4); }, e4.fromBlockBodyData = function(e5, t4) { if (void 0 === t4 && (t4 = {}), n2.isBuffer(e5)) return this.fromSerializedData(e5, t4); if (Array.isArray(e5)) return o2.Transaction.fromValuesArray(e5, t4); throw new Error("Cannot decode transaction: unknown type input"); }, e4.getTransactionClass = function(e5, t4) { if (void 0 === e5 && (e5 = 0), 0 == e5 || e5 >= 128 && e5 <= 255) return o2.Transaction; switch (e5) { case 1: return o2.AccessListEIP2930Transaction; case 2: return o2.FeeMarketEIP1559Transaction; default: throw new Error("TypedTransaction with ID ".concat(e5, " unknown")); } }, e4; }(); t3.default = a2; }, 87325: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.N_DIV_2 = t3.isAccessList = t3.isAccessListBuffer = t3.Capability = void 0; var n2, i2 = r3(33062); function o2(e4) { if (0 === e4.length) return true; var t4 = e4[0]; return !!Array.isArray(t4); } (n2 = t3.Capability || (t3.Capability = {}))[n2.EIP155ReplayProtection = 155] = "EIP155ReplayProtection", n2[n2.EIP1559FeeMarket = 1559] = "EIP1559FeeMarket", n2[n2.EIP2718TypedTransaction = 2718] = "EIP2718TypedTransaction", n2[n2.EIP2930AccessLists = 2930] = "EIP2930AccessLists", t3.isAccessListBuffer = o2, t3.isAccessList = function(e4) { return !o2(e4); }, t3.N_DIV_2 = new i2.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0", 16); }, 53789: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.AccessLists = t3.checkMaxInitCodeSize = void 0; var n2 = r3(33062), i2 = r3(87325); t3.checkMaxInitCodeSize = function(e4, t4) { if (t4 > e4.param("vm", "maxInitCodeSize")) throw new Error("the initcode size of this transaction is too large: it is ".concat(t4, " while the max is ").concat(e4.param("vm", "maxInitCodeSize"))); }; var o2 = function() { function e4() { } return e4.getAccessListData = function(e5) { var t4, r4; if (e5 && (0, i2.isAccessList)(e5)) { t4 = e5; for (var o3 = [], a2 = 0; a2 < e5.length; a2++) { for (var s2 = e5[a2], u2 = (0, n2.toBuffer)(s2.address), c2 = [], f2 = 0; f2 < s2.storageKeys.length; f2++) c2.push((0, n2.toBuffer)(s2.storageKeys[f2])); o3.push([u2, c2]); } r4 = o3; } else { r4 = null != e5 ? e5 : []; var d2 = []; for (a2 = 0; a2 < r4.length; a2++) { var l2 = r4[a2], h2 = (0, n2.bufferToHex)(l2[0]), p2 = []; for (s2 = 0; s2 < l2[1].length; s2++) p2.push((0, n2.bufferToHex)(l2[1][s2])); var b2 = { address: h2, storageKeys: p2 }; d2.push(b2); } t4 = d2; } return { AccessListJSON: t4, accessList: r4 }; }, e4.verifyAccessList = function(e5) { for (var t4 = 0; t4 < e5.length; t4++) { var r4 = e5[t4], n3 = r4[0], i3 = r4[1]; if (void 0 !== r4[2]) throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots."); if (20 != n3.length) throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes"); for (var o3 = 0; o3 < i3.length; o3++) if (32 != i3[o3].length) throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes"); } }, e4.getAccessListJSON = function(e5) { for (var t4 = [], r4 = 0; r4 < e5.length; r4++) { for (var i3 = e5[r4], o3 = { address: "0x" + (0, n2.setLengthLeft)(i3[0], 20).toString("hex"), storageKeys: [] }, a2 = i3[1], s2 = 0; s2 < a2.length; s2++) { var u2 = a2[s2]; o3.storageKeys.push("0x" + (0, n2.setLengthLeft)(u2, 32).toString("hex")); } t4.push(o3); } return t4; }, e4.getDataFeeEIP2930 = function(e5, t4) { for (var r4 = t4.param("gasPrices", "accessListStorageKeyCost"), n3 = t4.param("gasPrices", "accessListAddressCost"), i3 = 0, o3 = 0; o3 < e5.length; o3++) i3 += e5[o3][1].length; return e5.length * n3 + i3 * r4; }, e4; }(); t3.AccessLists = o2; }, 59786: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(28847), o2 = i2(r3(74519)), a2 = i2(r3(69721)), s2 = i2(r3(58985)); Object.defineProperty(t3, "__esModule", { value: true }), t3.accountBodyToRLP = t3.accountBodyToSlim = t3.accountBodyFromSlim = t3.isZeroAddress = t3.zeroAddress = t3.importPublic = t3.privateToAddress = t3.privateToPublic = t3.publicToAddress = t3.pubToAddress = t3.isValidPublic = t3.isValidPrivate = t3.generateAddress2 = t3.generateAddress = t3.isValidChecksumAddress = t3.toChecksumAddress = t3.isValidAddress = t3.Account = void 0; var u2 = r3(89658), c2 = r3(1243), f2 = r3(86992), d2 = r3(40890), l2 = r3(55803), h2 = r3(21449), p2 = r3(99047), b2 = r3(72560), y2 = BigInt(0), v2 = function() { function e4() { var t4 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : y2, r4 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : y2, n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : h2.KECCAK256_RLP, i3 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : h2.KECCAK256_NULL; (0, a2.default)(this, e4), this.nonce = t4, this.balance = r4, this.storageRoot = n3, this.codeHash = i3, this._validate(); } return (0, s2.default)(e4, [{ key: "_validate", value: function() { if (this.nonce < y2) throw new Error("nonce must be greater than zero"); if (this.balance < y2) throw new Error("balance must be greater than zero"); if (32 !== this.storageRoot.length) throw new Error("storageRoot must have a length of 32"); if (32 !== this.codeHash.length) throw new Error("codeHash must have a length of 32"); } }, { key: "raw", value: function() { return [(0, l2.bigIntToUnpaddedBuffer)(this.nonce), (0, l2.bigIntToUnpaddedBuffer)(this.balance), this.storageRoot, this.codeHash]; } }, { key: "serialize", value: function() { return n2.from(u2.RLP.encode((0, l2.bufArrToArr)(this.raw()))); } }, { key: "isContract", value: function() { return !this.codeHash.equals(h2.KECCAK256_NULL); } }, { key: "isEmpty", value: function() { return this.balance === y2 && this.nonce === y2 && this.codeHash.equals(h2.KECCAK256_NULL); } }], [{ key: "fromAccountData", value: function(t4) { var r4 = t4.nonce, n3 = t4.balance, i3 = t4.storageRoot, o3 = t4.codeHash; return new e4(void 0 !== r4 ? (0, l2.bufferToBigInt)((0, l2.toBuffer)(r4)) : void 0, void 0 !== n3 ? (0, l2.bufferToBigInt)((0, l2.toBuffer)(n3)) : void 0, void 0 !== i3 ? (0, l2.toBuffer)(i3) : void 0, void 0 !== o3 ? (0, l2.toBuffer)(o3) : void 0); } }, { key: "fromRlpSerializedAccount", value: function(e5) { var t4 = (0, l2.arrToBufArr)(u2.RLP.decode(Uint8Array.from(e5))); if (!Array.isArray(t4)) throw new Error("Invalid serialized account input. Must be array"); return this.fromValuesArray(t4); } }, { key: "fromValuesArray", value: function(t4) { var r4 = (0, o2.default)(t4, 4), n3 = r4[0], i3 = r4[1], a3 = r4[2], s3 = r4[3]; return new e4((0, l2.bufferToBigInt)(n3), (0, l2.bufferToBigInt)(i3), a3, s3); } }]), e4; }(); function m2(e4) { var t4 = (0, o2.default)(e4, 4), r4 = t4[0], n3 = t4[1], i3 = t4[2], a3 = t4[3]; return [r4, n3, 0 === (0, l2.arrToBufArr)(i3).length ? h2.KECCAK256_RLP : i3, 0 === (0, l2.arrToBufArr)(a3).length ? h2.KECCAK256_NULL : a3]; } t3.Account = v2, t3.isValidAddress = function(e4) { try { (0, p2.assertIsString)(e4); } catch (e5) { return false; } return /^0x[0-9a-fA-F]{40}$/.test(e4); }, t3.toChecksumAddress = function(e4, t4) { (0, p2.assertIsHexString)(e4); var r4 = (0, b2.stripHexPrefix)(e4).toLowerCase(), i3 = ""; void 0 !== t4 && (i3 = (0, l2.bufferToBigInt)((0, l2.toBuffer)(t4)).toString() + "0x"); for (var o3 = n2.from(i3 + r4, "utf8"), a3 = (0, d2.bytesToHex)((0, c2.keccak256)(o3)), s3 = "0x", u3 = 0; u3 < r4.length; u3++) parseInt(a3[u3], 16) >= 8 ? s3 += r4[u3].toUpperCase() : s3 += r4[u3]; return s3; }, t3.isValidChecksumAddress = function(e4, r4) { return (0, t3.isValidAddress)(e4) && (0, t3.toChecksumAddress)(e4, r4) === e4; }, t3.generateAddress = function(e4, t4) { return (0, p2.assertIsBuffer)(e4), (0, p2.assertIsBuffer)(t4), (0, l2.bufferToBigInt)(t4) === BigInt(0) ? n2.from((0, c2.keccak256)(u2.RLP.encode((0, l2.bufArrToArr)([e4, null])))).slice(-20) : n2.from((0, c2.keccak256)(u2.RLP.encode((0, l2.bufArrToArr)([e4, t4])))).slice(-20); }, t3.generateAddress2 = function(e4, t4, r4) { if ((0, p2.assertIsBuffer)(e4), (0, p2.assertIsBuffer)(t4), (0, p2.assertIsBuffer)(r4), 20 !== e4.length) throw new Error("Expected from to be of length 20"); if (32 !== t4.length) throw new Error("Expected salt to be of length 32"); var i3 = (0, c2.keccak256)(n2.concat([n2.from("ff", "hex"), e4, t4, (0, c2.keccak256)(r4)])); return (0, l2.toBuffer)(i3).slice(-20); }, t3.isValidPrivate = function(e4) { return f2.secp256k1.utils.isValidPrivateKey(e4); }, t3.isValidPublic = function(e4) { var t4 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; if ((0, p2.assertIsBuffer)(e4), 64 === e4.length) try { return f2.secp256k1.ProjectivePoint.fromHex(n2.concat([n2.from([4]), e4])), true; } catch (e5) { return false; } if (!t4) return false; try { return f2.secp256k1.ProjectivePoint.fromHex(e4), true; } catch (e5) { return false; } }, t3.pubToAddress = function(e4) { var t4 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; if ((0, p2.assertIsBuffer)(e4), t4 && 64 !== e4.length && (e4 = n2.from(f2.secp256k1.ProjectivePoint.fromHex(e4).toRawBytes(false).slice(1))), 64 !== e4.length) throw new Error("Expected pubKey to be of length 64"); return n2.from((0, c2.keccak256)(e4)).slice(-20); }, t3.publicToAddress = t3.pubToAddress, t3.privateToPublic = function(e4) { return (0, p2.assertIsBuffer)(e4), n2.from(f2.secp256k1.ProjectivePoint.fromPrivateKey(e4).toRawBytes(false).slice(1)); }, t3.privateToAddress = function(e4) { return (0, t3.publicToAddress)((0, t3.privateToPublic)(e4)); }, t3.importPublic = function(e4) { return (0, p2.assertIsBuffer)(e4), 64 !== e4.length && (e4 = n2.from(f2.secp256k1.ProjectivePoint.fromHex(e4).toRawBytes(false).slice(1))), e4; }, t3.zeroAddress = function() { var e4 = (0, l2.zeros)(20); return (0, l2.bufferToHex)(e4); }, t3.isZeroAddress = function(e4) { try { (0, p2.assertIsString)(e4); } catch (e5) { return false; } return (0, t3.zeroAddress)() === e4; }, t3.accountBodyFromSlim = m2; var g2 = new Uint8Array(0); t3.accountBodyToSlim = function(e4) { var t4 = (0, o2.default)(e4, 4), r4 = t4[0], n3 = t4[1], i3 = t4[2], a3 = t4[3]; return [r4, n3, (0, l2.arrToBufArr)(i3).equals(h2.KECCAK256_RLP) ? g2 : i3, (0, l2.arrToBufArr)(a3).equals(h2.KECCAK256_NULL) ? g2 : a3]; }, t3.accountBodyToRLP = function(e4) { var t4 = arguments.length > 1 && void 0 !== arguments[1] && !arguments[1] ? e4 : m2(e4); return (0, l2.arrToBufArr)(u2.RLP.encode(t4)); }; }, 78718: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(28847), o2 = i2(r3(69721)), a2 = i2(r3(58985)); Object.defineProperty(t3, "__esModule", { value: true }), t3.Address = void 0; var s2 = r3(59786), u2 = r3(55803), c2 = function() { function e4(t4) { if ((0, o2.default)(this, e4), 20 !== t4.length) throw new Error("Invalid address length"); this.buf = t4; } return (0, a2.default)(e4, [{ key: "equals", value: function(e5) { return this.buf.equals(e5.buf); } }, { key: "isZero", value: function() { return this.equals(e4.zero()); } }, { key: "isPrecompileOrSystemAddress", value: function() { var e5 = (0, u2.bufferToBigInt)(this.buf), t4 = BigInt(0), r4 = BigInt("0xffff"); return e5 >= t4 && e5 <= r4; } }, { key: "toString", value: function() { return "0x" + this.buf.toString("hex"); } }, { key: "toBuffer", value: function() { return n2.from(this.buf); } }], [{ key: "zero", value: function() { return new e4((0, u2.zeros)(20)); } }, { key: "fromString", value: function(t4) { if (!(0, s2.isValidAddress)(t4)) throw new Error("Invalid address"); return new e4((0, u2.toBuffer)(t4)); } }, { key: "fromPublicKey", value: function(t4) { if (!n2.isBuffer(t4)) throw new Error("Public key should be Buffer"); return new e4((0, s2.pubToAddress)(t4)); } }, { key: "fromPrivateKey", value: function(t4) { if (!n2.isBuffer(t4)) throw new Error("Private key should be Buffer"); return new e4((0, s2.privateToAddress)(t4)); } }, { key: "generate", value: function(t4, r4) { if ("bigint" != typeof r4) throw new Error("Expected nonce to be a bigint"); return new e4((0, s2.generateAddress)(t4.buf, (0, u2.bigIntToBuffer)(r4))); } }, { key: "generate2", value: function(t4, r4, i3) { if (!n2.isBuffer(r4)) throw new Error("Expected salt to be a Buffer"); if (!n2.isBuffer(i3)) throw new Error("Expected initCode to be a Buffer"); return new e4((0, s2.generateAddress2)(t4.buf, r4, i3)); } }]), e4; }(); t3.Address = c2; }, 77692: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(82247)), o2 = n2(r3(69721)), a2 = n2(r3(58985)), s2 = n2(r3(119)), u2 = n2(r3(15163)), c2 = n2(r3(34650)), f2 = n2(r3(21949)), d2 = n2(r3(94571)); function l2(e4) { var t4, r4, n3, i3 = 2; for ("undefined" != typeof Symbol && (r4 = Symbol.asyncIterator, n3 = Symbol.iterator); i3--; ) { if (r4 && null != (t4 = e4[r4])) return t4.call(e4); if (n3 && null != (t4 = e4[n3])) return new h2(t4.call(e4)); r4 = "@@asyncIterator", n3 = "@@iterator"; } throw new TypeError("Object is not async iterable"); } function h2(e4) { function t4(e5) { if (Object(e5) !== e5) return Promise.reject(new TypeError(e5 + " is not an object.")); var t5 = e5.done; return Promise.resolve(e5.value).then(function(e6) { return { value: e6, done: t5 }; }); } return h2 = function(e5) { this.s = e5, this.n = e5.next; }, h2.prototype = { s: null, n: null, next: function() { return t4(this.n.apply(this.s, arguments)); }, return: function(e5) { var r4 = this.s.return; return void 0 === r4 ? Promise.resolve({ value: e5, done: true }) : t4(r4.apply(this.s, arguments)); }, throw: function(e5) { var r4 = this.s.return; return void 0 === r4 ? Promise.reject(e5) : t4(r4.apply(this.s, arguments)); } }, new h2(e4); } function p2() { return (p2 = (0, d2.default)(i2.default.mark(function e4(t4, r4, n3) { var o3, a3, s3, u3, c3, f3, d3; return i2.default.wrap(function(e5) { for (; ; ) switch (e5.prev = e5.next) { case 0: a3 = false, s3 = false, e5.prev = 2, c3 = i2.default.mark(function e6() { var r5; return i2.default.wrap(function(e7) { for (; ; ) switch (e7.prev = e7.next) { case 0: if (r5 = d3.value, e7.prev = 1, !(r5.length < 2)) { e7.next = 6; break; } r5.call(t4, n3), e7.next = 8; break; case 6: return e7.next = 8, new Promise(function(e8, i3) { r5.call(t4, n3, function(t5) { t5 ? i3(t5) : e8(); }); }); case 8: e7.next = 13; break; case 10: e7.prev = 10, e7.t0 = e7.catch(1), o3 = e7.t0; case 13: case "end": return e7.stop(); } }, e6, null, [[1, 10]]); }), f3 = l2(r4); case 5: return e5.next = 7, f3.next(); case 7: if (!(a3 = !(d3 = e5.sent).done)) { e5.next = 12; break; } return e5.delegateYield(c3(), "t0", 9); case 9: a3 = false, e5.next = 5; break; case 12: e5.next = 18; break; case 14: e5.prev = 14, e5.t1 = e5.catch(2), s3 = true, u3 = e5.t1; case 18: if (e5.prev = 18, e5.prev = 19, !a3 || null == f3.return) { e5.next = 23; break; } return e5.next = 23, f3.return(); case 23: if (e5.prev = 23, !s3) { e5.next = 26; break; } throw u3; case 26: return e5.finish(23); case 27: return e5.finish(18); case 28: if (!o3) { e5.next = 30; break; } throw o3; case 30: case "end": return e5.stop(); } }, e4, null, [[2, 14, 18, 28], [19, , 23, 27]]); }))).apply(this, arguments); } Object.defineProperty(t3, "__esModule", { value: true }), t3.AsyncEventEmitter = void 0; var b2 = function(e4) { (0, u2.default)(i3, e4); var t4, r4, n3 = (t4 = i3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, f2.default)(t4); if (r4) { var i4 = (0, f2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i4); } else e5 = n4.apply(this, arguments); return (0, c2.default)(this, e5); }); function i3() { return (0, o2.default)(this, i3), n3.apply(this, arguments); } return (0, a2.default)(i3, [{ key: "emit", value: function(e5) { for (var t5, r5 = arguments.length, n4 = new Array(r5 > 1 ? r5 - 1 : 0), i4 = 1; i4 < r5; i4++) n4[i4 - 1] = arguments[i4]; var o3 = n4[0], a3 = n4[1], s3 = this, u3 = null !== (t5 = s3._events[e5]) && void 0 !== t5 ? t5 : []; return void 0 === a3 && "function" == typeof o3 && (a3 = o3, o3 = void 0), "newListener" !== e5 && "removeListener" !== e5 || (o3 = { event: o3, fn: a3 }, a3 = void 0), function(e6, t6, r6) { return p2.apply(this, arguments); }(s3, (u3 = Array.isArray(u3) ? u3 : [u3]).slice(), o3).then(a3).catch(a3), s3.listenerCount(e5) > 0; } }, { key: "once", value: function(e5, t5) { var r5, n4 = this; if ("function" != typeof t5) throw new TypeError("listener must be a function"); return r5 = t5.length >= 2 ? function(i4, o3) { n4.removeListener(e5, r5), t5(i4, o3); } : function(i4) { n4.removeListener(e5, r5), t5(i4, r5); }, n4.on(e5, r5), n4; } }, { key: "first", value: function(e5, t5) { var r5, n4 = null !== (r5 = this._events[e5]) && void 0 !== r5 ? r5 : []; if ("function" != typeof t5) throw new TypeError("listener must be a function"); return Array.isArray(n4) || (this._events[e5] = n4 = [n4]), n4.unshift(t5), this; } }, { key: "before", value: function(e5, t5, r5) { return this.beforeOrAfter(e5, t5, r5); } }, { key: "after", value: function(e5, t5, r5) { return this.beforeOrAfter(e5, t5, r5, "after"); } }, { key: "beforeOrAfter", value: function(e5, t5, r5, n4) { var i4, o3, a3, s3 = null !== (i4 = this._events[e5]) && void 0 !== i4 ? i4 : [], u3 = "after" === n4 ? 1 : 0; if ("function" != typeof r5) throw new TypeError("listener must be a function"); if ("function" != typeof t5) throw new TypeError("target must be a function"); for (Array.isArray(s3) || (this._events[e5] = s3 = [s3]), a3 = s3.length, o3 = s3.length; o3--; ) if (s3[o3] === t5) { a3 = o3 + u3; break; } return s3.splice(a3, 0, r5), this; } }, { key: "on", value: function(e5, t5) { return (0, s2.default)((0, f2.default)(i3.prototype), "on", this).call(this, e5, t5); } }, { key: "addListener", value: function(e5, t5) { return (0, s2.default)((0, f2.default)(i3.prototype), "addListener", this).call(this, e5, t5); } }, { key: "prependListener", value: function(e5, t5) { return (0, s2.default)((0, f2.default)(i3.prototype), "prependListener", this).call(this, e5, t5); } }, { key: "prependOnceListener", value: function(e5, t5) { return (0, s2.default)((0, f2.default)(i3.prototype), "prependOnceListener", this).call(this, e5, t5); } }, { key: "removeAllListeners", value: function(e5) { return (0, s2.default)((0, f2.default)(i3.prototype), "removeAllListeners", this).call(this, e5); } }, { key: "removeListener", value: function(e5, t5) { return (0, s2.default)((0, f2.default)(i3.prototype), "removeListener", this).call(this, e5, t5); } }, { key: "eventNames", value: function() { return (0, s2.default)((0, f2.default)(i3.prototype), "eventNames", this).call(this); } }, { key: "listeners", value: function(e5) { return (0, s2.default)((0, f2.default)(i3.prototype), "listeners", this).call(this, e5); } }, { key: "listenerCount", value: function(e5) { return (0, s2.default)((0, f2.default)(i3.prototype), "listenerCount", this).call(this, e5); } }, { key: "getMaxListeners", value: function() { return (0, s2.default)((0, f2.default)(i3.prototype), "getMaxListeners", this).call(this); } }, { key: "setMaxListeners", value: function(e5) { return (0, s2.default)((0, f2.default)(i3.prototype), "setMaxListeners", this).call(this, e5); } }]), i3; }(r3(38291).EventEmitter); t3.AsyncEventEmitter = b2; }, 55803: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(28847)(r3(74519)); Object.defineProperty(t3, "__esModule", { value: true }), t3.intToUnpaddedBuffer = t3.bigIntToUnpaddedBuffer = t3.bigIntToHex = t3.bufArrToArr = t3.arrToBufArr = t3.validateNoLeadingZeroes = t3.baToJSON = t3.toUtf8 = t3.short = t3.addHexPrefix = t3.toUnsigned = t3.fromSigned = t3.bufferToInt = t3.bigIntToBuffer = t3.bufferToBigInt = t3.bufferToHex = t3.toBuffer = t3.unpadHexString = t3.unpadArray = t3.unpadBuffer = t3.setLengthRight = t3.setLengthLeft = t3.zeros = t3.intToBuffer = t3.intToHex = void 0; var o2 = r3(99047), a2 = r3(72560); t3.intToHex = function(e4) { if (!Number.isSafeInteger(e4) || e4 < 0) throw new Error("Received an invalid integer type: ".concat(e4)); return "0x".concat(e4.toString(16)); }, t3.intToBuffer = function(e4) { var r4 = (0, t3.intToHex)(e4); return n2.from((0, a2.padToEven)(r4.slice(2)), "hex"); }, t3.zeros = function(e4) { return n2.allocUnsafe(e4).fill(0); }; var s2 = function(e4, r4, n3) { var i3 = (0, t3.zeros)(r4); return n3 ? e4.length < r4 ? (e4.copy(i3), i3) : e4.slice(0, r4) : e4.length < r4 ? (e4.copy(i3, r4 - e4.length), i3) : e4.slice(-r4); }; t3.setLengthLeft = function(e4, t4) { return (0, o2.assertIsBuffer)(e4), s2(e4, t4, false); }, t3.setLengthRight = function(e4, t4) { return (0, o2.assertIsBuffer)(e4), s2(e4, t4, true); }; var u2 = function(e4) { for (var t4 = e4[0]; e4.length > 0 && "0" === t4.toString(); ) t4 = (e4 = e4.slice(1))[0]; return e4; }; function c2(e4) { var r4 = (0, t3.bufferToHex)(e4); return "0x" === r4 ? BigInt(0) : BigInt(r4); } function f2(e4) { return (0, t3.toBuffer)("0x" + e4.toString(16)); } t3.unpadBuffer = function(e4) { return (0, o2.assertIsBuffer)(e4), u2(e4); }, t3.unpadArray = function(e4) { return (0, o2.assertIsArray)(e4), u2(e4); }, t3.unpadHexString = function(e4) { return (0, o2.assertIsHexString)(e4), e4 = (0, a2.stripHexPrefix)(e4), "0x" + u2(e4); }, t3.toBuffer = function(e4) { if (null == e4) return n2.allocUnsafe(0); if (n2.isBuffer(e4)) return n2.from(e4); if (Array.isArray(e4) || e4 instanceof Uint8Array) return n2.from(e4); if ("string" == typeof e4) { if (!(0, a2.isHexString)(e4)) throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e4)); return n2.from((0, a2.padToEven)((0, a2.stripHexPrefix)(e4)), "hex"); } if ("number" == typeof e4) return (0, t3.intToBuffer)(e4); if ("bigint" == typeof e4) { if (e4 < BigInt(0)) throw new Error("Cannot convert negative bigint to buffer. Given: ".concat(e4)); var r4 = e4.toString(16); return r4.length % 2 && (r4 = "0" + r4), n2.from(r4, "hex"); } if (e4.toArray) return n2.from(e4.toArray()); if (e4.toBuffer) return n2.from(e4.toBuffer()); throw new Error("invalid type"); }, t3.bufferToHex = function(e4) { return "0x" + (e4 = (0, t3.toBuffer)(e4)).toString("hex"); }, t3.bufferToBigInt = c2, t3.bigIntToBuffer = f2, t3.bufferToInt = function(e4) { var t4 = Number(c2(e4)); if (!Number.isSafeInteger(t4)) throw new Error("Number exceeds 53 bits"); return t4; }, t3.fromSigned = function(e4) { return BigInt.asIntN(256, c2(e4)); }, t3.toUnsigned = function(e4) { return f2(BigInt.asUintN(256, e4)); }, t3.addHexPrefix = function(e4) { return "string" != typeof e4 || (0, a2.isHexPrefixed)(e4) ? e4 : "0x" + e4; }, t3.short = function(e4) { var t4 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 50, r4 = n2.isBuffer(e4) ? e4.toString("hex") : e4; return r4.length <= t4 ? r4 : r4.slice(0, t4) + "…"; }, t3.toUtf8 = function(e4) { if ((e4 = (0, a2.stripHexPrefix)(e4)).length % 2 != 0) throw new Error("Invalid non-even hex string input for toUtf8() provided"); return n2.from(e4.replace(/^(00)+|(00)+$/g, ""), "hex").toString("utf8"); }, t3.baToJSON = function(e4) { if (n2.isBuffer(e4)) return "0x".concat(e4.toString("hex")); if (e4 instanceof Array) { for (var r4 = [], i3 = 0; i3 < e4.length; i3++) r4.push((0, t3.baToJSON)(e4[i3])); return r4; } }, t3.validateNoLeadingZeroes = function(e4) { for (var t4 = 0, r4 = Object.entries(e4); t4 < r4.length; t4++) { var n3 = (0, i2.default)(r4[t4], 2), o3 = n3[0], a3 = n3[1]; if (void 0 !== a3 && a3.length > 0 && 0 === a3[0]) throw new Error("".concat(o3, " cannot have leading zeroes, received: ").concat(a3.toString("hex"))); } }, t3.arrToBufArr = function e4(t4) { return Array.isArray(t4) ? t4.map(function(t5) { return e4(t5); }) : n2.from(t4); }, t3.bufArrToArr = function e4(t4) { return Array.isArray(t4) ? t4.map(function(t5) { return e4(t5); }) : Uint8Array.from(null != t4 ? t4 : []); }, t3.bigIntToHex = function(e4) { return "0x" + e4.toString(16); }, t3.bigIntToUnpaddedBuffer = function(e4) { return (0, t3.unpadBuffer)(f2(e4)); }, t3.intToUnpaddedBuffer = function(e4) { return (0, t3.unpadBuffer)((0, t3.intToBuffer)(e4)); }; }, 21449: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.MAX_WITHDRAWALS_PER_PAYLOAD = t3.RLP_EMPTY_STRING = t3.KECCAK256_RLP = t3.KECCAK256_RLP_S = t3.KECCAK256_RLP_ARRAY = t3.KECCAK256_RLP_ARRAY_S = t3.KECCAK256_NULL = t3.KECCAK256_NULL_S = t3.TWO_POW256 = t3.SECP256K1_ORDER_DIV_2 = t3.SECP256K1_ORDER = t3.MAX_INTEGER_BIGINT = t3.MAX_INTEGER = t3.MAX_UINT64 = void 0; var n2 = r3(29033), i2 = r3(86992); t3.MAX_UINT64 = BigInt("0xffffffffffffffff"), t3.MAX_INTEGER = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), t3.MAX_INTEGER_BIGINT = BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"), t3.SECP256K1_ORDER = i2.secp256k1.CURVE.n, t3.SECP256K1_ORDER_DIV_2 = i2.secp256k1.CURVE.n / BigInt(2), t3.TWO_POW256 = BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"), t3.KECCAK256_NULL_S = "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", t3.KECCAK256_NULL = n2.Buffer.from(t3.KECCAK256_NULL_S, "hex"), t3.KECCAK256_RLP_ARRAY_S = "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", t3.KECCAK256_RLP_ARRAY = n2.Buffer.from(t3.KECCAK256_RLP_ARRAY_S, "hex"), t3.KECCAK256_RLP_S = "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", t3.KECCAK256_RLP = n2.Buffer.from(t3.KECCAK256_RLP_S, "hex"), t3.RLP_EMPTY_STRING = n2.Buffer.from([128]), t3.MAX_WITHDRAWALS_PER_PAYLOAD = 16; }, 89890: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.compactBytesToNibbles = t3.bytesToNibbles = t3.nibblesToCompactBytes = t3.nibblesToBytes = t3.hasTerminator = void 0, t3.hasTerminator = function(e4) { return e4.length > 0 && 16 === e4[e4.length - 1]; }, t3.nibblesToBytes = function(e4, t4) { for (var r3 = 0, n2 = 0; n2 < e4.length; r3 += 1, n2 += 2) t4[r3] = e4[n2] << 4 | e4[n2 + 1]; }, t3.nibblesToCompactBytes = function(e4) { var r3 = 0; (0, t3.hasTerminator)(e4) && (r3 = 1, e4 = e4.subarray(0, e4.length - 1)); var n2 = new Uint8Array(e4.length / 2 + 1); return n2[0] = r3 << 5, 1 == (1 & e4.length) && (n2[0] |= 16, n2[0] |= e4[0], e4 = e4.subarray(1)), (0, t3.nibblesToBytes)(e4, n2.subarray(1)), n2; }, t3.bytesToNibbles = function(e4) { for (var t4 = 2 * e4.length + 1, r3 = new Uint8Array(t4), n2 = 0; n2 < e4.length; n2++) { var i2 = e4[n2]; r3[2 * n2] = i2 / 16, r3[2 * n2 + 1] = i2 % 16; } return r3[t4 - 1] = 16, r3; }, t3.compactBytesToNibbles = function(e4) { if (0 === e4.length) return e4; var r3 = (0, t3.bytesToNibbles)(e4); r3[0] < 2 && (r3 = r3.subarray(0, r3.length - 1)); var n2 = 2 - (1 & r3[0]); return r3.subarray(n2); }; }, 99047: (e3, t3, r3) => { var n2 = r3(29033).Buffer; Object.defineProperty(t3, "__esModule", { value: true }), t3.assertIsString = t3.assertIsArray = t3.assertIsBuffer = t3.assertIsHexString = void 0; var i2 = r3(72560); t3.assertIsHexString = function(e4) { if (!(0, i2.isHexString)(e4)) { var t4 = "This method only supports 0x-prefixed hex strings but input was: ".concat(e4); throw new Error(t4); } }, t3.assertIsBuffer = function(e4) { if (!n2.isBuffer(e4)) { var t4 = "This method only supports Buffer but input was: ".concat(e4); throw new Error(t4); } }, t3.assertIsArray = function(e4) { if (!Array.isArray(e4)) { var t4 = "This method only supports number arrays but input was: ".concat(e4); throw new Error(t4); } }, t3.assertIsString = function(e4) { if ("string" != typeof e4) { var t4 = "This method only supports strings but input was: ".concat(e4); throw new Error(t4); } }; }, 65907: (e3, t3, r3) => { var n2 = Object.create ? function(e4, t4, r4, n3) { void 0 === n3 && (n3 = r4); var i3 = Object.getOwnPropertyDescriptor(t4, r4); i3 && !("get" in i3 ? !t4.__esModule : i3.writable || i3.configurable) || (i3 = { enumerable: true, get: function() { return t4[r4]; } }), Object.defineProperty(e4, n3, i3); } : function(e4, t4, r4, n3) { void 0 === n3 && (n3 = r4), e4[n3] = t4[r4]; }, i2 = function(e4, t4) { for (var r4 in e4) "default" === r4 || Object.prototype.hasOwnProperty.call(t4, r4) || n2(t4, e4, r4); }; Object.defineProperty(t3, "__esModule", { value: true }), t3.toAscii = t3.stripHexPrefix = t3.padToEven = t3.isHexString = t3.isHexPrefixed = t3.getKeys = t3.getBinarySize = t3.fromUtf8 = t3.fromAscii = t3.arrayContainsArray = void 0, i2(r3(21449), t3), i2(r3(44205), t3), i2(r3(59786), t3), i2(r3(78718), t3), i2(r3(1313), t3), i2(r3(65404), t3), i2(r3(55803), t3), i2(r3(62198), t3), i2(r3(89890), t3), i2(r3(77692), t3); var o2 = r3(72560); Object.defineProperty(t3, "arrayContainsArray", { enumerable: true, get: function() { return o2.arrayContainsArray; } }), Object.defineProperty(t3, "fromAscii", { enumerable: true, get: function() { return o2.fromAscii; } }), Object.defineProperty(t3, "fromUtf8", { enumerable: true, get: function() { return o2.fromUtf8; } }), Object.defineProperty(t3, "getBinarySize", { enumerable: true, get: function() { return o2.getBinarySize; } }), Object.defineProperty(t3, "getKeys", { enumerable: true, get: function() { return o2.getKeys; } }), Object.defineProperty(t3, "isHexPrefixed", { enumerable: true, get: function() { return o2.isHexPrefixed; } }), Object.defineProperty(t3, "isHexString", { enumerable: true, get: function() { return o2.isHexString; } }), Object.defineProperty(t3, "padToEven", { enumerable: true, get: function() { return o2.padToEven; } }), Object.defineProperty(t3, "stripHexPrefix", { enumerable: true, get: function() { return o2.stripHexPrefix; } }), Object.defineProperty(t3, "toAscii", { enumerable: true, get: function() { return o2.toAscii; } }), i2(r3(35651), t3), i2(r3(6449), t3); }, 72560: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(28847)(r3(3355)); function o2(e4) { if ("string" != typeof e4) throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat((0, i2.default)(e4))); return "0" === e4[0] && "x" === e4[1]; } function a2(e4) { var t4 = e4; if ("string" != typeof t4) throw new Error("[padToEven] value must be type 'string', received ".concat((0, i2.default)(t4))); return t4.length % 2 && (t4 = "0".concat(t4)), t4; } Object.defineProperty(t3, "__esModule", { value: true }), t3.isHexString = t3.getKeys = t3.fromAscii = t3.fromUtf8 = t3.toAscii = t3.arrayContainsArray = t3.getBinarySize = t3.padToEven = t3.stripHexPrefix = t3.isHexPrefixed = void 0, t3.isHexPrefixed = o2, t3.stripHexPrefix = function(e4) { if ("string" != typeof e4) throw new Error("[stripHexPrefix] input must be type 'string', received ".concat((0, i2.default)(e4))); return o2(e4) ? e4.slice(2) : e4; }, t3.padToEven = a2, t3.getBinarySize = function(e4) { if ("string" != typeof e4) throw new Error("[getBinarySize] method requires input type 'string', received ".concat((0, i2.default)(e4))); return n2.byteLength(e4, "utf8"); }, t3.arrayContainsArray = function(e4, t4, r4) { if (true !== Array.isArray(e4)) throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat((0, i2.default)(e4), "'")); if (true !== Array.isArray(t4)) throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat((0, i2.default)(t4), "'")); return t4[true === r4 ? "some" : "every"](function(t5) { return e4.indexOf(t5) >= 0; }); }, t3.toAscii = function(e4) { var t4 = "", r4 = 0, n3 = e4.length; for ("0x" === e4.substring(0, 2) && (r4 = 2); r4 < n3; r4 += 2) { var i3 = parseInt(e4.substr(r4, 2), 16); t4 += String.fromCharCode(i3); } return t4; }, t3.fromUtf8 = function(e4) { var t4 = n2.from(e4, "utf8"); return "0x".concat(a2(t4.toString("hex")).replace(/^0+|0+$/g, "")); }, t3.fromAscii = function(e4) { for (var t4 = "", r4 = 0; r4 < e4.length; r4++) { var n3 = e4.charCodeAt(r4).toString(16); t4 += n3.length < 2 ? "0".concat(n3) : n3; } return "0x".concat(t4); }, t3.getKeys = function(e4, t4, r4) { if (!Array.isArray(e4)) throw new Error("[getKeys] method expects input 'params' to be an array, got ".concat((0, i2.default)(e4))); if ("string" != typeof t4) throw new Error("[getKeys] method expects input 'key' to be type 'string', got ".concat((0, i2.default)(e4))); for (var n3 = [], o3 = 0; o3 < e4.length; o3++) { var a3 = e4[o3][t4]; if (true !== r4 || a3) { if ("string" != typeof a3) throw new Error("invalid abi - expected type 'string', received ".concat((0, i2.default)(a3))); } else a3 = ""; n3.push(a3); } return n3; }, t3.isHexString = function(e4, t4) { return !("string" != typeof e4 || !e4.match(/^0x[0-9A-Fa-f]*$/) || void 0 !== t4 && t4 > 0 && e4.length !== 2 + 2 * t4); }; }, 35651: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(82247)), o2 = n2(r3(94571)), a2 = n2(r3(69721)), s2 = n2(r3(58985)); Object.defineProperty(t3, "__esModule", { value: true }), t3.Lock = void 0; var u2 = function() { function e4() { (0, a2.default)(this, e4), this.permits = 1, this.promiseResolverQueue = []; } var t4; return (0, s2.default)(e4, [{ key: "acquire", value: (t4 = (0, o2.default)(i2.default.mark(function e5() { var t5 = this; return i2.default.wrap(function(e6) { for (; ; ) switch (e6.prev = e6.next) { case 0: if (!(this.permits > 0)) { e6.next = 3; break; } return this.permits -= 1, e6.abrupt("return", Promise.resolve(true)); case 3: return e6.abrupt("return", new Promise(function(e7) { return t5.promiseResolverQueue.push(e7); })); case 4: case "end": return e6.stop(); } }, e5, this); })), function() { return t4.apply(this, arguments); }) }, { key: "release", value: function() { if (this.permits += 1, this.permits > 1 && this.promiseResolverQueue.length > 0) console.warn("Lock.permits should never be > 0 when there is someone waiting."); else if (1 === this.permits && this.promiseResolverQueue.length > 0) { this.permits -= 1; var e5 = this.promiseResolverQueue.shift(); e5 && e5(true); } } }]), e4; }(); t3.Lock = u2; }, 6449: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(82247)), o2 = n2(r3(94571)); Object.defineProperty(t3, "__esModule", { value: true }), t3.getProvider = t3.fetchFromProvider = void 0; var a2 = r3(37441), s2 = function() { var e4 = (0, o2.default)(i2.default.mark(function e5(t4, r4) { var n3; return i2.default.wrap(function(e6) { for (; ; ) switch (e6.prev = e6.next) { case 0: return e6.next = 2, (0, a2.default)(t4, { headers: { "content-type": "application/json" }, type: "json", data: { method: r4.method, params: r4.params, jsonrpc: "2.0", id: 1 } }); case 2: return n3 = e6.sent, e6.abrupt("return", n3.result); case 4: case "end": return e6.stop(); } }, e5); })); return function(t4, r4) { return e4.apply(this, arguments); }; }(); t3.fetchFromProvider = s2, t3.getProvider = function(e4) { var t4; if ("string" == typeof e4) return e4; if (void 0 !== (null == e4 || null === (t4 = e4.connection) || void 0 === t4 ? void 0 : t4.url)) return e4.connection.url; throw new Error("Must provide valid provider URL or Web3Provider"); }; }, 65404: (e3, t3, r3) => { var n2 = r3(29033).Buffer; Object.defineProperty(t3, "__esModule", { value: true }), t3.hashPersonalMessage = t3.isValidSignature = t3.fromRpcSig = t3.toCompactSig = t3.toRpcSig = t3.ecrecover = t3.ecsign = void 0; var i2 = r3(1243), o2 = r3(86992), a2 = r3(55803), s2 = r3(21449), u2 = r3(99047); function c2(e4, t4) { return e4 === BigInt(0) || e4 === BigInt(1) ? e4 : void 0 === t4 ? e4 - BigInt(27) : e4 - (t4 * BigInt(2) + BigInt(35)); } function f2(e4) { return e4 === BigInt(0) || e4 === BigInt(1); } t3.ecsign = function(e4, t4, r4) { var i3 = o2.secp256k1.sign(e4, t4), a3 = i3.toCompactRawBytes(); return { r: n2.from(a3.slice(0, 32)), s: n2.from(a3.slice(32, 64)), v: void 0 === r4 ? BigInt(i3.recovery + 27) : BigInt(i3.recovery + 35) + BigInt(r4) * BigInt(2) }; }, t3.ecrecover = function(e4, t4, r4, i3, s3) { var u3 = n2.concat([(0, a2.setLengthLeft)(r4, 32), (0, a2.setLengthLeft)(i3, 32)], 64), d2 = c2(t4, s3); if (!f2(d2)) throw new Error("Invalid signature v value"); var l2 = o2.secp256k1.Signature.fromCompact(u3).addRecoveryBit(Number(d2)).recoverPublicKey(e4); return n2.from(l2.toRawBytes(false).slice(1)); }, t3.toRpcSig = function(e4, t4, r4, i3) { if (!f2(c2(e4, i3))) throw new Error("Invalid signature v value"); return (0, a2.bufferToHex)(n2.concat([(0, a2.setLengthLeft)(t4, 32), (0, a2.setLengthLeft)(r4, 32), (0, a2.toBuffer)(e4)])); }, t3.toCompactSig = function(e4, t4, r4, i3) { if (!f2(c2(e4, i3))) throw new Error("Invalid signature v value"); var o3 = r4; return (e4 > BigInt(28) && e4 % BigInt(2) === BigInt(1) || e4 === BigInt(1) || e4 === BigInt(28)) && ((o3 = n2.from(r4))[0] |= 128), (0, a2.bufferToHex)(n2.concat([(0, a2.setLengthLeft)(t4, 32), (0, a2.setLengthLeft)(o3, 32)])); }, t3.fromRpcSig = function(e4) { var t4, r4, n3, i3 = (0, a2.toBuffer)(e4); if (i3.length >= 65) t4 = i3.slice(0, 32), r4 = i3.slice(32, 64), n3 = (0, a2.bufferToBigInt)(i3.slice(64)); else { if (64 !== i3.length) throw new Error("Invalid signature length"); t4 = i3.slice(0, 32), r4 = i3.slice(32, 64), n3 = BigInt((0, a2.bufferToInt)(i3.slice(32, 33)) >> 7), r4[0] &= 127; } return n3 < 27 && (n3 += BigInt(27)), { v: n3, r: t4, s: r4 }; }, t3.isValidSignature = function(e4, t4, r4) { var n3 = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], i3 = arguments.length > 4 ? arguments[4] : void 0; if (32 !== t4.length || 32 !== r4.length) return false; if (!f2(c2(e4, i3))) return false; var o3 = (0, a2.bufferToBigInt)(t4), u3 = (0, a2.bufferToBigInt)(r4); return !(o3 === BigInt(0) || o3 >= s2.SECP256K1_ORDER || u3 === BigInt(0) || u3 >= s2.SECP256K1_ORDER || n3 && u3 >= s2.SECP256K1_ORDER_DIV_2); }, t3.hashPersonalMessage = function(e4) { (0, u2.assertIsBuffer)(e4); var t4 = n2.from("Ethereum Signed Message:\n".concat(e4.length), "utf-8"); return n2.from((0, i2.keccak256)(n2.concat([t4, e4]))); }; }, 62198: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.toType = t3.TypeOutput = void 0; var n2, i2 = r3(55803), o2 = r3(72560); !function(e4) { e4[e4.Number = 0] = "Number", e4[e4.BigInt = 1] = "BigInt", e4[e4.Buffer = 2] = "Buffer", e4[e4.PrefixedHexString = 3] = "PrefixedHexString"; }(n2 = t3.TypeOutput || (t3.TypeOutput = {})), t3.toType = function(e4, t4) { if (null === e4) return null; if (void 0 !== e4) { if ("string" == typeof e4 && !(0, o2.isHexString)(e4)) throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e4)); if ("number" == typeof e4 && !Number.isSafeInteger(e4)) throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)"); var r4 = (0, i2.toBuffer)(e4); switch (t4) { case n2.Buffer: return r4; case n2.BigInt: return (0, i2.bufferToBigInt)(r4); case n2.Number: var a2 = (0, i2.bufferToBigInt)(r4); if (a2 > BigInt(Number.MAX_SAFE_INTEGER)) throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)"); return Number(a2); case n2.PrefixedHexString: return (0, i2.bufferToHex)(r4); default: throw new Error("unknown outputType"); } } }; }, 44205: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.GWEI_TO_WEI = void 0, t3.GWEI_TO_WEI = BigInt(1e9); }, 1313: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(28847), o2 = i2(r3(74519)), a2 = i2(r3(69721)), s2 = i2(r3(58985)); Object.defineProperty(t3, "__esModule", { value: true }), t3.Withdrawal = void 0; var u2 = r3(78718), c2 = r3(55803), f2 = r3(62198), d2 = function() { function e4(t4, r4, n3, i3) { (0, a2.default)(this, e4), this.index = t4, this.validatorIndex = r4, this.address = n3, this.amount = i3; } return (0, s2.default)(e4, [{ key: "raw", value: function() { return e4.toBufferArray(this); } }, { key: "toValue", value: function() { return { index: this.index, validatorIndex: this.validatorIndex, address: this.address.buf, amount: this.amount }; } }, { key: "toJSON", value: function() { return { index: (0, c2.bigIntToHex)(this.index), validatorIndex: (0, c2.bigIntToHex)(this.validatorIndex), address: "0x" + this.address.buf.toString("hex"), amount: (0, c2.bigIntToHex)(this.amount) }; } }], [{ key: "fromWithdrawalData", value: function(t4) { var r4 = t4.index, n3 = t4.validatorIndex, i3 = t4.address, o3 = t4.amount; return new e4((0, f2.toType)(r4, f2.TypeOutput.BigInt), (0, f2.toType)(n3, f2.TypeOutput.BigInt), new u2.Address((0, f2.toType)(i3, f2.TypeOutput.Buffer)), (0, f2.toType)(o3, f2.TypeOutput.BigInt)); } }, { key: "fromValuesArray", value: function(t4) { if (4 !== t4.length) throw Error("Invalid withdrawalArray length expected=4 actual=".concat(t4.length)); var r4 = (0, o2.default)(t4, 4), n3 = r4[0], i3 = r4[1], a3 = r4[2], s3 = r4[3]; return e4.fromWithdrawalData({ index: n3, validatorIndex: i3, address: a3, amount: s3 }); } }, { key: "toBufferArray", value: function(e5) { var t4 = e5.index, r4 = e5.validatorIndex, i3 = e5.address, o3 = e5.amount; return [(0, f2.toType)(t4, f2.TypeOutput.BigInt) === BigInt(0) ? n2.alloc(0) : (0, f2.toType)(t4, f2.TypeOutput.Buffer), (0, f2.toType)(r4, f2.TypeOutput.BigInt) === BigInt(0) ? n2.alloc(0) : (0, f2.toType)(r4, f2.TypeOutput.Buffer), i3 instanceof u2.Address ? i3.buf : (0, f2.toType)(i3, f2.TypeOutput.Buffer), (0, f2.toType)(o3, f2.TypeOutput.BigInt) === BigInt(0) ? n2.alloc(0) : (0, f2.toType)(o3, f2.TypeOutput.Buffer)]; } }]), e4; }(); t3.Withdrawal = d2; }, 98067: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.version = void 0, t3.version = "abi/5.7.0"; }, 44937: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.defaultAbiCoder = t3.AbiCoder = void 0; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = r3(908), s2 = r3(23694), u2 = r3(64327), c2 = r3(98067), f2 = r3(17316), d2 = r3(49146), l2 = r3(4341), h2 = r3(30024), p2 = r3(53861), b2 = r3(90028), y2 = r3(4522), v2 = r3(88287), m2 = r3(48040), g2 = r3(52010), w2 = r3(60800), k2 = new u2.Logger(c2.version), _2 = new RegExp(/^bytes([0-9]*)$/), A2 = new RegExp(/^(u?int)([0-9]*)$/), E2 = function() { function e4(t4) { (0, i2.default)(this, e4), (0, s2.defineReadOnly)(this, "coerceFunc", t4 || null); } return (0, o2.default)(e4, [{ key: "_getCoder", value: function(e5) { var t4 = this; switch (e5.baseType) { case "address": return new d2.AddressCoder(e5.name); case "bool": return new h2.BooleanCoder(e5.name); case "string": return new m2.StringCoder(e5.name); case "bytes": return new p2.BytesCoder(e5.name); case "array": return new l2.ArrayCoder(this._getCoder(e5.arrayChildren), e5.arrayLength, e5.name); case "tuple": return new g2.TupleCoder((e5.components || []).map(function(e6) { return t4._getCoder(e6); }), e5.name); case "": return new y2.NullCoder(e5.name); } var r4 = e5.type.match(A2); if (r4) { var n3 = parseInt(r4[2] || "256"); return (0 === n3 || n3 > 256 || n3 % 8 != 0) && k2.throwArgumentError("invalid " + r4[1] + " bit length", "param", e5), new v2.NumberCoder(n3 / 8, "int" === r4[1], e5.name); } if (r4 = e5.type.match(_2)) { var i3 = parseInt(r4[1]); return (0 === i3 || i3 > 32) && k2.throwArgumentError("invalid bytes length", "param", e5), new b2.FixedBytesCoder(i3, e5.name); } return k2.throwArgumentError("invalid type", "type", e5.type); } }, { key: "_getWordSize", value: function() { return 32; } }, { key: "_getReader", value: function(e5, t4) { return new f2.Reader(e5, this._getWordSize(), this.coerceFunc, t4); } }, { key: "_getWriter", value: function() { return new f2.Writer(this._getWordSize()); } }, { key: "getDefaultValue", value: function(e5) { var t4 = this, r4 = e5.map(function(e6) { return t4._getCoder(w2.ParamType.from(e6)); }); return new g2.TupleCoder(r4, "_").defaultValue(); } }, { key: "encode", value: function(e5, t4) { var r4 = this; e5.length !== t4.length && k2.throwError("types/values length mismatch", u2.Logger.errors.INVALID_ARGUMENT, { count: { types: e5.length, values: t4.length }, value: { types: e5, values: t4 } }); var n3 = e5.map(function(e6) { return r4._getCoder(w2.ParamType.from(e6)); }), i3 = new g2.TupleCoder(n3, "_"), o3 = this._getWriter(); return i3.encode(o3, t4), o3.data; } }, { key: "decode", value: function(e5, t4, r4) { var n3 = this, i3 = e5.map(function(e6) { return n3._getCoder(w2.ParamType.from(e6)); }); return new g2.TupleCoder(i3, "_").decode(this._getReader((0, a2.arrayify)(t4), r4)); } }]), e4; }(); t3.AbiCoder = E2; var S2 = new E2(); t3.defaultAbiCoder = S2; }, 17316: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.Writer = t3.Reader = t3.Coder = void 0, t3.checkResultErrors = function(e4) { var t4 = []; return function e5(r4, n3) { if (Array.isArray(n3)) for (var i3 in n3) { var o3 = r4.slice(); o3.push(i3); try { e5(o3, n3[i3]); } catch (e6) { t4.push({ path: o3, error: e6 }); } } }([], e4), t4; }; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = r3(908), s2 = r3(34952), u2 = r3(23694), c2 = r3(64327), f2 = r3(98067), d2 = new c2.Logger(f2.version), l2 = function() { function e4(t4, r4, n3, o3) { (0, i2.default)(this, e4), this.name = t4, this.type = r4, this.localName = n3, this.dynamic = o3; } return (0, o2.default)(e4, [{ key: "_throwError", value: function(e5, t4) { d2.throwArgumentError(e5, this.localName, t4); } }]), e4; }(); t3.Coder = l2; var h2 = function() { function e4(t4) { (0, i2.default)(this, e4), (0, u2.defineReadOnly)(this, "wordSize", t4 || 32), this._data = [], this._dataLength = 0, this._padding = new Uint8Array(t4); } return (0, o2.default)(e4, [{ key: "data", get: function() { return (0, a2.hexConcat)(this._data); } }, { key: "length", get: function() { return this._dataLength; } }, { key: "_writeData", value: function(e5) { return this._data.push(e5), this._dataLength += e5.length, e5.length; } }, { key: "appendWriter", value: function(e5) { return this._writeData((0, a2.concat)(e5._data)); } }, { key: "writeBytes", value: function(e5) { var t4 = (0, a2.arrayify)(e5), r4 = t4.length % this.wordSize; return r4 && (t4 = (0, a2.concat)([t4, this._padding.slice(r4)])), this._writeData(t4); } }, { key: "_getValue", value: function(e5) { var t4 = (0, a2.arrayify)(s2.BigNumber.from(e5)); return t4.length > this.wordSize && d2.throwError("value out-of-bounds", c2.Logger.errors.BUFFER_OVERRUN, { length: this.wordSize, offset: t4.length }), t4.length % this.wordSize && (t4 = (0, a2.concat)([this._padding.slice(t4.length % this.wordSize), t4])), t4; } }, { key: "writeValue", value: function(e5) { return this._writeData(this._getValue(e5)); } }, { key: "writeUpdatableValue", value: function() { var e5 = this, t4 = this._data.length; return this._data.push(this._padding), this._dataLength += this.wordSize, function(r4) { e5._data[t4] = e5._getValue(r4); }; } }]), e4; }(); t3.Writer = h2; var p2 = function() { function e4(t4, r4, n3, o3) { (0, i2.default)(this, e4), (0, u2.defineReadOnly)(this, "_data", (0, a2.arrayify)(t4)), (0, u2.defineReadOnly)(this, "wordSize", r4 || 32), (0, u2.defineReadOnly)(this, "_coerceFunc", n3), (0, u2.defineReadOnly)(this, "allowLoose", o3), this._offset = 0; } return (0, o2.default)(e4, [{ key: "data", get: function() { return (0, a2.hexlify)(this._data); } }, { key: "consumed", get: function() { return this._offset; } }, { key: "coerce", value: function(t4, r4) { return this._coerceFunc ? this._coerceFunc(t4, r4) : e4.coerce(t4, r4); } }, { key: "_peekBytes", value: function(e5, t4, r4) { var n3 = Math.ceil(t4 / this.wordSize) * this.wordSize; return this._offset + n3 > this._data.length && (this.allowLoose && r4 && this._offset + t4 <= this._data.length ? n3 = t4 : d2.throwError("data out-of-bounds", c2.Logger.errors.BUFFER_OVERRUN, { length: this._data.length, offset: this._offset + n3 })), this._data.slice(this._offset, this._offset + n3); } }, { key: "subReader", value: function(t4) { return new e4(this._data.slice(this._offset + t4), this.wordSize, this._coerceFunc, this.allowLoose); } }, { key: "readBytes", value: function(e5, t4) { var r4 = this._peekBytes(0, e5, !!t4); return this._offset += r4.length, r4.slice(0, e5); } }, { key: "readValue", value: function() { return s2.BigNumber.from(this.readBytes(this.wordSize)); } }], [{ key: "coerce", value: function(e5, t4) { var r4 = e5.match("^u?int([0-9]+)$"); return r4 && parseInt(r4[1]) <= 48 && (t4 = t4.toNumber()), t4; } }]), e4; }(); t3.Reader = p2; }, 49146: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.AddressCoder = void 0; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)), c2 = r3(77921), f2 = r3(908); var d2 = function(e4) { (0, a2.default)(d3, e4); var t4, r4, n3 = (t4 = d3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, u2.default)(t4); if (r4) { var i3 = (0, u2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, s2.default)(this, e5); }); function d3(e5) { return (0, i2.default)(this, d3), n3.call(this, "address", "address", e5, false); } return (0, o2.default)(d3, [{ key: "defaultValue", value: function() { return "0x0000000000000000000000000000000000000000"; } }, { key: "encode", value: function(e5, t5) { try { t5 = (0, c2.getAddress)(t5); } catch (e6) { this._throwError(e6.message, t5); } return e5.writeValue(t5); } }, { key: "decode", value: function(e5) { return (0, c2.getAddress)((0, f2.hexZeroPad)(e5.readValue().toHexString(), 20)); } }]), d3; }(r3(17316).Coder); t3.AddressCoder = d2; }, 58090: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.AnonymousCoder = void 0; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)); var c2 = function(e4) { (0, a2.default)(c3, e4); var t4, r4, n3 = (t4 = c3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, u2.default)(t4); if (r4) { var i3 = (0, u2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, s2.default)(this, e5); }); function c3(e5) { var t5; return (0, i2.default)(this, c3), (t5 = n3.call(this, e5.name, e5.type, void 0, e5.dynamic)).coder = e5, t5; } return (0, o2.default)(c3, [{ key: "defaultValue", value: function() { return this.coder.defaultValue(); } }, { key: "encode", value: function(e5, t5) { return this.coder.encode(e5, t5); } }, { key: "decode", value: function(e5) { return this.coder.decode(e5); } }]), c3; }(r3(17316).Coder); t3.AnonymousCoder = c2; }, 4341: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.ArrayCoder = void 0, t3.pack = b2, t3.unpack = y2; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)), c2 = n2(r3(3355)), f2 = r3(64327), d2 = r3(98067), l2 = r3(17316), h2 = r3(58090); var p2 = new f2.Logger(d2.version); function b2(e4, t4, r4) { var n3 = null; if (Array.isArray(r4)) n3 = r4; else if (r4 && "object" === (0, c2.default)(r4)) { var i3 = {}; n3 = t4.map(function(e5) { var t5 = e5.localName; return t5 || p2.throwError("cannot encode object for signature with missing names", f2.Logger.errors.INVALID_ARGUMENT, { argument: "values", coder: e5, value: r4 }), i3[t5] && p2.throwError("cannot encode object for signature with duplicate names", f2.Logger.errors.INVALID_ARGUMENT, { argument: "values", coder: e5, value: r4 }), i3[t5] = true, r4[t5]; }); } else p2.throwArgumentError("invalid tuple value", "tuple", r4); t4.length !== n3.length && p2.throwArgumentError("types/value length mismatch", "tuple", r4); var o3 = new l2.Writer(e4.wordSize), a3 = new l2.Writer(e4.wordSize), s3 = []; return t4.forEach(function(e5, t5) { var r5 = n3[t5]; if (e5.dynamic) { var i4 = a3.length; e5.encode(a3, r5); var u3 = o3.writeUpdatableValue(); s3.push(function(e6) { u3(e6 + i4); }); } else e5.encode(o3, r5); }), s3.forEach(function(e5) { e5(o3.length); }), e4.appendWriter(o3) + e4.appendWriter(a3); } function y2(e4, t4) { var r4 = [], n3 = e4.subReader(0); t4.forEach(function(t5) { var i4 = null; if (t5.dynamic) { var o4 = e4.readValue(), a4 = n3.subReader(o4.toNumber()); try { i4 = t5.decode(a4); } catch (e5) { if (e5.code === f2.Logger.errors.BUFFER_OVERRUN) throw e5; (i4 = e5).baseType = t5.name, i4.name = t5.localName, i4.type = t5.type; } } else try { i4 = t5.decode(e4); } catch (e5) { if (e5.code === f2.Logger.errors.BUFFER_OVERRUN) throw e5; (i4 = e5).baseType = t5.name, i4.name = t5.localName, i4.type = t5.type; } null != i4 && r4.push(i4); }); var i3 = t4.reduce(function(e5, t5) { var r5 = t5.localName; return r5 && (e5[r5] || (e5[r5] = 0), e5[r5]++), e5; }, {}); t4.forEach(function(e5, t5) { var n4 = e5.localName; if (n4 && 1 === i3[n4] && ("length" === n4 && (n4 = "_length"), null == r4[n4])) { var o4 = r4[t5]; o4 instanceof Error ? Object.defineProperty(r4, n4, { enumerable: true, get: function() { throw o4; } }) : r4[n4] = o4; } }); for (var o3 = function(e5) { var t5 = r4[e5]; t5 instanceof Error && Object.defineProperty(r4, e5, { enumerable: true, get: function() { throw t5; } }); }, a3 = 0; a3 < r4.length; a3++) o3(a3); return Object.freeze(r4); } var v2 = function(e4) { (0, a2.default)(c3, e4); var t4, r4, n3 = (t4 = c3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, u2.default)(t4); if (r4) { var i3 = (0, u2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, s2.default)(this, e5); }); function c3(e5, t5, r5) { var o3; (0, i2.default)(this, c3); var a3 = e5.type + "[" + (t5 >= 0 ? t5 : "") + "]", s3 = -1 === t5 || e5.dynamic; return (o3 = n3.call(this, "array", a3, r5, s3)).coder = e5, o3.length = t5, o3; } return (0, o2.default)(c3, [{ key: "defaultValue", value: function() { for (var e5 = this.coder.defaultValue(), t5 = [], r5 = 0; r5 < this.length; r5++) t5.push(e5); return t5; } }, { key: "encode", value: function(e5, t5) { Array.isArray(t5) || this._throwError("expected array value", t5); var r5 = this.length; -1 === r5 && (r5 = t5.length, e5.writeValue(t5.length)), p2.checkArgumentCount(t5.length, r5, "coder array" + (this.localName ? " " + this.localName : "")); for (var n4 = [], i3 = 0; i3 < t5.length; i3++) n4.push(this.coder); return b2(e5, n4, t5); } }, { key: "decode", value: function(e5) { var t5 = this.length; -1 === t5 && 32 * (t5 = e5.readValue().toNumber()) > e5._data.length && p2.throwError("insufficient data length", f2.Logger.errors.BUFFER_OVERRUN, { length: e5._data.length, count: t5 }); for (var r5 = [], n4 = 0; n4 < t5; n4++) r5.push(new h2.AnonymousCoder(this.coder)); return e5.coerce(this.name, y2(e5, r5)); } }]), c3; }(l2.Coder); t3.ArrayCoder = v2; }, 30024: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.BooleanCoder = void 0; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)); var c2 = function(e4) { (0, a2.default)(c3, e4); var t4, r4, n3 = (t4 = c3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, u2.default)(t4); if (r4) { var i3 = (0, u2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, s2.default)(this, e5); }); function c3(e5) { return (0, i2.default)(this, c3), n3.call(this, "bool", "bool", e5, false); } return (0, o2.default)(c3, [{ key: "defaultValue", value: function() { return false; } }, { key: "encode", value: function(e5, t5) { return e5.writeValue(t5 ? 1 : 0); } }, { key: "decode", value: function(e5) { return e5.coerce(this.type, !e5.readValue().isZero()); } }]), c3; }(r3(17316).Coder); t3.BooleanCoder = c2; }, 53861: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.DynamicBytesCoder = t3.BytesCoder = void 0; var i2 = n2(r3(119)), o2 = n2(r3(69721)), a2 = n2(r3(58985)), s2 = n2(r3(15163)), u2 = n2(r3(34650)), c2 = n2(r3(21949)), f2 = r3(908); function d2(e4) { var t4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(); return function() { var r4, n3 = (0, c2.default)(e4); if (t4) { var i3 = (0, c2.default)(this).constructor; r4 = Reflect.construct(n3, arguments, i3); } else r4 = n3.apply(this, arguments); return (0, u2.default)(this, r4); }; } var l2 = function(e4) { (0, s2.default)(r4, e4); var t4 = d2(r4); function r4(e5, n3) { return (0, o2.default)(this, r4), t4.call(this, e5, e5, n3, true); } return (0, a2.default)(r4, [{ key: "defaultValue", value: function() { return "0x"; } }, { key: "encode", value: function(e5, t5) { return t5 = (0, f2.arrayify)(t5), e5.writeValue(t5.length) + e5.writeBytes(t5); } }, { key: "decode", value: function(e5) { return e5.readBytes(e5.readValue().toNumber(), true); } }]), r4; }(r3(17316).Coder); t3.DynamicBytesCoder = l2; var h2 = function(e4) { (0, s2.default)(r4, e4); var t4 = d2(r4); function r4(e5) { return (0, o2.default)(this, r4), t4.call(this, "bytes", e5); } return (0, a2.default)(r4, [{ key: "decode", value: function(e5) { return e5.coerce(this.name, (0, f2.hexlify)((0, i2.default)((0, c2.default)(r4.prototype), "decode", this).call(this, e5))); } }]), r4; }(l2); t3.BytesCoder = h2; }, 90028: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.FixedBytesCoder = void 0; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)), c2 = r3(908); var f2 = function(e4) { (0, a2.default)(f3, e4); var t4, r4, n3 = (t4 = f3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, u2.default)(t4); if (r4) { var i3 = (0, u2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, s2.default)(this, e5); }); function f3(e5, t5) { var r5; (0, i2.default)(this, f3); var o3 = "bytes" + String(e5); return (r5 = n3.call(this, o3, o3, t5, false)).size = e5, r5; } return (0, o2.default)(f3, [{ key: "defaultValue", value: function() { return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + 2 * this.size); } }, { key: "encode", value: function(e5, t5) { var r5 = (0, c2.arrayify)(t5); return r5.length !== this.size && this._throwError("incorrect data length", t5), e5.writeBytes(r5); } }, { key: "decode", value: function(e5) { return e5.coerce(this.name, (0, c2.hexlify)(e5.readBytes(this.size))); } }]), f3; }(r3(17316).Coder); t3.FixedBytesCoder = f2; }, 4522: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.NullCoder = void 0; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)); var c2 = function(e4) { (0, a2.default)(c3, e4); var t4, r4, n3 = (t4 = c3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, u2.default)(t4); if (r4) { var i3 = (0, u2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, s2.default)(this, e5); }); function c3(e5) { return (0, i2.default)(this, c3), n3.call(this, "null", "", e5, false); } return (0, o2.default)(c3, [{ key: "defaultValue", value: function() { return null; } }, { key: "encode", value: function(e5, t5) { return null != t5 && this._throwError("not null", t5), e5.writeBytes([]); } }, { key: "decode", value: function(e5) { return e5.readBytes(0), e5.coerce(this.name, null); } }]), c3; }(r3(17316).Coder); t3.NullCoder = c2; }, 88287: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.NumberCoder = void 0; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)), c2 = r3(34952), f2 = r3(5465); var d2 = function(e4) { (0, a2.default)(d3, e4); var t4, r4, n3 = (t4 = d3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, u2.default)(t4); if (r4) { var i3 = (0, u2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, s2.default)(this, e5); }); function d3(e5, t5, r5) { var o3; (0, i2.default)(this, d3); var a3 = (t5 ? "int" : "uint") + 8 * e5; return (o3 = n3.call(this, a3, a3, r5, false)).size = e5, o3.signed = t5, o3; } return (0, o2.default)(d3, [{ key: "defaultValue", value: function() { return 0; } }, { key: "encode", value: function(e5, t5) { var r5 = c2.BigNumber.from(t5), n4 = f2.MaxUint256.mask(8 * e5.wordSize); if (this.signed) { var i3 = n4.mask(8 * this.size - 1); (r5.gt(i3) || r5.lt(i3.add(f2.One).mul(f2.NegativeOne))) && this._throwError("value out-of-bounds", t5); } else (r5.lt(f2.Zero) || r5.gt(n4.mask(8 * this.size))) && this._throwError("value out-of-bounds", t5); return r5 = r5.toTwos(8 * this.size).mask(8 * this.size), this.signed && (r5 = r5.fromTwos(8 * this.size).toTwos(8 * e5.wordSize)), e5.writeValue(r5); } }, { key: "decode", value: function(e5) { var t5 = e5.readValue().mask(8 * this.size); return this.signed && (t5 = t5.fromTwos(8 * this.size)), e5.coerce(this.name, t5); } }]), d3; }(r3(17316).Coder); t3.NumberCoder = d2; }, 48040: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.StringCoder = void 0; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(119)), s2 = n2(r3(15163)), u2 = n2(r3(34650)), c2 = n2(r3(21949)), f2 = r3(78627); var d2 = function(e4) { (0, s2.default)(d3, e4); var t4, r4, n3 = (t4 = d3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, c2.default)(t4); if (r4) { var i3 = (0, c2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, u2.default)(this, e5); }); function d3(e5) { return (0, i2.default)(this, d3), n3.call(this, "string", e5); } return (0, o2.default)(d3, [{ key: "defaultValue", value: function() { return ""; } }, { key: "encode", value: function(e5, t5) { return (0, a2.default)((0, c2.default)(d3.prototype), "encode", this).call(this, e5, (0, f2.toUtf8Bytes)(t5)); } }, { key: "decode", value: function(e5) { return (0, f2.toUtf8String)((0, a2.default)((0, c2.default)(d3.prototype), "decode", this).call(this, e5)); } }]), d3; }(r3(53861).DynamicBytesCoder); t3.StringCoder = d2; }, 52010: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.TupleCoder = void 0; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)), c2 = r3(17316), f2 = r3(4341); var d2 = function(e4) { (0, a2.default)(c3, e4); var t4, r4, n3 = (t4 = c3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, u2.default)(t4); if (r4) { var i3 = (0, u2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, s2.default)(this, e5); }); function c3(e5, t5) { var r5; (0, i2.default)(this, c3); var o3 = false, a3 = []; e5.forEach(function(e6) { e6.dynamic && (o3 = true), a3.push(e6.type); }); var s3 = "tuple(" + a3.join(",") + ")"; return (r5 = n3.call(this, "tuple", s3, t5, o3)).coders = e5, r5; } return (0, o2.default)(c3, [{ key: "defaultValue", value: function() { var e5 = []; this.coders.forEach(function(t6) { e5.push(t6.defaultValue()); }); var t5 = this.coders.reduce(function(e6, t6) { var r5 = t6.localName; return r5 && (e6[r5] || (e6[r5] = 0), e6[r5]++), e6; }, {}); return this.coders.forEach(function(r5, n4) { var i3 = r5.localName; i3 && 1 === t5[i3] && ("length" === i3 && (i3 = "_length"), null == e5[i3] && (e5[i3] = e5[n4])); }), Object.freeze(e5); } }, { key: "encode", value: function(e5, t5) { return (0, f2.pack)(e5, this.coders, t5); } }, { key: "decode", value: function(e5) { return e5.coerce(this.name, (0, f2.unpack)(e5, this.coders)); } }]), c3; }(c2.Coder); t3.TupleCoder = d2; }, 60800: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.ParamType = t3.FunctionFragment = t3.Fragment = t3.FormatTypes = t3.EventFragment = t3.ErrorFragment = t3.ConstructorFragment = void 0; var i2 = n2(r3(15163)), o2 = n2(r3(34650)), a2 = n2(r3(21949)), s2 = n2(r3(69721)), u2 = n2(r3(58985)), c2 = r3(34952), f2 = r3(23694), d2 = r3(64327), l2 = r3(98067); function h2(e4) { var t4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(); return function() { var r4, n3 = (0, a2.default)(e4); if (t4) { var i3 = (0, a2.default)(this).constructor; r4 = Reflect.construct(n3, arguments, i3); } else r4 = n3.apply(this, arguments); return (0, o2.default)(this, r4); }; } var p2 = new d2.Logger(l2.version), b2 = {}, y2 = { calldata: true, memory: true, storage: true }, v2 = { calldata: true, memory: true }; function m2(e4, t4) { if ("bytes" === e4 || "string" === e4) { if (y2[t4]) return true; } else if ("address" === e4) { if ("payable" === t4) return true; } else if ((e4.indexOf("[") >= 0 || "tuple" === e4) && v2[t4]) return true; return (y2[t4] || "payable" === t4) && p2.throwArgumentError("invalid modifier", "name", t4), false; } function g2(e4, t4) { for (var r4 in t4) (0, f2.defineReadOnly)(e4, r4, t4[r4]); } var w2 = Object.freeze({ sighash: "sighash", minimal: "minimal", full: "full", json: "json" }); t3.FormatTypes = w2; var k2 = new RegExp(/^(.*)\[([0-9]*)\]$/), _2 = function() { function e4(t4, r4) { (0, s2.default)(this, e4), t4 !== b2 && p2.throwError("use fromString", d2.Logger.errors.UNSUPPORTED_OPERATION, { operation: "new ParamType()" }), g2(this, r4); var n3 = this.type.match(k2); g2(this, n3 ? { arrayLength: parseInt(n3[2] || "-1"), arrayChildren: e4.fromObject({ type: n3[1], components: this.components }), baseType: "array" } : { arrayLength: null, arrayChildren: null, baseType: null != this.components ? "tuple" : this.type }), this._isParamType = true, Object.freeze(this); } return (0, u2.default)(e4, [{ key: "format", value: function(e5) { if (e5 || (e5 = w2.sighash), w2[e5] || p2.throwArgumentError("invalid format type", "format", e5), e5 === w2.json) { var t4 = { type: "tuple" === this.baseType ? "tuple" : this.type, name: this.name || void 0 }; return "boolean" == typeof this.indexed && (t4.indexed = this.indexed), this.components && (t4.components = this.components.map(function(t5) { return JSON.parse(t5.format(e5)); })), JSON.stringify(t4); } var r4 = ""; return "array" === this.baseType ? (r4 += this.arrayChildren.format(e5), r4 += "[" + (this.arrayLength < 0 ? "" : String(this.arrayLength)) + "]") : "tuple" === this.baseType ? (e5 !== w2.sighash && (r4 += this.type), r4 += "(" + this.components.map(function(t5) { return t5.format(e5); }).join(e5 === w2.full ? ", " : ",") + ")") : r4 += this.type, e5 !== w2.sighash && (true === this.indexed && (r4 += " indexed"), e5 === w2.full && this.name && (r4 += " " + this.name)), r4; } }], [{ key: "from", value: function(t4, r4) { return "string" == typeof t4 ? e4.fromString(t4, r4) : e4.fromObject(t4); } }, { key: "fromObject", value: function(t4) { return e4.isParamType(t4) ? t4 : new e4(b2, { name: t4.name || null, type: M2(t4.type), indexed: null == t4.indexed ? null : !!t4.indexed, components: t4.components ? t4.components.map(e4.fromObject) : null }); } }, { key: "fromString", value: function(t4, r4) { return n3 = function(e5, t5) { var r5 = e5; function n4(t6) { p2.throwArgumentError("unexpected character at position ".concat(t6), "param", e5); } function i3(e6) { var r6 = { type: "", name: "", parent: e6, state: { allowType: true } }; return t5 && (r6.indexed = false), r6; } e5 = e5.replace(/\s/g, " "); for (var o3 = { type: "", name: "", state: { allowType: true } }, a3 = o3, s3 = 0; s3 < e5.length; s3++) { var u3 = e5[s3]; switch (u3) { case "(": a3.state.allowType && "" === a3.type ? a3.type = "tuple" : a3.state.allowParams || n4(s3), a3.state.allowType = false, a3.type = M2(a3.type), a3.components = [i3(a3)], a3 = a3.components[0]; break; case ")": delete a3.state, "indexed" === a3.name && (t5 || n4(s3), a3.indexed = true, a3.name = ""), m2(a3.type, a3.name) && (a3.name = ""), a3.type = M2(a3.type); var c3 = a3; (a3 = a3.parent) || n4(s3), delete c3.parent, a3.state.allowParams = false, a3.state.allowName = true, a3.state.allowArray = true; break; case ",": delete a3.state, "indexed" === a3.name && (t5 || n4(s3), a3.indexed = true, a3.name = ""), m2(a3.type, a3.name) && (a3.name = ""), a3.type = M2(a3.type); var f3 = i3(a3.parent); a3.parent.components.push(f3), delete a3.parent, a3 = f3; break; case " ": a3.state.allowType && "" !== a3.type && (a3.type = M2(a3.type), delete a3.state.allowType, a3.state.allowName = true, a3.state.allowParams = true), a3.state.allowName && "" !== a3.name && ("indexed" === a3.name ? (t5 || n4(s3), a3.indexed && n4(s3), a3.indexed = true, a3.name = "") : m2(a3.type, a3.name) ? a3.name = "" : a3.state.allowName = false); break; case "[": a3.state.allowArray || n4(s3), a3.type += u3, a3.state.allowArray = false, a3.state.allowName = false, a3.state.readArray = true; break; case "]": a3.state.readArray || n4(s3), a3.type += u3, a3.state.readArray = false, a3.state.allowArray = true, a3.state.allowName = true; break; default: a3.state.allowType ? (a3.type += u3, a3.state.allowParams = true, a3.state.allowArray = true) : a3.state.allowName ? (a3.name += u3, delete a3.state.allowArray) : a3.state.readArray ? a3.type += u3 : n4(s3); } } return a3.parent && p2.throwArgumentError("unexpected eof", "param", e5), delete o3.state, "indexed" === a3.name ? (t5 || n4(r5.length - 7), a3.indexed && n4(r5.length - 7), a3.indexed = true, a3.name = "") : m2(a3.type, a3.name) && (a3.name = ""), o3.type = M2(o3.type), o3; }(t4, !!r4), e4.fromObject({ name: n3.name, type: n3.type, indexed: n3.indexed, components: n3.components }); var n3; } }, { key: "isParamType", value: function(e5) { return !(null == e5 || !e5._isParamType); } }]), e4; }(); function A2(e4, t4) { return function(e5) { e5 = e5.trim(); for (var t5 = [], r4 = "", n3 = 0, i3 = 0; i3 < e5.length; i3++) { var o3 = e5[i3]; "," === o3 && 0 === n3 ? (t5.push(r4), r4 = "") : (r4 += o3, "(" === o3 ? n3++ : ")" === o3 && -1 == --n3 && p2.throwArgumentError("unbalanced parenthesis", "value", e5)); } return r4 && t5.push(r4), t5; }(e4).map(function(e5) { return _2.fromString(e5, t4); }); } t3.ParamType = _2; var E2 = function() { function e4(t4, r4) { (0, s2.default)(this, e4), t4 !== b2 && p2.throwError("use a static from method", d2.Logger.errors.UNSUPPORTED_OPERATION, { operation: "new Fragment()" }), g2(this, r4), this._isFragment = true, Object.freeze(this); } return (0, u2.default)(e4, null, [{ key: "from", value: function(t4) { return e4.isFragment(t4) ? t4 : "string" == typeof t4 ? e4.fromString(t4) : e4.fromObject(t4); } }, { key: "fromObject", value: function(t4) { if (e4.isFragment(t4)) return t4; switch (t4.type) { case "function": return I2.fromObject(t4); case "event": return S2.fromObject(t4); case "constructor": return P2.fromObject(t4); case "error": return C2.fromObject(t4); case "fallback": case "receive": return null; } return p2.throwArgumentError("invalid fragment object", "value", t4); } }, { key: "fromString", value: function(e5) { return "event" === (e5 = (e5 = (e5 = e5.replace(/\s/g, " ")).replace(/\(/g, " (").replace(/\)/g, ") ").replace(/\s+/g, " ")).trim()).split(" ")[0] ? S2.fromString(e5.substring(5).trim()) : "function" === e5.split(" ")[0] ? I2.fromString(e5.substring(8).trim()) : "constructor" === e5.split("(")[0].trim() ? P2.fromString(e5.trim()) : "error" === e5.split(" ")[0] ? C2.fromString(e5.substring(5).trim()) : p2.throwArgumentError("unsupported fragment", "value", e5); } }, { key: "isFragment", value: function(e5) { return !(!e5 || !e5._isFragment); } }]), e4; }(); t3.Fragment = E2; var S2 = function(e4) { (0, i2.default)(r4, e4); var t4 = h2(r4); function r4() { return (0, s2.default)(this, r4), t4.apply(this, arguments); } return (0, u2.default)(r4, [{ key: "format", value: function(e5) { if (e5 || (e5 = w2.sighash), w2[e5] || p2.throwArgumentError("invalid format type", "format", e5), e5 === w2.json) return JSON.stringify({ type: "event", anonymous: this.anonymous, name: this.name, inputs: this.inputs.map(function(t6) { return JSON.parse(t6.format(e5)); }) }); var t5 = ""; return e5 !== w2.sighash && (t5 += "event "), t5 += this.name + "(" + this.inputs.map(function(t6) { return t6.format(e5); }).join(e5 === w2.full ? ", " : ",") + ") ", e5 !== w2.sighash && this.anonymous && (t5 += "anonymous "), t5.trim(); } }], [{ key: "from", value: function(e5) { return "string" == typeof e5 ? r4.fromString(e5) : r4.fromObject(e5); } }, { key: "fromObject", value: function(e5) { if (r4.isEventFragment(e5)) return e5; "event" !== e5.type && p2.throwArgumentError("invalid event object", "value", e5); var t5 = { name: U2(e5.name), anonymous: e5.anonymous, inputs: e5.inputs ? e5.inputs.map(_2.fromObject) : [], type: "event" }; return new r4(b2, t5); } }, { key: "fromString", value: function(e5) { var t5 = e5.match(N2); t5 || p2.throwArgumentError("invalid event string", "value", e5); var n3 = false; return t5[3].split(" ").forEach(function(e6) { switch (e6.trim()) { case "anonymous": n3 = true; break; case "": break; default: p2.warn("unknown modifier: " + e6); } }), r4.fromObject({ name: t5[1].trim(), anonymous: n3, inputs: A2(t5[2], true), type: "event" }); } }, { key: "isEventFragment", value: function(e5) { return e5 && e5._isFragment && "event" === e5.type; } }]), r4; }(E2); function x2(e4, t4) { t4.gas = null; var r4 = e4.split("@"); return 1 !== r4.length ? (r4.length > 2 && p2.throwArgumentError("invalid human-readable ABI signature", "value", e4), r4[1].match(/^[0-9]+$/) || p2.throwArgumentError("invalid human-readable ABI signature gas", "value", e4), t4.gas = c2.BigNumber.from(r4[1]), r4[0]) : e4; } function B2(e4, t4) { t4.constant = false, t4.payable = false, t4.stateMutability = "nonpayable", e4.split(" ").forEach(function(e5) { switch (e5.trim()) { case "constant": t4.constant = true; break; case "payable": t4.payable = true, t4.stateMutability = "payable"; break; case "nonpayable": t4.payable = false, t4.stateMutability = "nonpayable"; break; case "pure": t4.constant = true, t4.stateMutability = "pure"; break; case "view": t4.constant = true, t4.stateMutability = "view"; break; case "external": case "public": case "": break; default: console.log("unknown modifier: " + e5); } }); } function O2(e4) { var t4 = { constant: false, payable: true, stateMutability: "payable" }; return null != e4.stateMutability ? (t4.stateMutability = e4.stateMutability, t4.constant = "view" === t4.stateMutability || "pure" === t4.stateMutability, null != e4.constant && !!e4.constant !== t4.constant && p2.throwArgumentError("cannot have constant function with mutability " + t4.stateMutability, "value", e4), t4.payable = "payable" === t4.stateMutability, null != e4.payable && !!e4.payable !== t4.payable && p2.throwArgumentError("cannot have payable function with mutability " + t4.stateMutability, "value", e4)) : null != e4.payable ? (t4.payable = !!e4.payable, null != e4.constant || t4.payable || "constructor" === e4.type || p2.throwArgumentError("unable to determine stateMutability", "value", e4), t4.constant = !!e4.constant, t4.constant ? t4.stateMutability = "view" : t4.stateMutability = t4.payable ? "payable" : "nonpayable", t4.payable && t4.constant && p2.throwArgumentError("cannot have constant payable function", "value", e4)) : null != e4.constant ? (t4.constant = !!e4.constant, t4.payable = !t4.constant, t4.stateMutability = t4.constant ? "view" : "payable") : "constructor" !== e4.type && p2.throwArgumentError("unable to determine stateMutability", "value", e4), t4; } t3.EventFragment = S2; var P2 = function(e4) { (0, i2.default)(r4, e4); var t4 = h2(r4); function r4() { return (0, s2.default)(this, r4), t4.apply(this, arguments); } return (0, u2.default)(r4, [{ key: "format", value: function(e5) { if (e5 || (e5 = w2.sighash), w2[e5] || p2.throwArgumentError("invalid format type", "format", e5), e5 === w2.json) return JSON.stringify({ type: "constructor", stateMutability: "nonpayable" !== this.stateMutability ? this.stateMutability : void 0, payable: this.payable, gas: this.gas ? this.gas.toNumber() : void 0, inputs: this.inputs.map(function(t6) { return JSON.parse(t6.format(e5)); }) }); e5 === w2.sighash && p2.throwError("cannot format a constructor for sighash", d2.Logger.errors.UNSUPPORTED_OPERATION, { operation: "format(sighash)" }); var t5 = "constructor(" + this.inputs.map(function(t6) { return t6.format(e5); }).join(e5 === w2.full ? ", " : ",") + ") "; return this.stateMutability && "nonpayable" !== this.stateMutability && (t5 += this.stateMutability + " "), t5.trim(); } }], [{ key: "from", value: function(e5) { return "string" == typeof e5 ? r4.fromString(e5) : r4.fromObject(e5); } }, { key: "fromObject", value: function(e5) { if (r4.isConstructorFragment(e5)) return e5; "constructor" !== e5.type && p2.throwArgumentError("invalid constructor object", "value", e5); var t5 = O2(e5); t5.constant && p2.throwArgumentError("constructor cannot be constant", "value", e5); var n3 = { name: null, type: e5.type, inputs: e5.inputs ? e5.inputs.map(_2.fromObject) : [], payable: t5.payable, stateMutability: t5.stateMutability, gas: e5.gas ? c2.BigNumber.from(e5.gas) : null }; return new r4(b2, n3); } }, { key: "fromString", value: function(e5) { var t5 = { type: "constructor" }, n3 = (e5 = x2(e5, t5)).match(N2); return n3 && "constructor" === n3[1].trim() || p2.throwArgumentError("invalid constructor string", "value", e5), t5.inputs = A2(n3[2].trim(), false), B2(n3[3].trim(), t5), r4.fromObject(t5); } }, { key: "isConstructorFragment", value: function(e5) { return e5 && e5._isFragment && "constructor" === e5.type; } }]), r4; }(E2); t3.ConstructorFragment = P2; var I2 = function(e4) { (0, i2.default)(r4, e4); var t4 = h2(r4); function r4() { return (0, s2.default)(this, r4), t4.apply(this, arguments); } return (0, u2.default)(r4, [{ key: "format", value: function(e5) { if (e5 || (e5 = w2.sighash), w2[e5] || p2.throwArgumentError("invalid format type", "format", e5), e5 === w2.json) return JSON.stringify({ type: "function", name: this.name, constant: this.constant, stateMutability: "nonpayable" !== this.stateMutability ? this.stateMutability : void 0, payable: this.payable, gas: this.gas ? this.gas.toNumber() : void 0, inputs: this.inputs.map(function(t6) { return JSON.parse(t6.format(e5)); }), outputs: this.outputs.map(function(t6) { return JSON.parse(t6.format(e5)); }) }); var t5 = ""; return e5 !== w2.sighash && (t5 += "function "), t5 += this.name + "(" + this.inputs.map(function(t6) { return t6.format(e5); }).join(e5 === w2.full ? ", " : ",") + ") ", e5 !== w2.sighash && (this.stateMutability ? "nonpayable" !== this.stateMutability && (t5 += this.stateMutability + " ") : this.constant && (t5 += "view "), this.outputs && this.outputs.length && (t5 += "returns (" + this.outputs.map(function(t6) { return t6.format(e5); }).join(", ") + ") "), null != this.gas && (t5 += "@" + this.gas.toString() + " ")), t5.trim(); } }], [{ key: "from", value: function(e5) { return "string" == typeof e5 ? r4.fromString(e5) : r4.fromObject(e5); } }, { key: "fromObject", value: function(e5) { if (r4.isFunctionFragment(e5)) return e5; "function" !== e5.type && p2.throwArgumentError("invalid function object", "value", e5); var t5 = O2(e5), n3 = { type: e5.type, name: U2(e5.name), constant: t5.constant, inputs: e5.inputs ? e5.inputs.map(_2.fromObject) : [], outputs: e5.outputs ? e5.outputs.map(_2.fromObject) : [], payable: t5.payable, stateMutability: t5.stateMutability, gas: e5.gas ? c2.BigNumber.from(e5.gas) : null }; return new r4(b2, n3); } }, { key: "fromString", value: function(e5) { var t5 = { type: "function" }, n3 = (e5 = x2(e5, t5)).split(" returns "); n3.length > 2 && p2.throwArgumentError("invalid function string", "value", e5); var i3 = n3[0].match(N2); if (i3 || p2.throwArgumentError("invalid function signature", "value", e5), t5.name = i3[1].trim(), t5.name && U2(t5.name), t5.inputs = A2(i3[2], false), B2(i3[3].trim(), t5), n3.length > 1) { var o3 = n3[1].match(N2); "" == o3[1].trim() && "" == o3[3].trim() || p2.throwArgumentError("unexpected tokens", "value", e5), t5.outputs = A2(o3[2], false); } else t5.outputs = []; return r4.fromObject(t5); } }, { key: "isFunctionFragment", value: function(e5) { return e5 && e5._isFragment && "function" === e5.type; } }]), r4; }(P2); function T2(e4) { var t4 = e4.format(); return "Error(string)" !== t4 && "Panic(uint256)" !== t4 || p2.throwArgumentError("cannot specify user defined ".concat(t4, " error"), "fragment", e4), e4; } t3.FunctionFragment = I2; var C2 = function(e4) { (0, i2.default)(r4, e4); var t4 = h2(r4); function r4() { return (0, s2.default)(this, r4), t4.apply(this, arguments); } return (0, u2.default)(r4, [{ key: "format", value: function(e5) { if (e5 || (e5 = w2.sighash), w2[e5] || p2.throwArgumentError("invalid format type", "format", e5), e5 === w2.json) return JSON.stringify({ type: "error", name: this.name, inputs: this.inputs.map(function(t6) { return JSON.parse(t6.format(e5)); }) }); var t5 = ""; return e5 !== w2.sighash && (t5 += "error "), (t5 += this.name + "(" + this.inputs.map(function(t6) { return t6.format(e5); }).join(e5 === w2.full ? ", " : ",") + ") ").trim(); } }], [{ key: "from", value: function(e5) { return "string" == typeof e5 ? r4.fromString(e5) : r4.fromObject(e5); } }, { key: "fromObject", value: function(e5) { if (r4.isErrorFragment(e5)) return e5; "error" !== e5.type && p2.throwArgumentError("invalid error object", "value", e5); var t5 = { type: e5.type, name: U2(e5.name), inputs: e5.inputs ? e5.inputs.map(_2.fromObject) : [] }; return T2(new r4(b2, t5)); } }, { key: "fromString", value: function(e5) { var t5 = { type: "error" }, n3 = e5.match(N2); return n3 || p2.throwArgumentError("invalid error signature", "value", e5), t5.name = n3[1].trim(), t5.name && U2(t5.name), t5.inputs = A2(n3[2], false), T2(r4.fromObject(t5)); } }, { key: "isErrorFragment", value: function(e5) { return e5 && e5._isFragment && "error" === e5.type; } }]), r4; }(E2); function M2(e4) { return e4.match(/^uint($|[^1-9])/) ? e4 = "uint256" + e4.substring(4) : e4.match(/^int($|[^1-9])/) && (e4 = "int256" + e4.substring(3)), e4; } t3.ErrorFragment = C2; var R2 = new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$"); function U2(e4) { return e4 && e4.match(R2) || p2.throwArgumentError('invalid identifier "'.concat(e4, '"'), "value", e4), e4; } var N2 = new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"); }, 62914: (e3, t3, r3) => { Object.defineProperty(t3, "RQ", { enumerable: true, get: function() { return i2.AbiCoder; } }), Object.defineProperty(t3, "_R", { enumerable: true, get: function() { return n2.ParamType; } }); var n2 = r3(60800), i2 = r3(44937); r3(69044); }, 69044: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.TransactionDescription = t3.LogDescription = t3.Interface = t3.Indexed = t3.ErrorDescription = void 0, Object.defineProperty(t3, "checkResultErrors", { enumerable: true, get: function() { return y2.checkResultErrors; } }); var i2 = n2(r3(58985)), o2 = n2(r3(69721)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)), c2 = r3(77921), f2 = r3(34952), d2 = r3(908), l2 = r3(37515), h2 = r3(64642), p2 = r3(23694), b2 = r3(44937), y2 = r3(17316), v2 = r3(60800), m2 = r3(64327), g2 = r3(98067); function w2(e4) { var t4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(); return function() { var r4, n3 = (0, u2.default)(e4); if (t4) { var i3 = (0, u2.default)(this).constructor; r4 = Reflect.construct(n3, arguments, i3); } else r4 = n3.apply(this, arguments); return (0, s2.default)(this, r4); }; } var k2 = new m2.Logger(g2.version), _2 = function(e4) { (0, a2.default)(r4, e4); var t4 = w2(r4); function r4() { return (0, o2.default)(this, r4), t4.apply(this, arguments); } return (0, i2.default)(r4); }(p2.Description); t3.LogDescription = _2; var A2 = function(e4) { (0, a2.default)(r4, e4); var t4 = w2(r4); function r4() { return (0, o2.default)(this, r4), t4.apply(this, arguments); } return (0, i2.default)(r4); }(p2.Description); t3.TransactionDescription = A2; var E2 = function(e4) { (0, a2.default)(r4, e4); var t4 = w2(r4); function r4() { return (0, o2.default)(this, r4), t4.apply(this, arguments); } return (0, i2.default)(r4); }(p2.Description); t3.ErrorDescription = E2; var S2 = function(e4) { (0, a2.default)(r4, e4); var t4 = w2(r4); function r4() { return (0, o2.default)(this, r4), t4.apply(this, arguments); } return (0, i2.default)(r4, null, [{ key: "isIndexed", value: function(e5) { return !(!e5 || !e5._isIndexed); } }]), r4; }(p2.Description); t3.Indexed = S2; var x2 = { "0x08c379a0": { signature: "Error(string)", name: "Error", inputs: ["string"], reason: true }, "0x4e487b71": { signature: "Panic(uint256)", name: "Panic", inputs: ["uint256"] } }; function B2(e4, t4) { var r4 = new Error("deferred error during ABI decoding triggered accessing ".concat(e4)); return r4.error = t4, r4; } var O2 = function() { function e4(t4) { var r4 = this; (0, o2.default)(this, e4); var n3 = []; n3 = "string" == typeof t4 ? JSON.parse(t4) : t4, (0, p2.defineReadOnly)(this, "fragments", n3.map(function(e5) { return v2.Fragment.from(e5); }).filter(function(e5) { return null != e5; })), (0, p2.defineReadOnly)(this, "_abiCoder", (0, p2.getStatic)(this instanceof e4 ? this.constructor : void 0, "getAbiCoder")()), (0, p2.defineReadOnly)(this, "functions", {}), (0, p2.defineReadOnly)(this, "errors", {}), (0, p2.defineReadOnly)(this, "events", {}), (0, p2.defineReadOnly)(this, "structs", {}), this.fragments.forEach(function(e5) { var t5 = null; switch (e5.type) { case "constructor": return r4.deploy ? void k2.warn("duplicate definition - constructor") : void (0, p2.defineReadOnly)(r4, "deploy", e5); case "function": t5 = r4.functions; break; case "event": t5 = r4.events; break; case "error": t5 = r4.errors; break; default: return; } var n4 = e5.format(); t5[n4] ? k2.warn("duplicate definition - " + n4) : t5[n4] = e5; }), this.deploy || (0, p2.defineReadOnly)(this, "deploy", v2.ConstructorFragment.from({ payable: false, type: "constructor" })), (0, p2.defineReadOnly)(this, "_isInterface", true); } return (0, i2.default)(e4, [{ key: "format", value: function(e5) { e5 || (e5 = v2.FormatTypes.full), e5 === v2.FormatTypes.sighash && k2.throwArgumentError("interface does not support formatting sighash", "format", e5); var t4 = this.fragments.map(function(t5) { return t5.format(e5); }); return e5 === v2.FormatTypes.json ? JSON.stringify(t4.map(function(e6) { return JSON.parse(e6); })) : t4; } }, { key: "getFunction", value: function(e5) { if ((0, d2.isHexString)(e5)) { for (var t4 in this.functions) if (e5 === this.getSighash(t4)) return this.functions[t4]; k2.throwArgumentError("no matching function", "sighash", e5); } if (-1 === e5.indexOf("(")) { var r4 = e5.trim(), n3 = Object.keys(this.functions).filter(function(e6) { return e6.split("(")[0] === r4; }); return 0 === n3.length ? k2.throwArgumentError("no matching function", "name", r4) : n3.length > 1 && k2.throwArgumentError("multiple matching functions", "name", r4), this.functions[n3[0]]; } var i3 = this.functions[v2.FunctionFragment.fromString(e5).format()]; return i3 || k2.throwArgumentError("no matching function", "signature", e5), i3; } }, { key: "getEvent", value: function(e5) { if ((0, d2.isHexString)(e5)) { var t4 = e5.toLowerCase(); for (var r4 in this.events) if (t4 === this.getEventTopic(r4)) return this.events[r4]; k2.throwArgumentError("no matching event", "topichash", t4); } if (-1 === e5.indexOf("(")) { var n3 = e5.trim(), i3 = Object.keys(this.events).filter(function(e6) { return e6.split("(")[0] === n3; }); return 0 === i3.length ? k2.throwArgumentError("no matching event", "name", n3) : i3.length > 1 && k2.throwArgumentError("multiple matching events", "name", n3), this.events[i3[0]]; } var o3 = this.events[v2.EventFragment.fromString(e5).format()]; return o3 || k2.throwArgumentError("no matching event", "signature", e5), o3; } }, { key: "getError", value: function(e5) { if ((0, d2.isHexString)(e5)) { var t4 = (0, p2.getStatic)(this.constructor, "getSighash"); for (var r4 in this.errors) if (e5 === t4(this.errors[r4])) return this.errors[r4]; k2.throwArgumentError("no matching error", "sighash", e5); } if (-1 === e5.indexOf("(")) { var n3 = e5.trim(), i3 = Object.keys(this.errors).filter(function(e6) { return e6.split("(")[0] === n3; }); return 0 === i3.length ? k2.throwArgumentError("no matching error", "name", n3) : i3.length > 1 && k2.throwArgumentError("multiple matching errors", "name", n3), this.errors[i3[0]]; } var o3 = this.errors[v2.FunctionFragment.fromString(e5).format()]; return o3 || k2.throwArgumentError("no matching error", "signature", e5), o3; } }, { key: "getSighash", value: function(e5) { if ("string" == typeof e5) try { e5 = this.getFunction(e5); } catch (t4) { try { e5 = this.getError(e5); } catch (e6) { throw t4; } } return (0, p2.getStatic)(this.constructor, "getSighash")(e5); } }, { key: "getEventTopic", value: function(e5) { return "string" == typeof e5 && (e5 = this.getEvent(e5)), (0, p2.getStatic)(this.constructor, "getEventTopic")(e5); } }, { key: "_decodeParams", value: function(e5, t4) { return this._abiCoder.decode(e5, t4); } }, { key: "_encodeParams", value: function(e5, t4) { return this._abiCoder.encode(e5, t4); } }, { key: "encodeDeploy", value: function(e5) { return this._encodeParams(this.deploy.inputs, e5 || []); } }, { key: "decodeErrorResult", value: function(e5, t4) { "string" == typeof e5 && (e5 = this.getError(e5)); var r4 = (0, d2.arrayify)(t4); return (0, d2.hexlify)(r4.slice(0, 4)) !== this.getSighash(e5) && k2.throwArgumentError("data signature does not match error ".concat(e5.name, "."), "data", (0, d2.hexlify)(r4)), this._decodeParams(e5.inputs, r4.slice(4)); } }, { key: "encodeErrorResult", value: function(e5, t4) { return "string" == typeof e5 && (e5 = this.getError(e5)), (0, d2.hexlify)((0, d2.concat)([this.getSighash(e5), this._encodeParams(e5.inputs, t4 || [])])); } }, { key: "decodeFunctionData", value: function(e5, t4) { "string" == typeof e5 && (e5 = this.getFunction(e5)); var r4 = (0, d2.arrayify)(t4); return (0, d2.hexlify)(r4.slice(0, 4)) !== this.getSighash(e5) && k2.throwArgumentError("data signature does not match function ".concat(e5.name, "."), "data", (0, d2.hexlify)(r4)), this._decodeParams(e5.inputs, r4.slice(4)); } }, { key: "encodeFunctionData", value: function(e5, t4) { return "string" == typeof e5 && (e5 = this.getFunction(e5)), (0, d2.hexlify)((0, d2.concat)([this.getSighash(e5), this._encodeParams(e5.inputs, t4 || [])])); } }, { key: "decodeFunctionResult", value: function(e5, t4) { "string" == typeof e5 && (e5 = this.getFunction(e5)); var r4 = (0, d2.arrayify)(t4), n3 = null, i3 = "", o3 = null, a3 = null, s3 = null; switch (r4.length % this._abiCoder._getWordSize()) { case 0: try { return this._abiCoder.decode(e5.outputs, r4); } catch (f4) { } break; case 4: var u3 = (0, d2.hexlify)(r4.slice(0, 4)), c3 = x2[u3]; if (c3) o3 = this._abiCoder.decode(c3.inputs, r4.slice(4)), a3 = c3.name, s3 = c3.signature, c3.reason && (n3 = o3[0]), "Error" === a3 ? i3 = "; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o3[0])) : "Panic" === a3 && (i3 = "; VM Exception while processing transaction: reverted with panic code ".concat(o3[0])); else try { var f3 = this.getError(u3); o3 = this._abiCoder.decode(f3.inputs, r4.slice(4)), a3 = f3.name, s3 = f3.format(); } catch (f4) { } } return k2.throwError("call revert exception" + i3, m2.Logger.errors.CALL_EXCEPTION, { method: e5.format(), data: (0, d2.hexlify)(t4), errorArgs: o3, errorName: a3, errorSignature: s3, reason: n3 }); } }, { key: "encodeFunctionResult", value: function(e5, t4) { return "string" == typeof e5 && (e5 = this.getFunction(e5)), (0, d2.hexlify)(this._abiCoder.encode(e5.outputs, t4 || [])); } }, { key: "encodeFilterTopics", value: function(e5, t4) { var r4 = this; "string" == typeof e5 && (e5 = this.getEvent(e5)), t4.length > e5.inputs.length && k2.throwError("too many arguments for " + e5.format(), m2.Logger.errors.UNEXPECTED_ARGUMENT, { argument: "values", value: t4 }); var n3 = []; e5.anonymous || n3.push(this.getEventTopic(e5)); var i3 = function(e6, t5) { return "string" === e6.type ? (0, l2.id)(t5) : "bytes" === e6.type ? (0, h2.keccak256)((0, d2.hexlify)(t5)) : ("bool" === e6.type && "boolean" == typeof t5 && (t5 = t5 ? "0x01" : "0x00"), e6.type.match(/^u?int/) && (t5 = f2.BigNumber.from(t5).toHexString()), "address" === e6.type && r4._abiCoder.encode(["address"], [t5]), (0, d2.hexZeroPad)((0, d2.hexlify)(t5), 32)); }; for (t4.forEach(function(t5, r5) { var o3 = e5.inputs[r5]; o3.indexed ? null == t5 ? n3.push(null) : "array" === o3.baseType || "tuple" === o3.baseType ? k2.throwArgumentError("filtering with tuples or arrays not supported", "contract." + o3.name, t5) : Array.isArray(t5) ? n3.push(t5.map(function(e6) { return i3(o3, e6); })) : n3.push(i3(o3, t5)) : null != t5 && k2.throwArgumentError("cannot filter non-indexed parameters; must be null", "contract." + o3.name, t5); }); n3.length && null === n3[n3.length - 1]; ) n3.pop(); return n3; } }, { key: "encodeEventLog", value: function(e5, t4) { var r4 = this; "string" == typeof e5 && (e5 = this.getEvent(e5)); var n3 = [], i3 = [], o3 = []; return e5.anonymous || n3.push(this.getEventTopic(e5)), t4.length !== e5.inputs.length && k2.throwArgumentError("event arguments/values mismatch", "values", t4), e5.inputs.forEach(function(e6, a3) { var s3 = t4[a3]; if (e6.indexed) if ("string" === e6.type) n3.push((0, l2.id)(s3)); else if ("bytes" === e6.type) n3.push((0, h2.keccak256)(s3)); else { if ("tuple" === e6.baseType || "array" === e6.baseType) throw new Error("not implemented"); n3.push(r4._abiCoder.encode([e6.type], [s3])); } else i3.push(e6), o3.push(s3); }), { data: this._abiCoder.encode(i3, o3), topics: n3 }; } }, { key: "decodeEventLog", value: function(e5, t4, r4) { if ("string" == typeof e5 && (e5 = this.getEvent(e5)), null != r4 && !e5.anonymous) { var n3 = this.getEventTopic(e5); (0, d2.isHexString)(r4[0], 32) && r4[0].toLowerCase() === n3 || k2.throwError("fragment/topic mismatch", m2.Logger.errors.INVALID_ARGUMENT, { argument: "topics[0]", expected: n3, value: r4[0] }), r4 = r4.slice(1); } var i3 = [], o3 = [], a3 = []; e5.inputs.forEach(function(e6, t5) { e6.indexed ? "string" === e6.type || "bytes" === e6.type || "tuple" === e6.baseType || "array" === e6.baseType ? (i3.push(v2.ParamType.fromObject({ type: "bytes32", name: e6.name })), a3.push(true)) : (i3.push(e6), a3.push(false)) : (o3.push(e6), a3.push(false)); }); var s3 = null != r4 ? this._abiCoder.decode(i3, (0, d2.concat)(r4)) : null, u3 = this._abiCoder.decode(o3, t4, true), c3 = [], f3 = 0, l3 = 0; e5.inputs.forEach(function(e6, t5) { if (e6.indexed) if (null == s3) c3[t5] = new S2({ _isIndexed: true, hash: null }); else if (a3[t5]) c3[t5] = new S2({ _isIndexed: true, hash: s3[l3++] }); else try { c3[t5] = s3[l3++]; } catch (e7) { c3[t5] = e7; } else try { c3[t5] = u3[f3++]; } catch (e7) { c3[t5] = e7; } if (e6.name && null == c3[e6.name]) { var r5 = c3[t5]; r5 instanceof Error ? Object.defineProperty(c3, e6.name, { enumerable: true, get: function() { throw B2("property ".concat(JSON.stringify(e6.name)), r5); } }) : c3[e6.name] = r5; } }); for (var h3 = function(e6) { var t5 = c3[e6]; t5 instanceof Error && Object.defineProperty(c3, e6, { enumerable: true, get: function() { throw B2("index ".concat(e6), t5); } }); }, p3 = 0; p3 < c3.length; p3++) h3(p3); return Object.freeze(c3); } }, { key: "parseTransaction", value: function(e5) { var t4 = this.getFunction(e5.data.substring(0, 10).toLowerCase()); return t4 ? new A2({ args: this._abiCoder.decode(t4.inputs, "0x" + e5.data.substring(10)), functionFragment: t4, name: t4.name, signature: t4.format(), sighash: this.getSighash(t4), value: f2.BigNumber.from(e5.value || "0") }) : null; } }, { key: "parseLog", value: function(e5) { var t4 = this.getEvent(e5.topics[0]); return !t4 || t4.anonymous ? null : new _2({ eventFragment: t4, name: t4.name, signature: t4.format(), topic: this.getEventTopic(t4), args: this.decodeEventLog(t4, e5.data, e5.topics) }); } }, { key: "parseError", value: function(e5) { var t4 = (0, d2.hexlify)(e5), r4 = this.getError(t4.substring(0, 10).toLowerCase()); return r4 ? new E2({ args: this._abiCoder.decode(r4.inputs, "0x" + t4.substring(10)), errorFragment: r4, name: r4.name, signature: r4.format(), sighash: this.getSighash(r4) }) : null; } }], [{ key: "getAbiCoder", value: function() { return b2.defaultAbiCoder; } }, { key: "getAddress", value: function(e5) { return (0, c2.getAddress)(e5); } }, { key: "getSighash", value: function(e5) { return (0, d2.hexDataSlice)((0, l2.id)(e5.format()), 0, 4); } }, { key: "getEventTopic", value: function(e5) { return (0, l2.id)(e5.format()); } }, { key: "isInterface", value: function(e5) { return !(!e5 || !e5._isInterface); } }]), e4; }(); t3.Interface = O2; }, 88222: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.version = void 0, t3.version = "address/5.7.0"; }, 77921: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.getAddress = v2, t3.getContractAddress = function(e4) { var t4 = null; try { t4 = v2(e4.from); } catch (t5) { c2.throwArgumentError("missing from address", "transaction", e4); } var r4 = (0, n2.stripZeros)((0, n2.arrayify)(i2.BigNumber.from(e4.nonce).toHexString())); return v2((0, n2.hexDataSlice)((0, o2.keccak256)((0, a2.encode)([t4, r4])), 12)); }, t3.getCreate2Address = function(e4, t4, r4) { return 32 !== (0, n2.hexDataLength)(t4) && c2.throwArgumentError("salt must be 32 bytes", "salt", t4), 32 !== (0, n2.hexDataLength)(r4) && c2.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", r4), v2((0, n2.hexDataSlice)((0, o2.keccak256)((0, n2.concat)(["0xff", v2(e4), t4, r4])), 12)); }, t3.getIcapAddress = function(e4) { for (var t4 = (0, i2._base16To36)(v2(e4).substring(2)).toUpperCase(); t4.length < 30; ) t4 = "0" + t4; return "XE" + y2("XE00" + t4) + t4; }, t3.isAddress = function(e4) { try { return v2(e4), true; } catch (e5) { } return false; }; var n2 = r3(908), i2 = r3(34952), o2 = r3(64642), a2 = r3(55265), s2 = r3(64327), u2 = r3(88222), c2 = new s2.Logger(u2.version); function f2(e4) { (0, n2.isHexString)(e4, 20) || c2.throwArgumentError("invalid address", "address", e4); for (var t4 = (e4 = e4.toLowerCase()).substring(2).split(""), r4 = new Uint8Array(40), i3 = 0; i3 < 40; i3++) r4[i3] = t4[i3].charCodeAt(0); for (var a3 = (0, n2.arrayify)((0, o2.keccak256)(r4)), s3 = 0; s3 < 40; s3 += 2) a3[s3 >> 1] >> 4 >= 8 && (t4[s3] = t4[s3].toUpperCase()), (15 & a3[s3 >> 1]) >= 8 && (t4[s3 + 1] = t4[s3 + 1].toUpperCase()); return "0x" + t4.join(""); } for (var d2 = {}, l2 = 0; l2 < 10; l2++) d2[String(l2)] = String(l2); for (var h2 = 0; h2 < 26; h2++) d2[String.fromCharCode(65 + h2)] = String(10 + h2); var p2, b2 = Math.floor((p2 = 9007199254740991, Math.log10 ? Math.log10(p2) : Math.log(p2) / Math.LN10)); function y2(e4) { for (var t4 = (e4 = (e4 = e4.toUpperCase()).substring(4) + e4.substring(0, 2) + "00").split("").map(function(e5) { return d2[e5]; }).join(""); t4.length >= b2; ) { var r4 = t4.substring(0, b2); t4 = parseInt(r4, 10) % 97 + t4.substring(r4.length); } for (var n3 = String(98 - parseInt(t4, 10) % 97); n3.length < 2; ) n3 = "0" + n3; return n3; } function v2(e4) { var t4 = null; if ("string" != typeof e4 && c2.throwArgumentError("invalid address", "address", e4), e4.match(/^(0x)?[0-9a-fA-F]{40}$/)) "0x" !== e4.substring(0, 2) && (e4 = "0x" + e4), t4 = f2(e4), e4.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && t4 !== e4 && c2.throwArgumentError("bad address checksum", "address", e4); else if (e4.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) { for (e4.substring(2, 4) !== y2(e4) && c2.throwArgumentError("bad icap checksum", "address", e4), t4 = (0, i2._base36To16)(e4.substring(4)); t4.length < 40; ) t4 = "0" + t4; t4 = f2("0x" + t4); } else c2.throwArgumentError("invalid address", "address", e4); return t4; } }, 75798: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.decode = function(e4) { e4 = atob(e4); for (var t4 = [], r4 = 0; r4 < e4.length; r4++) t4.push(e4.charCodeAt(r4)); return (0, n2.arrayify)(t4); }, t3.encode = function(e4) { e4 = (0, n2.arrayify)(e4); for (var t4 = "", r4 = 0; r4 < e4.length; r4++) t4 += String.fromCharCode(e4[r4]); return btoa(t4); }; var n2 = r3(908); }, 80997: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), Object.defineProperty(t3, "decode", { enumerable: true, get: function() { return n2.decode; } }), Object.defineProperty(t3, "encode", { enumerable: true, get: function() { return n2.encode; } }); var n2 = r3(75798); }, 3042: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.version = void 0, t3.version = "bignumber/5.7.0"; }, 1872: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.BigNumber = void 0, t3._base16To36 = function(e4) { return new f2(e4, 16).toString(36); }, t3._base36To16 = function(e4) { return new f2(e4, 36).toString(16); }, t3.isBigNumberish = function(e4) { return null != e4 && (b2.isBigNumber(e4) || "number" == typeof e4 && e4 % 1 == 0 || "string" == typeof e4 && !!e4.match(/^-?[0-9]+$/) || (0, s2.isHexString)(e4) || "bigint" == typeof e4 || (0, s2.isBytes)(e4)); }; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(31734)), s2 = r3(908), u2 = r3(64327), c2 = r3(3042), f2 = a2.default.BN, d2 = new u2.Logger(c2.version), l2 = {}, h2 = 9007199254740991, p2 = false, b2 = function() { function e4(t4, r4) { (0, i2.default)(this, e4), t4 !== l2 && d2.throwError("cannot call constructor directly; use BigNumber.from", u2.Logger.errors.UNSUPPORTED_OPERATION, { operation: "new (BigNumber)" }), this._hex = r4, this._isBigNumber = true, Object.freeze(this); } return (0, o2.default)(e4, [{ key: "fromTwos", value: function(e5) { return v2(m2(this).fromTwos(e5)); } }, { key: "toTwos", value: function(e5) { return v2(m2(this).toTwos(e5)); } }, { key: "abs", value: function() { return "-" === this._hex[0] ? e4.from(this._hex.substring(1)) : this; } }, { key: "add", value: function(e5) { return v2(m2(this).add(m2(e5))); } }, { key: "sub", value: function(e5) { return v2(m2(this).sub(m2(e5))); } }, { key: "div", value: function(t4) { return e4.from(t4).isZero() && g2("division-by-zero", "div"), v2(m2(this).div(m2(t4))); } }, { key: "mul", value: function(e5) { return v2(m2(this).mul(m2(e5))); } }, { key: "mod", value: function(e5) { var t4 = m2(e5); return t4.isNeg() && g2("division-by-zero", "mod"), v2(m2(this).umod(t4)); } }, { key: "pow", value: function(e5) { var t4 = m2(e5); return t4.isNeg() && g2("negative-power", "pow"), v2(m2(this).pow(t4)); } }, { key: "and", value: function(e5) { var t4 = m2(e5); return (this.isNegative() || t4.isNeg()) && g2("unbound-bitwise-result", "and"), v2(m2(this).and(t4)); } }, { key: "or", value: function(e5) { var t4 = m2(e5); return (this.isNegative() || t4.isNeg()) && g2("unbound-bitwise-result", "or"), v2(m2(this).or(t4)); } }, { key: "xor", value: function(e5) { var t4 = m2(e5); return (this.isNegative() || t4.isNeg()) && g2("unbound-bitwise-result", "xor"), v2(m2(this).xor(t4)); } }, { key: "mask", value: function(e5) { return (this.isNegative() || e5 < 0) && g2("negative-width", "mask"), v2(m2(this).maskn(e5)); } }, { key: "shl", value: function(e5) { return (this.isNegative() || e5 < 0) && g2("negative-width", "shl"), v2(m2(this).shln(e5)); } }, { key: "shr", value: function(e5) { return (this.isNegative() || e5 < 0) && g2("negative-width", "shr"), v2(m2(this).shrn(e5)); } }, { key: "eq", value: function(e5) { return m2(this).eq(m2(e5)); } }, { key: "lt", value: function(e5) { return m2(this).lt(m2(e5)); } }, { key: "lte", value: function(e5) { return m2(this).lte(m2(e5)); } }, { key: "gt", value: function(e5) { return m2(this).gt(m2(e5)); } }, { key: "gte", value: function(e5) { return m2(this).gte(m2(e5)); } }, { key: "isNegative", value: function() { return "-" === this._hex[0]; } }, { key: "isZero", value: function() { return m2(this).isZero(); } }, { key: "toNumber", value: function() { try { return m2(this).toNumber(); } catch (e5) { g2("overflow", "toNumber", this.toString()); } return null; } }, { key: "toBigInt", value: function() { try { return BigInt(this.toString()); } catch (e5) { } return d2.throwError("this platform does not support BigInt", u2.Logger.errors.UNSUPPORTED_OPERATION, { value: this.toString() }); } }, { key: "toString", value: function() { return arguments.length > 0 && (10 === arguments[0] ? p2 || (p2 = true, d2.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")) : 16 === arguments[0] ? d2.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", u2.Logger.errors.UNEXPECTED_ARGUMENT, {}) : d2.throwError("BigNumber.toString does not accept parameters", u2.Logger.errors.UNEXPECTED_ARGUMENT, {})), m2(this).toString(10); } }, { key: "toHexString", value: function() { return this._hex; } }, { key: "toJSON", value: function(e5) { return { type: "BigNumber", hex: this.toHexString() }; } }], [{ key: "from", value: function(t4) { if (t4 instanceof e4) return t4; if ("string" == typeof t4) return t4.match(/^-?0x[0-9a-f]+$/i) ? new e4(l2, y2(t4)) : t4.match(/^-?[0-9]+$/) ? new e4(l2, y2(new f2(t4))) : d2.throwArgumentError("invalid BigNumber string", "value", t4); if ("number" == typeof t4) return t4 % 1 && g2("underflow", "BigNumber.from", t4), (t4 >= h2 || t4 <= -h2) && g2("overflow", "BigNumber.from", t4), e4.from(String(t4)); var r4 = t4; if ("bigint" == typeof r4) return e4.from(r4.toString()); if ((0, s2.isBytes)(r4)) return e4.from((0, s2.hexlify)(r4)); if (r4) if (r4.toHexString) { var n3 = r4.toHexString(); if ("string" == typeof n3) return e4.from(n3); } else { var i3 = r4._hex; if (null == i3 && "BigNumber" === r4.type && (i3 = r4.hex), "string" == typeof i3 && ((0, s2.isHexString)(i3) || "-" === i3[0] && (0, s2.isHexString)(i3.substring(1)))) return e4.from(i3); } return d2.throwArgumentError("invalid BigNumber value", "value", t4); } }, { key: "isBigNumber", value: function(e5) { return !(!e5 || !e5._isBigNumber); } }]), e4; }(); function y2(e4) { if ("string" != typeof e4) return y2(e4.toString(16)); if ("-" === e4[0]) return "-" === (e4 = e4.substring(1))[0] && d2.throwArgumentError("invalid hex", "value", e4), "0x00" === (e4 = y2(e4)) ? e4 : "-" + e4; if ("0x" !== e4.substring(0, 2) && (e4 = "0x" + e4), "0x" === e4) return "0x00"; for (e4.length % 2 && (e4 = "0x0" + e4.substring(2)); e4.length > 4 && "0x00" === e4.substring(0, 4); ) e4 = "0x" + e4.substring(4); return e4; } function v2(e4) { return b2.from(y2(e4)); } function m2(e4) { var t4 = b2.from(e4).toHexString(); return "-" === t4[0] ? new f2("-" + t4.substring(3), 16) : new f2(t4.substring(2), 16); } function g2(e4, t4, r4) { var n3 = { fault: e4, operation: t4 }; return null != r4 && (n3.value = r4), d2.throwError(e4, u2.Logger.errors.NUMERIC_FAULT, n3); } t3.BigNumber = b2; }, 68390: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.FixedNumber = t3.FixedFormat = void 0, t3.formatFixed = m2, t3.parseFixed = g2; var i2 = n2(r3(3355)), o2 = n2(r3(69721)), a2 = n2(r3(58985)), s2 = r3(908), u2 = r3(64327), c2 = r3(3042), f2 = r3(1872), d2 = new u2.Logger(c2.version), l2 = {}, h2 = f2.BigNumber.from(0), p2 = f2.BigNumber.from(-1); function b2(e4, t4, r4, n3) { var i3 = { fault: t4, operation: r4 }; return void 0 !== n3 && (i3.value = n3), d2.throwError(e4, u2.Logger.errors.NUMERIC_FAULT, i3); } for (var y2 = "0"; y2.length < 256; ) y2 += y2; function v2(e4) { if ("number" != typeof e4) try { e4 = f2.BigNumber.from(e4).toNumber(); } catch (e5) { } return "number" == typeof e4 && e4 >= 0 && e4 <= 256 && !(e4 % 1) ? "1" + y2.substring(0, e4) : d2.throwArgumentError("invalid decimal size", "decimals", e4); } function m2(e4, t4) { null == t4 && (t4 = 0); var r4 = v2(t4), n3 = (e4 = f2.BigNumber.from(e4)).lt(h2); n3 && (e4 = e4.mul(p2)); for (var i3 = e4.mod(r4).toString(); i3.length < r4.length - 1; ) i3 = "0" + i3; i3 = i3.match(/^([0-9]*[1-9]|0)(0*)/)[1]; var o3 = e4.div(r4).toString(); return e4 = 1 === r4.length ? o3 : o3 + "." + i3, n3 && (e4 = "-" + e4), e4; } function g2(e4, t4) { null == t4 && (t4 = 0); var r4 = v2(t4); "string" == typeof e4 && e4.match(/^-?[0-9.]+$/) || d2.throwArgumentError("invalid decimal value", "value", e4); var n3 = "-" === e4.substring(0, 1); n3 && (e4 = e4.substring(1)), "." === e4 && d2.throwArgumentError("missing value", "value", e4); var i3 = e4.split("."); i3.length > 2 && d2.throwArgumentError("too many decimal points", "value", e4); var o3 = i3[0], a3 = i3[1]; for (o3 || (o3 = "0"), a3 || (a3 = "0"); "0" === a3[a3.length - 1]; ) a3 = a3.substring(0, a3.length - 1); for (a3.length > r4.length - 1 && b2("fractional component exceeds decimals", "underflow", "parseFixed"), "" === a3 && (a3 = "0"); a3.length < r4.length - 1; ) a3 += "0"; var s3 = f2.BigNumber.from(o3), u3 = f2.BigNumber.from(a3), c3 = s3.mul(r4).add(u3); return n3 && (c3 = c3.mul(p2)), c3; } var w2 = function() { function e4(t4, r4, n3, i3) { (0, o2.default)(this, e4), t4 !== l2 && d2.throwError("cannot use FixedFormat constructor; use FixedFormat.from", u2.Logger.errors.UNSUPPORTED_OPERATION, { operation: "new FixedFormat" }), this.signed = r4, this.width = n3, this.decimals = i3, this.name = (r4 ? "" : "u") + "fixed" + String(n3) + "x" + String(i3), this._multiplier = v2(i3), Object.freeze(this); } return (0, a2.default)(e4, null, [{ key: "from", value: function(t4) { if (t4 instanceof e4) return t4; "number" == typeof t4 && (t4 = "fixed128x".concat(t4)); var r4 = true, n3 = 128, o3 = 18; if ("string" == typeof t4) if ("fixed" === t4) ; else if ("ufixed" === t4) r4 = false; else { var a3 = t4.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); a3 || d2.throwArgumentError("invalid fixed format", "format", t4), r4 = "u" !== a3[1], n3 = parseInt(a3[2]), o3 = parseInt(a3[3]); } else if (t4) { var s3 = function(e5, r5, n4) { return null == t4[e5] ? n4 : ((0, i2.default)(t4[e5]) !== r5 && d2.throwArgumentError("invalid fixed format (" + e5 + " not " + r5 + ")", "format." + e5, t4[e5]), t4[e5]); }; r4 = s3("signed", "boolean", r4), n3 = s3("width", "number", n3), o3 = s3("decimals", "number", o3); } return n3 % 8 && d2.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", n3), o3 > 80 && d2.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", o3), new e4(l2, r4, n3, o3); } }]), e4; }(); t3.FixedFormat = w2; var k2 = function() { function e4(t4, r4, n3, i3) { (0, o2.default)(this, e4), t4 !== l2 && d2.throwError("cannot use FixedNumber constructor; use FixedNumber.from", u2.Logger.errors.UNSUPPORTED_OPERATION, { operation: "new FixedFormat" }), this.format = i3, this._hex = r4, this._value = n3, this._isFixedNumber = true, Object.freeze(this); } return (0, a2.default)(e4, [{ key: "_checkFormat", value: function(e5) { this.format.name !== e5.format.name && d2.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", e5); } }, { key: "addUnsafe", value: function(t4) { this._checkFormat(t4); var r4 = g2(this._value, this.format.decimals), n3 = g2(t4._value, t4.format.decimals); return e4.fromValue(r4.add(n3), this.format.decimals, this.format); } }, { key: "subUnsafe", value: function(t4) { this._checkFormat(t4); var r4 = g2(this._value, this.format.decimals), n3 = g2(t4._value, t4.format.decimals); return e4.fromValue(r4.sub(n3), this.format.decimals, this.format); } }, { key: "mulUnsafe", value: function(t4) { this._checkFormat(t4); var r4 = g2(this._value, this.format.decimals), n3 = g2(t4._value, t4.format.decimals); return e4.fromValue(r4.mul(n3).div(this.format._multiplier), this.format.decimals, this.format); } }, { key: "divUnsafe", value: function(t4) { this._checkFormat(t4); var r4 = g2(this._value, this.format.decimals), n3 = g2(t4._value, t4.format.decimals); return e4.fromValue(r4.mul(this.format._multiplier).div(n3), this.format.decimals, this.format); } }, { key: "floor", value: function() { var t4 = this.toString().split("."); 1 === t4.length && t4.push("0"); var r4 = e4.from(t4[0], this.format), n3 = !t4[1].match(/^(0*)$/); return this.isNegative() && n3 && (r4 = r4.subUnsafe(_2.toFormat(r4.format))), r4; } }, { key: "ceiling", value: function() { var t4 = this.toString().split("."); 1 === t4.length && t4.push("0"); var r4 = e4.from(t4[0], this.format), n3 = !t4[1].match(/^(0*)$/); return !this.isNegative() && n3 && (r4 = r4.addUnsafe(_2.toFormat(r4.format))), r4; } }, { key: "round", value: function(t4) { null == t4 && (t4 = 0); var r4 = this.toString().split("."); if (1 === r4.length && r4.push("0"), (t4 < 0 || t4 > 80 || t4 % 1) && d2.throwArgumentError("invalid decimal count", "decimals", t4), r4[1].length <= t4) return this; var n3 = e4.from("1" + y2.substring(0, t4), this.format), i3 = A2.toFormat(this.format); return this.mulUnsafe(n3).addUnsafe(i3).floor().divUnsafe(n3); } }, { key: "isZero", value: function() { return "0.0" === this._value || "0" === this._value; } }, { key: "isNegative", value: function() { return "-" === this._value[0]; } }, { key: "toString", value: function() { return this._value; } }, { key: "toHexString", value: function(e5) { if (null == e5) return this._hex; e5 % 8 && d2.throwArgumentError("invalid byte width", "width", e5); var t4 = f2.BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(e5).toHexString(); return (0, s2.hexZeroPad)(t4, e5 / 8); } }, { key: "toUnsafeFloat", value: function() { return parseFloat(this.toString()); } }, { key: "toFormat", value: function(t4) { return e4.fromString(this._value, t4); } }], [{ key: "fromValue", value: function(t4, r4, n3) { return null != n3 || null == r4 || (0, f2.isBigNumberish)(r4) || (n3 = r4, r4 = null), null == r4 && (r4 = 0), null == n3 && (n3 = "fixed"), e4.fromString(m2(t4, r4), w2.from(n3)); } }, { key: "fromString", value: function(t4, r4) { null == r4 && (r4 = "fixed"); var n3 = w2.from(r4), i3 = g2(t4, n3.decimals); !n3.signed && i3.lt(h2) && b2("unsigned value cannot be negative", "overflow", "value", t4); var o3 = null; n3.signed ? o3 = i3.toTwos(n3.width).toHexString() : (o3 = i3.toHexString(), o3 = (0, s2.hexZeroPad)(o3, n3.width / 8)); var a3 = m2(i3, n3.decimals); return new e4(l2, o3, a3, n3); } }, { key: "fromBytes", value: function(t4, r4) { null == r4 && (r4 = "fixed"); var n3 = w2.from(r4); if ((0, s2.arrayify)(t4).length > n3.width / 8) throw new Error("overflow"); var i3 = f2.BigNumber.from(t4); n3.signed && (i3 = i3.fromTwos(n3.width)); var o3 = i3.toTwos((n3.signed ? 0 : 1) + n3.width).toHexString(), a3 = m2(i3, n3.decimals); return new e4(l2, o3, a3, n3); } }, { key: "from", value: function(t4, r4) { if ("string" == typeof t4) return e4.fromString(t4, r4); if ((0, s2.isBytes)(t4)) return e4.fromBytes(t4, r4); try { return e4.fromValue(t4, 0, r4); } catch (e5) { if (e5.code !== u2.Logger.errors.INVALID_ARGUMENT) throw e5; } return d2.throwArgumentError("invalid FixedNumber value", "value", t4); } }, { key: "isFixedNumber", value: function(e5) { return !(!e5 || !e5._isFixedNumber); } }]), e4; }(); t3.FixedNumber = k2; var _2 = k2.from(1), A2 = k2.from("0.5"); }, 34952: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), Object.defineProperty(t3, "BigNumber", { enumerable: true, get: function() { return n2.BigNumber; } }), Object.defineProperty(t3, "FixedFormat", { enumerable: true, get: function() { return i2.FixedFormat; } }), Object.defineProperty(t3, "FixedNumber", { enumerable: true, get: function() { return i2.FixedNumber; } }), Object.defineProperty(t3, "_base16To36", { enumerable: true, get: function() { return n2._base16To36; } }), Object.defineProperty(t3, "_base36To16", { enumerable: true, get: function() { return n2._base36To16; } }), Object.defineProperty(t3, "formatFixed", { enumerable: true, get: function() { return i2.formatFixed; } }), Object.defineProperty(t3, "parseFixed", { enumerable: true, get: function() { return i2.parseFixed; } }); var n2 = r3(1872), i2 = r3(68390); }, 8729: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.version = void 0, t3.version = "bytes/5.7.0"; }, 908: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.arrayify = d2, t3.concat = l2, t3.hexConcat = function(e4) { var t4 = "0x"; return e4.forEach(function(e5) { t4 += y2(e5).substring(2); }), t4; }, t3.hexDataLength = function(e4) { if ("string" != typeof e4) e4 = y2(e4); else if (!p2(e4) || e4.length % 2) return null; return (e4.length - 2) / 2; }, t3.hexDataSlice = function(e4, t4, r4) { return "string" != typeof e4 ? e4 = y2(e4) : (!p2(e4) || e4.length % 2) && o2.throwArgumentError("invalid hexData", "value", e4), t4 = 2 + 2 * t4, null != r4 ? "0x" + e4.substring(t4, 2 + 2 * r4) : "0x" + e4.substring(t4); }, t3.hexStripZeros = v2, t3.hexValue = function(e4) { var t4 = v2(y2(e4, { hexPad: "left" })); return "0x" === t4 ? "0x0" : t4; }, t3.hexZeroPad = m2, t3.hexlify = y2, t3.isBytes = f2, t3.isBytesLike = u2, t3.isHexString = p2, t3.joinSignature = function(e4) { return y2(l2([(e4 = g2(e4)).r, e4.s, e4.recoveryParam ? "0x1c" : "0x1b"])); }, t3.splitSignature = g2, t3.stripZeros = function(e4) { var t4 = d2(e4); if (0 === t4.length) return t4; for (var r4 = 0; r4 < t4.length && 0 === t4[r4]; ) r4++; return r4 && (t4 = t4.slice(r4)), t4; }, t3.zeroPad = h2; var n2 = r3(64327), i2 = r3(8729), o2 = new n2.Logger(i2.version); function a2(e4) { return !!e4.toHexString; } function s2(e4) { return e4.slice || (e4.slice = function() { var t4 = Array.prototype.slice.call(arguments); return s2(new Uint8Array(Array.prototype.slice.apply(e4, t4))); }), e4; } function u2(e4) { return p2(e4) && !(e4.length % 2) || f2(e4); } function c2(e4) { return "number" == typeof e4 && e4 == e4 && e4 % 1 == 0; } function f2(e4) { if (null == e4) return false; if (e4.constructor === Uint8Array) return true; if ("string" == typeof e4) return false; if (!c2(e4.length) || e4.length < 0) return false; for (var t4 = 0; t4 < e4.length; t4++) { var r4 = e4[t4]; if (!c2(r4) || r4 < 0 || r4 >= 256) return false; } return true; } function d2(e4, t4) { if (t4 || (t4 = {}), "number" == typeof e4) { o2.checkSafeUint53(e4, "invalid arrayify value"); for (var r4 = []; e4; ) r4.unshift(255 & e4), e4 = parseInt(String(e4 / 256)); return 0 === r4.length && r4.push(0), s2(new Uint8Array(r4)); } if (t4.allowMissingPrefix && "string" == typeof e4 && "0x" !== e4.substring(0, 2) && (e4 = "0x" + e4), a2(e4) && (e4 = e4.toHexString()), p2(e4)) { var n3 = e4.substring(2); n3.length % 2 && ("left" === t4.hexPad ? n3 = "0" + n3 : "right" === t4.hexPad ? n3 += "0" : o2.throwArgumentError("hex data is odd-length", "value", e4)); for (var i3 = [], u3 = 0; u3 < n3.length; u3 += 2) i3.push(parseInt(n3.substring(u3, u3 + 2), 16)); return s2(new Uint8Array(i3)); } return f2(e4) ? s2(new Uint8Array(e4)) : o2.throwArgumentError("invalid arrayify value", "value", e4); } function l2(e4) { var t4 = e4.map(function(e5) { return d2(e5); }), r4 = t4.reduce(function(e5, t5) { return e5 + t5.length; }, 0), n3 = new Uint8Array(r4); return t4.reduce(function(e5, t5) { return n3.set(t5, e5), e5 + t5.length; }, 0), s2(n3); } function h2(e4, t4) { (e4 = d2(e4)).length > t4 && o2.throwArgumentError("value out of range", "value", arguments[0]); var r4 = new Uint8Array(t4); return r4.set(e4, t4 - e4.length), s2(r4); } function p2(e4, t4) { return !("string" != typeof e4 || !e4.match(/^0x[0-9A-Fa-f]*$/) || t4 && e4.length !== 2 + 2 * t4); } var b2 = "0123456789abcdef"; function y2(e4, t4) { if (t4 || (t4 = {}), "number" == typeof e4) { o2.checkSafeUint53(e4, "invalid hexlify value"); for (var r4 = ""; e4; ) r4 = b2[15 & e4] + r4, e4 = Math.floor(e4 / 16); return r4.length ? (r4.length % 2 && (r4 = "0" + r4), "0x" + r4) : "0x00"; } if ("bigint" == typeof e4) return (e4 = e4.toString(16)).length % 2 ? "0x0" + e4 : "0x" + e4; if (t4.allowMissingPrefix && "string" == typeof e4 && "0x" !== e4.substring(0, 2) && (e4 = "0x" + e4), a2(e4)) return e4.toHexString(); if (p2(e4)) return e4.length % 2 && ("left" === t4.hexPad ? e4 = "0x0" + e4.substring(2) : "right" === t4.hexPad ? e4 += "0" : o2.throwArgumentError("hex data is odd-length", "value", e4)), e4.toLowerCase(); if (f2(e4)) { for (var n3 = "0x", i3 = 0; i3 < e4.length; i3++) { var s3 = e4[i3]; n3 += b2[(240 & s3) >> 4] + b2[15 & s3]; } return n3; } return o2.throwArgumentError("invalid hexlify value", "value", e4); } function v2(e4) { "string" != typeof e4 && (e4 = y2(e4)), p2(e4) || o2.throwArgumentError("invalid hex string", "value", e4), e4 = e4.substring(2); for (var t4 = 0; t4 < e4.length && "0" === e4[t4]; ) t4++; return "0x" + e4.substring(t4); } function m2(e4, t4) { for ("string" != typeof e4 ? e4 = y2(e4) : p2(e4) || o2.throwArgumentError("invalid hex string", "value", e4), e4.length > 2 * t4 + 2 && o2.throwArgumentError("value out of range", "value", arguments[1]); e4.length < 2 * t4 + 2; ) e4 = "0x0" + e4.substring(2); return e4; } function g2(e4) { var t4 = { r: "0x", s: "0x", _vs: "0x", recoveryParam: 0, v: 0, yParityAndS: "0x", compact: "0x" }; if (u2(e4)) { var r4 = d2(e4); 64 === r4.length ? (t4.v = 27 + (r4[32] >> 7), r4[32] &= 127, t4.r = y2(r4.slice(0, 32)), t4.s = y2(r4.slice(32, 64))) : 65 === r4.length ? (t4.r = y2(r4.slice(0, 32)), t4.s = y2(r4.slice(32, 64)), t4.v = r4[64]) : o2.throwArgumentError("invalid signature string", "signature", e4), t4.v < 27 && (0 === t4.v || 1 === t4.v ? t4.v += 27 : o2.throwArgumentError("signature invalid v byte", "signature", e4)), t4.recoveryParam = 1 - t4.v % 2, t4.recoveryParam && (r4[32] |= 128), t4._vs = y2(r4.slice(32, 64)); } else { if (t4.r = e4.r, t4.s = e4.s, t4.v = e4.v, t4.recoveryParam = e4.recoveryParam, t4._vs = e4._vs, null != t4._vs) { var n3 = h2(d2(t4._vs), 32); t4._vs = y2(n3); var i3 = n3[0] >= 128 ? 1 : 0; null == t4.recoveryParam ? t4.recoveryParam = i3 : t4.recoveryParam !== i3 && o2.throwArgumentError("signature recoveryParam mismatch _vs", "signature", e4), n3[0] &= 127; var a3 = y2(n3); null == t4.s ? t4.s = a3 : t4.s !== a3 && o2.throwArgumentError("signature v mismatch _vs", "signature", e4); } if (null == t4.recoveryParam) null == t4.v ? o2.throwArgumentError("signature missing v and recoveryParam", "signature", e4) : 0 === t4.v || 1 === t4.v ? t4.recoveryParam = t4.v : t4.recoveryParam = 1 - t4.v % 2; else if (null == t4.v) t4.v = 27 + t4.recoveryParam; else { var s3 = 0 === t4.v || 1 === t4.v ? t4.v : 1 - t4.v % 2; t4.recoveryParam !== s3 && o2.throwArgumentError("signature recoveryParam mismatch v", "signature", e4); } null != t4.r && p2(t4.r) ? t4.r = m2(t4.r, 32) : o2.throwArgumentError("signature missing or invalid r", "signature", e4), null != t4.s && p2(t4.s) ? t4.s = m2(t4.s, 32) : o2.throwArgumentError("signature missing or invalid s", "signature", e4); var c3 = d2(t4.s); c3[0] >= 128 && o2.throwArgumentError("signature s out of range", "signature", e4), t4.recoveryParam && (c3[0] |= 128); var f3 = y2(c3); t4._vs && (p2(t4._vs) || o2.throwArgumentError("signature invalid _vs", "signature", e4), t4._vs = m2(t4._vs, 32)), null == t4._vs ? t4._vs = f3 : t4._vs !== f3 && o2.throwArgumentError("signature _vs mismatch v and s", "signature", e4); } return t4.yParityAndS = t4._vs, t4.compact = t4.r + t4.yParityAndS.substring(2), t4; } }, 48721: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.AddressZero = void 0, t3.AddressZero = "0x0000000000000000000000000000000000000000"; }, 22997: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.Zero = t3.WeiPerEther = t3.Two = t3.One = t3.NegativeOne = t3.MinInt256 = t3.MaxUint256 = t3.MaxInt256 = void 0; var n2 = r3(34952), i2 = n2.BigNumber.from(-1); t3.NegativeOne = i2; var o2 = n2.BigNumber.from(0); t3.Zero = o2; var a2 = n2.BigNumber.from(1); t3.One = a2; var s2 = n2.BigNumber.from(2); t3.Two = s2; var u2 = n2.BigNumber.from("1000000000000000000"); t3.WeiPerEther = u2; var c2 = n2.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); t3.MaxUint256 = c2; var f2 = n2.BigNumber.from("-0x8000000000000000000000000000000000000000000000000000000000000000"); t3.MinInt256 = f2; var d2 = n2.BigNumber.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); t3.MaxInt256 = d2; }, 90396: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.HashZero = void 0, t3.HashZero = "0x0000000000000000000000000000000000000000000000000000000000000000"; }, 5465: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), Object.defineProperty(t3, "AddressZero", { enumerable: true, get: function() { return n2.AddressZero; } }), Object.defineProperty(t3, "EtherSymbol", { enumerable: true, get: function() { return a2.EtherSymbol; } }), Object.defineProperty(t3, "HashZero", { enumerable: true, get: function() { return o2.HashZero; } }), Object.defineProperty(t3, "MaxInt256", { enumerable: true, get: function() { return i2.MaxInt256; } }), Object.defineProperty(t3, "MaxUint256", { enumerable: true, get: function() { return i2.MaxUint256; } }), Object.defineProperty(t3, "MinInt256", { enumerable: true, get: function() { return i2.MinInt256; } }), Object.defineProperty(t3, "NegativeOne", { enumerable: true, get: function() { return i2.NegativeOne; } }), Object.defineProperty(t3, "One", { enumerable: true, get: function() { return i2.One; } }), Object.defineProperty(t3, "Two", { enumerable: true, get: function() { return i2.Two; } }), Object.defineProperty(t3, "WeiPerEther", { enumerable: true, get: function() { return i2.WeiPerEther; } }), Object.defineProperty(t3, "Zero", { enumerable: true, get: function() { return i2.Zero; } }); var n2 = r3(48721), i2 = r3(22997), o2 = r3(90396), a2 = r3(68347); }, 68347: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.EtherSymbol = void 0, t3.EtherSymbol = "Ξ"; }, 33989: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.version = void 0, t3.version = "hash/5.7.0"; }, 33731: (e3, t3) => { function r3(e4, t4) { null == t4 && (t4 = 1); var r4 = [], n3 = r4.forEach; return function e5(t5, i3) { n3.call(t5, function(t6) { i3 > 0 && Array.isArray(t6) ? e5(t6, i3 - 1) : r4.push(t6); }); }(e4, t4), r4; } function n2(e4) { var t4 = 0; function r4() { return e4[t4++] << 8 | e4[t4++]; } for (var n3 = r4(), i3 = 1, o3 = [0, 1], a3 = 1; a3 < n3; a3++) o3.push(i3 += r4()); var s3 = r4(), u3 = t4; t4 += s3; var c3 = 0, f3 = 0; function d3() { return 0 == c3 && (f3 = f3 << 8 | e4[t4++], c3 = 8), f3 >> --c3 & 1; } for (var l3 = Math.pow(2, 31), h2 = l3 >>> 1, p2 = h2 >> 1, b2 = l3 - 1, y2 = 0, v2 = 0; v2 < 31; v2++) y2 = y2 << 1 | d3(); for (var m2 = [], g2 = 0, w2 = l3; ; ) { for (var k2 = Math.floor(((y2 - g2 + 1) * i3 - 1) / w2), _2 = 0, A2 = n3; A2 - _2 > 1; ) { var E2 = _2 + A2 >>> 1; k2 < o3[E2] ? A2 = E2 : _2 = E2; } if (0 == _2) break; m2.push(_2); for (var S2 = g2 + Math.floor(w2 * o3[_2] / i3), x2 = g2 + Math.floor(w2 * o3[_2 + 1] / i3) - 1; 0 == ((S2 ^ x2) & h2); ) y2 = y2 << 1 & b2 | d3(), S2 = S2 << 1 & b2, x2 = x2 << 1 & b2 | 1; for (; S2 & ~x2 & p2; ) y2 = y2 & h2 | y2 << 1 & b2 >>> 1 | d3(), S2 = S2 << 1 ^ h2, x2 = (x2 ^ h2) << 1 | h2 | 1; g2 = S2, w2 = 1 + x2 - S2; } var B2 = n3 - 4; return m2.map(function(t5) { switch (t5 - B2) { case 3: return B2 + 65792 + (e4[u3++] << 16 | e4[u3++] << 8 | e4[u3++]); case 2: return B2 + 256 + (e4[u3++] << 8 | e4[u3++]); case 1: return B2 + e4[u3++]; default: return t5 - 1; } }); } function i2(e4) { var t4 = 0; return function() { return e4[t4++]; }; } function o2(e4) { return 1 & e4 ? ~e4 >> 1 : e4 >> 1; } function a2(e4, t4) { for (var r4 = Array(e4), n3 = 0, i3 = -1; n3 < e4; n3++) r4[n3] = i3 += 1 + t4(); return r4; } function s2(e4, t4) { for (var r4 = Array(e4), n3 = 0, i3 = 0; n3 < e4; n3++) r4[n3] = i3 += o2(t4()); return r4; } function u2(e4, t4) { for (var r4 = a2(e4(), e4), n3 = e4(), i3 = a2(n3, e4), o3 = function(e5, t5) { for (var r5 = Array(e5), n4 = 0; n4 < e5; n4++) r5[n4] = 1 + t5(); return r5; }(n3, e4), s3 = 0; s3 < n3; s3++) for (var u3 = 0; u3 < o3[s3]; u3++) r4.push(i3[s3] + u3); return t4 ? r4.map(function(e5) { return t4[e5]; }) : r4; } function c2(e4) { for (var t4 = []; ; ) { var r4 = e4(); if (0 == r4) break; t4.push(r4); } return t4; } function f2(e4, t4, r4) { for (var n3 = Array(e4).fill(void 0).map(function() { return []; }), i3 = 0; i3 < t4; i3++) s2(e4, r4).forEach(function(e5, t5) { return n3[t5].push(e5); }); return n3; } function d2(e4, t4) { var n3 = 1 + t4(), i3 = t4(), o3 = c2(t4); return r3(f2(o3.length, 1 + e4, t4).map(function(e5, t5) { var r4 = e5[0], a3 = e5.slice(1); return Array(o3[t5]).fill(void 0).map(function(e6, t6) { var o4 = t6 * i3; return [r4 + t6 * n3, a3.map(function(e7) { return e7 + o4; })]; }); })); } function l2(e4, t4) { return f2(1 + t4(), 1 + e4, t4).map(function(e5) { return [e5[0], e5.slice(1)]; }); } Object.defineProperty(t3, "__esModule", { value: true }), t3.decode_arithmetic = n2, t3.read_compressed_payload = function(e4) { return i2(n2(e4)); }, t3.read_emoji_trie = function(e4) { var t4 = u2(e4).sort(function(e5, t5) { return e5 - t5; }); return function r4() { for (var n3 = []; ; ) { var i3 = u2(e4, t4); if (0 == i3.length) break; n3.push({ set: new Set(i3), node: r4() }); } n3.sort(function(e5, t5) { return t5.set.size - e5.set.size; }); var o3 = e4(); return { branches: n3, valid: o3 % 3, fe0f: !!(1 & (o3 = o3 / 3 | 0)), save: 1 == (o3 >>= 1), check: 2 == o3 }; }(); }, t3.read_mapped_map = function(e4) { for (var t4 = []; ; ) { var n3 = e4(); if (0 == n3) break; t4.push(d2(n3, e4)); } for (; ; ) { var i3 = e4() - 1; if (i3 < 0) break; t4.push(l2(i3, e4)); } return function(e5) { for (var t5 = {}, r4 = 0; r4 < e5.length; r4++) { var n4 = e5[r4]; t5[n4[0]] = n4[1]; } return t5; }(r3(t4)); }, t3.read_member_array = u2, t3.read_payload = i2, t3.read_zero_terminated_array = c2, t3.signed = o2; }, 63961: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.getData = function() { return (0, i2.read_compressed_payload)((0, n2.decode)("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")); }; var n2 = r3(80997), i2 = r3(33731); }, 17032: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.ens_normalize = function(e4) { return m2(function(e5, t4) { for (var r4 = y2(e5).reverse(), n3 = []; r4.length; ) { var o3 = g2(r4); if (o3) n3.push.apply(n3, (0, i2.default)(t4(o3))); else { var a3 = r4.pop(); if (f2.has(a3)) n3.push(a3); else if (!d2.has(a3)) { var s3 = l2[a3]; if (!s3) throw new Error("Disallowed codepoint: 0x".concat(a3.toString(16).toUpperCase())); n3.push.apply(n3, (0, i2.default)(s3)); } } } return m2(String.fromCodePoint.apply(String, n3).normalize("NFC")); }(e4, v2)); }, t3.ens_normalize_post_check = m2; var i2 = n2(r3(93106)), o2 = r3(78627), a2 = r3(63961), s2 = r3(33731); function u2(e4, t4) { (null == t4 || t4 > e4.length) && (t4 = e4.length); for (var r4 = 0, n3 = new Array(t4); r4 < t4; r4++) n3[r4] = e4[r4]; return n3; } var c2 = (0, a2.getData)(), f2 = new Set((0, s2.read_member_array)(c2)), d2 = new Set((0, s2.read_member_array)(c2)), l2 = (0, s2.read_mapped_map)(c2), h2 = (0, s2.read_emoji_trie)(c2), p2 = 45, b2 = 95; function y2(e4) { return (0, o2.toUtf8CodePoints)(e4); } function v2(e4) { return e4.filter(function(e5) { return 65039 != e5; }); } function m2(e4) { var t4, r4 = function(e5, t5) { var r5 = "undefined" != typeof Symbol && e5[Symbol.iterator] || e5["@@iterator"]; if (!r5) { if (Array.isArray(e5) || (r5 = function(e6, t6) { if (e6) { if ("string" == typeof e6) return u2(e6, t6); var r6 = Object.prototype.toString.call(e6).slice(8, -1); return "Object" === r6 && e6.constructor && (r6 = e6.constructor.name), "Map" === r6 || "Set" === r6 ? Array.from(e6) : "Arguments" === r6 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r6) ? u2(e6, t6) : void 0; } }(e5)) || t5 && e5 && "number" == typeof e5.length) { r5 && (e5 = r5); var n4 = 0, i4 = function() { }; return { s: i4, n: function() { return n4 >= e5.length ? { done: true } : { done: false, value: e5[n4++] }; }, e: function(e6) { throw e6; }, f: i4 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o4, a3 = true, s3 = false; return { s: function() { r5 = r5.call(e5); }, n: function() { var e6 = r5.next(); return a3 = e6.done, e6; }, e: function(e6) { s3 = true, o4 = e6; }, f: function() { try { a3 || null == r5.return || r5.return(); } finally { if (s3) throw o4; } } }; }(e4.split(".")); try { for (r4.s(); !(t4 = r4.n()).done; ) { var n3 = t4.value, i3 = y2(n3); try { for (var o3 = i3.lastIndexOf(b2) - 1; o3 >= 0; o3--) if (i3[o3] !== b2) throw new Error("underscore only allowed at start"); if (i3.length >= 4 && i3.every(function(e5) { return e5 < 128; }) && i3[2] === p2 && i3[3] === p2) throw new Error("invalid label extension"); } catch (e5) { throw new Error('Invalid label "'.concat(n3, '": ').concat(e5.message)); } } } catch (e5) { r4.e(e5); } finally { r4.f(); } return e4; } function g2(e4, t4) { var r4, n3, o3, a3 = h2, s3 = [], u3 = e4.length; t4 && (t4.length = 0); for (var c3 = function() { var c4 = e4[--u3]; if (!(a3 = null === (r4 = a3.branches.find(function(e5) { return e5.set.has(c4); })) || void 0 === r4 ? void 0 : r4.node)) return "break"; if (a3.save) o3 = c4; else if (a3.check && c4 === o3) return "break"; s3.push(c4), a3.fe0f && (s3.push(65039), u3 > 0 && 65039 == e4[u3 - 1] && u3--), a3.valid && (n3 = s3.slice(), 2 == a3.valid && n3.splice(1, 1), t4 && t4.push.apply(t4, (0, i2.default)(e4.slice(u3).reverse())), e4.length = u3); }; u3 && "break" !== c3(); ) ; return n3; } }, 57901: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.id = function(e4) { return (0, n2.keccak256)((0, i2.toUtf8Bytes)(e4)); }; var n2 = r3(64642), i2 = r3(78627); }, 37515: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), Object.defineProperty(t3, "_TypedDataEncoder", { enumerable: true, get: function() { return a2.TypedDataEncoder; } }), Object.defineProperty(t3, "dnsEncode", { enumerable: true, get: function() { return i2.dnsEncode; } }), Object.defineProperty(t3, "ensNormalize", { enumerable: true, get: function() { return i2.ensNormalize; } }), Object.defineProperty(t3, "hashMessage", { enumerable: true, get: function() { return o2.hashMessage; } }), Object.defineProperty(t3, "id", { enumerable: true, get: function() { return n2.id; } }), Object.defineProperty(t3, "isValidName", { enumerable: true, get: function() { return i2.isValidName; } }), Object.defineProperty(t3, "messagePrefix", { enumerable: true, get: function() { return o2.messagePrefix; } }), Object.defineProperty(t3, "namehash", { enumerable: true, get: function() { return i2.namehash; } }); var n2 = r3(57901), i2 = r3(84898), o2 = r3(34443), a2 = r3(12171); }, 34443: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.hashMessage = function(e4) { return "string" == typeof e4 && (e4 = (0, o2.toUtf8Bytes)(e4)), (0, i2.keccak256)((0, n2.concat)([(0, o2.toUtf8Bytes)(a2), (0, o2.toUtf8Bytes)(String(e4.length)), e4])); }, t3.messagePrefix = void 0; var n2 = r3(908), i2 = r3(64642), o2 = r3(78627), a2 = "Ethereum Signed Message:\n"; t3.messagePrefix = a2; }, 84898: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.dnsEncode = function(e4) { return (0, n2.hexlify)((0, n2.concat)(l2(e4).map(function(e5) { if (e5.length > 63) throw new Error("invalid DNS encoded entry; length exceeds 63 bytes"); var t4 = new Uint8Array(e5.length + 1); return t4.set(e5, 1), t4[0] = t4.length - 1, t4; }))) + "00"; }, t3.ensNormalize = function(e4) { return l2(e4).map(function(e5) { return (0, i2.toUtf8String)(e5); }).join("."); }, t3.isValidName = function(e4) { try { return 0 !== l2(e4).length; } catch (e5) { } return false; }, t3.namehash = function(e4) { "string" != typeof e4 && c2.throwArgumentError("invalid ENS name; not a string", "name", e4); for (var t4 = f2, r4 = l2(e4); r4.length; ) t4 = (0, o2.keccak256)((0, n2.concat)([t4, (0, o2.keccak256)(r4.pop())])); return (0, n2.hexlify)(t4); }; var n2 = r3(908), i2 = r3(78627), o2 = r3(64642), a2 = r3(64327), s2 = r3(33989), u2 = r3(17032), c2 = new a2.Logger(s2.version), f2 = new Uint8Array(32); function d2(e4) { if (0 === e4.length) throw new Error("invalid ENS name; empty component"); return e4; } function l2(e4) { var t4 = (0, i2.toUtf8Bytes)((0, u2.ens_normalize)(e4)), r4 = []; if (0 === e4.length) return r4; for (var n3 = 0, o3 = 0; o3 < t4.length; o3++) 46 === t4[o3] && (r4.push(d2(t4.slice(n3, o3))), n3 = o3 + 1); if (n3 >= t4.length) throw new Error("invalid ENS name; empty component"); return r4.push(d2(t4.slice(n3))), r4; } f2.fill(0); }, 12171: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.TypedDataEncoder = void 0; var i2 = n2(r3(82247)), o2 = n2(r3(69721)), a2 = n2(r3(58985)), s2 = r3(77921), u2 = r3(34952), c2 = r3(908), f2 = r3(64642), d2 = r3(23694), l2 = r3(64327), h2 = r3(33989), p2 = r3(57901), b2 = new l2.Logger(h2.version), y2 = new Uint8Array(32); y2.fill(0); var v2 = u2.BigNumber.from(-1), m2 = u2.BigNumber.from(0), g2 = u2.BigNumber.from(1), w2 = u2.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), k2 = (0, c2.hexZeroPad)(g2.toHexString(), 32), _2 = (0, c2.hexZeroPad)(m2.toHexString(), 32), A2 = { name: "string", version: "string", chainId: "uint256", verifyingContract: "address", salt: "bytes32" }, E2 = ["name", "version", "chainId", "verifyingContract", "salt"]; function S2(e4) { return function(t4) { return "string" != typeof t4 && b2.throwArgumentError("invalid domain value for ".concat(JSON.stringify(e4)), "domain.".concat(e4), t4), t4; }; } var x2 = { name: S2("name"), version: S2("version"), chainId: function(e4) { try { return u2.BigNumber.from(e4).toString(); } catch (e5) { } return b2.throwArgumentError('invalid domain value for "chainId"', "domain.chainId", e4); }, verifyingContract: function(e4) { try { return (0, s2.getAddress)(e4).toLowerCase(); } catch (e5) { } return b2.throwArgumentError('invalid domain value "verifyingContract"', "domain.verifyingContract", e4); }, salt: function(e4) { try { var t4 = (0, c2.arrayify)(e4); if (32 !== t4.length) throw new Error("bad length"); return (0, c2.hexlify)(t4); } catch (e5) { } return b2.throwArgumentError('invalid domain value "salt"', "domain.salt", e4); } }; function B2(e4) { var t4 = e4.match(/^(u?)int(\d*)$/); if (t4) { var r4 = "" === t4[1], n3 = parseInt(t4[2] || "256"); (n3 % 8 != 0 || n3 > 256 || t4[2] && t4[2] !== String(n3)) && b2.throwArgumentError("invalid numeric width", "type", e4); var i3 = w2.mask(r4 ? n3 - 1 : n3), o3 = r4 ? i3.add(g2).mul(v2) : m2; return function(t5) { var r5 = u2.BigNumber.from(t5); return (r5.lt(o3) || r5.gt(i3)) && b2.throwArgumentError("value out-of-bounds for ".concat(e4), "value", t5), (0, c2.hexZeroPad)(r5.toTwos(256).toHexString(), 32); }; } var a3 = e4.match(/^bytes(\d+)$/); if (a3) { var d3 = parseInt(a3[1]); return (0 === d3 || d3 > 32 || a3[1] !== String(d3)) && b2.throwArgumentError("invalid bytes width", "type", e4), function(t5) { return (0, c2.arrayify)(t5).length !== d3 && b2.throwArgumentError("invalid length for ".concat(e4), "value", t5), function(e5) { var t6 = (0, c2.arrayify)(e5), r5 = t6.length % 32; return r5 ? (0, c2.hexConcat)([t6, y2.slice(r5)]) : (0, c2.hexlify)(t6); }(t5); }; } switch (e4) { case "address": return function(e5) { return (0, c2.hexZeroPad)((0, s2.getAddress)(e5), 32); }; case "bool": return function(e5) { return e5 ? k2 : _2; }; case "bytes": return function(e5) { return (0, f2.keccak256)(e5); }; case "string": return function(e5) { return (0, p2.id)(e5); }; } return null; } function O2(e4, t4) { return "".concat(e4, "(").concat(t4.map(function(e5) { var t5 = e5.name; return e5.type + " " + t5; }).join(","), ")"); } var P2 = function() { function e4(t4) { (0, o2.default)(this, e4), (0, d2.defineReadOnly)(this, "types", Object.freeze((0, d2.deepCopy)(t4))), (0, d2.defineReadOnly)(this, "_encoderCache", {}), (0, d2.defineReadOnly)(this, "_types", {}); var r4 = {}, n3 = {}, i3 = {}; Object.keys(t4).forEach(function(e5) { r4[e5] = {}, n3[e5] = [], i3[e5] = {}; }); var a3 = function(e5) { var i4 = {}; t4[e5].forEach(function(o3) { i4[o3.name] && b2.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o3.name), " in ").concat(JSON.stringify(e5)), "types", t4), i4[o3.name] = true; var a4 = o3.type.match(/^([^\x5b]*)(\x5b|$)/)[1]; a4 === e5 && b2.throwArgumentError("circular type reference to ".concat(JSON.stringify(a4)), "types", t4), B2(a4) || (n3[a4] || b2.throwArgumentError("unknown type ".concat(JSON.stringify(a4)), "types", t4), n3[a4].push(e5), r4[e5][a4] = true); }); }; for (var s3 in t4) a3(s3); var u3 = Object.keys(n3).filter(function(e5) { return 0 === n3[e5].length; }); for (var c3 in 0 === u3.length ? b2.throwArgumentError("missing primary type", "types", t4) : u3.length > 1 && b2.throwArgumentError("ambiguous primary types or unused types: ".concat(u3.map(function(e5) { return JSON.stringify(e5); }).join(", ")), "types", t4), (0, d2.defineReadOnly)(this, "primaryType", u3[0]), function e5(o3, a4) { a4[o3] && b2.throwArgumentError("circular type reference to ".concat(JSON.stringify(o3)), "types", t4), a4[o3] = true, Object.keys(r4[o3]).forEach(function(t5) { n3[t5] && (e5(t5, a4), Object.keys(a4).forEach(function(e6) { i3[e6][t5] = true; })); }), delete a4[o3]; }(this.primaryType, {}), i3) { var f3 = Object.keys(i3[c3]); f3.sort(), this._types[c3] = O2(c3, t4[c3]) + f3.map(function(e5) { return O2(e5, t4[e5]); }).join(""); } } return (0, a2.default)(e4, [{ key: "getEncoder", value: function(e5) { var t4 = this._encoderCache[e5]; return t4 || (t4 = this._encoderCache[e5] = this._getEncoder(e5)), t4; } }, { key: "_getEncoder", value: function(e5) { var t4 = this, r4 = B2(e5); if (r4) return r4; var n3 = e5.match(/^(.*)(\x5b(\d*)\x5d)$/); if (n3) { var i3 = n3[1], o3 = this.getEncoder(i3), a3 = parseInt(n3[3]); return function(e6) { a3 >= 0 && e6.length !== a3 && b2.throwArgumentError("array length mismatch; expected length ${ arrayLength }", "value", e6); var r5 = e6.map(o3); return t4._types[i3] && (r5 = r5.map(f2.keccak256)), (0, f2.keccak256)((0, c2.hexConcat)(r5)); }; } var s3 = this.types[e5]; if (s3) { var u3 = (0, p2.id)(this._types[e5]); return function(e6) { var r5 = s3.map(function(r6) { var n4 = r6.name, i4 = r6.type, o4 = t4.getEncoder(i4)(e6[n4]); return t4._types[i4] ? (0, f2.keccak256)(o4) : o4; }); return r5.unshift(u3), (0, c2.hexConcat)(r5); }; } return b2.throwArgumentError("unknown type: ".concat(e5), "type", e5); } }, { key: "encodeType", value: function(e5) { var t4 = this._types[e5]; return t4 || b2.throwArgumentError("unknown type: ".concat(JSON.stringify(e5)), "name", e5), t4; } }, { key: "encodeData", value: function(e5, t4) { return this.getEncoder(e5)(t4); } }, { key: "hashStruct", value: function(e5, t4) { return (0, f2.keccak256)(this.encodeData(e5, t4)); } }, { key: "encode", value: function(e5) { return this.encodeData(this.primaryType, e5); } }, { key: "hash", value: function(e5) { return this.hashStruct(this.primaryType, e5); } }, { key: "_visit", value: function(e5, t4, r4) { var n3 = this; if (B2(e5)) return r4(e5, t4); var i3 = e5.match(/^(.*)(\x5b(\d*)\x5d)$/); if (i3) { var o3 = i3[1], a3 = parseInt(i3[3]); return a3 >= 0 && t4.length !== a3 && b2.throwArgumentError("array length mismatch; expected length ${ arrayLength }", "value", t4), t4.map(function(e6) { return n3._visit(o3, e6, r4); }); } var s3 = this.types[e5]; return s3 ? s3.reduce(function(e6, i4) { var o4 = i4.name, a4 = i4.type; return e6[o4] = n3._visit(a4, t4[o4], r4), e6; }, {}) : b2.throwArgumentError("unknown type: ".concat(e5), "type", e5); } }, { key: "visit", value: function(e5, t4) { return this._visit(this.primaryType, e5, t4); } }], [{ key: "from", value: function(t4) { return new e4(t4); } }, { key: "getPrimaryType", value: function(t4) { return e4.from(t4).primaryType; } }, { key: "hashStruct", value: function(t4, r4, n3) { return e4.from(r4).hashStruct(t4, n3); } }, { key: "hashDomain", value: function(t4) { var r4 = []; for (var n3 in t4) { var i3 = A2[n3]; i3 || b2.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n3)), "domain", t4), r4.push({ name: n3, type: i3 }); } return r4.sort(function(e5, t5) { return E2.indexOf(e5.name) - E2.indexOf(t5.name); }), e4.hashStruct("EIP712Domain", { EIP712Domain: r4 }, t4); } }, { key: "encode", value: function(t4, r4, n3) { return (0, c2.hexConcat)(["0x1901", e4.hashDomain(t4), e4.from(r4).hash(n3)]); } }, { key: "hash", value: function(t4, r4, n3) { return (0, f2.keccak256)(e4.encode(t4, r4, n3)); } }, { key: "resolveNames", value: function(t4, r4, n3, o3) { return a3 = this, s3 = void 0, u3 = void 0, f3 = i2.default.mark(function a4() { var s4, u4, f4; return i2.default.wrap(function(a5) { for (; ; ) switch (a5.prev = a5.next) { case 0: t4 = (0, d2.shallowCopy)(t4), s4 = {}, t4.verifyingContract && !(0, c2.isHexString)(t4.verifyingContract, 20) && (s4[t4.verifyingContract] = "0x"), (u4 = e4.from(r4)).visit(n3, function(e5, t5) { return "address" !== e5 || (0, c2.isHexString)(t5, 20) || (s4[t5] = "0x"), t5; }), a5.t0 = i2.default.keys(s4); case 6: if ((a5.t1 = a5.t0()).done) { a5.next = 13; break; } return f4 = a5.t1.value, a5.next = 10, o3(f4); case 10: s4[f4] = a5.sent, a5.next = 6; break; case 13: return t4.verifyingContract && s4[t4.verifyingContract] && (t4.verifyingContract = s4[t4.verifyingContract]), n3 = u4.visit(n3, function(e5, t5) { return "address" === e5 && s4[t5] ? s4[t5] : t5; }), a5.abrupt("return", { domain: t4, value: n3 }); case 16: case "end": return a5.stop(); } }, a4); }), new (u3 || (u3 = Promise))(function(e5, t5) { function r5(e6) { try { i3(f3.next(e6)); } catch (e7) { t5(e7); } } function n4(e6) { try { i3(f3.throw(e6)); } catch (e7) { t5(e7); } } function i3(t6) { var i4; t6.done ? e5(t6.value) : (i4 = t6.value, i4 instanceof u3 ? i4 : new u3(function(e6) { e6(i4); })).then(r5, n4); } i3((f3 = f3.apply(a3, s3 || [])).next()); }); var a3, s3, u3, f3; } }, { key: "getPayload", value: function(t4, r4, n3) { e4.hashDomain(t4); var i3 = {}, o3 = []; E2.forEach(function(e5) { var r5 = t4[e5]; null != r5 && (i3[e5] = x2[e5](r5), o3.push({ name: e5, type: A2[e5] })); }); var a3 = e4.from(r4), s3 = (0, d2.shallowCopy)(r4); return s3.EIP712Domain ? b2.throwArgumentError("types must not contain EIP712Domain type", "types.EIP712Domain", r4) : s3.EIP712Domain = o3, a3.encode(n3), { types: s3, domain: i3, primaryType: a3.primaryType, message: a3.visit(n3, function(e5, t5) { if (e5.match(/^bytes(\d*)/)) return (0, c2.hexlify)((0, c2.arrayify)(t5)); if (e5.match(/^u?int/)) return u2.BigNumber.from(t5).toString(); switch (e5) { case "address": return t5.toLowerCase(); case "bool": return !!t5; case "string": return "string" != typeof t5 && b2.throwArgumentError("invalid string", "value", t5), t5; } return b2.throwArgumentError("unsupported type", "type", e5); }) }; } }]), e4; }(); t3.TypedDataEncoder = P2; }, 64642: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.keccak256 = function(e4) { return "0x" + i2.default.keccak_256((0, o2.arrayify)(e4)); }; var i2 = n2(r3(95975)), o2 = r3(908); }, 95975: (e3, t3, r3) => { e3 = r3.nmd(e3); var n2, i2 = r3(19142), o2 = r3(28847)(r3(3355)); !function() { var a2 = "input is invalid type", s2 = "object" === ("undefined" == typeof window ? "undefined" : (0, o2.default)(window)), u2 = s2 ? window : {}; u2.JS_SHA3_NO_WINDOW && (s2 = false); var c2 = !s2 && "object" === ("undefined" == typeof self ? "undefined" : (0, o2.default)(self)); !u2.JS_SHA3_NO_NODE_JS && "object" === (void 0 === i2 ? "undefined" : (0, o2.default)(i2)) && i2.versions && i2.versions.node ? u2 = r3.g : c2 && (u2 = self); var f2 = !u2.JS_SHA3_NO_COMMON_JS && "object" === (0, o2.default)(e3) && e3.exports, d2 = r3.amdO, l2 = !u2.JS_SHA3_NO_ARRAY_BUFFER && "undefined" != typeof ArrayBuffer, h2 = "0123456789abcdef".split(""), p2 = [4, 1024, 262144, 67108864], b2 = [0, 8, 16, 24], y2 = [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], v2 = [224, 256, 384, 512], m2 = [128, 256], g2 = ["hex", "buffer", "arrayBuffer", "array", "digest"], w2 = { 128: 168, 256: 136 }; !u2.JS_SHA3_NO_NODE_JS && Array.isArray || (Array.isArray = function(e4) { return "[object Array]" === Object.prototype.toString.call(e4); }), !l2 || !u2.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW && ArrayBuffer.isView || (ArrayBuffer.isView = function(e4) { return "object" === (0, o2.default)(e4) && e4.buffer && e4.buffer.constructor === ArrayBuffer; }); for (var k2 = function(e4, t4, r4) { return function(n3) { return new N2(e4, t4, e4).update(n3)[r4](); }; }, _2 = function(e4, t4, r4) { return function(n3, i3) { return new N2(e4, t4, i3).update(n3)[r4](); }; }, A2 = function(e4, t4, r4) { return function(t5, n3, i3, o3) { return O2["cshake" + e4].update(t5, n3, i3, o3)[r4](); }; }, E2 = function(e4, t4, r4) { return function(t5, n3, i3, o3) { return O2["kmac" + e4].update(t5, n3, i3, o3)[r4](); }; }, S2 = function(e4, t4, r4, n3) { for (var i3 = 0; i3 < g2.length; ++i3) { var o3 = g2[i3]; e4[o3] = t4(r4, n3, o3); } return e4; }, x2 = function(e4, t4) { var r4 = k2(e4, t4, "hex"); return r4.create = function() { return new N2(e4, t4, e4); }, r4.update = function(e5) { return r4.create().update(e5); }, S2(r4, k2, e4, t4); }, B2 = [{ name: "keccak", padding: [1, 256, 65536, 16777216], bits: v2, createMethod: x2 }, { name: "sha3", padding: [6, 1536, 393216, 100663296], bits: v2, createMethod: x2 }, { name: "shake", padding: [31, 7936, 2031616, 520093696], bits: m2, createMethod: function(e4, t4) { var r4 = _2(e4, t4, "hex"); return r4.create = function(r5) { return new N2(e4, t4, r5); }, r4.update = function(e5, t5) { return r4.create(t5).update(e5); }, S2(r4, _2, e4, t4); } }, { name: "cshake", padding: p2, bits: m2, createMethod: function(e4, t4) { var r4 = w2[e4], n3 = A2(e4, 0, "hex"); return n3.create = function(n4, i3, o3) { return i3 || o3 ? new N2(e4, t4, n4).bytepad([i3, o3], r4) : O2["shake" + e4].create(n4); }, n3.update = function(e5, t5, r5, i3) { return n3.create(t5, r5, i3).update(e5); }, S2(n3, A2, e4, t4); } }, { name: "kmac", padding: p2, bits: m2, createMethod: function(e4, t4) { var r4 = w2[e4], n3 = E2(e4, 0, "hex"); return n3.create = function(n4, i3, o3) { return new j2(e4, t4, i3).bytepad(["KMAC", o3], r4).bytepad([n4], r4); }, n3.update = function(e5, t5, r5, i3) { return n3.create(e5, r5, i3).update(t5); }, S2(n3, E2, e4, t4); } }], O2 = {}, P2 = [], I2 = 0; I2 < B2.length; ++I2) for (var T2 = B2[I2], C2 = T2.bits, M2 = 0; M2 < C2.length; ++M2) { var R2 = T2.name + "_" + C2[M2]; if (P2.push(R2), O2[R2] = T2.createMethod(C2[M2], T2.padding), "sha3" !== T2.name) { var U2 = T2.name + C2[M2]; P2.push(U2), O2[U2] = O2[R2]; } } function N2(e4, t4, r4) { this.blocks = [], this.s = [], this.padding = t4, this.outputBits = r4, this.reset = true, this.finalized = false, this.block = 0, this.start = 0, this.blockCount = 1600 - (e4 << 1) >> 5, this.byteCount = this.blockCount << 2, this.outputBlocks = r4 >> 5, this.extraBytes = (31 & r4) >> 3; for (var n3 = 0; n3 < 50; ++n3) this.s[n3] = 0; } function j2(e4, t4, r4) { N2.call(this, e4, t4, r4); } N2.prototype.update = function(e4) { if (this.finalized) throw new Error("finalize already called"); var t4, r4 = (0, o2.default)(e4); if ("string" !== r4) { if ("object" !== r4) throw new Error(a2); if (null === e4) throw new Error(a2); if (l2 && e4.constructor === ArrayBuffer) e4 = new Uint8Array(e4); else if (!(Array.isArray(e4) || l2 && ArrayBuffer.isView(e4))) throw new Error(a2); t4 = true; } for (var n3, i3, s3 = this.blocks, u3 = this.byteCount, c3 = e4.length, f3 = this.blockCount, d3 = 0, h3 = this.s; d3 < c3; ) { if (this.reset) for (this.reset = false, s3[0] = this.block, n3 = 1; n3 < f3 + 1; ++n3) s3[n3] = 0; if (t4) for (n3 = this.start; d3 < c3 && n3 < u3; ++d3) s3[n3 >> 2] |= e4[d3] << b2[3 & n3++]; else for (n3 = this.start; d3 < c3 && n3 < u3; ++d3) (i3 = e4.charCodeAt(d3)) < 128 ? s3[n3 >> 2] |= i3 << b2[3 & n3++] : i3 < 2048 ? (s3[n3 >> 2] |= (192 | i3 >> 6) << b2[3 & n3++], s3[n3 >> 2] |= (128 | 63 & i3) << b2[3 & n3++]) : i3 < 55296 || i3 >= 57344 ? (s3[n3 >> 2] |= (224 | i3 >> 12) << b2[3 & n3++], s3[n3 >> 2] |= (128 | i3 >> 6 & 63) << b2[3 & n3++], s3[n3 >> 2] |= (128 | 63 & i3) << b2[3 & n3++]) : (i3 = 65536 + ((1023 & i3) << 10 | 1023 & e4.charCodeAt(++d3)), s3[n3 >> 2] |= (240 | i3 >> 18) << b2[3 & n3++], s3[n3 >> 2] |= (128 | i3 >> 12 & 63) << b2[3 & n3++], s3[n3 >> 2] |= (128 | i3 >> 6 & 63) << b2[3 & n3++], s3[n3 >> 2] |= (128 | 63 & i3) << b2[3 & n3++]); if (this.lastByteIndex = n3, n3 >= u3) { for (this.start = n3 - u3, this.block = s3[f3], n3 = 0; n3 < f3; ++n3) h3[n3] ^= s3[n3]; L2(h3), this.reset = true; } else this.start = n3; } return this; }, N2.prototype.encode = function(e4, t4) { var r4 = 255 & e4, n3 = 1, i3 = [r4]; for (r4 = 255 & (e4 >>= 8); r4 > 0; ) i3.unshift(r4), r4 = 255 & (e4 >>= 8), ++n3; return t4 ? i3.push(n3) : i3.unshift(n3), this.update(i3), i3.length; }, N2.prototype.encodeString = function(e4) { var t4, r4 = (0, o2.default)(e4); if ("string" !== r4) { if ("object" !== r4) throw new Error(a2); if (null === e4) throw new Error(a2); if (l2 && e4.constructor === ArrayBuffer) e4 = new Uint8Array(e4); else if (!(Array.isArray(e4) || l2 && ArrayBuffer.isView(e4))) throw new Error(a2); t4 = true; } var n3 = 0, i3 = e4.length; if (t4) n3 = i3; else for (var s3 = 0; s3 < e4.length; ++s3) { var u3 = e4.charCodeAt(s3); u3 < 128 ? n3 += 1 : u3 < 2048 ? n3 += 2 : u3 < 55296 || u3 >= 57344 ? n3 += 3 : (u3 = 65536 + ((1023 & u3) << 10 | 1023 & e4.charCodeAt(++s3)), n3 += 4); } return n3 += this.encode(8 * n3), this.update(e4), n3; }, N2.prototype.bytepad = function(e4, t4) { for (var r4 = this.encode(t4), n3 = 0; n3 < e4.length; ++n3) r4 += this.encodeString(e4[n3]); var i3 = t4 - r4 % t4, o3 = []; return o3.length = i3, this.update(o3), this; }, N2.prototype.finalize = function() { if (!this.finalized) { this.finalized = true; var e4 = this.blocks, t4 = this.lastByteIndex, r4 = this.blockCount, n3 = this.s; if (e4[t4 >> 2] |= this.padding[3 & t4], this.lastByteIndex === this.byteCount) for (e4[0] = e4[r4], t4 = 1; t4 < r4 + 1; ++t4) e4[t4] = 0; for (e4[r4 - 1] |= 2147483648, t4 = 0; t4 < r4; ++t4) n3[t4] ^= e4[t4]; L2(n3); } }, N2.prototype.toString = N2.prototype.hex = function() { this.finalize(); for (var e4, t4 = this.blockCount, r4 = this.s, n3 = this.outputBlocks, i3 = this.extraBytes, o3 = 0, a3 = 0, s3 = ""; a3 < n3; ) { for (o3 = 0; o3 < t4 && a3 < n3; ++o3, ++a3) e4 = r4[o3], s3 += h2[e4 >> 4 & 15] + h2[15 & e4] + h2[e4 >> 12 & 15] + h2[e4 >> 8 & 15] + h2[e4 >> 20 & 15] + h2[e4 >> 16 & 15] + h2[e4 >> 28 & 15] + h2[e4 >> 24 & 15]; a3 % t4 == 0 && (L2(r4), o3 = 0); } return i3 && (e4 = r4[o3], s3 += h2[e4 >> 4 & 15] + h2[15 & e4], i3 > 1 && (s3 += h2[e4 >> 12 & 15] + h2[e4 >> 8 & 15]), i3 > 2 && (s3 += h2[e4 >> 20 & 15] + h2[e4 >> 16 & 15])), s3; }, N2.prototype.arrayBuffer = function() { this.finalize(); var e4, t4 = this.blockCount, r4 = this.s, n3 = this.outputBlocks, i3 = this.extraBytes, o3 = 0, a3 = 0, s3 = this.outputBits >> 3; e4 = i3 ? new ArrayBuffer(n3 + 1 << 2) : new ArrayBuffer(s3); for (var u3 = new Uint32Array(e4); a3 < n3; ) { for (o3 = 0; o3 < t4 && a3 < n3; ++o3, ++a3) u3[a3] = r4[o3]; a3 % t4 == 0 && L2(r4); } return i3 && (u3[o3] = r4[o3], e4 = e4.slice(0, s3)), e4; }, N2.prototype.buffer = N2.prototype.arrayBuffer, N2.prototype.digest = N2.prototype.array = function() { this.finalize(); for (var e4, t4, r4 = this.blockCount, n3 = this.s, i3 = this.outputBlocks, o3 = this.extraBytes, a3 = 0, s3 = 0, u3 = []; s3 < i3; ) { for (a3 = 0; a3 < r4 && s3 < i3; ++a3, ++s3) e4 = s3 << 2, t4 = n3[a3], u3[e4] = 255 & t4, u3[e4 + 1] = t4 >> 8 & 255, u3[e4 + 2] = t4 >> 16 & 255, u3[e4 + 3] = t4 >> 24 & 255; s3 % r4 == 0 && L2(n3); } return o3 && (e4 = s3 << 2, t4 = n3[a3], u3[e4] = 255 & t4, o3 > 1 && (u3[e4 + 1] = t4 >> 8 & 255), o3 > 2 && (u3[e4 + 2] = t4 >> 16 & 255)), u3; }, j2.prototype = new N2(), j2.prototype.finalize = function() { return this.encode(this.outputBits, true), N2.prototype.finalize.call(this); }; var L2 = function(e4) { var t4, r4, n3, i3, o3, a3, s3, u3, c3, f3, d3, l3, h3, p3, b3, v3, m3, g3, w3, k3, _3, A3, E3, S3, x3, B3, O3, P3, I3, T3, C3, M3, R3, U3, N3, j3, L3, F2, D2, H2, z2, q2, K2, G2, V2, Z2, W2, J2, Y2, X2, Q2, $2, ee2, te2, re2, ne2, ie2, oe2, ae2, se2, ue2, ce2, fe2; for (n3 = 0; n3 < 48; n3 += 2) i3 = e4[0] ^ e4[10] ^ e4[20] ^ e4[30] ^ e4[40], o3 = e4[1] ^ e4[11] ^ e4[21] ^ e4[31] ^ e4[41], a3 = e4[2] ^ e4[12] ^ e4[22] ^ e4[32] ^ e4[42], s3 = e4[3] ^ e4[13] ^ e4[23] ^ e4[33] ^ e4[43], u3 = e4[4] ^ e4[14] ^ e4[24] ^ e4[34] ^ e4[44], c3 = e4[5] ^ e4[15] ^ e4[25] ^ e4[35] ^ e4[45], f3 = e4[6] ^ e4[16] ^ e4[26] ^ e4[36] ^ e4[46], d3 = e4[7] ^ e4[17] ^ e4[27] ^ e4[37] ^ e4[47], t4 = (l3 = e4[8] ^ e4[18] ^ e4[28] ^ e4[38] ^ e4[48]) ^ (a3 << 1 | s3 >>> 31), r4 = (h3 = e4[9] ^ e4[19] ^ e4[29] ^ e4[39] ^ e4[49]) ^ (s3 << 1 | a3 >>> 31), e4[0] ^= t4, e4[1] ^= r4, e4[10] ^= t4, e4[11] ^= r4, e4[20] ^= t4, e4[21] ^= r4, e4[30] ^= t4, e4[31] ^= r4, e4[40] ^= t4, e4[41] ^= r4, t4 = i3 ^ (u3 << 1 | c3 >>> 31), r4 = o3 ^ (c3 << 1 | u3 >>> 31), e4[2] ^= t4, e4[3] ^= r4, e4[12] ^= t4, e4[13] ^= r4, e4[22] ^= t4, e4[23] ^= r4, e4[32] ^= t4, e4[33] ^= r4, e4[42] ^= t4, e4[43] ^= r4, t4 = a3 ^ (f3 << 1 | d3 >>> 31), r4 = s3 ^ (d3 << 1 | f3 >>> 31), e4[4] ^= t4, e4[5] ^= r4, e4[14] ^= t4, e4[15] ^= r4, e4[24] ^= t4, e4[25] ^= r4, e4[34] ^= t4, e4[35] ^= r4, e4[44] ^= t4, e4[45] ^= r4, t4 = u3 ^ (l3 << 1 | h3 >>> 31), r4 = c3 ^ (h3 << 1 | l3 >>> 31), e4[6] ^= t4, e4[7] ^= r4, e4[16] ^= t4, e4[17] ^= r4, e4[26] ^= t4, e4[27] ^= r4, e4[36] ^= t4, e4[37] ^= r4, e4[46] ^= t4, e4[47] ^= r4, t4 = f3 ^ (i3 << 1 | o3 >>> 31), r4 = d3 ^ (o3 << 1 | i3 >>> 31), e4[8] ^= t4, e4[9] ^= r4, e4[18] ^= t4, e4[19] ^= r4, e4[28] ^= t4, e4[29] ^= r4, e4[38] ^= t4, e4[39] ^= r4, e4[48] ^= t4, e4[49] ^= r4, p3 = e4[0], b3 = e4[1], Z2 = e4[11] << 4 | e4[10] >>> 28, W2 = e4[10] << 4 | e4[11] >>> 28, P3 = e4[20] << 3 | e4[21] >>> 29, I3 = e4[21] << 3 | e4[20] >>> 29, se2 = e4[31] << 9 | e4[30] >>> 23, ue2 = e4[30] << 9 | e4[31] >>> 23, q2 = e4[40] << 18 | e4[41] >>> 14, K2 = e4[41] << 18 | e4[40] >>> 14, U3 = e4[2] << 1 | e4[3] >>> 31, N3 = e4[3] << 1 | e4[2] >>> 31, v3 = e4[13] << 12 | e4[12] >>> 20, m3 = e4[12] << 12 | e4[13] >>> 20, J2 = e4[22] << 10 | e4[23] >>> 22, Y2 = e4[23] << 10 | e4[22] >>> 22, T3 = e4[33] << 13 | e4[32] >>> 19, C3 = e4[32] << 13 | e4[33] >>> 19, ce2 = e4[42] << 2 | e4[43] >>> 30, fe2 = e4[43] << 2 | e4[42] >>> 30, te2 = e4[5] << 30 | e4[4] >>> 2, re2 = e4[4] << 30 | e4[5] >>> 2, j3 = e4[14] << 6 | e4[15] >>> 26, L3 = e4[15] << 6 | e4[14] >>> 26, g3 = e4[25] << 11 | e4[24] >>> 21, w3 = e4[24] << 11 | e4[25] >>> 21, X2 = e4[34] << 15 | e4[35] >>> 17, Q2 = e4[35] << 15 | e4[34] >>> 17, M3 = e4[45] << 29 | e4[44] >>> 3, R3 = e4[44] << 29 | e4[45] >>> 3, S3 = e4[6] << 28 | e4[7] >>> 4, x3 = e4[7] << 28 | e4[6] >>> 4, ne2 = e4[17] << 23 | e4[16] >>> 9, ie2 = e4[16] << 23 | e4[17] >>> 9, F2 = e4[26] << 25 | e4[27] >>> 7, D2 = e4[27] << 25 | e4[26] >>> 7, k3 = e4[36] << 21 | e4[37] >>> 11, _3 = e4[37] << 21 | e4[36] >>> 11, $2 = e4[47] << 24 | e4[46] >>> 8, ee2 = e4[46] << 24 | e4[47] >>> 8, G2 = e4[8] << 27 | e4[9] >>> 5, V2 = e4[9] << 27 | e4[8] >>> 5, B3 = e4[18] << 20 | e4[19] >>> 12, O3 = e4[19] << 20 | e4[18] >>> 12, oe2 = e4[29] << 7 | e4[28] >>> 25, ae2 = e4[28] << 7 | e4[29] >>> 25, H2 = e4[38] << 8 | e4[39] >>> 24, z2 = e4[39] << 8 | e4[38] >>> 24, A3 = e4[48] << 14 | e4[49] >>> 18, E3 = e4[49] << 14 | e4[48] >>> 18, e4[0] = p3 ^ ~v3 & g3, e4[1] = b3 ^ ~m3 & w3, e4[10] = S3 ^ ~B3 & P3, e4[11] = x3 ^ ~O3 & I3, e4[20] = U3 ^ ~j3 & F2, e4[21] = N3 ^ ~L3 & D2, e4[30] = G2 ^ ~Z2 & J2, e4[31] = V2 ^ ~W2 & Y2, e4[40] = te2 ^ ~ne2 & oe2, e4[41] = re2 ^ ~ie2 & ae2, e4[2] = v3 ^ ~g3 & k3, e4[3] = m3 ^ ~w3 & _3, e4[12] = B3 ^ ~P3 & T3, e4[13] = O3 ^ ~I3 & C3, e4[22] = j3 ^ ~F2 & H2, e4[23] = L3 ^ ~D2 & z2, e4[32] = Z2 ^ ~J2 & X2, e4[33] = W2 ^ ~Y2 & Q2, e4[42] = ne2 ^ ~oe2 & se2, e4[43] = ie2 ^ ~ae2 & ue2, e4[4] = g3 ^ ~k3 & A3, e4[5] = w3 ^ ~_3 & E3, e4[14] = P3 ^ ~T3 & M3, e4[15] = I3 ^ ~C3 & R3, e4[24] = F2 ^ ~H2 & q2, e4[25] = D2 ^ ~z2 & K2, e4[34] = J2 ^ ~X2 & $2, e4[35] = Y2 ^ ~Q2 & ee2, e4[44] = oe2 ^ ~se2 & ce2, e4[45] = ae2 ^ ~ue2 & fe2, e4[6] = k3 ^ ~A3 & p3, e4[7] = _3 ^ ~E3 & b3, e4[16] = T3 ^ ~M3 & S3, e4[17] = C3 ^ ~R3 & x3, e4[26] = H2 ^ ~q2 & U3, e4[27] = z2 ^ ~K2 & N3, e4[36] = X2 ^ ~$2 & G2, e4[37] = Q2 ^ ~ee2 & V2, e4[46] = se2 ^ ~ce2 & te2, e4[47] = ue2 ^ ~fe2 & re2, e4[8] = A3 ^ ~p3 & v3, e4[9] = E3 ^ ~b3 & m3, e4[18] = M3 ^ ~S3 & B3, e4[19] = R3 ^ ~x3 & O3, e4[28] = q2 ^ ~U3 & j3, e4[29] = K2 ^ ~N3 & L3, e4[38] = $2 ^ ~G2 & Z2, e4[39] = ee2 ^ ~V2 & W2, e4[48] = ce2 ^ ~te2 & ne2, e4[49] = fe2 ^ ~re2 & ie2, e4[0] ^= y2[n3], e4[1] ^= y2[n3 + 1]; }; if (f2) e3.exports = O2; else { for (I2 = 0; I2 < P2.length; ++I2) u2[P2[I2]] = O2[P2[I2]]; d2 && (void 0 === (n2 = (function() { return O2; }).call(t3, r3, t3, e3)) || (e3.exports = n2)); } }(); }, 37252: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.version = void 0, t3.version = "logger/5.7.0"; }, 64327: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.Logger = t3.LogLevel = t3.ErrorCode = void 0; var i2, o2, a2 = n2(r3(69721)), s2 = n2(r3(58985)), u2 = r3(37252), c2 = false, f2 = false, d2 = { debug: 1, default: 2, info: 2, warning: 3, error: 4, off: 5 }, l2 = d2.default, h2 = null, p2 = function() { try { var e4 = []; if (["NFD", "NFC", "NFKD", "NFKC"].forEach(function(t4) { try { if ("test" !== "test".normalize(t4)) throw new Error("bad normalize"); } catch (r4) { e4.push(t4); } }), e4.length) throw new Error("missing " + e4.join(", ")); if (String.fromCharCode(233).normalize("NFD") !== String.fromCharCode(101, 769)) throw new Error("broken implementation"); } catch (e5) { return e5.message; } return null; }(); t3.LogLevel = i2, function(e4) { e4.DEBUG = "DEBUG", e4.INFO = "INFO", e4.WARNING = "WARNING", e4.ERROR = "ERROR", e4.OFF = "OFF"; }(i2 || (t3.LogLevel = i2 = {})), t3.ErrorCode = o2, function(e4) { e4.UNKNOWN_ERROR = "UNKNOWN_ERROR", e4.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", e4.UNSUPPORTED_OPERATION = "UNSUPPORTED_OPERATION", e4.NETWORK_ERROR = "NETWORK_ERROR", e4.SERVER_ERROR = "SERVER_ERROR", e4.TIMEOUT = "TIMEOUT", e4.BUFFER_OVERRUN = "BUFFER_OVERRUN", e4.NUMERIC_FAULT = "NUMERIC_FAULT", e4.MISSING_NEW = "MISSING_NEW", e4.INVALID_ARGUMENT = "INVALID_ARGUMENT", e4.MISSING_ARGUMENT = "MISSING_ARGUMENT", e4.UNEXPECTED_ARGUMENT = "UNEXPECTED_ARGUMENT", e4.CALL_EXCEPTION = "CALL_EXCEPTION", e4.INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS", e4.NONCE_EXPIRED = "NONCE_EXPIRED", e4.REPLACEMENT_UNDERPRICED = "REPLACEMENT_UNDERPRICED", e4.UNPREDICTABLE_GAS_LIMIT = "UNPREDICTABLE_GAS_LIMIT", e4.TRANSACTION_REPLACED = "TRANSACTION_REPLACED", e4.ACTION_REJECTED = "ACTION_REJECTED"; }(o2 || (t3.ErrorCode = o2 = {})); var b2 = "0123456789abcdef", y2 = function() { function e4(t4) { (0, a2.default)(this, e4), Object.defineProperty(this, "version", { enumerable: true, value: t4, writable: false }); } return (0, s2.default)(e4, [{ key: "_log", value: function(e5, t4) { var r4 = e5.toLowerCase(); null == d2[r4] && this.throwArgumentError("invalid log level name", "logLevel", e5), l2 > d2[r4] || console.log.apply(console, t4); } }, { key: "debug", value: function() { for (var t4 = arguments.length, r4 = new Array(t4), n3 = 0; n3 < t4; n3++) r4[n3] = arguments[n3]; this._log(e4.levels.DEBUG, r4); } }, { key: "info", value: function() { for (var t4 = arguments.length, r4 = new Array(t4), n3 = 0; n3 < t4; n3++) r4[n3] = arguments[n3]; this._log(e4.levels.INFO, r4); } }, { key: "warn", value: function() { for (var t4 = arguments.length, r4 = new Array(t4), n3 = 0; n3 < t4; n3++) r4[n3] = arguments[n3]; this._log(e4.levels.WARNING, r4); } }, { key: "makeError", value: function(t4, r4, n3) { if (f2) return this.makeError("censored error", r4, {}); r4 || (r4 = e4.errors.UNKNOWN_ERROR), n3 || (n3 = {}); var i3 = []; Object.keys(n3).forEach(function(e5) { var t5 = n3[e5]; try { if (t5 instanceof Uint8Array) { for (var r5 = "", o3 = 0; o3 < t5.length; o3++) r5 += b2[t5[o3] >> 4], r5 += b2[15 & t5[o3]]; i3.push(e5 + "=Uint8Array(0x" + r5 + ")"); } else i3.push(e5 + "=" + JSON.stringify(t5)); } catch (t6) { i3.push(e5 + "=" + JSON.stringify(n3[e5].toString())); } }), i3.push("code=".concat(r4)), i3.push("version=".concat(this.version)); var a3 = t4, s3 = ""; switch (r4) { case o2.NUMERIC_FAULT: s3 = "NUMERIC_FAULT"; var u3 = t4; switch (u3) { case "overflow": case "underflow": case "division-by-zero": s3 += "-" + u3; break; case "negative-power": case "negative-width": s3 += "-unsupported"; break; case "unbound-bitwise-result": s3 += "-unbound-result"; } break; case o2.CALL_EXCEPTION: case o2.INSUFFICIENT_FUNDS: case o2.MISSING_NEW: case o2.NONCE_EXPIRED: case o2.REPLACEMENT_UNDERPRICED: case o2.TRANSACTION_REPLACED: case o2.UNPREDICTABLE_GAS_LIMIT: s3 = r4; } s3 && (t4 += " [ See: https://links.ethers.org/v5-errors-" + s3 + " ]"), i3.length && (t4 += " (" + i3.join(", ") + ")"); var c3 = new Error(t4); return c3.reason = a3, c3.code = r4, Object.keys(n3).forEach(function(e5) { c3[e5] = n3[e5]; }), c3; } }, { key: "throwError", value: function(e5, t4, r4) { throw this.makeError(e5, t4, r4); } }, { key: "throwArgumentError", value: function(t4, r4, n3) { return this.throwError(t4, e4.errors.INVALID_ARGUMENT, { argument: r4, value: n3 }); } }, { key: "assert", value: function(e5, t4, r4, n3) { e5 || this.throwError(t4, r4, n3); } }, { key: "assertArgument", value: function(e5, t4, r4, n3) { e5 || this.throwArgumentError(t4, r4, n3); } }, { key: "checkNormalize", value: function(t4) { p2 && this.throwError("platform missing String.prototype.normalize", e4.errors.UNSUPPORTED_OPERATION, { operation: "String.prototype.normalize", form: p2 }); } }, { key: "checkSafeUint53", value: function(t4, r4) { "number" == typeof t4 && (null == r4 && (r4 = "value not safe"), (t4 < 0 || t4 >= 9007199254740991) && this.throwError(r4, e4.errors.NUMERIC_FAULT, { operation: "checkSafeInteger", fault: "out-of-safe-range", value: t4 }), t4 % 1 && this.throwError(r4, e4.errors.NUMERIC_FAULT, { operation: "checkSafeInteger", fault: "non-integer", value: t4 })); } }, { key: "checkArgumentCount", value: function(t4, r4, n3) { n3 = n3 ? ": " + n3 : "", t4 < r4 && this.throwError("missing argument" + n3, e4.errors.MISSING_ARGUMENT, { count: t4, expectedCount: r4 }), t4 > r4 && this.throwError("too many arguments" + n3, e4.errors.UNEXPECTED_ARGUMENT, { count: t4, expectedCount: r4 }); } }, { key: "checkNew", value: function(t4, r4) { t4 !== Object && null != t4 || this.throwError("missing new", e4.errors.MISSING_NEW, { name: r4.name }); } }, { key: "checkAbstract", value: function(t4, r4) { t4 === r4 ? this.throwError("cannot instantiate abstract class " + JSON.stringify(r4.name) + " directly; use a sub-class", e4.errors.UNSUPPORTED_OPERATION, { name: t4.name, operation: "new" }) : t4 !== Object && null != t4 || this.throwError("missing new", e4.errors.MISSING_NEW, { name: r4.name }); } }], [{ key: "globalLogger", value: function() { return h2 || (h2 = new e4(u2.version)), h2; } }, { key: "setCensorship", value: function(t4, r4) { if (!t4 && r4 && this.globalLogger().throwError("cannot permanently disable censorship", e4.errors.UNSUPPORTED_OPERATION, { operation: "setCensorship" }), c2) { if (!t4) return; this.globalLogger().throwError("error censorship permanent", e4.errors.UNSUPPORTED_OPERATION, { operation: "setCensorship" }); } f2 = !!t4, c2 = !!r4; } }, { key: "setLogLevel", value: function(t4) { var r4 = d2[t4.toLowerCase()]; null != r4 ? l2 = r4 : e4.globalLogger().warn("invalid log level - " + t4); } }, { key: "from", value: function(t4) { return new e4(t4); } }]), e4; }(); t3.Logger = y2, y2.errors = o2, y2.levels = i2; }, 64071: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.version = void 0, t3.version = "properties/5.7.0"; }, 23694: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.Description = void 0, t3.checkProperties = function(e4, t4) { e4 && "object" === (0, s2.default)(e4) || d2.throwArgumentError("invalid object", "object", e4), Object.keys(e4).forEach(function(r4) { t4[r4] || d2.throwArgumentError("invalid object key - " + r4, "transaction:" + r4, e4); }); }, t3.deepCopy = y2, t3.defineReadOnly = l2, t3.getStatic = function(e4, t4) { for (var r4 = 0; r4 < 32; r4++) { if (e4[t4]) return e4[t4]; if (!e4.prototype || "object" !== (0, s2.default)(e4.prototype)) break; e4 = Object.getPrototypeOf(e4.prototype).constructor; } return null; }, t3.resolveProperties = function(e4) { return f2(this, void 0, void 0, i2.default.mark(function t4() { var r4, n3; return i2.default.wrap(function(t5) { for (; ; ) switch (t5.prev = t5.next) { case 0: return r4 = Object.keys(e4).map(function(t6) { var r5 = e4[t6]; return Promise.resolve(r5).then(function(e5) { return { key: t6, value: e5 }; }); }), t5.next = 3, Promise.all(r4); case 3: return n3 = t5.sent, t5.abrupt("return", n3.reduce(function(e5, t6) { return e5[t6.key] = t6.value, e5; }, {})); case 5: case "end": return t5.stop(); } }, t4); })); }, t3.shallowCopy = function(e4) { var t4 = {}; for (var r4 in e4) t4[r4] = e4[r4]; return t4; }; var i2 = n2(r3(82247)), o2 = n2(r3(58985)), a2 = n2(r3(69721)), s2 = n2(r3(3355)), u2 = r3(64327), c2 = r3(64071), f2 = function(e4, t4, r4, n3) { return new (r4 || (r4 = Promise))(function(i3, o3) { function a3(e5) { try { u3(n3.next(e5)); } catch (e6) { o3(e6); } } function s3(e5) { try { u3(n3.throw(e5)); } catch (e6) { o3(e6); } } function u3(e5) { var t5; e5.done ? i3(e5.value) : (t5 = e5.value, t5 instanceof r4 ? t5 : new r4(function(e6) { e6(t5); })).then(a3, s3); } u3((n3 = n3.apply(e4, t4 || [])).next()); }); }, d2 = new u2.Logger(c2.version); function l2(e4, t4, r4) { Object.defineProperty(e4, t4, { enumerable: true, value: r4, writable: false }); } var h2 = { bigint: true, boolean: true, function: true, number: true, string: true }; function p2(e4) { if (null == e4 || h2[(0, s2.default)(e4)]) return true; if (Array.isArray(e4) || "object" === (0, s2.default)(e4)) { if (!Object.isFrozen(e4)) return false; for (var t4 = Object.keys(e4), r4 = 0; r4 < t4.length; r4++) { var n3 = null; try { n3 = e4[t4[r4]]; } catch (e5) { continue; } if (!p2(n3)) return false; } return true; } return d2.throwArgumentError("Cannot deepCopy ".concat((0, s2.default)(e4)), "object", e4); } function b2(e4) { if (p2(e4)) return e4; if (Array.isArray(e4)) return Object.freeze(e4.map(function(e5) { return y2(e5); })); if ("object" === (0, s2.default)(e4)) { var t4 = {}; for (var r4 in e4) { var n3 = e4[r4]; void 0 !== n3 && l2(t4, r4, y2(n3)); } return t4; } return d2.throwArgumentError("Cannot deepCopy ".concat((0, s2.default)(e4)), "object", e4); } function y2(e4) { return b2(e4); } var v2 = (0, o2.default)(function e4(t4) { for (var r4 in (0, a2.default)(this, e4), t4) this[r4] = y2(t4[r4]); }); t3.Description = v2; }, 61466: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.version = void 0, t3.version = "rlp/5.7.0"; }, 55265: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.decode = function(e4) { var t4 = (0, n2.arrayify)(e4), r4 = d2(t4, 0); return r4.consumed !== t4.length && a2.throwArgumentError("invalid rlp data", "data", e4), r4.result; }, t3.encode = function(e4) { return (0, n2.hexlify)(c2(e4)); }; var n2 = r3(908), i2 = r3(64327), o2 = r3(61466), a2 = new i2.Logger(o2.version); function s2(e4) { for (var t4 = []; e4; ) t4.unshift(255 & e4), e4 >>= 8; return t4; } function u2(e4, t4, r4) { for (var n3 = 0, i3 = 0; i3 < r4; i3++) n3 = 256 * n3 + e4[t4 + i3]; return n3; } function c2(e4) { if (Array.isArray(e4)) { var t4 = []; if (e4.forEach(function(e5) { t4 = t4.concat(c2(e5)); }), t4.length <= 55) return t4.unshift(192 + t4.length), t4; var r4 = s2(t4.length); return r4.unshift(247 + r4.length), r4.concat(t4); } (0, n2.isBytesLike)(e4) || a2.throwArgumentError("RLP object must be BytesLike", "object", e4); var i3 = Array.prototype.slice.call((0, n2.arrayify)(e4)); if (1 === i3.length && i3[0] <= 127) return i3; if (i3.length <= 55) return i3.unshift(128 + i3.length), i3; var o3 = s2(i3.length); return o3.unshift(183 + o3.length), o3.concat(i3); } function f2(e4, t4, r4, n3) { for (var o3 = []; r4 < t4 + 1 + n3; ) { var s3 = d2(e4, r4); o3.push(s3.result), (r4 += s3.consumed) > t4 + 1 + n3 && a2.throwError("child data too short", i2.Logger.errors.BUFFER_OVERRUN, {}); } return { consumed: 1 + n3, result: o3 }; } function d2(e4, t4) { if (0 === e4.length && a2.throwError("data too short", i2.Logger.errors.BUFFER_OVERRUN, {}), e4[t4] >= 248) { var r4 = e4[t4] - 247; t4 + 1 + r4 > e4.length && a2.throwError("data short segment too short", i2.Logger.errors.BUFFER_OVERRUN, {}); var o3 = u2(e4, t4 + 1, r4); return t4 + 1 + r4 + o3 > e4.length && a2.throwError("data long segment too short", i2.Logger.errors.BUFFER_OVERRUN, {}), f2(e4, t4, t4 + 1 + r4, r4 + o3); } if (e4[t4] >= 192) { var s3 = e4[t4] - 192; return t4 + 1 + s3 > e4.length && a2.throwError("data array too short", i2.Logger.errors.BUFFER_OVERRUN, {}), f2(e4, t4, t4 + 1, s3); } if (e4[t4] >= 184) { var c3 = e4[t4] - 183; t4 + 1 + c3 > e4.length && a2.throwError("data array too short", i2.Logger.errors.BUFFER_OVERRUN, {}); var d3 = u2(e4, t4 + 1, c3); return t4 + 1 + c3 + d3 > e4.length && a2.throwError("data array too short", i2.Logger.errors.BUFFER_OVERRUN, {}), { consumed: 1 + c3 + d3, result: (0, n2.hexlify)(e4.slice(t4 + 1 + c3, t4 + 1 + c3 + d3)) }; } if (e4[t4] >= 128) { var l2 = e4[t4] - 128; return t4 + 1 + l2 > e4.length && a2.throwError("data too short", i2.Logger.errors.BUFFER_OVERRUN, {}), { consumed: 1 + l2, result: (0, n2.hexlify)(e4.slice(t4 + 1, t4 + 1 + l2)) }; } return { consumed: 1, result: (0, n2.hexlify)(e4[t4]) }; } }, 48100: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.version = void 0, t3.version = "signing-key/5.7.0"; }, 36918: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.EC = void 0; var i2 = n2(r3(3355)), o2 = n2(r3(31734)), a2 = n2(r3(37198)); function s2(e4, t4, r4) { return r4 = { path: t4, exports: {}, require: function(e5, t5) { return function() { throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs"); }(null == t5 && r4.path); } }, e4(r4, r4.exports), r4.exports; } "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== r3.g ? r3.g : "undefined" != typeof self && self; var u2 = c2; function c2(e4, t4) { if (!e4) throw new Error(t4 || "Assertion failed"); } c2.equal = function(e4, t4, r4) { if (e4 != t4) throw new Error(r4 || "Assertion failed: " + e4 + " != " + t4); }; var f2 = s2(function(e4, t4) { var r4 = t4; function n3(e5) { return 1 === e5.length ? "0" + e5 : e5; } function i3(e5) { for (var t5 = "", r5 = 0; r5 < e5.length; r5++) t5 += n3(e5[r5].toString(16)); return t5; } r4.toArray = function(e5, t5) { if (Array.isArray(e5)) return e5.slice(); if (!e5) return []; var r5 = []; if ("string" != typeof e5) { for (var n4 = 0; n4 < e5.length; n4++) r5[n4] = 0 | e5[n4]; return r5; } if ("hex" === t5) for ((e5 = e5.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (e5 = "0" + e5), n4 = 0; n4 < e5.length; n4 += 2) r5.push(parseInt(e5[n4] + e5[n4 + 1], 16)); else for (n4 = 0; n4 < e5.length; n4++) { var i4 = e5.charCodeAt(n4), o3 = i4 >> 8, a3 = 255 & i4; o3 ? r5.push(o3, a3) : r5.push(a3); } return r5; }, r4.zero2 = n3, r4.toHex = i3, r4.encode = function(e5, t5) { return "hex" === t5 ? i3(e5) : e5; }; }), d2 = s2(function(e4, t4) { var r4 = t4; r4.assert = u2, r4.toArray = f2.toArray, r4.zero2 = f2.zero2, r4.toHex = f2.toHex, r4.encode = f2.encode, r4.getNAF = function(e5, t5, r5) { var n3 = new Array(Math.max(e5.bitLength(), r5) + 1); n3.fill(0); for (var i3 = 1 << t5 + 1, o3 = e5.clone(), a3 = 0; a3 < n3.length; a3++) { var s3, u3 = o3.andln(i3 - 1); o3.isOdd() ? (s3 = u3 > (i3 >> 1) - 1 ? (i3 >> 1) - u3 : u3, o3.isubn(s3)) : s3 = 0, n3[a3] = s3, o3.iushrn(1); } return n3; }, r4.getJSF = function(e5, t5) { var r5 = [[], []]; e5 = e5.clone(), t5 = t5.clone(); for (var n3, i3 = 0, o3 = 0; e5.cmpn(-i3) > 0 || t5.cmpn(-o3) > 0; ) { var a3, s3, u3 = e5.andln(3) + i3 & 3, c3 = t5.andln(3) + o3 & 3; 3 === u3 && (u3 = -1), 3 === c3 && (c3 = -1), a3 = 0 == (1 & u3) ? 0 : 3 != (n3 = e5.andln(7) + i3 & 7) && 5 !== n3 || 2 !== c3 ? u3 : -u3, r5[0].push(a3), s3 = 0 == (1 & c3) ? 0 : 3 != (n3 = t5.andln(7) + o3 & 7) && 5 !== n3 || 2 !== u3 ? c3 : -c3, r5[1].push(s3), 2 * i3 === a3 + 1 && (i3 = 1 - i3), 2 * o3 === s3 + 1 && (o3 = 1 - o3), e5.iushrn(1), t5.iushrn(1); } return r5; }, r4.cachedProperty = function(e5, t5, r5) { var n3 = "_" + t5; e5.prototype[t5] = function() { return void 0 !== this[n3] ? this[n3] : this[n3] = r5.call(this); }; }, r4.parseBytes = function(e5) { return "string" == typeof e5 ? r4.toArray(e5, "hex") : e5; }, r4.intFromLE = function(e5) { return new o2.default(e5, "hex", "le"); }; }), l2 = d2.getNAF, h2 = d2.getJSF, p2 = d2.assert; function b2(e4, t4) { this.type = e4, this.p = new o2.default(t4.p, 16), this.red = t4.prime ? o2.default.red(t4.prime) : o2.default.mont(this.p), this.zero = new o2.default(0).toRed(this.red), this.one = new o2.default(1).toRed(this.red), this.two = new o2.default(2).toRed(this.red), this.n = t4.n && new o2.default(t4.n, 16), this.g = t4.g && this.pointFromJSON(t4.g, t4.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 r4 = this.n && this.p.div(this.n); !r4 || r4.cmpn(100) > 0 ? this.redN = null : (this._maxwellTrick = true, this.redN = this.n.toRed(this.red)); } var y2 = b2; function v2(e4, t4) { this.curve = e4, this.type = t4, this.precomputed = null; } b2.prototype.point = function() { throw new Error("Not implemented"); }, b2.prototype.validate = function() { throw new Error("Not implemented"); }, b2.prototype._fixedNafMul = function(e4, t4) { p2(e4.precomputed); var r4 = e4._getDoubles(), n3 = l2(t4, 1, this._bitLength), i3 = (1 << r4.step + 1) - (r4.step % 2 == 0 ? 2 : 1); i3 /= 3; var o3, a3, s3 = []; for (o3 = 0; o3 < n3.length; o3 += r4.step) { a3 = 0; for (var u3 = o3 + r4.step - 1; u3 >= o3; u3--) a3 = (a3 << 1) + n3[u3]; s3.push(a3); } for (var c3 = this.jpoint(null, null, null), f3 = this.jpoint(null, null, null), d3 = i3; d3 > 0; d3--) { for (o3 = 0; o3 < s3.length; o3++) (a3 = s3[o3]) === d3 ? f3 = f3.mixedAdd(r4.points[o3]) : a3 === -d3 && (f3 = f3.mixedAdd(r4.points[o3].neg())); c3 = c3.add(f3); } return c3.toP(); }, b2.prototype._wnafMul = function(e4, t4) { var r4 = 4, n3 = e4._getNAFPoints(r4); r4 = n3.wnd; for (var i3 = n3.points, o3 = l2(t4, r4, this._bitLength), a3 = this.jpoint(null, null, null), s3 = o3.length - 1; s3 >= 0; s3--) { for (var u3 = 0; s3 >= 0 && 0 === o3[s3]; s3--) u3++; if (s3 >= 0 && u3++, a3 = a3.dblp(u3), s3 < 0) break; var c3 = o3[s3]; p2(0 !== c3), a3 = "affine" === e4.type ? c3 > 0 ? a3.mixedAdd(i3[c3 - 1 >> 1]) : a3.mixedAdd(i3[-c3 - 1 >> 1].neg()) : c3 > 0 ? a3.add(i3[c3 - 1 >> 1]) : a3.add(i3[-c3 - 1 >> 1].neg()); } return "affine" === e4.type ? a3.toP() : a3; }, b2.prototype._wnafMulAdd = function(e4, t4, r4, n3, i3) { var o3, a3, s3, u3 = this._wnafT1, c3 = this._wnafT2, f3 = this._wnafT3, d3 = 0; for (o3 = 0; o3 < n3; o3++) { var p3 = (s3 = t4[o3])._getNAFPoints(e4); u3[o3] = p3.wnd, c3[o3] = p3.points; } for (o3 = n3 - 1; o3 >= 1; o3 -= 2) { var b3 = o3 - 1, y3 = o3; if (1 === u3[b3] && 1 === u3[y3]) { var v3 = [t4[b3], null, null, t4[y3]]; 0 === t4[b3].y.cmp(t4[y3].y) ? (v3[1] = t4[b3].add(t4[y3]), v3[2] = t4[b3].toJ().mixedAdd(t4[y3].neg())) : 0 === t4[b3].y.cmp(t4[y3].y.redNeg()) ? (v3[1] = t4[b3].toJ().mixedAdd(t4[y3]), v3[2] = t4[b3].add(t4[y3].neg())) : (v3[1] = t4[b3].toJ().mixedAdd(t4[y3]), v3[2] = t4[b3].toJ().mixedAdd(t4[y3].neg())); var m3 = [-3, -1, -5, -7, 0, 7, 5, 1, 3], g3 = h2(r4[b3], r4[y3]); for (d3 = Math.max(g3[0].length, d3), f3[b3] = new Array(d3), f3[y3] = new Array(d3), a3 = 0; a3 < d3; a3++) { var w3 = 0 | g3[0][a3], k3 = 0 | g3[1][a3]; f3[b3][a3] = m3[3 * (w3 + 1) + (k3 + 1)], f3[y3][a3] = 0, c3[b3] = v3; } } else f3[b3] = l2(r4[b3], u3[b3], this._bitLength), f3[y3] = l2(r4[y3], u3[y3], this._bitLength), d3 = Math.max(f3[b3].length, d3), d3 = Math.max(f3[y3].length, d3); } var _3 = this.jpoint(null, null, null), A3 = this._wnafT4; for (o3 = d3; o3 >= 0; o3--) { for (var E3 = 0; o3 >= 0; ) { var S3 = true; for (a3 = 0; a3 < n3; a3++) A3[a3] = 0 | f3[a3][o3], 0 !== A3[a3] && (S3 = false); if (!S3) break; E3++, o3--; } if (o3 >= 0 && E3++, _3 = _3.dblp(E3), o3 < 0) break; for (a3 = 0; a3 < n3; a3++) { var x3 = A3[a3]; 0 !== x3 && (x3 > 0 ? s3 = c3[a3][x3 - 1 >> 1] : x3 < 0 && (s3 = c3[a3][-x3 - 1 >> 1].neg()), _3 = "affine" === s3.type ? _3.mixedAdd(s3) : _3.add(s3)); } } for (o3 = 0; o3 < n3; o3++) c3[o3] = null; return i3 ? _3 : _3.toP(); }, b2.BasePoint = v2, v2.prototype.eq = function() { throw new Error("Not implemented"); }, v2.prototype.validate = function() { return this.curve.validate(this); }, b2.prototype.decodePoint = function(e4, t4) { e4 = d2.toArray(e4, t4); var r4 = this.p.byteLength(); if ((4 === e4[0] || 6 === e4[0] || 7 === e4[0]) && e4.length - 1 == 2 * r4) return 6 === e4[0] ? p2(e4[e4.length - 1] % 2 == 0) : 7 === e4[0] && p2(e4[e4.length - 1] % 2 == 1), this.point(e4.slice(1, 1 + r4), e4.slice(1 + r4, 1 + 2 * r4)); if ((2 === e4[0] || 3 === e4[0]) && e4.length - 1 === r4) return this.pointFromX(e4.slice(1, 1 + r4), 3 === e4[0]); throw new Error("Unknown point format"); }, v2.prototype.encodeCompressed = function(e4) { return this.encode(e4, true); }, v2.prototype._encode = function(e4) { var t4 = this.curve.p.byteLength(), r4 = this.getX().toArray("be", t4); return e4 ? [this.getY().isEven() ? 2 : 3].concat(r4) : [4].concat(r4, this.getY().toArray("be", t4)); }, v2.prototype.encode = function(e4, t4) { return d2.encode(this._encode(t4), e4); }, v2.prototype.precompute = function(e4) { if (this.precomputed) return this; var t4 = { doubles: null, naf: null, beta: null }; return t4.naf = this._getNAFPoints(8), t4.doubles = this._getDoubles(4, e4), t4.beta = this._getBeta(), this.precomputed = t4, this; }, v2.prototype._hasDoubles = function(e4) { if (!this.precomputed) return false; var t4 = this.precomputed.doubles; return !!t4 && t4.points.length >= Math.ceil((e4.bitLength() + 1) / t4.step); }, v2.prototype._getDoubles = function(e4, t4) { if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles; for (var r4 = [this], n3 = this, i3 = 0; i3 < t4; i3 += e4) { for (var o3 = 0; o3 < e4; o3++) n3 = n3.dbl(); r4.push(n3); } return { step: e4, points: r4 }; }, v2.prototype._getNAFPoints = function(e4) { if (this.precomputed && this.precomputed.naf) return this.precomputed.naf; for (var t4 = [this], r4 = (1 << e4) - 1, n3 = 1 === r4 ? null : this.dbl(), i3 = 1; i3 < r4; i3++) t4[i3] = t4[i3 - 1].add(n3); return { wnd: e4, points: t4 }; }, v2.prototype._getBeta = function() { return null; }, v2.prototype.dblp = function(e4) { for (var t4 = this, r4 = 0; r4 < e4; r4++) t4 = t4.dbl(); return t4; }; var m2 = s2(function(e4) { "function" == typeof Object.create ? e4.exports = function(e5, t4) { t4 && (e5.super_ = t4, e5.prototype = Object.create(t4.prototype, { constructor: { value: e5, enumerable: false, writable: true, configurable: true } })); } : e4.exports = function(e5, t4) { if (t4) { e5.super_ = t4; var r4 = function() { }; r4.prototype = t4.prototype, e5.prototype = new r4(), e5.prototype.constructor = e5; } }; }), g2 = d2.assert; function w2(e4) { y2.call(this, "short", e4), this.a = new o2.default(e4.a, 16).toRed(this.red), this.b = new o2.default(e4.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = 0 === this.a.fromRed().cmpn(0), this.threeA = 0 === this.a.fromRed().sub(this.p).cmpn(-3), this.endo = this._getEndomorphism(e4), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4); } m2(w2, y2); var k2 = w2; function _2(e4, t4, r4, n3) { y2.BasePoint.call(this, e4, "affine"), null === t4 && null === r4 ? (this.x = null, this.y = null, this.inf = true) : (this.x = new o2.default(t4, 16), this.y = new o2.default(r4, 16), n3 && (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 = false); } function A2(e4, t4, r4, n3) { y2.BasePoint.call(this, e4, "jacobian"), null === t4 && null === r4 && null === n3 ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new o2.default(0)) : (this.x = new o2.default(t4, 16), this.y = new o2.default(r4, 16), this.z = new o2.default(n3, 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; } w2.prototype._getEndomorphism = function(e4) { if (this.zeroA && this.g && this.n && 1 === this.p.modn(3)) { var t4, r4; if (e4.beta) t4 = new o2.default(e4.beta, 16).toRed(this.red); else { var n3 = this._getEndoRoots(this.p); t4 = (t4 = n3[0].cmp(n3[1]) < 0 ? n3[0] : n3[1]).toRed(this.red); } if (e4.lambda) r4 = new o2.default(e4.lambda, 16); else { var i3 = this._getEndoRoots(this.n); 0 === this.g.mul(i3[0]).x.cmp(this.g.x.redMul(t4)) ? r4 = i3[0] : (r4 = i3[1], g2(0 === this.g.mul(r4).x.cmp(this.g.x.redMul(t4)))); } return { beta: t4, lambda: r4, basis: e4.basis ? e4.basis.map(function(e5) { return { a: new o2.default(e5.a, 16), b: new o2.default(e5.b, 16) }; }) : this._getEndoBasis(r4) }; } }, w2.prototype._getEndoRoots = function(e4) { var t4 = e4 === this.p ? this.red : o2.default.mont(e4), r4 = new o2.default(2).toRed(t4).redInvm(), n3 = r4.redNeg(), i3 = new o2.default(3).toRed(t4).redNeg().redSqrt().redMul(r4); return [n3.redAdd(i3).fromRed(), n3.redSub(i3).fromRed()]; }, w2.prototype._getEndoBasis = function(e4) { for (var t4, r4, n3, i3, a3, s3, u3, c3, f3, d3 = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), l3 = e4, h3 = this.n.clone(), p3 = new o2.default(1), b3 = new o2.default(0), y3 = new o2.default(0), v3 = new o2.default(1), m3 = 0; 0 !== l3.cmpn(0); ) { var g3 = h3.div(l3); c3 = h3.sub(g3.mul(l3)), f3 = y3.sub(g3.mul(p3)); var w3 = v3.sub(g3.mul(b3)); if (!n3 && c3.cmp(d3) < 0) t4 = u3.neg(), r4 = p3, n3 = c3.neg(), i3 = f3; else if (n3 && 2 == ++m3) break; u3 = c3, h3 = l3, l3 = c3, y3 = p3, p3 = f3, v3 = b3, b3 = w3; } a3 = c3.neg(), s3 = f3; var k3 = n3.sqr().add(i3.sqr()); return a3.sqr().add(s3.sqr()).cmp(k3) >= 0 && (a3 = t4, s3 = r4), n3.negative && (n3 = n3.neg(), i3 = i3.neg()), a3.negative && (a3 = a3.neg(), s3 = s3.neg()), [{ a: n3, b: i3 }, { a: a3, b: s3 }]; }, w2.prototype._endoSplit = function(e4) { var t4 = this.endo.basis, r4 = t4[0], n3 = t4[1], i3 = n3.b.mul(e4).divRound(this.n), o3 = r4.b.neg().mul(e4).divRound(this.n), a3 = i3.mul(r4.a), s3 = o3.mul(n3.a), u3 = i3.mul(r4.b), c3 = o3.mul(n3.b); return { k1: e4.sub(a3).sub(s3), k2: u3.add(c3).neg() }; }, w2.prototype.pointFromX = function(e4, t4) { (e4 = new o2.default(e4, 16)).red || (e4 = e4.toRed(this.red)); var r4 = e4.redSqr().redMul(e4).redIAdd(e4.redMul(this.a)).redIAdd(this.b), n3 = r4.redSqrt(); if (0 !== n3.redSqr().redSub(r4).cmp(this.zero)) throw new Error("invalid point"); var i3 = n3.fromRed().isOdd(); return (t4 && !i3 || !t4 && i3) && (n3 = n3.redNeg()), this.point(e4, n3); }, w2.prototype.validate = function(e4) { if (e4.inf) return true; var t4 = e4.x, r4 = e4.y, n3 = this.a.redMul(t4), i3 = t4.redSqr().redMul(t4).redIAdd(n3).redIAdd(this.b); return 0 === r4.redSqr().redISub(i3).cmpn(0); }, w2.prototype._endoWnafMulAdd = function(e4, t4, r4) { for (var n3 = this._endoWnafT1, i3 = this._endoWnafT2, o3 = 0; o3 < e4.length; o3++) { var a3 = this._endoSplit(t4[o3]), s3 = e4[o3], u3 = s3._getBeta(); a3.k1.negative && (a3.k1.ineg(), s3 = s3.neg(true)), a3.k2.negative && (a3.k2.ineg(), u3 = u3.neg(true)), n3[2 * o3] = s3, n3[2 * o3 + 1] = u3, i3[2 * o3] = a3.k1, i3[2 * o3 + 1] = a3.k2; } for (var c3 = this._wnafMulAdd(1, n3, i3, 2 * o3, r4), f3 = 0; f3 < 2 * o3; f3++) n3[f3] = null, i3[f3] = null; return c3; }, m2(_2, y2.BasePoint), w2.prototype.point = function(e4, t4, r4) { return new _2(this, e4, t4, r4); }, w2.prototype.pointFromJSON = function(e4, t4) { return _2.fromJSON(this, e4, t4); }, _2.prototype._getBeta = function() { if (this.curve.endo) { var e4 = this.precomputed; if (e4 && e4.beta) return e4.beta; var t4 = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); if (e4) { var r4 = this.curve, n3 = function(e5) { return r4.point(e5.x.redMul(r4.endo.beta), e5.y); }; e4.beta = t4, t4.precomputed = { beta: null, naf: e4.naf && { wnd: e4.naf.wnd, points: e4.naf.points.map(n3) }, doubles: e4.doubles && { step: e4.doubles.step, points: e4.doubles.points.map(n3) } }; } return t4; } }, _2.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]; }, _2.fromJSON = function(e4, t4, r4) { "string" == typeof t4 && (t4 = JSON.parse(t4)); var n3 = e4.point(t4[0], t4[1], r4); if (!t4[2]) return n3; function i3(t5) { return e4.point(t5[0], t5[1], r4); } var o3 = t4[2]; return n3.precomputed = { beta: null, doubles: o3.doubles && { step: o3.doubles.step, points: [n3].concat(o3.doubles.points.map(i3)) }, naf: o3.naf && { wnd: o3.naf.wnd, points: [n3].concat(o3.naf.points.map(i3)) } }, n3; }, _2.prototype.inspect = function() { return this.isInfinity() ? "" : ""; }, _2.prototype.isInfinity = function() { return this.inf; }, _2.prototype.add = function(e4) { if (this.inf) return e4; if (e4.inf) return this; if (this.eq(e4)) return this.dbl(); if (this.neg().eq(e4)) return this.curve.point(null, null); if (0 === this.x.cmp(e4.x)) return this.curve.point(null, null); var t4 = this.y.redSub(e4.y); 0 !== t4.cmpn(0) && (t4 = t4.redMul(this.x.redSub(e4.x).redInvm())); var r4 = t4.redSqr().redISub(this.x).redISub(e4.x), n3 = t4.redMul(this.x.redSub(r4)).redISub(this.y); return this.curve.point(r4, n3); }, _2.prototype.dbl = function() { if (this.inf) return this; var e4 = this.y.redAdd(this.y); if (0 === e4.cmpn(0)) return this.curve.point(null, null); var t4 = this.curve.a, r4 = this.x.redSqr(), n3 = e4.redInvm(), i3 = r4.redAdd(r4).redIAdd(r4).redIAdd(t4).redMul(n3), o3 = i3.redSqr().redISub(this.x.redAdd(this.x)), a3 = i3.redMul(this.x.redSub(o3)).redISub(this.y); return this.curve.point(o3, a3); }, _2.prototype.getX = function() { return this.x.fromRed(); }, _2.prototype.getY = function() { return this.y.fromRed(); }, _2.prototype.mul = function(e4) { return e4 = new o2.default(e4, 16), this.isInfinity() ? this : this._hasDoubles(e4) ? this.curve._fixedNafMul(this, e4) : this.curve.endo ? this.curve._endoWnafMulAdd([this], [e4]) : this.curve._wnafMul(this, e4); }, _2.prototype.mulAdd = function(e4, t4, r4) { var n3 = [this, t4], i3 = [e4, r4]; return this.curve.endo ? this.curve._endoWnafMulAdd(n3, i3) : this.curve._wnafMulAdd(1, n3, i3, 2); }, _2.prototype.jmulAdd = function(e4, t4, r4) { var n3 = [this, t4], i3 = [e4, r4]; return this.curve.endo ? this.curve._endoWnafMulAdd(n3, i3, true) : this.curve._wnafMulAdd(1, n3, i3, 2, true); }, _2.prototype.eq = function(e4) { return this === e4 || this.inf === e4.inf && (this.inf || 0 === this.x.cmp(e4.x) && 0 === this.y.cmp(e4.y)); }, _2.prototype.neg = function(e4) { if (this.inf) return this; var t4 = this.curve.point(this.x, this.y.redNeg()); if (e4 && this.precomputed) { var r4 = this.precomputed, n3 = function(e5) { return e5.neg(); }; t4.precomputed = { naf: r4.naf && { wnd: r4.naf.wnd, points: r4.naf.points.map(n3) }, doubles: r4.doubles && { step: r4.doubles.step, points: r4.doubles.points.map(n3) } }; } return t4; }, _2.prototype.toJ = function() { return this.inf ? this.curve.jpoint(null, null, null) : this.curve.jpoint(this.x, this.y, this.curve.one); }, m2(A2, y2.BasePoint), w2.prototype.jpoint = function(e4, t4, r4) { return new A2(this, e4, t4, r4); }, A2.prototype.toP = function() { if (this.isInfinity()) return this.curve.point(null, null); var e4 = this.z.redInvm(), t4 = e4.redSqr(), r4 = this.x.redMul(t4), n3 = this.y.redMul(t4).redMul(e4); return this.curve.point(r4, n3); }, A2.prototype.neg = function() { return this.curve.jpoint(this.x, this.y.redNeg(), this.z); }, A2.prototype.add = function(e4) { if (this.isInfinity()) return e4; if (e4.isInfinity()) return this; var t4 = e4.z.redSqr(), r4 = this.z.redSqr(), n3 = this.x.redMul(t4), i3 = e4.x.redMul(r4), o3 = this.y.redMul(t4.redMul(e4.z)), a3 = e4.y.redMul(r4.redMul(this.z)), s3 = n3.redSub(i3), u3 = o3.redSub(a3); if (0 === s3.cmpn(0)) return 0 !== u3.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl(); var c3 = s3.redSqr(), f3 = c3.redMul(s3), d3 = n3.redMul(c3), l3 = u3.redSqr().redIAdd(f3).redISub(d3).redISub(d3), h3 = u3.redMul(d3.redISub(l3)).redISub(o3.redMul(f3)), p3 = this.z.redMul(e4.z).redMul(s3); return this.curve.jpoint(l3, h3, p3); }, A2.prototype.mixedAdd = function(e4) { if (this.isInfinity()) return e4.toJ(); if (e4.isInfinity()) return this; var t4 = this.z.redSqr(), r4 = this.x, n3 = e4.x.redMul(t4), i3 = this.y, o3 = e4.y.redMul(t4).redMul(this.z), a3 = r4.redSub(n3), s3 = i3.redSub(o3); if (0 === a3.cmpn(0)) return 0 !== s3.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl(); var u3 = a3.redSqr(), c3 = u3.redMul(a3), f3 = r4.redMul(u3), d3 = s3.redSqr().redIAdd(c3).redISub(f3).redISub(f3), l3 = s3.redMul(f3.redISub(d3)).redISub(i3.redMul(c3)), h3 = this.z.redMul(a3); return this.curve.jpoint(d3, l3, h3); }, A2.prototype.dblp = function(e4) { if (0 === e4) return this; if (this.isInfinity()) return this; if (!e4) return this.dbl(); var t4; if (this.curve.zeroA || this.curve.threeA) { var r4 = this; for (t4 = 0; t4 < e4; t4++) r4 = r4.dbl(); return r4; } var n3 = this.curve.a, i3 = this.curve.tinv, o3 = this.x, a3 = this.y, s3 = this.z, u3 = s3.redSqr().redSqr(), c3 = a3.redAdd(a3); for (t4 = 0; t4 < e4; t4++) { var f3 = o3.redSqr(), d3 = c3.redSqr(), l3 = d3.redSqr(), h3 = f3.redAdd(f3).redIAdd(f3).redIAdd(n3.redMul(u3)), p3 = o3.redMul(d3), b3 = h3.redSqr().redISub(p3.redAdd(p3)), y3 = p3.redISub(b3), v3 = h3.redMul(y3); v3 = v3.redIAdd(v3).redISub(l3); var m3 = c3.redMul(s3); t4 + 1 < e4 && (u3 = u3.redMul(l3)), o3 = b3, s3 = m3, c3 = v3; } return this.curve.jpoint(o3, c3.redMul(i3), s3); }, A2.prototype.dbl = function() { return this.isInfinity() ? this : this.curve.zeroA ? this._zeroDbl() : this.curve.threeA ? this._threeDbl() : this._dbl(); }, A2.prototype._zeroDbl = function() { var e4, t4, r4; if (this.zOne) { var n3 = this.x.redSqr(), i3 = this.y.redSqr(), o3 = i3.redSqr(), a3 = this.x.redAdd(i3).redSqr().redISub(n3).redISub(o3); a3 = a3.redIAdd(a3); var s3 = n3.redAdd(n3).redIAdd(n3), u3 = s3.redSqr().redISub(a3).redISub(a3), c3 = o3.redIAdd(o3); c3 = (c3 = c3.redIAdd(c3)).redIAdd(c3), e4 = u3, t4 = s3.redMul(a3.redISub(u3)).redISub(c3), r4 = this.y.redAdd(this.y); } else { var f3 = this.x.redSqr(), d3 = this.y.redSqr(), l3 = d3.redSqr(), h3 = this.x.redAdd(d3).redSqr().redISub(f3).redISub(l3); h3 = h3.redIAdd(h3); var p3 = f3.redAdd(f3).redIAdd(f3), b3 = p3.redSqr(), y3 = l3.redIAdd(l3); y3 = (y3 = y3.redIAdd(y3)).redIAdd(y3), e4 = b3.redISub(h3).redISub(h3), t4 = p3.redMul(h3.redISub(e4)).redISub(y3), r4 = (r4 = this.y.redMul(this.z)).redIAdd(r4); } return this.curve.jpoint(e4, t4, r4); }, A2.prototype._threeDbl = function() { var e4, t4, r4; if (this.zOne) { var n3 = this.x.redSqr(), i3 = this.y.redSqr(), o3 = i3.redSqr(), a3 = this.x.redAdd(i3).redSqr().redISub(n3).redISub(o3); a3 = a3.redIAdd(a3); var s3 = n3.redAdd(n3).redIAdd(n3).redIAdd(this.curve.a), u3 = s3.redSqr().redISub(a3).redISub(a3); e4 = u3; var c3 = o3.redIAdd(o3); c3 = (c3 = c3.redIAdd(c3)).redIAdd(c3), t4 = s3.redMul(a3.redISub(u3)).redISub(c3), r4 = this.y.redAdd(this.y); } else { var f3 = this.z.redSqr(), d3 = this.y.redSqr(), l3 = this.x.redMul(d3), h3 = this.x.redSub(f3).redMul(this.x.redAdd(f3)); h3 = h3.redAdd(h3).redIAdd(h3); var p3 = l3.redIAdd(l3), b3 = (p3 = p3.redIAdd(p3)).redAdd(p3); e4 = h3.redSqr().redISub(b3), r4 = this.y.redAdd(this.z).redSqr().redISub(d3).redISub(f3); var y3 = d3.redSqr(); y3 = (y3 = (y3 = y3.redIAdd(y3)).redIAdd(y3)).redIAdd(y3), t4 = h3.redMul(p3.redISub(e4)).redISub(y3); } return this.curve.jpoint(e4, t4, r4); }, A2.prototype._dbl = function() { var e4 = this.curve.a, t4 = this.x, r4 = this.y, n3 = this.z, i3 = n3.redSqr().redSqr(), o3 = t4.redSqr(), a3 = r4.redSqr(), s3 = o3.redAdd(o3).redIAdd(o3).redIAdd(e4.redMul(i3)), u3 = t4.redAdd(t4), c3 = (u3 = u3.redIAdd(u3)).redMul(a3), f3 = s3.redSqr().redISub(c3.redAdd(c3)), d3 = c3.redISub(f3), l3 = a3.redSqr(); l3 = (l3 = (l3 = l3.redIAdd(l3)).redIAdd(l3)).redIAdd(l3); var h3 = s3.redMul(d3).redISub(l3), p3 = r4.redAdd(r4).redMul(n3); return this.curve.jpoint(f3, h3, p3); }, A2.prototype.trpl = function() { if (!this.curve.zeroA) return this.dbl().add(this); var e4 = this.x.redSqr(), t4 = this.y.redSqr(), r4 = this.z.redSqr(), n3 = t4.redSqr(), i3 = e4.redAdd(e4).redIAdd(e4), o3 = i3.redSqr(), a3 = this.x.redAdd(t4).redSqr().redISub(e4).redISub(n3), s3 = (a3 = (a3 = (a3 = a3.redIAdd(a3)).redAdd(a3).redIAdd(a3)).redISub(o3)).redSqr(), u3 = n3.redIAdd(n3); u3 = (u3 = (u3 = u3.redIAdd(u3)).redIAdd(u3)).redIAdd(u3); var c3 = i3.redIAdd(a3).redSqr().redISub(o3).redISub(s3).redISub(u3), f3 = t4.redMul(c3); f3 = (f3 = f3.redIAdd(f3)).redIAdd(f3); var d3 = this.x.redMul(s3).redISub(f3); d3 = (d3 = d3.redIAdd(d3)).redIAdd(d3); var l3 = this.y.redMul(c3.redMul(u3.redISub(c3)).redISub(a3.redMul(s3))); l3 = (l3 = (l3 = l3.redIAdd(l3)).redIAdd(l3)).redIAdd(l3); var h3 = this.z.redAdd(a3).redSqr().redISub(r4).redISub(s3); return this.curve.jpoint(d3, l3, h3); }, A2.prototype.mul = function(e4, t4) { return e4 = new o2.default(e4, t4), this.curve._wnafMul(this, e4); }, A2.prototype.eq = function(e4) { if ("affine" === e4.type) return this.eq(e4.toJ()); if (this === e4) return true; var t4 = this.z.redSqr(), r4 = e4.z.redSqr(); if (0 !== this.x.redMul(r4).redISub(e4.x.redMul(t4)).cmpn(0)) return false; var n3 = t4.redMul(this.z), i3 = r4.redMul(e4.z); return 0 === this.y.redMul(i3).redISub(e4.y.redMul(n3)).cmpn(0); }, A2.prototype.eqXToP = function(e4) { var t4 = this.z.redSqr(), r4 = e4.toRed(this.curve.red).redMul(t4); if (0 === this.x.cmp(r4)) return true; for (var n3 = e4.clone(), i3 = this.curve.redN.redMul(t4); ; ) { if (n3.iadd(this.curve.n), n3.cmp(this.curve.p) >= 0) return false; if (r4.redIAdd(i3), 0 === this.x.cmp(r4)) return true; } }, A2.prototype.inspect = function() { return this.isInfinity() ? "" : ""; }, A2.prototype.isInfinity = function() { return 0 === this.z.cmpn(0); }; var E2 = s2(function(e4, t4) { var r4 = t4; r4.base = y2, r4.short = k2, r4.mont = null, r4.edwards = null; }), S2 = s2(function(e4, t4) { var r4, n3 = t4, i3 = d2.assert; function o3(e5) { "short" === e5.type ? this.curve = new E2.short(e5) : "edwards" === e5.type ? this.curve = new E2.edwards(e5) : this.curve = new E2.mont(e5), this.g = this.curve.g, this.n = this.curve.n, this.hash = e5.hash, i3(this.g.validate(), "Invalid curve"), i3(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); } function s3(e5, t5) { Object.defineProperty(n3, e5, { configurable: true, enumerable: true, get: function() { var r5 = new o3(t5); return Object.defineProperty(n3, e5, { configurable: true, enumerable: true, value: r5 }), r5; } }); } n3.PresetCurve = o3, s3("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: a2.default.sha256, gRed: false, g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"] }), s3("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: a2.default.sha256, gRed: false, g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"] }), s3("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: a2.default.sha256, gRed: false, g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"] }), s3("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: a2.default.sha384, gRed: false, 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"] }), s3("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: a2.default.sha512, gRed: false, 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"] }), s3("curve25519", { type: "mont", prime: "p25519", p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", a: "76d06", b: "1", n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", hash: a2.default.sha256, gRed: false, g: ["9"] }), s3("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: a2.default.sha256, gRed: false, g: ["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", "6666666666666666666666666666666666666666666666666666666666666658"] }); try { r4 = null.crash(); } catch (e5) { r4 = void 0; } s3("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: a2.default.sha256, beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", basis: [{ a: "3086d221a7d46bcde86c90e49284eb15", b: "-e4437ed6010e88286f547fa90abfe4c3" }, { a: "114ca50f7a8e2f3f657c1108d9d44cfd8", b: "3086d221a7d46bcde86c90e49284eb15" }], gRed: false, g: ["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", r4] }); }); function x2(e4) { if (!(this instanceof x2)) return new x2(e4); this.hash = e4.hash, this.predResist = !!e4.predResist, this.outLen = this.hash.outSize, this.minEntropy = e4.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null; var t4 = f2.toArray(e4.entropy, e4.entropyEnc || "hex"), r4 = f2.toArray(e4.nonce, e4.nonceEnc || "hex"), n3 = f2.toArray(e4.pers, e4.persEnc || "hex"); u2(t4.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._init(t4, r4, n3); } var B2 = x2; x2.prototype._init = function(e4, t4, r4) { var n3 = e4.concat(t4).concat(r4); this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8); for (var i3 = 0; i3 < this.V.length; i3++) this.K[i3] = 0, this.V[i3] = 1; this._update(n3), this._reseed = 1, this.reseedInterval = 281474976710656; }, x2.prototype._hmac = function() { return new a2.default.hmac(this.hash, this.K); }, x2.prototype._update = function(e4) { var t4 = this._hmac().update(this.V).update([0]); e4 && (t4 = t4.update(e4)), this.K = t4.digest(), this.V = this._hmac().update(this.V).digest(), e4 && (this.K = this._hmac().update(this.V).update([1]).update(e4).digest(), this.V = this._hmac().update(this.V).digest()); }, x2.prototype.reseed = function(e4, t4, r4, n3) { "string" != typeof t4 && (n3 = r4, r4 = t4, t4 = null), e4 = f2.toArray(e4, t4), r4 = f2.toArray(r4, n3), u2(e4.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._update(e4.concat(r4 || [])), this._reseed = 1; }, x2.prototype.generate = function(e4, t4, r4, n3) { if (this._reseed > this.reseedInterval) throw new Error("Reseed is required"); "string" != typeof t4 && (n3 = r4, r4 = t4, t4 = null), r4 && (r4 = f2.toArray(r4, n3 || "hex"), this._update(r4)); for (var i3 = []; i3.length < e4; ) this.V = this._hmac().update(this.V).digest(), i3 = i3.concat(this.V); var o3 = i3.slice(0, e4); return this._update(r4), this._reseed++, f2.encode(o3, t4); }; var O2 = d2.assert; function P2(e4, t4) { this.ec = e4, this.priv = null, this.pub = null, t4.priv && this._importPrivate(t4.priv, t4.privEnc), t4.pub && this._importPublic(t4.pub, t4.pubEnc); } var I2 = P2; P2.fromPublic = function(e4, t4, r4) { return t4 instanceof P2 ? t4 : new P2(e4, { pub: t4, pubEnc: r4 }); }, P2.fromPrivate = function(e4, t4, r4) { return t4 instanceof P2 ? t4 : new P2(e4, { priv: t4, privEnc: r4 }); }, P2.prototype.validate = function() { var e4 = this.getPublic(); return e4.isInfinity() ? { result: false, reason: "Invalid public key" } : e4.validate() ? e4.mul(this.ec.curve.n).isInfinity() ? { result: true, reason: null } : { result: false, reason: "Public key * N != O" } : { result: false, reason: "Public key is not a point" }; }, P2.prototype.getPublic = function(e4, t4) { return "string" == typeof e4 && (t4 = e4, e4 = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), t4 ? this.pub.encode(t4, e4) : this.pub; }, P2.prototype.getPrivate = function(e4) { return "hex" === e4 ? this.priv.toString(16, 2) : this.priv; }, P2.prototype._importPrivate = function(e4, t4) { this.priv = new o2.default(e4, t4 || 16), this.priv = this.priv.umod(this.ec.curve.n); }, P2.prototype._importPublic = function(e4, t4) { if (e4.x || e4.y) return "mont" === this.ec.curve.type ? O2(e4.x, "Need x coordinate") : "short" !== this.ec.curve.type && "edwards" !== this.ec.curve.type || O2(e4.x && e4.y, "Need both x and y coordinate"), void (this.pub = this.ec.curve.point(e4.x, e4.y)); this.pub = this.ec.curve.decodePoint(e4, t4); }, P2.prototype.derive = function(e4) { return e4.validate() || O2(e4.validate(), "public point not validated"), e4.mul(this.priv).getX(); }, P2.prototype.sign = function(e4, t4, r4) { return this.ec.sign(e4, this, t4, r4); }, P2.prototype.verify = function(e4, t4) { return this.ec.verify(e4, t4, this); }, P2.prototype.inspect = function() { return ""; }; var T2 = d2.assert; function C2(e4, t4) { if (e4 instanceof C2) return e4; this._importDER(e4, t4) || (T2(e4.r && e4.s, "Signature without r or s"), this.r = new o2.default(e4.r, 16), this.s = new o2.default(e4.s, 16), void 0 === e4.recoveryParam ? this.recoveryParam = null : this.recoveryParam = e4.recoveryParam); } var M2 = C2; function R2() { this.place = 0; } function U2(e4, t4) { var r4 = e4[t4.place++]; if (!(128 & r4)) return r4; var n3 = 15 & r4; if (0 === n3 || n3 > 4) return false; for (var i3 = 0, o3 = 0, a3 = t4.place; o3 < n3; o3++, a3++) i3 <<= 8, i3 |= e4[a3], i3 >>>= 0; return !(i3 <= 127) && (t4.place = a3, i3); } function N2(e4) { for (var t4 = 0, r4 = e4.length - 1; !e4[t4] && !(128 & e4[t4 + 1]) && t4 < r4; ) t4++; return 0 === t4 ? e4 : e4.slice(t4); } function j2(e4, t4) { if (t4 < 128) e4.push(t4); else { var r4 = 1 + (Math.log(t4) / Math.LN2 >>> 3); for (e4.push(128 | r4); --r4; ) e4.push(t4 >>> (r4 << 3) & 255); e4.push(t4); } } C2.prototype._importDER = function(e4, t4) { e4 = d2.toArray(e4, t4); var r4 = new R2(); if (48 !== e4[r4.place++]) return false; var n3 = U2(e4, r4); if (false === n3) return false; if (n3 + r4.place !== e4.length) return false; if (2 !== e4[r4.place++]) return false; var i3 = U2(e4, r4); if (false === i3) return false; var a3 = e4.slice(r4.place, i3 + r4.place); if (r4.place += i3, 2 !== e4[r4.place++]) return false; var s3 = U2(e4, r4); if (false === s3) return false; if (e4.length !== s3 + r4.place) return false; var u3 = e4.slice(r4.place, s3 + r4.place); if (0 === a3[0]) { if (!(128 & a3[1])) return false; a3 = a3.slice(1); } if (0 === u3[0]) { if (!(128 & u3[1])) return false; u3 = u3.slice(1); } return this.r = new o2.default(a3), this.s = new o2.default(u3), this.recoveryParam = null, true; }, C2.prototype.toDER = function(e4) { var t4 = this.r.toArray(), r4 = this.s.toArray(); for (128 & t4[0] && (t4 = [0].concat(t4)), 128 & r4[0] && (r4 = [0].concat(r4)), t4 = N2(t4), r4 = N2(r4); !(r4[0] || 128 & r4[1]); ) r4 = r4.slice(1); var n3 = [2]; j2(n3, t4.length), (n3 = n3.concat(t4)).push(2), j2(n3, r4.length); var i3 = n3.concat(r4), o3 = [48]; return j2(o3, i3.length), o3 = o3.concat(i3), d2.encode(o3, e4); }; var L2 = function() { throw new Error("unsupported"); }, F2 = d2.assert; function D2(e4) { if (!(this instanceof D2)) return new D2(e4); "string" == typeof e4 && (F2(Object.prototype.hasOwnProperty.call(S2, e4), "Unknown curve " + e4), e4 = S2[e4]), e4 instanceof S2.PresetCurve && (e4 = { curve: e4 }), this.curve = e4.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = e4.curve.g, this.g.precompute(e4.curve.n.bitLength() + 1), this.hash = e4.hash || e4.curve.hash; } var H2 = D2; D2.prototype.keyPair = function(e4) { return new I2(this, e4); }, D2.prototype.keyFromPrivate = function(e4, t4) { return I2.fromPrivate(this, e4, t4); }, D2.prototype.keyFromPublic = function(e4, t4) { return I2.fromPublic(this, e4, t4); }, D2.prototype.genKeyPair = function(e4) { e4 || (e4 = {}); for (var t4 = new B2({ hash: this.hash, pers: e4.pers, persEnc: e4.persEnc || "utf8", entropy: e4.entropy || L2(this.hash.hmacStrength), entropyEnc: e4.entropy && e4.entropyEnc || "utf8", nonce: this.n.toArray() }), r4 = this.n.byteLength(), n3 = this.n.sub(new o2.default(2)); ; ) { var i3 = new o2.default(t4.generate(r4)); if (!(i3.cmp(n3) > 0)) return i3.iaddn(1), this.keyFromPrivate(i3); } }, D2.prototype._truncateToN = function(e4, t4) { var r4 = 8 * e4.byteLength() - this.n.bitLength(); return r4 > 0 && (e4 = e4.ushrn(r4)), !t4 && e4.cmp(this.n) >= 0 ? e4.sub(this.n) : e4; }, D2.prototype.sign = function(e4, t4, r4, n3) { "object" === (0, i2.default)(r4) && (n3 = r4, r4 = null), n3 || (n3 = {}), t4 = this.keyFromPrivate(t4, r4), e4 = this._truncateToN(new o2.default(e4, 16)); for (var a3 = this.n.byteLength(), s3 = t4.getPrivate().toArray("be", a3), u3 = e4.toArray("be", a3), c3 = new B2({ hash: this.hash, entropy: s3, nonce: u3, pers: n3.pers, persEnc: n3.persEnc || "utf8" }), f3 = this.n.sub(new o2.default(1)), d3 = 0; ; d3++) { var l3 = n3.k ? n3.k(d3) : new o2.default(c3.generate(this.n.byteLength())); if (!((l3 = this._truncateToN(l3, true)).cmpn(1) <= 0 || l3.cmp(f3) >= 0)) { var h3 = this.g.mul(l3); if (!h3.isInfinity()) { var p3 = h3.getX(), b3 = p3.umod(this.n); if (0 !== b3.cmpn(0)) { var y3 = l3.invm(this.n).mul(b3.mul(t4.getPrivate()).iadd(e4)); if (0 !== (y3 = y3.umod(this.n)).cmpn(0)) { var v3 = (h3.getY().isOdd() ? 1 : 0) | (0 !== p3.cmp(b3) ? 2 : 0); return n3.canonical && y3.cmp(this.nh) > 0 && (y3 = this.n.sub(y3), v3 ^= 1), new M2({ r: b3, s: y3, recoveryParam: v3 }); } } } } } }, D2.prototype.verify = function(e4, t4, r4, n3) { e4 = this._truncateToN(new o2.default(e4, 16)), r4 = this.keyFromPublic(r4, n3); var i3 = (t4 = new M2(t4, "hex")).r, a3 = t4.s; if (i3.cmpn(1) < 0 || i3.cmp(this.n) >= 0) return false; if (a3.cmpn(1) < 0 || a3.cmp(this.n) >= 0) return false; var s3, u3 = a3.invm(this.n), c3 = u3.mul(e4).umod(this.n), f3 = u3.mul(i3).umod(this.n); return this.curve._maxwellTrick ? !(s3 = this.g.jmulAdd(c3, r4.getPublic(), f3)).isInfinity() && s3.eqXToP(i3) : !(s3 = this.g.mulAdd(c3, r4.getPublic(), f3)).isInfinity() && 0 === s3.getX().umod(this.n).cmp(i3); }, D2.prototype.recoverPubKey = function(e4, t4, r4, n3) { F2((3 & r4) === r4, "The recovery param is more than two bits"), t4 = new M2(t4, n3); var i3 = this.n, a3 = new o2.default(e4), s3 = t4.r, u3 = t4.s, c3 = 1 & r4, f3 = r4 >> 1; if (s3.cmp(this.curve.p.umod(this.curve.n)) >= 0 && f3) throw new Error("Unable to find sencond key candinate"); s3 = f3 ? this.curve.pointFromX(s3.add(this.curve.n), c3) : this.curve.pointFromX(s3, c3); var d3 = t4.r.invm(i3), l3 = i3.sub(a3).mul(d3).umod(i3), h3 = u3.mul(d3).umod(i3); return this.g.mulAdd(l3, s3, h3); }, D2.prototype.getKeyRecoveryParam = function(e4, t4, r4, n3) { if (null !== (t4 = new M2(t4, n3)).recoveryParam) return t4.recoveryParam; for (var i3 = 0; i3 < 4; i3++) { var o3; try { o3 = this.recoverPubKey(e4, t4, i3); } catch (e5) { continue; } if (o3.eq(r4)) return i3; } throw new Error("Unable to find valid recovery factor"); }; var z2 = s2(function(e4, t4) { var r4 = t4; r4.version = "6.5.4", r4.utils = d2, r4.rand = function() { throw new Error("unsupported"); }, r4.curve = E2, r4.curves = S2, r4.ec = H2, r4.eddsa = null; }), q2 = z2.ec; t3.EC = q2; }, 17612: (e3, t3, r3) => { var n2 = r3(28847); Object.defineProperty(t3, "__esModule", { value: true }), t3.SigningKey = void 0, t3.computePublicKey = b2, t3.recoverPublicKey = function(e4, t4) { var r4 = (0, s2.splitSignature)(t4), n3 = { r: (0, s2.arrayify)(r4.r), s: (0, s2.arrayify)(r4.s) }; return "0x" + h2().recoverPubKey((0, s2.arrayify)(e4), n3, r4.recoveryParam).encode("hex", false); }; var i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = r3(36918), s2 = r3(908), u2 = r3(23694), c2 = r3(64327), f2 = r3(48100), d2 = new c2.Logger(f2.version), l2 = null; function h2() { return l2 || (l2 = new a2.EC("secp256k1")), l2; } var p2 = function() { function e4(t4) { (0, i2.default)(this, e4), (0, u2.defineReadOnly)(this, "curve", "secp256k1"), (0, u2.defineReadOnly)(this, "privateKey", (0, s2.hexlify)(t4)), 32 !== (0, s2.hexDataLength)(this.privateKey) && d2.throwArgumentError("invalid private key", "privateKey", "[[ REDACTED ]]"); var r4 = h2().keyFromPrivate((0, s2.arrayify)(this.privateKey)); (0, u2.defineReadOnly)(this, "publicKey", "0x" + r4.getPublic(false, "hex")), (0, u2.defineReadOnly)(this, "compressedPublicKey", "0x" + r4.getPublic(true, "hex")), (0, u2.defineReadOnly)(this, "_isSigningKey", true); } return (0, o2.default)(e4, [{ key: "_addPoint", value: function(e5) { var t4 = h2().keyFromPublic((0, s2.arrayify)(this.publicKey)), r4 = h2().keyFromPublic((0, s2.arrayify)(e5)); return "0x" + t4.pub.add(r4.pub).encodeCompressed("hex"); } }, { key: "signDigest", value: function(e5) { var t4 = h2().keyFromPrivate((0, s2.arrayify)(this.privateKey)), r4 = (0, s2.arrayify)(e5); 32 !== r4.length && d2.throwArgumentError("bad digest length", "digest", e5); var n3 = t4.sign(r4, { canonical: true }); return (0, s2.splitSignature)({ recoveryParam: n3.recoveryParam, r: (0, s2.hexZeroPad)("0x" + n3.r.toString(16), 32), s: (0, s2.hexZeroPad)("0x" + n3.s.toString(16), 32) }); } }, { key: "computeSharedSecret", value: function(e5) { var t4 = h2().keyFromPrivate((0, s2.arrayify)(this.privateKey)), r4 = h2().keyFromPublic((0, s2.arrayify)(b2(e5))); return (0, s2.hexZeroPad)("0x" + t4.derive(r4.getPublic()).toString(16), 32); } }], [{ key: "isSigningKey", value: function(e5) { return !(!e5 || !e5._isSigningKey); } }]), e4; }(); function b2(e4, t4) { var r4 = (0, s2.arrayify)(e4); if (32 === r4.length) { var n3 = new p2(r4); return t4 ? "0x" + h2().keyFromPrivate(r4).getPublic(true, "hex") : n3.publicKey; } return 33 === r4.length ? t4 ? (0, s2.hexlify)(r4) : "0x" + h2().keyFromPublic(r4).getPublic(false, "hex") : 65 === r4.length ? t4 ? "0x" + h2().keyFromPublic(r4).getPublic(true, "hex") : (0, s2.hexlify)(r4) : d2.throwArgumentError("invalid public or private key", "key", "[REDACTED]"); } t3.SigningKey = p2; }, 56518: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.version = void 0, t3.version = "strings/5.7.0"; }, 95856: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.formatBytes32String = function(e4) { var t4 = (0, o2.toUtf8Bytes)(e4); if (t4.length > 31) throw new Error("bytes32 string must be less than 32 bytes"); return (0, i2.hexlify)((0, i2.concat)([t4, n2.HashZero]).slice(0, 32)); }, t3.parseBytes32String = function(e4) { var t4 = (0, i2.arrayify)(e4); if (32 !== t4.length) throw new Error("invalid bytes32 - not 32 bytes long"); if (0 !== t4[31]) throw new Error("invalid bytes32 string - no null terminator"); for (var r4 = 31; 0 === t4[r4 - 1]; ) r4--; return (0, o2.toUtf8String)(t4.slice(0, r4)); }; var n2 = r3(5465), i2 = r3(908), o2 = r3(34997); }, 68645: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3._nameprepTableA1 = p2, t3._nameprepTableB2 = b2, t3._nameprepTableC = y2, t3.nameprep = function(e4) { if (e4.match(/^[a-z0-9-]*$/i) && e4.length <= 59) return e4.toLowerCase(); var t4, r4 = (0, n2.toUtf8CodePoints)(e4); t4 = r4.map(function(e5) { return u2.indexOf(e5) >= 0 || e5 >= 65024 && e5 <= 65039 ? [] : b2(e5) || [e5]; }), r4 = t4.reduce(function(e5, t5) { return t5.forEach(function(t6) { e5.push(t6); }), e5; }, []), (r4 = (0, n2.toUtf8CodePoints)((0, n2._toUtf8String)(r4), n2.UnicodeNormalizationForm.NFKC)).forEach(function(e5) { if (y2(e5)) throw new Error("STRINGPREP_CONTAINS_PROHIBITED"); }), r4.forEach(function(e5) { if (p2(e5)) throw new Error("STRINGPREP_CONTAINS_UNASSIGNED"); }); var i3 = (0, n2._toUtf8String)(r4); if ("-" === i3.substring(0, 1) || "--" === i3.substring(2, 4) || "-" === i3.substring(i3.length - 1)) throw new Error("invalid hyphen"); return i3; }; var n2 = r3(34997); function i2(e4, t4) { t4 || (t4 = function(e5) { return [parseInt(e5, 16)]; }); var r4 = 0, n3 = {}; return e4.split(",").forEach(function(e5) { var i3 = e5.split(":"); r4 += parseInt(i3[0], 16), n3[r4] = t4(i3[1]); }), n3; } function o2(e4) { var t4 = 0; return e4.split(",").map(function(e5) { var r4 = e5.split("-"); return 1 === r4.length ? r4[1] = "0" : "" === r4[1] && (r4[1] = "1"), { l: t4 + parseInt(r4[0], 16), h: t4 = parseInt(r4[1], 16) }; }); } function a2(e4, t4) { for (var r4 = 0, n3 = 0; n3 < t4.length; n3++) { var i3 = t4[n3]; if (e4 >= (r4 += i3.l) && e4 <= r4 + i3.h && (e4 - r4) % (i3.d || 1) == 0) { if (i3.e && -1 !== i3.e.indexOf(e4 - r4)) continue; return i3; } } return null; } var s2 = o2("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"), u2 = "ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(function(e4) { return parseInt(e4, 16); }), c2 = [{ h: 25, s: 32, l: 65 }, { h: 30, s: 32, e: [23], l: 127 }, { h: 54, s: 1, e: [48], l: 64, d: 2 }, { h: 14, s: 1, l: 57, d: 2 }, { h: 44, s: 1, l: 17, d: 2 }, { h: 10, s: 1, e: [2, 6, 8], l: 61, d: 2 }, { h: 16, s: 1, l: 68, d: 2 }, { h: 84, s: 1, e: [18, 24, 66], l: 19, d: 2 }, { h: 26, s: 32, e: [17], l: 435 }, { h: 22, s: 1, l: 71, d: 2 }, { h: 15, s: 80, l: 40 }, { h: 31, s: 32, l: 16 }, { h: 32, s: 1, l: 80, d: 2 }, { h: 52, s: 1, l: 42, d: 2 }, { h: 12, s: 1, l: 55, d: 2 }, { h: 40, s: 1, e: [38], l: 15, d: 2 }, { h: 14, s: 1, l: 48, d: 2 }, { h: 37, s: 48, l: 49 }, { h: 148, s: 1, l: 6351, d: 2 }, { h: 88, s: 1, l: 160, d: 2 }, { h: 15, s: 16, l: 704 }, { h: 25, s: 26, l: 854 }, { h: 25, s: 32, l: 55915 }, { h: 37, s: 40, l: 1247 }, { h: 25, s: -119711, l: 53248 }, { h: 25, s: -119763, l: 52 }, { h: 25, s: -119815, l: 52 }, { h: 25, s: -119867, e: [1, 4, 5, 7, 8, 11, 12, 17], l: 52 }, { h: 25, s: -119919, l: 52 }, { h: 24, s: -119971, e: [2, 7, 8, 17], l: 52 }, { h: 24, s: -120023, e: [2, 7, 13, 15, 16, 17], l: 52 }, { h: 25, s: -120075, l: 52 }, { h: 25, s: -120127, l: 52 }, { h: 25, s: -120179, l: 52 }, { h: 25, s: -120231, l: 52 }, { h: 25, s: -120283, l: 52 }, { h: 25, s: -120335, l: 52 }, { h: 24, s: -119543, e: [17], l: 56 }, { h: 24, s: -119601, e: [17], l: 58 }, { h: 24, s: -119659, e: [17], l: 58 }, { h: 24, s: -119717, e: [17], l: 58 }, { h: 24, s: -119775, e: [17], l: 58 }], f2 = i2("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"), d2 = i2("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"), l2 = i2("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", function(e4) { if (e4.length % 4 != 0) throw new Error("bad data"); for (var t4 = [], r4 = 0; r4 < e4.length; r4 += 4) t4.push(parseInt(e4.substring(r4, r4 + 4), 16)); return t4; }), h2 = o2("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 p2(e4) { return !!a2(e4, s2); } function b2(e4) { var t4 = a2(e4, c2); if (t4) return [e4 + t4.s]; var r4 = f2[e4]; if (r4) return r4; var n3 = d2[e4]; return n3 ? [e4 + n3[0]] : l2[e4] || null; } function y2(e4) { return !!a2(e4, h2); } }, 78627: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), Object.defineProperty(t3, "UnicodeNormalizationForm", { enumerable: true, get: function() { return o2.UnicodeNormalizationForm; } }), Object.defineProperty(t3, "Utf8ErrorFuncs", { enumerable: true, get: function() { return o2.Utf8ErrorFuncs; } }), Object.defineProperty(t3, "Utf8ErrorReason", { enumerable: true, get: function() { return o2.Utf8ErrorReason; } }), Object.defineProperty(t3, "_toEscapedUtf8String", { enumerable: true, get: function() { return o2._toEscapedUtf8String; } }), Object.defineProperty(t3, "formatBytes32String", { enumerable: true, get: function() { return n2.formatBytes32String; } }), Object.defineProperty(t3, "nameprep", { enumerable: true, get: function() { return i2.nameprep; } }), Object.defineProperty(t3, "parseBytes32String", { enumerable: true, get: function() { return n2.parseBytes32String; } }), Object.defineProperty(t3, "toUtf8Bytes", { enumerable: true, get: function() { return o2.toUtf8Bytes; } }), Object.defineProperty(t3, "toUtf8CodePoints", { enumerable: true, get: function() { return o2.toUtf8CodePoints; } }), Object.defineProperty(t3, "toUtf8String", { enumerable: true, get: function() { return o2.toUtf8String; } }); var n2 = r3(95856), i2 = r3(68645), o2 = r3(34997); }, 34997: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.Utf8ErrorReason = t3.Utf8ErrorFuncs = t3.UnicodeNormalizationForm = void 0, t3._toEscapedUtf8String = function(e4, t4) { return '"' + d2(e4, t4).map(function(e5) { if (e5 < 256) { switch (e5) { case 8: return "\\b"; case 9: return "\\t"; case 10: return "\\n"; case 13: return "\\r"; case 34: return '\\"'; case 92: return "\\\\"; } if (e5 >= 32 && e5 < 127) return String.fromCharCode(e5); } return e5 <= 65535 ? h2(e5) : h2(55296 + ((e5 -= 65536) >> 10 & 1023)) + h2(56320 + (1023 & e5)); }).join("") + '"'; }, t3._toUtf8String = p2, t3.toUtf8Bytes = l2, t3.toUtf8CodePoints = function(e4) { return d2(l2(e4, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : n2.current)); }, t3.toUtf8String = function(e4, t4) { return p2(d2(e4, t4)); }; var n2, i2, o2 = r3(908), a2 = r3(64327), s2 = r3(56518), u2 = new a2.Logger(s2.version); function c2(e4, t4, r4, n3, o3) { if (e4 === i2.BAD_PREFIX || e4 === i2.UNEXPECTED_CONTINUE) { for (var a3 = 0, s3 = t4 + 1; s3 < r4.length && r4[s3] >> 6 == 2; s3++) a3++; return a3; } return e4 === i2.OVERRUN ? r4.length - t4 - 1 : 0; } t3.UnicodeNormalizationForm = n2, function(e4) { e4.current = "", e4.NFC = "NFC", e4.NFD = "NFD", e4.NFKC = "NFKC", e4.NFKD = "NFKD"; }(n2 || (t3.UnicodeNormalizationForm = n2 = {})), t3.Utf8ErrorReason = i2, function(e4) { e4.UNEXPECTED_CONTINUE = "unexpected continuation byte", e4.BAD_PREFIX = "bad codepoint prefix", e4.OVERRUN = "string overrun", e4.MISSING_CONTINUE = "missing continuation byte", e4.OUT_OF_RANGE = "out of UTF-8 range", e4.UTF16_SURROGATE = "UTF-16 surrogate", e4.OVERLONG = "overlong representation"; }(i2 || (t3.Utf8ErrorReason = i2 = {})); var f2 = Object.freeze({ error: function(e4, t4, r4, n3, i3) { return u2.throwArgumentError("invalid codepoint at offset ".concat(t4, "; ").concat(e4), "bytes", r4); }, ignore: c2, replace: function(e4, t4, r4, n3, o3) { return e4 === i2.OVERLONG ? (n3.push(o3), 0) : (n3.push(65533), c2(e4, t4, r4)); } }); function d2(e4, t4) { null == t4 && (t4 = f2.error), e4 = (0, o2.arrayify)(e4); for (var r4 = [], n3 = 0; n3 < e4.length; ) { var a3 = e4[n3++]; if (a3 >> 7 != 0) { var s3 = null, u3 = null; if (192 == (224 & a3)) s3 = 1, u3 = 127; else if (224 == (240 & a3)) s3 = 2, u3 = 2047; else { if (240 != (248 & a3)) { n3 += t4(128 == (192 & a3) ? i2.UNEXPECTED_CONTINUE : i2.BAD_PREFIX, n3 - 1, e4, r4); continue; } s3 = 3, u3 = 65535; } if (n3 - 1 + s3 >= e4.length) n3 += t4(i2.OVERRUN, n3 - 1, e4, r4); else { for (var c3 = a3 & (1 << 8 - s3 - 1) - 1, d3 = 0; d3 < s3; d3++) { var l3 = e4[n3]; if (128 != (192 & l3)) { n3 += t4(i2.MISSING_CONTINUE, n3, e4, r4), c3 = null; break; } c3 = c3 << 6 | 63 & l3, n3++; } null !== c3 && (c3 > 1114111 ? n3 += t4(i2.OUT_OF_RANGE, n3 - 1 - s3, e4, r4, c3) : c3 >= 55296 && c3 <= 57343 ? n3 += t4(i2.UTF16_SURROGATE, n3 - 1 - s3, e4, r4, c3) : c3 <= u3 ? n3 += t4(i2.OVERLONG, n3 - 1 - s3, e4, r4, c3) : r4.push(c3)); } } else r4.push(a3); } return r4; } function l2(e4) { var t4 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : n2.current; t4 != n2.current && (u2.checkNormalize(), e4 = e4.normalize(t4)); for (var r4 = [], i3 = 0; i3 < e4.length; i3++) { var a3 = e4.charCodeAt(i3); if (a3 < 128) r4.push(a3); else if (a3 < 2048) r4.push(a3 >> 6 | 192), r4.push(63 & a3 | 128); else if (55296 == (64512 & a3)) { i3++; var s3 = e4.charCodeAt(i3); if (i3 >= e4.length || 56320 != (64512 & s3)) throw new Error("invalid utf-8 string"); var c3 = 65536 + ((1023 & a3) << 10) + (1023 & s3); r4.push(c3 >> 18 | 240), r4.push(c3 >> 12 & 63 | 128), r4.push(c3 >> 6 & 63 | 128), r4.push(63 & c3 | 128); } else r4.push(a3 >> 12 | 224), r4.push(a3 >> 6 & 63 | 128), r4.push(63 & a3 | 128); } return (0, o2.arrayify)(r4); } function h2(e4) { var t4 = "0000" + e4.toString(16); return "\\u" + t4.substring(t4.length - 4); } function p2(e4) { return e4.map(function(e5) { return e5 <= 65535 ? String.fromCharCode(e5) : (e5 -= 65536, String.fromCharCode(55296 + (e5 >> 10 & 1023), 56320 + (1023 & e5))); }).join(""); } t3.Utf8ErrorFuncs = f2; }, 96783: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.version = void 0, t3.version = "transactions/5.7.0"; }, 21936: (e3, t3, r3) => { var n2 = r3(3355); Object.defineProperty(t3, "__esModule", { value: true }), t3.TransactionTypes = void 0, t3.accessListify = S2, t3.computeAddress = k2, t3.parse = function(e4) { var t4 = (0, a2.arrayify)(e4); if (t4[0] > 127) return function(e5) { var t5 = f2.decode(e5); 9 !== t5.length && 6 !== t5.length && y2.throwArgumentError("invalid raw transaction", "rawTransaction", e5); var r4 = { nonce: m2(t5[0]).toNumber(), gasPrice: m2(t5[1]), gasLimit: m2(t5[2]), to: v2(t5[3]), value: m2(t5[4]), data: t5[5], chainId: 0 }; if (6 === t5.length) return r4; try { r4.v = o2.BigNumber.from(t5[6]).toNumber(); } catch (e6) { return r4; } if (r4.r = (0, a2.hexZeroPad)(t5[7], 32), r4.s = (0, a2.hexZeroPad)(t5[8], 32), o2.BigNumber.from(r4.r).isZero() && o2.BigNumber.from(r4.s).isZero()) r4.chainId = r4.v, r4.v = 0; else { r4.chainId = Math.floor((r4.v - 35) / 2), r4.chainId < 0 && (r4.chainId = 0); var n3 = r4.v - 27, i3 = t5.slice(0, 6); 0 !== r4.chainId && (i3.push((0, a2.hexlify)(r4.chainId)), i3.push("0x"), i3.push("0x"), n3 -= 2 * r4.chainId + 8); var s3 = (0, u2.keccak256)(f2.encode(i3)); try { r4.from = _2(s3, { r: (0, a2.hexlify)(r4.r), s: (0, a2.hexlify)(r4.s), recoveryParam: n3 }); } catch (e6) { } r4.hash = (0, u2.keccak256)(e5); } return r4.type = null, r4; }(t4); switch (t4[0]) { case 1: return function(e5) { var t5 = f2.decode(e5.slice(1)); 8 !== t5.length && 11 !== t5.length && y2.throwArgumentError("invalid component count for transaction type: 1", "payload", (0, a2.hexlify)(e5)); var r4 = { type: 1, chainId: m2(t5[0]).toNumber(), nonce: m2(t5[1]).toNumber(), gasPrice: m2(t5[2]), gasLimit: m2(t5[3]), to: v2(t5[4]), value: m2(t5[5]), data: t5[6], accessList: S2(t5[7]) }; return 8 === t5.length || (r4.hash = (0, u2.keccak256)(e5), P2(r4, t5.slice(8), O2)), r4; }(t4); case 2: return function(e5) { var t5 = f2.decode(e5.slice(1)); 9 !== t5.length && 12 !== t5.length && y2.throwArgumentError("invalid component count for transaction type: 2", "payload", (0, a2.hexlify)(e5)); var r4 = m2(t5[2]), n3 = m2(t5[3]), i3 = { type: 2, chainId: m2(t5[0]).toNumber(), nonce: m2(t5[1]).toNumber(), maxPriorityFeePerGas: r4, maxFeePerGas: n3, gasPrice: null, gasLimit: m2(t5[4]), to: v2(t5[5]), value: m2(t5[6]), data: t5[7], accessList: S2(t5[8]) }; return 9 === t5.length || (i3.hash = (0, u2.keccak256)(e5), P2(i3, t5.slice(9), B2)), i3; }(t4); } return y2.throwError("unsupported transaction type: ".concat(t4[0]), l2.Logger.errors.UNSUPPORTED_OPERATION, { operation: "parseTransaction", transactionType: t4[0] }); }, t3.recoverAddress = _2, t3.serialize = function(e4, t4) { if (null == e4.type || 0 === e4.type) return null != e4.accessList && y2.throwArgumentError("untyped transactions do not support accessList; include type: 1", "transaction", e4), function(e5, t5) { (0, c2.checkProperties)(e5, w2); var r4 = []; g2.forEach(function(t6) { var n4 = e5[t6.name] || [], i4 = {}; t6.numeric && (i4.hexPad = "left"), n4 = (0, a2.arrayify)((0, a2.hexlify)(n4, i4)), t6.length && n4.length !== t6.length && n4.length > 0 && y2.throwArgumentError("invalid length for " + t6.name, "transaction:" + t6.name, n4), t6.maxLength && (n4 = (0, a2.stripZeros)(n4)).length > t6.maxLength && y2.throwArgumentError("invalid length for " + t6.name, "transaction:" + t6.name, n4), r4.push((0, a2.hexlify)(n4)); }); var n3 = 0; if (null != e5.chainId ? "number" != typeof (n3 = e5.chainId) && y2.throwArgumentError("invalid transaction.chainId", "transaction", e5) : t5 && !(0, a2.isBytesLike)(t5) && t5.v > 28 && (n3 = Math.floor((t5.v - 35) / 2)), 0 !== n3 && (r4.push((0, a2.hexlify)(n3)), r4.push("0x"), r4.push("0x")), !t5) return f2.encode(r4); var i3 = (0, a2.splitSignature)(t5), o3 = 27 + i3.recoveryParam; return 0 !== n3 ? (r4.pop(), r4.pop(), r4.pop(), o3 += 2 * n3 + 8, i3.v > 28 && i3.v !== o3 && y2.throwArgumentError("transaction.chainId/signature.v mismatch", "signature", t5)) : i3.v !== o3 && y2.throwArgumentError("transaction.chainId/signature.v mismatch", "signature", t5), r4.push((0, a2.hexlify)(o3)), r4.push((0, a2.stripZeros)((0, a2.arrayify)(i3.r))), r4.push((0, a2.stripZeros)((0, a2.arrayify)(i3.s))), f2.encode(r4); }(e4, t4); switch (e4.type) { case 1: return O2(e4, t4); case 2: return B2(e4, t4); } return y2.throwError("unsupported transaction type: ".concat(e4.type), l2.Logger.errors.UNSUPPORTED_OPERATION, { operation: "serializeTransaction", transactionType: e4.type }); }; var i2 = r3(77921), o2 = r3(34952), a2 = r3(908), s2 = r3(5465), u2 = r3(64642), c2 = r3(23694), f2 = function(e4, t4) { if (e4 && e4.__esModule) return e4; if (null === e4 || "object" !== n2(e4) && "function" != typeof e4) return { default: e4 }; var r4 = p2(t4); if (r4 && r4.has(e4)) return r4.get(e4); var i3 = {}, o3 = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var a3 in e4) if ("default" !== a3 && Object.prototype.hasOwnProperty.call(e4, a3)) { var s3 = o3 ? Object.getOwnPropertyDescriptor(e4, a3) : null; s3 && (s3.get || s3.set) ? Object.defineProperty(i3, a3, s3) : i3[a3] = e4[a3]; } return i3.default = e4, r4 && r4.set(e4, i3), i3; }(r3(55265)), d2 = r3(17612), l2 = r3(64327), h2 = r3(96783); function p2(e4) { if ("function" != typeof WeakMap) return null; var t4 = /* @__PURE__ */ new WeakMap(), r4 = /* @__PURE__ */ new WeakMap(); return (p2 = function(e5) { return e5 ? r4 : t4; })(e4); } var b2, y2 = new l2.Logger(h2.version); function v2(e4) { return "0x" === e4 ? null : (0, i2.getAddress)(e4); } function m2(e4) { return "0x" === e4 ? s2.Zero : o2.BigNumber.from(e4); } t3.TransactionTypes = b2, function(e4) { e4[e4.legacy = 0] = "legacy", e4[e4.eip2930 = 1] = "eip2930", e4[e4.eip1559 = 2] = "eip1559"; }(b2 || (t3.TransactionTypes = b2 = {})); var g2 = [{ name: "nonce", maxLength: 32, numeric: true }, { name: "gasPrice", maxLength: 32, numeric: true }, { name: "gasLimit", maxLength: 32, numeric: true }, { name: "to", length: 20 }, { name: "value", maxLength: 32, numeric: true }, { name: "data" }], w2 = { chainId: true, data: true, gasLimit: true, gasPrice: true, nonce: true, to: true, type: true, value: true }; function k2(e4) { var t4 = (0, d2.computePublicKey)(e4); return (0, i2.getAddress)((0, a2.hexDataSlice)((0, u2.keccak256)((0, a2.hexDataSlice)(t4, 1)), 12)); } function _2(e4, t4) { return k2((0, d2.recoverPublicKey)((0, a2.arrayify)(e4), t4)); } function A2(e4, t4) { var r4 = (0, a2.stripZeros)(o2.BigNumber.from(e4).toHexString()); return r4.length > 32 && y2.throwArgumentError("invalid length for " + t4, "transaction:" + t4, e4), r4; } function E2(e4, t4) { return { address: (0, i2.getAddress)(e4), storageKeys: (t4 || []).map(function(t5, r4) { return 32 !== (0, a2.hexDataLength)(t5) && y2.throwArgumentError("invalid access list storageKey", "accessList[".concat(e4, ":").concat(r4, "]"), t5), t5.toLowerCase(); }) }; } function S2(e4) { if (Array.isArray(e4)) return e4.map(function(e5, t5) { return Array.isArray(e5) ? (e5.length > 2 && y2.throwArgumentError("access list expected to be [ address, storageKeys[] ]", "value[".concat(t5, "]"), e5), E2(e5[0], e5[1])) : E2(e5.address, e5.storageKeys); }); var t4 = Object.keys(e4).map(function(t5) { var r4 = e4[t5].reduce(function(e5, t6) { return e5[t6] = true, e5; }, {}); return E2(t5, Object.keys(r4).sort()); }); return t4.sort(function(e5, t5) { return e5.address.localeCompare(t5.address); }), t4; } function x2(e4) { return S2(e4).map(function(e5) { return [e5.address, e5.storageKeys]; }); } function B2(e4, t4) { if (null != e4.gasPrice) { var r4 = o2.BigNumber.from(e4.gasPrice), n3 = o2.BigNumber.from(e4.maxFeePerGas || 0); r4.eq(n3) || y2.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas", "tx", { gasPrice: r4, maxFeePerGas: n3 }); } var s3 = [A2(e4.chainId || 0, "chainId"), A2(e4.nonce || 0, "nonce"), A2(e4.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), A2(e4.maxFeePerGas || 0, "maxFeePerGas"), A2(e4.gasLimit || 0, "gasLimit"), null != e4.to ? (0, i2.getAddress)(e4.to) : "0x", A2(e4.value || 0, "value"), e4.data || "0x", x2(e4.accessList || [])]; if (t4) { var u3 = (0, a2.splitSignature)(t4); s3.push(A2(u3.recoveryParam, "recoveryParam")), s3.push((0, a2.stripZeros)(u3.r)), s3.push((0, a2.stripZeros)(u3.s)); } return (0, a2.hexConcat)(["0x02", f2.encode(s3)]); } function O2(e4, t4) { var r4 = [A2(e4.chainId || 0, "chainId"), A2(e4.nonce || 0, "nonce"), A2(e4.gasPrice || 0, "gasPrice"), A2(e4.gasLimit || 0, "gasLimit"), null != e4.to ? (0, i2.getAddress)(e4.to) : "0x", A2(e4.value || 0, "value"), e4.data || "0x", x2(e4.accessList || [])]; if (t4) { var n3 = (0, a2.splitSignature)(t4); r4.push(A2(n3.recoveryParam, "recoveryParam")), r4.push((0, a2.stripZeros)(n3.r)), r4.push((0, a2.stripZeros)(n3.s)); } return (0, a2.hexConcat)(["0x01", f2.encode(r4)]); } function P2(e4, t4, r4) { try { var n3 = m2(t4[0]).toNumber(); if (0 !== n3 && 1 !== n3) throw new Error("bad recid"); e4.v = n3; } catch (e5) { y2.throwArgumentError("invalid v for transaction type: 1", "v", t4[0]); } e4.r = (0, a2.hexZeroPad)(t4[1], 32), e4.s = (0, a2.hexZeroPad)(t4[2], 32); try { var i3 = (0, u2.keccak256)(r4(e4)); e4.from = _2(i3, { r: e4.r, s: e4.s, recoveryParam: e4.v }); } catch (e5) { } } }, 96546: (e3, t3, r3) => { var n2 = r3(28847)(r3(90775)); function i2(e4, t4) { var r4 = Object.keys(e4); if (Object.getOwnPropertySymbols) { var n3 = Object.getOwnPropertySymbols(e4); t4 && (n3 = n3.filter(function(t5) { return Object.getOwnPropertyDescriptor(e4, t5).enumerable; })), r4.push.apply(r4, n3); } return r4; } function o2(e4) { for (var t4 = 1; t4 < arguments.length; t4++) { var r4 = null != arguments[t4] ? arguments[t4] : {}; t4 % 2 ? i2(Object(r4), true).forEach(function(t5) { (0, n2.default)(e4, t5, r4[t5]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(r4)) : i2(Object(r4)).forEach(function(t5) { Object.defineProperty(e4, t5, Object.getOwnPropertyDescriptor(r4, t5)); }); } return e4; } Object.defineProperty(t3, "__esModule", { value: true }), t3.createCurve = t3.getHash = void 0; var a2 = r3(45896), s2 = r3(72434), u2 = r3(16573); function c2(e4) { return { hash: e4, hmac: function(t4) { for (var r4 = arguments.length, n3 = new Array(r4 > 1 ? r4 - 1 : 0), i3 = 1; i3 < r4; i3++) n3[i3 - 1] = arguments[i3]; return (0, a2.hmac)(e4, t4, s2.concatBytes.apply(void 0, n3)); }, randomBytes: s2.randomBytes }; } t3.getHash = c2, t3.createCurve = function(e4, t4) { var r4 = function(t5) { return (0, u2.weierstrass)(o2(o2({}, e4), c2(t5))); }; return Object.freeze(o2(o2({}, r4(t4)), {}, { create: r4 })); }; }, 91813: (e3, t3, r3) => { var n2 = r3(28847)(r3(90775)); function i2(e4, t4) { var r4 = Object.keys(e4); if (Object.getOwnPropertySymbols) { var n3 = Object.getOwnPropertySymbols(e4); t4 && (n3 = n3.filter(function(t5) { return Object.getOwnPropertyDescriptor(e4, t5).enumerable; })), r4.push.apply(r4, n3); } return r4; } function o2(e4) { for (var t4 = 1; t4 < arguments.length; t4++) { var r4 = null != arguments[t4] ? arguments[t4] : {}; t4 % 2 ? i2(Object(r4), true).forEach(function(t5) { (0, n2.default)(e4, t5, r4[t5]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(r4)) : i2(Object(r4)).forEach(function(t5) { Object.defineProperty(e4, t5, Object.getOwnPropertyDescriptor(r4, t5)); }); } return e4; } Object.defineProperty(t3, "__esModule", { value: true }), t3.validateBasic = t3.wNAF = void 0; var a2 = r3(3970), s2 = r3(46928), u2 = BigInt(0), c2 = BigInt(1); t3.wNAF = function(e4, t4) { var r4 = function(e5, t5) { var r5 = t5.negate(); return e5 ? r5 : t5; }, n3 = function(e5) { return { windows: Math.ceil(t4 / e5) + 1, windowSize: Math.pow(2, e5 - 1) }; }; return { constTimeNegate: r4, unsafeLadder: function(t5, r5) { for (var n4 = e4.ZERO, i3 = t5; r5 > u2; ) r5 & c2 && (n4 = n4.add(i3)), i3 = i3.double(), r5 >>= c2; return n4; }, precomputeWindow: function(e5, t5) { for (var r5 = n3(t5), i3 = r5.windows, o3 = r5.windowSize, a3 = [], s3 = e5, u3 = s3, c3 = 0; c3 < i3; c3++) { u3 = s3, a3.push(u3); for (var f2 = 1; f2 < o3; f2++) u3 = u3.add(s3), a3.push(u3); s3 = u3.double(); } return a3; }, wNAF: function(t5, i3, o3) { for (var a3 = n3(t5), s3 = a3.windows, u3 = a3.windowSize, f2 = e4.ZERO, d2 = e4.BASE, l2 = BigInt(Math.pow(2, t5) - 1), h2 = Math.pow(2, t5), p2 = BigInt(t5), b2 = 0; b2 < s3; b2++) { var y2 = b2 * u3, v2 = Number(o3 & l2); o3 >>= p2, v2 > u3 && (v2 -= h2, o3 += c2); var m2 = y2, g2 = y2 + Math.abs(v2) - 1, w2 = b2 % 2 != 0, k2 = v2 < 0; 0 === v2 ? d2 = d2.add(r4(w2, i3[m2])) : f2 = f2.add(r4(k2, i3[g2])); } return { p: f2, f: d2 }; }, wNAFCached: function(e5, t5, r5, n4) { var i3 = e5._WINDOW_SIZE || 1, o3 = t5.get(e5); return o3 || (o3 = this.precomputeWindow(e5, i3), 1 !== i3 && t5.set(e5, n4(o3))), this.wNAF(i3, o3, r5); } }; }, t3.validateBasic = function(e4) { return (0, a2.validateField)(e4.Fp), (0, s2.validateObject)(e4, { n: "bigint", h: "bigint", Gx: "field", Gy: "field" }, { nBitLength: "isSafeInteger", nByteLength: "isSafeInteger" }), Object.freeze(o2(o2(o2({}, (0, a2.nLength)(e4.n, e4.nBitLength)), e4), { p: e4.Fp.ORDER })); }; }, 19751: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(90775)), o2 = n2(r3(74519)); function a2(e4, t4) { var r4 = Object.keys(e4); if (Object.getOwnPropertySymbols) { var n3 = Object.getOwnPropertySymbols(e4); t4 && (n3 = n3.filter(function(t5) { return Object.getOwnPropertyDescriptor(e4, t5).enumerable; })), r4.push.apply(r4, n3); } return r4; } function s2(e4) { for (var t4 = 1; t4 < arguments.length; t4++) { var r4 = null != arguments[t4] ? arguments[t4] : {}; t4 % 2 ? a2(Object(r4), true).forEach(function(t5) { (0, i2.default)(e4, t5, r4[t5]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(r4)) : a2(Object(r4)).forEach(function(t5) { Object.defineProperty(e4, t5, Object.getOwnPropertyDescriptor(r4, t5)); }); } return e4; } Object.defineProperty(t3, "__esModule", { value: true }), t3.createHasher = t3.isogenyMap = t3.hash_to_field = t3.expand_message_xof = t3.expand_message_xmd = void 0; var u2 = r3(3970), c2 = r3(46928), f2 = c2.bytesToNumberBE; function d2(e4, t4) { if (e4 < 0 || e4 >= 1 << 8 * t4) throw new Error("bad I2OSP call: value=".concat(e4, " length=").concat(t4)); for (var r4 = Array.from({ length: t4 }).fill(0), n3 = t4 - 1; n3 >= 0; n3--) r4[n3] = 255 & e4, e4 >>>= 8; return new Uint8Array(r4); } function l2(e4, t4) { for (var r4 = new Uint8Array(e4.length), n3 = 0; n3 < e4.length; n3++) r4[n3] = e4[n3] ^ t4[n3]; return r4; } function h2(e4) { if (!(e4 instanceof Uint8Array)) throw new Error("Uint8Array expected"); } function p2(e4) { if (!Number.isSafeInteger(e4)) throw new Error("number expected"); } function b2(e4, t4, r4, n3) { h2(e4), h2(t4), p2(r4), t4.length > 255 && (t4 = n3((0, c2.concatBytes)((0, c2.utf8ToBytes)("H2C-OVERSIZE-DST-"), t4))); var i3 = n3.outputLen, o3 = n3.blockLen, a3 = Math.ceil(r4 / i3); if (a3 > 255) throw new Error("Invalid xmd length"); var s3 = (0, c2.concatBytes)(t4, d2(t4.length, 1)), u3 = d2(0, o3), f3 = d2(r4, 2), b3 = new Array(a3), y3 = n3((0, c2.concatBytes)(u3, e4, f3, d2(0, 1), s3)); b3[0] = n3((0, c2.concatBytes)(y3, d2(1, 1), s3)); for (var v3 = 1; v3 <= a3; v3++) { var m2 = [l2(y3, b3[v3 - 1]), d2(v3 + 1, 1), s3]; b3[v3] = n3(c2.concatBytes.apply(void 0, m2)); } return c2.concatBytes.apply(void 0, b3).slice(0, r4); } function y2(e4, t4, r4, n3, i3) { if (h2(e4), h2(t4), p2(r4), t4.length > 255) { var o3 = Math.ceil(2 * n3 / 8); t4 = i3.create({ dkLen: o3 }).update((0, c2.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t4).digest(); } if (r4 > 65535 || t4.length > 255) throw new Error("expand_message_xof: invalid lenInBytes"); return i3.create({ dkLen: r4 }).update(e4).update(d2(r4, 2)).update(t4).update(d2(t4.length, 1)).digest(); } function v2(e4, t4, r4) { (0, c2.validateObject)(r4, { DST: "string", p: "bigint", m: "isSafeInteger", k: "isSafeInteger", hash: "hash" }); var n3 = r4.p, i3 = r4.k, o3 = r4.m, a3 = r4.hash, s3 = r4.expand, d3 = r4.DST; h2(e4), p2(t4); var l3, v3 = function(e5) { if (e5 instanceof Uint8Array) return e5; if ("string" == typeof e5) return (0, c2.utf8ToBytes)(e5); throw new Error("DST must be Uint8Array or string"); }(d3), m2 = n3.toString(2).length, g2 = Math.ceil((m2 + i3) / 8), w2 = t4 * o3 * g2; if ("xmd" === s3) l3 = b2(e4, v3, w2, a3); else if ("xof" === s3) l3 = y2(e4, v3, w2, i3, a3); else { if ("_internal_pass" !== s3) throw new Error('expand must be "xmd" or "xof"'); l3 = e4; } for (var k2 = new Array(t4), _2 = 0; _2 < t4; _2++) { for (var A2 = new Array(o3), E2 = 0; E2 < o3; E2++) { var S2 = g2 * (E2 + _2 * o3), x2 = l3.subarray(S2, S2 + g2); A2[E2] = (0, u2.mod)(f2(x2), n3); } k2[_2] = A2; } return k2; } t3.expand_message_xmd = b2, t3.expand_message_xof = y2, t3.hash_to_field = v2, t3.isogenyMap = function(e4, t4) { var r4 = t4.map(function(e5) { return Array.from(e5).reverse(); }); return function(t5, n3) { var i3 = r4.map(function(r5) { return r5.reduce(function(r6, n4) { return e4.add(e4.mul(r6, t5), n4); }); }), a3 = (0, o2.default)(i3, 4), s3 = a3[0], u3 = a3[1], c3 = a3[2], f3 = a3[3]; return t5 = e4.div(s3, u3), n3 = e4.mul(n3, e4.div(c3, f3)), { x: t5, y: n3 }; }; }, t3.createHasher = function(e4, t4, r4) { if ("function" != typeof t4) throw new Error("mapToCurve() must be defined"); return { hashToCurve: function(n3, i3) { var o3 = v2(n3, 2, s2(s2({}, r4), {}, { DST: r4.DST }, i3)), a3 = e4.fromAffine(t4(o3[0])), u3 = e4.fromAffine(t4(o3[1])), c3 = a3.add(u3).clearCofactor(); return c3.assertValidity(), c3; }, encodeToCurve: function(n3, i3) { var o3 = v2(n3, 1, s2(s2({}, r4), {}, { DST: r4.encodeDST }, i3)), a3 = e4.fromAffine(t4(o3[0])).clearCofactor(); return a3.assertValidity(), a3; } }; }; }, 3970: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)); Object.defineProperty(t3, "__esModule", { value: true }), t3.hashToPrivateScalar = t3.FpSqrtEven = t3.FpSqrtOdd = t3.Field = t3.nLength = t3.FpIsSquare = t3.FpDiv = t3.FpInvertBatch = t3.FpPow = t3.validateField = t3.isNegativeLE = t3.FpSqrt = t3.tonelliShanks = t3.invert = t3.pow2 = t3.pow = t3.mod = void 0; var i2 = r3(46928), o2 = BigInt(0), a2 = BigInt(1), s2 = BigInt(2), u2 = BigInt(3), c2 = BigInt(4), f2 = BigInt(5), d2 = BigInt(8); function l2(e4, t4) { var r4 = e4 % t4; return r4 >= o2 ? r4 : t4 + r4; } function h2(e4, t4, r4) { if (r4 <= o2 || t4 < o2) throw new Error("Expected power/modulo > 0"); if (r4 === a2) return o2; for (var n3 = a2; t4 > o2; ) t4 & a2 && (n3 = n3 * e4 % r4), e4 = e4 * e4 % r4, t4 >>= a2; return n3; } function p2(e4, t4) { if (e4 === o2 || t4 <= o2) throw new Error("invert: expected positive integers, got n=".concat(e4, " mod=").concat(t4)); for (var r4 = l2(e4, t4), n3 = t4, i3 = o2, s3 = a2, u3 = a2, c3 = o2; r4 !== o2; ) { var f3 = n3 / r4, d3 = n3 % r4, h3 = i3 - u3 * f3, p3 = s3 - c3 * f3; n3 = r4, r4 = d3, i3 = u3, s3 = c3, u3 = h3, c3 = p3; } if (n3 !== a2) throw new Error("invert: does not exist"); return l2(i3, t4); } function b2(e4) { var t4, r4, n3, i3 = (e4 - a2) / s2; for (t4 = e4 - a2, r4 = 0; t4 % s2 === o2; t4 /= s2, r4++) ; for (n3 = s2; n3 < e4 && h2(n3, i3, e4) !== e4 - a2; n3++) ; if (1 === r4) { var u3 = (e4 + a2) / c2; return function(e5, t5) { var r5 = e5.pow(t5, u3); if (!e5.eql(e5.sqr(r5), t5)) throw new Error("Cannot find square root"); return r5; }; } var f3 = (t4 + a2) / s2; return function(e5, o3) { if (e5.pow(o3, i3) === e5.neg(e5.ONE)) throw new Error("Cannot find square root"); for (var s3 = r4, u4 = e5.pow(e5.mul(e5.ONE, n3), t4), c3 = e5.pow(o3, f3), d3 = e5.pow(o3, t4); !e5.eql(d3, e5.ONE); ) { if (e5.eql(d3, e5.ZERO)) return e5.ZERO; for (var l3 = 1, h3 = e5.sqr(d3); l3 < s3 && !e5.eql(h3, e5.ONE); l3++) h3 = e5.sqr(h3); var p3 = e5.pow(u4, a2 << BigInt(s3 - l3 - 1)); u4 = e5.sqr(p3), c3 = e5.mul(c3, p3), d3 = e5.mul(d3, u4), s3 = l3; } return c3; }; } function y2(e4) { if (e4 % c2 === u2) { var t4 = (e4 + a2) / c2; return function(e5, r5) { var n3 = e5.pow(r5, t4); if (!e5.eql(e5.sqr(n3), r5)) throw new Error("Cannot find square root"); return n3; }; } if (e4 % d2 === f2) { var r4 = (e4 - f2) / d2; return function(e5, t5) { var n3 = e5.mul(t5, s2), i3 = e5.pow(n3, r4), o3 = e5.mul(t5, i3), a3 = e5.mul(e5.mul(o3, s2), i3), u3 = e5.mul(o3, e5.sub(a3, e5.ONE)); if (!e5.eql(e5.sqr(u3), t5)) throw new Error("Cannot find square root"); return u3; }; } return b2(e4); } BigInt(9), BigInt(16), t3.mod = l2, t3.pow = h2, t3.pow2 = function(e4, t4, r4) { for (var n3 = e4; t4-- > o2; ) n3 *= n3, n3 %= r4; return n3; }, t3.invert = p2, t3.tonelliShanks = b2, t3.FpSqrt = y2, t3.isNegativeLE = function(e4, t4) { return (l2(e4, t4) & a2) === a2; }; var v2 = ["create", "isValid", "is0", "neg", "inv", "sqrt", "sqr", "eql", "add", "sub", "mul", "pow", "div", "addN", "subN", "mulN", "sqrN"]; function m2(e4, t4, r4) { if (r4 < o2) throw new Error("Expected power > 0"); if (r4 === o2) return e4.ONE; if (r4 === a2) return t4; for (var n3 = e4.ONE, i3 = t4; r4 > o2; ) r4 & a2 && (n3 = e4.mul(n3, i3)), i3 = e4.sqr(i3), r4 >>= a2; return n3; } function g2(e4, t4) { var r4 = new Array(t4.length), n3 = t4.reduce(function(t5, n4, i4) { return e4.is0(n4) ? t5 : (r4[i4] = t5, e4.mul(t5, n4)); }, e4.ONE), i3 = e4.inv(n3); return t4.reduceRight(function(t5, n4, i4) { return e4.is0(n4) ? t5 : (r4[i4] = e4.mul(t5, r4[i4]), e4.mul(t5, n4)); }, i3), r4; } function w2(e4, t4) { var r4 = void 0 !== t4 ? t4 : e4.toString(2).length; return { nBitLength: r4, nByteLength: Math.ceil(r4 / 8) }; } t3.validateField = function(e4) { var t4 = v2.reduce(function(e5, t5) { return e5[t5] = "function", e5; }, { ORDER: "bigint", MASK: "bigint", BYTES: "isSafeInteger", BITS: "isSafeInteger" }); return (0, i2.validateObject)(e4, t4); }, t3.FpPow = m2, t3.FpInvertBatch = g2, t3.FpDiv = function(e4, t4, r4) { return e4.mul(t4, "bigint" == typeof r4 ? p2(r4, e4.ORDER) : e4.inv(r4)); }, t3.FpIsSquare = function(e4) { var t4 = (e4.ORDER - a2) / s2; return function(r4) { var n3 = e4.pow(r4, t4); return e4.eql(n3, e4.ZERO) || e4.eql(n3, e4.ONE); }; }, t3.nLength = w2, t3.Field = function(e4, t4) { var r4 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], s3 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; if (e4 <= o2) throw new Error("Expected Fp ORDER > 0, got ".concat(e4)); var u3 = w2(e4, t4), c3 = u3.nBitLength, f3 = u3.nByteLength; if (f3 > 2048) throw new Error("Field lengths over 2048 bytes are not supported"); var d3 = y2(e4), h3 = Object.freeze({ ORDER: e4, BITS: c3, BYTES: f3, MASK: (0, i2.bitMask)(c3), ZERO: o2, ONE: a2, create: function(t5) { return l2(t5, e4); }, isValid: function(t5) { if ("bigint" != typeof t5) throw new Error("Invalid field element: expected bigint, got ".concat((0, n2.default)(t5))); return o2 <= t5 && t5 < e4; }, is0: function(e5) { return e5 === o2; }, isOdd: function(e5) { return (e5 & a2) === a2; }, neg: function(t5) { return l2(-t5, e4); }, eql: function(e5, t5) { return e5 === t5; }, sqr: function(t5) { return l2(t5 * t5, e4); }, add: function(t5, r5) { return l2(t5 + r5, e4); }, sub: function(t5, r5) { return l2(t5 - r5, e4); }, mul: function(t5, r5) { return l2(t5 * r5, e4); }, pow: function(e5, t5) { return m2(h3, e5, t5); }, div: function(t5, r5) { return l2(t5 * p2(r5, e4), e4); }, sqrN: function(e5) { return e5 * e5; }, addN: function(e5, t5) { return e5 + t5; }, subN: function(e5, t5) { return e5 - t5; }, mulN: function(e5, t5) { return e5 * t5; }, inv: function(t5) { return p2(t5, e4); }, sqrt: s3.sqrt || function(e5) { return d3(h3, e5); }, invertBatch: function(e5) { return g2(h3, e5); }, cmov: function(e5, t5, r5) { return r5 ? t5 : e5; }, toBytes: function(e5) { return r4 ? (0, i2.numberToBytesLE)(e5, f3) : (0, i2.numberToBytesBE)(e5, f3); }, fromBytes: function(e5) { if (e5.length !== f3) throw new Error("Fp.fromBytes: expected ".concat(f3, ", got ").concat(e5.length)); return r4 ? (0, i2.bytesToNumberLE)(e5) : (0, i2.bytesToNumberBE)(e5); } }); return Object.freeze(h3); }, t3.FpSqrtOdd = function(e4, t4) { if (!e4.isOdd) throw new Error("Field doesn't have isOdd"); var r4 = e4.sqrt(t4); return e4.isOdd(r4) ? r4 : e4.neg(r4); }, t3.FpSqrtEven = function(e4, t4) { if (!e4.isOdd) throw new Error("Field doesn't have isOdd"); var r4 = e4.sqrt(t4); return e4.isOdd(r4) ? e4.neg(r4) : r4; }, t3.hashToPrivateScalar = function(e4, t4) { var r4 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], n3 = (e4 = (0, i2.ensureBytes)("privateHash", e4)).length, o3 = w2(t4).nByteLength + 8; if (o3 < 24 || n3 < o3 || n3 > 1024) throw new Error("hashToPrivateScalar: expected ".concat(o3, "-1024 bytes of input, got ").concat(n3)); return l2(r4 ? (0, i2.bytesToNumberLE)(e4) : (0, i2.bytesToNumberBE)(e4), t4 - a2) + a2; }; }, 46928: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(74519)), o2 = n2(r3(3355)); Object.defineProperty(t3, "__esModule", { value: true }), t3.validateObject = t3.createHmacDrbg = t3.bitMask = t3.bitSet = t3.bitGet = t3.bitLen = t3.utf8ToBytes = t3.equalBytes = t3.concatBytes = t3.ensureBytes = t3.numberToVarBytesBE = t3.numberToBytesLE = t3.numberToBytesBE = t3.bytesToNumberLE = t3.bytesToNumberBE = t3.hexToBytes = t3.hexToNumber = t3.numberToHexUnpadded = t3.bytesToHex = void 0; var a2 = BigInt(0), s2 = BigInt(1), u2 = BigInt(2), c2 = function(e4) { return e4 instanceof Uint8Array; }, f2 = Array.from({ length: 256 }, function(e4, t4) { return t4.toString(16).padStart(2, "0"); }); function d2(e4) { if (!c2(e4)) throw new Error("Uint8Array expected"); for (var t4 = "", r4 = 0; r4 < e4.length; r4++) t4 += f2[e4[r4]]; return t4; } function l2(e4) { var t4 = e4.toString(16); return 1 & t4.length ? "0".concat(t4) : t4; } function h2(e4) { if ("string" != typeof e4) throw new Error("hex string expected, got " + (0, o2.default)(e4)); return BigInt("" === e4 ? "0" : "0x".concat(e4)); } function p2(e4) { if ("string" != typeof e4) throw new Error("hex string expected, got " + (0, o2.default)(e4)); var t4 = e4.length; if (t4 % 2) throw new Error("padded hex string expected, got unpadded hex of length " + t4); for (var r4 = new Uint8Array(t4 / 2), n3 = 0; n3 < r4.length; n3++) { var i3 = 2 * n3, a3 = e4.slice(i3, i3 + 2), s3 = Number.parseInt(a3, 16); if (Number.isNaN(s3) || s3 < 0) throw new Error("Invalid byte sequence"); r4[n3] = s3; } return r4; } function b2(e4, t4) { return p2(e4.toString(16).padStart(2 * t4, "0")); } function y2() { for (var e4 = arguments.length, t4 = new Array(e4), r4 = 0; r4 < e4; r4++) t4[r4] = arguments[r4]; var n3 = new Uint8Array(t4.reduce(function(e5, t5) { return e5 + t5.length; }, 0)), i3 = 0; return t4.forEach(function(e5) { if (!c2(e5)) throw new Error("Uint8Array expected"); n3.set(e5, i3), i3 += e5.length; }), n3; } t3.bytesToHex = d2, t3.numberToHexUnpadded = l2, t3.hexToNumber = h2, t3.hexToBytes = p2, t3.bytesToNumberBE = function(e4) { return h2(d2(e4)); }, t3.bytesToNumberLE = function(e4) { if (!c2(e4)) throw new Error("Uint8Array expected"); return h2(d2(Uint8Array.from(e4).reverse())); }, t3.numberToBytesBE = b2, t3.numberToBytesLE = function(e4, t4) { return b2(e4, t4).reverse(); }, t3.numberToVarBytesBE = function(e4) { return p2(l2(e4)); }, t3.ensureBytes = function(e4, t4, r4) { var n3; if ("string" == typeof t4) try { n3 = p2(t4); } catch (r5) { throw new Error("".concat(e4, ' must be valid hex string, got "').concat(t4, '". Cause: ').concat(r5)); } else { if (!c2(t4)) throw new Error("".concat(e4, " must be hex string or Uint8Array")); n3 = Uint8Array.from(t4); } var i3 = n3.length; if ("number" == typeof r4 && i3 !== r4) throw new Error("".concat(e4, " expected ").concat(r4, " bytes, got ").concat(i3)); return n3; }, t3.concatBytes = y2, t3.equalBytes = function(e4, t4) { if (e4.length !== t4.length) return false; for (var r4 = 0; r4 < e4.length; r4++) if (e4[r4] !== t4[r4]) return false; return true; }, t3.utf8ToBytes = function(e4) { if ("string" != typeof e4) throw new Error("utf8ToBytes expected string, got ".concat((0, o2.default)(e4))); return new Uint8Array(new TextEncoder().encode(e4)); }, t3.bitLen = function(e4) { var t4; for (t4 = 0; e4 > a2; e4 >>= s2, t4 += 1) ; return t4; }, t3.bitGet = function(e4, t4) { return e4 >> BigInt(t4) & s2; }, t3.bitSet = function(e4, t4, r4) { return e4 | (r4 ? s2 : a2) << BigInt(t4); }, t3.bitMask = function(e4) { return (u2 << BigInt(e4 - 1)) - s2; }; var v2 = function(e4) { return new Uint8Array(e4); }, m2 = function(e4) { return Uint8Array.from(e4); }; t3.createHmacDrbg = function(e4, t4, r4) { if ("number" != typeof e4 || e4 < 2) throw new Error("hashLen must be a number"); if ("number" != typeof t4 || t4 < 2) throw new Error("qByteLen must be a number"); if ("function" != typeof r4) throw new Error("hmacFn must be a function"); var n3 = v2(e4), i3 = v2(e4), o3 = 0, a3 = function() { n3.fill(1), i3.fill(0), o3 = 0; }, s3 = function() { for (var e5 = arguments.length, t5 = new Array(e5), o4 = 0; o4 < e5; o4++) t5[o4] = arguments[o4]; return r4.apply(void 0, [i3, n3].concat(t5)); }, u3 = function() { var e5 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : v2(); i3 = s3(m2([0]), e5), n3 = s3(), 0 !== e5.length && (i3 = s3(m2([1]), e5), n3 = s3()); }, c3 = function() { if (o3++ >= 1e3) throw new Error("drbg: tried 1000 values"); for (var e5 = 0, r5 = []; e5 < t4; ) { var i4 = (n3 = s3()).slice(); r5.push(i4), e5 += n3.length; } return y2.apply(void 0, r5); }; return function(e5, t5) { a3(), u3(e5); for (var r5 = void 0; !(r5 = t5(c3())); ) u3(); return a3(), r5; }; }; var g2 = { bigint: function(e4) { return "bigint" == typeof e4; }, function: function(e4) { return "function" == typeof e4; }, boolean: function(e4) { return "boolean" == typeof e4; }, string: function(e4) { return "string" == typeof e4; }, isSafeInteger: function(e4) { return Number.isSafeInteger(e4); }, array: function(e4) { return Array.isArray(e4); }, field: function(e4, t4) { return t4.Fp.isValid(e4); }, hash: function(e4) { return "function" == typeof e4 && Number.isSafeInteger(e4.outputLen); } }; t3.validateObject = function(e4, t4) { for (var r4 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, n3 = function(t5, r5, n4) { var i3 = g2[r5]; if ("function" != typeof i3) throw new Error('Invalid validator "'.concat(r5, '", expected function')); var a4 = e4[t5]; if (!(n4 && void 0 === a4 || i3(a4, e4))) throw new Error("Invalid param ".concat(String(t5), "=").concat(a4, " (").concat((0, o2.default)(a4), "), expected ").concat(r5)); }, a3 = 0, s3 = Object.entries(t4); a3 < s3.length; a3++) { var u3 = (0, i2.default)(s3[a3], 2); n3(u3[0], u3[1], false); } for (var c3 = 0, f3 = Object.entries(r4); c3 < f3.length; c3++) { var d3 = (0, i2.default)(f3[c3], 2); n3(d3[0], d3[1], true); } return e4; }; }, 16573: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(58985)), o2 = n2(r3(69721)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)), c2 = n2(r3(22940)), f2 = n2(r3(90775)), d2 = n2(r3(3355)); function l2(e4, t4) { var r4 = Object.keys(e4); if (Object.getOwnPropertySymbols) { var n3 = Object.getOwnPropertySymbols(e4); t4 && (n3 = n3.filter(function(t5) { return Object.getOwnPropertyDescriptor(e4, t5).enumerable; })), r4.push.apply(r4, n3); } return r4; } function h2(e4) { for (var t4 = 1; t4 < arguments.length; t4++) { var r4 = null != arguments[t4] ? arguments[t4] : {}; t4 % 2 ? l2(Object(r4), true).forEach(function(t5) { (0, f2.default)(e4, t5, r4[t5]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(r4)) : l2(Object(r4)).forEach(function(t5) { Object.defineProperty(e4, t5, Object.getOwnPropertyDescriptor(r4, t5)); }); } return e4; } Object.defineProperty(t3, "__esModule", { value: true }), t3.mapToCurveSimpleSWU = t3.SWUFpSqrtRatio = t3.weierstrass = t3.weierstrassPoints = t3.DER = void 0; var p2 = r3(3970), b2 = r3(46928), y2 = r3(46928), v2 = r3(91813), m2 = b2.bytesToNumberBE, g2 = b2.hexToBytes; t3.DER = { Err: function(e4) { (0, a2.default)(c3, e4); var t4, r4, n3 = (t4 = c3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, u2.default)(t4); if (r4) { var i3 = (0, u2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, s2.default)(this, e5); }); function c3() { var e5 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""; return (0, o2.default)(this, c3), n3.call(this, e5); } return (0, i2.default)(c3); }((0, c2.default)(Error)), _parseInt: function(e4) { var r4 = t3.DER.Err; if (e4.length < 2 || 2 !== e4[0]) throw new r4("Invalid signature integer tag"); var n3 = e4[1], i3 = e4.subarray(2, n3 + 2); if (!n3 || i3.length !== n3) throw new r4("Invalid signature integer: wrong length"); if (128 & i3[0]) throw new r4("Invalid signature integer: negative"); if (0 === i3[0] && !(128 & i3[1])) throw new r4("Invalid signature integer: unnecessary leading zero"); return { d: m2(i3), l: e4.subarray(n3 + 2) }; }, toSig: function(e4) { var r4 = t3.DER.Err, n3 = "string" == typeof e4 ? g2(e4) : e4; if (!(n3 instanceof Uint8Array)) throw new Error("ui8a expected"); var i3 = n3.length; if (i3 < 2 || 48 != n3[0]) throw new r4("Invalid signature tag"); if (n3[1] !== i3 - 2) throw new r4("Invalid signature: incorrect length"); var o3 = t3.DER._parseInt(n3.subarray(2)), a3 = o3.d, s3 = o3.l, u3 = t3.DER._parseInt(s3), c3 = u3.d; if (u3.l.length) throw new r4("Invalid signature: left bytes after parsing"); return { r: a3, s: c3 }; }, hexFromSig: function(e4) { var t4 = function(e5) { return 8 & Number.parseInt(e5[0], 16) ? "00" + e5 : e5; }, r4 = function(e5) { var t5 = e5.toString(16); return 1 & t5.length ? "0".concat(t5) : t5; }, n3 = t4(r4(e4.s)), i3 = t4(r4(e4.r)), o3 = n3.length / 2, a3 = i3.length / 2, s3 = r4(o3), u3 = r4(a3); return "30".concat(r4(a3 + o3 + 4), "02").concat(u3).concat(i3, "02").concat(s3).concat(n3); } }; var w2 = BigInt(0), k2 = BigInt(1), _2 = BigInt(2), A2 = BigInt(3), E2 = BigInt(4); function S2(e4) { var t4 = function(e5) { var t5 = (0, v2.validateBasic)(e5); b2.validateObject(t5, { a: "field", b: "field" }, { allowedPrivateKeyLengths: "array", wrapPrivateKey: "boolean", isTorsionFree: "function", clearCofactor: "function", allowInfinityPoint: "boolean", fromBytes: "function", toBytes: "function" }); var r5 = t5.endo, n4 = t5.Fp, i3 = t5.a; if (r5) { if (!n4.eql(i3, n4.ZERO)) throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0"); if ("object" !== (0, d2.default)(r5) || "bigint" != typeof r5.beta || "function" != typeof r5.splitScalar) throw new Error("Expected endomorphism with beta: bigint and splitScalar: function"); } return Object.freeze(h2({}, t5)); }(e4), r4 = t4.Fp, n3 = t4.toBytes || function(e5, t5, n4) { var i3 = t5.toAffine(); return b2.concatBytes(Uint8Array.from([4]), r4.toBytes(i3.x), r4.toBytes(i3.y)); }, a3 = t4.fromBytes || function(e5) { var t5 = e5.subarray(1); return { x: r4.fromBytes(t5.subarray(0, r4.BYTES)), y: r4.fromBytes(t5.subarray(r4.BYTES, 2 * r4.BYTES)) }; }; function s3(e5) { var n4 = t4.a, i3 = t4.b, o3 = r4.sqr(e5), a4 = r4.mul(o3, e5); return r4.add(r4.add(a4, r4.mul(e5, n4)), i3); } if (!r4.eql(r4.sqr(t4.Gy), s3(t4.Gx))) throw new Error("bad generator point: equation left != right"); function u3(e5) { return "bigint" == typeof e5 && w2 < e5 && e5 < t4.n; } function c3(e5) { if (!u3(e5)) throw new Error("Expected valid bigint: 0 < bigint < curve.n"); } function f3(e5) { var r5, n4 = t4.allowedPrivateKeyLengths, i3 = t4.nByteLength, o3 = t4.wrapPrivateKey, a4 = t4.n; if (n4 && "bigint" != typeof e5) { if (e5 instanceof Uint8Array && (e5 = b2.bytesToHex(e5)), "string" != typeof e5 || !n4.includes(e5.length)) throw new Error("Invalid key"); e5 = e5.padStart(2 * i3, "0"); } try { r5 = "bigint" == typeof e5 ? e5 : b2.bytesToNumberBE((0, y2.ensureBytes)("private key", e5, i3)); } catch (t5) { throw new Error("private key must be ".concat(i3, " bytes, hex or bigint, not ").concat((0, d2.default)(e5))); } return o3 && (r5 = p2.mod(r5, a4)), c3(r5), r5; } var l3 = /* @__PURE__ */ new Map(); function m3(e5) { if (!(e5 instanceof g3)) throw new Error("ProjectivePoint expected"); } var g3 = function() { function e5(t5, n4, i3) { if ((0, o2.default)(this, e5), this.px = t5, this.py = n4, this.pz = i3, null == t5 || !r4.isValid(t5)) throw new Error("x required"); if (null == n4 || !r4.isValid(n4)) throw new Error("y required"); if (null == i3 || !r4.isValid(i3)) throw new Error("z required"); } return (0, i2.default)(e5, [{ key: "x", get: function() { return this.toAffine().x; } }, { key: "y", get: function() { return this.toAffine().y; } }, { key: "_setWindowSize", value: function(e6) { this._WINDOW_SIZE = e6, l3.delete(this); } }, { key: "assertValidity", value: function() { if (this.is0()) { if (t4.allowInfinityPoint) return; throw new Error("bad point: ZERO"); } var e6 = this.toAffine(), n4 = e6.x, i3 = e6.y; if (!r4.isValid(n4) || !r4.isValid(i3)) throw new Error("bad point: x or y not FE"); var o3 = r4.sqr(i3), a4 = s3(n4); if (!r4.eql(o3, a4)) throw new Error("bad point: equation left != right"); if (!this.isTorsionFree()) throw new Error("bad point: not in prime-order subgroup"); } }, { key: "hasEvenY", value: function() { var e6 = this.toAffine().y; if (r4.isOdd) return !r4.isOdd(e6); throw new Error("Field doesn't support isOdd"); } }, { key: "equals", value: function(e6) { m3(e6); var t5 = this.px, n4 = this.py, i3 = this.pz, o3 = e6.px, a4 = e6.py, s4 = e6.pz, u4 = r4.eql(r4.mul(t5, s4), r4.mul(o3, i3)), c4 = r4.eql(r4.mul(n4, s4), r4.mul(a4, i3)); return u4 && c4; } }, { key: "negate", value: function() { return new e5(this.px, r4.neg(this.py), this.pz); } }, { key: "double", value: function() { var n4 = t4.a, i3 = t4.b, o3 = r4.mul(i3, A2), a4 = this.px, s4 = this.py, u4 = this.pz, c4 = r4.ZERO, f4 = r4.ZERO, d3 = r4.ZERO, l4 = r4.mul(a4, a4), h3 = r4.mul(s4, s4), p3 = r4.mul(u4, u4), b3 = r4.mul(a4, s4); return b3 = r4.add(b3, b3), d3 = r4.mul(a4, u4), d3 = r4.add(d3, d3), c4 = r4.mul(n4, d3), f4 = r4.mul(o3, p3), f4 = r4.add(c4, f4), c4 = r4.sub(h3, f4), f4 = r4.add(h3, f4), f4 = r4.mul(c4, f4), c4 = r4.mul(b3, c4), d3 = r4.mul(o3, d3), p3 = r4.mul(n4, p3), b3 = r4.sub(l4, p3), b3 = r4.mul(n4, b3), b3 = r4.add(b3, d3), d3 = r4.add(l4, l4), l4 = r4.add(d3, l4), l4 = r4.add(l4, p3), l4 = r4.mul(l4, b3), f4 = r4.add(f4, l4), p3 = r4.mul(s4, u4), p3 = r4.add(p3, p3), l4 = r4.mul(p3, b3), c4 = r4.sub(c4, l4), d3 = r4.mul(p3, h3), d3 = r4.add(d3, d3), new e5(c4, f4, d3 = r4.add(d3, d3)); } }, { key: "add", value: function(n4) { m3(n4); var i3 = this.px, o3 = this.py, a4 = this.pz, s4 = n4.px, u4 = n4.py, c4 = n4.pz, f4 = r4.ZERO, d3 = r4.ZERO, l4 = r4.ZERO, h3 = t4.a, p3 = r4.mul(t4.b, A2), b3 = r4.mul(i3, s4), y3 = r4.mul(o3, u4), v3 = r4.mul(a4, c4), g4 = r4.add(i3, o3), w3 = r4.add(s4, u4); g4 = r4.mul(g4, w3), w3 = r4.add(b3, y3), g4 = r4.sub(g4, w3), w3 = r4.add(i3, a4); var k3 = r4.add(s4, c4); return w3 = r4.mul(w3, k3), k3 = r4.add(b3, v3), w3 = r4.sub(w3, k3), k3 = r4.add(o3, a4), f4 = r4.add(u4, c4), k3 = r4.mul(k3, f4), f4 = r4.add(y3, v3), k3 = r4.sub(k3, f4), l4 = r4.mul(h3, w3), f4 = r4.mul(p3, v3), l4 = r4.add(f4, l4), f4 = r4.sub(y3, l4), l4 = r4.add(y3, l4), d3 = r4.mul(f4, l4), y3 = r4.add(b3, b3), y3 = r4.add(y3, b3), v3 = r4.mul(h3, v3), w3 = r4.mul(p3, w3), y3 = r4.add(y3, v3), v3 = r4.sub(b3, v3), v3 = r4.mul(h3, v3), w3 = r4.add(w3, v3), b3 = r4.mul(y3, w3), d3 = r4.add(d3, b3), b3 = r4.mul(k3, w3), f4 = r4.mul(g4, f4), f4 = r4.sub(f4, b3), b3 = r4.mul(g4, y3), l4 = r4.mul(k3, l4), new e5(f4, d3, l4 = r4.add(l4, b3)); } }, { key: "subtract", value: function(e6) { return this.add(e6.negate()); } }, { key: "is0", value: function() { return this.equals(e5.ZERO); } }, { key: "wNAF", value: function(t5) { return E3.wNAFCached(this, l3, t5, function(t6) { var n4 = r4.invertBatch(t6.map(function(e6) { return e6.pz; })); return t6.map(function(e6, t7) { return e6.toAffine(n4[t7]); }).map(e5.fromAffine); }); } }, { key: "multiplyUnsafe", value: function(n4) { var i3 = e5.ZERO; if (n4 === w2) return i3; if (c3(n4), n4 === k2) return this; var o3 = t4.endo; if (!o3) return E3.unsafeLadder(this, n4); for (var a4 = o3.splitScalar(n4), s4 = a4.k1neg, u4 = a4.k1, f4 = a4.k2neg, d3 = a4.k2, l4 = i3, h3 = i3, p3 = this; u4 > w2 || d3 > w2; ) u4 & k2 && (l4 = l4.add(p3)), d3 & k2 && (h3 = h3.add(p3)), p3 = p3.double(), u4 >>= k2, d3 >>= k2; return s4 && (l4 = l4.negate()), f4 && (h3 = h3.negate()), h3 = new e5(r4.mul(h3.px, o3.beta), h3.py, h3.pz), l4.add(h3); } }, { key: "multiply", value: function(n4) { c3(n4); var i3, o3, a4 = n4, s4 = t4.endo; if (s4) { var u4 = s4.splitScalar(a4), f4 = u4.k1neg, d3 = u4.k1, l4 = u4.k2neg, h3 = u4.k2, p3 = this.wNAF(d3), b3 = p3.p, y3 = p3.f, v3 = this.wNAF(h3), m4 = v3.p, g4 = v3.f; b3 = E3.constTimeNegate(f4, b3), m4 = E3.constTimeNegate(l4, m4), m4 = new e5(r4.mul(m4.px, s4.beta), m4.py, m4.pz), i3 = b3.add(m4), o3 = y3.add(g4); } else { var w3 = this.wNAF(a4); i3 = w3.p, o3 = w3.f; } return e5.normalizeZ([i3, o3])[0]; } }, { key: "multiplyAndAddUnsafe", value: function(t5, r5, n4) { var i3 = e5.BASE, o3 = function(e6, t6) { return t6 !== w2 && t6 !== k2 && e6.equals(i3) ? e6.multiply(t6) : e6.multiplyUnsafe(t6); }, a4 = o3(this, r5).add(o3(t5, n4)); return a4.is0() ? void 0 : a4; } }, { key: "toAffine", value: function(e6) { var t5 = this.px, n4 = this.py, i3 = this.pz, o3 = this.is0(); null == e6 && (e6 = o3 ? r4.ONE : r4.inv(i3)); var a4 = r4.mul(t5, e6), s4 = r4.mul(n4, e6), u4 = r4.mul(i3, e6); if (o3) return { x: r4.ZERO, y: r4.ZERO }; if (!r4.eql(u4, r4.ONE)) throw new Error("invZ was invalid"); return { x: a4, y: s4 }; } }, { key: "isTorsionFree", value: function() { var r5 = t4.h, n4 = t4.isTorsionFree; if (r5 === k2) return true; if (n4) return n4(e5, this); throw new Error("isTorsionFree() has not been declared for the elliptic curve"); } }, { key: "clearCofactor", value: function() { var r5 = t4.h, n4 = t4.clearCofactor; return r5 === k2 ? this : n4 ? n4(e5, this) : this.multiplyUnsafe(t4.h); } }, { key: "toRawBytes", value: function() { var t5 = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; return this.assertValidity(), n3(e5, this, t5); } }, { key: "toHex", value: function() { var e6 = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; return b2.bytesToHex(this.toRawBytes(e6)); } }], [{ key: "fromAffine", value: function(t5) { var n4 = t5 || {}, i3 = n4.x, o3 = n4.y; if (!t5 || !r4.isValid(i3) || !r4.isValid(o3)) throw new Error("invalid affine point"); if (t5 instanceof e5) throw new Error("projective point not allowed"); var a4 = function(e6) { return r4.eql(e6, r4.ZERO); }; return a4(i3) && a4(o3) ? e5.ZERO : new e5(i3, o3, r4.ONE); } }, { key: "normalizeZ", value: function(t5) { var n4 = r4.invertBatch(t5.map(function(e6) { return e6.pz; })); return t5.map(function(e6, t6) { return e6.toAffine(n4[t6]); }).map(e5.fromAffine); } }, { key: "fromHex", value: function(t5) { var r5 = e5.fromAffine(a3((0, y2.ensureBytes)("pointHex", t5))); return r5.assertValidity(), r5; } }, { key: "fromPrivateKey", value: function(t5) { return e5.BASE.multiply(f3(t5)); } }]), e5; }(); g3.BASE = new g3(t4.Gx, t4.Gy, r4.ONE), g3.ZERO = new g3(r4.ZERO, r4.ONE, r4.ZERO); var _3 = t4.nBitLength, E3 = (0, v2.wNAF)(g3, t4.endo ? Math.ceil(_3 / 2) : _3); return { CURVE: t4, ProjectivePoint: g3, normPrivateKeyToScalar: f3, weierstrassEquation: s3, isWithinCurveOrder: u3 }; } function x2(e4, t4) { for (var r4 = e4.ORDER, n3 = w2, i3 = r4 - k2; i3 % _2 === w2; i3 /= _2) n3 += k2; var o3 = n3, a3 = _2 << o3 - k2 - k2, s3 = a3 * _2, u3 = (r4 - k2) / s3, c3 = (u3 - k2) / _2, f3 = s3 - k2, d3 = a3, l3 = e4.pow(t4, u3), h3 = e4.pow(t4, (u3 + k2) / _2), p3 = function(t5, r5) { var n4 = l3, i4 = e4.pow(r5, f3), a4 = e4.sqr(i4); a4 = e4.mul(a4, r5); var s4 = e4.mul(t5, a4); s4 = e4.pow(s4, c3), s4 = e4.mul(s4, i4), i4 = e4.mul(s4, r5), a4 = e4.mul(s4, t5); var u4 = e4.mul(a4, i4); s4 = e4.pow(u4, d3); var p4 = e4.eql(s4, e4.ONE); i4 = e4.mul(a4, h3), s4 = e4.mul(u4, n4), a4 = e4.cmov(i4, a4, p4), u4 = e4.cmov(s4, u4, p4); for (var b4 = o3; b4 > k2; b4--) { var y4 = b4 - _2; y4 = _2 << y4 - k2; var v3 = e4.pow(u4, y4), m3 = e4.eql(v3, e4.ONE); i4 = e4.mul(a4, n4), n4 = e4.mul(n4, n4), v3 = e4.mul(u4, n4), a4 = e4.cmov(i4, a4, m3), u4 = e4.cmov(v3, u4, m3); } return { isValid: p4, value: a4 }; }; if (e4.ORDER % E2 === A2) { var b3 = (e4.ORDER - A2) / E2, y3 = e4.sqrt(e4.neg(t4)); p3 = function(t5, r5) { var n4 = e4.sqr(r5), i4 = e4.mul(t5, r5); n4 = e4.mul(n4, i4); var o4 = e4.pow(n4, b3); o4 = e4.mul(o4, i4); var a4 = e4.mul(o4, y3), s4 = e4.mul(e4.sqr(o4), r5), u4 = e4.eql(s4, t5); return { isValid: u4, value: e4.cmov(a4, o4, u4) }; }; } return p3; } t3.weierstrassPoints = S2, t3.weierstrass = function(e4) { var r4, n3, a3 = (r4 = e4, n3 = (0, v2.validateBasic)(r4), b2.validateObject(n3, { hash: "hash", hmac: "function", randomBytes: "function" }, { bits2int: "function", bits2int_modN: "function", lowS: "boolean" }), Object.freeze(h2({ lowS: true }, n3))), s3 = a3.Fp, u3 = a3.n, c3 = s3.BYTES + 1, f3 = 2 * s3.BYTES + 1; function l3(e5) { return p2.mod(e5, u3); } function m3(e5) { return p2.invert(e5, u3); } var g3 = S2(h2(h2({}, a3), {}, { toBytes: function(e5, t4, r5) { var n4 = t4.toAffine(), i3 = s3.toBytes(n4.x), o3 = b2.concatBytes; return r5 ? o3(Uint8Array.from([t4.hasEvenY() ? 2 : 3]), i3) : o3(Uint8Array.from([4]), i3, s3.toBytes(n4.y)); }, fromBytes: function(e5) { var t4 = e5.length, r5 = e5[0], n4 = e5.subarray(1); if (t4 !== c3 || 2 !== r5 && 3 !== r5) { if (t4 === f3 && 4 === r5) return { x: s3.fromBytes(n4.subarray(0, s3.BYTES)), y: s3.fromBytes(n4.subarray(s3.BYTES, 2 * s3.BYTES)) }; throw new Error("Point of length ".concat(t4, " was invalid. Expected ").concat(c3, " compressed bytes or ").concat(f3, " uncompressed bytes")); } var i3 = b2.bytesToNumberBE(n4); if (!(w2 < (o3 = i3) && o3 < s3.ORDER)) throw new Error("Point is not on curve"); var o3, a4 = E3(i3), u4 = s3.sqrt(a4); return 1 == (1 & r5) != ((u4 & k2) === k2) && (u4 = s3.neg(u4)), { x: i3, y: u4 }; } })), _3 = g3.ProjectivePoint, A3 = g3.normPrivateKeyToScalar, E3 = g3.weierstrassEquation, x3 = g3.isWithinCurveOrder, B2 = function(e5) { return b2.bytesToHex(b2.numberToBytesBE(e5, a3.nByteLength)); }; function O2(e5) { return e5 > u3 >> k2; } var P2 = function(e5, t4, r5) { return b2.bytesToNumberBE(e5.slice(t4, r5)); }, I2 = function() { function e5(t4, r5, n4) { (0, o2.default)(this, e5), this.r = t4, this.s = r5, this.recovery = n4, this.assertValidity(); } return (0, i2.default)(e5, [{ key: "assertValidity", value: function() { if (!x3(this.r)) throw new Error("r must be 0 < r < CURVE.n"); if (!x3(this.s)) throw new Error("s must be 0 < s < CURVE.n"); } }, { key: "addRecoveryBit", value: function(t4) { return new e5(this.r, this.s, t4); } }, { key: "recoverPublicKey", value: function(e6) { var t4 = this.r, r5 = this.s, n4 = this.recovery, i3 = R2((0, y2.ensureBytes)("msgHash", e6)); if (null == n4 || ![0, 1, 2, 3].includes(n4)) throw new Error("recovery id invalid"); var o3 = 2 === n4 || 3 === n4 ? t4 + a3.n : t4; if (o3 >= s3.ORDER) throw new Error("recovery id 2 or 3 invalid"); var u4 = 0 == (1 & n4) ? "02" : "03", c4 = _3.fromHex(u4 + B2(o3)), f4 = m3(o3), d3 = l3(-i3 * f4), h3 = l3(r5 * f4), p3 = _3.BASE.multiplyAndAddUnsafe(c4, d3, h3); if (!p3) throw new Error("point at infinify"); return p3.assertValidity(), p3; } }, { key: "hasHighS", value: function() { return O2(this.s); } }, { key: "normalizeS", value: function() { return this.hasHighS() ? new e5(this.r, l3(-this.s), this.recovery) : this; } }, { key: "toDERRawBytes", value: function() { return b2.hexToBytes(this.toDERHex()); } }, { key: "toDERHex", value: function() { return t3.DER.hexFromSig({ r: this.r, s: this.s }); } }, { key: "toCompactRawBytes", value: function() { return b2.hexToBytes(this.toCompactHex()); } }, { key: "toCompactHex", value: function() { return B2(this.r) + B2(this.s); } }], [{ key: "fromCompact", value: function(t4) { var r5 = a3.nByteLength; return t4 = (0, y2.ensureBytes)("compactSignature", t4, 2 * r5), new e5(P2(t4, 0, r5), P2(t4, r5, 2 * r5)); } }, { key: "fromDER", value: function(r5) { var n4 = t3.DER.toSig((0, y2.ensureBytes)("DER", r5)); return new e5(n4.r, n4.s); } }]), e5; }(), T2 = { isValidPrivateKey: function(e5) { try { return A3(e5), true; } catch (e6) { return false; } }, normPrivateKeyToScalar: A3, randomPrivateKey: function() { var e5 = a3.randomBytes(s3.BYTES + 8), t4 = p2.hashToPrivateScalar(e5, u3); return b2.numberToBytesBE(t4, a3.nByteLength); }, precompute: function() { var e5 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 8, t4 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : _3.BASE; return t4._setWindowSize(e5), t4.multiply(BigInt(3)), t4; } }; function C2(e5) { var t4 = e5 instanceof Uint8Array, r5 = "string" == typeof e5, n4 = (t4 || r5) && e5.length; return t4 ? n4 === c3 || n4 === f3 : r5 ? n4 === 2 * c3 || n4 === 2 * f3 : e5 instanceof _3; } var M2 = a3.bits2int || function(e5) { var t4 = b2.bytesToNumberBE(e5), r5 = 8 * e5.length - a3.nBitLength; return r5 > 0 ? t4 >> BigInt(r5) : t4; }, R2 = a3.bits2int_modN || function(e5) { return l3(M2(e5)); }, U2 = b2.bitMask(a3.nBitLength); function N2(e5) { if ("bigint" != typeof e5) throw new Error("bigint expected"); if (!(w2 <= e5 && e5 < U2)) throw new Error("bigint expected < 2^".concat(a3.nBitLength)); return b2.numberToBytesBE(e5, a3.nByteLength); } var j2 = { lowS: a3.lowS, prehash: false }, L2 = { lowS: a3.lowS, prehash: false }; return _3.BASE._setWindowSize(8), { CURVE: a3, getPublicKey: function(e5) { var t4 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; return _3.fromPrivateKey(e5).toRawBytes(t4); }, getSharedSecret: function(e5, t4) { var r5 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]; if (C2(e5)) throw new Error("first arg must be private key"); if (!C2(t4)) throw new Error("second arg must be public key"); return _3.fromHex(t4).multiply(A3(e5)).toRawBytes(r5); }, sign: function(e5, t4) { var r5 = function(e6, t5) { var r6 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : j2; if (["recovered", "canonical"].some(function(e7) { return e7 in r6; })) throw new Error("sign() legacy options not supported"); var n5 = a3.hash, i4 = a3.randomBytes, o4 = r6.lowS, u4 = r6.prehash, c4 = r6.extraEntropy; null == o4 && (o4 = true), e6 = (0, y2.ensureBytes)("msgHash", e6), u4 && (e6 = (0, y2.ensureBytes)("prehashed msgHash", n5(e6))); var f4 = R2(e6), d3 = A3(t5), h3 = [N2(d3), N2(f4)]; if (null != c4) { var p3 = true === c4 ? i4(s3.BYTES) : c4; h3.push((0, y2.ensureBytes)("extraEntropy", p3, s3.BYTES)); } var v3 = b2.concatBytes.apply(b2, h3), g4 = f4; return { seed: v3, k2sig: function(e7) { var t6 = M2(e7); if (x3(t6)) { var r7 = m3(t6), n6 = _3.BASE.multiply(t6).toAffine(), i5 = l3(n6.x); if (i5 !== w2) { var a4 = l3(r7 * l3(g4 + i5 * d3)); if (a4 !== w2) { var s4 = (n6.x === i5 ? 0 : 2) | Number(n6.y & k2), u5 = a4; return o4 && O2(a4) && (u5 = function(e8) { return O2(e8) ? l3(-e8) : e8; }(a4), s4 ^= 1), new I2(i5, u5, s4); } } } } }; }(e5, t4, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : j2), n4 = r5.seed, i3 = r5.k2sig, o3 = a3; return b2.createHmacDrbg(o3.hash.outputLen, o3.nByteLength, o3.hmac)(n4, i3); }, verify: function(e5, r5, n4) { var i3, o3 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : L2, s4 = e5; if (r5 = (0, y2.ensureBytes)("msgHash", r5), n4 = (0, y2.ensureBytes)("publicKey", n4), "strict" in o3) throw new Error("options.strict was renamed to lowS"); var u4, c4 = o3.lowS, f4 = o3.prehash, h3 = void 0; try { if ("string" == typeof s4 || s4 instanceof Uint8Array) try { h3 = I2.fromDER(s4); } catch (e6) { if (!(e6 instanceof t3.DER.Err)) throw e6; h3 = I2.fromCompact(s4); } else { if ("object" !== (0, d2.default)(s4) || "bigint" != typeof s4.r || "bigint" != typeof s4.s) throw new Error("PARSE"); var p3 = s4.r, b3 = s4.s; h3 = new I2(p3, b3); } u4 = _3.fromHex(n4); } catch (e6) { if ("PARSE" === e6.message) throw new Error("signature must be Signature instance, Uint8Array or hex string"); return false; } if (c4 && h3.hasHighS()) return false; f4 && (r5 = a3.hash(r5)); var v3 = h3, g4 = v3.r, w3 = v3.s, k3 = R2(r5), A4 = m3(w3), E4 = l3(k3 * A4), S3 = l3(g4 * A4), x4 = null === (i3 = _3.BASE.multiplyAndAddUnsafe(u4, E4, S3)) || void 0 === i3 ? void 0 : i3.toAffine(); return !!x4 && l3(x4.x) === g4; }, ProjectivePoint: _3, Signature: I2, utils: T2 }; }, t3.SWUFpSqrtRatio = x2, t3.mapToCurveSimpleSWU = function(e4, t4) { if (p2.validateField(e4), !e4.isValid(t4.A) || !e4.isValid(t4.B) || !e4.isValid(t4.Z)) throw new Error("mapToCurveSimpleSWU: invalid opts"); var r4 = x2(e4, t4.Z); if (!e4.isOdd) throw new Error("Fp.isOdd is not implemented!"); return function(n3) { var i3, o3, a3, s3, u3, c3, f3, d3; i3 = e4.sqr(n3), i3 = e4.mul(i3, t4.Z), o3 = e4.sqr(i3), o3 = e4.add(o3, i3), a3 = e4.add(o3, e4.ONE), a3 = e4.mul(a3, t4.B), s3 = e4.cmov(t4.Z, e4.neg(o3), !e4.eql(o3, e4.ZERO)), s3 = e4.mul(s3, t4.A), o3 = e4.sqr(a3), c3 = e4.sqr(s3), u3 = e4.mul(c3, t4.A), o3 = e4.add(o3, u3), o3 = e4.mul(o3, a3), c3 = e4.mul(c3, s3), u3 = e4.mul(c3, t4.B), o3 = e4.add(o3, u3), f3 = e4.mul(i3, a3); var l3 = r4(o3, c3), h3 = l3.isValid, p3 = l3.value; d3 = e4.mul(i3, n3), d3 = e4.mul(d3, p3), f3 = e4.cmov(f3, a3, h3), d3 = e4.cmov(d3, p3, h3); var b3 = e4.isOdd(n3) === e4.isOdd(d3); return d3 = e4.cmov(e4.neg(d3), d3, b3), { x: f3 = e4.div(f3, s3), y: d3 }; }; }; }, 4158: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.encodeToCurve = t3.hashToCurve = t3.schnorr = t3.secp256k1 = void 0; var n2 = r3(61241), i2 = r3(72434), o2 = r3(3970), a2 = r3(16573), s2 = r3(46928), u2 = r3(19751), c2 = r3(96546), f2 = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), d2 = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), l2 = BigInt(1), h2 = BigInt(2), p2 = function(e4, t4) { return (e4 + t4 / h2) / t4; }; function b2(e4) { var t4 = f2, r4 = BigInt(3), n3 = BigInt(6), i3 = BigInt(11), a3 = BigInt(22), s3 = BigInt(23), u3 = BigInt(44), c3 = BigInt(88), d3 = e4 * e4 * e4 % t4, l3 = d3 * d3 * e4 % t4, p3 = (0, o2.pow2)(l3, r4, t4) * l3 % t4, b3 = (0, o2.pow2)(p3, r4, t4) * l3 % t4, v3 = (0, o2.pow2)(b3, h2, t4) * d3 % t4, m3 = (0, o2.pow2)(v3, i3, t4) * v3 % t4, g3 = (0, o2.pow2)(m3, a3, t4) * m3 % t4, w3 = (0, o2.pow2)(g3, u3, t4) * g3 % t4, k3 = (0, o2.pow2)(w3, c3, t4) * w3 % t4, _3 = (0, o2.pow2)(k3, u3, t4) * g3 % t4, A3 = (0, o2.pow2)(_3, r4, t4) * l3 % t4, E3 = (0, o2.pow2)(A3, s3, t4) * m3 % t4, S3 = (0, o2.pow2)(E3, n3, t4) * d3 % t4, x3 = (0, o2.pow2)(S3, h2, t4); if (!y2.eql(y2.sqr(x3), e4)) throw new Error("Cannot find square root"); return x3; } var y2 = (0, o2.Field)(f2, void 0, void 0, { sqrt: b2 }); t3.secp256k1 = (0, c2.createCurve)({ a: BigInt(0), b: BigInt(7), Fp: y2, n: d2, Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"), Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"), h: BigInt(1), lowS: true, endo: { beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"), splitScalar: function(e4) { var t4 = d2, r4 = BigInt("0x3086d221a7d46bcde86c90e49284eb15"), n3 = -l2 * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"), i3 = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), a3 = r4, s3 = BigInt("0x100000000000000000000000000000000"), u3 = p2(a3 * e4, t4), c3 = p2(-n3 * e4, t4), f3 = (0, o2.mod)(e4 - u3 * r4 - c3 * i3, t4), h3 = (0, o2.mod)(-u3 * n3 - c3 * a3, t4), b3 = f3 > s3, y3 = h3 > s3; if (b3 && (f3 = t4 - f3), y3 && (h3 = t4 - h3), f3 > s3 || h3 > s3) throw new Error("splitScalar: Endomorphism failed, k=" + e4); return { k1neg: b3, k1: f3, k2neg: y3, k2: h3 }; } } }, n2.sha256); var v2 = BigInt(0), m2 = function(e4) { return "bigint" == typeof e4 && v2 < e4 && e4 < f2; }, g2 = function(e4) { return "bigint" == typeof e4 && v2 < e4 && e4 < d2; }, w2 = {}; function k2(e4) { var t4 = w2[e4]; if (void 0 === t4) { var r4 = (0, n2.sha256)(Uint8Array.from(e4, function(e5) { return e5.charCodeAt(0); })); t4 = (0, s2.concatBytes)(r4, r4), w2[e4] = t4; } for (var i3 = arguments.length, o3 = new Array(i3 > 1 ? i3 - 1 : 0), a3 = 1; a3 < i3; a3++) o3[a3 - 1] = arguments[a3]; return (0, n2.sha256)(s2.concatBytes.apply(void 0, [t4].concat(o3))); } var _2 = function(e4) { return e4.toRawBytes(true).slice(1); }, A2 = function(e4) { return (0, s2.numberToBytesBE)(e4, 32); }, E2 = function(e4) { return (0, o2.mod)(e4, f2); }, S2 = function(e4) { return (0, o2.mod)(e4, d2); }, x2 = t3.secp256k1.ProjectivePoint, B2 = function(e4, t4, r4) { return x2.BASE.multiplyAndAddUnsafe(e4, t4, r4); }; function O2(e4) { var r4 = t3.secp256k1.utils.normPrivateKeyToScalar(e4), n3 = x2.fromPrivateKey(r4); return { scalar: n3.hasEvenY() ? r4 : S2(-r4), bytes: _2(n3) }; } function P2(e4) { if (!m2(e4)) throw new Error("bad x: need 0 < x < p"); var t4 = E2(e4 * e4), r4 = b2(E2(t4 * e4 + BigInt(7))); r4 % h2 !== v2 && (r4 = E2(-r4)); var n3 = new x2(e4, r4, l2); return n3.assertValidity(), n3; } function I2() { for (var e4 = arguments.length, t4 = new Array(e4), r4 = 0; r4 < e4; r4++) t4[r4] = arguments[r4]; return S2((0, s2.bytesToNumberBE)(k2.apply(void 0, ["BIP0340/challenge"].concat(t4)))); } function T2(e4, t4, r4) { var n3 = (0, s2.ensureBytes)("signature", e4, 64), i3 = (0, s2.ensureBytes)("message", t4), o3 = (0, s2.ensureBytes)("publicKey", r4, 32); try { var a3 = P2((0, s2.bytesToNumberBE)(o3)), u3 = (0, s2.bytesToNumberBE)(n3.subarray(0, 32)); if (!m2(u3)) return false; var c3 = (0, s2.bytesToNumberBE)(n3.subarray(32, 64)); if (!g2(c3)) return false; var f3 = I2(A2(u3), _2(a3), i3), d3 = B2(a3, c3, S2(-f3)); return !(!d3 || !d3.hasEvenY() || d3.toAffine().x !== u3); } catch (e5) { return false; } } t3.schnorr = { getPublicKey: function(e4) { return O2(e4).bytes; }, sign: function(e4, t4) { var r4 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : (0, i2.randomBytes)(32), n3 = (0, s2.ensureBytes)("message", e4), o3 = O2(t4), a3 = o3.bytes, u3 = o3.scalar, c3 = (0, s2.ensureBytes)("auxRand", r4, 32), f3 = A2(u3 ^ (0, s2.bytesToNumberBE)(k2("BIP0340/aux", c3))), d3 = k2("BIP0340/nonce", f3, a3, n3), l3 = S2((0, s2.bytesToNumberBE)(d3)); if (l3 === v2) throw new Error("sign failed: k is zero"); var h3 = O2(l3), p3 = h3.bytes, b3 = h3.scalar, y3 = I2(p3, a3, n3), m3 = new Uint8Array(64); if (m3.set(p3, 0), m3.set(A2(S2(b3 + y3 * u3)), 32), !T2(m3, n3, a3)) throw new Error("sign: Invalid signature produced"); return m3; }, verify: T2, utils: { randomPrivateKey: t3.secp256k1.utils.randomPrivateKey, lift_x: P2, pointToBytes: _2, numberToBytesBE: s2.numberToBytesBE, bytesToNumberBE: s2.bytesToNumberBE, taggedHash: k2, mod: o2.mod } }; var C2 = function() { return (0, u2.isogenyMap)(y2, [["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7", "0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581", "0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262", "0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"], ["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b", "0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14", "0x0000000000000000000000000000000000000000000000000000000000000001"], ["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c", "0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3", "0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931", "0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"], ["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b", "0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573", "0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f", "0x0000000000000000000000000000000000000000000000000000000000000001"]].map(function(e4) { return e4.map(function(e5) { return BigInt(e5); }); })); }(), M2 = function() { return (0, a2.mapToCurveSimpleSWU)(y2, { A: BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"), B: BigInt("1771"), Z: y2.create(BigInt("-11")) }); }(), R2 = function() { return (0, u2.createHasher)(t3.secp256k1.ProjectivePoint, function(e4) { var t4 = M2(y2.create(e4[0])), r4 = t4.x, n3 = t4.y; return C2(r4, n3); }, { DST: "secp256k1_XMD:SHA-256_SSWU_RO_", encodeDST: "secp256k1_XMD:SHA-256_SSWU_NU_", p: y2.ORDER, m: 1, k: 128, expand: "xmd", hash: n2.sha256 }); }(); t3.hashToCurve = R2.hashToCurve, t3.encodeToCurve = R2.encodeToCurve; }, 96822: (e3, t3) => { function r3(e4) { if (!Number.isSafeInteger(e4) || e4 < 0) throw new Error("Wrong positive integer: ".concat(e4)); } function n2(e4) { if ("boolean" != typeof e4) throw new Error("Expected boolean, not ".concat(e4)); } function i2(e4) { if (!(e4 instanceof Uint8Array)) throw new Error("Expected Uint8Array"); for (var t4 = arguments.length, r4 = new Array(t4 > 1 ? t4 - 1 : 0), n3 = 1; n3 < t4; n3++) r4[n3 - 1] = arguments[n3]; if (r4.length > 0 && !r4.includes(e4.length)) throw new Error("Expected Uint8Array of length ".concat(r4, ", not of length=").concat(e4.length)); } function o2(e4) { if ("function" != typeof e4 || "function" != typeof e4.create) throw new Error("Hash should be wrapped by utils.wrapConstructor"); r3(e4.outputLen), r3(e4.blockLen); } function a2(e4) { var t4 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; if (e4.destroyed) throw new Error("Hash instance has been destroyed"); if (t4 && e4.finished) throw new Error("Hash#digest() has already been called"); } function s2(e4, t4) { i2(e4); var r4 = t4.outputLen; if (e4.length < r4) throw new Error("digestInto() expects output buffer of length at least ".concat(r4)); } Object.defineProperty(t3, "__esModule", { value: true }), t3.output = t3.exists = t3.hash = t3.bytes = t3.bool = t3.number = void 0, t3.number = r3, t3.bool = n2, t3.bytes = i2, t3.hash = o2, t3.exists = a2, t3.output = s2; var u2 = { number: r3, bool: n2, bytes: i2, hash: o2, exists: a2, output: s2 }; t3.default = u2; }, 20330: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(93106)), o2 = n2(r3(69721)), a2 = n2(r3(58985)), s2 = n2(r3(15163)), u2 = n2(r3(34650)), c2 = n2(r3(21949)); Object.defineProperty(t3, "__esModule", { value: true }), t3.SHA2 = void 0; var f2 = r3(96822), d2 = r3(72434), l2 = function(e4) { (0, s2.default)(l3, e4); var t4, r4, n3 = (t4 = l3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, c2.default)(t4); if (r4) { var i3 = (0, c2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, u2.default)(this, e5); }); function l3(e5, t5, r5, i3) { var a3; return (0, o2.default)(this, l3), (a3 = n3.call(this)).blockLen = e5, a3.outputLen = t5, a3.padOffset = r5, a3.isLE = i3, a3.finished = false, a3.length = 0, a3.pos = 0, a3.destroyed = false, a3.buffer = new Uint8Array(e5), a3.view = (0, d2.createView)(a3.buffer), a3; } return (0, a2.default)(l3, [{ key: "update", value: function(e5) { f2.default.exists(this); for (var t5 = this.view, r5 = this.buffer, n4 = this.blockLen, i3 = (e5 = (0, d2.toBytes)(e5)).length, o3 = 0; o3 < i3; ) { var a3 = Math.min(n4 - this.pos, i3 - o3); if (a3 !== n4) r5.set(e5.subarray(o3, o3 + a3), this.pos), this.pos += a3, o3 += a3, this.pos === n4 && (this.process(t5, 0), this.pos = 0); else for (var s3 = (0, d2.createView)(e5); n4 <= i3 - o3; o3 += n4) this.process(s3, o3); } return this.length += e5.length, this.roundClean(), this; } }, { key: "digestInto", value: function(e5) { f2.default.exists(this), f2.default.output(e5, this), this.finished = true; var t5 = this.buffer, r5 = this.view, n4 = this.blockLen, i3 = this.isLE, o3 = this.pos; t5[o3++] = 128, this.buffer.subarray(o3).fill(0), this.padOffset > n4 - o3 && (this.process(r5, 0), o3 = 0); for (var a3 = o3; a3 < n4; a3++) t5[a3] = 0; !function(e6, t6, r6, n5) { if ("function" == typeof e6.setBigUint64) return e6.setBigUint64(t6, r6, n5); var i4 = BigInt(32), o4 = BigInt(4294967295), a4 = Number(r6 >> i4 & o4), s4 = Number(r6 & o4), u4 = n5 ? 4 : 0, c4 = n5 ? 0 : 4; e6.setUint32(t6 + u4, a4, n5), e6.setUint32(t6 + c4, s4, n5); }(r5, n4 - 8, BigInt(8 * this.length), i3), this.process(r5, 0); var s3 = (0, d2.createView)(e5), u3 = this.outputLen; if (u3 % 4) throw new Error("_sha2: outputLen should be aligned to 32bit"); var c3 = u3 / 4, l4 = this.get(); if (c3 > l4.length) throw new Error("_sha2: outputLen bigger than state"); for (var h2 = 0; h2 < c3; h2++) s3.setUint32(4 * h2, l4[h2], i3); } }, { key: "digest", value: function() { var e5 = this.buffer, t5 = this.outputLen; this.digestInto(e5); var r5 = e5.slice(0, t5); return this.destroy(), r5; } }, { key: "_cloneInto", value: function(e5) { var t5; e5 || (e5 = new this.constructor()), (t5 = e5).set.apply(t5, (0, i2.default)(this.get())); var r5 = this.blockLen, n4 = this.buffer, o3 = this.length, a3 = this.finished, s3 = this.destroyed, u3 = this.pos; return e5.length = o3, e5.pos = u3, e5.finished = a3, e5.destroyed = s3, o3 % r5 && e5.buffer.set(n4), e5; } }]), l3; }(d2.Hash); t3.SHA2 = l2; }, 64356: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.add = t3.toBig = t3.split = t3.fromBig = void 0; var r3 = BigInt(Math.pow(2, 32) - 1), n2 = BigInt(32); function i2(e4) { return arguments.length > 1 && void 0 !== arguments[1] && arguments[1] ? { h: Number(e4 & r3), l: Number(e4 >> n2 & r3) } : { h: 0 | Number(e4 >> n2 & r3), l: 0 | Number(e4 & r3) }; } function o2(e4) { for (var t4 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], r4 = new Uint32Array(e4.length), n3 = new Uint32Array(e4.length), o3 = 0; o3 < e4.length; o3++) { var a3 = i2(e4[o3], t4), s3 = [a3.h, a3.l]; r4[o3] = s3[0], n3[o3] = s3[1]; } return [r4, n3]; } function a2(e4, t4, r4, n3) { var i3 = (t4 >>> 0) + (n3 >>> 0); return { h: e4 + r4 + (i3 / Math.pow(2, 32) | 0) | 0, l: 0 | i3 }; } t3.fromBig = i2, t3.split = o2, t3.toBig = function(e4, t4) { return BigInt(e4 >>> 0) << n2 | BigInt(t4 >>> 0); }, t3.add = a2; var s2 = { fromBig: i2, split: o2, toBig: t3.toBig, shrSH: function(e4, t4, r4) { return e4 >>> r4; }, shrSL: function(e4, t4, r4) { return e4 << 32 - r4 | t4 >>> r4; }, rotrSH: function(e4, t4, r4) { return e4 >>> r4 | t4 << 32 - r4; }, rotrSL: function(e4, t4, r4) { return e4 << 32 - r4 | t4 >>> r4; }, rotrBH: function(e4, t4, r4) { return e4 << 64 - r4 | t4 >>> r4 - 32; }, rotrBL: function(e4, t4, r4) { return e4 >>> r4 - 32 | t4 << 64 - r4; }, rotr32H: function(e4, t4) { return t4; }, rotr32L: function(e4, t4) { return e4; }, rotlSH: function(e4, t4, r4) { return e4 << r4 | t4 >>> 32 - r4; }, rotlSL: function(e4, t4, r4) { return t4 << r4 | e4 >>> 32 - r4; }, rotlBH: function(e4, t4, r4) { return t4 << r4 - 32 | e4 >>> 64 - r4; }, rotlBL: function(e4, t4, r4) { return e4 << r4 - 32 | t4 >>> 64 - r4; }, add: a2, add3L: function(e4, t4, r4) { return (e4 >>> 0) + (t4 >>> 0) + (r4 >>> 0); }, add3H: function(e4, t4, r4, n3) { return t4 + r4 + n3 + (e4 / Math.pow(2, 32) | 0) | 0; }, add4L: function(e4, t4, r4, n3) { return (e4 >>> 0) + (t4 >>> 0) + (r4 >>> 0) + (n3 >>> 0); }, add4H: function(e4, t4, r4, n3, i3) { return t4 + r4 + n3 + i3 + (e4 / Math.pow(2, 32) | 0) | 0; }, add5H: function(e4, t4, r4, n3, i3, o3) { return t4 + r4 + n3 + i3 + o3 + (e4 / Math.pow(2, 32) | 0) | 0; }, add5L: function(e4, t4, r4, n3, i3) { return (e4 >>> 0) + (t4 >>> 0) + (r4 >>> 0) + (n3 >>> 0) + (i3 >>> 0); } }; t3.default = s2; }, 39712: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)); Object.defineProperty(t3, "__esModule", { value: true }), t3.crypto = void 0, t3.crypto = "object" === ("undefined" == typeof globalThis ? "undefined" : (0, n2.default)(globalThis)) && "crypto" in globalThis ? globalThis.crypto : void 0; }, 45896: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)); Object.defineProperty(t3, "__esModule", { value: true }), t3.hmac = t3.HMAC = void 0; var c2 = r3(96822), f2 = r3(72434), d2 = function(e4) { (0, a2.default)(d3, e4); var t4, r4, n3 = (t4 = d3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, u2.default)(t4); if (r4) { var i3 = (0, u2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, s2.default)(this, e5); }); function d3(e5, t5) { var r5; (0, i2.default)(this, d3), (r5 = n3.call(this)).finished = false, r5.destroyed = false, c2.default.hash(e5); var o3 = (0, f2.toBytes)(t5); if (r5.iHash = e5.create(), "function" != typeof r5.iHash.update) throw new Error("Expected instance of class which extends utils.Hash"); r5.blockLen = r5.iHash.blockLen, r5.outputLen = r5.iHash.outputLen; var a3 = r5.blockLen, s3 = new Uint8Array(a3); s3.set(o3.length > a3 ? e5.create().update(o3).digest() : o3); for (var u3 = 0; u3 < s3.length; u3++) s3[u3] ^= 54; r5.iHash.update(s3), r5.oHash = e5.create(); for (var l2 = 0; l2 < s3.length; l2++) s3[l2] ^= 106; return r5.oHash.update(s3), s3.fill(0), r5; } return (0, o2.default)(d3, [{ key: "update", value: function(e5) { return c2.default.exists(this), this.iHash.update(e5), this; } }, { key: "digestInto", value: function(e5) { c2.default.exists(this), c2.default.bytes(e5, this.outputLen), this.finished = true, this.iHash.digestInto(e5), this.oHash.update(e5), this.oHash.digestInto(e5), this.destroy(); } }, { key: "digest", value: function() { var e5 = new Uint8Array(this.oHash.outputLen); return this.digestInto(e5), e5; } }, { key: "_cloneInto", value: function(e5) { e5 || (e5 = Object.create(Object.getPrototypeOf(this), {})); var t5 = this.oHash, r5 = this.iHash, n4 = this.finished, i3 = this.destroyed, o3 = this.blockLen, a3 = this.outputLen; return e5.finished = n4, e5.destroyed = i3, e5.blockLen = o3, e5.outputLen = a3, e5.oHash = t5._cloneInto(e5.oHash), e5.iHash = r5._cloneInto(e5.iHash), e5; } }, { key: "destroy", value: function() { this.destroyed = true, this.oHash.destroy(), this.iHash.destroy(); } }]), d3; }(f2.Hash); t3.HMAC = d2, t3.hmac = function(e4, t4, r4) { return new d2(e4, t4).update(r4).digest(); }, t3.hmac.create = function(e4, t4) { return new d2(e4, t4); }; }, 61241: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)); function c2(e4) { var t4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(); return function() { var r4, n3 = (0, u2.default)(e4); if (t4) { var i3 = (0, u2.default)(this).constructor; r4 = Reflect.construct(n3, arguments, i3); } else r4 = n3.apply(this, arguments); return (0, s2.default)(this, r4); }; } Object.defineProperty(t3, "__esModule", { value: true }), t3.sha224 = t3.sha256 = void 0; var f2 = r3(20330), d2 = r3(72434), l2 = function(e4, t4, r4) { return e4 & t4 ^ e4 & r4 ^ t4 & r4; }, h2 = 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]), p2 = new Uint32Array([1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225]), b2 = new Uint32Array(64), y2 = function(e4) { (0, a2.default)(r4, e4); var t4 = c2(r4); function r4() { var e5; return (0, i2.default)(this, r4), (e5 = t4.call(this, 64, 32, 8, false)).A = 0 | p2[0], e5.B = 0 | p2[1], e5.C = 0 | p2[2], e5.D = 0 | p2[3], e5.E = 0 | p2[4], e5.F = 0 | p2[5], e5.G = 0 | p2[6], e5.H = 0 | p2[7], e5; } return (0, o2.default)(r4, [{ key: "get", value: function() { return [this.A, this.B, this.C, this.D, this.E, this.F, this.G, this.H]; } }, { key: "set", value: function(e5, t5, r5, n3, i3, o3, a3, s3) { this.A = 0 | e5, this.B = 0 | t5, this.C = 0 | r5, this.D = 0 | n3, this.E = 0 | i3, this.F = 0 | o3, this.G = 0 | a3, this.H = 0 | s3; } }, { key: "process", value: function(e5, t5) { for (var r5 = 0; r5 < 16; r5++, t5 += 4) b2[r5] = e5.getUint32(t5, false); for (var n3 = 16; n3 < 64; n3++) { var i3 = b2[n3 - 15], o3 = b2[n3 - 2], a3 = (0, d2.rotr)(i3, 7) ^ (0, d2.rotr)(i3, 18) ^ i3 >>> 3, s3 = (0, d2.rotr)(o3, 17) ^ (0, d2.rotr)(o3, 19) ^ o3 >>> 10; b2[n3] = s3 + b2[n3 - 7] + a3 + b2[n3 - 16] | 0; } var u3, c3 = this.A, f3 = this.B, p3 = this.C, y3 = this.D, v3 = this.E, m2 = this.F, g2 = this.G, w2 = this.H; for (r5 = 0; r5 < 64; r5++) { var k2 = w2 + ((0, d2.rotr)(v3, 6) ^ (0, d2.rotr)(v3, 11) ^ (0, d2.rotr)(v3, 25)) + ((u3 = v3) & m2 ^ ~u3 & g2) + h2[r5] + b2[r5] | 0, _2 = ((0, d2.rotr)(c3, 2) ^ (0, d2.rotr)(c3, 13) ^ (0, d2.rotr)(c3, 22)) + l2(c3, f3, p3) | 0; w2 = g2, g2 = m2, m2 = v3, v3 = y3 + k2 | 0, y3 = p3, p3 = f3, f3 = c3, c3 = k2 + _2 | 0; } c3 = c3 + this.A | 0, f3 = f3 + this.B | 0, p3 = p3 + this.C | 0, y3 = y3 + this.D | 0, v3 = v3 + this.E | 0, m2 = m2 + this.F | 0, g2 = g2 + this.G | 0, w2 = w2 + this.H | 0, this.set(c3, f3, p3, y3, v3, m2, g2, w2); } }, { key: "roundClean", value: function() { b2.fill(0); } }, { key: "destroy", value: function() { this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0); } }]), r4; }(f2.SHA2), v2 = function(e4) { (0, a2.default)(r4, e4); var t4 = c2(r4); function r4() { var e5; return (0, i2.default)(this, r4), (e5 = t4.call(this)).A = -1056596264, e5.B = 914150663, e5.C = 812702999, e5.D = -150054599, e5.E = -4191439, e5.F = 1750603025, e5.G = 1694076839, e5.H = -1090891868, e5.outputLen = 28, e5; } return (0, o2.default)(r4); }(y2); t3.sha256 = (0, d2.wrapConstructor)(function() { return new y2(); }), t3.sha224 = (0, d2.wrapConstructor)(function() { return new v2(); }); }, 64376: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = n2(r3(15163)), s2 = n2(r3(34650)), u2 = n2(r3(21949)), c2 = n2(r3(74519)); Object.defineProperty(t3, "__esModule", { value: true }), t3.shake256 = t3.shake128 = t3.keccak_512 = t3.keccak_384 = t3.keccak_256 = t3.keccak_224 = t3.sha3_512 = t3.sha3_384 = t3.sha3_256 = t3.sha3_224 = t3.Keccak = t3.keccakP = void 0; for (var f2 = r3(96822), d2 = r3(64356), l2 = r3(72434), h2 = [], p2 = [], b2 = [], y2 = BigInt(0), v2 = BigInt(1), m2 = BigInt(2), g2 = BigInt(7), w2 = BigInt(256), k2 = BigInt(113), _2 = 0, A2 = v2, E2 = 1, S2 = 0; _2 < 24; _2++) { var x2 = [S2, (2 * E2 + 3 * S2) % 5]; E2 = x2[0], S2 = x2[1], h2.push(2 * (5 * S2 + E2)), p2.push((_2 + 1) * (_2 + 2) / 2 % 64); for (var B2 = y2, O2 = 0; O2 < 7; O2++) (A2 = (A2 << v2 ^ (A2 >> g2) * k2) % w2) & m2 && (B2 ^= v2 << (v2 << BigInt(O2)) - v2); b2.push(B2); } var P2 = d2.default.split(b2, true), I2 = (0, c2.default)(P2, 2), T2 = I2[0], C2 = I2[1], M2 = function(e4, t4, r4) { return r4 > 32 ? d2.default.rotlBH(e4, t4, r4) : d2.default.rotlSH(e4, t4, r4); }, R2 = function(e4, t4, r4) { return r4 > 32 ? d2.default.rotlBL(e4, t4, r4) : d2.default.rotlSL(e4, t4, r4); }; function U2(e4) { for (var t4 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 24, r4 = new Uint32Array(10), n3 = 24 - t4; n3 < 24; n3++) { for (var i3 = 0; i3 < 10; i3++) r4[i3] = e4[i3] ^ e4[i3 + 10] ^ e4[i3 + 20] ^ e4[i3 + 30] ^ e4[i3 + 40]; for (var o3 = 0; o3 < 10; o3 += 2) for (var a3 = (o3 + 8) % 10, s3 = (o3 + 2) % 10, u3 = r4[s3], c3 = r4[s3 + 1], f3 = M2(u3, c3, 1) ^ r4[a3], d3 = R2(u3, c3, 1) ^ r4[a3 + 1], l3 = 0; l3 < 50; l3 += 10) e4[o3 + l3] ^= f3, e4[o3 + l3 + 1] ^= d3; for (var b3 = e4[2], y3 = e4[3], v3 = 0; v3 < 24; v3++) { var m3 = p2[v3], g3 = M2(b3, y3, m3), w3 = R2(b3, y3, m3), k3 = h2[v3]; b3 = e4[k3], y3 = e4[k3 + 1], e4[k3] = g3, e4[k3 + 1] = w3; } for (var _3 = 0; _3 < 50; _3 += 10) { for (var A3 = 0; A3 < 10; A3++) r4[A3] = e4[_3 + A3]; for (var E3 = 0; E3 < 10; E3++) e4[_3 + E3] ^= ~r4[(E3 + 2) % 10] & r4[(E3 + 4) % 10]; } e4[0] ^= T2[n3], e4[1] ^= C2[n3]; } r4.fill(0); } t3.keccakP = U2; var N2 = function(e4) { (0, a2.default)(c3, e4); var t4, r4, n3 = (t4 = c3, r4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, n4 = (0, u2.default)(t4); if (r4) { var i3 = (0, u2.default)(this).constructor; e5 = Reflect.construct(n4, arguments, i3); } else e5 = n4.apply(this, arguments); return (0, s2.default)(this, e5); }); function c3(e5, t5, r5) { var o3, a3 = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], s3 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 24; if ((0, i2.default)(this, c3), (o3 = n3.call(this)).blockLen = e5, o3.suffix = t5, o3.outputLen = r5, o3.enableXOF = a3, o3.rounds = s3, o3.pos = 0, o3.posOut = 0, o3.finished = false, o3.destroyed = false, f2.default.number(r5), 0 >= o3.blockLen || o3.blockLen >= 200) throw new Error("Sha3 supports only keccak-f1600 function"); return o3.state = new Uint8Array(200), o3.state32 = (0, l2.u32)(o3.state), o3; } return (0, o2.default)(c3, [{ key: "keccak", value: function() { U2(this.state32, this.rounds), this.posOut = 0, this.pos = 0; } }, { key: "update", value: function(e5) { f2.default.exists(this); for (var t5 = this.blockLen, r5 = this.state, n4 = (e5 = (0, l2.toBytes)(e5)).length, i3 = 0; i3 < n4; ) { for (var o3 = Math.min(t5 - this.pos, n4 - i3), a3 = 0; a3 < o3; a3++) r5[this.pos++] ^= e5[i3++]; this.pos === t5 && this.keccak(); } return this; } }, { key: "finish", value: function() { if (!this.finished) { this.finished = true; var e5 = this.state, t5 = this.suffix, r5 = this.pos, n4 = this.blockLen; e5[r5] ^= t5, 0 != (128 & t5) && r5 === n4 - 1 && this.keccak(), e5[n4 - 1] ^= 128, this.keccak(); } } }, { key: "writeInto", value: function(e5) { f2.default.exists(this, false), f2.default.bytes(e5), this.finish(); for (var t5 = this.state, r5 = this.blockLen, n4 = 0, i3 = e5.length; n4 < i3; ) { this.posOut >= r5 && this.keccak(); var o3 = Math.min(r5 - this.posOut, i3 - n4); e5.set(t5.subarray(this.posOut, this.posOut + o3), n4), this.posOut += o3, n4 += o3; } return e5; } }, { key: "xofInto", value: function(e5) { if (!this.enableXOF) throw new Error("XOF is not possible for this instance"); return this.writeInto(e5); } }, { key: "xof", value: function(e5) { return f2.default.number(e5), this.xofInto(new Uint8Array(e5)); } }, { key: "digestInto", value: function(e5) { if (f2.default.output(e5, this), this.finished) throw new Error("digest() was already called"); return this.writeInto(e5), this.destroy(), e5; } }, { key: "digest", value: function() { return this.digestInto(new Uint8Array(this.outputLen)); } }, { key: "destroy", value: function() { this.destroyed = true, this.state.fill(0); } }, { key: "_cloneInto", value: function(e5) { var t5 = this.blockLen, r5 = this.suffix, n4 = this.outputLen, i3 = this.rounds, o3 = this.enableXOF; return e5 || (e5 = new c3(t5, r5, n4, o3, i3)), e5.state32.set(this.state32), e5.pos = this.pos, e5.posOut = this.posOut, e5.finished = this.finished, e5.rounds = i3, e5.suffix = r5, e5.outputLen = n4, e5.enableXOF = o3, e5.destroyed = this.destroyed, e5; } }]), c3; }(l2.Hash); t3.Keccak = N2; var j2 = function(e4, t4, r4) { return (0, l2.wrapConstructor)(function() { return new N2(t4, e4, r4); }); }; t3.sha3_224 = j2(6, 144, 28), t3.sha3_256 = j2(6, 136, 32), t3.sha3_384 = j2(6, 104, 48), t3.sha3_512 = j2(6, 72, 64), t3.keccak_224 = j2(1, 144, 28), t3.keccak_256 = j2(1, 136, 32), t3.keccak_384 = j2(1, 104, 48), t3.keccak_512 = j2(1, 72, 64); var L2 = function(e4, t4, r4) { return (0, l2.wrapXOFConstructorWithOpts)(function() { var n3 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; return new N2(t4, e4, void 0 === n3.dkLen ? r4 : n3.dkLen, true); }); }; t3.shake128 = L2(31, 168, 16), t3.shake256 = L2(31, 136, 32); }, 72434: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(82247)), o2 = n2(r3(69721)), a2 = n2(r3(58985)), s2 = n2(r3(94571)), u2 = n2(r3(3355)); Object.defineProperty(t3, "__esModule", { value: true }), t3.randomBytes = t3.wrapXOFConstructorWithOpts = t3.wrapConstructorWithOpts = t3.wrapConstructor = t3.checkOpts = t3.Hash = t3.concatBytes = t3.toBytes = t3.utf8ToBytes = t3.asyncLoop = t3.nextTick = t3.hexToBytes = t3.bytesToHex = t3.isLE = t3.rotr = t3.createView = t3.u32 = t3.u8 = void 0; var c2 = r3(39712), f2 = function(e4) { return e4 instanceof Uint8Array; }; if (t3.u8 = function(e4) { return new Uint8Array(e4.buffer, e4.byteOffset, e4.byteLength); }, t3.u32 = function(e4) { return new Uint32Array(e4.buffer, e4.byteOffset, Math.floor(e4.byteLength / 4)); }, t3.createView = function(e4) { return new DataView(e4.buffer, e4.byteOffset, e4.byteLength); }, t3.rotr = function(e4, t4) { return e4 << 32 - t4 | e4 >>> t4; }, t3.isLE = 68 === new Uint8Array(new Uint32Array([287454020]).buffer)[0], !t3.isLE) throw new Error("Non little-endian hardware is not supported"); var d2 = Array.from({ length: 256 }, function(e4, t4) { return t4.toString(16).padStart(2, "0"); }); t3.bytesToHex = function(e4) { if (!f2(e4)) throw new Error("Uint8Array expected"); for (var t4 = "", r4 = 0; r4 < e4.length; r4++) t4 += d2[e4[r4]]; return t4; }, t3.hexToBytes = function(e4) { if ("string" != typeof e4) throw new Error("hex string expected, got " + (0, u2.default)(e4)); var t4 = e4.length; if (t4 % 2) throw new Error("padded hex string expected, got unpadded hex of length " + t4); for (var r4 = new Uint8Array(t4 / 2), n3 = 0; n3 < r4.length; n3++) { var i3 = 2 * n3, o3 = e4.slice(i3, i3 + 2), a3 = Number.parseInt(o3, 16); if (Number.isNaN(a3) || a3 < 0) throw new Error("Invalid byte sequence"); r4[n3] = a3; } return r4; }; var l2 = function() { var e4 = (0, s2.default)(i2.default.mark(function e5() { return i2.default.wrap(function(e6) { for (; ; ) switch (e6.prev = e6.next) { case 0: case "end": return e6.stop(); } }, e5); })); return function() { return e4.apply(this, arguments); }; }(); function h2() { return (h2 = (0, s2.default)(i2.default.mark(function e4(r4, n3, o3) { var a3, s3, u3; return i2.default.wrap(function(e5) { for (; ; ) switch (e5.prev = e5.next) { case 0: a3 = Date.now(), s3 = 0; case 2: if (!(s3 < r4)) { e5.next = 13; break; } if (o3(s3), !((u3 = Date.now() - a3) >= 0 && u3 < n3)) { e5.next = 7; break; } return e5.abrupt("continue", 10); case 7: return e5.next = 9, (0, t3.nextTick)(); case 9: a3 += u3; case 10: s3++, e5.next = 2; break; case 13: case "end": return e5.stop(); } }, e4); }))).apply(this, arguments); } function p2(e4) { if ("string" != typeof e4) throw new Error("utf8ToBytes expected string, got ".concat((0, u2.default)(e4))); return new Uint8Array(new TextEncoder().encode(e4)); } function b2(e4) { if ("string" == typeof e4 && (e4 = p2(e4)), !f2(e4)) throw new Error("expected Uint8Array, got ".concat((0, u2.default)(e4))); return e4; } t3.nextTick = l2, t3.asyncLoop = function(e4, t4, r4) { return h2.apply(this, arguments); }, t3.utf8ToBytes = p2, t3.toBytes = b2, t3.concatBytes = function() { for (var e4 = arguments.length, t4 = new Array(e4), r4 = 0; r4 < e4; r4++) t4[r4] = arguments[r4]; var n3 = new Uint8Array(t4.reduce(function(e5, t5) { return e5 + t5.length; }, 0)), i3 = 0; return t4.forEach(function(e5) { if (!f2(e5)) throw new Error("Uint8Array expected"); n3.set(e5, i3), i3 += e5.length; }), n3; }; var y2 = function() { function e4() { (0, o2.default)(this, e4); } return (0, a2.default)(e4, [{ key: "clone", value: function() { return this._cloneInto(); } }]), e4; }(); t3.Hash = y2; t3.checkOpts = function(e4, t4) { if (void 0 !== t4 && ("object" !== (0, u2.default)(t4) || (r4 = t4, "[object Object]" !== Object.prototype.toString.call(r4) || r4.constructor !== Object))) throw new Error("Options should be object or undefined"); var r4; return Object.assign(e4, t4); }, t3.wrapConstructor = function(e4) { var t4 = function(t5) { return e4().update(b2(t5)).digest(); }, r4 = e4(); return t4.outputLen = r4.outputLen, t4.blockLen = r4.blockLen, t4.create = function() { return e4(); }, t4; }, t3.wrapConstructorWithOpts = function(e4) { var t4 = function(t5, r5) { return e4(r5).update(b2(t5)).digest(); }, r4 = e4({}); return t4.outputLen = r4.outputLen, t4.blockLen = r4.blockLen, t4.create = function(t5) { return e4(t5); }, t4; }, t3.wrapXOFConstructorWithOpts = function(e4) { var t4 = function(t5, r5) { return e4(r5).update(b2(t5)).digest(); }, r4 = e4({}); return t4.outputLen = r4.outputLen, t4.blockLen = r4.blockLen, t4.create = function(t5) { return e4(t5); }, t4; }, t3.randomBytes = function() { var e4 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 32; if (c2.crypto && "function" == typeof c2.crypto.getRandomValues) return c2.crypto.getRandomValues(new Uint8Array(e4)); throw new Error("crypto.getRandomValues must be defined"); }; }, 53368: (e3, t3, r3) => { var n2, i2, o2 = r3(28847)(r3(3355)); void 0 === (i2 = "function" == typeof (n2 = function() { function e4(e5, t5) { if (!(e5 instanceof t5)) throw new TypeError("Cannot call a class as a function"); } function t4(e5, t5) { for (var r4 = 0; r4 < t5.length; r4++) { var n4 = t5[r4]; n4.enumerable = n4.enumerable || false, n4.configurable = true, "value" in n4 && (n4.writable = true), Object.defineProperty(e5, n4.key, n4); } } function n3(e5, r4, n4) { return r4 && t4(e5.prototype, r4), n4 && t4(e5, n4), Object.defineProperty(e5, "prototype", { writable: false }), e5; } function i3(e5) { return i3 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e6) { return e6.__proto__ || Object.getPrototypeOf(e6); }, i3(e5); } function a2(e5, t5) { return a2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e6, t6) { return e6.__proto__ = t6, e6; }, a2(e5, t5); } function s2(e5) { if (void 0 === e5) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e5; } function u2(e5) { var t5 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e6) { return false; } }(); return function() { var r4, n4 = i3(e5); if (t5) { var a3 = i3(this).constructor; r4 = Reflect.construct(n4, arguments, a3); } else r4 = n4.apply(this, arguments); return function(e6, t6) { if (t6 && ("object" === (0, o2.default)(t6) || "function" == typeof t6)) return t6; if (void 0 !== t6) throw new TypeError("Derived constructors may only return object or undefined"); return s2(e6); }(this, r4); }; } function c2() { return c2 = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e5, t5, r4) { var n4 = function(e6, t6) { for (; !Object.prototype.hasOwnProperty.call(e6, t6) && null !== (e6 = i3(e6)); ) ; return e6; }(e5, t5); if (n4) { var o3 = Object.getOwnPropertyDescriptor(n4, t5); return o3.get ? o3.get.call(arguments.length < 3 ? e5 : r4) : o3.value; } }, c2.apply(this, arguments); } var f2 = function() { function t5() { e4(this, t5), Object.defineProperty(this, "listeners", { value: {}, writable: true, configurable: true }); } return n3(t5, [{ key: "addEventListener", value: function(e5, t6, r4) { e5 in this.listeners || (this.listeners[e5] = []), this.listeners[e5].push({ callback: t6, options: r4 }); } }, { key: "removeEventListener", value: function(e5, t6) { if (e5 in this.listeners) { for (var r4 = this.listeners[e5], n4 = 0, i4 = r4.length; n4 < i4; n4++) if (r4[n4].callback === t6) return void r4.splice(n4, 1); } } }, { key: "dispatchEvent", value: function(e5) { if (e5.type in this.listeners) { for (var t6 = this.listeners[e5.type].slice(), r4 = 0, n4 = t6.length; r4 < n4; r4++) { var i4 = t6[r4]; try { i4.callback.call(this, e5); } catch (e6) { Promise.resolve().then(function() { throw e6; }); } i4.options && i4.options.once && this.removeEventListener(e5.type, i4.callback); } return !e5.defaultPrevented; } } }]), t5; }(), d2 = function(t5) { !function(e5, t6) { if ("function" != typeof t6 && null !== t6) throw new TypeError("Super expression must either be null or a function"); e5.prototype = Object.create(t6 && t6.prototype, { constructor: { value: e5, writable: true, configurable: true } }), Object.defineProperty(e5, "prototype", { writable: false }), t6 && a2(e5, t6); }(o3, t5); var r4 = u2(o3); function o3() { var t6; return e4(this, o3), (t6 = r4.call(this)).listeners || f2.call(s2(t6)), Object.defineProperty(s2(t6), "aborted", { value: false, writable: true, configurable: true }), Object.defineProperty(s2(t6), "onabort", { value: null, writable: true, configurable: true }), Object.defineProperty(s2(t6), "reason", { value: void 0, writable: true, configurable: true }), t6; } return n3(o3, [{ key: "toString", value: function() { return "[object AbortSignal]"; } }, { key: "dispatchEvent", value: function(e5) { "abort" === e5.type && (this.aborted = true, "function" == typeof this.onabort && this.onabort.call(this, e5)), c2(i3(o3.prototype), "dispatchEvent", this).call(this, e5); } }]), o3; }(f2), l2 = function() { function t5() { e4(this, t5), Object.defineProperty(this, "signal", { value: new d2(), writable: true, configurable: true }); } return n3(t5, [{ key: "abort", value: function(e5) { var t6; try { t6 = new Event("abort"); } catch (e6) { "undefined" != typeof document ? document.createEvent ? (t6 = document.createEvent("Event")).initEvent("abort", false, false) : (t6 = document.createEventObject()).type = "abort" : t6 = { type: "abort", bubbles: false, cancelable: false }; } var r4 = e5; if (void 0 === r4) if ("undefined" == typeof document) (r4 = new Error("This operation was aborted")).name = "AbortError"; else try { r4 = new DOMException("signal is aborted without reason"); } catch (e6) { (r4 = new Error("This operation was aborted")).name = "AbortError"; } this.signal.reason = r4, this.signal.dispatchEvent(t6); } }, { key: "toString", value: function() { return "[object AbortController]"; } }]), t5; }(); function h2(e5) { return e5.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL ? (console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"), true) : "function" == typeof e5.Request && !e5.Request.prototype.hasOwnProperty("signal") || !e5.AbortController; } "undefined" != typeof Symbol && Symbol.toStringTag && (l2.prototype[Symbol.toStringTag] = "AbortController", d2.prototype[Symbol.toStringTag] = "AbortSignal"), function(e5) { if (h2(e5)) if (e5.fetch) { var t5 = function(e6) { "function" == typeof e6 && (e6 = { fetch: e6 }); var t6 = e6, r5 = t6.fetch, n5 = t6.Request, i4 = void 0 === n5 ? r5.Request : n5, o3 = t6.AbortController, a3 = t6.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL, s3 = void 0 !== a3 && a3; if (!h2({ fetch: r5, Request: i4, AbortController: o3, __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL: s3 })) return { fetch: r5, Request: u3 }; var u3 = i4; (u3 && !u3.prototype.hasOwnProperty("signal") || s3) && ((u3 = function(e7, t7) { var r6; t7 && t7.signal && (r6 = t7.signal, delete t7.signal); var n6 = new i4(e7, t7); return r6 && Object.defineProperty(n6, "signal", { writable: false, enumerable: false, configurable: true, value: r6 }), n6; }).prototype = i4.prototype); var c3 = r5; return { fetch: function(e7, t7) { var r6 = u3 && u3.prototype.isPrototypeOf(e7) ? e7.signal : t7 ? t7.signal : void 0; if (r6) { var n6; try { n6 = new DOMException("Aborted", "AbortError"); } catch (e8) { (n6 = new Error("Aborted")).name = "AbortError"; } if (r6.aborted) return Promise.reject(n6); var i5 = new Promise(function(e8, t8) { r6.addEventListener("abort", function() { return t8(n6); }, { once: true }); }); return t7 && t7.signal && delete t7.signal, Promise.race([i5, c3(e7, t7)]); } return c3(e7, t7); }, Request: u3 }; }(e5), r4 = t5.fetch, n4 = t5.Request; e5.fetch = r4, e5.Request = n4, Object.defineProperty(e5, "AbortController", { writable: true, enumerable: false, configurable: true, value: l2 }), Object.defineProperty(e5, "AbortSignal", { writable: true, enumerable: false, configurable: true, value: d2 }); } else console.warn("fetch() is not available, cannot install abortcontroller-polyfill"); }("undefined" != typeof self ? self : r3.g); }) ? n2.call(t3, r3, t3, e3) : n2) || (e3.exports = i2); }, 68357: (e3, t3, r3) => { var n2 = t3; n2.bignum = r3(31734), n2.define = r3(41568).define, n2.base = r3(12412), n2.constants = r3(79387), n2.decoders = r3(61500), n2.encoders = r3(47506); }, 41568: (e3, t3, r3) => { var n2 = r3(47506), i2 = r3(61500), o2 = r3(41736); function a2(e4, t4) { this.name = e4, this.body = t4, this.decoders = {}, this.encoders = {}; } t3.define = function(e4, t4) { return new a2(e4, t4); }, a2.prototype._createNamed = function(e4) { var t4 = this.name; function r4(e5) { this._initNamed(e5, t4); } return o2(r4, e4), r4.prototype._initNamed = function(t5, r5) { e4.call(this, t5, r5); }, new r4(this); }, a2.prototype._getDecoder = function(e4) { return e4 = e4 || "der", this.decoders.hasOwnProperty(e4) || (this.decoders[e4] = this._createNamed(i2[e4])), this.decoders[e4]; }, a2.prototype.decode = function(e4, t4, r4) { return this._getDecoder(t4).decode(e4, r4); }, a2.prototype._getEncoder = function(e4) { return e4 = e4 || "der", this.encoders.hasOwnProperty(e4) || (this.encoders[e4] = this._createNamed(n2[e4])), this.encoders[e4]; }, a2.prototype.encode = function(e4, t4, r4) { return this._getEncoder(t4).encode(e4, r4); }; }, 90585: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(41736), o2 = r3(32719).b, a2 = r3(11755).Buffer; function s2(e4, t4) { o2.call(this, t4), a2.isBuffer(e4) ? (this.base = e4, this.offset = 0, this.length = e4.length) : this.error("Input not Buffer"); } function u2(e4, t4) { if (Array.isArray(e4)) this.length = 0, this.value = e4.map(function(e5) { return u2.isEncoderBuffer(e5) || (e5 = new u2(e5, t4)), this.length += e5.length, e5; }, this); else if ("number" == typeof e4) { if (!(0 <= e4 && e4 <= 255)) return t4.error("non-byte EncoderBuffer value"); this.value = e4, this.length = 1; } else if ("string" == typeof e4) this.value = e4, this.length = a2.byteLength(e4); else { if (!a2.isBuffer(e4)) return t4.error("Unsupported type: " + (0, n2.default)(e4)); this.value = e4, this.length = e4.length; } } i2(s2, o2), t3.C = s2, s2.isDecoderBuffer = function(e4) { return e4 instanceof s2 || "object" === (0, n2.default)(e4) && a2.isBuffer(e4.base) && "DecoderBuffer" === e4.constructor.name && "number" == typeof e4.offset && "number" == typeof e4.length && "function" == typeof e4.save && "function" == typeof e4.restore && "function" == typeof e4.isEmpty && "function" == typeof e4.readUInt8 && "function" == typeof e4.skip && "function" == typeof e4.raw; }, s2.prototype.save = function() { return { offset: this.offset, reporter: o2.prototype.save.call(this) }; }, s2.prototype.restore = function(e4) { var t4 = new s2(this.base); return t4.offset = e4.offset, t4.length = this.offset, this.offset = e4.offset, o2.prototype.restore.call(this, e4.reporter), t4; }, s2.prototype.isEmpty = function() { return this.offset === this.length; }, s2.prototype.readUInt8 = function(e4) { return this.offset + 1 <= this.length ? this.base.readUInt8(this.offset++, true) : this.error(e4 || "DecoderBuffer overrun"); }, s2.prototype.skip = function(e4, t4) { if (!(this.offset + e4 <= this.length)) return this.error(t4 || "DecoderBuffer overrun"); var r4 = new s2(this.base); return r4._reporterState = this._reporterState, r4.offset = this.offset, r4.length = this.offset + e4, this.offset += e4, r4; }, s2.prototype.raw = function(e4) { return this.base.slice(e4 ? e4.offset : this.offset, this.length); }, t3.R = u2, u2.isEncoderBuffer = function(e4) { return e4 instanceof u2 || "object" === (0, n2.default)(e4) && "EncoderBuffer" === e4.constructor.name && "number" == typeof e4.length && "function" == typeof e4.join; }, u2.prototype.join = function(e4, t4) { return e4 || (e4 = a2.alloc(this.length)), t4 || (t4 = 0), 0 === this.length || (Array.isArray(this.value) ? this.value.forEach(function(r4) { r4.join(e4, t4), t4 += r4.length; }) : ("number" == typeof this.value ? e4[t4] = this.value : "string" == typeof this.value ? e4.write(this.value, t4) : a2.isBuffer(this.value) && this.value.copy(e4, t4), t4 += this.length)), e4; }; }, 12412: (e3, t3, r3) => { var n2 = t3; n2.Reporter = r3(32719).b, n2.DecoderBuffer = r3(90585).C, n2.EncoderBuffer = r3(90585).R, n2.Node = r3(51371); }, 51371: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(32719).b, o2 = r3(90585).R, a2 = r3(90585).C, s2 = r3(94504), u2 = ["seq", "seqof", "set", "setof", "objid", "bool", "gentime", "utctime", "null_", "enum", "int", "objDesc", "bitstr", "bmpstr", "charstr", "genstr", "graphstr", "ia5str", "iso646str", "numstr", "octstr", "printstr", "t61str", "unistr", "utf8str", "videostr"], c2 = ["key", "obj", "use", "optional", "explicit", "implicit", "def", "choice", "any", "contains"].concat(u2); function f2(e4, t4, r4) { var n3 = {}; this._baseState = n3, n3.name = r4, n3.enc = e4, n3.parent = t4 || null, n3.children = null, n3.tag = null, n3.args = null, n3.reverseArgs = null, n3.choice = null, n3.optional = false, n3.any = false, n3.obj = false, n3.use = null, n3.useDecoder = null, n3.key = null, n3.default = null, n3.explicit = null, n3.implicit = null, n3.contains = null, n3.parent || (n3.children = [], this._wrap()); } e3.exports = f2; var d2 = ["enc", "parent", "children", "tag", "args", "reverseArgs", "choice", "optional", "any", "obj", "use", "alteredUse", "key", "default", "explicit", "implicit", "contains"]; f2.prototype.clone = function() { var e4 = this._baseState, t4 = {}; d2.forEach(function(r5) { t4[r5] = e4[r5]; }); var r4 = new this.constructor(t4.parent); return r4._baseState = t4, r4; }, f2.prototype._wrap = function() { var e4 = this._baseState; c2.forEach(function(t4) { this[t4] = function() { var r4 = new this.constructor(this); return e4.children.push(r4), r4[t4].apply(r4, arguments); }; }, this); }, f2.prototype._init = function(e4) { var t4 = this._baseState; s2(null === t4.parent), e4.call(this), t4.children = t4.children.filter(function(e5) { return e5._baseState.parent === this; }, this), s2.equal(t4.children.length, 1, "Root node can have only one child"); }, f2.prototype._useArgs = function(e4) { var t4 = this._baseState, r4 = e4.filter(function(e5) { return e5 instanceof this.constructor; }, this); e4 = e4.filter(function(e5) { return !(e5 instanceof this.constructor); }, this), 0 !== r4.length && (s2(null === t4.children), t4.children = r4, r4.forEach(function(e5) { e5._baseState.parent = this; }, this)), 0 !== e4.length && (s2(null === t4.args), t4.args = e4, t4.reverseArgs = e4.map(function(e5) { if ("object" !== (0, n2.default)(e5) || e5.constructor !== Object) return e5; var t5 = {}; return Object.keys(e5).forEach(function(r5) { r5 == (0 | r5) && (r5 |= 0); var n3 = e5[r5]; t5[n3] = r5; }), t5; })); }, ["_peekTag", "_decodeTag", "_use", "_decodeStr", "_decodeObjid", "_decodeTime", "_decodeNull", "_decodeInt", "_decodeBool", "_decodeList", "_encodeComposite", "_encodeStr", "_encodeObjid", "_encodeTime", "_encodeNull", "_encodeInt", "_encodeBool"].forEach(function(e4) { f2.prototype[e4] = function() { var t4 = this._baseState; throw new Error(e4 + " not implemented for encoding: " + t4.enc); }; }), u2.forEach(function(e4) { f2.prototype[e4] = function() { var t4 = this._baseState, r4 = Array.prototype.slice.call(arguments); return s2(null === t4.tag), t4.tag = e4, this._useArgs(r4), this; }; }), f2.prototype.use = function(e4) { s2(e4); var t4 = this._baseState; return s2(null === t4.use), t4.use = e4, this; }, f2.prototype.optional = function() { return this._baseState.optional = true, this; }, f2.prototype.def = function(e4) { var t4 = this._baseState; return s2(null === t4.default), t4.default = e4, t4.optional = true, this; }, f2.prototype.explicit = function(e4) { var t4 = this._baseState; return s2(null === t4.explicit && null === t4.implicit), t4.explicit = e4, this; }, f2.prototype.implicit = function(e4) { var t4 = this._baseState; return s2(null === t4.explicit && null === t4.implicit), t4.implicit = e4, this; }, f2.prototype.obj = function() { var e4 = this._baseState, t4 = Array.prototype.slice.call(arguments); return e4.obj = true, 0 !== t4.length && this._useArgs(t4), this; }, f2.prototype.key = function(e4) { var t4 = this._baseState; return s2(null === t4.key), t4.key = e4, this; }, f2.prototype.any = function() { return this._baseState.any = true, this; }, f2.prototype.choice = function(e4) { var t4 = this._baseState; return s2(null === t4.choice), t4.choice = e4, this._useArgs(Object.keys(e4).map(function(t5) { return e4[t5]; })), this; }, f2.prototype.contains = function(e4) { var t4 = this._baseState; return s2(null === t4.use), t4.contains = e4, this; }, f2.prototype._decode = function(e4, t4) { var r4 = this._baseState; if (null === r4.parent) return e4.wrapResult(r4.children[0]._decode(e4, t4)); var n3, i3 = r4.default, o3 = true, s3 = null; if (null !== r4.key && (s3 = e4.enterKey(r4.key)), r4.optional) { var u3 = null; if (null !== r4.explicit ? u3 = r4.explicit : null !== r4.implicit ? u3 = r4.implicit : null !== r4.tag && (u3 = r4.tag), null !== u3 || r4.any) { if (o3 = this._peekTag(e4, u3, r4.any), e4.isError(o3)) return o3; } else { var c3 = e4.save(); try { null === r4.choice ? this._decodeGeneric(r4.tag, e4, t4) : this._decodeChoice(e4, t4), o3 = true; } catch (e5) { o3 = false; } e4.restore(c3); } } if (r4.obj && o3 && (n3 = e4.enterObject()), o3) { if (null !== r4.explicit) { var f3 = this._decodeTag(e4, r4.explicit); if (e4.isError(f3)) return f3; e4 = f3; } var d3 = e4.offset; if (null === r4.use && null === r4.choice) { var l2; r4.any && (l2 = e4.save()); var h2 = this._decodeTag(e4, null !== r4.implicit ? r4.implicit : r4.tag, r4.any); if (e4.isError(h2)) return h2; r4.any ? i3 = e4.raw(l2) : e4 = h2; } if (t4 && t4.track && null !== r4.tag && t4.track(e4.path(), d3, e4.length, "tagged"), t4 && t4.track && null !== r4.tag && t4.track(e4.path(), e4.offset, e4.length, "content"), r4.any || (i3 = null === r4.choice ? this._decodeGeneric(r4.tag, e4, t4) : this._decodeChoice(e4, t4)), e4.isError(i3)) return i3; if (r4.any || null !== r4.choice || null === r4.children || r4.children.forEach(function(r5) { r5._decode(e4, t4); }), r4.contains && ("octstr" === r4.tag || "bitstr" === r4.tag)) { var p2 = new a2(i3); i3 = this._getUse(r4.contains, e4._reporterState.obj)._decode(p2, t4); } } return r4.obj && o3 && (i3 = e4.leaveObject(n3)), null === r4.key || null === i3 && true !== o3 ? null !== s3 && e4.exitKey(s3) : e4.leaveKey(s3, r4.key, i3), i3; }, f2.prototype._decodeGeneric = function(e4, t4, r4) { var n3 = this._baseState; return "seq" === e4 || "set" === e4 ? null : "seqof" === e4 || "setof" === e4 ? this._decodeList(t4, e4, n3.args[0], r4) : /str$/.test(e4) ? this._decodeStr(t4, e4, r4) : "objid" === e4 && n3.args ? this._decodeObjid(t4, n3.args[0], n3.args[1], r4) : "objid" === e4 ? this._decodeObjid(t4, null, null, r4) : "gentime" === e4 || "utctime" === e4 ? this._decodeTime(t4, e4, r4) : "null_" === e4 ? this._decodeNull(t4, r4) : "bool" === e4 ? this._decodeBool(t4, r4) : "objDesc" === e4 ? this._decodeStr(t4, e4, r4) : "int" === e4 || "enum" === e4 ? this._decodeInt(t4, n3.args && n3.args[0], r4) : null !== n3.use ? this._getUse(n3.use, t4._reporterState.obj)._decode(t4, r4) : t4.error("unknown tag: " + e4); }, f2.prototype._getUse = function(e4, t4) { var r4 = this._baseState; return r4.useDecoder = this._use(e4, t4), s2(null === r4.useDecoder._baseState.parent), r4.useDecoder = r4.useDecoder._baseState.children[0], r4.implicit !== r4.useDecoder._baseState.implicit && (r4.useDecoder = r4.useDecoder.clone(), r4.useDecoder._baseState.implicit = r4.implicit), r4.useDecoder; }, f2.prototype._decodeChoice = function(e4, t4) { var r4 = this._baseState, n3 = null, i3 = false; return Object.keys(r4.choice).some(function(o3) { var a3 = e4.save(), s3 = r4.choice[o3]; try { var u3 = s3._decode(e4, t4); if (e4.isError(u3)) return false; n3 = { type: o3, value: u3 }, i3 = true; } catch (t5) { return e4.restore(a3), false; } return true; }, this), i3 ? n3 : e4.error("Choice not matched"); }, f2.prototype._createEncoderBuffer = function(e4) { return new o2(e4, this.reporter); }, f2.prototype._encode = function(e4, t4, r4) { var n3 = this._baseState; if (null === n3.default || n3.default !== e4) { var i3 = this._encodeValue(e4, t4, r4); if (void 0 !== i3 && !this._skipDefault(i3, t4, r4)) return i3; } }, f2.prototype._encodeValue = function(e4, t4, r4) { var o3 = this._baseState; if (null === o3.parent) return o3.children[0]._encode(e4, t4 || new i2()); var a3 = null; if (this.reporter = t4, o3.optional && void 0 === e4) { if (null === o3.default) return; e4 = o3.default; } var s3 = null, u3 = false; if (o3.any) a3 = this._createEncoderBuffer(e4); else if (o3.choice) a3 = this._encodeChoice(e4, t4); else if (o3.contains) s3 = this._getUse(o3.contains, r4)._encode(e4, t4), u3 = true; else if (o3.children) s3 = o3.children.map(function(r5) { if ("null_" === r5._baseState.tag) return r5._encode(null, t4, e4); if (null === r5._baseState.key) return t4.error("Child should have a key"); var i3 = t4.enterKey(r5._baseState.key); if ("object" !== (0, n2.default)(e4)) return t4.error("Child expected, but input is not object"); var o4 = r5._encode(e4[r5._baseState.key], t4, e4); return t4.leaveKey(i3), o4; }, this).filter(function(e5) { return e5; }), s3 = this._createEncoderBuffer(s3); else if ("seqof" === o3.tag || "setof" === o3.tag) { if (!o3.args || 1 !== o3.args.length) return t4.error("Too many args for : " + o3.tag); if (!Array.isArray(e4)) return t4.error("seqof/setof, but data is not Array"); var c3 = this.clone(); c3._baseState.implicit = null, s3 = this._createEncoderBuffer(e4.map(function(r5) { var n3 = this._baseState; return this._getUse(n3.args[0], e4)._encode(r5, t4); }, c3)); } else null !== o3.use ? a3 = this._getUse(o3.use, r4)._encode(e4, t4) : (s3 = this._encodePrimitive(o3.tag, e4), u3 = true); if (!o3.any && null === o3.choice) { var f3 = null !== o3.implicit ? o3.implicit : o3.tag, d3 = null === o3.implicit ? "universal" : "context"; null === f3 ? null === o3.use && t4.error("Tag could be omitted only for .use()") : null === o3.use && (a3 = this._encodeComposite(f3, u3, d3, s3)); } return null !== o3.explicit && (a3 = this._encodeComposite(o3.explicit, false, "context", a3)), a3; }, f2.prototype._encodeChoice = function(e4, t4) { var r4 = this._baseState, n3 = r4.choice[e4.type]; return n3 || s2(false, e4.type + " not found in " + JSON.stringify(Object.keys(r4.choice))), n3._encode(e4.value, t4); }, f2.prototype._encodePrimitive = function(e4, t4) { var r4 = this._baseState; if (/str$/.test(e4)) return this._encodeStr(t4, e4); if ("objid" === e4 && r4.args) return this._encodeObjid(t4, r4.reverseArgs[0], r4.args[1]); if ("objid" === e4) return this._encodeObjid(t4, null, null); if ("gentime" === e4 || "utctime" === e4) return this._encodeTime(t4, e4); if ("null_" === e4) return this._encodeNull(); if ("int" === e4 || "enum" === e4) return this._encodeInt(t4, r4.args && r4.reverseArgs[0]); if ("bool" === e4) return this._encodeBool(t4); if ("objDesc" === e4) return this._encodeStr(t4, e4); throw new Error("Unsupported tag: " + e4); }, f2.prototype._isNumstr = function(e4) { return /^[0-9 ]*$/.test(e4); }, f2.prototype._isPrintstr = function(e4) { return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(e4); }; }, 32719: (e3, t3, r3) => { var n2 = r3(41736); function i2(e4) { this._reporterState = { obj: null, path: [], options: e4 || {}, errors: [] }; } function o2(e4, t4) { this.path = e4, this.rethrow(t4); } t3.b = i2, i2.prototype.isError = function(e4) { return e4 instanceof o2; }, i2.prototype.save = function() { var e4 = this._reporterState; return { obj: e4.obj, pathLen: e4.path.length }; }, i2.prototype.restore = function(e4) { var t4 = this._reporterState; t4.obj = e4.obj, t4.path = t4.path.slice(0, e4.pathLen); }, i2.prototype.enterKey = function(e4) { return this._reporterState.path.push(e4); }, i2.prototype.exitKey = function(e4) { var t4 = this._reporterState; t4.path = t4.path.slice(0, e4 - 1); }, i2.prototype.leaveKey = function(e4, t4, r4) { var n3 = this._reporterState; this.exitKey(e4), null !== n3.obj && (n3.obj[t4] = r4); }, i2.prototype.path = function() { return this._reporterState.path.join("/"); }, i2.prototype.enterObject = function() { var e4 = this._reporterState, t4 = e4.obj; return e4.obj = {}, t4; }, i2.prototype.leaveObject = function(e4) { var t4 = this._reporterState, r4 = t4.obj; return t4.obj = e4, r4; }, i2.prototype.error = function(e4) { var t4, r4 = this._reporterState, n3 = e4 instanceof o2; if (t4 = n3 ? e4 : new o2(r4.path.map(function(e5) { return "[" + JSON.stringify(e5) + "]"; }).join(""), e4.message || e4, e4.stack), !r4.options.partial) throw t4; return n3 || r4.errors.push(t4), t4; }, i2.prototype.wrapResult = function(e4) { var t4 = this._reporterState; return t4.options.partial ? { result: this.isError(e4) ? null : e4, errors: t4.errors } : e4; }, n2(o2, Error), o2.prototype.rethrow = function(e4) { if (this.message = e4 + " at: " + (this.path || "(shallow)"), Error.captureStackTrace && Error.captureStackTrace(this, o2), !this.stack) try { throw new Error(this.message); } catch (e5) { this.stack = e5.stack; } return this; }; }, 6520: (e3, t3) => { function r3(e4) { var t4 = {}; return Object.keys(e4).forEach(function(r4) { (0 | r4) == r4 && (r4 |= 0); var n2 = e4[r4]; t4[n2] = r4; }), t4; } t3.tagClass = { 0: "universal", 1: "application", 2: "context", 3: "private" }, t3.tagClassByName = r3(t3.tagClass), t3.tag = { 0: "end", 1: "bool", 2: "int", 3: "bitstr", 4: "octstr", 5: "null_", 6: "objid", 7: "objDesc", 8: "external", 9: "real", 10: "enum", 11: "embed", 12: "utf8str", 13: "relativeOid", 16: "seq", 17: "set", 18: "numstr", 19: "printstr", 20: "t61str", 21: "videostr", 22: "ia5str", 23: "utctime", 24: "gentime", 25: "graphstr", 26: "iso646str", 27: "genstr", 28: "unistr", 29: "charstr", 30: "bmpstr" }, t3.tagByName = r3(t3.tag); }, 79387: (e3, t3, r3) => { var n2 = t3; n2._reverse = function(e4) { var t4 = {}; return Object.keys(e4).forEach(function(r4) { (0 | r4) == r4 && (r4 |= 0); var n3 = e4[r4]; t4[n3] = r4; }), t4; }, n2.der = r3(6520); }, 92387: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(31734), o2 = r3(90585).C, a2 = r3(51371), s2 = r3(6520); function u2(e4) { this.enc = "der", this.name = e4.name, this.entity = e4, this.tree = new c2(), this.tree._init(e4.body); } function c2(e4) { a2.call(this, "der", e4); } function f2(e4, t4) { var r4 = e4.readUInt8(t4); if (e4.isError(r4)) return r4; var n3 = s2.tagClass[r4 >> 6], i3 = 0 == (32 & r4); if (31 == (31 & r4)) { var o3 = r4; for (r4 = 0; 128 == (128 & o3); ) { if (o3 = e4.readUInt8(t4), e4.isError(o3)) return o3; r4 <<= 7, r4 |= 127 & o3; } } else r4 &= 31; return { cls: n3, primitive: i3, tag: r4, tagStr: s2.tag[r4] }; } function d2(e4, t4, r4) { var n3 = e4.readUInt8(r4); if (e4.isError(n3)) return n3; if (!t4 && 128 === n3) return null; if (0 == (128 & n3)) return n3; var i3 = 127 & n3; if (i3 > 4) return e4.error("length octect is too long"); n3 = 0; for (var o3 = 0; o3 < i3; o3++) { n3 <<= 8; var a3 = e4.readUInt8(r4); if (e4.isError(a3)) return a3; n3 |= a3; } return n3; } e3.exports = u2, u2.prototype.decode = function(e4, t4) { return o2.isDecoderBuffer(e4) || (e4 = new o2(e4, t4)), this.tree._decode(e4, t4); }, n2(c2, a2), c2.prototype._peekTag = function(e4, t4, r4) { if (e4.isEmpty()) return false; var n3 = e4.save(), i3 = f2(e4, 'Failed to peek tag: "' + t4 + '"'); return e4.isError(i3) ? i3 : (e4.restore(n3), i3.tag === t4 || i3.tagStr === t4 || i3.tagStr + "of" === t4 || r4); }, c2.prototype._decodeTag = function(e4, t4, r4) { var n3 = f2(e4, 'Failed to decode tag of "' + t4 + '"'); if (e4.isError(n3)) return n3; var i3 = d2(e4, n3.primitive, 'Failed to get length of "' + t4 + '"'); if (e4.isError(i3)) return i3; if (!r4 && n3.tag !== t4 && n3.tagStr !== t4 && n3.tagStr + "of" !== t4) return e4.error('Failed to match tag: "' + t4 + '"'); if (n3.primitive || null !== i3) return e4.skip(i3, 'Failed to match body of: "' + t4 + '"'); var o3 = e4.save(), a3 = this._skipUntilEnd(e4, 'Failed to skip indefinite length body: "' + this.tag + '"'); return e4.isError(a3) ? a3 : (i3 = e4.offset - o3.offset, e4.restore(o3), e4.skip(i3, 'Failed to match body of: "' + t4 + '"')); }, c2.prototype._skipUntilEnd = function(e4, t4) { for (; ; ) { var r4 = f2(e4, t4); if (e4.isError(r4)) return r4; var n3 = d2(e4, r4.primitive, t4); if (e4.isError(n3)) return n3; var i3; if (i3 = r4.primitive || null !== n3 ? e4.skip(n3) : this._skipUntilEnd(e4, t4), e4.isError(i3)) return i3; if ("end" === r4.tagStr) break; } }, c2.prototype._decodeList = function(e4, t4, r4, n3) { for (var i3 = []; !e4.isEmpty(); ) { var o3 = this._peekTag(e4, "end"); if (e4.isError(o3)) return o3; var a3 = r4.decode(e4, "der", n3); if (e4.isError(a3) && o3) break; i3.push(a3); } return i3; }, c2.prototype._decodeStr = function(e4, t4) { if ("bitstr" === t4) { var r4 = e4.readUInt8(); return e4.isError(r4) ? r4 : { unused: r4, data: e4.raw() }; } if ("bmpstr" === t4) { var n3 = e4.raw(); if (n3.length % 2 == 1) return e4.error("Decoding of string type: bmpstr length mismatch"); for (var i3 = "", o3 = 0; o3 < n3.length / 2; o3++) i3 += String.fromCharCode(n3.readUInt16BE(2 * o3)); return i3; } if ("numstr" === t4) { var a3 = e4.raw().toString("ascii"); return this._isNumstr(a3) ? a3 : e4.error("Decoding of string type: numstr unsupported characters"); } if ("octstr" === t4) return e4.raw(); if ("objDesc" === t4) return e4.raw(); if ("printstr" === t4) { var s3 = e4.raw().toString("ascii"); return this._isPrintstr(s3) ? s3 : e4.error("Decoding of string type: printstr unsupported characters"); } return /str$/.test(t4) ? e4.raw().toString() : e4.error("Decoding of string type: " + t4 + " unsupported"); }, c2.prototype._decodeObjid = function(e4, t4, r4) { for (var n3, i3 = [], o3 = 0, a3 = 0; !e4.isEmpty(); ) o3 <<= 7, o3 |= 127 & (a3 = e4.readUInt8()), 0 == (128 & a3) && (i3.push(o3), o3 = 0); 128 & a3 && i3.push(o3); var s3 = i3[0] / 40 | 0, u3 = i3[0] % 40; if (n3 = r4 ? i3 : [s3, u3].concat(i3.slice(1)), t4) { var c3 = t4[n3.join(" ")]; void 0 === c3 && (c3 = t4[n3.join(".")]), void 0 !== c3 && (n3 = c3); } return n3; }, c2.prototype._decodeTime = function(e4, t4) { var r4, n3, i3, o3, a3, s3, u3 = e4.raw().toString(); if ("gentime" === t4) r4 = 0 | u3.slice(0, 4), n3 = 0 | u3.slice(4, 6), i3 = 0 | u3.slice(6, 8), o3 = 0 | u3.slice(8, 10), a3 = 0 | u3.slice(10, 12), s3 = 0 | u3.slice(12, 14); else { if ("utctime" !== t4) return e4.error("Decoding " + t4 + " time is not supported yet"); r4 = 0 | u3.slice(0, 2), n3 = 0 | u3.slice(2, 4), i3 = 0 | u3.slice(4, 6), o3 = 0 | u3.slice(6, 8), a3 = 0 | u3.slice(8, 10), s3 = 0 | u3.slice(10, 12), r4 = r4 < 70 ? 2e3 + r4 : 1900 + r4; } return Date.UTC(r4, n3 - 1, i3, o3, a3, s3, 0); }, c2.prototype._decodeNull = function() { return null; }, c2.prototype._decodeBool = function(e4) { var t4 = e4.readUInt8(); return e4.isError(t4) ? t4 : 0 !== t4; }, c2.prototype._decodeInt = function(e4, t4) { var r4 = e4.raw(), n3 = new i2(r4); return t4 && (n3 = t4[n3.toString(10)] || n3), n3; }, c2.prototype._use = function(e4, t4) { return "function" == typeof e4 && (e4 = e4(t4)), e4._getDecoder("der").tree; }; }, 61500: (e3, t3, r3) => { var n2 = t3; n2.der = r3(92387), n2.pem = r3(50529); }, 50529: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(11755).Buffer, o2 = r3(92387); function a2(e4) { o2.call(this, e4), this.enc = "pem"; } n2(a2, o2), e3.exports = a2, a2.prototype.decode = function(e4, t4) { for (var r4 = e4.toString().split(/[\r\n]+/g), n3 = t4.label.toUpperCase(), a3 = /^-----(BEGIN|END) ([^-]+)-----$/, s2 = -1, u2 = -1, c2 = 0; c2 < r4.length; c2++) { var f2 = r4[c2].match(a3); if (null !== f2 && f2[2] === n3) { if (-1 !== s2) { if ("END" !== f2[1]) break; u2 = c2; break; } if ("BEGIN" !== f2[1]) break; s2 = c2; } } if (-1 === s2 || -1 === u2) throw new Error("PEM section not found for: " + n3); var d2 = r4.slice(s2 + 1, u2).join(""); d2.replace(/[^a-z0-9+/=]+/gi, ""); var l2 = i2.from(d2, "base64"); return o2.prototype.decode.call(this, l2, t4); }; }, 11068: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(11755).Buffer, o2 = r3(51371), a2 = r3(6520); function s2(e4) { this.enc = "der", this.name = e4.name, this.entity = e4, this.tree = new u2(), this.tree._init(e4.body); } function u2(e4) { o2.call(this, "der", e4); } function c2(e4) { return e4 < 10 ? "0" + e4 : e4; } e3.exports = s2, s2.prototype.encode = function(e4, t4) { return this.tree._encode(e4, t4).join(); }, n2(u2, o2), u2.prototype._encodeComposite = function(e4, t4, r4, n3) { var o3 = function(e5, t5, r5, n4) { var i3; if ("seqof" === e5 ? e5 = "seq" : "setof" === e5 && (e5 = "set"), a2.tagByName.hasOwnProperty(e5)) i3 = a2.tagByName[e5]; else { if ("number" != typeof e5 || (0 | e5) !== e5) return n4.error("Unknown tag: " + e5); i3 = e5; } return i3 >= 31 ? n4.error("Multi-octet tag encoding unsupported") : (t5 || (i3 |= 32), i3 |= a2.tagClassByName[r5 || "universal"] << 6); }(e4, t4, r4, this.reporter); if (n3.length < 128) { var s3 = i2.alloc(2); return s3[0] = o3, s3[1] = n3.length, this._createEncoderBuffer([s3, n3]); } for (var u3 = 1, c3 = n3.length; c3 >= 256; c3 >>= 8) u3++; var f2 = i2.alloc(2 + u3); f2[0] = o3, f2[1] = 128 | u3; for (var d2 = 1 + u3, l2 = n3.length; l2 > 0; d2--, l2 >>= 8) f2[d2] = 255 & l2; return this._createEncoderBuffer([f2, n3]); }, u2.prototype._encodeStr = function(e4, t4) { if ("bitstr" === t4) return this._createEncoderBuffer([0 | e4.unused, e4.data]); if ("bmpstr" === t4) { for (var r4 = i2.alloc(2 * e4.length), n3 = 0; n3 < e4.length; n3++) r4.writeUInt16BE(e4.charCodeAt(n3), 2 * n3); return this._createEncoderBuffer(r4); } return "numstr" === t4 ? this._isNumstr(e4) ? this._createEncoderBuffer(e4) : this.reporter.error("Encoding of string type: numstr supports only digits and space") : "printstr" === t4 ? this._isPrintstr(e4) ? this._createEncoderBuffer(e4) : this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark") : /str$/.test(t4) || "objDesc" === t4 ? this._createEncoderBuffer(e4) : this.reporter.error("Encoding of string type: " + t4 + " unsupported"); }, u2.prototype._encodeObjid = function(e4, t4, r4) { if ("string" == typeof e4) { if (!t4) return this.reporter.error("string objid given, but no values map found"); if (!t4.hasOwnProperty(e4)) return this.reporter.error("objid not found in values map"); e4 = t4[e4].split(/[\s.]+/g); for (var n3 = 0; n3 < e4.length; n3++) e4[n3] |= 0; } else if (Array.isArray(e4)) { e4 = e4.slice(); for (var o3 = 0; o3 < e4.length; o3++) e4[o3] |= 0; } if (!Array.isArray(e4)) return this.reporter.error("objid() should be either array or string, got: " + JSON.stringify(e4)); if (!r4) { if (e4[1] >= 40) return this.reporter.error("Second objid identifier OOB"); e4.splice(0, 2, 40 * e4[0] + e4[1]); } for (var a3 = 0, s3 = 0; s3 < e4.length; s3++) { var u3 = e4[s3]; for (a3++; u3 >= 128; u3 >>= 7) a3++; } for (var c3 = i2.alloc(a3), f2 = c3.length - 1, d2 = e4.length - 1; d2 >= 0; d2--) { var l2 = e4[d2]; for (c3[f2--] = 127 & l2; (l2 >>= 7) > 0; ) c3[f2--] = 128 | 127 & l2; } return this._createEncoderBuffer(c3); }, u2.prototype._encodeTime = function(e4, t4) { var r4, n3 = new Date(e4); return "gentime" === t4 ? r4 = [c2(n3.getUTCFullYear()), c2(n3.getUTCMonth() + 1), c2(n3.getUTCDate()), c2(n3.getUTCHours()), c2(n3.getUTCMinutes()), c2(n3.getUTCSeconds()), "Z"].join("") : "utctime" === t4 ? r4 = [c2(n3.getUTCFullYear() % 100), c2(n3.getUTCMonth() + 1), c2(n3.getUTCDate()), c2(n3.getUTCHours()), c2(n3.getUTCMinutes()), c2(n3.getUTCSeconds()), "Z"].join("") : this.reporter.error("Encoding " + t4 + " time is not supported yet"), this._encodeStr(r4, "octstr"); }, u2.prototype._encodeNull = function() { return this._createEncoderBuffer(""); }, u2.prototype._encodeInt = function(e4, t4) { if ("string" == typeof e4) { if (!t4) return this.reporter.error("String int or enum given, but no values map"); if (!t4.hasOwnProperty(e4)) return this.reporter.error("Values map doesn't contain: " + JSON.stringify(e4)); e4 = t4[e4]; } if ("number" != typeof e4 && !i2.isBuffer(e4)) { var r4 = e4.toArray(); !e4.sign && 128 & r4[0] && r4.unshift(0), e4 = i2.from(r4); } if (i2.isBuffer(e4)) { var n3 = e4.length; 0 === e4.length && n3++; var o3 = i2.alloc(n3); return e4.copy(o3), 0 === e4.length && (o3[0] = 0), this._createEncoderBuffer(o3); } if (e4 < 128) return this._createEncoderBuffer(e4); if (e4 < 256) return this._createEncoderBuffer([0, e4]); for (var a3 = 1, s3 = e4; s3 >= 256; s3 >>= 8) a3++; for (var u3 = new Array(a3), c3 = u3.length - 1; c3 >= 0; c3--) u3[c3] = 255 & e4, e4 >>= 8; return 128 & u3[0] && u3.unshift(0), this._createEncoderBuffer(i2.from(u3)); }, u2.prototype._encodeBool = function(e4) { return this._createEncoderBuffer(e4 ? 255 : 0); }, u2.prototype._use = function(e4, t4) { return "function" == typeof e4 && (e4 = e4(t4)), e4._getEncoder("der").tree; }, u2.prototype._skipDefault = function(e4, t4, r4) { var n3, i3 = this._baseState; if (null === i3.default) return false; var o3 = e4.join(); if (void 0 === i3.defaultBuffer && (i3.defaultBuffer = this._encodeValue(i3.default, t4, r4).join()), o3.length !== i3.defaultBuffer.length) return false; for (n3 = 0; n3 < o3.length; n3++) if (o3[n3] !== i3.defaultBuffer[n3]) return false; return true; }; }, 47506: (e3, t3, r3) => { var n2 = t3; n2.der = r3(11068), n2.pem = r3(38520); }, 38520: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(11068); function o2(e4) { i2.call(this, e4), this.enc = "pem"; } n2(o2, i2), e3.exports = o2, o2.prototype.encode = function(e4, t4) { for (var r4 = i2.prototype.encode.call(this, e4).toString("base64"), n3 = ["-----BEGIN " + t4.label + "-----"], o3 = 0; o3 < r4.length; o3 += 64) n3.push(r4.slice(o3, o3 + 64)); return n3.push("-----END " + t4.label + "-----"), n3.join("\n"); }; }, 3894: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(33103); function o2(e4, t4) { if (e4 === t4) return 0; for (var r4 = e4.length, n3 = t4.length, i3 = 0, o3 = Math.min(r4, n3); i3 < o3; ++i3) if (e4[i3] !== t4[i3]) { r4 = e4[i3], n3 = t4[i3]; break; } return r4 < n3 ? -1 : n3 < r4 ? 1 : 0; } function a2(e4) { return r3.g.Buffer && "function" == typeof r3.g.Buffer.isBuffer ? r3.g.Buffer.isBuffer(e4) : !(null == e4 || !e4._isBuffer); } var s2 = r3(69954), u2 = Object.prototype.hasOwnProperty, c2 = Array.prototype.slice, f2 = "foo" === (function() { }).name; function d2(e4) { return Object.prototype.toString.call(e4); } function l2(e4) { return !a2(e4) && "function" == typeof r3.g.ArrayBuffer && ("function" == typeof ArrayBuffer.isView ? ArrayBuffer.isView(e4) : !!e4 && (e4 instanceof DataView || !!(e4.buffer && e4.buffer instanceof ArrayBuffer))); } var h2 = e3.exports = g2, p2 = /\s*function\s+([^\(\s]*)\s*/; function b2(e4) { if (s2.isFunction(e4)) { if (f2) return e4.name; var t4 = e4.toString().match(p2); return t4 && t4[1]; } } function y2(e4, t4) { return "string" == typeof e4 ? e4.length < t4 ? e4 : e4.slice(0, t4) : e4; } function v2(e4) { if (f2 || !s2.isFunction(e4)) return s2.inspect(e4); var t4 = b2(e4); return "[Function" + (t4 ? ": " + t4 : "") + "]"; } function m2(e4, t4, r4, n3, i3) { throw new h2.AssertionError({ message: r4, actual: e4, expected: t4, operator: n3, stackStartFunction: i3 }); } function g2(e4, t4) { e4 || m2(e4, true, t4, "==", h2.ok); } function w2(e4, t4, r4, i3) { if (e4 === t4) return true; if (a2(e4) && a2(t4)) return 0 === o2(e4, t4); if (s2.isDate(e4) && s2.isDate(t4)) return e4.getTime() === t4.getTime(); if (s2.isRegExp(e4) && s2.isRegExp(t4)) return e4.source === t4.source && e4.global === t4.global && e4.multiline === t4.multiline && e4.lastIndex === t4.lastIndex && e4.ignoreCase === t4.ignoreCase; if (null !== e4 && "object" === (0, n2.default)(e4) || null !== t4 && "object" === (0, n2.default)(t4)) { if (l2(e4) && l2(t4) && d2(e4) === d2(t4) && !(e4 instanceof Float32Array || e4 instanceof Float64Array)) return 0 === o2(new Uint8Array(e4.buffer), new Uint8Array(t4.buffer)); if (a2(e4) !== a2(t4)) return false; var u3 = (i3 = i3 || { actual: [], expected: [] }).actual.indexOf(e4); return -1 !== u3 && u3 === i3.expected.indexOf(t4) || (i3.actual.push(e4), i3.expected.push(t4), function(e5, t5, r5, n3) { if (null == e5 || null == t5) return false; if (s2.isPrimitive(e5) || s2.isPrimitive(t5)) return e5 === t5; if (r5 && Object.getPrototypeOf(e5) !== Object.getPrototypeOf(t5)) return false; var i4 = k2(e5), o3 = k2(t5); if (i4 && !o3 || !i4 && o3) return false; if (i4) return w2(e5 = c2.call(e5), t5 = c2.call(t5), r5); var a3, u4, f3 = E2(e5), d3 = E2(t5); if (f3.length !== d3.length) return false; for (f3.sort(), d3.sort(), u4 = f3.length - 1; u4 >= 0; u4--) if (f3[u4] !== d3[u4]) return false; for (u4 = f3.length - 1; u4 >= 0; u4--) if (!w2(e5[a3 = f3[u4]], t5[a3], r5, n3)) return false; return true; }(e4, t4, r4, i3)); } return r4 ? e4 === t4 : e4 == t4; } function k2(e4) { return "[object Arguments]" == Object.prototype.toString.call(e4); } function _2(e4, t4) { if (!e4 || !t4) return false; if ("[object RegExp]" == Object.prototype.toString.call(t4)) return t4.test(e4); try { if (e4 instanceof t4) return true; } catch (e5) { } return !Error.isPrototypeOf(t4) && true === t4.call({}, e4); } function A2(e4, t4, r4, n3) { var i3; if ("function" != typeof t4) throw new TypeError('"block" argument must be a function'); "string" == typeof r4 && (n3 = r4, r4 = null), i3 = function(e5) { var t5; try { e5(); } catch (e6) { t5 = e6; } return t5; }(t4), n3 = (r4 && r4.name ? " (" + r4.name + ")." : ".") + (n3 ? " " + n3 : "."), e4 && !i3 && m2(i3, r4, "Missing expected exception" + n3); var o3 = "string" == typeof n3, a3 = !e4 && i3 && !r4; if ((!e4 && s2.isError(i3) && o3 && _2(i3, r4) || a3) && m2(i3, r4, "Got unwanted exception" + n3), e4 && i3 && r4 && !_2(i3, r4) || !e4 && i3) throw i3; } h2.AssertionError = function(e4) { this.name = "AssertionError", this.actual = e4.actual, this.expected = e4.expected, this.operator = e4.operator, e4.message ? (this.message = e4.message, this.generatedMessage = false) : (this.message = function(e5) { return y2(v2(e5.actual), 128) + " " + e5.operator + " " + y2(v2(e5.expected), 128); }(this), this.generatedMessage = true); var t4 = e4.stackStartFunction || m2; if (Error.captureStackTrace) Error.captureStackTrace(this, t4); else { var r4 = new Error(); if (r4.stack) { var n3 = r4.stack, i3 = b2(t4), o3 = n3.indexOf("\n" + i3); if (o3 >= 0) { var a3 = n3.indexOf("\n", o3 + 1); n3 = n3.substring(a3 + 1); } this.stack = n3; } } }, s2.inherits(h2.AssertionError, Error), h2.fail = m2, h2.ok = g2, h2.equal = function(e4, t4, r4) { e4 != t4 && m2(e4, t4, r4, "==", h2.equal); }, h2.notEqual = function(e4, t4, r4) { e4 == t4 && m2(e4, t4, r4, "!=", h2.notEqual); }, h2.deepEqual = function(e4, t4, r4) { w2(e4, t4, false) || m2(e4, t4, r4, "deepEqual", h2.deepEqual); }, h2.deepStrictEqual = function(e4, t4, r4) { w2(e4, t4, true) || m2(e4, t4, r4, "deepStrictEqual", h2.deepStrictEqual); }, h2.notDeepEqual = function(e4, t4, r4) { w2(e4, t4, false) && m2(e4, t4, r4, "notDeepEqual", h2.notDeepEqual); }, h2.notDeepStrictEqual = function e4(t4, r4, n3) { w2(t4, r4, true) && m2(t4, r4, n3, "notDeepStrictEqual", e4); }, h2.strictEqual = function(e4, t4, r4) { e4 !== t4 && m2(e4, t4, r4, "===", h2.strictEqual); }, h2.notStrictEqual = function(e4, t4, r4) { e4 === t4 && m2(e4, t4, r4, "!==", h2.notStrictEqual); }, h2.throws = function(e4, t4, r4) { A2(true, e4, t4, r4); }, h2.doesNotThrow = function(e4, t4, r4) { A2(false, e4, t4, r4); }, h2.ifError = function(e4) { if (e4) throw e4; }, h2.strict = i2(function e4(t4, r4) { t4 || m2(t4, true, r4, "==", e4); }, h2, { equal: h2.strictEqual, deepEqual: h2.deepStrictEqual, notEqual: h2.notStrictEqual, notDeepEqual: h2.notDeepStrictEqual }), h2.strict.strict = h2.strict; var E2 = Object.keys || function(e4) { var t4 = []; for (var r4 in e4) u2.call(e4, r4) && t4.push(r4); return t4; }; }, 94074: (e3) => { "function" == typeof Object.create ? e3.exports = function(e4, t3) { e4.super_ = t3, e4.prototype = Object.create(t3.prototype, { constructor: { value: e4, enumerable: false, writable: true, configurable: true } }); } : e3.exports = function(e4, t3) { e4.super_ = t3; var r3 = function() { }; r3.prototype = t3.prototype, e4.prototype = new r3(), e4.prototype.constructor = e4; }; }, 86732: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)); e3.exports = function(e4) { return e4 && "object" === (0, n2.default)(e4) && "function" == typeof e4.copy && "function" == typeof e4.fill && "function" == typeof e4.readUInt8; }; }, 69954: (e3, t3, r3) => { var n2 = r3(19142), i2 = r3(28847)(r3(3355)), o2 = /%[sdj%]/g; t3.format = function(e4) { if (!m2(e4)) { for (var t4 = [], r4 = 0; r4 < arguments.length; r4++) t4.push(u2(arguments[r4])); return t4.join(" "); } r4 = 1; for (var n3 = arguments, i3 = n3.length, a3 = String(e4).replace(o2, function(e5) { if ("%%" === e5) return "%"; if (r4 >= i3) return e5; switch (e5) { case "%s": return String(n3[r4++]); case "%d": return Number(n3[r4++]); case "%j": try { return JSON.stringify(n3[r4++]); } catch (e6) { return "[Circular]"; } default: return e5; } }), s3 = n3[r4]; r4 < i3; s3 = n3[++r4]) y2(s3) || !k2(s3) ? a3 += " " + s3 : a3 += " " + u2(s3); return a3; }, t3.deprecate = function(e4, i3) { if (g2(r3.g.process)) return function() { return t3.deprecate(e4, i3).apply(this, arguments); }; if (true === n2.noDeprecation) return e4; var o3 = false; return function() { if (!o3) { if (n2.throwDeprecation) throw new Error(i3); n2.traceDeprecation ? console.trace(i3) : console.error(i3), o3 = true; } return e4.apply(this, arguments); }; }; var a2, s2 = {}; function u2(e4, r4) { var n3 = { seen: [], stylize: f2 }; return arguments.length >= 3 && (n3.depth = arguments[2]), arguments.length >= 4 && (n3.colors = arguments[3]), b2(r4) ? n3.showHidden = r4 : r4 && t3._extend(n3, r4), g2(n3.showHidden) && (n3.showHidden = false), g2(n3.depth) && (n3.depth = 2), g2(n3.colors) && (n3.colors = false), g2(n3.customInspect) && (n3.customInspect = true), n3.colors && (n3.stylize = c2), d2(n3, e4, n3.depth); } function c2(e4, t4) { var r4 = u2.styles[t4]; return r4 ? "\x1B[" + u2.colors[r4][0] + "m" + e4 + "\x1B[" + u2.colors[r4][1] + "m" : e4; } function f2(e4, t4) { return e4; } function d2(e4, r4, n3) { if (e4.customInspect && r4 && E2(r4.inspect) && r4.inspect !== t3.inspect && (!r4.constructor || r4.constructor.prototype !== r4)) { var i3 = r4.inspect(n3, e4); return m2(i3) || (i3 = d2(e4, i3, n3)), i3; } var o3 = function(e5, t4) { if (g2(t4)) return e5.stylize("undefined", "undefined"); if (m2(t4)) { var r5 = "'" + JSON.stringify(t4).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; return e5.stylize(r5, "string"); } return v2(t4) ? e5.stylize("" + t4, "number") : b2(t4) ? e5.stylize("" + t4, "boolean") : y2(t4) ? e5.stylize("null", "null") : void 0; }(e4, r4); if (o3) return o3; var a3 = Object.keys(r4), s3 = function(e5) { var t4 = {}; return e5.forEach(function(e6, r5) { t4[e6] = true; }), t4; }(a3); if (e4.showHidden && (a3 = Object.getOwnPropertyNames(r4)), A2(r4) && (a3.indexOf("message") >= 0 || a3.indexOf("description") >= 0)) return l2(r4); if (0 === a3.length) { if (E2(r4)) { var u3 = r4.name ? ": " + r4.name : ""; return e4.stylize("[Function" + u3 + "]", "special"); } if (w2(r4)) return e4.stylize(RegExp.prototype.toString.call(r4), "regexp"); if (_2(r4)) return e4.stylize(Date.prototype.toString.call(r4), "date"); if (A2(r4)) return l2(r4); } var c3, f3 = "", k3 = false, S3 = ["{", "}"]; return p2(r4) && (k3 = true, S3 = ["[", "]"]), E2(r4) && (f3 = " [Function" + (r4.name ? ": " + r4.name : "") + "]"), w2(r4) && (f3 = " " + RegExp.prototype.toString.call(r4)), _2(r4) && (f3 = " " + Date.prototype.toUTCString.call(r4)), A2(r4) && (f3 = " " + l2(r4)), 0 !== a3.length || k3 && 0 != r4.length ? n3 < 0 ? w2(r4) ? e4.stylize(RegExp.prototype.toString.call(r4), "regexp") : e4.stylize("[Object]", "special") : (e4.seen.push(r4), c3 = k3 ? function(e5, t4, r5, n4, i4) { for (var o4 = [], a4 = 0, s4 = t4.length; a4 < s4; ++a4) O2(t4, String(a4)) ? o4.push(h2(e5, t4, r5, n4, String(a4), true)) : o4.push(""); return i4.forEach(function(i5) { i5.match(/^\d+$/) || o4.push(h2(e5, t4, r5, n4, i5, true)); }), o4; }(e4, r4, n3, s3, a3) : a3.map(function(t4) { return h2(e4, r4, n3, s3, t4, k3); }), e4.seen.pop(), function(e5, t4, r5) { return e5.reduce(function(e6, t5) { return t5.indexOf("\n"), e6 + t5.replace(/\u001b\[\d\d?m/g, "").length + 1; }, 0) > 60 ? r5[0] + ("" === t4 ? "" : t4 + "\n ") + " " + e5.join(",\n ") + " " + r5[1] : r5[0] + t4 + " " + e5.join(", ") + " " + r5[1]; }(c3, f3, S3)) : S3[0] + f3 + S3[1]; } function l2(e4) { return "[" + Error.prototype.toString.call(e4) + "]"; } function h2(e4, t4, r4, n3, i3, o3) { var a3, s3, u3; if ((u3 = Object.getOwnPropertyDescriptor(t4, i3) || { value: t4[i3] }).get ? s3 = u3.set ? e4.stylize("[Getter/Setter]", "special") : e4.stylize("[Getter]", "special") : u3.set && (s3 = e4.stylize("[Setter]", "special")), O2(n3, i3) || (a3 = "[" + i3 + "]"), s3 || (e4.seen.indexOf(u3.value) < 0 ? (s3 = y2(r4) ? d2(e4, u3.value, null) : d2(e4, u3.value, r4 - 1)).indexOf("\n") > -1 && (s3 = o3 ? s3.split("\n").map(function(e5) { return " " + e5; }).join("\n").substr(2) : "\n" + s3.split("\n").map(function(e5) { return " " + e5; }).join("\n")) : s3 = e4.stylize("[Circular]", "special")), g2(a3)) { if (o3 && i3.match(/^\d+$/)) return s3; (a3 = JSON.stringify("" + i3)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (a3 = a3.substr(1, a3.length - 2), a3 = e4.stylize(a3, "name")) : (a3 = a3.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), a3 = e4.stylize(a3, "string")); } return a3 + ": " + s3; } function p2(e4) { return Array.isArray(e4); } function b2(e4) { return "boolean" == typeof e4; } function y2(e4) { return null === e4; } function v2(e4) { return "number" == typeof e4; } function m2(e4) { return "string" == typeof e4; } function g2(e4) { return void 0 === e4; } function w2(e4) { return k2(e4) && "[object RegExp]" === S2(e4); } function k2(e4) { return "object" === (0, i2.default)(e4) && null !== e4; } function _2(e4) { return k2(e4) && "[object Date]" === S2(e4); } function A2(e4) { return k2(e4) && ("[object Error]" === S2(e4) || e4 instanceof Error); } function E2(e4) { return "function" == typeof e4; } function S2(e4) { return Object.prototype.toString.call(e4); } function x2(e4) { return e4 < 10 ? "0" + e4.toString(10) : e4.toString(10); } t3.debuglog = function(e4) { if (g2(a2) && (a2 = n2.env.NODE_DEBUG || ""), e4 = e4.toUpperCase(), !s2[e4]) if (new RegExp("\\b" + e4 + "\\b", "i").test(a2)) { var r4 = n2.pid; s2[e4] = function() { var n3 = t3.format.apply(t3, arguments); console.error("%s %d: %s", e4, r4, n3); }; } else s2[e4] = function() { }; return s2[e4]; }, t3.inspect = u2, u2.colors = { bold: [1, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], white: [37, 39], grey: [90, 39], black: [30, 39], blue: [34, 39], cyan: [36, 39], green: [32, 39], magenta: [35, 39], red: [31, 39], yellow: [33, 39] }, u2.styles = { special: "cyan", number: "yellow", boolean: "yellow", undefined: "grey", null: "bold", string: "green", date: "magenta", regexp: "red" }, t3.isArray = p2, t3.isBoolean = b2, t3.isNull = y2, t3.isNullOrUndefined = function(e4) { return null == e4; }, t3.isNumber = v2, t3.isString = m2, t3.isSymbol = function(e4) { return "symbol" === (0, i2.default)(e4); }, t3.isUndefined = g2, t3.isRegExp = w2, t3.isObject = k2, t3.isDate = _2, t3.isError = A2, t3.isFunction = E2, t3.isPrimitive = function(e4) { return null === e4 || "boolean" == typeof e4 || "number" == typeof e4 || "string" == typeof e4 || "symbol" === (0, i2.default)(e4) || void 0 === e4; }, t3.isBuffer = r3(86732); var B2 = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; function O2(e4, t4) { return Object.prototype.hasOwnProperty.call(e4, t4); } t3.log = function() { var e4, r4; console.log("%s - %s", (r4 = [x2((e4 = /* @__PURE__ */ new Date()).getHours()), x2(e4.getMinutes()), x2(e4.getSeconds())].join(":"), [e4.getDate(), B2[e4.getMonth()], r4].join(" ")), t3.format.apply(t3, arguments)); }, t3.inherits = r3(94074), t3._extend = function(e4, t4) { if (!t4 || !k2(t4)) return e4; for (var r4 = Object.keys(t4), n3 = r4.length; n3--; ) e4[r4[n3]] = t4[r4[n3]]; return e4; }; }, 27548: (e3, t3, r3) => { var n2 = r3(48850).Buffer; e3.exports = function(e4) { if (e4.length >= 255) throw new TypeError("Alphabet too long"); for (var t4 = new Uint8Array(256), r4 = 0; r4 < t4.length; r4++) t4[r4] = 255; for (var i2 = 0; i2 < e4.length; i2++) { var o2 = e4.charAt(i2), a2 = o2.charCodeAt(0); if (255 !== t4[a2]) throw new TypeError(o2 + " is ambiguous"); t4[a2] = i2; } var s2 = e4.length, u2 = e4.charAt(0), c2 = Math.log(s2) / Math.log(256), f2 = Math.log(256) / Math.log(s2); function d2(e5) { if ("string" != typeof e5) throw new TypeError("Expected String"); if (0 === e5.length) return n2.alloc(0); for (var r5 = 0, i3 = 0, o3 = 0; e5[r5] === u2; ) i3++, r5++; for (var a3 = (e5.length - r5) * c2 + 1 >>> 0, f3 = new Uint8Array(a3); e5[r5]; ) { var d3 = t4[e5.charCodeAt(r5)]; if (255 === d3) return; for (var l2 = 0, h2 = a3 - 1; (0 !== d3 || l2 < o3) && -1 !== h2; h2--, l2++) d3 += s2 * f3[h2] >>> 0, f3[h2] = d3 % 256 >>> 0, d3 = d3 / 256 >>> 0; if (0 !== d3) throw new Error("Non-zero carry"); o3 = l2, r5++; } for (var p2 = a3 - o3; p2 !== a3 && 0 === f3[p2]; ) p2++; var b2 = n2.allocUnsafe(i3 + (a3 - p2)); b2.fill(0, 0, i3); for (var y2 = i3; p2 !== a3; ) b2[y2++] = f3[p2++]; return b2; } return { encode: function(t5) { if ((Array.isArray(t5) || t5 instanceof Uint8Array) && (t5 = n2.from(t5)), !n2.isBuffer(t5)) throw new TypeError("Expected Buffer"); if (0 === t5.length) return ""; for (var r5 = 0, i3 = 0, o3 = 0, a3 = t5.length; o3 !== a3 && 0 === t5[o3]; ) o3++, r5++; for (var c3 = (a3 - o3) * f2 + 1 >>> 0, d3 = new Uint8Array(c3); o3 !== a3; ) { for (var l2 = t5[o3], h2 = 0, p2 = c3 - 1; (0 !== l2 || h2 < i3) && -1 !== p2; p2--, h2++) l2 += 256 * d3[p2] >>> 0, d3[p2] = l2 % s2 >>> 0, l2 = l2 / s2 >>> 0; if (0 !== l2) throw new Error("Non-zero carry"); i3 = h2, o3++; } for (var b2 = c3 - i3; b2 !== c3 && 0 === d3[b2]; ) b2++; for (var y2 = u2.repeat(r5); b2 < c3; ++b2) y2 += e4.charAt(d3[b2]); return y2; }, decodeUnsafe: d2, decode: function(e5) { var t5 = d2(e5); if (t5) return t5; throw new Error("Non-base" + s2 + " character"); } }; }; }, 34919: (e3, t3) => { t3.byteLength = function(e4) { var t4 = u2(e4), r4 = t4[0], n3 = t4[1]; return 3 * (r4 + n3) / 4 - n3; }, t3.toByteArray = function(e4) { var t4, r4, o3 = u2(e4), a3 = o3[0], s3 = o3[1], c3 = new i2(function(e5, t5, r5) { return 3 * (t5 + r5) / 4 - r5; }(0, a3, s3)), f2 = 0, d2 = s3 > 0 ? a3 - 4 : a3; for (r4 = 0; r4 < d2; r4 += 4) t4 = n2[e4.charCodeAt(r4)] << 18 | n2[e4.charCodeAt(r4 + 1)] << 12 | n2[e4.charCodeAt(r4 + 2)] << 6 | n2[e4.charCodeAt(r4 + 3)], c3[f2++] = t4 >> 16 & 255, c3[f2++] = t4 >> 8 & 255, c3[f2++] = 255 & t4; return 2 === s3 && (t4 = n2[e4.charCodeAt(r4)] << 2 | n2[e4.charCodeAt(r4 + 1)] >> 4, c3[f2++] = 255 & t4), 1 === s3 && (t4 = n2[e4.charCodeAt(r4)] << 10 | n2[e4.charCodeAt(r4 + 1)] << 4 | n2[e4.charCodeAt(r4 + 2)] >> 2, c3[f2++] = t4 >> 8 & 255, c3[f2++] = 255 & t4), c3; }, t3.fromByteArray = function(e4) { for (var t4, n3 = e4.length, i3 = n3 % 3, o3 = [], a3 = 16383, s3 = 0, u3 = n3 - i3; s3 < u3; s3 += a3) o3.push(c2(e4, s3, s3 + a3 > u3 ? u3 : s3 + a3)); return 1 === i3 ? (t4 = e4[n3 - 1], o3.push(r3[t4 >> 2] + r3[t4 << 4 & 63] + "==")) : 2 === i3 && (t4 = (e4[n3 - 2] << 8) + e4[n3 - 1], o3.push(r3[t4 >> 10] + r3[t4 >> 4 & 63] + r3[t4 << 2 & 63] + "=")), o3.join(""); }; for (var r3 = [], n2 = [], i2 = "undefined" != typeof Uint8Array ? Uint8Array : Array, o2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a2 = 0, s2 = o2.length; a2 < s2; ++a2) r3[a2] = o2[a2], n2[o2.charCodeAt(a2)] = a2; function u2(e4) { var t4 = e4.length; if (t4 % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4"); var r4 = e4.indexOf("="); return -1 === r4 && (r4 = t4), [r4, r4 === t4 ? 0 : 4 - r4 % 4]; } function c2(e4, t4, n3) { for (var i3, o3, a3 = [], s3 = t4; s3 < n3; s3 += 3) i3 = (e4[s3] << 16 & 16711680) + (e4[s3 + 1] << 8 & 65280) + (255 & e4[s3 + 2]), a3.push(r3[(o3 = i3) >> 18 & 63] + r3[o3 >> 12 & 63] + r3[o3 >> 6 & 63] + r3[63 & o3]); return a3.join(""); } n2["-".charCodeAt(0)] = 62, n2["_".charCodeAt(0)] = 63; }, 31734: (e3, t3, r3) => { e3 = r3.nmd(e3); var n2 = r3(28847)(r3(3355)); !function(e4, t4) { function i2(e5, t5) { if (!e5) throw new Error(t5 || "Assertion failed"); } function o2(e5, t5) { e5.super_ = t5; var r4 = function() { }; r4.prototype = t5.prototype, e5.prototype = new r4(), e5.prototype.constructor = e5; } function a2(e5, t5, r4) { if (a2.isBN(e5)) return e5; this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== e5 && ("le" !== t5 && "be" !== t5 || (r4 = t5, t5 = 10), this._init(e5 || 0, t5 || 10, r4 || "be")); } var s2; "object" === (0, n2.default)(e4) ? e4.exports = a2 : (void 0).BN = a2, a2.BN = a2, a2.wordSize = 26; try { s2 = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : r3(29033).Buffer; } catch (e5) { } function u2(e5, t5) { var r4 = e5.charCodeAt(t5); return r4 >= 48 && r4 <= 57 ? r4 - 48 : r4 >= 65 && r4 <= 70 ? r4 - 55 : r4 >= 97 && r4 <= 102 ? r4 - 87 : void i2(false, "Invalid character in " + e5); } function c2(e5, t5, r4) { var n3 = u2(e5, r4); return r4 - 1 >= t5 && (n3 |= u2(e5, r4 - 1) << 4), n3; } function f2(e5, t5, r4, n3) { for (var o3 = 0, a3 = 0, s3 = Math.min(e5.length, r4), u3 = t5; u3 < s3; u3++) { var c3 = e5.charCodeAt(u3) - 48; o3 *= n3, a3 = c3 >= 49 ? c3 - 49 + 10 : c3 >= 17 ? c3 - 17 + 10 : c3, i2(c3 >= 0 && a3 < n3, "Invalid character"), o3 += a3; } return o3; } function d2(e5, t5) { e5.words = t5.words, e5.length = t5.length, e5.negative = t5.negative, e5.red = t5.red; } if (a2.isBN = function(e5) { return e5 instanceof a2 || null !== e5 && "object" === (0, n2.default)(e5) && e5.constructor.wordSize === a2.wordSize && Array.isArray(e5.words); }, a2.max = function(e5, t5) { return e5.cmp(t5) > 0 ? e5 : t5; }, a2.min = function(e5, t5) { return e5.cmp(t5) < 0 ? e5 : t5; }, a2.prototype._init = function(e5, t5, r4) { if ("number" == typeof e5) return this._initNumber(e5, t5, r4); if ("object" === (0, n2.default)(e5)) return this._initArray(e5, t5, r4); "hex" === t5 && (t5 = 16), i2(t5 === (0 | t5) && t5 >= 2 && t5 <= 36); var o3 = 0; "-" === (e5 = e5.toString().replace(/\s+/g, ""))[0] && (o3++, this.negative = 1), o3 < e5.length && (16 === t5 ? this._parseHex(e5, o3, r4) : (this._parseBase(e5, t5, o3), "le" === r4 && this._initArray(this.toArray(), t5, r4))); }, a2.prototype._initNumber = function(e5, t5, r4) { e5 < 0 && (this.negative = 1, e5 = -e5), e5 < 67108864 ? (this.words = [67108863 & e5], this.length = 1) : e5 < 4503599627370496 ? (this.words = [67108863 & e5, e5 / 67108864 & 67108863], this.length = 2) : (i2(e5 < 9007199254740992), this.words = [67108863 & e5, e5 / 67108864 & 67108863, 1], this.length = 3), "le" === r4 && this._initArray(this.toArray(), t5, r4); }, a2.prototype._initArray = function(e5, t5, r4) { if (i2("number" == typeof e5.length), e5.length <= 0) return this.words = [0], this.length = 1, this; this.length = Math.ceil(e5.length / 3), this.words = new Array(this.length); for (var n3 = 0; n3 < this.length; n3++) this.words[n3] = 0; var o3, a3, s3 = 0; if ("be" === r4) for (n3 = e5.length - 1, o3 = 0; n3 >= 0; n3 -= 3) a3 = e5[n3] | e5[n3 - 1] << 8 | e5[n3 - 2] << 16, this.words[o3] |= a3 << s3 & 67108863, this.words[o3 + 1] = a3 >>> 26 - s3 & 67108863, (s3 += 24) >= 26 && (s3 -= 26, o3++); else if ("le" === r4) for (n3 = 0, o3 = 0; n3 < e5.length; n3 += 3) a3 = e5[n3] | e5[n3 + 1] << 8 | e5[n3 + 2] << 16, this.words[o3] |= a3 << s3 & 67108863, this.words[o3 + 1] = a3 >>> 26 - s3 & 67108863, (s3 += 24) >= 26 && (s3 -= 26, o3++); return this._strip(); }, a2.prototype._parseHex = function(e5, t5, r4) { this.length = Math.ceil((e5.length - t5) / 6), this.words = new Array(this.length); for (var n3 = 0; n3 < this.length; n3++) this.words[n3] = 0; var i3, o3 = 0, a3 = 0; if ("be" === r4) for (n3 = e5.length - 1; n3 >= t5; n3 -= 2) i3 = c2(e5, t5, n3) << o3, this.words[a3] |= 67108863 & i3, o3 >= 18 ? (o3 -= 18, a3 += 1, this.words[a3] |= i3 >>> 26) : o3 += 8; else for (n3 = (e5.length - t5) % 2 == 0 ? t5 + 1 : t5; n3 < e5.length; n3 += 2) i3 = c2(e5, t5, n3) << o3, this.words[a3] |= 67108863 & i3, o3 >= 18 ? (o3 -= 18, a3 += 1, this.words[a3] |= i3 >>> 26) : o3 += 8; this._strip(); }, a2.prototype._parseBase = function(e5, t5, r4) { this.words = [0], this.length = 1; for (var n3 = 0, i3 = 1; i3 <= 67108863; i3 *= t5) n3++; n3--, i3 = i3 / t5 | 0; for (var o3 = e5.length - r4, a3 = o3 % n3, s3 = Math.min(o3, o3 - a3) + r4, u3 = 0, c3 = r4; c3 < s3; c3 += n3) u3 = f2(e5, c3, c3 + n3, t5), this.imuln(i3), this.words[0] + u3 < 67108864 ? this.words[0] += u3 : this._iaddn(u3); if (0 !== a3) { var d3 = 1; for (u3 = f2(e5, c3, e5.length, t5), c3 = 0; c3 < a3; c3++) d3 *= t5; this.imuln(d3), this.words[0] + u3 < 67108864 ? this.words[0] += u3 : this._iaddn(u3); } this._strip(); }, a2.prototype.copy = function(e5) { e5.words = new Array(this.length); for (var t5 = 0; t5 < this.length; t5++) e5.words[t5] = this.words[t5]; e5.length = this.length, e5.negative = this.negative, e5.red = this.red; }, a2.prototype._move = function(e5) { d2(e5, this); }, a2.prototype.clone = function() { var e5 = new a2(null); return this.copy(e5), e5; }, a2.prototype._expand = function(e5) { for (; this.length < e5; ) this.words[this.length++] = 0; return this; }, a2.prototype._strip = function() { for (; this.length > 1 && 0 === this.words[this.length - 1]; ) this.length--; return this._normSign(); }, a2.prototype._normSign = function() { return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this; }, "undefined" != typeof Symbol && "function" == typeof Symbol.for) try { a2.prototype[Symbol.for("nodejs.util.inspect.custom")] = l2; } catch (e5) { a2.prototype.inspect = l2; } else a2.prototype.inspect = l2; function l2() { return (this.red ? ""; } var h2 = ["", "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"], p2 = [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], b2 = [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]; function y2(e5, t5, r4) { r4.negative = t5.negative ^ e5.negative; var n3 = e5.length + t5.length | 0; r4.length = n3, n3 = n3 - 1 | 0; var i3 = 0 | e5.words[0], o3 = 0 | t5.words[0], a3 = i3 * o3, s3 = 67108863 & a3, u3 = a3 / 67108864 | 0; r4.words[0] = s3; for (var c3 = 1; c3 < n3; c3++) { for (var f3 = u3 >>> 26, d3 = 67108863 & u3, l3 = Math.min(c3, t5.length - 1), h3 = Math.max(0, c3 - e5.length + 1); h3 <= l3; h3++) { var p3 = c3 - h3 | 0; f3 += (a3 = (i3 = 0 | e5.words[p3]) * (o3 = 0 | t5.words[h3]) + d3) / 67108864 | 0, d3 = 67108863 & a3; } r4.words[c3] = 0 | d3, u3 = 0 | f3; } return 0 !== u3 ? r4.words[c3] = 0 | u3 : r4.length--, r4._strip(); } a2.prototype.toString = function(e5, t5) { var r4; if (t5 = 0 | t5 || 1, 16 === (e5 = e5 || 10) || "hex" === e5) { r4 = ""; for (var n3 = 0, o3 = 0, a3 = 0; a3 < this.length; a3++) { var s3 = this.words[a3], u3 = (16777215 & (s3 << n3 | o3)).toString(16); o3 = s3 >>> 24 - n3 & 16777215, (n3 += 2) >= 26 && (n3 -= 26, a3--), r4 = 0 !== o3 || a3 !== this.length - 1 ? h2[6 - u3.length] + u3 + r4 : u3 + r4; } for (0 !== o3 && (r4 = o3.toString(16) + r4); r4.length % t5 != 0; ) r4 = "0" + r4; return 0 !== this.negative && (r4 = "-" + r4), r4; } if (e5 === (0 | e5) && e5 >= 2 && e5 <= 36) { var c3 = p2[e5], f3 = b2[e5]; r4 = ""; var d3 = this.clone(); for (d3.negative = 0; !d3.isZero(); ) { var l3 = d3.modrn(f3).toString(e5); r4 = (d3 = d3.idivn(f3)).isZero() ? l3 + r4 : h2[c3 - l3.length] + l3 + r4; } for (this.isZero() && (r4 = "0" + r4); r4.length % t5 != 0; ) r4 = "0" + r4; return 0 !== this.negative && (r4 = "-" + r4), r4; } i2(false, "Base should be between 2 and 36"); }, a2.prototype.toNumber = function() { var e5 = this.words[0]; return 2 === this.length ? e5 += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? e5 += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && i2(false, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -e5 : e5; }, a2.prototype.toJSON = function() { return this.toString(16, 2); }, s2 && (a2.prototype.toBuffer = function(e5, t5) { return this.toArrayLike(s2, e5, t5); }), a2.prototype.toArray = function(e5, t5) { return this.toArrayLike(Array, e5, t5); }, a2.prototype.toArrayLike = function(e5, t5, r4) { this._strip(); var n3 = this.byteLength(), o3 = r4 || Math.max(1, n3); i2(n3 <= o3, "byte array longer than desired length"), i2(o3 > 0, "Requested array length <= 0"); var a3 = function(e6, t6) { return e6.allocUnsafe ? e6.allocUnsafe(t6) : new e6(t6); }(e5, o3); return this["_toArrayLike" + ("le" === t5 ? "LE" : "BE")](a3, n3), a3; }, a2.prototype._toArrayLikeLE = function(e5, t5) { for (var r4 = 0, n3 = 0, i3 = 0, o3 = 0; i3 < this.length; i3++) { var a3 = this.words[i3] << o3 | n3; e5[r4++] = 255 & a3, r4 < e5.length && (e5[r4++] = a3 >> 8 & 255), r4 < e5.length && (e5[r4++] = a3 >> 16 & 255), 6 === o3 ? (r4 < e5.length && (e5[r4++] = a3 >> 24 & 255), n3 = 0, o3 = 0) : (n3 = a3 >>> 24, o3 += 2); } if (r4 < e5.length) for (e5[r4++] = n3; r4 < e5.length; ) e5[r4++] = 0; }, a2.prototype._toArrayLikeBE = function(e5, t5) { for (var r4 = e5.length - 1, n3 = 0, i3 = 0, o3 = 0; i3 < this.length; i3++) { var a3 = this.words[i3] << o3 | n3; e5[r4--] = 255 & a3, r4 >= 0 && (e5[r4--] = a3 >> 8 & 255), r4 >= 0 && (e5[r4--] = a3 >> 16 & 255), 6 === o3 ? (r4 >= 0 && (e5[r4--] = a3 >> 24 & 255), n3 = 0, o3 = 0) : (n3 = a3 >>> 24, o3 += 2); } if (r4 >= 0) for (e5[r4--] = n3; r4 >= 0; ) e5[r4--] = 0; }, Math.clz32 ? a2.prototype._countBits = function(e5) { return 32 - Math.clz32(e5); } : a2.prototype._countBits = function(e5) { var t5 = e5, r4 = 0; return t5 >= 4096 && (r4 += 13, t5 >>>= 13), t5 >= 64 && (r4 += 7, t5 >>>= 7), t5 >= 8 && (r4 += 4, t5 >>>= 4), t5 >= 2 && (r4 += 2, t5 >>>= 2), r4 + t5; }, a2.prototype._zeroBits = function(e5) { if (0 === e5) return 26; var t5 = e5, r4 = 0; return 0 == (8191 & t5) && (r4 += 13, t5 >>>= 13), 0 == (127 & t5) && (r4 += 7, t5 >>>= 7), 0 == (15 & t5) && (r4 += 4, t5 >>>= 4), 0 == (3 & t5) && (r4 += 2, t5 >>>= 2), 0 == (1 & t5) && r4++, r4; }, a2.prototype.bitLength = function() { var e5 = this.words[this.length - 1], t5 = this._countBits(e5); return 26 * (this.length - 1) + t5; }, a2.prototype.zeroBits = function() { if (this.isZero()) return 0; for (var e5 = 0, t5 = 0; t5 < this.length; t5++) { var r4 = this._zeroBits(this.words[t5]); if (e5 += r4, 26 !== r4) break; } return e5; }, a2.prototype.byteLength = function() { return Math.ceil(this.bitLength() / 8); }, a2.prototype.toTwos = function(e5) { return 0 !== this.negative ? this.abs().inotn(e5).iaddn(1) : this.clone(); }, a2.prototype.fromTwos = function(e5) { return this.testn(e5 - 1) ? this.notn(e5).iaddn(1).ineg() : this.clone(); }, a2.prototype.isNeg = function() { return 0 !== this.negative; }, a2.prototype.neg = function() { return this.clone().ineg(); }, a2.prototype.ineg = function() { return this.isZero() || (this.negative ^= 1), this; }, a2.prototype.iuor = function(e5) { for (; this.length < e5.length; ) this.words[this.length++] = 0; for (var t5 = 0; t5 < e5.length; t5++) this.words[t5] = this.words[t5] | e5.words[t5]; return this._strip(); }, a2.prototype.ior = function(e5) { return i2(0 == (this.negative | e5.negative)), this.iuor(e5); }, a2.prototype.or = function(e5) { return this.length > e5.length ? this.clone().ior(e5) : e5.clone().ior(this); }, a2.prototype.uor = function(e5) { return this.length > e5.length ? this.clone().iuor(e5) : e5.clone().iuor(this); }, a2.prototype.iuand = function(e5) { var t5; t5 = this.length > e5.length ? e5 : this; for (var r4 = 0; r4 < t5.length; r4++) this.words[r4] = this.words[r4] & e5.words[r4]; return this.length = t5.length, this._strip(); }, a2.prototype.iand = function(e5) { return i2(0 == (this.negative | e5.negative)), this.iuand(e5); }, a2.prototype.and = function(e5) { return this.length > e5.length ? this.clone().iand(e5) : e5.clone().iand(this); }, a2.prototype.uand = function(e5) { return this.length > e5.length ? this.clone().iuand(e5) : e5.clone().iuand(this); }, a2.prototype.iuxor = function(e5) { var t5, r4; this.length > e5.length ? (t5 = this, r4 = e5) : (t5 = e5, r4 = this); for (var n3 = 0; n3 < r4.length; n3++) this.words[n3] = t5.words[n3] ^ r4.words[n3]; if (this !== t5) for (; n3 < t5.length; n3++) this.words[n3] = t5.words[n3]; return this.length = t5.length, this._strip(); }, a2.prototype.ixor = function(e5) { return i2(0 == (this.negative | e5.negative)), this.iuxor(e5); }, a2.prototype.xor = function(e5) { return this.length > e5.length ? this.clone().ixor(e5) : e5.clone().ixor(this); }, a2.prototype.uxor = function(e5) { return this.length > e5.length ? this.clone().iuxor(e5) : e5.clone().iuxor(this); }, a2.prototype.inotn = function(e5) { i2("number" == typeof e5 && e5 >= 0); var t5 = 0 | Math.ceil(e5 / 26), r4 = e5 % 26; this._expand(t5), r4 > 0 && t5--; for (var n3 = 0; n3 < t5; n3++) this.words[n3] = 67108863 & ~this.words[n3]; return r4 > 0 && (this.words[n3] = ~this.words[n3] & 67108863 >> 26 - r4), this._strip(); }, a2.prototype.notn = function(e5) { return this.clone().inotn(e5); }, a2.prototype.setn = function(e5, t5) { i2("number" == typeof e5 && e5 >= 0); var r4 = e5 / 26 | 0, n3 = e5 % 26; return this._expand(r4 + 1), this.words[r4] = t5 ? this.words[r4] | 1 << n3 : this.words[r4] & ~(1 << n3), this._strip(); }, a2.prototype.iadd = function(e5) { var t5, r4, n3; if (0 !== this.negative && 0 === e5.negative) return this.negative = 0, t5 = this.isub(e5), this.negative ^= 1, this._normSign(); if (0 === this.negative && 0 !== e5.negative) return e5.negative = 0, t5 = this.isub(e5), e5.negative = 1, t5._normSign(); this.length > e5.length ? (r4 = this, n3 = e5) : (r4 = e5, n3 = this); for (var i3 = 0, o3 = 0; o3 < n3.length; o3++) t5 = (0 | r4.words[o3]) + (0 | n3.words[o3]) + i3, this.words[o3] = 67108863 & t5, i3 = t5 >>> 26; for (; 0 !== i3 && o3 < r4.length; o3++) t5 = (0 | r4.words[o3]) + i3, this.words[o3] = 67108863 & t5, i3 = t5 >>> 26; if (this.length = r4.length, 0 !== i3) this.words[this.length] = i3, this.length++; else if (r4 !== this) for (; o3 < r4.length; o3++) this.words[o3] = r4.words[o3]; return this; }, a2.prototype.add = function(e5) { var t5; return 0 !== e5.negative && 0 === this.negative ? (e5.negative = 0, t5 = this.sub(e5), e5.negative ^= 1, t5) : 0 === e5.negative && 0 !== this.negative ? (this.negative = 0, t5 = e5.sub(this), this.negative = 1, t5) : this.length > e5.length ? this.clone().iadd(e5) : e5.clone().iadd(this); }, a2.prototype.isub = function(e5) { if (0 !== e5.negative) { e5.negative = 0; var t5 = this.iadd(e5); return e5.negative = 1, t5._normSign(); } if (0 !== this.negative) return this.negative = 0, this.iadd(e5), this.negative = 1, this._normSign(); var r4, n3, i3 = this.cmp(e5); if (0 === i3) return this.negative = 0, this.length = 1, this.words[0] = 0, this; i3 > 0 ? (r4 = this, n3 = e5) : (r4 = e5, n3 = this); for (var o3 = 0, a3 = 0; a3 < n3.length; a3++) o3 = (t5 = (0 | r4.words[a3]) - (0 | n3.words[a3]) + o3) >> 26, this.words[a3] = 67108863 & t5; for (; 0 !== o3 && a3 < r4.length; a3++) o3 = (t5 = (0 | r4.words[a3]) + o3) >> 26, this.words[a3] = 67108863 & t5; if (0 === o3 && a3 < r4.length && r4 !== this) for (; a3 < r4.length; a3++) this.words[a3] = r4.words[a3]; return this.length = Math.max(this.length, a3), r4 !== this && (this.negative = 1), this._strip(); }, a2.prototype.sub = function(e5) { return this.clone().isub(e5); }; var v2 = function(e5, t5, r4) { var n3, i3, o3, a3 = e5.words, s3 = t5.words, u3 = r4.words, c3 = 0, f3 = 0 | a3[0], d3 = 8191 & f3, l3 = f3 >>> 13, h3 = 0 | a3[1], p3 = 8191 & h3, b3 = h3 >>> 13, y3 = 0 | a3[2], v3 = 8191 & y3, m3 = y3 >>> 13, g3 = 0 | a3[3], w2 = 8191 & g3, k3 = g3 >>> 13, _3 = 0 | a3[4], A3 = 8191 & _3, E3 = _3 >>> 13, S3 = 0 | a3[5], x3 = 8191 & S3, B3 = S3 >>> 13, O3 = 0 | a3[6], P2 = 8191 & O3, I2 = O3 >>> 13, T2 = 0 | a3[7], C2 = 8191 & T2, M2 = T2 >>> 13, R2 = 0 | a3[8], U2 = 8191 & R2, N2 = R2 >>> 13, j2 = 0 | a3[9], L2 = 8191 & j2, F2 = j2 >>> 13, D2 = 0 | s3[0], H2 = 8191 & D2, z2 = D2 >>> 13, q2 = 0 | s3[1], K2 = 8191 & q2, G2 = q2 >>> 13, V2 = 0 | s3[2], Z2 = 8191 & V2, W2 = V2 >>> 13, J2 = 0 | s3[3], Y2 = 8191 & J2, X2 = J2 >>> 13, Q2 = 0 | s3[4], $2 = 8191 & Q2, ee2 = Q2 >>> 13, te2 = 0 | s3[5], re2 = 8191 & te2, ne2 = te2 >>> 13, ie2 = 0 | s3[6], oe2 = 8191 & ie2, ae2 = ie2 >>> 13, se2 = 0 | s3[7], ue2 = 8191 & se2, ce2 = se2 >>> 13, fe2 = 0 | s3[8], de2 = 8191 & fe2, le2 = fe2 >>> 13, he2 = 0 | s3[9], pe2 = 8191 & he2, be2 = he2 >>> 13; r4.negative = e5.negative ^ t5.negative, r4.length = 19; var ye2 = (c3 + (n3 = Math.imul(d3, H2)) | 0) + ((8191 & (i3 = (i3 = Math.imul(d3, z2)) + Math.imul(l3, H2) | 0)) << 13) | 0; c3 = ((o3 = Math.imul(l3, z2)) + (i3 >>> 13) | 0) + (ye2 >>> 26) | 0, ye2 &= 67108863, n3 = Math.imul(p3, H2), i3 = (i3 = Math.imul(p3, z2)) + Math.imul(b3, H2) | 0, o3 = Math.imul(b3, z2); var ve2 = (c3 + (n3 = n3 + Math.imul(d3, K2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, G2) | 0) + Math.imul(l3, K2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(l3, G2) | 0) + (i3 >>> 13) | 0) + (ve2 >>> 26) | 0, ve2 &= 67108863, n3 = Math.imul(v3, H2), i3 = (i3 = Math.imul(v3, z2)) + Math.imul(m3, H2) | 0, o3 = Math.imul(m3, z2), n3 = n3 + Math.imul(p3, K2) | 0, i3 = (i3 = i3 + Math.imul(p3, G2) | 0) + Math.imul(b3, K2) | 0, o3 = o3 + Math.imul(b3, G2) | 0; var me2 = (c3 + (n3 = n3 + Math.imul(d3, Z2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, W2) | 0) + Math.imul(l3, Z2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(l3, W2) | 0) + (i3 >>> 13) | 0) + (me2 >>> 26) | 0, me2 &= 67108863, n3 = Math.imul(w2, H2), i3 = (i3 = Math.imul(w2, z2)) + Math.imul(k3, H2) | 0, o3 = Math.imul(k3, z2), n3 = n3 + Math.imul(v3, K2) | 0, i3 = (i3 = i3 + Math.imul(v3, G2) | 0) + Math.imul(m3, K2) | 0, o3 = o3 + Math.imul(m3, G2) | 0, n3 = n3 + Math.imul(p3, Z2) | 0, i3 = (i3 = i3 + Math.imul(p3, W2) | 0) + Math.imul(b3, Z2) | 0, o3 = o3 + Math.imul(b3, W2) | 0; var ge2 = (c3 + (n3 = n3 + Math.imul(d3, Y2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, X2) | 0) + Math.imul(l3, Y2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(l3, X2) | 0) + (i3 >>> 13) | 0) + (ge2 >>> 26) | 0, ge2 &= 67108863, n3 = Math.imul(A3, H2), i3 = (i3 = Math.imul(A3, z2)) + Math.imul(E3, H2) | 0, o3 = Math.imul(E3, z2), n3 = n3 + Math.imul(w2, K2) | 0, i3 = (i3 = i3 + Math.imul(w2, G2) | 0) + Math.imul(k3, K2) | 0, o3 = o3 + Math.imul(k3, G2) | 0, n3 = n3 + Math.imul(v3, Z2) | 0, i3 = (i3 = i3 + Math.imul(v3, W2) | 0) + Math.imul(m3, Z2) | 0, o3 = o3 + Math.imul(m3, W2) | 0, n3 = n3 + Math.imul(p3, Y2) | 0, i3 = (i3 = i3 + Math.imul(p3, X2) | 0) + Math.imul(b3, Y2) | 0, o3 = o3 + Math.imul(b3, X2) | 0; var we2 = (c3 + (n3 = n3 + Math.imul(d3, $2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, ee2) | 0) + Math.imul(l3, $2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(l3, ee2) | 0) + (i3 >>> 13) | 0) + (we2 >>> 26) | 0, we2 &= 67108863, n3 = Math.imul(x3, H2), i3 = (i3 = Math.imul(x3, z2)) + Math.imul(B3, H2) | 0, o3 = Math.imul(B3, z2), n3 = n3 + Math.imul(A3, K2) | 0, i3 = (i3 = i3 + Math.imul(A3, G2) | 0) + Math.imul(E3, K2) | 0, o3 = o3 + Math.imul(E3, G2) | 0, n3 = n3 + Math.imul(w2, Z2) | 0, i3 = (i3 = i3 + Math.imul(w2, W2) | 0) + Math.imul(k3, Z2) | 0, o3 = o3 + Math.imul(k3, W2) | 0, n3 = n3 + Math.imul(v3, Y2) | 0, i3 = (i3 = i3 + Math.imul(v3, X2) | 0) + Math.imul(m3, Y2) | 0, o3 = o3 + Math.imul(m3, X2) | 0, n3 = n3 + Math.imul(p3, $2) | 0, i3 = (i3 = i3 + Math.imul(p3, ee2) | 0) + Math.imul(b3, $2) | 0, o3 = o3 + Math.imul(b3, ee2) | 0; var ke2 = (c3 + (n3 = n3 + Math.imul(d3, re2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, ne2) | 0) + Math.imul(l3, re2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(l3, ne2) | 0) + (i3 >>> 13) | 0) + (ke2 >>> 26) | 0, ke2 &= 67108863, n3 = Math.imul(P2, H2), i3 = (i3 = Math.imul(P2, z2)) + Math.imul(I2, H2) | 0, o3 = Math.imul(I2, z2), n3 = n3 + Math.imul(x3, K2) | 0, i3 = (i3 = i3 + Math.imul(x3, G2) | 0) + Math.imul(B3, K2) | 0, o3 = o3 + Math.imul(B3, G2) | 0, n3 = n3 + Math.imul(A3, Z2) | 0, i3 = (i3 = i3 + Math.imul(A3, W2) | 0) + Math.imul(E3, Z2) | 0, o3 = o3 + Math.imul(E3, W2) | 0, n3 = n3 + Math.imul(w2, Y2) | 0, i3 = (i3 = i3 + Math.imul(w2, X2) | 0) + Math.imul(k3, Y2) | 0, o3 = o3 + Math.imul(k3, X2) | 0, n3 = n3 + Math.imul(v3, $2) | 0, i3 = (i3 = i3 + Math.imul(v3, ee2) | 0) + Math.imul(m3, $2) | 0, o3 = o3 + Math.imul(m3, ee2) | 0, n3 = n3 + Math.imul(p3, re2) | 0, i3 = (i3 = i3 + Math.imul(p3, ne2) | 0) + Math.imul(b3, re2) | 0, o3 = o3 + Math.imul(b3, ne2) | 0; var _e2 = (c3 + (n3 = n3 + Math.imul(d3, oe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, ae2) | 0) + Math.imul(l3, oe2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(l3, ae2) | 0) + (i3 >>> 13) | 0) + (_e2 >>> 26) | 0, _e2 &= 67108863, n3 = Math.imul(C2, H2), i3 = (i3 = Math.imul(C2, z2)) + Math.imul(M2, H2) | 0, o3 = Math.imul(M2, z2), n3 = n3 + Math.imul(P2, K2) | 0, i3 = (i3 = i3 + Math.imul(P2, G2) | 0) + Math.imul(I2, K2) | 0, o3 = o3 + Math.imul(I2, G2) | 0, n3 = n3 + Math.imul(x3, Z2) | 0, i3 = (i3 = i3 + Math.imul(x3, W2) | 0) + Math.imul(B3, Z2) | 0, o3 = o3 + Math.imul(B3, W2) | 0, n3 = n3 + Math.imul(A3, Y2) | 0, i3 = (i3 = i3 + Math.imul(A3, X2) | 0) + Math.imul(E3, Y2) | 0, o3 = o3 + Math.imul(E3, X2) | 0, n3 = n3 + Math.imul(w2, $2) | 0, i3 = (i3 = i3 + Math.imul(w2, ee2) | 0) + Math.imul(k3, $2) | 0, o3 = o3 + Math.imul(k3, ee2) | 0, n3 = n3 + Math.imul(v3, re2) | 0, i3 = (i3 = i3 + Math.imul(v3, ne2) | 0) + Math.imul(m3, re2) | 0, o3 = o3 + Math.imul(m3, ne2) | 0, n3 = n3 + Math.imul(p3, oe2) | 0, i3 = (i3 = i3 + Math.imul(p3, ae2) | 0) + Math.imul(b3, oe2) | 0, o3 = o3 + Math.imul(b3, ae2) | 0; var Ae2 = (c3 + (n3 = n3 + Math.imul(d3, ue2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, ce2) | 0) + Math.imul(l3, ue2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(l3, ce2) | 0) + (i3 >>> 13) | 0) + (Ae2 >>> 26) | 0, Ae2 &= 67108863, n3 = Math.imul(U2, H2), i3 = (i3 = Math.imul(U2, z2)) + Math.imul(N2, H2) | 0, o3 = Math.imul(N2, z2), n3 = n3 + Math.imul(C2, K2) | 0, i3 = (i3 = i3 + Math.imul(C2, G2) | 0) + Math.imul(M2, K2) | 0, o3 = o3 + Math.imul(M2, G2) | 0, n3 = n3 + Math.imul(P2, Z2) | 0, i3 = (i3 = i3 + Math.imul(P2, W2) | 0) + Math.imul(I2, Z2) | 0, o3 = o3 + Math.imul(I2, W2) | 0, n3 = n3 + Math.imul(x3, Y2) | 0, i3 = (i3 = i3 + Math.imul(x3, X2) | 0) + Math.imul(B3, Y2) | 0, o3 = o3 + Math.imul(B3, X2) | 0, n3 = n3 + Math.imul(A3, $2) | 0, i3 = (i3 = i3 + Math.imul(A3, ee2) | 0) + Math.imul(E3, $2) | 0, o3 = o3 + Math.imul(E3, ee2) | 0, n3 = n3 + Math.imul(w2, re2) | 0, i3 = (i3 = i3 + Math.imul(w2, ne2) | 0) + Math.imul(k3, re2) | 0, o3 = o3 + Math.imul(k3, ne2) | 0, n3 = n3 + Math.imul(v3, oe2) | 0, i3 = (i3 = i3 + Math.imul(v3, ae2) | 0) + Math.imul(m3, oe2) | 0, o3 = o3 + Math.imul(m3, ae2) | 0, n3 = n3 + Math.imul(p3, ue2) | 0, i3 = (i3 = i3 + Math.imul(p3, ce2) | 0) + Math.imul(b3, ue2) | 0, o3 = o3 + Math.imul(b3, ce2) | 0; var Ee2 = (c3 + (n3 = n3 + Math.imul(d3, de2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, le2) | 0) + Math.imul(l3, de2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(l3, le2) | 0) + (i3 >>> 13) | 0) + (Ee2 >>> 26) | 0, Ee2 &= 67108863, n3 = Math.imul(L2, H2), i3 = (i3 = Math.imul(L2, z2)) + Math.imul(F2, H2) | 0, o3 = Math.imul(F2, z2), n3 = n3 + Math.imul(U2, K2) | 0, i3 = (i3 = i3 + Math.imul(U2, G2) | 0) + Math.imul(N2, K2) | 0, o3 = o3 + Math.imul(N2, G2) | 0, n3 = n3 + Math.imul(C2, Z2) | 0, i3 = (i3 = i3 + Math.imul(C2, W2) | 0) + Math.imul(M2, Z2) | 0, o3 = o3 + Math.imul(M2, W2) | 0, n3 = n3 + Math.imul(P2, Y2) | 0, i3 = (i3 = i3 + Math.imul(P2, X2) | 0) + Math.imul(I2, Y2) | 0, o3 = o3 + Math.imul(I2, X2) | 0, n3 = n3 + Math.imul(x3, $2) | 0, i3 = (i3 = i3 + Math.imul(x3, ee2) | 0) + Math.imul(B3, $2) | 0, o3 = o3 + Math.imul(B3, ee2) | 0, n3 = n3 + Math.imul(A3, re2) | 0, i3 = (i3 = i3 + Math.imul(A3, ne2) | 0) + Math.imul(E3, re2) | 0, o3 = o3 + Math.imul(E3, ne2) | 0, n3 = n3 + Math.imul(w2, oe2) | 0, i3 = (i3 = i3 + Math.imul(w2, ae2) | 0) + Math.imul(k3, oe2) | 0, o3 = o3 + Math.imul(k3, ae2) | 0, n3 = n3 + Math.imul(v3, ue2) | 0, i3 = (i3 = i3 + Math.imul(v3, ce2) | 0) + Math.imul(m3, ue2) | 0, o3 = o3 + Math.imul(m3, ce2) | 0, n3 = n3 + Math.imul(p3, de2) | 0, i3 = (i3 = i3 + Math.imul(p3, le2) | 0) + Math.imul(b3, de2) | 0, o3 = o3 + Math.imul(b3, le2) | 0; var Se = (c3 + (n3 = n3 + Math.imul(d3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(d3, be2) | 0) + Math.imul(l3, pe2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(l3, be2) | 0) + (i3 >>> 13) | 0) + (Se >>> 26) | 0, Se &= 67108863, n3 = Math.imul(L2, K2), i3 = (i3 = Math.imul(L2, G2)) + Math.imul(F2, K2) | 0, o3 = Math.imul(F2, G2), n3 = n3 + Math.imul(U2, Z2) | 0, i3 = (i3 = i3 + Math.imul(U2, W2) | 0) + Math.imul(N2, Z2) | 0, o3 = o3 + Math.imul(N2, W2) | 0, n3 = n3 + Math.imul(C2, Y2) | 0, i3 = (i3 = i3 + Math.imul(C2, X2) | 0) + Math.imul(M2, Y2) | 0, o3 = o3 + Math.imul(M2, X2) | 0, n3 = n3 + Math.imul(P2, $2) | 0, i3 = (i3 = i3 + Math.imul(P2, ee2) | 0) + Math.imul(I2, $2) | 0, o3 = o3 + Math.imul(I2, ee2) | 0, n3 = n3 + Math.imul(x3, re2) | 0, i3 = (i3 = i3 + Math.imul(x3, ne2) | 0) + Math.imul(B3, re2) | 0, o3 = o3 + Math.imul(B3, ne2) | 0, n3 = n3 + Math.imul(A3, oe2) | 0, i3 = (i3 = i3 + Math.imul(A3, ae2) | 0) + Math.imul(E3, oe2) | 0, o3 = o3 + Math.imul(E3, ae2) | 0, n3 = n3 + Math.imul(w2, ue2) | 0, i3 = (i3 = i3 + Math.imul(w2, ce2) | 0) + Math.imul(k3, ue2) | 0, o3 = o3 + Math.imul(k3, ce2) | 0, n3 = n3 + Math.imul(v3, de2) | 0, i3 = (i3 = i3 + Math.imul(v3, le2) | 0) + Math.imul(m3, de2) | 0, o3 = o3 + Math.imul(m3, le2) | 0; var xe2 = (c3 + (n3 = n3 + Math.imul(p3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(p3, be2) | 0) + Math.imul(b3, pe2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(b3, be2) | 0) + (i3 >>> 13) | 0) + (xe2 >>> 26) | 0, xe2 &= 67108863, n3 = Math.imul(L2, Z2), i3 = (i3 = Math.imul(L2, W2)) + Math.imul(F2, Z2) | 0, o3 = Math.imul(F2, W2), n3 = n3 + Math.imul(U2, Y2) | 0, i3 = (i3 = i3 + Math.imul(U2, X2) | 0) + Math.imul(N2, Y2) | 0, o3 = o3 + Math.imul(N2, X2) | 0, n3 = n3 + Math.imul(C2, $2) | 0, i3 = (i3 = i3 + Math.imul(C2, ee2) | 0) + Math.imul(M2, $2) | 0, o3 = o3 + Math.imul(M2, ee2) | 0, n3 = n3 + Math.imul(P2, re2) | 0, i3 = (i3 = i3 + Math.imul(P2, ne2) | 0) + Math.imul(I2, re2) | 0, o3 = o3 + Math.imul(I2, ne2) | 0, n3 = n3 + Math.imul(x3, oe2) | 0, i3 = (i3 = i3 + Math.imul(x3, ae2) | 0) + Math.imul(B3, oe2) | 0, o3 = o3 + Math.imul(B3, ae2) | 0, n3 = n3 + Math.imul(A3, ue2) | 0, i3 = (i3 = i3 + Math.imul(A3, ce2) | 0) + Math.imul(E3, ue2) | 0, o3 = o3 + Math.imul(E3, ce2) | 0, n3 = n3 + Math.imul(w2, de2) | 0, i3 = (i3 = i3 + Math.imul(w2, le2) | 0) + Math.imul(k3, de2) | 0, o3 = o3 + Math.imul(k3, le2) | 0; var Be2 = (c3 + (n3 = n3 + Math.imul(v3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(v3, be2) | 0) + Math.imul(m3, pe2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(m3, be2) | 0) + (i3 >>> 13) | 0) + (Be2 >>> 26) | 0, Be2 &= 67108863, n3 = Math.imul(L2, Y2), i3 = (i3 = Math.imul(L2, X2)) + Math.imul(F2, Y2) | 0, o3 = Math.imul(F2, X2), n3 = n3 + Math.imul(U2, $2) | 0, i3 = (i3 = i3 + Math.imul(U2, ee2) | 0) + Math.imul(N2, $2) | 0, o3 = o3 + Math.imul(N2, ee2) | 0, n3 = n3 + Math.imul(C2, re2) | 0, i3 = (i3 = i3 + Math.imul(C2, ne2) | 0) + Math.imul(M2, re2) | 0, o3 = o3 + Math.imul(M2, ne2) | 0, n3 = n3 + Math.imul(P2, oe2) | 0, i3 = (i3 = i3 + Math.imul(P2, ae2) | 0) + Math.imul(I2, oe2) | 0, o3 = o3 + Math.imul(I2, ae2) | 0, n3 = n3 + Math.imul(x3, ue2) | 0, i3 = (i3 = i3 + Math.imul(x3, ce2) | 0) + Math.imul(B3, ue2) | 0, o3 = o3 + Math.imul(B3, ce2) | 0, n3 = n3 + Math.imul(A3, de2) | 0, i3 = (i3 = i3 + Math.imul(A3, le2) | 0) + Math.imul(E3, de2) | 0, o3 = o3 + Math.imul(E3, le2) | 0; var Oe2 = (c3 + (n3 = n3 + Math.imul(w2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(w2, be2) | 0) + Math.imul(k3, pe2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(k3, be2) | 0) + (i3 >>> 13) | 0) + (Oe2 >>> 26) | 0, Oe2 &= 67108863, n3 = Math.imul(L2, $2), i3 = (i3 = Math.imul(L2, ee2)) + Math.imul(F2, $2) | 0, o3 = Math.imul(F2, ee2), n3 = n3 + Math.imul(U2, re2) | 0, i3 = (i3 = i3 + Math.imul(U2, ne2) | 0) + Math.imul(N2, re2) | 0, o3 = o3 + Math.imul(N2, ne2) | 0, n3 = n3 + Math.imul(C2, oe2) | 0, i3 = (i3 = i3 + Math.imul(C2, ae2) | 0) + Math.imul(M2, oe2) | 0, o3 = o3 + Math.imul(M2, ae2) | 0, n3 = n3 + Math.imul(P2, ue2) | 0, i3 = (i3 = i3 + Math.imul(P2, ce2) | 0) + Math.imul(I2, ue2) | 0, o3 = o3 + Math.imul(I2, ce2) | 0, n3 = n3 + Math.imul(x3, de2) | 0, i3 = (i3 = i3 + Math.imul(x3, le2) | 0) + Math.imul(B3, de2) | 0, o3 = o3 + Math.imul(B3, le2) | 0; var Pe2 = (c3 + (n3 = n3 + Math.imul(A3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(A3, be2) | 0) + Math.imul(E3, pe2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(E3, be2) | 0) + (i3 >>> 13) | 0) + (Pe2 >>> 26) | 0, Pe2 &= 67108863, n3 = Math.imul(L2, re2), i3 = (i3 = Math.imul(L2, ne2)) + Math.imul(F2, re2) | 0, o3 = Math.imul(F2, ne2), n3 = n3 + Math.imul(U2, oe2) | 0, i3 = (i3 = i3 + Math.imul(U2, ae2) | 0) + Math.imul(N2, oe2) | 0, o3 = o3 + Math.imul(N2, ae2) | 0, n3 = n3 + Math.imul(C2, ue2) | 0, i3 = (i3 = i3 + Math.imul(C2, ce2) | 0) + Math.imul(M2, ue2) | 0, o3 = o3 + Math.imul(M2, ce2) | 0, n3 = n3 + Math.imul(P2, de2) | 0, i3 = (i3 = i3 + Math.imul(P2, le2) | 0) + Math.imul(I2, de2) | 0, o3 = o3 + Math.imul(I2, le2) | 0; var Ie2 = (c3 + (n3 = n3 + Math.imul(x3, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(x3, be2) | 0) + Math.imul(B3, pe2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(B3, be2) | 0) + (i3 >>> 13) | 0) + (Ie2 >>> 26) | 0, Ie2 &= 67108863, n3 = Math.imul(L2, oe2), i3 = (i3 = Math.imul(L2, ae2)) + Math.imul(F2, oe2) | 0, o3 = Math.imul(F2, ae2), n3 = n3 + Math.imul(U2, ue2) | 0, i3 = (i3 = i3 + Math.imul(U2, ce2) | 0) + Math.imul(N2, ue2) | 0, o3 = o3 + Math.imul(N2, ce2) | 0, n3 = n3 + Math.imul(C2, de2) | 0, i3 = (i3 = i3 + Math.imul(C2, le2) | 0) + Math.imul(M2, de2) | 0, o3 = o3 + Math.imul(M2, le2) | 0; var Te2 = (c3 + (n3 = n3 + Math.imul(P2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(P2, be2) | 0) + Math.imul(I2, pe2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(I2, be2) | 0) + (i3 >>> 13) | 0) + (Te2 >>> 26) | 0, Te2 &= 67108863, n3 = Math.imul(L2, ue2), i3 = (i3 = Math.imul(L2, ce2)) + Math.imul(F2, ue2) | 0, o3 = Math.imul(F2, ce2), n3 = n3 + Math.imul(U2, de2) | 0, i3 = (i3 = i3 + Math.imul(U2, le2) | 0) + Math.imul(N2, de2) | 0, o3 = o3 + Math.imul(N2, le2) | 0; var Ce2 = (c3 + (n3 = n3 + Math.imul(C2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(C2, be2) | 0) + Math.imul(M2, pe2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(M2, be2) | 0) + (i3 >>> 13) | 0) + (Ce2 >>> 26) | 0, Ce2 &= 67108863, n3 = Math.imul(L2, de2), i3 = (i3 = Math.imul(L2, le2)) + Math.imul(F2, de2) | 0, o3 = Math.imul(F2, le2); var Me2 = (c3 + (n3 = n3 + Math.imul(U2, pe2) | 0) | 0) + ((8191 & (i3 = (i3 = i3 + Math.imul(U2, be2) | 0) + Math.imul(N2, pe2) | 0)) << 13) | 0; c3 = ((o3 = o3 + Math.imul(N2, be2) | 0) + (i3 >>> 13) | 0) + (Me2 >>> 26) | 0, Me2 &= 67108863; var Re2 = (c3 + (n3 = Math.imul(L2, pe2)) | 0) + ((8191 & (i3 = (i3 = Math.imul(L2, be2)) + Math.imul(F2, pe2) | 0)) << 13) | 0; return c3 = ((o3 = Math.imul(F2, be2)) + (i3 >>> 13) | 0) + (Re2 >>> 26) | 0, Re2 &= 67108863, u3[0] = ye2, u3[1] = ve2, u3[2] = me2, u3[3] = ge2, u3[4] = we2, u3[5] = ke2, u3[6] = _e2, u3[7] = Ae2, u3[8] = Ee2, u3[9] = Se, u3[10] = xe2, u3[11] = Be2, u3[12] = Oe2, u3[13] = Pe2, u3[14] = Ie2, u3[15] = Te2, u3[16] = Ce2, u3[17] = Me2, u3[18] = Re2, 0 !== c3 && (u3[19] = c3, r4.length++), r4; }; function m2(e5, t5, r4) { r4.negative = t5.negative ^ e5.negative, r4.length = e5.length + t5.length; for (var n3 = 0, i3 = 0, o3 = 0; o3 < r4.length - 1; o3++) { var a3 = i3; i3 = 0; for (var s3 = 67108863 & n3, u3 = Math.min(o3, t5.length - 1), c3 = Math.max(0, o3 - e5.length + 1); c3 <= u3; c3++) { var f3 = o3 - c3, d3 = (0 | e5.words[f3]) * (0 | t5.words[c3]), l3 = 67108863 & d3; s3 = 67108863 & (l3 = l3 + s3 | 0), i3 += (a3 = (a3 = a3 + (d3 / 67108864 | 0) | 0) + (l3 >>> 26) | 0) >>> 26, a3 &= 67108863; } r4.words[o3] = s3, n3 = a3, a3 = i3; } return 0 !== n3 ? r4.words[o3] = n3 : r4.length--, r4._strip(); } function g2(e5, t5, r4) { return m2(e5, t5, r4); } Math.imul || (v2 = y2), a2.prototype.mulTo = function(e5, t5) { var r4 = this.length + e5.length; return 10 === this.length && 10 === e5.length ? v2(this, e5, t5) : r4 < 63 ? y2(this, e5, t5) : r4 < 1024 ? m2(this, e5, t5) : g2(this, e5, t5); }, a2.prototype.mul = function(e5) { var t5 = new a2(null); return t5.words = new Array(this.length + e5.length), this.mulTo(e5, t5); }, a2.prototype.mulf = function(e5) { var t5 = new a2(null); return t5.words = new Array(this.length + e5.length), g2(this, e5, t5); }, a2.prototype.imul = function(e5) { return this.clone().mulTo(e5, this); }, a2.prototype.imuln = function(e5) { var t5 = e5 < 0; t5 && (e5 = -e5), i2("number" == typeof e5), i2(e5 < 67108864); for (var r4 = 0, n3 = 0; n3 < this.length; n3++) { var o3 = (0 | this.words[n3]) * e5, a3 = (67108863 & o3) + (67108863 & r4); r4 >>= 26, r4 += o3 / 67108864 | 0, r4 += a3 >>> 26, this.words[n3] = 67108863 & a3; } return 0 !== r4 && (this.words[n3] = r4, this.length++), t5 ? this.ineg() : this; }, a2.prototype.muln = function(e5) { return this.clone().imuln(e5); }, a2.prototype.sqr = function() { return this.mul(this); }, a2.prototype.isqr = function() { return this.imul(this.clone()); }, a2.prototype.pow = function(e5) { var t5 = function(e6) { for (var t6 = new Array(e6.bitLength()), r5 = 0; r5 < t6.length; r5++) { var n4 = r5 / 26 | 0, i4 = r5 % 26; t6[r5] = e6.words[n4] >>> i4 & 1; } return t6; }(e5); if (0 === t5.length) return new a2(1); for (var r4 = this, n3 = 0; n3 < t5.length && 0 === t5[n3]; n3++, r4 = r4.sqr()) ; if (++n3 < t5.length) for (var i3 = r4.sqr(); n3 < t5.length; n3++, i3 = i3.sqr()) 0 !== t5[n3] && (r4 = r4.mul(i3)); return r4; }, a2.prototype.iushln = function(e5) { i2("number" == typeof e5 && e5 >= 0); var t5, r4 = e5 % 26, n3 = (e5 - r4) / 26, o3 = 67108863 >>> 26 - r4 << 26 - r4; if (0 !== r4) { var a3 = 0; for (t5 = 0; t5 < this.length; t5++) { var s3 = this.words[t5] & o3, u3 = (0 | this.words[t5]) - s3 << r4; this.words[t5] = u3 | a3, a3 = s3 >>> 26 - r4; } a3 && (this.words[t5] = a3, this.length++); } if (0 !== n3) { for (t5 = this.length - 1; t5 >= 0; t5--) this.words[t5 + n3] = this.words[t5]; for (t5 = 0; t5 < n3; t5++) this.words[t5] = 0; this.length += n3; } return this._strip(); }, a2.prototype.ishln = function(e5) { return i2(0 === this.negative), this.iushln(e5); }, a2.prototype.iushrn = function(e5, t5, r4) { var n3; i2("number" == typeof e5 && e5 >= 0), n3 = t5 ? (t5 - t5 % 26) / 26 : 0; var o3 = e5 % 26, a3 = Math.min((e5 - o3) / 26, this.length), s3 = 67108863 ^ 67108863 >>> o3 << o3, u3 = r4; if (n3 -= a3, n3 = Math.max(0, n3), u3) { for (var c3 = 0; c3 < a3; c3++) u3.words[c3] = this.words[c3]; u3.length = a3; } if (0 === a3) ; else if (this.length > a3) for (this.length -= a3, c3 = 0; c3 < this.length; c3++) this.words[c3] = this.words[c3 + a3]; else this.words[0] = 0, this.length = 1; var f3 = 0; for (c3 = this.length - 1; c3 >= 0 && (0 !== f3 || c3 >= n3); c3--) { var d3 = 0 | this.words[c3]; this.words[c3] = f3 << 26 - o3 | d3 >>> o3, f3 = d3 & s3; } return u3 && 0 !== f3 && (u3.words[u3.length++] = f3), 0 === this.length && (this.words[0] = 0, this.length = 1), this._strip(); }, a2.prototype.ishrn = function(e5, t5, r4) { return i2(0 === this.negative), this.iushrn(e5, t5, r4); }, a2.prototype.shln = function(e5) { return this.clone().ishln(e5); }, a2.prototype.ushln = function(e5) { return this.clone().iushln(e5); }, a2.prototype.shrn = function(e5) { return this.clone().ishrn(e5); }, a2.prototype.ushrn = function(e5) { return this.clone().iushrn(e5); }, a2.prototype.testn = function(e5) { i2("number" == typeof e5 && e5 >= 0); var t5 = e5 % 26, r4 = (e5 - t5) / 26, n3 = 1 << t5; return !(this.length <= r4 || !(this.words[r4] & n3)); }, a2.prototype.imaskn = function(e5) { i2("number" == typeof e5 && e5 >= 0); var t5 = e5 % 26, r4 = (e5 - t5) / 26; if (i2(0 === this.negative, "imaskn works only with positive numbers"), this.length <= r4) return this; if (0 !== t5 && r4++, this.length = Math.min(r4, this.length), 0 !== t5) { var n3 = 67108863 ^ 67108863 >>> t5 << t5; this.words[this.length - 1] &= n3; } return this._strip(); }, a2.prototype.maskn = function(e5) { return this.clone().imaskn(e5); }, a2.prototype.iaddn = function(e5) { return i2("number" == typeof e5), i2(e5 < 67108864), e5 < 0 ? this.isubn(-e5) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) <= e5 ? (this.words[0] = e5 - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(e5), this.negative = 1, this) : this._iaddn(e5); }, a2.prototype._iaddn = function(e5) { this.words[0] += e5; for (var t5 = 0; t5 < this.length && this.words[t5] >= 67108864; t5++) this.words[t5] -= 67108864, t5 === this.length - 1 ? this.words[t5 + 1] = 1 : this.words[t5 + 1]++; return this.length = Math.max(this.length, t5 + 1), this; }, a2.prototype.isubn = function(e5) { if (i2("number" == typeof e5), i2(e5 < 67108864), e5 < 0) return this.iaddn(-e5); if (0 !== this.negative) return this.negative = 0, this.iaddn(e5), this.negative = 1, this; if (this.words[0] -= e5, 1 === this.length && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1; else for (var t5 = 0; t5 < this.length && this.words[t5] < 0; t5++) this.words[t5] += 67108864, this.words[t5 + 1] -= 1; return this._strip(); }, a2.prototype.addn = function(e5) { return this.clone().iaddn(e5); }, a2.prototype.subn = function(e5) { return this.clone().isubn(e5); }, a2.prototype.iabs = function() { return this.negative = 0, this; }, a2.prototype.abs = function() { return this.clone().iabs(); }, a2.prototype._ishlnsubmul = function(e5, t5, r4) { var n3, o3, a3 = e5.length + r4; this._expand(a3); var s3 = 0; for (n3 = 0; n3 < e5.length; n3++) { o3 = (0 | this.words[n3 + r4]) + s3; var u3 = (0 | e5.words[n3]) * t5; s3 = ((o3 -= 67108863 & u3) >> 26) - (u3 / 67108864 | 0), this.words[n3 + r4] = 67108863 & o3; } for (; n3 < this.length - r4; n3++) s3 = (o3 = (0 | this.words[n3 + r4]) + s3) >> 26, this.words[n3 + r4] = 67108863 & o3; if (0 === s3) return this._strip(); for (i2(-1 === s3), s3 = 0, n3 = 0; n3 < this.length; n3++) s3 = (o3 = -(0 | this.words[n3]) + s3) >> 26, this.words[n3] = 67108863 & o3; return this.negative = 1, this._strip(); }, a2.prototype._wordDiv = function(e5, t5) { var r4 = (this.length, e5.length), n3 = this.clone(), i3 = e5, o3 = 0 | i3.words[i3.length - 1]; 0 != (r4 = 26 - this._countBits(o3)) && (i3 = i3.ushln(r4), n3.iushln(r4), o3 = 0 | i3.words[i3.length - 1]); var s3, u3 = n3.length - i3.length; if ("mod" !== t5) { (s3 = new a2(null)).length = u3 + 1, s3.words = new Array(s3.length); for (var c3 = 0; c3 < s3.length; c3++) s3.words[c3] = 0; } var f3 = n3.clone()._ishlnsubmul(i3, 1, u3); 0 === f3.negative && (n3 = f3, s3 && (s3.words[u3] = 1)); for (var d3 = u3 - 1; d3 >= 0; d3--) { var l3 = 67108864 * (0 | n3.words[i3.length + d3]) + (0 | n3.words[i3.length + d3 - 1]); for (l3 = Math.min(l3 / o3 | 0, 67108863), n3._ishlnsubmul(i3, l3, d3); 0 !== n3.negative; ) l3--, n3.negative = 0, n3._ishlnsubmul(i3, 1, d3), n3.isZero() || (n3.negative ^= 1); s3 && (s3.words[d3] = l3); } return s3 && s3._strip(), n3._strip(), "div" !== t5 && 0 !== r4 && n3.iushrn(r4), { div: s3 || null, mod: n3 }; }, a2.prototype.divmod = function(e5, t5, r4) { return i2(!e5.isZero()), this.isZero() ? { div: new a2(0), mod: new a2(0) } : 0 !== this.negative && 0 === e5.negative ? (s3 = this.neg().divmod(e5, t5), "mod" !== t5 && (n3 = s3.div.neg()), "div" !== t5 && (o3 = s3.mod.neg(), r4 && 0 !== o3.negative && o3.iadd(e5)), { div: n3, mod: o3 }) : 0 === this.negative && 0 !== e5.negative ? (s3 = this.divmod(e5.neg(), t5), "mod" !== t5 && (n3 = s3.div.neg()), { div: n3, mod: s3.mod }) : 0 != (this.negative & e5.negative) ? (s3 = this.neg().divmod(e5.neg(), t5), "div" !== t5 && (o3 = s3.mod.neg(), r4 && 0 !== o3.negative && o3.isub(e5)), { div: s3.div, mod: o3 }) : e5.length > this.length || this.cmp(e5) < 0 ? { div: new a2(0), mod: this } : 1 === e5.length ? "div" === t5 ? { div: this.divn(e5.words[0]), mod: null } : "mod" === t5 ? { div: null, mod: new a2(this.modrn(e5.words[0])) } : { div: this.divn(e5.words[0]), mod: new a2(this.modrn(e5.words[0])) } : this._wordDiv(e5, t5); var n3, o3, s3; }, a2.prototype.div = function(e5) { return this.divmod(e5, "div", false).div; }, a2.prototype.mod = function(e5) { return this.divmod(e5, "mod", false).mod; }, a2.prototype.umod = function(e5) { return this.divmod(e5, "mod", true).mod; }, a2.prototype.divRound = function(e5) { var t5 = this.divmod(e5); if (t5.mod.isZero()) return t5.div; var r4 = 0 !== t5.div.negative ? t5.mod.isub(e5) : t5.mod, n3 = e5.ushrn(1), i3 = e5.andln(1), o3 = r4.cmp(n3); return o3 < 0 || 1 === i3 && 0 === o3 ? t5.div : 0 !== t5.div.negative ? t5.div.isubn(1) : t5.div.iaddn(1); }, a2.prototype.modrn = function(e5) { var t5 = e5 < 0; t5 && (e5 = -e5), i2(e5 <= 67108863); for (var r4 = (1 << 26) % e5, n3 = 0, o3 = this.length - 1; o3 >= 0; o3--) n3 = (r4 * n3 + (0 | this.words[o3])) % e5; return t5 ? -n3 : n3; }, a2.prototype.modn = function(e5) { return this.modrn(e5); }, a2.prototype.idivn = function(e5) { var t5 = e5 < 0; t5 && (e5 = -e5), i2(e5 <= 67108863); for (var r4 = 0, n3 = this.length - 1; n3 >= 0; n3--) { var o3 = (0 | this.words[n3]) + 67108864 * r4; this.words[n3] = o3 / e5 | 0, r4 = o3 % e5; } return this._strip(), t5 ? this.ineg() : this; }, a2.prototype.divn = function(e5) { return this.clone().idivn(e5); }, a2.prototype.egcd = function(e5) { i2(0 === e5.negative), i2(!e5.isZero()); var t5 = this, r4 = e5.clone(); t5 = 0 !== t5.negative ? t5.umod(e5) : t5.clone(); for (var n3 = new a2(1), o3 = new a2(0), s3 = new a2(0), u3 = new a2(1), c3 = 0; t5.isEven() && r4.isEven(); ) t5.iushrn(1), r4.iushrn(1), ++c3; for (var f3 = r4.clone(), d3 = t5.clone(); !t5.isZero(); ) { for (var l3 = 0, h3 = 1; 0 == (t5.words[0] & h3) && l3 < 26; ++l3, h3 <<= 1) ; if (l3 > 0) for (t5.iushrn(l3); l3-- > 0; ) (n3.isOdd() || o3.isOdd()) && (n3.iadd(f3), o3.isub(d3)), n3.iushrn(1), o3.iushrn(1); for (var p3 = 0, b3 = 1; 0 == (r4.words[0] & b3) && p3 < 26; ++p3, b3 <<= 1) ; if (p3 > 0) for (r4.iushrn(p3); p3-- > 0; ) (s3.isOdd() || u3.isOdd()) && (s3.iadd(f3), u3.isub(d3)), s3.iushrn(1), u3.iushrn(1); t5.cmp(r4) >= 0 ? (t5.isub(r4), n3.isub(s3), o3.isub(u3)) : (r4.isub(t5), s3.isub(n3), u3.isub(o3)); } return { a: s3, b: u3, gcd: r4.iushln(c3) }; }, a2.prototype._invmp = function(e5) { i2(0 === e5.negative), i2(!e5.isZero()); var t5 = this, r4 = e5.clone(); t5 = 0 !== t5.negative ? t5.umod(e5) : t5.clone(); for (var n3, o3 = new a2(1), s3 = new a2(0), u3 = r4.clone(); t5.cmpn(1) > 0 && r4.cmpn(1) > 0; ) { for (var c3 = 0, f3 = 1; 0 == (t5.words[0] & f3) && c3 < 26; ++c3, f3 <<= 1) ; if (c3 > 0) for (t5.iushrn(c3); c3-- > 0; ) o3.isOdd() && o3.iadd(u3), o3.iushrn(1); for (var d3 = 0, l3 = 1; 0 == (r4.words[0] & l3) && d3 < 26; ++d3, l3 <<= 1) ; if (d3 > 0) for (r4.iushrn(d3); d3-- > 0; ) s3.isOdd() && s3.iadd(u3), s3.iushrn(1); t5.cmp(r4) >= 0 ? (t5.isub(r4), o3.isub(s3)) : (r4.isub(t5), s3.isub(o3)); } return (n3 = 0 === t5.cmpn(1) ? o3 : s3).cmpn(0) < 0 && n3.iadd(e5), n3; }, a2.prototype.gcd = function(e5) { if (this.isZero()) return e5.abs(); if (e5.isZero()) return this.abs(); var t5 = this.clone(), r4 = e5.clone(); t5.negative = 0, r4.negative = 0; for (var n3 = 0; t5.isEven() && r4.isEven(); n3++) t5.iushrn(1), r4.iushrn(1); for (; ; ) { for (; t5.isEven(); ) t5.iushrn(1); for (; r4.isEven(); ) r4.iushrn(1); var i3 = t5.cmp(r4); if (i3 < 0) { var o3 = t5; t5 = r4, r4 = o3; } else if (0 === i3 || 0 === r4.cmpn(1)) break; t5.isub(r4); } return r4.iushln(n3); }, a2.prototype.invm = function(e5) { return this.egcd(e5).a.umod(e5); }, a2.prototype.isEven = function() { return 0 == (1 & this.words[0]); }, a2.prototype.isOdd = function() { return 1 == (1 & this.words[0]); }, a2.prototype.andln = function(e5) { return this.words[0] & e5; }, a2.prototype.bincn = function(e5) { i2("number" == typeof e5); var t5 = e5 % 26, r4 = (e5 - t5) / 26, n3 = 1 << t5; if (this.length <= r4) return this._expand(r4 + 1), this.words[r4] |= n3, this; for (var o3 = n3, a3 = r4; 0 !== o3 && a3 < this.length; a3++) { var s3 = 0 | this.words[a3]; o3 = (s3 += o3) >>> 26, s3 &= 67108863, this.words[a3] = s3; } return 0 !== o3 && (this.words[a3] = o3, this.length++), this; }, a2.prototype.isZero = function() { return 1 === this.length && 0 === this.words[0]; }, a2.prototype.cmpn = function(e5) { var t5, r4 = e5 < 0; if (0 !== this.negative && !r4) return -1; if (0 === this.negative && r4) return 1; if (this._strip(), this.length > 1) t5 = 1; else { r4 && (e5 = -e5), i2(e5 <= 67108863, "Number is too big"); var n3 = 0 | this.words[0]; t5 = n3 === e5 ? 0 : n3 < e5 ? -1 : 1; } return 0 !== this.negative ? 0 | -t5 : t5; }, a2.prototype.cmp = function(e5) { if (0 !== this.negative && 0 === e5.negative) return -1; if (0 === this.negative && 0 !== e5.negative) return 1; var t5 = this.ucmp(e5); return 0 !== this.negative ? 0 | -t5 : t5; }, a2.prototype.ucmp = function(e5) { if (this.length > e5.length) return 1; if (this.length < e5.length) return -1; for (var t5 = 0, r4 = this.length - 1; r4 >= 0; r4--) { var n3 = 0 | this.words[r4], i3 = 0 | e5.words[r4]; if (n3 !== i3) { n3 < i3 ? t5 = -1 : n3 > i3 && (t5 = 1); break; } } return t5; }, a2.prototype.gtn = function(e5) { return 1 === this.cmpn(e5); }, a2.prototype.gt = function(e5) { return 1 === this.cmp(e5); }, a2.prototype.gten = function(e5) { return this.cmpn(e5) >= 0; }, a2.prototype.gte = function(e5) { return this.cmp(e5) >= 0; }, a2.prototype.ltn = function(e5) { return -1 === this.cmpn(e5); }, a2.prototype.lt = function(e5) { return -1 === this.cmp(e5); }, a2.prototype.lten = function(e5) { return this.cmpn(e5) <= 0; }, a2.prototype.lte = function(e5) { return this.cmp(e5) <= 0; }, a2.prototype.eqn = function(e5) { return 0 === this.cmpn(e5); }, a2.prototype.eq = function(e5) { return 0 === this.cmp(e5); }, a2.red = function(e5) { return new B2(e5); }, a2.prototype.toRed = function(e5) { return i2(!this.red, "Already a number in reduction context"), i2(0 === this.negative, "red works only with positives"), e5.convertTo(this)._forceRed(e5); }, a2.prototype.fromRed = function() { return i2(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this); }, a2.prototype._forceRed = function(e5) { return this.red = e5, this; }, a2.prototype.forceRed = function(e5) { return i2(!this.red, "Already a number in reduction context"), this._forceRed(e5); }, a2.prototype.redAdd = function(e5) { return i2(this.red, "redAdd works only with red numbers"), this.red.add(this, e5); }, a2.prototype.redIAdd = function(e5) { return i2(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, e5); }, a2.prototype.redSub = function(e5) { return i2(this.red, "redSub works only with red numbers"), this.red.sub(this, e5); }, a2.prototype.redISub = function(e5) { return i2(this.red, "redISub works only with red numbers"), this.red.isub(this, e5); }, a2.prototype.redShl = function(e5) { return i2(this.red, "redShl works only with red numbers"), this.red.shl(this, e5); }, a2.prototype.redMul = function(e5) { return i2(this.red, "redMul works only with red numbers"), this.red._verify2(this, e5), this.red.mul(this, e5); }, a2.prototype.redIMul = function(e5) { return i2(this.red, "redMul works only with red numbers"), this.red._verify2(this, e5), this.red.imul(this, e5); }, a2.prototype.redSqr = function() { return i2(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this); }, a2.prototype.redISqr = function() { return i2(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this); }, a2.prototype.redSqrt = function() { return i2(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this); }, a2.prototype.redInvm = function() { return i2(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this); }, a2.prototype.redNeg = function() { return i2(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this); }, a2.prototype.redPow = function(e5) { return i2(this.red && !e5.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, e5); }; var k2 = { k256: null, p224: null, p192: null, p25519: null }; function _2(e5, t5) { this.name = e5, this.p = new a2(t5, 16), this.n = this.p.bitLength(), this.k = new a2(1).iushln(this.n).isub(this.p), this.tmp = this._tmp(); } function A2() { _2.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); } function E2() { _2.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); } function S2() { _2.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); } function x2() { _2.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); } function B2(e5) { if ("string" == typeof e5) { var t5 = a2._prime(e5); this.m = t5.p, this.prime = t5; } else i2(e5.gtn(1), "modulus must be greater than 1"), this.m = e5, this.prime = null; } function O2(e5) { B2.call(this, e5), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new a2(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); } _2.prototype._tmp = function() { var e5 = new a2(null); return e5.words = new Array(Math.ceil(this.n / 13)), e5; }, _2.prototype.ireduce = function(e5) { var t5, r4 = e5; do { this.split(r4, this.tmp), t5 = (r4 = (r4 = this.imulK(r4)).iadd(this.tmp)).bitLength(); } while (t5 > this.n); var n3 = t5 < this.n ? -1 : r4.ucmp(this.p); return 0 === n3 ? (r4.words[0] = 0, r4.length = 1) : n3 > 0 ? r4.isub(this.p) : void 0 !== r4.strip ? r4.strip() : r4._strip(), r4; }, _2.prototype.split = function(e5, t5) { e5.iushrn(this.n, 0, t5); }, _2.prototype.imulK = function(e5) { return e5.imul(this.k); }, o2(A2, _2), A2.prototype.split = function(e5, t5) { for (var r4 = 4194303, n3 = Math.min(e5.length, 9), i3 = 0; i3 < n3; i3++) t5.words[i3] = e5.words[i3]; if (t5.length = n3, e5.length <= 9) return e5.words[0] = 0, void (e5.length = 1); var o3 = e5.words[9]; for (t5.words[t5.length++] = o3 & r4, i3 = 10; i3 < e5.length; i3++) { var a3 = 0 | e5.words[i3]; e5.words[i3 - 10] = (a3 & r4) << 4 | o3 >>> 22, o3 = a3; } o3 >>>= 22, e5.words[i3 - 10] = o3, 0 === o3 && e5.length > 10 ? e5.length -= 10 : e5.length -= 9; }, A2.prototype.imulK = function(e5) { e5.words[e5.length] = 0, e5.words[e5.length + 1] = 0, e5.length += 2; for (var t5 = 0, r4 = 0; r4 < e5.length; r4++) { var n3 = 0 | e5.words[r4]; t5 += 977 * n3, e5.words[r4] = 67108863 & t5, t5 = 64 * n3 + (t5 / 67108864 | 0); } return 0 === e5.words[e5.length - 1] && (e5.length--, 0 === e5.words[e5.length - 1] && e5.length--), e5; }, o2(E2, _2), o2(S2, _2), o2(x2, _2), x2.prototype.imulK = function(e5) { for (var t5 = 0, r4 = 0; r4 < e5.length; r4++) { var n3 = 19 * (0 | e5.words[r4]) + t5, i3 = 67108863 & n3; n3 >>>= 26, e5.words[r4] = i3, t5 = n3; } return 0 !== t5 && (e5.words[e5.length++] = t5), e5; }, a2._prime = function(e5) { if (k2[e5]) return k2[e5]; var t5; if ("k256" === e5) t5 = new A2(); else if ("p224" === e5) t5 = new E2(); else if ("p192" === e5) t5 = new S2(); else { if ("p25519" !== e5) throw new Error("Unknown prime " + e5); t5 = new x2(); } return k2[e5] = t5, t5; }, B2.prototype._verify1 = function(e5) { i2(0 === e5.negative, "red works only with positives"), i2(e5.red, "red works only with red numbers"); }, B2.prototype._verify2 = function(e5, t5) { i2(0 == (e5.negative | t5.negative), "red works only with positives"), i2(e5.red && e5.red === t5.red, "red works only with red numbers"); }, B2.prototype.imod = function(e5) { return this.prime ? this.prime.ireduce(e5)._forceRed(this) : (d2(e5, e5.umod(this.m)._forceRed(this)), e5); }, B2.prototype.neg = function(e5) { return e5.isZero() ? e5.clone() : this.m.sub(e5)._forceRed(this); }, B2.prototype.add = function(e5, t5) { this._verify2(e5, t5); var r4 = e5.add(t5); return r4.cmp(this.m) >= 0 && r4.isub(this.m), r4._forceRed(this); }, B2.prototype.iadd = function(e5, t5) { this._verify2(e5, t5); var r4 = e5.iadd(t5); return r4.cmp(this.m) >= 0 && r4.isub(this.m), r4; }, B2.prototype.sub = function(e5, t5) { this._verify2(e5, t5); var r4 = e5.sub(t5); return r4.cmpn(0) < 0 && r4.iadd(this.m), r4._forceRed(this); }, B2.prototype.isub = function(e5, t5) { this._verify2(e5, t5); var r4 = e5.isub(t5); return r4.cmpn(0) < 0 && r4.iadd(this.m), r4; }, B2.prototype.shl = function(e5, t5) { return this._verify1(e5), this.imod(e5.ushln(t5)); }, B2.prototype.imul = function(e5, t5) { return this._verify2(e5, t5), this.imod(e5.imul(t5)); }, B2.prototype.mul = function(e5, t5) { return this._verify2(e5, t5), this.imod(e5.mul(t5)); }, B2.prototype.isqr = function(e5) { return this.imul(e5, e5.clone()); }, B2.prototype.sqr = function(e5) { return this.mul(e5, e5); }, B2.prototype.sqrt = function(e5) { if (e5.isZero()) return e5.clone(); var t5 = this.m.andln(3); if (i2(t5 % 2 == 1), 3 === t5) { var r4 = this.m.add(new a2(1)).iushrn(2); return this.pow(e5, r4); } for (var n3 = this.m.subn(1), o3 = 0; !n3.isZero() && 0 === n3.andln(1); ) o3++, n3.iushrn(1); i2(!n3.isZero()); var s3 = new a2(1).toRed(this), u3 = s3.redNeg(), c3 = this.m.subn(1).iushrn(1), f3 = this.m.bitLength(); for (f3 = new a2(2 * f3 * f3).toRed(this); 0 !== this.pow(f3, c3).cmp(u3); ) f3.redIAdd(u3); for (var d3 = this.pow(f3, n3), l3 = this.pow(e5, n3.addn(1).iushrn(1)), h3 = this.pow(e5, n3), p3 = o3; 0 !== h3.cmp(s3); ) { for (var b3 = h3, y3 = 0; 0 !== b3.cmp(s3); y3++) b3 = b3.redSqr(); i2(y3 < p3); var v3 = this.pow(d3, new a2(1).iushln(p3 - y3 - 1)); l3 = l3.redMul(v3), d3 = v3.redSqr(), h3 = h3.redMul(d3), p3 = y3; } return l3; }, B2.prototype.invm = function(e5) { var t5 = e5._invmp(this.m); return 0 !== t5.negative ? (t5.negative = 0, this.imod(t5).redNeg()) : this.imod(t5); }, B2.prototype.pow = function(e5, t5) { if (t5.isZero()) return new a2(1).toRed(this); if (0 === t5.cmpn(1)) return e5.clone(); var r4 = new Array(16); r4[0] = new a2(1).toRed(this), r4[1] = e5; for (var n3 = 2; n3 < r4.length; n3++) r4[n3] = this.mul(r4[n3 - 1], e5); var i3 = r4[0], o3 = 0, s3 = 0, u3 = t5.bitLength() % 26; for (0 === u3 && (u3 = 26), n3 = t5.length - 1; n3 >= 0; n3--) { for (var c3 = t5.words[n3], f3 = u3 - 1; f3 >= 0; f3--) { var d3 = c3 >> f3 & 1; i3 !== r4[0] && (i3 = this.sqr(i3)), 0 !== d3 || 0 !== o3 ? (o3 <<= 1, o3 |= d3, (4 == ++s3 || 0 === n3 && 0 === f3) && (i3 = this.mul(i3, r4[o3]), s3 = 0, o3 = 0)) : s3 = 0; } u3 = 26; } return i3; }, B2.prototype.convertTo = function(e5) { var t5 = e5.umod(this.m); return t5 === e5 ? t5.clone() : t5; }, B2.prototype.convertFrom = function(e5) { var t5 = e5.clone(); return t5.red = null, t5; }, a2.mont = function(e5) { return new O2(e5); }, o2(O2, B2), O2.prototype.convertTo = function(e5) { return this.imod(e5.ushln(this.shift)); }, O2.prototype.convertFrom = function(e5) { var t5 = this.imod(e5.mul(this.rinv)); return t5.red = null, t5; }, O2.prototype.imul = function(e5, t5) { if (e5.isZero() || t5.isZero()) return e5.words[0] = 0, e5.length = 1, e5; var r4 = e5.imul(t5), n3 = r4.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), i3 = r4.isub(n3).iushrn(this.shift), o3 = i3; return i3.cmp(this.m) >= 0 ? o3 = i3.isub(this.m) : i3.cmpn(0) < 0 && (o3 = i3.iadd(this.m)), o3._forceRed(this); }, O2.prototype.mul = function(e5, t5) { if (e5.isZero() || t5.isZero()) return new a2(0)._forceRed(this); var r4 = e5.mul(t5), n3 = r4.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), i3 = r4.isub(n3).iushrn(this.shift), o3 = i3; return i3.cmp(this.m) >= 0 ? o3 = i3.isub(this.m) : i3.cmpn(0) < 0 && (o3 = i3.iadd(this.m)), o3._forceRed(this); }, O2.prototype.invm = function(e5) { return this.imod(e5._invmp(this.m).mul(this.r2))._forceRed(this); }; }(e3); }, 82202: (e3, t3, r3) => { var n2, i2 = r3(28847)(r3(3355)); function o2(e4) { this.rand = e4; } if (e3.exports = function(e4) { return n2 || (n2 = new o2(null)), n2.generate(e4); }, e3.exports.Rand = o2, o2.prototype.generate = function(e4) { return this._rand(e4); }, o2.prototype._rand = function(e4) { if (this.rand.getBytes) return this.rand.getBytes(e4); for (var t4 = new Uint8Array(e4), r4 = 0; r4 < t4.length; r4++) t4[r4] = this.rand.getByte(); return t4; }, "object" === ("undefined" == typeof self ? "undefined" : (0, i2.default)(self))) self.crypto && self.crypto.getRandomValues ? o2.prototype._rand = function(e4) { var t4 = new Uint8Array(e4); return self.crypto.getRandomValues(t4), t4; } : self.msCrypto && self.msCrypto.getRandomValues ? o2.prototype._rand = function(e4) { var t4 = new Uint8Array(e4); return self.msCrypto.getRandomValues(t4), t4; } : "object" === ("undefined" == typeof window ? "undefined" : (0, i2.default)(window)) && (o2.prototype._rand = function() { throw new Error("Not implemented yet"); }); else try { var a2 = r3(89214); if ("function" != typeof a2.randomBytes) throw new Error("Not supported"); o2.prototype._rand = function(e4) { return a2.randomBytes(e4); }; } catch (e4) { } }, 37494: (e3, t3, r3) => { var n2 = r3(48850).Buffer; function i2(e4) { n2.isBuffer(e4) || (e4 = n2.from(e4)); for (var t4 = e4.length / 4 | 0, r4 = new Array(t4), i3 = 0; i3 < t4; i3++) r4[i3] = e4.readUInt32BE(4 * i3); return r4; } function o2(e4) { for (; 0 < e4.length; e4++) e4[0] = 0; } function a2(e4, t4, r4, n3, i3) { for (var o3, a3, s3, u3, c3 = r4[0], f2 = r4[1], d2 = r4[2], l2 = r4[3], h2 = e4[0] ^ t4[0], p2 = e4[1] ^ t4[1], b2 = e4[2] ^ t4[2], y2 = e4[3] ^ t4[3], v2 = 4, m2 = 1; m2 < i3; m2++) o3 = c3[h2 >>> 24] ^ f2[p2 >>> 16 & 255] ^ d2[b2 >>> 8 & 255] ^ l2[255 & y2] ^ t4[v2++], a3 = c3[p2 >>> 24] ^ f2[b2 >>> 16 & 255] ^ d2[y2 >>> 8 & 255] ^ l2[255 & h2] ^ t4[v2++], s3 = c3[b2 >>> 24] ^ f2[y2 >>> 16 & 255] ^ d2[h2 >>> 8 & 255] ^ l2[255 & p2] ^ t4[v2++], u3 = c3[y2 >>> 24] ^ f2[h2 >>> 16 & 255] ^ d2[p2 >>> 8 & 255] ^ l2[255 & b2] ^ t4[v2++], h2 = o3, p2 = a3, b2 = s3, y2 = u3; return o3 = (n3[h2 >>> 24] << 24 | n3[p2 >>> 16 & 255] << 16 | n3[b2 >>> 8 & 255] << 8 | n3[255 & y2]) ^ t4[v2++], a3 = (n3[p2 >>> 24] << 24 | n3[b2 >>> 16 & 255] << 16 | n3[y2 >>> 8 & 255] << 8 | n3[255 & h2]) ^ t4[v2++], s3 = (n3[b2 >>> 24] << 24 | n3[y2 >>> 16 & 255] << 16 | n3[h2 >>> 8 & 255] << 8 | n3[255 & p2]) ^ t4[v2++], u3 = (n3[y2 >>> 24] << 24 | n3[h2 >>> 16 & 255] << 16 | n3[p2 >>> 8 & 255] << 8 | n3[255 & b2]) ^ t4[v2++], [o3 >>>= 0, a3 >>>= 0, s3 >>>= 0, u3 >>>= 0]; } var s2 = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], u2 = function() { for (var e4 = new Array(256), t4 = 0; t4 < 256; t4++) e4[t4] = t4 < 128 ? t4 << 1 : t4 << 1 ^ 283; for (var r4 = [], n3 = [], i3 = [[], [], [], []], o3 = [[], [], [], []], a3 = 0, s3 = 0, u3 = 0; u3 < 256; ++u3) { var c3 = s3 ^ s3 << 1 ^ s3 << 2 ^ s3 << 3 ^ s3 << 4; c3 = c3 >>> 8 ^ 255 & c3 ^ 99, r4[a3] = c3, n3[c3] = a3; var f2 = e4[a3], d2 = e4[f2], l2 = e4[d2], h2 = 257 * e4[c3] ^ 16843008 * c3; i3[0][a3] = h2 << 24 | h2 >>> 8, i3[1][a3] = h2 << 16 | h2 >>> 16, i3[2][a3] = h2 << 8 | h2 >>> 24, i3[3][a3] = h2, h2 = 16843009 * l2 ^ 65537 * d2 ^ 257 * f2 ^ 16843008 * a3, o3[0][c3] = h2 << 24 | h2 >>> 8, o3[1][c3] = h2 << 16 | h2 >>> 16, o3[2][c3] = h2 << 8 | h2 >>> 24, o3[3][c3] = h2, 0 === a3 ? a3 = s3 = 1 : (a3 = f2 ^ e4[e4[e4[l2 ^ f2]]], s3 ^= e4[e4[s3]]); } return { SBOX: r4, INV_SBOX: n3, SUB_MIX: i3, INV_SUB_MIX: o3 }; }(); function c2(e4) { this._key = i2(e4), this._reset(); } c2.blockSize = 16, c2.keySize = 32, c2.prototype.blockSize = c2.blockSize, c2.prototype.keySize = c2.keySize, c2.prototype._reset = function() { for (var e4 = this._key, t4 = e4.length, r4 = t4 + 6, n3 = 4 * (r4 + 1), i3 = [], o3 = 0; o3 < t4; o3++) i3[o3] = e4[o3]; for (o3 = t4; o3 < n3; o3++) { var a3 = i3[o3 - 1]; o3 % t4 == 0 ? (a3 = a3 << 8 | a3 >>> 24, a3 = u2.SBOX[a3 >>> 24] << 24 | u2.SBOX[a3 >>> 16 & 255] << 16 | u2.SBOX[a3 >>> 8 & 255] << 8 | u2.SBOX[255 & a3], a3 ^= s2[o3 / t4 | 0] << 24) : t4 > 6 && o3 % t4 == 4 && (a3 = u2.SBOX[a3 >>> 24] << 24 | u2.SBOX[a3 >>> 16 & 255] << 16 | u2.SBOX[a3 >>> 8 & 255] << 8 | u2.SBOX[255 & a3]), i3[o3] = i3[o3 - t4] ^ a3; } for (var c3 = [], f2 = 0; f2 < n3; f2++) { var d2 = n3 - f2, l2 = i3[d2 - (f2 % 4 ? 0 : 4)]; c3[f2] = f2 < 4 || d2 <= 4 ? l2 : u2.INV_SUB_MIX[0][u2.SBOX[l2 >>> 24]] ^ u2.INV_SUB_MIX[1][u2.SBOX[l2 >>> 16 & 255]] ^ u2.INV_SUB_MIX[2][u2.SBOX[l2 >>> 8 & 255]] ^ u2.INV_SUB_MIX[3][u2.SBOX[255 & l2]]; } this._nRounds = r4, this._keySchedule = i3, this._invKeySchedule = c3; }, c2.prototype.encryptBlockRaw = function(e4) { return a2(e4 = i2(e4), this._keySchedule, u2.SUB_MIX, u2.SBOX, this._nRounds); }, c2.prototype.encryptBlock = function(e4) { var t4 = this.encryptBlockRaw(e4), r4 = n2.allocUnsafe(16); return r4.writeUInt32BE(t4[0], 0), r4.writeUInt32BE(t4[1], 4), r4.writeUInt32BE(t4[2], 8), r4.writeUInt32BE(t4[3], 12), r4; }, c2.prototype.decryptBlock = function(e4) { var t4 = (e4 = i2(e4))[1]; e4[1] = e4[3], e4[3] = t4; var r4 = a2(e4, this._invKeySchedule, u2.INV_SUB_MIX, u2.INV_SBOX, this._nRounds), o3 = n2.allocUnsafe(16); return o3.writeUInt32BE(r4[0], 0), o3.writeUInt32BE(r4[3], 4), o3.writeUInt32BE(r4[2], 8), o3.writeUInt32BE(r4[1], 12), o3; }, c2.prototype.scrub = function() { o2(this._keySchedule), o2(this._invKeySchedule), o2(this._key); }, e3.exports.AES = c2; }, 10426: (e3, t3, r3) => { var n2 = r3(37494), i2 = r3(48850).Buffer, o2 = r3(93013), a2 = r3(41736), s2 = r3(26626), u2 = r3(96316), c2 = r3(67557); function f2(e4, t4, r4, a3) { o2.call(this); var u3 = i2.alloc(4, 0); this._cipher = new n2.AES(t4); var f3 = this._cipher.encryptBlock(u3); this._ghash = new s2(f3), r4 = function(e5, t5, r5) { if (12 === t5.length) return e5._finID = i2.concat([t5, i2.from([0, 0, 0, 1])]), i2.concat([t5, i2.from([0, 0, 0, 2])]); var n3 = new s2(r5), o3 = t5.length, a4 = o3 % 16; n3.update(t5), a4 && (a4 = 16 - a4, n3.update(i2.alloc(a4, 0))), n3.update(i2.alloc(8, 0)); var u4 = 8 * o3, f4 = i2.alloc(8); f4.writeUIntBE(u4, 0, 8), n3.update(f4), e5._finID = n3.state; var d2 = i2.from(e5._finID); return c2(d2), d2; }(this, r4, f3), this._prev = i2.from(r4), this._cache = i2.allocUnsafe(0), this._secCache = i2.allocUnsafe(0), this._decrypt = a3, this._alen = 0, this._len = 0, this._mode = e4, this._authTag = null, this._called = false; } a2(f2, o2), f2.prototype._update = function(e4) { if (!this._called && this._alen) { var t4 = 16 - this._alen % 16; t4 < 16 && (t4 = i2.alloc(t4, 0), this._ghash.update(t4)); } this._called = true; var r4 = this._mode.encrypt(this, e4); return this._decrypt ? this._ghash.update(e4) : this._ghash.update(r4), this._len += e4.length, r4; }, f2.prototype._final = function() { if (this._decrypt && !this._authTag) throw new Error("Unsupported state or unable to authenticate data"); var e4 = u2(this._ghash.final(8 * this._alen, 8 * this._len), this._cipher.encryptBlock(this._finID)); if (this._decrypt && function(e5, t4) { var r4 = 0; e5.length !== t4.length && r4++; for (var n3 = Math.min(e5.length, t4.length), i3 = 0; i3 < n3; ++i3) r4 += e5[i3] ^ t4[i3]; return r4; }(e4, this._authTag)) throw new Error("Unsupported state or unable to authenticate data"); this._authTag = e4, this._cipher.scrub(); }, f2.prototype.getAuthTag = function() { if (this._decrypt || !i2.isBuffer(this._authTag)) throw new Error("Attempting to get auth tag in unsupported state"); return this._authTag; }, f2.prototype.setAuthTag = function(e4) { if (!this._decrypt) throw new Error("Attempting to set auth tag in unsupported state"); this._authTag = e4; }, f2.prototype.setAAD = function(e4) { if (this._called) throw new Error("Attempting to set AAD in unsupported state"); this._ghash.update(e4), this._alen += e4.length; }, e3.exports = f2; }, 98073: (e3, t3, r3) => { var n2 = r3(85478), i2 = r3(32184), o2 = r3(44946); t3.createCipher = t3.Cipher = n2.createCipher, t3.createCipheriv = t3.Cipheriv = n2.createCipheriv, t3.createDecipher = t3.Decipher = i2.createDecipher, t3.createDecipheriv = t3.Decipheriv = i2.createDecipheriv, t3.listCiphers = t3.getCiphers = function() { return Object.keys(o2); }; }, 32184: (e3, t3, r3) => { var n2 = r3(10426), i2 = r3(48850).Buffer, o2 = r3(58408), a2 = r3(21408), s2 = r3(93013), u2 = r3(37494), c2 = r3(27085); function f2(e4, t4, r4) { s2.call(this), this._cache = new d2(), this._last = void 0, this._cipher = new u2.AES(t4), this._prev = i2.from(r4), this._mode = e4, this._autopadding = true; } function d2() { this.cache = i2.allocUnsafe(0); } function l2(e4, t4, r4) { var s3 = o2[e4.toLowerCase()]; if (!s3) throw new TypeError("invalid suite type"); if ("string" == typeof r4 && (r4 = i2.from(r4)), "GCM" !== s3.mode && r4.length !== s3.iv) throw new TypeError("invalid iv length " + r4.length); if ("string" == typeof t4 && (t4 = i2.from(t4)), t4.length !== s3.key / 8) throw new TypeError("invalid key length " + t4.length); return "stream" === s3.type ? new a2(s3.module, t4, r4, true) : "auth" === s3.type ? new n2(s3.module, t4, r4, true) : new f2(s3.module, t4, r4); } r3(41736)(f2, s2), f2.prototype._update = function(e4) { var t4, r4; this._cache.add(e4); for (var n3 = []; t4 = this._cache.get(this._autopadding); ) r4 = this._mode.decrypt(this, t4), n3.push(r4); return i2.concat(n3); }, f2.prototype._final = function() { var e4 = this._cache.flush(); if (this._autopadding) return function(e5) { var t4 = e5[15]; if (t4 < 1 || t4 > 16) throw new Error("unable to decrypt data"); for (var r4 = -1; ++r4 < t4; ) if (e5[r4 + (16 - t4)] !== t4) throw new Error("unable to decrypt data"); if (16 !== t4) return e5.slice(0, 16 - t4); }(this._mode.decrypt(this, e4)); if (e4) throw new Error("data not multiple of block length"); }, f2.prototype.setAutoPadding = function(e4) { return this._autopadding = !!e4, this; }, d2.prototype.add = function(e4) { this.cache = i2.concat([this.cache, e4]); }, d2.prototype.get = function(e4) { var t4; if (e4) { if (this.cache.length > 16) return t4 = this.cache.slice(0, 16), this.cache = this.cache.slice(16), t4; } else if (this.cache.length >= 16) return t4 = this.cache.slice(0, 16), this.cache = this.cache.slice(16), t4; return null; }, d2.prototype.flush = function() { if (this.cache.length) return this.cache; }, t3.createDecipher = function(e4, t4) { var r4 = o2[e4.toLowerCase()]; if (!r4) throw new TypeError("invalid suite type"); var n3 = c2(t4, false, r4.key, r4.iv); return l2(e4, n3.key, n3.iv); }, t3.createDecipheriv = l2; }, 85478: (e3, t3, r3) => { var n2 = r3(58408), i2 = r3(10426), o2 = r3(48850).Buffer, a2 = r3(21408), s2 = r3(93013), u2 = r3(37494), c2 = r3(27085); function f2(e4, t4, r4) { s2.call(this), this._cache = new l2(), this._cipher = new u2.AES(t4), this._prev = o2.from(r4), this._mode = e4, this._autopadding = true; } r3(41736)(f2, s2), f2.prototype._update = function(e4) { var t4, r4; this._cache.add(e4); for (var n3 = []; t4 = this._cache.get(); ) r4 = this._mode.encrypt(this, t4), n3.push(r4); return o2.concat(n3); }; var d2 = o2.alloc(16, 16); function l2() { this.cache = o2.allocUnsafe(0); } function h2(e4, t4, r4) { var s3 = n2[e4.toLowerCase()]; if (!s3) throw new TypeError("invalid suite type"); if ("string" == typeof t4 && (t4 = o2.from(t4)), t4.length !== s3.key / 8) throw new TypeError("invalid key length " + t4.length); if ("string" == typeof r4 && (r4 = o2.from(r4)), "GCM" !== s3.mode && r4.length !== s3.iv) throw new TypeError("invalid iv length " + r4.length); return "stream" === s3.type ? new a2(s3.module, t4, r4) : "auth" === s3.type ? new i2(s3.module, t4, r4) : new f2(s3.module, t4, r4); } f2.prototype._final = function() { var e4 = this._cache.flush(); if (this._autopadding) return e4 = this._mode.encrypt(this, e4), this._cipher.scrub(), e4; if (!e4.equals(d2)) throw this._cipher.scrub(), new Error("data not multiple of block length"); }, f2.prototype.setAutoPadding = function(e4) { return this._autopadding = !!e4, this; }, l2.prototype.add = function(e4) { this.cache = o2.concat([this.cache, e4]); }, l2.prototype.get = function() { if (this.cache.length > 15) { var e4 = this.cache.slice(0, 16); return this.cache = this.cache.slice(16), e4; } return null; }, l2.prototype.flush = function() { for (var e4 = 16 - this.cache.length, t4 = o2.allocUnsafe(e4), r4 = -1; ++r4 < e4; ) t4.writeUInt8(e4, r4); return o2.concat([this.cache, t4]); }, t3.createCipheriv = h2, t3.createCipher = function(e4, t4) { var r4 = n2[e4.toLowerCase()]; if (!r4) throw new TypeError("invalid suite type"); var i3 = c2(t4, false, r4.key, r4.iv); return h2(e4, i3.key, i3.iv); }; }, 26626: (e3, t3, r3) => { var n2 = r3(48850).Buffer, i2 = n2.alloc(16, 0); function o2(e4) { var t4 = n2.allocUnsafe(16); return t4.writeUInt32BE(e4[0] >>> 0, 0), t4.writeUInt32BE(e4[1] >>> 0, 4), t4.writeUInt32BE(e4[2] >>> 0, 8), t4.writeUInt32BE(e4[3] >>> 0, 12), t4; } function a2(e4) { this.h = e4, this.state = n2.alloc(16, 0), this.cache = n2.allocUnsafe(0); } a2.prototype.ghash = function(e4) { for (var t4 = -1; ++t4 < e4.length; ) this.state[t4] ^= e4[t4]; this._multiply(); }, a2.prototype._multiply = function() { for (var e4, t4, r4, n3 = [(e4 = this.h).readUInt32BE(0), e4.readUInt32BE(4), e4.readUInt32BE(8), e4.readUInt32BE(12)], i3 = [0, 0, 0, 0], a3 = -1; ++a3 < 128; ) { for (0 != (this.state[~~(a3 / 8)] & 1 << 7 - a3 % 8) && (i3[0] ^= n3[0], i3[1] ^= n3[1], i3[2] ^= n3[2], i3[3] ^= n3[3]), r4 = 0 != (1 & n3[3]), t4 = 3; t4 > 0; t4--) n3[t4] = n3[t4] >>> 1 | (1 & n3[t4 - 1]) << 31; n3[0] = n3[0] >>> 1, r4 && (n3[0] = n3[0] ^ 225 << 24); } this.state = o2(i3); }, a2.prototype.update = function(e4) { var t4; for (this.cache = n2.concat([this.cache, e4]); this.cache.length >= 16; ) t4 = this.cache.slice(0, 16), this.cache = this.cache.slice(16), this.ghash(t4); }, a2.prototype.final = function(e4, t4) { return this.cache.length && this.ghash(n2.concat([this.cache, i2], 16)), this.ghash(o2([0, e4, 0, t4])), this.state; }, e3.exports = a2; }, 67557: (e3) => { e3.exports = function(e4) { for (var t3, r3 = e4.length; r3--; ) { if (255 !== (t3 = e4.readUInt8(r3))) { t3++, e4.writeUInt8(t3, r3); break; } e4.writeUInt8(0, r3); } }; }, 77427: (e3, t3, r3) => { var n2 = r3(96316); t3.encrypt = function(e4, t4) { var r4 = n2(t4, e4._prev); return e4._prev = e4._cipher.encryptBlock(r4), e4._prev; }, t3.decrypt = function(e4, t4) { var r4 = e4._prev; e4._prev = t4; var i2 = e4._cipher.decryptBlock(t4); return n2(i2, r4); }; }, 44030: (e3, t3, r3) => { var n2 = r3(48850).Buffer, i2 = r3(96316); function o2(e4, t4, r4) { var o3 = t4.length, a2 = i2(t4, e4._cache); return e4._cache = e4._cache.slice(o3), e4._prev = n2.concat([e4._prev, r4 ? t4 : a2]), a2; } t3.encrypt = function(e4, t4, r4) { for (var i3, a2 = n2.allocUnsafe(0); t4.length; ) { if (0 === e4._cache.length && (e4._cache = e4._cipher.encryptBlock(e4._prev), e4._prev = n2.allocUnsafe(0)), !(e4._cache.length <= t4.length)) { a2 = n2.concat([a2, o2(e4, t4, r4)]); break; } i3 = e4._cache.length, a2 = n2.concat([a2, o2(e4, t4.slice(0, i3), r4)]), t4 = t4.slice(i3); } return a2; }; }, 13206: (e3, t3, r3) => { var n2 = r3(48850).Buffer; function i2(e4, t4, r4) { for (var n3, i3, a2 = -1, s2 = 0; ++a2 < 8; ) n3 = t4 & 1 << 7 - a2 ? 128 : 0, s2 += (128 & (i3 = e4._cipher.encryptBlock(e4._prev)[0] ^ n3)) >> a2 % 8, e4._prev = o2(e4._prev, r4 ? n3 : i3); return s2; } function o2(e4, t4) { var r4 = e4.length, i3 = -1, o3 = n2.allocUnsafe(e4.length); for (e4 = n2.concat([e4, n2.from([t4])]); ++i3 < r4; ) o3[i3] = e4[i3] << 1 | e4[i3 + 1] >> 7; return o3; } t3.encrypt = function(e4, t4, r4) { for (var o3 = t4.length, a2 = n2.allocUnsafe(o3), s2 = -1; ++s2 < o3; ) a2[s2] = i2(e4, t4[s2], r4); return a2; }; }, 14726: (e3, t3, r3) => { var n2 = r3(48850).Buffer; function i2(e4, t4, r4) { var i3 = e4._cipher.encryptBlock(e4._prev)[0] ^ t4; return e4._prev = n2.concat([e4._prev.slice(1), n2.from([r4 ? t4 : i3])]), i3; } t3.encrypt = function(e4, t4, r4) { for (var o2 = t4.length, a2 = n2.allocUnsafe(o2), s2 = -1; ++s2 < o2; ) a2[s2] = i2(e4, t4[s2], r4); return a2; }; }, 32802: (e3, t3, r3) => { var n2 = r3(96316), i2 = r3(48850).Buffer, o2 = r3(67557); function a2(e4) { var t4 = e4._cipher.encryptBlockRaw(e4._prev); return o2(e4._prev), t4; } t3.encrypt = function(e4, t4) { var r4 = Math.ceil(t4.length / 16), o3 = e4._cache.length; e4._cache = i2.concat([e4._cache, i2.allocUnsafe(16 * r4)]); for (var s2 = 0; s2 < r4; s2++) { var u2 = a2(e4), c2 = o3 + 16 * s2; e4._cache.writeUInt32BE(u2[0], c2 + 0), e4._cache.writeUInt32BE(u2[1], c2 + 4), e4._cache.writeUInt32BE(u2[2], c2 + 8), e4._cache.writeUInt32BE(u2[3], c2 + 12); } var f2 = e4._cache.slice(0, t4.length); return e4._cache = e4._cache.slice(t4.length), n2(t4, f2); }; }, 59297: (e3, t3) => { t3.encrypt = function(e4, t4) { return e4._cipher.encryptBlock(t4); }, t3.decrypt = function(e4, t4) { return e4._cipher.decryptBlock(t4); }; }, 58408: (e3, t3, r3) => { var n2 = { ECB: r3(59297), CBC: r3(77427), CFB: r3(44030), CFB8: r3(14726), CFB1: r3(13206), OFB: r3(91962), CTR: r3(32802), GCM: r3(32802) }, i2 = r3(44946); for (var o2 in i2) i2[o2].module = n2[i2[o2].mode]; e3.exports = i2; }, 91962: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(96316); function o2(e4) { return e4._prev = e4._cipher.encryptBlock(e4._prev), e4._prev; } t3.encrypt = function(e4, t4) { for (; e4._cache.length < t4.length; ) e4._cache = n2.concat([e4._cache, o2(e4)]); var r4 = e4._cache.slice(0, t4.length); return e4._cache = e4._cache.slice(t4.length), i2(t4, r4); }; }, 21408: (e3, t3, r3) => { var n2 = r3(37494), i2 = r3(48850).Buffer, o2 = r3(93013); function a2(e4, t4, r4, a3) { o2.call(this), this._cipher = new n2.AES(t4), this._prev = i2.from(r4), this._cache = i2.allocUnsafe(0), this._secCache = i2.allocUnsafe(0), this._decrypt = a3, this._mode = e4; } r3(41736)(a2, o2), a2.prototype._update = function(e4) { return this._mode.encrypt(this, e4, this._decrypt); }, a2.prototype._final = function() { this._cipher.scrub(); }, e3.exports = a2; }, 56805: (e3, t3, r3) => { var n2 = r3(19120), i2 = r3(98073), o2 = r3(58408), a2 = r3(30867), s2 = r3(27085); function u2(e4, t4, r4) { if (e4 = e4.toLowerCase(), o2[e4]) return i2.createCipheriv(e4, t4, r4); if (a2[e4]) return new n2({ key: t4, iv: r4, mode: e4 }); throw new TypeError("invalid suite type"); } function c2(e4, t4, r4) { if (e4 = e4.toLowerCase(), o2[e4]) return i2.createDecipheriv(e4, t4, r4); if (a2[e4]) return new n2({ key: t4, iv: r4, mode: e4, decrypt: true }); throw new TypeError("invalid suite type"); } t3.createCipher = t3.Cipher = function(e4, t4) { var r4, n3; if (e4 = e4.toLowerCase(), o2[e4]) r4 = o2[e4].key, n3 = o2[e4].iv; else { if (!a2[e4]) throw new TypeError("invalid suite type"); r4 = 8 * a2[e4].key, n3 = a2[e4].iv; } var i3 = s2(t4, false, r4, n3); return u2(e4, i3.key, i3.iv); }, t3.createCipheriv = t3.Cipheriv = u2, t3.createDecipher = t3.Decipher = function(e4, t4) { var r4, n3; if (e4 = e4.toLowerCase(), o2[e4]) r4 = o2[e4].key, n3 = o2[e4].iv; else { if (!a2[e4]) throw new TypeError("invalid suite type"); r4 = 8 * a2[e4].key, n3 = a2[e4].iv; } var i3 = s2(t4, false, r4, n3); return c2(e4, i3.key, i3.iv); }, t3.createDecipheriv = t3.Decipheriv = c2, t3.listCiphers = t3.getCiphers = function() { return Object.keys(a2).concat(i2.getCiphers()); }; }, 19120: (e3, t3, r3) => { var n2 = r3(93013), i2 = r3(75626), o2 = r3(41736), a2 = r3(48850).Buffer, s2 = { "des-ede3-cbc": i2.CBC.instantiate(i2.EDE), "des-ede3": i2.EDE, "des-ede-cbc": i2.CBC.instantiate(i2.EDE), "des-ede": i2.EDE, "des-cbc": i2.CBC.instantiate(i2.DES), "des-ecb": i2.DES }; function u2(e4) { n2.call(this); var t4, r4 = e4.mode.toLowerCase(), i3 = s2[r4]; t4 = e4.decrypt ? "decrypt" : "encrypt"; var o3 = e4.key; a2.isBuffer(o3) || (o3 = a2.from(o3)), "des-ede" !== r4 && "des-ede-cbc" !== r4 || (o3 = a2.concat([o3, o3.slice(0, 8)])); var u3 = e4.iv; a2.isBuffer(u3) || (u3 = a2.from(u3)), this._des = i3.create({ key: o3, iv: u3, type: t4 }); } s2.des = s2["des-cbc"], s2.des3 = s2["des-ede3-cbc"], e3.exports = u2, o2(u2, n2), u2.prototype._update = function(e4) { return a2.from(this._des.update(e4)); }, u2.prototype._final = function() { return a2.from(this._des.final()); }; }, 30867: (e3, t3) => { t3["des-ecb"] = { key: 8, iv: 0 }, t3["des-cbc"] = t3.des = { key: 8, iv: 8 }, t3["des-ede3-cbc"] = t3.des3 = { key: 24, iv: 8 }, t3["des-ede3"] = { key: 24, iv: 0 }, t3["des-ede-cbc"] = { key: 16, iv: 8 }, t3["des-ede"] = { key: 16, iv: 0 }; }, 99782: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(31734), o2 = r3(75010); function a2(e4) { var t4, r4 = e4.modulus.byteLength(); do { t4 = new i2(o2(r4)); } while (t4.cmp(e4.modulus) >= 0 || !t4.umod(e4.prime1) || !t4.umod(e4.prime2)); return t4; } function s2(e4, t4) { var r4 = function(e5) { var t5 = a2(e5); return { blinder: t5.toRed(i2.mont(e5.modulus)).redPow(new i2(e5.publicExponent)).fromRed(), unblinder: t5.invm(e5.modulus) }; }(t4), o3 = t4.modulus.byteLength(), s3 = new i2(e4).mul(r4.blinder).umod(t4.modulus), u2 = s3.toRed(i2.mont(t4.prime1)), c2 = s3.toRed(i2.mont(t4.prime2)), f2 = t4.coefficient, d2 = t4.prime1, l2 = t4.prime2, h2 = u2.redPow(t4.exponent1).fromRed(), p2 = c2.redPow(t4.exponent2).fromRed(), b2 = h2.isub(p2).imul(f2).umod(d2).imul(l2); return p2.iadd(b2).imul(r4.unblinder).umod(t4.modulus).toArrayLike(n2, "be", o3); } s2.getr = a2, e3.exports = s2; }, 26561: (e3, t3, r3) => { e3.exports = r3(75207); }, 79527: (e3, t3, r3) => { var n2 = r3(48850).Buffer, i2 = r3(35866), o2 = r3(86505), a2 = r3(41736), s2 = r3(11628), u2 = r3(15410), c2 = r3(75207); function f2(e4) { o2.Writable.call(this); var t4 = c2[e4]; if (!t4) throw new Error("Unknown message digest"); this._hashType = t4.hash, this._hash = i2(t4.hash), this._tag = t4.id, this._signType = t4.sign; } function d2(e4) { o2.Writable.call(this); var t4 = c2[e4]; if (!t4) throw new Error("Unknown message digest"); this._hash = i2(t4.hash), this._tag = t4.id, this._signType = t4.sign; } function l2(e4) { return new f2(e4); } function h2(e4) { return new d2(e4); } Object.keys(c2).forEach(function(e4) { c2[e4].id = n2.from(c2[e4].id, "hex"), c2[e4.toLowerCase()] = c2[e4]; }), a2(f2, o2.Writable), f2.prototype._write = function(e4, t4, r4) { this._hash.update(e4), r4(); }, f2.prototype.update = function(e4, t4) { return this._hash.update("string" == typeof e4 ? n2.from(e4, t4) : e4), this; }, f2.prototype.sign = function(e4, t4) { this.end(); var r4 = this._hash.digest(), n3 = s2(r4, e4, this._hashType, this._signType, this._tag); return t4 ? n3.toString(t4) : n3; }, a2(d2, o2.Writable), d2.prototype._write = function(e4, t4, r4) { this._hash.update(e4), r4(); }, d2.prototype.update = function(e4, t4) { return this._hash.update("string" == typeof e4 ? n2.from(e4, t4) : e4), this; }, d2.prototype.verify = function(e4, t4, r4) { var i3 = "string" == typeof t4 ? n2.from(t4, r4) : t4; this.end(); var o3 = this._hash.digest(); return u2(i3, o3, e4, this._signType, this._tag); }, e3.exports = { Sign: l2, Verify: h2, createSign: l2, createVerify: h2 }; }, 11628: (e3, t3, r3) => { var n2 = r3(48850).Buffer, i2 = r3(34424), o2 = r3(99782), a2 = r3(36597).ec, s2 = r3(31734), u2 = r3(27552), c2 = r3(1308); function f2(e4, t4, r4, o3) { if ((e4 = n2.from(e4.toArray())).length < t4.byteLength()) { var a3 = n2.alloc(t4.byteLength() - e4.length); e4 = n2.concat([a3, e4]); } var s3 = r4.length, u3 = function(e5, t5) { e5 = (e5 = d2(e5, t5)).mod(t5); var r5 = n2.from(e5.toArray()); if (r5.length < t5.byteLength()) { var i3 = n2.alloc(t5.byteLength() - r5.length); r5 = n2.concat([i3, r5]); } return r5; }(r4, t4), c3 = n2.alloc(s3); c3.fill(1); var f3 = n2.alloc(s3); return f3 = i2(o3, f3).update(c3).update(n2.from([0])).update(e4).update(u3).digest(), c3 = i2(o3, f3).update(c3).digest(), { k: f3 = i2(o3, f3).update(c3).update(n2.from([1])).update(e4).update(u3).digest(), v: c3 = i2(o3, f3).update(c3).digest() }; } function d2(e4, t4) { var r4 = new s2(e4), n3 = (e4.length << 3) - t4.bitLength(); return n3 > 0 && r4.ishrn(n3), r4; } function l2(e4, t4, r4) { var o3, a3; do { for (o3 = n2.alloc(0); 8 * o3.length < e4.bitLength(); ) t4.v = i2(r4, t4.k).update(t4.v).digest(), o3 = n2.concat([o3, t4.v]); a3 = d2(o3, e4), t4.k = i2(r4, t4.k).update(t4.v).update(n2.from([0])).digest(), t4.v = i2(r4, t4.k).update(t4.v).digest(); } while (-1 !== a3.cmp(e4)); return a3; } function h2(e4, t4, r4, n3) { return e4.toRed(s2.mont(r4)).redPow(t4).fromRed().mod(n3); } e3.exports = function(e4, t4, r4, i3, p2) { var b2 = u2(t4); if (b2.curve) { if ("ecdsa" !== i3 && "ecdsa/rsa" !== i3) throw new Error("wrong private key type"); return function(e5, t5) { var r5 = c2[t5.curve.join(".")]; if (!r5) throw new Error("unknown curve " + t5.curve.join(".")); var i4 = new a2(r5).keyFromPrivate(t5.privateKey).sign(e5); return n2.from(i4.toDER()); }(e4, b2); } if ("dsa" === b2.type) { if ("dsa" !== i3) throw new Error("wrong private key type"); return function(e5, t5, r5) { for (var i4, o3 = t5.params.priv_key, a3 = t5.params.p, u3 = t5.params.q, c3 = t5.params.g, p3 = new s2(0), b3 = d2(e5, u3).mod(u3), y3 = false, v3 = f2(o3, u3, e5, r5); false === y3; ) p3 = h2(c3, i4 = l2(u3, v3, r5), a3, u3), 0 === (y3 = i4.invm(u3).imul(b3.add(o3.mul(p3))).mod(u3)).cmpn(0) && (y3 = false, p3 = new s2(0)); return function(e6, t6) { e6 = e6.toArray(), t6 = t6.toArray(), 128 & e6[0] && (e6 = [0].concat(e6)), 128 & t6[0] && (t6 = [0].concat(t6)); var r6 = [48, e6.length + t6.length + 4, 2, e6.length]; return r6 = r6.concat(e6, [2, t6.length], t6), n2.from(r6); }(p3, y3); }(e4, b2, r4); } if ("rsa" !== i3 && "ecdsa/rsa" !== i3) throw new Error("wrong private key type"); if (void 0 !== t4.padding && 1 !== t4.padding) throw new Error("illegal or unsupported padding mode"); e4 = n2.concat([p2, e4]); for (var y2 = b2.modulus.byteLength(), v2 = [0, 1]; e4.length + v2.length + 1 < y2; ) v2.push(255); v2.push(0); for (var m2 = -1; ++m2 < e4.length; ) v2.push(e4[m2]); return o2(v2, b2); }, e3.exports.getKey = f2, e3.exports.makeKey = l2; }, 15410: (e3, t3, r3) => { var n2 = r3(48850).Buffer, i2 = r3(31734), o2 = r3(36597).ec, a2 = r3(27552), s2 = r3(1308); function u2(e4, t4) { if (e4.cmpn(0) <= 0) throw new Error("invalid sig"); if (e4.cmp(t4) >= 0) throw new Error("invalid sig"); } e3.exports = function(e4, t4, r4, c2, f2) { var d2 = a2(r4); if ("ec" === d2.type) { if ("ecdsa" !== c2 && "ecdsa/rsa" !== c2) throw new Error("wrong public key type"); return function(e5, t5, r5) { var n3 = s2[r5.data.algorithm.curve.join(".")]; if (!n3) throw new Error("unknown curve " + r5.data.algorithm.curve.join(".")); var i3 = new o2(n3), a3 = r5.data.subjectPrivateKey.data; return i3.verify(t5, e5, a3); }(e4, t4, d2); } if ("dsa" === d2.type) { if ("dsa" !== c2) throw new Error("wrong public key type"); return function(e5, t5, r5) { var n3 = r5.data.p, o3 = r5.data.q, s3 = r5.data.g, c3 = r5.data.pub_key, f3 = a2.signature.decode(e5, "der"), d3 = f3.s, l3 = f3.r; u2(d3, o3), u2(l3, o3); var h3 = i2.mont(n3), p3 = d3.invm(o3); return 0 === s3.toRed(h3).redPow(new i2(t5).mul(p3).mod(o3)).fromRed().mul(c3.toRed(h3).redPow(l3.mul(p3).mod(o3)).fromRed()).mod(n3).mod(o3).cmp(l3); }(e4, t4, d2); } if ("rsa" !== c2 && "ecdsa/rsa" !== c2) throw new Error("wrong public key type"); t4 = n2.concat([f2, t4]); for (var l2 = d2.modulus.byteLength(), h2 = [1], p2 = 0; t4.length + h2.length + 2 < l2; ) h2.push(255), p2 += 1; h2.push(0); for (var b2 = -1; ++b2 < t4.length; ) h2.push(t4[b2]); h2 = n2.from(h2); var y2 = i2.mont(d2.modulus); e4 = (e4 = new i2(e4).toRed(y2)).redPow(new i2(d2.publicExponent)), e4 = n2.from(e4.fromRed().toArray()); var v2 = p2 < 8 ? 1 : 0; for (l2 = Math.min(e4.length, h2.length), e4.length !== h2.length && (v2 = 1), b2 = -1; ++b2 < l2; ) v2 |= e4[b2] ^ h2[b2]; return 0 === v2; }; }, 19626: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(19142), o2 = r3(3894), a2 = r3(47563), s2 = r3(54151), u2 = r3(63534), c2 = r3(29806); for (var f2 in c2) t3[f2] = c2[f2]; function d2(e4) { if ("number" != typeof e4 || e4 < t3.DEFLATE || e4 > t3.UNZIP) throw new TypeError("Bad argument"); this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = false, this.level = 0, this.memLevel = 0, this.mode = e4, this.strategy = 0, this.windowBits = 0, this.write_in_progress = false, this.pending_close = false, this.gzip_id_bytes_read = 0; } t3.NONE = 0, t3.DEFLATE = 1, t3.INFLATE = 2, t3.GZIP = 3, t3.GUNZIP = 4, t3.DEFLATERAW = 5, t3.INFLATERAW = 6, t3.UNZIP = 7, d2.prototype.close = function() { this.write_in_progress ? this.pending_close = true : (this.pending_close = false, o2(this.init_done, "close before init"), o2(this.mode <= t3.UNZIP), this.mode === t3.DEFLATE || this.mode === t3.GZIP || this.mode === t3.DEFLATERAW ? s2.deflateEnd(this.strm) : this.mode !== t3.INFLATE && this.mode !== t3.GUNZIP && this.mode !== t3.INFLATERAW && this.mode !== t3.UNZIP || u2.inflateEnd(this.strm), this.mode = t3.NONE, this.dictionary = null); }, d2.prototype.write = function(e4, t4, r4, n3, i3, o3, a3) { return this._write(true, e4, t4, r4, n3, i3, o3, a3); }, d2.prototype.writeSync = function(e4, t4, r4, n3, i3, o3, a3) { return this._write(false, e4, t4, r4, n3, i3, o3, a3); }, d2.prototype._write = function(e4, r4, a3, s3, u3, c3, f3, d3) { if (o2.equal(arguments.length, 8), o2(this.init_done, "write before init"), o2(this.mode !== t3.NONE, "already finalized"), o2.equal(false, this.write_in_progress, "write already in progress"), o2.equal(false, this.pending_close, "close is pending"), this.write_in_progress = true, o2.equal(false, void 0 === r4, "must provide flush value"), this.write_in_progress = true, r4 !== t3.Z_NO_FLUSH && r4 !== t3.Z_PARTIAL_FLUSH && r4 !== t3.Z_SYNC_FLUSH && r4 !== t3.Z_FULL_FLUSH && r4 !== t3.Z_FINISH && r4 !== t3.Z_BLOCK) throw new Error("Invalid flush value"); if (null == a3 && (a3 = n2.alloc(0), u3 = 0, s3 = 0), this.strm.avail_in = u3, this.strm.input = a3, this.strm.next_in = s3, this.strm.avail_out = d3, this.strm.output = c3, this.strm.next_out = f3, this.flush = r4, !e4) return this._process(), this._checkError() ? this._afterSync() : void 0; var l2 = this; return i2.nextTick(function() { l2._process(), l2._after(); }), this; }, d2.prototype._afterSync = function() { var e4 = this.strm.avail_out, t4 = this.strm.avail_in; return this.write_in_progress = false, [t4, e4]; }, d2.prototype._process = function() { var e4 = null; switch (this.mode) { case t3.DEFLATE: case t3.GZIP: case t3.DEFLATERAW: this.err = s2.deflate(this.strm, this.flush); break; case t3.UNZIP: switch (this.strm.avail_in > 0 && (e4 = this.strm.next_in), this.gzip_id_bytes_read) { case 0: if (null === e4) break; if (31 !== this.strm.input[e4]) { this.mode = t3.INFLATE; break; } if (this.gzip_id_bytes_read = 1, e4++, 1 === this.strm.avail_in) break; case 1: if (null === e4) break; 139 === this.strm.input[e4] ? (this.gzip_id_bytes_read = 2, this.mode = t3.GUNZIP) : this.mode = t3.INFLATE; break; default: throw new Error("invalid number of gzip magic number bytes read"); } case t3.INFLATE: case t3.GUNZIP: case t3.INFLATERAW: for (this.err = u2.inflate(this.strm, this.flush), this.err === t3.Z_NEED_DICT && this.dictionary && (this.err = u2.inflateSetDictionary(this.strm, this.dictionary), this.err === t3.Z_OK ? this.err = u2.inflate(this.strm, this.flush) : this.err === t3.Z_DATA_ERROR && (this.err = t3.Z_NEED_DICT)); this.strm.avail_in > 0 && this.mode === t3.GUNZIP && this.err === t3.Z_STREAM_END && 0 !== this.strm.next_in[0]; ) this.reset(), this.err = u2.inflate(this.strm, this.flush); break; default: throw new Error("Unknown mode " + this.mode); } }, d2.prototype._checkError = function() { switch (this.err) { case t3.Z_OK: case t3.Z_BUF_ERROR: if (0 !== this.strm.avail_out && this.flush === t3.Z_FINISH) return this._error("unexpected end of file"), false; break; case t3.Z_STREAM_END: break; case t3.Z_NEED_DICT: return null == this.dictionary ? this._error("Missing dictionary") : this._error("Bad dictionary"), false; default: return this._error("Zlib error"), false; } return true; }, d2.prototype._after = function() { if (this._checkError()) { var e4 = this.strm.avail_out, t4 = this.strm.avail_in; this.write_in_progress = false, this.callback(t4, e4), this.pending_close && this.close(); } }, d2.prototype._error = function(e4) { this.strm.msg && (e4 = this.strm.msg), this.onerror(e4, this.err), this.write_in_progress = false, this.pending_close && this.close(); }, d2.prototype.init = function(e4, r4, n3, i3, a3) { o2(4 === arguments.length || 5 === arguments.length, "init(windowBits, level, memLevel, strategy, [dictionary])"), o2(e4 >= 8 && e4 <= 15, "invalid windowBits"), o2(r4 >= -1 && r4 <= 9, "invalid compression level"), o2(n3 >= 1 && n3 <= 9, "invalid memlevel"), o2(i3 === t3.Z_FILTERED || i3 === t3.Z_HUFFMAN_ONLY || i3 === t3.Z_RLE || i3 === t3.Z_FIXED || i3 === t3.Z_DEFAULT_STRATEGY, "invalid strategy"), this._init(r4, e4, n3, i3, a3), this._setDictionary(); }, d2.prototype.params = function() { throw new Error("deflateParams Not supported"); }, d2.prototype.reset = function() { this._reset(), this._setDictionary(); }, d2.prototype._init = function(e4, r4, n3, i3, o3) { switch (this.level = e4, this.windowBits = r4, this.memLevel = n3, this.strategy = i3, this.flush = t3.Z_NO_FLUSH, this.err = t3.Z_OK, this.mode !== t3.GZIP && this.mode !== t3.GUNZIP || (this.windowBits += 16), this.mode === t3.UNZIP && (this.windowBits += 32), this.mode !== t3.DEFLATERAW && this.mode !== t3.INFLATERAW || (this.windowBits = -1 * this.windowBits), this.strm = new a2(), this.mode) { case t3.DEFLATE: case t3.GZIP: case t3.DEFLATERAW: this.err = s2.deflateInit2(this.strm, this.level, t3.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy); break; case t3.INFLATE: case t3.GUNZIP: case t3.INFLATERAW: case t3.UNZIP: this.err = u2.inflateInit2(this.strm, this.windowBits); break; default: throw new Error("Unknown mode " + this.mode); } this.err !== t3.Z_OK && this._error("Init error"), this.dictionary = o3, this.write_in_progress = false, this.init_done = true; }, d2.prototype._setDictionary = function() { if (null != this.dictionary) { switch (this.err = t3.Z_OK, this.mode) { case t3.DEFLATE: case t3.DEFLATERAW: this.err = s2.deflateSetDictionary(this.strm, this.dictionary); } this.err !== t3.Z_OK && this._error("Failed to set dictionary"); } }, d2.prototype._reset = function() { switch (this.err = t3.Z_OK, this.mode) { case t3.DEFLATE: case t3.DEFLATERAW: case t3.GZIP: this.err = s2.deflateReset(this.strm); break; case t3.INFLATE: case t3.INFLATERAW: case t3.GUNZIP: this.err = u2.inflateReset(this.strm); } this.err !== t3.Z_OK && this._error("Failed to reset stream"); }, t3.Zlib = d2; }, 77611: (e3, t3, r3) => { var n2 = r3(19142), i2 = r3(29033).Buffer, o2 = r3(57245).Transform, a2 = r3(19626), s2 = r3(45058), u2 = r3(3894).ok, c2 = r3(29033).kMaxLength, f2 = "Cannot create final Buffer. It would be larger than 0x" + c2.toString(16) + " bytes"; a2.Z_MIN_WINDOWBITS = 8, a2.Z_MAX_WINDOWBITS = 15, a2.Z_DEFAULT_WINDOWBITS = 15, a2.Z_MIN_CHUNK = 64, a2.Z_MAX_CHUNK = 1 / 0, a2.Z_DEFAULT_CHUNK = 16384, a2.Z_MIN_MEMLEVEL = 1, a2.Z_MAX_MEMLEVEL = 9, a2.Z_DEFAULT_MEMLEVEL = 8, a2.Z_MIN_LEVEL = -1, a2.Z_MAX_LEVEL = 9, a2.Z_DEFAULT_LEVEL = a2.Z_DEFAULT_COMPRESSION; for (var d2 = Object.keys(a2), l2 = 0; l2 < d2.length; l2++) { var h2 = d2[l2]; h2.match(/^Z/) && Object.defineProperty(t3, h2, { enumerable: true, value: a2[h2], writable: false }); } for (var p2 = { Z_OK: a2.Z_OK, Z_STREAM_END: a2.Z_STREAM_END, Z_NEED_DICT: a2.Z_NEED_DICT, Z_ERRNO: a2.Z_ERRNO, Z_STREAM_ERROR: a2.Z_STREAM_ERROR, Z_DATA_ERROR: a2.Z_DATA_ERROR, Z_MEM_ERROR: a2.Z_MEM_ERROR, Z_BUF_ERROR: a2.Z_BUF_ERROR, Z_VERSION_ERROR: a2.Z_VERSION_ERROR }, b2 = Object.keys(p2), y2 = 0; y2 < b2.length; y2++) { var v2 = b2[y2]; p2[p2[v2]] = v2; } function m2(e4, t4, r4) { var n3 = [], o3 = 0; function a3() { for (var t5; null !== (t5 = e4.read()); ) n3.push(t5), o3 += t5.length; e4.once("readable", a3); } function s3() { var t5, a4 = null; o3 >= c2 ? a4 = new RangeError(f2) : t5 = i2.concat(n3, o3), n3 = [], e4.close(), r4(a4, t5); } e4.on("error", function(t5) { e4.removeListener("end", s3), e4.removeListener("readable", a3), r4(t5); }), e4.on("end", s3), e4.end(t4), a3(); } function g2(e4, t4) { if ("string" == typeof t4 && (t4 = i2.from(t4)), !i2.isBuffer(t4)) throw new TypeError("Not a string or buffer"); var r4 = e4._finishFlushFlag; return e4._processChunk(t4, r4); } function w2(e4) { if (!(this instanceof w2)) return new w2(e4); O2.call(this, e4, a2.DEFLATE); } function k2(e4) { if (!(this instanceof k2)) return new k2(e4); O2.call(this, e4, a2.INFLATE); } function _2(e4) { if (!(this instanceof _2)) return new _2(e4); O2.call(this, e4, a2.GZIP); } function A2(e4) { if (!(this instanceof A2)) return new A2(e4); O2.call(this, e4, a2.GUNZIP); } function E2(e4) { if (!(this instanceof E2)) return new E2(e4); O2.call(this, e4, a2.DEFLATERAW); } function S2(e4) { if (!(this instanceof S2)) return new S2(e4); O2.call(this, e4, a2.INFLATERAW); } function x2(e4) { if (!(this instanceof x2)) return new x2(e4); O2.call(this, e4, a2.UNZIP); } function B2(e4) { return e4 === a2.Z_NO_FLUSH || e4 === a2.Z_PARTIAL_FLUSH || e4 === a2.Z_SYNC_FLUSH || e4 === a2.Z_FULL_FLUSH || e4 === a2.Z_FINISH || e4 === a2.Z_BLOCK; } function O2(e4, r4) { var n3 = this; if (this._opts = e4 = e4 || {}, this._chunkSize = e4.chunkSize || t3.Z_DEFAULT_CHUNK, o2.call(this, e4), e4.flush && !B2(e4.flush)) throw new Error("Invalid flush flag: " + e4.flush); if (e4.finishFlush && !B2(e4.finishFlush)) throw new Error("Invalid flush flag: " + e4.finishFlush); if (this._flushFlag = e4.flush || a2.Z_NO_FLUSH, this._finishFlushFlag = void 0 !== e4.finishFlush ? e4.finishFlush : a2.Z_FINISH, e4.chunkSize && (e4.chunkSize < t3.Z_MIN_CHUNK || e4.chunkSize > t3.Z_MAX_CHUNK)) throw new Error("Invalid chunk size: " + e4.chunkSize); if (e4.windowBits && (e4.windowBits < t3.Z_MIN_WINDOWBITS || e4.windowBits > t3.Z_MAX_WINDOWBITS)) throw new Error("Invalid windowBits: " + e4.windowBits); if (e4.level && (e4.level < t3.Z_MIN_LEVEL || e4.level > t3.Z_MAX_LEVEL)) throw new Error("Invalid compression level: " + e4.level); if (e4.memLevel && (e4.memLevel < t3.Z_MIN_MEMLEVEL || e4.memLevel > t3.Z_MAX_MEMLEVEL)) throw new Error("Invalid memLevel: " + e4.memLevel); if (e4.strategy && e4.strategy != t3.Z_FILTERED && e4.strategy != t3.Z_HUFFMAN_ONLY && e4.strategy != t3.Z_RLE && e4.strategy != t3.Z_FIXED && e4.strategy != t3.Z_DEFAULT_STRATEGY) throw new Error("Invalid strategy: " + e4.strategy); if (e4.dictionary && !i2.isBuffer(e4.dictionary)) throw new Error("Invalid dictionary: it should be a Buffer instance"); this._handle = new a2.Zlib(r4); var s3 = this; this._hadError = false, this._handle.onerror = function(e5, r5) { P2(s3), s3._hadError = true; var n4 = new Error(e5); n4.errno = r5, n4.code = t3.codes[r5], s3.emit("error", n4); }; var u3 = t3.Z_DEFAULT_COMPRESSION; "number" == typeof e4.level && (u3 = e4.level); var c3 = t3.Z_DEFAULT_STRATEGY; "number" == typeof e4.strategy && (c3 = e4.strategy), this._handle.init(e4.windowBits || t3.Z_DEFAULT_WINDOWBITS, u3, e4.memLevel || t3.Z_DEFAULT_MEMLEVEL, c3, e4.dictionary), this._buffer = i2.allocUnsafe(this._chunkSize), this._offset = 0, this._level = u3, this._strategy = c3, this.once("end", this.close), Object.defineProperty(this, "_closed", { get: function() { return !n3._handle; }, configurable: true, enumerable: true }); } function P2(e4, t4) { t4 && n2.nextTick(t4), e4._handle && (e4._handle.close(), e4._handle = null); } function I2(e4) { e4.emit("close"); } Object.defineProperty(t3, "codes", { enumerable: true, value: Object.freeze(p2), writable: false }), t3.Deflate = w2, t3.Inflate = k2, t3.Gzip = _2, t3.Gunzip = A2, t3.DeflateRaw = E2, t3.InflateRaw = S2, t3.Unzip = x2, t3.createDeflate = function(e4) { return new w2(e4); }, t3.createInflate = function(e4) { return new k2(e4); }, t3.createDeflateRaw = function(e4) { return new E2(e4); }, t3.createInflateRaw = function(e4) { return new S2(e4); }, t3.createGzip = function(e4) { return new _2(e4); }, t3.createGunzip = function(e4) { return new A2(e4); }, t3.createUnzip = function(e4) { return new x2(e4); }, t3.deflate = function(e4, t4, r4) { return "function" == typeof t4 && (r4 = t4, t4 = {}), m2(new w2(t4), e4, r4); }, t3.deflateSync = function(e4, t4) { return g2(new w2(t4), e4); }, t3.gzip = function(e4, t4, r4) { return "function" == typeof t4 && (r4 = t4, t4 = {}), m2(new _2(t4), e4, r4); }, t3.gzipSync = function(e4, t4) { return g2(new _2(t4), e4); }, t3.deflateRaw = function(e4, t4, r4) { return "function" == typeof t4 && (r4 = t4, t4 = {}), m2(new E2(t4), e4, r4); }, t3.deflateRawSync = function(e4, t4) { return g2(new E2(t4), e4); }, t3.unzip = function(e4, t4, r4) { return "function" == typeof t4 && (r4 = t4, t4 = {}), m2(new x2(t4), e4, r4); }, t3.unzipSync = function(e4, t4) { return g2(new x2(t4), e4); }, t3.inflate = function(e4, t4, r4) { return "function" == typeof t4 && (r4 = t4, t4 = {}), m2(new k2(t4), e4, r4); }, t3.inflateSync = function(e4, t4) { return g2(new k2(t4), e4); }, t3.gunzip = function(e4, t4, r4) { return "function" == typeof t4 && (r4 = t4, t4 = {}), m2(new A2(t4), e4, r4); }, t3.gunzipSync = function(e4, t4) { return g2(new A2(t4), e4); }, t3.inflateRaw = function(e4, t4, r4) { return "function" == typeof t4 && (r4 = t4, t4 = {}), m2(new S2(t4), e4, r4); }, t3.inflateRawSync = function(e4, t4) { return g2(new S2(t4), e4); }, s2.inherits(O2, o2), O2.prototype.params = function(e4, r4, i3) { if (e4 < t3.Z_MIN_LEVEL || e4 > t3.Z_MAX_LEVEL) throw new RangeError("Invalid compression level: " + e4); if (r4 != t3.Z_FILTERED && r4 != t3.Z_HUFFMAN_ONLY && r4 != t3.Z_RLE && r4 != t3.Z_FIXED && r4 != t3.Z_DEFAULT_STRATEGY) throw new TypeError("Invalid strategy: " + r4); if (this._level !== e4 || this._strategy !== r4) { var o3 = this; this.flush(a2.Z_SYNC_FLUSH, function() { u2(o3._handle, "zlib binding closed"), o3._handle.params(e4, r4), o3._hadError || (o3._level = e4, o3._strategy = r4, i3 && i3()); }); } else n2.nextTick(i3); }, O2.prototype.reset = function() { return u2(this._handle, "zlib binding closed"), this._handle.reset(); }, O2.prototype._flush = function(e4) { this._transform(i2.alloc(0), "", e4); }, O2.prototype.flush = function(e4, t4) { var r4 = this, o3 = this._writableState; ("function" == typeof e4 || void 0 === e4 && !t4) && (t4 = e4, e4 = a2.Z_FULL_FLUSH), o3.ended ? t4 && n2.nextTick(t4) : o3.ending ? t4 && this.once("end", t4) : o3.needDrain ? t4 && this.once("drain", function() { return r4.flush(e4, t4); }) : (this._flushFlag = e4, this.write(i2.alloc(0), "", t4)); }, O2.prototype.close = function(e4) { P2(this, e4), n2.nextTick(I2, this); }, O2.prototype._transform = function(e4, t4, r4) { var n3, o3 = this._writableState, s3 = (o3.ending || o3.ended) && (!e4 || o3.length === e4.length); return null === e4 || i2.isBuffer(e4) ? this._handle ? (s3 ? n3 = this._finishFlushFlag : (n3 = this._flushFlag, e4.length >= o3.length && (this._flushFlag = this._opts.flush || a2.Z_NO_FLUSH)), void this._processChunk(e4, n3, r4)) : r4(new Error("zlib binding closed")) : r4(new Error("invalid input")); }, O2.prototype._processChunk = function(e4, t4, r4) { var n3 = e4 && e4.length, o3 = this._chunkSize - this._offset, a3 = 0, s3 = this, d3 = "function" == typeof r4; if (!d3) { var l3, h3 = [], p3 = 0; this.on("error", function(e5) { l3 = e5; }), u2(this._handle, "zlib binding closed"); do { var b3 = this._handle.writeSync(t4, e4, a3, n3, this._buffer, this._offset, o3); } while (!this._hadError && m3(b3[0], b3[1])); if (this._hadError) throw l3; if (p3 >= c2) throw P2(this), new RangeError(f2); var y3 = i2.concat(h3, p3); return P2(this), y3; } u2(this._handle, "zlib binding closed"); var v3 = this._handle.write(t4, e4, a3, n3, this._buffer, this._offset, o3); function m3(c3, f3) { if (this && (this.buffer = null, this.callback = null), !s3._hadError) { var l4 = o3 - f3; if (u2(l4 >= 0, "have should not go down"), l4 > 0) { var b4 = s3._buffer.slice(s3._offset, s3._offset + l4); s3._offset += l4, d3 ? s3.push(b4) : (h3.push(b4), p3 += b4.length); } if ((0 === f3 || s3._offset >= s3._chunkSize) && (o3 = s3._chunkSize, s3._offset = 0, s3._buffer = i2.allocUnsafe(s3._chunkSize)), 0 === f3) { if (a3 += n3 - c3, n3 = c3, !d3) return true; var y4 = s3._handle.write(t4, e4, a3, n3, s3._buffer, s3._offset, s3._chunkSize); return y4.callback = m3, void (y4.buffer = e4); } if (!d3) return false; r4(); } } v3.buffer = e4, v3.callback = m3; }, s2.inherits(w2, O2), s2.inherits(k2, O2), s2.inherits(_2, O2), s2.inherits(A2, O2), s2.inherits(E2, O2), s2.inherits(S2, O2), s2.inherits(x2, O2); }, 96316: (e3, t3, r3) => { var n2 = r3(29033).Buffer; e3.exports = function(e4, t4) { for (var r4 = Math.min(e4.length, t4.length), i2 = new n2(r4), o2 = 0; o2 < r4; ++o2) i2[o2] = e4[o2] ^ t4[o2]; return i2; }; }, 29033: (e3, t3, r3) => { var n2 = r3(34919), i2 = r3(83226), o2 = r3(39484); function a2() { return u2.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823; } function s2(e4, t4) { if (a2() < t4) throw new RangeError("Invalid typed array length"); return u2.TYPED_ARRAY_SUPPORT ? (e4 = new Uint8Array(t4)).__proto__ = u2.prototype : (null === e4 && (e4 = new u2(t4)), e4.length = t4), e4; } function u2(e4, t4, r4) { if (!(u2.TYPED_ARRAY_SUPPORT || this instanceof u2)) return new u2(e4, t4, r4); if ("number" == typeof e4) { if ("string" == typeof t4) throw new Error("If encoding is specified then the first argument must be a string"); return d2(this, e4); } return c2(this, e4, t4, r4); } function c2(e4, t4, r4, n3) { if ("number" == typeof t4) throw new TypeError('"value" argument must not be a number'); return "undefined" != typeof ArrayBuffer && t4 instanceof ArrayBuffer ? function(e5, t5, r5, n4) { if (t5.byteLength, r5 < 0 || t5.byteLength < r5) throw new RangeError("'offset' is out of bounds"); if (t5.byteLength < r5 + (n4 || 0)) throw new RangeError("'length' is out of bounds"); return t5 = void 0 === r5 && void 0 === n4 ? new Uint8Array(t5) : void 0 === n4 ? new Uint8Array(t5, r5) : new Uint8Array(t5, r5, n4), u2.TYPED_ARRAY_SUPPORT ? (e5 = t5).__proto__ = u2.prototype : e5 = l2(e5, t5), e5; }(e4, t4, r4, n3) : "string" == typeof t4 ? function(e5, t5, r5) { if ("string" == typeof r5 && "" !== r5 || (r5 = "utf8"), !u2.isEncoding(r5)) throw new TypeError('"encoding" must be a valid string encoding'); var n4 = 0 | p2(t5, r5), i3 = (e5 = s2(e5, n4)).write(t5, r5); return i3 !== n4 && (e5 = e5.slice(0, i3)), e5; }(e4, t4, r4) : function(e5, t5) { if (u2.isBuffer(t5)) { var r5 = 0 | h2(t5.length); return 0 === (e5 = s2(e5, r5)).length || t5.copy(e5, 0, 0, r5), e5; } if (t5) { if ("undefined" != typeof ArrayBuffer && t5.buffer instanceof ArrayBuffer || "length" in t5) return "number" != typeof t5.length || (n4 = t5.length) != n4 ? s2(e5, 0) : l2(e5, t5); if ("Buffer" === t5.type && o2(t5.data)) return l2(e5, t5.data); } var n4; throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object."); }(e4, t4); } function f2(e4) { if ("number" != typeof e4) throw new TypeError('"size" argument must be a number'); if (e4 < 0) throw new RangeError('"size" argument must not be negative'); } function d2(e4, t4) { if (f2(t4), e4 = s2(e4, t4 < 0 ? 0 : 0 | h2(t4)), !u2.TYPED_ARRAY_SUPPORT) for (var r4 = 0; r4 < t4; ++r4) e4[r4] = 0; return e4; } function l2(e4, t4) { var r4 = t4.length < 0 ? 0 : 0 | h2(t4.length); e4 = s2(e4, r4); for (var n3 = 0; n3 < r4; n3 += 1) e4[n3] = 255 & t4[n3]; return e4; } function h2(e4) { if (e4 >= a2()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + a2().toString(16) + " bytes"); return 0 | e4; } function p2(e4, t4) { if (u2.isBuffer(e4)) return e4.length; if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e4) || e4 instanceof ArrayBuffer)) return e4.byteLength; "string" != typeof e4 && (e4 = "" + e4); var r4 = e4.length; if (0 === r4) return 0; for (var n3 = false; ; ) switch (t4) { case "ascii": case "latin1": case "binary": return r4; case "utf8": case "utf-8": case void 0: return D2(e4).length; case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return 2 * r4; case "hex": return r4 >>> 1; case "base64": return H2(e4).length; default: if (n3) return D2(e4).length; t4 = ("" + t4).toLowerCase(), n3 = true; } } function b2(e4, t4, r4) { var n3 = false; if ((void 0 === t4 || t4 < 0) && (t4 = 0), t4 > this.length) return ""; if ((void 0 === r4 || r4 > this.length) && (r4 = this.length), r4 <= 0) return ""; if ((r4 >>>= 0) <= (t4 >>>= 0)) return ""; for (e4 || (e4 = "utf8"); ; ) switch (e4) { case "hex": return I2(this, t4, r4); case "utf8": case "utf-8": return x2(this, t4, r4); case "ascii": return O2(this, t4, r4); case "latin1": case "binary": return P2(this, t4, r4); case "base64": return S2(this, t4, r4); case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return T2(this, t4, r4); default: if (n3) throw new TypeError("Unknown encoding: " + e4); e4 = (e4 + "").toLowerCase(), n3 = true; } } function y2(e4, t4, r4) { var n3 = e4[t4]; e4[t4] = e4[r4], e4[r4] = n3; } function v2(e4, t4, r4, n3, i3) { if (0 === e4.length) return -1; if ("string" == typeof r4 ? (n3 = r4, r4 = 0) : r4 > 2147483647 ? r4 = 2147483647 : r4 < -2147483648 && (r4 = -2147483648), r4 = +r4, isNaN(r4) && (r4 = i3 ? 0 : e4.length - 1), r4 < 0 && (r4 = e4.length + r4), r4 >= e4.length) { if (i3) return -1; r4 = e4.length - 1; } else if (r4 < 0) { if (!i3) return -1; r4 = 0; } if ("string" == typeof t4 && (t4 = u2.from(t4, n3)), u2.isBuffer(t4)) return 0 === t4.length ? -1 : m2(e4, t4, r4, n3, i3); if ("number" == typeof t4) return t4 &= 255, u2.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? i3 ? Uint8Array.prototype.indexOf.call(e4, t4, r4) : Uint8Array.prototype.lastIndexOf.call(e4, t4, r4) : m2(e4, [t4], r4, n3, i3); throw new TypeError("val must be string, number or Buffer"); } function m2(e4, t4, r4, n3, i3) { var o3, a3 = 1, s3 = e4.length, u3 = t4.length; if (void 0 !== n3 && ("ucs2" === (n3 = String(n3).toLowerCase()) || "ucs-2" === n3 || "utf16le" === n3 || "utf-16le" === n3)) { if (e4.length < 2 || t4.length < 2) return -1; a3 = 2, s3 /= 2, u3 /= 2, r4 /= 2; } function c3(e5, t5) { return 1 === a3 ? e5[t5] : e5.readUInt16BE(t5 * a3); } if (i3) { var f3 = -1; for (o3 = r4; o3 < s3; o3++) if (c3(e4, o3) === c3(t4, -1 === f3 ? 0 : o3 - f3)) { if (-1 === f3 && (f3 = o3), o3 - f3 + 1 === u3) return f3 * a3; } else -1 !== f3 && (o3 -= o3 - f3), f3 = -1; } else for (r4 + u3 > s3 && (r4 = s3 - u3), o3 = r4; o3 >= 0; o3--) { for (var d3 = true, l3 = 0; l3 < u3; l3++) if (c3(e4, o3 + l3) !== c3(t4, l3)) { d3 = false; break; } if (d3) return o3; } return -1; } function g2(e4, t4, r4, n3) { r4 = Number(r4) || 0; var i3 = e4.length - r4; n3 ? (n3 = Number(n3)) > i3 && (n3 = i3) : n3 = i3; var o3 = t4.length; if (o3 % 2 != 0) throw new TypeError("Invalid hex string"); n3 > o3 / 2 && (n3 = o3 / 2); for (var a3 = 0; a3 < n3; ++a3) { var s3 = parseInt(t4.substr(2 * a3, 2), 16); if (isNaN(s3)) return a3; e4[r4 + a3] = s3; } return a3; } function w2(e4, t4, r4, n3) { return z2(D2(t4, e4.length - r4), e4, r4, n3); } function k2(e4, t4, r4, n3) { return z2(function(e5) { for (var t5 = [], r5 = 0; r5 < e5.length; ++r5) t5.push(255 & e5.charCodeAt(r5)); return t5; }(t4), e4, r4, n3); } function _2(e4, t4, r4, n3) { return k2(e4, t4, r4, n3); } function A2(e4, t4, r4, n3) { return z2(H2(t4), e4, r4, n3); } function E2(e4, t4, r4, n3) { return z2(function(e5, t5) { for (var r5, n4, i3, o3 = [], a3 = 0; a3 < e5.length && !((t5 -= 2) < 0); ++a3) n4 = (r5 = e5.charCodeAt(a3)) >> 8, i3 = r5 % 256, o3.push(i3), o3.push(n4); return o3; }(t4, e4.length - r4), e4, r4, n3); } function S2(e4, t4, r4) { return 0 === t4 && r4 === e4.length ? n2.fromByteArray(e4) : n2.fromByteArray(e4.slice(t4, r4)); } function x2(e4, t4, r4) { r4 = Math.min(e4.length, r4); for (var n3 = [], i3 = t4; i3 < r4; ) { var o3, a3, s3, u3, c3 = e4[i3], f3 = null, d3 = c3 > 239 ? 4 : c3 > 223 ? 3 : c3 > 191 ? 2 : 1; if (i3 + d3 <= r4) switch (d3) { case 1: c3 < 128 && (f3 = c3); break; case 2: 128 == (192 & (o3 = e4[i3 + 1])) && (u3 = (31 & c3) << 6 | 63 & o3) > 127 && (f3 = u3); break; case 3: o3 = e4[i3 + 1], a3 = e4[i3 + 2], 128 == (192 & o3) && 128 == (192 & a3) && (u3 = (15 & c3) << 12 | (63 & o3) << 6 | 63 & a3) > 2047 && (u3 < 55296 || u3 > 57343) && (f3 = u3); break; case 4: o3 = e4[i3 + 1], a3 = e4[i3 + 2], s3 = e4[i3 + 3], 128 == (192 & o3) && 128 == (192 & a3) && 128 == (192 & s3) && (u3 = (15 & c3) << 18 | (63 & o3) << 12 | (63 & a3) << 6 | 63 & s3) > 65535 && u3 < 1114112 && (f3 = u3); } null === f3 ? (f3 = 65533, d3 = 1) : f3 > 65535 && (f3 -= 65536, n3.push(f3 >>> 10 & 1023 | 55296), f3 = 56320 | 1023 & f3), n3.push(f3), i3 += d3; } return function(e5) { var t5 = e5.length; if (t5 <= B2) return String.fromCharCode.apply(String, e5); for (var r5 = "", n4 = 0; n4 < t5; ) r5 += String.fromCharCode.apply(String, e5.slice(n4, n4 += B2)); return r5; }(n3); } t3.Buffer = u2, t3.SlowBuffer = function(e4) { return +e4 != e4 && (e4 = 0), u2.alloc(+e4); }, t3.INSPECT_MAX_BYTES = 50, u2.TYPED_ARRAY_SUPPORT = void 0 !== r3.g.TYPED_ARRAY_SUPPORT ? r3.g.TYPED_ARRAY_SUPPORT : function() { try { var e4 = new Uint8Array(1); return e4.__proto__ = { __proto__: Uint8Array.prototype, foo: function() { return 42; } }, 42 === e4.foo() && "function" == typeof e4.subarray && 0 === e4.subarray(1, 1).byteLength; } catch (e5) { return false; } }(), t3.kMaxLength = a2(), u2.poolSize = 8192, u2._augment = function(e4) { return e4.__proto__ = u2.prototype, e4; }, u2.from = function(e4, t4, r4) { return c2(null, e4, t4, r4); }, u2.TYPED_ARRAY_SUPPORT && (u2.prototype.__proto__ = Uint8Array.prototype, u2.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && u2[Symbol.species] === u2 && Object.defineProperty(u2, Symbol.species, { value: null, configurable: true })), u2.alloc = function(e4, t4, r4) { return function(e5, t5, r5, n3) { return f2(t5), t5 <= 0 ? s2(e5, t5) : void 0 !== r5 ? "string" == typeof n3 ? s2(e5, t5).fill(r5, n3) : s2(e5, t5).fill(r5) : s2(e5, t5); }(null, e4, t4, r4); }, u2.allocUnsafe = function(e4) { return d2(null, e4); }, u2.allocUnsafeSlow = function(e4) { return d2(null, e4); }, u2.isBuffer = function(e4) { return !(null == e4 || !e4._isBuffer); }, u2.compare = function(e4, t4) { if (!u2.isBuffer(e4) || !u2.isBuffer(t4)) throw new TypeError("Arguments must be Buffers"); if (e4 === t4) return 0; for (var r4 = e4.length, n3 = t4.length, i3 = 0, o3 = Math.min(r4, n3); i3 < o3; ++i3) if (e4[i3] !== t4[i3]) { r4 = e4[i3], n3 = t4[i3]; break; } return r4 < n3 ? -1 : n3 < r4 ? 1 : 0; }, u2.isEncoding = function(e4) { switch (String(e4).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 true; default: return false; } }, u2.concat = function(e4, t4) { if (!o2(e4)) throw new TypeError('"list" argument must be an Array of Buffers'); if (0 === e4.length) return u2.alloc(0); var r4; if (void 0 === t4) for (t4 = 0, r4 = 0; r4 < e4.length; ++r4) t4 += e4[r4].length; var n3 = u2.allocUnsafe(t4), i3 = 0; for (r4 = 0; r4 < e4.length; ++r4) { var a3 = e4[r4]; if (!u2.isBuffer(a3)) throw new TypeError('"list" argument must be an Array of Buffers'); a3.copy(n3, i3), i3 += a3.length; } return n3; }, u2.byteLength = p2, u2.prototype._isBuffer = true, u2.prototype.swap16 = function() { var e4 = this.length; if (e4 % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits"); for (var t4 = 0; t4 < e4; t4 += 2) y2(this, t4, t4 + 1); return this; }, u2.prototype.swap32 = function() { var e4 = this.length; if (e4 % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits"); for (var t4 = 0; t4 < e4; t4 += 4) y2(this, t4, t4 + 3), y2(this, t4 + 1, t4 + 2); return this; }, u2.prototype.swap64 = function() { var e4 = this.length; if (e4 % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits"); for (var t4 = 0; t4 < e4; t4 += 8) y2(this, t4, t4 + 7), y2(this, t4 + 1, t4 + 6), y2(this, t4 + 2, t4 + 5), y2(this, t4 + 3, t4 + 4); return this; }, u2.prototype.toString = function() { var e4 = 0 | this.length; return 0 === e4 ? "" : 0 === arguments.length ? x2(this, 0, e4) : b2.apply(this, arguments); }, u2.prototype.equals = function(e4) { if (!u2.isBuffer(e4)) throw new TypeError("Argument must be a Buffer"); return this === e4 || 0 === u2.compare(this, e4); }, u2.prototype.inspect = function() { var e4 = "", r4 = t3.INSPECT_MAX_BYTES; return this.length > 0 && (e4 = this.toString("hex", 0, r4).match(/.{2}/g).join(" "), this.length > r4 && (e4 += " ... ")), ""; }, u2.prototype.compare = function(e4, t4, r4, n3, i3) { if (!u2.isBuffer(e4)) throw new TypeError("Argument must be a Buffer"); if (void 0 === t4 && (t4 = 0), void 0 === r4 && (r4 = e4 ? e4.length : 0), void 0 === n3 && (n3 = 0), void 0 === i3 && (i3 = this.length), t4 < 0 || r4 > e4.length || n3 < 0 || i3 > this.length) throw new RangeError("out of range index"); if (n3 >= i3 && t4 >= r4) return 0; if (n3 >= i3) return -1; if (t4 >= r4) return 1; if (this === e4) return 0; for (var o3 = (i3 >>>= 0) - (n3 >>>= 0), a3 = (r4 >>>= 0) - (t4 >>>= 0), s3 = Math.min(o3, a3), c3 = this.slice(n3, i3), f3 = e4.slice(t4, r4), d3 = 0; d3 < s3; ++d3) if (c3[d3] !== f3[d3]) { o3 = c3[d3], a3 = f3[d3]; break; } return o3 < a3 ? -1 : a3 < o3 ? 1 : 0; }, u2.prototype.includes = function(e4, t4, r4) { return -1 !== this.indexOf(e4, t4, r4); }, u2.prototype.indexOf = function(e4, t4, r4) { return v2(this, e4, t4, r4, true); }, u2.prototype.lastIndexOf = function(e4, t4, r4) { return v2(this, e4, t4, r4, false); }, u2.prototype.write = function(e4, t4, r4, n3) { if (void 0 === t4) n3 = "utf8", r4 = this.length, t4 = 0; else if (void 0 === r4 && "string" == typeof t4) n3 = t4, r4 = this.length, t4 = 0; else { if (!isFinite(t4)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); t4 |= 0, isFinite(r4) ? (r4 |= 0, void 0 === n3 && (n3 = "utf8")) : (n3 = r4, r4 = void 0); } var i3 = this.length - t4; if ((void 0 === r4 || r4 > i3) && (r4 = i3), e4.length > 0 && (r4 < 0 || t4 < 0) || t4 > this.length) throw new RangeError("Attempt to write outside buffer bounds"); n3 || (n3 = "utf8"); for (var o3 = false; ; ) switch (n3) { case "hex": return g2(this, e4, t4, r4); case "utf8": case "utf-8": return w2(this, e4, t4, r4); case "ascii": return k2(this, e4, t4, r4); case "latin1": case "binary": return _2(this, e4, t4, r4); case "base64": return A2(this, e4, t4, r4); case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return E2(this, e4, t4, r4); default: if (o3) throw new TypeError("Unknown encoding: " + n3); n3 = ("" + n3).toLowerCase(), o3 = true; } }, u2.prototype.toJSON = function() { return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) }; }; var B2 = 4096; function O2(e4, t4, r4) { var n3 = ""; r4 = Math.min(e4.length, r4); for (var i3 = t4; i3 < r4; ++i3) n3 += String.fromCharCode(127 & e4[i3]); return n3; } function P2(e4, t4, r4) { var n3 = ""; r4 = Math.min(e4.length, r4); for (var i3 = t4; i3 < r4; ++i3) n3 += String.fromCharCode(e4[i3]); return n3; } function I2(e4, t4, r4) { var n3, i3 = e4.length; (!t4 || t4 < 0) && (t4 = 0), (!r4 || r4 < 0 || r4 > i3) && (r4 = i3); for (var o3 = "", a3 = t4; a3 < r4; ++a3) o3 += (n3 = e4[a3]) < 16 ? "0" + n3.toString(16) : n3.toString(16); return o3; } function T2(e4, t4, r4) { for (var n3 = e4.slice(t4, r4), i3 = "", o3 = 0; o3 < n3.length; o3 += 2) i3 += String.fromCharCode(n3[o3] + 256 * n3[o3 + 1]); return i3; } function C2(e4, t4, r4) { if (e4 % 1 != 0 || e4 < 0) throw new RangeError("offset is not uint"); if (e4 + t4 > r4) throw new RangeError("Trying to access beyond buffer length"); } function M2(e4, t4, r4, n3, i3, o3) { if (!u2.isBuffer(e4)) throw new TypeError('"buffer" argument must be a Buffer instance'); if (t4 > i3 || t4 < o3) throw new RangeError('"value" argument is out of bounds'); if (r4 + n3 > e4.length) throw new RangeError("Index out of range"); } function R2(e4, t4, r4, n3) { t4 < 0 && (t4 = 65535 + t4 + 1); for (var i3 = 0, o3 = Math.min(e4.length - r4, 2); i3 < o3; ++i3) e4[r4 + i3] = (t4 & 255 << 8 * (n3 ? i3 : 1 - i3)) >>> 8 * (n3 ? i3 : 1 - i3); } function U2(e4, t4, r4, n3) { t4 < 0 && (t4 = 4294967295 + t4 + 1); for (var i3 = 0, o3 = Math.min(e4.length - r4, 4); i3 < o3; ++i3) e4[r4 + i3] = t4 >>> 8 * (n3 ? i3 : 3 - i3) & 255; } function N2(e4, t4, r4, n3, i3, o3) { if (r4 + n3 > e4.length) throw new RangeError("Index out of range"); if (r4 < 0) throw new RangeError("Index out of range"); } function j2(e4, t4, r4, n3, o3) { return o3 || N2(e4, 0, r4, 4), i2.write(e4, t4, r4, n3, 23, 4), r4 + 4; } function L2(e4, t4, r4, n3, o3) { return o3 || N2(e4, 0, r4, 8), i2.write(e4, t4, r4, n3, 52, 8), r4 + 8; } u2.prototype.slice = function(e4, t4) { var r4, n3 = this.length; if ((e4 = ~~e4) < 0 ? (e4 += n3) < 0 && (e4 = 0) : e4 > n3 && (e4 = n3), (t4 = void 0 === t4 ? n3 : ~~t4) < 0 ? (t4 += n3) < 0 && (t4 = 0) : t4 > n3 && (t4 = n3), t4 < e4 && (t4 = e4), u2.TYPED_ARRAY_SUPPORT) (r4 = this.subarray(e4, t4)).__proto__ = u2.prototype; else { var i3 = t4 - e4; r4 = new u2(i3, void 0); for (var o3 = 0; o3 < i3; ++o3) r4[o3] = this[o3 + e4]; } return r4; }, u2.prototype.readUIntLE = function(e4, t4, r4) { e4 |= 0, t4 |= 0, r4 || C2(e4, t4, this.length); for (var n3 = this[e4], i3 = 1, o3 = 0; ++o3 < t4 && (i3 *= 256); ) n3 += this[e4 + o3] * i3; return n3; }, u2.prototype.readUIntBE = function(e4, t4, r4) { e4 |= 0, t4 |= 0, r4 || C2(e4, t4, this.length); for (var n3 = this[e4 + --t4], i3 = 1; t4 > 0 && (i3 *= 256); ) n3 += this[e4 + --t4] * i3; return n3; }, u2.prototype.readUInt8 = function(e4, t4) { return t4 || C2(e4, 1, this.length), this[e4]; }, u2.prototype.readUInt16LE = function(e4, t4) { return t4 || C2(e4, 2, this.length), this[e4] | this[e4 + 1] << 8; }, u2.prototype.readUInt16BE = function(e4, t4) { return t4 || C2(e4, 2, this.length), this[e4] << 8 | this[e4 + 1]; }, u2.prototype.readUInt32LE = function(e4, t4) { return t4 || C2(e4, 4, this.length), (this[e4] | this[e4 + 1] << 8 | this[e4 + 2] << 16) + 16777216 * this[e4 + 3]; }, u2.prototype.readUInt32BE = function(e4, t4) { return t4 || C2(e4, 4, this.length), 16777216 * this[e4] + (this[e4 + 1] << 16 | this[e4 + 2] << 8 | this[e4 + 3]); }, u2.prototype.readIntLE = function(e4, t4, r4) { e4 |= 0, t4 |= 0, r4 || C2(e4, t4, this.length); for (var n3 = this[e4], i3 = 1, o3 = 0; ++o3 < t4 && (i3 *= 256); ) n3 += this[e4 + o3] * i3; return n3 >= (i3 *= 128) && (n3 -= Math.pow(2, 8 * t4)), n3; }, u2.prototype.readIntBE = function(e4, t4, r4) { e4 |= 0, t4 |= 0, r4 || C2(e4, t4, this.length); for (var n3 = t4, i3 = 1, o3 = this[e4 + --n3]; n3 > 0 && (i3 *= 256); ) o3 += this[e4 + --n3] * i3; return o3 >= (i3 *= 128) && (o3 -= Math.pow(2, 8 * t4)), o3; }, u2.prototype.readInt8 = function(e4, t4) { return t4 || C2(e4, 1, this.length), 128 & this[e4] ? -1 * (255 - this[e4] + 1) : this[e4]; }, u2.prototype.readInt16LE = function(e4, t4) { t4 || C2(e4, 2, this.length); var r4 = this[e4] | this[e4 + 1] << 8; return 32768 & r4 ? 4294901760 | r4 : r4; }, u2.prototype.readInt16BE = function(e4, t4) { t4 || C2(e4, 2, this.length); var r4 = this[e4 + 1] | this[e4] << 8; return 32768 & r4 ? 4294901760 | r4 : r4; }, u2.prototype.readInt32LE = function(e4, t4) { return t4 || C2(e4, 4, this.length), this[e4] | this[e4 + 1] << 8 | this[e4 + 2] << 16 | this[e4 + 3] << 24; }, u2.prototype.readInt32BE = function(e4, t4) { return t4 || C2(e4, 4, this.length), this[e4] << 24 | this[e4 + 1] << 16 | this[e4 + 2] << 8 | this[e4 + 3]; }, u2.prototype.readFloatLE = function(e4, t4) { return t4 || C2(e4, 4, this.length), i2.read(this, e4, true, 23, 4); }, u2.prototype.readFloatBE = function(e4, t4) { return t4 || C2(e4, 4, this.length), i2.read(this, e4, false, 23, 4); }, u2.prototype.readDoubleLE = function(e4, t4) { return t4 || C2(e4, 8, this.length), i2.read(this, e4, true, 52, 8); }, u2.prototype.readDoubleBE = function(e4, t4) { return t4 || C2(e4, 8, this.length), i2.read(this, e4, false, 52, 8); }, u2.prototype.writeUIntLE = function(e4, t4, r4, n3) { e4 = +e4, t4 |= 0, r4 |= 0, n3 || M2(this, e4, t4, r4, Math.pow(2, 8 * r4) - 1, 0); var i3 = 1, o3 = 0; for (this[t4] = 255 & e4; ++o3 < r4 && (i3 *= 256); ) this[t4 + o3] = e4 / i3 & 255; return t4 + r4; }, u2.prototype.writeUIntBE = function(e4, t4, r4, n3) { e4 = +e4, t4 |= 0, r4 |= 0, n3 || M2(this, e4, t4, r4, Math.pow(2, 8 * r4) - 1, 0); var i3 = r4 - 1, o3 = 1; for (this[t4 + i3] = 255 & e4; --i3 >= 0 && (o3 *= 256); ) this[t4 + i3] = e4 / o3 & 255; return t4 + r4; }, u2.prototype.writeUInt8 = function(e4, t4, r4) { return e4 = +e4, t4 |= 0, r4 || M2(this, e4, t4, 1, 255, 0), u2.TYPED_ARRAY_SUPPORT || (e4 = Math.floor(e4)), this[t4] = 255 & e4, t4 + 1; }, u2.prototype.writeUInt16LE = function(e4, t4, r4) { return e4 = +e4, t4 |= 0, r4 || M2(this, e4, t4, 2, 65535, 0), u2.TYPED_ARRAY_SUPPORT ? (this[t4] = 255 & e4, this[t4 + 1] = e4 >>> 8) : R2(this, e4, t4, true), t4 + 2; }, u2.prototype.writeUInt16BE = function(e4, t4, r4) { return e4 = +e4, t4 |= 0, r4 || M2(this, e4, t4, 2, 65535, 0), u2.TYPED_ARRAY_SUPPORT ? (this[t4] = e4 >>> 8, this[t4 + 1] = 255 & e4) : R2(this, e4, t4, false), t4 + 2; }, u2.prototype.writeUInt32LE = function(e4, t4, r4) { return e4 = +e4, t4 |= 0, r4 || M2(this, e4, t4, 4, 4294967295, 0), u2.TYPED_ARRAY_SUPPORT ? (this[t4 + 3] = e4 >>> 24, this[t4 + 2] = e4 >>> 16, this[t4 + 1] = e4 >>> 8, this[t4] = 255 & e4) : U2(this, e4, t4, true), t4 + 4; }, u2.prototype.writeUInt32BE = function(e4, t4, r4) { return e4 = +e4, t4 |= 0, r4 || M2(this, e4, t4, 4, 4294967295, 0), u2.TYPED_ARRAY_SUPPORT ? (this[t4] = e4 >>> 24, this[t4 + 1] = e4 >>> 16, this[t4 + 2] = e4 >>> 8, this[t4 + 3] = 255 & e4) : U2(this, e4, t4, false), t4 + 4; }, u2.prototype.writeIntLE = function(e4, t4, r4, n3) { if (e4 = +e4, t4 |= 0, !n3) { var i3 = Math.pow(2, 8 * r4 - 1); M2(this, e4, t4, r4, i3 - 1, -i3); } var o3 = 0, a3 = 1, s3 = 0; for (this[t4] = 255 & e4; ++o3 < r4 && (a3 *= 256); ) e4 < 0 && 0 === s3 && 0 !== this[t4 + o3 - 1] && (s3 = 1), this[t4 + o3] = (e4 / a3 >> 0) - s3 & 255; return t4 + r4; }, u2.prototype.writeIntBE = function(e4, t4, r4, n3) { if (e4 = +e4, t4 |= 0, !n3) { var i3 = Math.pow(2, 8 * r4 - 1); M2(this, e4, t4, r4, i3 - 1, -i3); } var o3 = r4 - 1, a3 = 1, s3 = 0; for (this[t4 + o3] = 255 & e4; --o3 >= 0 && (a3 *= 256); ) e4 < 0 && 0 === s3 && 0 !== this[t4 + o3 + 1] && (s3 = 1), this[t4 + o3] = (e4 / a3 >> 0) - s3 & 255; return t4 + r4; }, u2.prototype.writeInt8 = function(e4, t4, r4) { return e4 = +e4, t4 |= 0, r4 || M2(this, e4, t4, 1, 127, -128), u2.TYPED_ARRAY_SUPPORT || (e4 = Math.floor(e4)), e4 < 0 && (e4 = 255 + e4 + 1), this[t4] = 255 & e4, t4 + 1; }, u2.prototype.writeInt16LE = function(e4, t4, r4) { return e4 = +e4, t4 |= 0, r4 || M2(this, e4, t4, 2, 32767, -32768), u2.TYPED_ARRAY_SUPPORT ? (this[t4] = 255 & e4, this[t4 + 1] = e4 >>> 8) : R2(this, e4, t4, true), t4 + 2; }, u2.prototype.writeInt16BE = function(e4, t4, r4) { return e4 = +e4, t4 |= 0, r4 || M2(this, e4, t4, 2, 32767, -32768), u2.TYPED_ARRAY_SUPPORT ? (this[t4] = e4 >>> 8, this[t4 + 1] = 255 & e4) : R2(this, e4, t4, false), t4 + 2; }, u2.prototype.writeInt32LE = function(e4, t4, r4) { return e4 = +e4, t4 |= 0, r4 || M2(this, e4, t4, 4, 2147483647, -2147483648), u2.TYPED_ARRAY_SUPPORT ? (this[t4] = 255 & e4, this[t4 + 1] = e4 >>> 8, this[t4 + 2] = e4 >>> 16, this[t4 + 3] = e4 >>> 24) : U2(this, e4, t4, true), t4 + 4; }, u2.prototype.writeInt32BE = function(e4, t4, r4) { return e4 = +e4, t4 |= 0, r4 || M2(this, e4, t4, 4, 2147483647, -2147483648), e4 < 0 && (e4 = 4294967295 + e4 + 1), u2.TYPED_ARRAY_SUPPORT ? (this[t4] = e4 >>> 24, this[t4 + 1] = e4 >>> 16, this[t4 + 2] = e4 >>> 8, this[t4 + 3] = 255 & e4) : U2(this, e4, t4, false), t4 + 4; }, u2.prototype.writeFloatLE = function(e4, t4, r4) { return j2(this, e4, t4, true, r4); }, u2.prototype.writeFloatBE = function(e4, t4, r4) { return j2(this, e4, t4, false, r4); }, u2.prototype.writeDoubleLE = function(e4, t4, r4) { return L2(this, e4, t4, true, r4); }, u2.prototype.writeDoubleBE = function(e4, t4, r4) { return L2(this, e4, t4, false, r4); }, u2.prototype.copy = function(e4, t4, r4, n3) { if (r4 || (r4 = 0), n3 || 0 === n3 || (n3 = this.length), t4 >= e4.length && (t4 = e4.length), t4 || (t4 = 0), n3 > 0 && n3 < r4 && (n3 = r4), n3 === r4) return 0; if (0 === e4.length || 0 === this.length) return 0; if (t4 < 0) throw new RangeError("targetStart out of bounds"); if (r4 < 0 || r4 >= this.length) throw new RangeError("sourceStart out of bounds"); if (n3 < 0) throw new RangeError("sourceEnd out of bounds"); n3 > this.length && (n3 = this.length), e4.length - t4 < n3 - r4 && (n3 = e4.length - t4 + r4); var i3, o3 = n3 - r4; if (this === e4 && r4 < t4 && t4 < n3) for (i3 = o3 - 1; i3 >= 0; --i3) e4[i3 + t4] = this[i3 + r4]; else if (o3 < 1e3 || !u2.TYPED_ARRAY_SUPPORT) for (i3 = 0; i3 < o3; ++i3) e4[i3 + t4] = this[i3 + r4]; else Uint8Array.prototype.set.call(e4, this.subarray(r4, r4 + o3), t4); return o3; }, u2.prototype.fill = function(e4, t4, r4, n3) { if ("string" == typeof e4) { if ("string" == typeof t4 ? (n3 = t4, t4 = 0, r4 = this.length) : "string" == typeof r4 && (n3 = r4, r4 = this.length), 1 === e4.length) { var i3 = e4.charCodeAt(0); i3 < 256 && (e4 = i3); } if (void 0 !== n3 && "string" != typeof n3) throw new TypeError("encoding must be a string"); if ("string" == typeof n3 && !u2.isEncoding(n3)) throw new TypeError("Unknown encoding: " + n3); } else "number" == typeof e4 && (e4 &= 255); if (t4 < 0 || this.length < t4 || this.length < r4) throw new RangeError("Out of range index"); if (r4 <= t4) return this; var o3; if (t4 >>>= 0, r4 = void 0 === r4 ? this.length : r4 >>> 0, e4 || (e4 = 0), "number" == typeof e4) for (o3 = t4; o3 < r4; ++o3) this[o3] = e4; else { var a3 = u2.isBuffer(e4) ? e4 : D2(new u2(e4, n3).toString()), s3 = a3.length; for (o3 = 0; o3 < r4 - t4; ++o3) this[o3 + t4] = a3[o3 % s3]; } return this; }; var F2 = /[^+\/0-9A-Za-z-_]/g; function D2(e4, t4) { var r4; t4 = t4 || 1 / 0; for (var n3 = e4.length, i3 = null, o3 = [], a3 = 0; a3 < n3; ++a3) { if ((r4 = e4.charCodeAt(a3)) > 55295 && r4 < 57344) { if (!i3) { if (r4 > 56319) { (t4 -= 3) > -1 && o3.push(239, 191, 189); continue; } if (a3 + 1 === n3) { (t4 -= 3) > -1 && o3.push(239, 191, 189); continue; } i3 = r4; continue; } if (r4 < 56320) { (t4 -= 3) > -1 && o3.push(239, 191, 189), i3 = r4; continue; } r4 = 65536 + (i3 - 55296 << 10 | r4 - 56320); } else i3 && (t4 -= 3) > -1 && o3.push(239, 191, 189); if (i3 = null, r4 < 128) { if ((t4 -= 1) < 0) break; o3.push(r4); } else if (r4 < 2048) { if ((t4 -= 2) < 0) break; o3.push(r4 >> 6 | 192, 63 & r4 | 128); } else if (r4 < 65536) { if ((t4 -= 3) < 0) break; o3.push(r4 >> 12 | 224, r4 >> 6 & 63 | 128, 63 & r4 | 128); } else { if (!(r4 < 1114112)) throw new Error("Invalid code point"); if ((t4 -= 4) < 0) break; o3.push(r4 >> 18 | 240, r4 >> 12 & 63 | 128, r4 >> 6 & 63 | 128, 63 & r4 | 128); } } return o3; } function H2(e4) { return n2.toByteArray(function(e5) { if ((e5 = function(e6) { return e6.trim ? e6.trim() : e6.replace(/^\s+|\s+$/g, ""); }(e5).replace(F2, "")).length < 2) return ""; for (; e5.length % 4 != 0; ) e5 += "="; return e5; }(e4)); } function z2(e4, t4, r4, n3) { for (var i3 = 0; i3 < n3 && !(i3 + r4 >= t4.length || i3 >= e4.length); ++i3) t4[i3 + r4] = e4[i3]; return i3; } }, 83675: (e3) => { e3.exports = { 100: "Continue", 101: "Switching Protocols", 102: "Processing", 200: "OK", 201: "Created", 202: "Accepted", 203: "Non-Authoritative Information", 204: "No Content", 205: "Reset Content", 206: "Partial Content", 207: "Multi-Status", 208: "Already Reported", 226: "IM Used", 300: "Multiple Choices", 301: "Moved Permanently", 302: "Found", 303: "See Other", 304: "Not Modified", 305: "Use Proxy", 307: "Temporary Redirect", 308: "Permanent Redirect", 400: "Bad Request", 401: "Unauthorized", 402: "Payment Required", 403: "Forbidden", 404: "Not Found", 405: "Method Not Allowed", 406: "Not Acceptable", 407: "Proxy Authentication Required", 408: "Request Timeout", 409: "Conflict", 410: "Gone", 411: "Length Required", 412: "Precondition Failed", 413: "Payload Too Large", 414: "URI Too Long", 415: "Unsupported Media Type", 416: "Range Not Satisfiable", 417: "Expectation Failed", 418: "I'm a teapot", 421: "Misdirected Request", 422: "Unprocessable Entity", 423: "Locked", 424: "Failed Dependency", 425: "Unordered Collection", 426: "Upgrade Required", 428: "Precondition Required", 429: "Too Many Requests", 431: "Request Header Fields Too Large", 451: "Unavailable For Legal Reasons", 500: "Internal Server Error", 501: "Not Implemented", 502: "Bad Gateway", 503: "Service Unavailable", 504: "Gateway Timeout", 505: "HTTP Version Not Supported", 506: "Variant Also Negotiates", 507: "Insufficient Storage", 508: "Loop Detected", 509: "Bandwidth Limit Exceeded", 510: "Not Extended", 511: "Network Authentication Required" }; }, 80593: (e3, t3, r3) => { var n2 = r3(57701), i2 = r3(24373), o2 = i2(n2("String.prototype.indexOf")); e3.exports = function(e4, t4) { var r4 = n2(e4, !!t4); return "function" == typeof r4 && o2(e4, ".prototype.") > -1 ? i2(r4) : r4; }; }, 24373: (e3, t3, r3) => { var n2 = r3(3767), i2 = r3(57701), o2 = r3(77990), a2 = i2("%TypeError%"), s2 = i2("%Function.prototype.apply%"), u2 = i2("%Function.prototype.call%"), c2 = i2("%Reflect.apply%", true) || n2.call(u2, s2), f2 = i2("%Object.defineProperty%", true), d2 = i2("%Math.max%"); if (f2) try { f2({}, "a", { value: 1 }); } catch (e4) { f2 = null; } e3.exports = function(e4) { if ("function" != typeof e4) throw new a2("a function is required"); var t4 = c2(n2, u2, arguments); return o2(t4, 1 + d2(0, e4.length - (arguments.length - 1)), true); }; var l2 = function() { return c2(n2, s2, arguments); }; f2 ? f2(e3.exports, "apply", { value: l2 }) : e3.exports.apply = l2; }, 47759: (e3, t3, r3) => { for (var n2 = r3(28847)(r3(74519)), i2 = r3(83630), o2 = {}, a2 = 0, s2 = Object.entries(i2); a2 < s2.length; a2++) { var u2 = (0, n2.default)(s2[a2], 2), c2 = u2[0], f2 = u2[1]; o2[c2.toUpperCase().replace(/-/g, "_")] = f2; } e3.exports = Object.freeze(o2); }, 97223: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(26657), o2 = r3(55262), a2 = r3(71842), s2 = r3(40779); (t3 = e3.exports).addPrefix = function(e4, t4) { var r4; if (n2.isBuffer(e4)) r4 = s2.varintBufferEncode(e4); else { if (!a2[e4]) throw new Error("multicodec not recognized"); r4 = a2[e4]; } return n2.concat([r4, t4]); }, t3.rmPrefix = function(e4) { return i2.decode(e4), e4.slice(i2.decode.bytes); }, t3.getCodec = function(e4) { var t4 = i2.decode(e4), r4 = o2.get(t4); if (void 0 === r4) throw new Error("Code ".concat(t4, " not found")); return r4; }, t3.getName = function(e4) { return o2.get(e4); }, t3.getNumber = function(e4) { var t4 = a2[e4]; if (void 0 === t4) throw new Error("Codec `" + e4 + "` not found"); return s2.varintBufferDecode(t4)[0]; }, t3.getCode = function(e4) { return i2.decode(e4); }, t3.getCodeVarint = function(e4) { var t4 = a2[e4]; if (void 0 === t4) throw new Error("Codec `" + e4 + "` not found"); return t4; }, t3.getVarint = function(e4) { return i2.encode(e4); }; var u2 = r3(47759); Object.assign(t3, u2), t3.print = r3(29268); }, 55262: (e3, t3, r3) => { var n2 = r3(83630), i2 = /* @__PURE__ */ new Map(); for (var o2 in n2) { var a2 = n2[o2]; i2.set(a2, o2); } e3.exports = Object.freeze(i2); }, 29268: (e3, t3, r3) => { for (var n2 = r3(28847)(r3(74519)), i2 = r3(83630), o2 = {}, a2 = 0, s2 = Object.entries(i2); a2 < s2.length; a2++) { var u2 = (0, n2.default)(s2[a2], 2), c2 = u2[0], f2 = u2[1]; void 0 === o2[f2] && (o2[f2] = c2); } e3.exports = Object.freeze(o2); }, 40779: (e3, t3, r3) => { var n2 = r3(26657), i2 = r3(29033).Buffer; function o2(e4) { return parseInt(e4.toString("hex"), 16); } function a2(e4) { var t4 = e4.toString(16); return t4.length % 2 == 1 && (t4 = "0" + t4), i2.from(t4, "hex"); } e3.exports = { numberToBuffer: a2, bufferToNumber: o2, varintBufferEncode: function(e4) { return i2.from(n2.encode(o2(e4))); }, varintBufferDecode: function(e4) { return a2(n2.decode(e4)); }, varintEncode: function(e4) { return i2.from(n2.encode(e4)); } }; }, 71842: (e3, t3, r3) => { var n2 = r3(83630), i2 = r3(40779).varintEncode, o2 = {}; for (var a2 in n2) { var s2 = n2[a2]; o2[a2] = i2(s2); } e3.exports = Object.freeze(o2); }, 59976: (e3, t3, r3) => { var n2 = r3(77748), i2 = r3(29033).Buffer, o2 = { checkCIDComponents: function(e4) { if (null == e4) return "null values are not valid CIDs"; if (0 !== e4.version && 1 !== e4.version) return "Invalid version, must be a number equal to 1 or 0"; if ("string" != typeof e4.codec) return "codec must be string"; if (0 === e4.version) { if ("dag-pb" !== e4.codec) return "codec must be 'dag-pb' for CIDv0"; if ("base58btc" !== e4.multibaseName) return "multibaseName must be 'base58btc' for CIDv0"; } if (!i2.isBuffer(e4.multihash)) return "multihash must be a Buffer"; try { n2.validate(e4.multihash); } catch (e5) { var t4 = e5.message; return t4 || (t4 = "Multihash validation failed"), t4; } } }; e3.exports = o2; }, 72753: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = r3(29033).Buffer, s2 = r3(77748), u2 = r3(6086), c2 = r3(97223), f2 = r3(83630), d2 = r3(59976), l2 = r3(83162)(function(e4) { function t4(e5, r4, n3, o3) { if ((0, i2.default)(this, t4), l2.isCID(e5)) { var f3 = e5; return this.version = f3.version, this.codec = f3.codec, this.multihash = a2.from(f3.multihash), void (this.multibaseName = f3.multibaseName || (0 === f3.version ? "base58btc" : "base32")); } if ("string" == typeof e5) { var d3 = u2.isEncoded(e5); if (d3) { var h2 = u2.decode(e5); this.version = parseInt(h2.slice(0, 1).toString("hex"), 16), this.codec = c2.getCodec(h2.slice(1)), this.multihash = c2.rmPrefix(h2.slice(1)), this.multibaseName = d3; } else this.version = 0, this.codec = "dag-pb", this.multihash = s2.fromB58String(e5), this.multibaseName = "base58btc"; return t4.validateCID(this), void Object.defineProperty(this, "string", { value: e5 }); } if (a2.isBuffer(e5)) { var p2 = e5.slice(0, 1), b2 = parseInt(p2.toString("hex"), 16); if (1 === b2) { var y2 = e5; this.version = b2, this.codec = c2.getCodec(y2.slice(1)), this.multihash = c2.rmPrefix(y2.slice(1)), this.multibaseName = "base32"; } else this.version = 0, this.codec = "dag-pb", this.multihash = e5, this.multibaseName = "base58btc"; t4.validateCID(this); } else this.version = e5, this.codec = r4, this.multihash = n3, this.multibaseName = o3 || (0 === e5 ? "base58btc" : "base32"), t4.validateCID(this); } return (0, o2.default)(t4, [{ key: "buffer", get: function() { var e5 = this._buffer; if (!e5) { if (0 === this.version) e5 = this.multihash; else { if (1 !== this.version) throw new Error("unsupported version"); e5 = a2.concat([a2.from("01", "hex"), c2.getCodeVarint(this.codec), this.multihash]); } Object.defineProperty(this, "_buffer", { value: e5 }); } return e5; } }, { key: "prefix", get: function() { return a2.concat([a2.from("0".concat(this.version), "hex"), c2.getCodeVarint(this.codec), s2.prefix(this.multihash)]); } }, { key: "toV0", value: function() { if ("dag-pb" !== this.codec) throw new Error("Cannot convert a non dag-pb CID to CIDv0"); var e5 = s2.decode(this.multihash), t5 = e5.name, r4 = e5.length; if ("sha2-256" !== t5) throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0"); if (32 !== r4) throw new Error("Cannot convert non 32 byte multihash CID to CIDv0"); return new l2(0, this.codec, this.multihash); } }, { key: "toV1", value: function() { return new l2(1, this.codec, this.multihash); } }, { key: "toBaseEncodedString", value: function() { var e5 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.multibaseName; if (this.string && e5 === this.multibaseName) return this.string; var t5 = null; if (0 === this.version) { if ("base58btc" !== e5) throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()"); t5 = s2.toB58String(this.multihash); } else { if (1 !== this.version) throw new Error("unsupported version"); t5 = u2.encode(e5, this.buffer).toString(); } return e5 === this.multibaseName && Object.defineProperty(this, "string", { value: t5 }), t5; } }, { key: e4, value: function() { return "CID(" + this.toString() + ")"; } }, { key: "toString", value: function(e5) { return this.toBaseEncodedString(e5); } }, { key: "toJSON", value: function() { return { codec: this.codec, version: this.version, hash: this.multihash }; } }, { key: "equals", value: function(e5) { return this.codec === e5.codec && this.version === e5.version && this.multihash.equals(e5.multihash); } }], [{ key: "validateCID", value: function(e5) { var t5 = d2.checkCIDComponents(e5); if (t5) throw new Error(t5); } }]), t4; }(Symbol.for("nodejs.util.inspect.custom")), { className: "CID", symbolName: "@ipld/js-cid/CID" }); l2.codecs = f2, e3.exports = l2; }, 93013: (e3, t3, r3) => { var n2 = r3(48850).Buffer, i2 = r3(57245).Transform, o2 = r3(23462).s; function a2(e4) { i2.call(this), this.hashMode = "string" == typeof e4, this.hashMode ? this[e4] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null; } r3(41736)(a2, i2), a2.prototype.update = function(e4, t4, r4) { "string" == typeof e4 && (e4 = n2.from(e4, t4)); var i3 = this._update(e4); return this.hashMode ? this : (r4 && (i3 = this._toString(i3, r4)), i3); }, a2.prototype.setAutoPadding = function() { }, a2.prototype.getAuthTag = function() { throw new Error("trying to get auth tag in unsupported state"); }, a2.prototype.setAuthTag = function() { throw new Error("trying to set auth tag in unsupported state"); }, a2.prototype.setAAD = function() { throw new Error("trying to set aad in unsupported state"); }, a2.prototype._transform = function(e4, t4, r4) { var n3; try { this.hashMode ? this._update(e4) : this.push(this._update(e4)); } catch (e5) { n3 = e5; } finally { r4(n3); } }, a2.prototype._flush = function(e4) { var t4; try { this.push(this.__final()); } catch (e5) { t4 = e5; } e4(t4); }, a2.prototype._finalOrDigest = function(e4) { var t4 = this.__final() || n2.alloc(0); return e4 && (t4 = this._toString(t4, e4, true)), t4; }, a2.prototype._toString = function(e4, t4, r4) { if (this._decoder || (this._decoder = new o2(t4), this._encoding = t4), this._encoding !== t4) throw new Error("can't switch encodings"); var n3 = this._decoder.write(e4); return r4 && (n3 += this._decoder.end()), n3; }, e3.exports = a2; }, 83162: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(14727)), o2 = n2(r3(90775)), a2 = n2(r3(69721)), s2 = n2(r3(58985)), u2 = n2(r3(58975)), c2 = n2(r3(15163)), f2 = n2(r3(34650)), d2 = n2(r3(21949)); e3.exports = function(e4, t4) { var r4 = t4.className, n3 = t4.symbolName, i3 = Symbol.for(n3), l2 = (0, o2.default)({}, r4, function(e5, t5) { (0, c2.default)(h2, e5); var n4, o3, l3 = (n4 = h2, o3 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e6) { return false; } }(), function() { var e6, t6 = (0, d2.default)(n4); if (o3) { var r5 = (0, d2.default)(this).constructor; e6 = Reflect.construct(t6, arguments, r5); } else e6 = t6.apply(this, arguments); return (0, f2.default)(this, e6); }); function h2() { var e6; (0, a2.default)(this, h2); for (var t6 = arguments.length, r5 = new Array(t6), n5 = 0; n5 < t6; n5++) r5[n5] = arguments[n5]; return e6 = l3.call.apply(l3, [this].concat(r5)), Object.defineProperty((0, u2.default)(e6), i3, { value: true }), e6; } return (0, s2.default)(h2, [{ key: t5, get: function() { return r4; } }]), h2; }(e4, Symbol.toStringTag))[r4]; return l2["is".concat(r4)] = function(e5) { return !(!e5 || !e5[i3]); }, l2; }, e3.exports.proto = function(e4, t4) { var r4 = t4.className, n3 = t4.symbolName, a3 = t4.withoutNew, s3 = Symbol.for(n3), u3 = (0, o2.default)({}, r4, function() { for (var t5 = arguments.length, r5 = new Array(t5), n4 = 0; n4 < t5; n4++) r5[n4] = arguments[n4]; if (a3 && !(this instanceof u3)) return (0, i2.default)(u3, r5); var o3 = e4.call.apply(e4, [this].concat(r5)) || this; return o3 && !o3[s3] && Object.defineProperty(o3, s3, { value: true }), o3; })[r4]; return u3.prototype = Object.create(e4.prototype), u3.prototype.constructor = u3, Object.defineProperty(u3.prototype, Symbol.toStringTag, { get: function() { return r4; } }), u3["is".concat(r4)] = function(e5) { return !(!e5 || !e5[s3]); }, u3; }; }, 36834: (e3, t3, r3) => { var n2 = r3(72753); t3.cidV0ToV1Base32 = function(e4) { var t4 = new n2(e4); return 0 === t4.version && (t4 = t4.toV1()), t4.toString("base32"); }; }, 94308: (e3, t3, r3) => { var n2 = r3(69206), i2 = r3(39512), o2 = i2.hexStringToBuffer, a2 = i2.profiles, s2 = r3(36834).cidV0ToV1Base32; e3.exports = { helpers: { cidV0ToV1Base32: s2 }, decode: function(e4) { var t4 = o2(e4), r4 = n2.getCodec(t4), i3 = n2.rmPrefix(t4), s3 = a2[r4]; return s3 || (s3 = a2.default), s3.decode(i3); }, fromIpfs: function(e4) { return this.encode("ipfs-ns", e4); }, fromSwarm: function(e4) { return this.encode("swarm-ns", e4); }, encode: function(e4, t4) { var r4 = a2[e4]; r4 || (r4 = a2.default); var i3 = r4.encode(t4); return n2.addPrefix(e4, i3).toString("hex"); }, getCodec: function(e4) { var t4 = o2(e4); return n2.getCodec(t4); } }; }, 39512: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(72753), o2 = r3(77748), a2 = function(e4) { var t4, r4 = e4.slice(0, 2), n3 = e4.slice(2); return t4 = "0x" === r4 ? n3 : e4, o2.fromHexString(t4); }, s2 = { swarm: function(e4) { var t4 = o2.encode(a2(e4), "keccak-256"); return new i2(1, "swarm-manifest", t4).buffer; }, ipfs: function(e4) { var t4 = o2.fromB58String(e4); return new i2(1, "dag-pb", t4).buffer; }, utf8: function(e4) { return n2.from(e4, "utf8"); } }, u2 = { hexMultiHash: function(e4) { var t4 = new i2(e4); return o2.decode(t4.multihash).digest.toString("hex"); }, b58MultiHash: function(e4) { var t4 = new i2(e4); return o2.toB58String(t4.multihash); }, utf8: function(e4) { return e4.toString("utf8"); } }, c2 = { "swarm-ns": { encode: s2.swarm, decode: u2.hexMultiHash }, "ipfs-ns": { encode: s2.ipfs, decode: u2.b58MultiHash }, "ipns-ns": { encode: s2.ipfs, decode: u2.b58MultiHash }, default: { encode: s2.utf8, decode: u2.utf8 } }; t3.hexStringToBuffer = a2, t3.profiles = c2; }, 64628: (e3, t3, r3) => { var n2, i2, o2 = r3(28847)(r3(3355)); i2 = function(e4) { e4.version = "1.2.2"; var t4 = function() { for (var e5 = 0, t5 = new Array(256), r5 = 0; 256 != r5; ++r5) e5 = 1 & (e5 = 1 & (e5 = 1 & (e5 = 1 & (e5 = 1 & (e5 = 1 & (e5 = 1 & (e5 = 1 & (e5 = r5) ? -306674912 ^ e5 >>> 1 : e5 >>> 1) ? -306674912 ^ e5 >>> 1 : e5 >>> 1) ? -306674912 ^ e5 >>> 1 : e5 >>> 1) ? -306674912 ^ e5 >>> 1 : e5 >>> 1) ? -306674912 ^ e5 >>> 1 : e5 >>> 1) ? -306674912 ^ e5 >>> 1 : e5 >>> 1) ? -306674912 ^ e5 >>> 1 : e5 >>> 1) ? -306674912 ^ e5 >>> 1 : e5 >>> 1, t5[r5] = e5; return "undefined" != typeof Int32Array ? new Int32Array(t5) : t5; }(), r4 = function(e5) { var t5 = 0, r5 = 0, n4 = 0, i4 = "undefined" != typeof Int32Array ? new Int32Array(4096) : new Array(4096); for (n4 = 0; 256 != n4; ++n4) i4[n4] = e5[n4]; for (n4 = 0; 256 != n4; ++n4) for (r5 = e5[n4], t5 = 256 + n4; t5 < 4096; t5 += 256) r5 = i4[t5] = r5 >>> 8 ^ e5[255 & r5]; var o4 = []; for (n4 = 1; 16 != n4; ++n4) o4[n4 - 1] = "undefined" != typeof Int32Array ? i4.subarray(256 * n4, 256 * n4 + 256) : i4.slice(256 * n4, 256 * n4 + 256); return o4; }(t4), n3 = r4[0], i3 = r4[1], o3 = r4[2], a2 = r4[3], s2 = r4[4], u2 = r4[5], c2 = r4[6], f2 = r4[7], d2 = r4[8], l2 = r4[9], h2 = r4[10], p2 = r4[11], b2 = r4[12], y2 = r4[13], v2 = r4[14]; e4.table = t4, e4.bstr = function(e5, r5) { for (var n4 = -1 ^ r5, i4 = 0, o4 = e5.length; i4 < o4; ) n4 = n4 >>> 8 ^ t4[255 & (n4 ^ e5.charCodeAt(i4++))]; return ~n4; }, e4.buf = function(e5, r5) { for (var m2 = -1 ^ r5, g2 = e5.length - 15, w2 = 0; w2 < g2; ) m2 = v2[e5[w2++] ^ 255 & m2] ^ y2[e5[w2++] ^ m2 >> 8 & 255] ^ b2[e5[w2++] ^ m2 >> 16 & 255] ^ p2[e5[w2++] ^ m2 >>> 24] ^ h2[e5[w2++]] ^ l2[e5[w2++]] ^ d2[e5[w2++]] ^ f2[e5[w2++]] ^ c2[e5[w2++]] ^ u2[e5[w2++]] ^ s2[e5[w2++]] ^ a2[e5[w2++]] ^ o3[e5[w2++]] ^ i3[e5[w2++]] ^ n3[e5[w2++]] ^ t4[e5[w2++]]; for (g2 += 15; w2 < g2; ) m2 = m2 >>> 8 ^ t4[255 & (m2 ^ e5[w2++])]; return ~m2; }, e4.str = function(e5, r5) { for (var n4 = -1 ^ r5, i4 = 0, o4 = e5.length, a3 = 0, s3 = 0; i4 < o4; ) (a3 = e5.charCodeAt(i4++)) < 128 ? n4 = n4 >>> 8 ^ t4[255 & (n4 ^ a3)] : a3 < 2048 ? n4 = (n4 = n4 >>> 8 ^ t4[255 & (n4 ^ (192 | a3 >> 6 & 31))]) >>> 8 ^ t4[255 & (n4 ^ (128 | 63 & a3))] : a3 >= 55296 && a3 < 57344 ? (a3 = 64 + (1023 & a3), s3 = 1023 & e5.charCodeAt(i4++), n4 = (n4 = (n4 = (n4 = n4 >>> 8 ^ t4[255 & (n4 ^ (240 | a3 >> 8 & 7))]) >>> 8 ^ t4[255 & (n4 ^ (128 | a3 >> 2 & 63))]) >>> 8 ^ t4[255 & (n4 ^ (128 | s3 >> 6 & 15 | (3 & a3) << 4))]) >>> 8 ^ t4[255 & (n4 ^ (128 | 63 & s3))]) : n4 = (n4 = (n4 = n4 >>> 8 ^ t4[255 & (n4 ^ (224 | a3 >> 12 & 15))]) >>> 8 ^ t4[255 & (n4 ^ (128 | a3 >> 6 & 63))]) >>> 8 ^ t4[255 & (n4 ^ (128 | 63 & a3))]; return ~n4; }; }, "undefined" == typeof DO_NOT_EXPORT_CRC ? "object" === (0, o2.default)(t3) ? i2(t3) : (n2 = (function() { var e4 = {}; return i2(e4), e4; }).call(t3, r3, t3, e3), void 0 === n2 || (e3.exports = n2)) : i2({}); }, 75102: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(36597), o2 = r3(31734); e3.exports = function(e4) { return new s2(e4); }; var a2 = { secp256k1: { name: "secp256k1", byteLength: 32 }, secp224r1: { name: "p224", byteLength: 28 }, prime256v1: { name: "p256", byteLength: 32 }, prime192v1: { name: "p192", byteLength: 24 }, ed25519: { name: "ed25519", byteLength: 32 }, secp384r1: { name: "p384", byteLength: 48 }, secp521r1: { name: "p521", byteLength: 66 } }; function s2(e4) { this.curveType = a2[e4], this.curveType || (this.curveType = { name: e4 }), this.curve = new i2.ec(this.curveType.name), this.keys = void 0; } function u2(e4, t4, r4) { Array.isArray(e4) || (e4 = e4.toArray()); var i3 = new n2(e4); if (r4 && i3.length < r4) { var o3 = new n2(r4 - i3.length); o3.fill(0), i3 = n2.concat([o3, i3]); } return t4 ? i3.toString(t4) : i3; } a2.p224 = a2.secp224r1, a2.p256 = a2.secp256r1 = a2.prime256v1, a2.p192 = a2.secp192r1 = a2.prime192v1, a2.p384 = a2.secp384r1, a2.p521 = a2.secp521r1, s2.prototype.generateKeys = function(e4, t4) { return this.keys = this.curve.genKeyPair(), this.getPublicKey(e4, t4); }, s2.prototype.computeSecret = function(e4, t4, r4) { return t4 = t4 || "utf8", n2.isBuffer(e4) || (e4 = new n2(e4, t4)), u2(this.curve.keyFromPublic(e4).getPublic().mul(this.keys.getPrivate()).getX(), r4, this.curveType.byteLength); }, s2.prototype.getPublicKey = function(e4, t4) { var r4 = this.keys.getPublic("compressed" === t4, true); return "hybrid" === t4 && (r4[r4.length - 1] % 2 ? r4[0] = 7 : r4[0] = 6), u2(r4, e4); }, s2.prototype.getPrivateKey = function(e4) { return u2(this.keys.getPrivate(), e4); }, s2.prototype.setPublicKey = function(e4, t4) { return t4 = t4 || "utf8", n2.isBuffer(e4) || (e4 = new n2(e4, t4)), this.keys._importPublic(e4), this; }, s2.prototype.setPrivateKey = function(e4, t4) { t4 = t4 || "utf8", n2.isBuffer(e4) || (e4 = new n2(e4, t4)); var r4 = new o2(e4); return r4 = r4.toString(16), this.keys = this.curve.genKeyPair(), this.keys._importPrivate(r4), this; }; }, 35866: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(50807), o2 = r3(26707), a2 = r3(51708), s2 = r3(93013); function u2(e4) { s2.call(this, "digest"), this._hash = e4; } n2(u2, s2), u2.prototype._update = function(e4) { this._hash.update(e4); }, u2.prototype._final = function() { return this._hash.digest(); }, e3.exports = function(e4) { return "md5" === (e4 = e4.toLowerCase()) ? new i2() : "rmd160" === e4 || "ripemd160" === e4 ? new o2() : new u2(a2(e4)); }; }, 55349: (e3, t3, r3) => { var n2 = r3(50807); e3.exports = function(e4) { return new n2().update(e4).digest(); }; }, 34424: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(19956), o2 = r3(93013), a2 = r3(48850).Buffer, s2 = r3(55349), u2 = r3(26707), c2 = r3(51708), f2 = a2.alloc(128); function d2(e4, t4) { o2.call(this, "digest"), "string" == typeof t4 && (t4 = a2.from(t4)); var r4 = "sha512" === e4 || "sha384" === e4 ? 128 : 64; this._alg = e4, this._key = t4, t4.length > r4 ? t4 = ("rmd160" === e4 ? new u2() : c2(e4)).update(t4).digest() : t4.length < r4 && (t4 = a2.concat([t4, f2], r4)); for (var n3 = this._ipad = a2.allocUnsafe(r4), i3 = this._opad = a2.allocUnsafe(r4), s3 = 0; s3 < r4; s3++) n3[s3] = 54 ^ t4[s3], i3[s3] = 92 ^ t4[s3]; this._hash = "rmd160" === e4 ? new u2() : c2(e4), this._hash.update(n3); } n2(d2, o2), d2.prototype._update = function(e4) { this._hash.update(e4); }, d2.prototype._final = function() { var e4 = this._hash.digest(); return ("rmd160" === this._alg ? new u2() : c2(this._alg)).update(this._opad).update(e4).digest(); }, e3.exports = function(e4, t4) { return "rmd160" === (e4 = e4.toLowerCase()) || "ripemd160" === e4 ? new d2("rmd160", t4) : "md5" === e4 ? new i2(s2, t4) : new d2(e4, t4); }; }, 19956: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(48850).Buffer, o2 = r3(93013), a2 = i2.alloc(128), s2 = 64; function u2(e4, t4) { o2.call(this, "digest"), "string" == typeof t4 && (t4 = i2.from(t4)), this._alg = e4, this._key = t4, t4.length > s2 ? t4 = e4(t4) : t4.length < s2 && (t4 = i2.concat([t4, a2], s2)); for (var r4 = this._ipad = i2.allocUnsafe(s2), n3 = this._opad = i2.allocUnsafe(s2), u3 = 0; u3 < s2; u3++) r4[u3] = 54 ^ t4[u3], n3[u3] = 92 ^ t4[u3]; this._hash = [r4]; } n2(u2, o2), u2.prototype._update = function(e4) { this._hash.push(e4); }, u2.prototype._final = function() { var e4 = this._alg(i2.concat(this._hash)); return this._alg(i2.concat([this._opad, e4])); }, e3.exports = u2; }, 33768: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = "undefined" != typeof globalThis && globalThis || "undefined" != typeof self && self || void 0 !== r3.g && r3.g, o2 = function() { function e4() { this.fetch = false, this.DOMException = i2.DOMException; } return e4.prototype = i2, new e4(); }(); !function(e4) { !function(t4) { var r4 = void 0 !== e4 && e4 || "undefined" != typeof self && self || void 0 !== r4 && r4, i3 = { searchParams: "URLSearchParams" in r4, iterable: "Symbol" in r4 && "iterator" in Symbol, blob: "FileReader" in r4 && "Blob" in r4 && function() { try { return new Blob(), true; } catch (e5) { return false; } }(), formData: "FormData" in r4, arrayBuffer: "ArrayBuffer" in r4 }; if (i3.arrayBuffer) var o3 = ["[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]"], a3 = ArrayBuffer.isView || function(e5) { return e5 && o3.indexOf(Object.prototype.toString.call(e5)) > -1; }; function s2(e5) { if ("string" != typeof e5 && (e5 = String(e5)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e5) || "" === e5) throw new TypeError('Invalid character in header field name: "' + e5 + '"'); return e5.toLowerCase(); } function u2(e5) { return "string" != typeof e5 && (e5 = String(e5)), e5; } function c2(e5) { var t5 = { next: function() { var t6 = e5.shift(); return { done: void 0 === t6, value: t6 }; } }; return i3.iterable && (t5[Symbol.iterator] = function() { return t5; }), t5; } function f2(e5) { this.map = {}, e5 instanceof f2 ? e5.forEach(function(e6, t5) { this.append(t5, e6); }, this) : Array.isArray(e5) ? e5.forEach(function(e6) { this.append(e6[0], e6[1]); }, this) : e5 && Object.getOwnPropertyNames(e5).forEach(function(t5) { this.append(t5, e5[t5]); }, this); } function d2(e5) { if (e5.bodyUsed) return Promise.reject(new TypeError("Already read")); e5.bodyUsed = true; } function l2(e5) { return new Promise(function(t5, r5) { e5.onload = function() { t5(e5.result); }, e5.onerror = function() { r5(e5.error); }; }); } function h2(e5) { var t5 = new FileReader(), r5 = l2(t5); return t5.readAsArrayBuffer(e5), r5; } function p2(e5) { if (e5.slice) return e5.slice(0); var t5 = new Uint8Array(e5.byteLength); return t5.set(new Uint8Array(e5)), t5.buffer; } function b2() { return this.bodyUsed = false, this._initBody = function(e5) { var t5; this.bodyUsed = this.bodyUsed, this._bodyInit = e5, e5 ? "string" == typeof e5 ? this._bodyText = e5 : i3.blob && Blob.prototype.isPrototypeOf(e5) ? this._bodyBlob = e5 : i3.formData && FormData.prototype.isPrototypeOf(e5) ? this._bodyFormData = e5 : i3.searchParams && URLSearchParams.prototype.isPrototypeOf(e5) ? this._bodyText = e5.toString() : i3.arrayBuffer && i3.blob && (t5 = e5) && DataView.prototype.isPrototypeOf(t5) ? (this._bodyArrayBuffer = p2(e5.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : i3.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(e5) || a3(e5)) ? this._bodyArrayBuffer = p2(e5) : this._bodyText = e5 = Object.prototype.toString.call(e5) : this._bodyText = "", this.headers.get("content-type") || ("string" == typeof e5 ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : i3.searchParams && URLSearchParams.prototype.isPrototypeOf(e5) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8")); }, i3.blob && (this.blob = function() { var e5 = d2(this); if (e5) return e5; 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 ? d2(this) || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength)) : Promise.resolve(this._bodyArrayBuffer)) : this.blob().then(h2); }), this.text = function() { var e5, t5, r5, n3 = d2(this); if (n3) return n3; if (this._bodyBlob) return e5 = this._bodyBlob, r5 = l2(t5 = new FileReader()), t5.readAsText(e5), r5; if (this._bodyArrayBuffer) return Promise.resolve(function(e6) { for (var t6 = new Uint8Array(e6), r6 = new Array(t6.length), n4 = 0; n4 < t6.length; n4++) r6[n4] = String.fromCharCode(t6[n4]); return r6.join(""); }(this._bodyArrayBuffer)); if (this._bodyFormData) throw new Error("could not read FormData body as text"); return Promise.resolve(this._bodyText); }, i3.formData && (this.formData = function() { return this.text().then(m2); }), this.json = function() { return this.text().then(JSON.parse); }, this; } f2.prototype.append = function(e5, t5) { e5 = s2(e5), t5 = u2(t5); var r5 = this.map[e5]; this.map[e5] = r5 ? r5 + ", " + t5 : t5; }, f2.prototype.delete = function(e5) { delete this.map[s2(e5)]; }, f2.prototype.get = function(e5) { return e5 = s2(e5), this.has(e5) ? this.map[e5] : null; }, f2.prototype.has = function(e5) { return this.map.hasOwnProperty(s2(e5)); }, f2.prototype.set = function(e5, t5) { this.map[s2(e5)] = u2(t5); }, f2.prototype.forEach = function(e5, t5) { for (var r5 in this.map) this.map.hasOwnProperty(r5) && e5.call(t5, this.map[r5], r5, this); }, f2.prototype.keys = function() { var e5 = []; return this.forEach(function(t5, r5) { e5.push(r5); }), c2(e5); }, f2.prototype.values = function() { var e5 = []; return this.forEach(function(t5) { e5.push(t5); }), c2(e5); }, f2.prototype.entries = function() { var e5 = []; return this.forEach(function(t5, r5) { e5.push([r5, t5]); }), c2(e5); }, i3.iterable && (f2.prototype[Symbol.iterator] = f2.prototype.entries); var y2 = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"]; function v2(e5, t5) { if (!(this instanceof v2)) throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); var r5, n3, i4 = (t5 = t5 || {}).body; if (e5 instanceof v2) { if (e5.bodyUsed) throw new TypeError("Already read"); this.url = e5.url, this.credentials = e5.credentials, t5.headers || (this.headers = new f2(e5.headers)), this.method = e5.method, this.mode = e5.mode, this.signal = e5.signal, i4 || null == e5._bodyInit || (i4 = e5._bodyInit, e5.bodyUsed = true); } else this.url = String(e5); if (this.credentials = t5.credentials || this.credentials || "same-origin", !t5.headers && this.headers || (this.headers = new f2(t5.headers)), this.method = (n3 = (r5 = t5.method || this.method || "GET").toUpperCase(), y2.indexOf(n3) > -1 ? n3 : r5), this.mode = t5.mode || this.mode || null, this.signal = t5.signal || this.signal, this.referrer = null, ("GET" === this.method || "HEAD" === this.method) && i4) throw new TypeError("Body not allowed for GET or HEAD requests"); if (this._initBody(i4), !("GET" !== this.method && "HEAD" !== this.method || "no-store" !== t5.cache && "no-cache" !== t5.cache)) { var o4 = /([?&])_=[^&]*/; o4.test(this.url) ? this.url = this.url.replace(o4, "$1_=" + (/* @__PURE__ */ new Date()).getTime()) : this.url += (/\?/.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime(); } } function m2(e5) { var t5 = new FormData(); return e5.trim().split("&").forEach(function(e6) { if (e6) { var r5 = e6.split("="), n3 = r5.shift().replace(/\+/g, " "), i4 = r5.join("=").replace(/\+/g, " "); t5.append(decodeURIComponent(n3), decodeURIComponent(i4)); } }), t5; } function g2(e5, t5) { if (!(this instanceof g2)) throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); t5 || (t5 = {}), this.type = "default", this.status = void 0 === t5.status ? 200 : t5.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = void 0 === t5.statusText ? "" : "" + t5.statusText, this.headers = new f2(t5.headers), this.url = t5.url || "", this._initBody(e5); } v2.prototype.clone = function() { return new v2(this, { body: this._bodyInit }); }, b2.call(v2.prototype), b2.call(g2.prototype), g2.prototype.clone = function() { return new g2(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new f2(this.headers), url: this.url }); }, g2.error = function() { var e5 = new g2(null, { status: 0, statusText: "" }); return e5.type = "error", e5; }; var w2 = [301, 302, 303, 307, 308]; g2.redirect = function(e5, t5) { if (-1 === w2.indexOf(t5)) throw new RangeError("Invalid status code"); return new g2(null, { status: t5, headers: { location: e5 } }); }, t4.DOMException = r4.DOMException; try { new t4.DOMException(); } catch (e5) { t4.DOMException = function(e6, t5) { this.message = e6, this.name = t5; var r5 = Error(e6); this.stack = r5.stack; }, t4.DOMException.prototype = Object.create(Error.prototype), t4.DOMException.prototype.constructor = t4.DOMException; } function k2(e5, o4) { return new Promise(function(a4, s3) { var c3 = new v2(e5, o4); if (c3.signal && c3.signal.aborted) return s3(new t4.DOMException("Aborted", "AbortError")); var d3 = new XMLHttpRequest(); function l3() { d3.abort(); } d3.onload = function() { var e6, t5, r5 = { status: d3.status, statusText: d3.statusText, headers: (e6 = d3.getAllResponseHeaders() || "", t5 = new f2(), e6.replace(/\r?\n[\t ]+/g, " ").split("\r").map(function(e7) { return 0 === e7.indexOf("\n") ? e7.substr(1, e7.length) : e7; }).forEach(function(e7) { var r6 = e7.split(":"), n4 = r6.shift().trim(); if (n4) { var i4 = r6.join(":").trim(); t5.append(n4, i4); } }), t5) }; r5.url = "responseURL" in d3 ? d3.responseURL : r5.headers.get("X-Request-URL"); var n3 = "response" in d3 ? d3.response : d3.responseText; setTimeout(function() { a4(new g2(n3, r5)); }, 0); }, d3.onerror = function() { setTimeout(function() { s3(new TypeError("Network request failed")); }, 0); }, d3.ontimeout = function() { setTimeout(function() { s3(new TypeError("Network request failed")); }, 0); }, d3.onabort = function() { setTimeout(function() { s3(new t4.DOMException("Aborted", "AbortError")); }, 0); }, d3.open(c3.method, function(e6) { try { return "" === e6 && r4.location.href ? r4.location.href : e6; } catch (t5) { return e6; } }(c3.url), true), "include" === c3.credentials ? d3.withCredentials = true : "omit" === c3.credentials && (d3.withCredentials = false), "responseType" in d3 && (i3.blob ? d3.responseType = "blob" : i3.arrayBuffer && c3.headers.get("Content-Type") && -1 !== c3.headers.get("Content-Type").indexOf("application/octet-stream") && (d3.responseType = "arraybuffer")), !o4 || "object" !== (0, n2.default)(o4.headers) || o4.headers instanceof f2 ? c3.headers.forEach(function(e6, t5) { d3.setRequestHeader(t5, e6); }) : Object.getOwnPropertyNames(o4.headers).forEach(function(e6) { d3.setRequestHeader(e6, u2(o4.headers[e6])); }), c3.signal && (c3.signal.addEventListener("abort", l3), d3.onreadystatechange = function() { 4 === d3.readyState && c3.signal.removeEventListener("abort", l3); }), d3.send(void 0 === c3._bodyInit ? null : c3._bodyInit); }); } k2.polyfill = true, r4.fetch || (r4.fetch = k2, r4.Headers = f2, r4.Request = v2, r4.Response = g2), t4.Headers = f2, t4.Request = v2, t4.Response = g2, t4.fetch = k2; }({}); }(o2), o2.fetch.ponyfill = true, delete o2.fetch.polyfill; var a2 = i2.fetch ? i2 : o2; (t3 = a2.fetch).default = a2.fetch, t3.fetch = a2.fetch, t3.Headers = a2.Headers, t3.Request = a2.Request, t3.Response = a2.Response, e3.exports = t3; }, 24293: (e3, t3, r3) => { t3.randomBytes = t3.rng = t3.pseudoRandomBytes = t3.prng = r3(75010), t3.createHash = t3.Hash = r3(35866), t3.createHmac = t3.Hmac = r3(34424); var n2 = r3(26561), i2 = Object.keys(n2), o2 = ["sha1", "sha224", "sha256", "sha384", "sha512", "md5", "rmd160"].concat(i2); t3.getHashes = function() { return o2; }; var a2 = r3(54192); t3.pbkdf2 = a2.pbkdf2, t3.pbkdf2Sync = a2.pbkdf2Sync; var s2 = r3(56805); t3.Cipher = s2.Cipher, t3.createCipher = s2.createCipher, t3.Cipheriv = s2.Cipheriv, t3.createCipheriv = s2.createCipheriv, t3.Decipher = s2.Decipher, t3.createDecipher = s2.createDecipher, t3.Decipheriv = s2.Decipheriv, t3.createDecipheriv = s2.createDecipheriv, t3.getCiphers = s2.getCiphers, t3.listCiphers = s2.listCiphers; var u2 = r3(28333); t3.DiffieHellmanGroup = u2.DiffieHellmanGroup, t3.createDiffieHellmanGroup = u2.createDiffieHellmanGroup, t3.getDiffieHellman = u2.getDiffieHellman, t3.createDiffieHellman = u2.createDiffieHellman, t3.DiffieHellman = u2.DiffieHellman; var c2 = r3(79527); t3.createSign = c2.createSign, t3.Sign = c2.Sign, t3.createVerify = c2.createVerify, t3.Verify = c2.Verify, t3.createECDH = r3(75102); var f2 = r3(86991); t3.publicEncrypt = f2.publicEncrypt, t3.privateEncrypt = f2.privateEncrypt, t3.publicDecrypt = f2.publicDecrypt, t3.privateDecrypt = f2.privateDecrypt; var d2 = r3(36509); t3.randomFill = d2.randomFill, t3.randomFillSync = d2.randomFillSync, t3.createCredentials = function() { throw new Error(["sorry, createCredentials is not implemented yet", "we accept pull requests", "https://github.com/crypto-browserify/crypto-browserify"].join("\n")); }, t3.constants = { DH_CHECK_P_NOT_SAFE_PRIME: 2, DH_CHECK_P_NOT_PRIME: 1, DH_UNABLE_TO_CHECK_GENERATOR: 4, DH_NOT_SUITABLE_GENERATOR: 8, NPN_ENABLED: 1, ALPN_ENABLED: 1, RSA_PKCS1_PADDING: 1, RSA_SSLV23_PADDING: 2, RSA_NO_PADDING: 3, RSA_PKCS1_OAEP_PADDING: 4, RSA_X931_PADDING: 5, RSA_PKCS1_PSS_PADDING: 6, POINT_CONVERSION_COMPRESSED: 2, POINT_CONVERSION_UNCOMPRESSED: 4, POINT_CONVERSION_HYBRID: 6 }; }, 80034: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = "%[a-f0-9]{2}", o2 = new RegExp("(" + i2 + ")|([^%]+?)", "gi"), a2 = new RegExp("(" + i2 + ")+", "gi"); function s2(e4, t4) { try { return [decodeURIComponent(e4.join(""))]; } catch (e5) { } if (1 === e4.length) return e4; t4 = t4 || 1; var r4 = e4.slice(0, t4), n3 = e4.slice(t4); return Array.prototype.concat.call([], s2(r4), s2(n3)); } function u2(e4) { try { return decodeURIComponent(e4); } catch (n3) { for (var t4 = e4.match(o2) || [], r4 = 1; r4 < t4.length; r4++) t4 = (e4 = s2(t4, r4).join("")).match(o2) || []; return e4; } } e3.exports = function(e4) { if ("string" != typeof e4) throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + (0, n2.default)(e4) + "`"); try { return e4 = e4.replace(/\+/g, " "), decodeURIComponent(e4); } catch (t4) { return function(e5) { for (var t5 = { "%FE%FF": "��", "%FF%FE": "��" }, r4 = a2.exec(e5); r4; ) { try { t5[r4[0]] = decodeURIComponent(r4[0]); } catch (e6) { var n3 = u2(r4[0]); n3 !== r4[0] && (t5[r4[0]] = n3); } r4 = a2.exec(e5); } t5["%C2"] = "�"; for (var i3 = Object.keys(t5), o3 = 0; o3 < i3.length; o3++) { var s3 = i3[o3]; e5 = e5.replace(new RegExp(s3, "g"), t5[s3]); } return e5; }(e4); } }; }, 94919: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(1020)(), o2 = r3(57701), a2 = i2 && o2("%Object.defineProperty%", true); if (a2) try { a2({}, "a", { value: 1 }); } catch (e4) { a2 = false; } var s2 = o2("%SyntaxError%"), u2 = o2("%TypeError%"), c2 = r3(53820); e3.exports = function(e4, t4, r4) { if (!e4 || "object" !== (0, n2.default)(e4) && "function" != typeof e4) throw new u2("`obj` must be an object or a function`"); if ("string" != typeof t4 && "symbol" !== (0, n2.default)(t4)) throw new u2("`property` must be a string or a symbol`"); if (arguments.length > 3 && "boolean" != typeof arguments[3] && null !== arguments[3]) throw new u2("`nonEnumerable`, if provided, must be a boolean or null"); if (arguments.length > 4 && "boolean" != typeof arguments[4] && null !== arguments[4]) throw new u2("`nonWritable`, if provided, must be a boolean or null"); if (arguments.length > 5 && "boolean" != typeof arguments[5] && null !== arguments[5]) throw new u2("`nonConfigurable`, if provided, must be a boolean or null"); if (arguments.length > 6 && "boolean" != typeof arguments[6]) throw new u2("`loose`, if provided, must be a boolean"); var i3 = arguments.length > 3 ? arguments[3] : null, o3 = arguments.length > 4 ? arguments[4] : null, f2 = arguments.length > 5 ? arguments[5] : null, d2 = arguments.length > 6 && arguments[6], l2 = !!c2 && c2(e4, t4); if (a2) a2(e4, t4, { configurable: null === f2 && l2 ? l2.configurable : !f2, enumerable: null === i3 && l2 ? l2.enumerable : !i3, value: r4, writable: null === o3 && l2 ? l2.writable : !o3 }); else { if (!d2 && (i3 || o3 || f2)) throw new s2("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); e4[t4] = r4; } }; }, 75626: (e3, t3, r3) => { t3.utils = r3(43349), t3.Cipher = r3(19591), t3.DES = r3(63049), t3.CBC = r3(4375), t3.EDE = r3(9413); }, 4375: (e3, t3, r3) => { var n2 = r3(94504), i2 = r3(41736), o2 = {}; function a2(e4) { n2.equal(e4.length, 8, "Invalid IV length"), this.iv = new Array(8); for (var t4 = 0; t4 < this.iv.length; t4++) this.iv[t4] = e4[t4]; } t3.instantiate = function(e4) { function t4(t5) { e4.call(this, t5), this._cbcInit(); } i2(t4, e4); for (var r4 = Object.keys(o2), n3 = 0; n3 < r4.length; n3++) { var a3 = r4[n3]; t4.prototype[a3] = o2[a3]; } return t4.create = function(e5) { return new t4(e5); }, t4; }, o2._cbcInit = function() { var e4 = new a2(this.options.iv); this._cbcState = e4; }, o2._update = function(e4, t4, r4, n3) { var i3 = this._cbcState, o3 = this.constructor.super_.prototype, a3 = i3.iv; if ("encrypt" === this.type) { for (var s2 = 0; s2 < this.blockSize; s2++) a3[s2] ^= e4[t4 + s2]; for (o3._update.call(this, a3, 0, r4, n3), s2 = 0; s2 < this.blockSize; s2++) a3[s2] = r4[n3 + s2]; } else { for (o3._update.call(this, e4, t4, r4, n3), s2 = 0; s2 < this.blockSize; s2++) r4[n3 + s2] ^= a3[s2]; for (s2 = 0; s2 < this.blockSize; s2++) a3[s2] = e4[t4 + s2]; } }; }, 19591: (e3, t3, r3) => { var n2 = r3(94504); function i2(e4) { this.options = e4, this.type = this.options.type, this.blockSize = 8, this._init(), this.buffer = new Array(this.blockSize), this.bufferOff = 0; } e3.exports = i2, i2.prototype._init = function() { }, i2.prototype.update = function(e4) { return 0 === e4.length ? [] : "decrypt" === this.type ? this._updateDecrypt(e4) : this._updateEncrypt(e4); }, i2.prototype._buffer = function(e4, t4) { for (var r4 = Math.min(this.buffer.length - this.bufferOff, e4.length - t4), n3 = 0; n3 < r4; n3++) this.buffer[this.bufferOff + n3] = e4[t4 + n3]; return this.bufferOff += r4, r4; }, i2.prototype._flushBuffer = function(e4, t4) { return this._update(this.buffer, 0, e4, t4), this.bufferOff = 0, this.blockSize; }, i2.prototype._updateEncrypt = function(e4) { var t4 = 0, r4 = 0, n3 = (this.bufferOff + e4.length) / this.blockSize | 0, i3 = new Array(n3 * this.blockSize); 0 !== this.bufferOff && (t4 += this._buffer(e4, t4), this.bufferOff === this.buffer.length && (r4 += this._flushBuffer(i3, r4))); for (var o2 = e4.length - (e4.length - t4) % this.blockSize; t4 < o2; t4 += this.blockSize) this._update(e4, t4, i3, r4), r4 += this.blockSize; for (; t4 < e4.length; t4++, this.bufferOff++) this.buffer[this.bufferOff] = e4[t4]; return i3; }, i2.prototype._updateDecrypt = function(e4) { for (var t4 = 0, r4 = 0, n3 = Math.ceil((this.bufferOff + e4.length) / this.blockSize) - 1, i3 = new Array(n3 * this.blockSize); n3 > 0; n3--) t4 += this._buffer(e4, t4), r4 += this._flushBuffer(i3, r4); return t4 += this._buffer(e4, t4), i3; }, i2.prototype.final = function(e4) { var t4, r4; return e4 && (t4 = this.update(e4)), r4 = "encrypt" === this.type ? this._finalEncrypt() : this._finalDecrypt(), t4 ? t4.concat(r4) : r4; }, i2.prototype._pad = function(e4, t4) { if (0 === t4) return false; for (; t4 < e4.length; ) e4[t4++] = 0; return true; }, i2.prototype._finalEncrypt = function() { if (!this._pad(this.buffer, this.bufferOff)) return []; var e4 = new Array(this.blockSize); return this._update(this.buffer, 0, e4, 0), e4; }, i2.prototype._unpad = function(e4) { return e4; }, i2.prototype._finalDecrypt = function() { n2.equal(this.bufferOff, this.blockSize, "Not enough data to decrypt"); var e4 = new Array(this.blockSize); return this._flushBuffer(e4, 0), this._unpad(e4); }; }, 63049: (e3, t3, r3) => { var n2 = r3(94504), i2 = r3(41736), o2 = r3(43349), a2 = r3(19591); function s2() { this.tmp = new Array(2), this.keys = null; } function u2(e4) { a2.call(this, e4); var t4 = new s2(); this._desState = t4, this.deriveKeys(t4, e4.key); } i2(u2, a2), e3.exports = u2, u2.create = function(e4) { return new u2(e4); }; var c2 = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1]; u2.prototype.deriveKeys = function(e4, t4) { e4.keys = new Array(32), n2.equal(t4.length, this.blockSize, "Invalid key length"); var r4 = o2.readUInt32BE(t4, 0), i3 = o2.readUInt32BE(t4, 4); o2.pc1(r4, i3, e4.tmp, 0), r4 = e4.tmp[0], i3 = e4.tmp[1]; for (var a3 = 0; a3 < e4.keys.length; a3 += 2) { var s3 = c2[a3 >>> 1]; r4 = o2.r28shl(r4, s3), i3 = o2.r28shl(i3, s3), o2.pc2(r4, i3, e4.keys, a3); } }, u2.prototype._update = function(e4, t4, r4, n3) { var i3 = this._desState, a3 = o2.readUInt32BE(e4, t4), s3 = o2.readUInt32BE(e4, t4 + 4); o2.ip(a3, s3, i3.tmp, 0), a3 = i3.tmp[0], s3 = i3.tmp[1], "encrypt" === this.type ? this._encrypt(i3, a3, s3, i3.tmp, 0) : this._decrypt(i3, a3, s3, i3.tmp, 0), a3 = i3.tmp[0], s3 = i3.tmp[1], o2.writeUInt32BE(r4, a3, n3), o2.writeUInt32BE(r4, s3, n3 + 4); }, u2.prototype._pad = function(e4, t4) { for (var r4 = e4.length - t4, n3 = t4; n3 < e4.length; n3++) e4[n3] = r4; return true; }, u2.prototype._unpad = function(e4) { for (var t4 = e4[e4.length - 1], r4 = e4.length - t4; r4 < e4.length; r4++) n2.equal(e4[r4], t4); return e4.slice(0, e4.length - t4); }, u2.prototype._encrypt = function(e4, t4, r4, n3, i3) { for (var a3 = t4, s3 = r4, u3 = 0; u3 < e4.keys.length; u3 += 2) { var c3 = e4.keys[u3], f2 = e4.keys[u3 + 1]; o2.expand(s3, e4.tmp, 0), c3 ^= e4.tmp[0], f2 ^= e4.tmp[1]; var d2 = o2.substitute(c3, f2), l2 = s3; s3 = (a3 ^ o2.permute(d2)) >>> 0, a3 = l2; } o2.rip(s3, a3, n3, i3); }, u2.prototype._decrypt = function(e4, t4, r4, n3, i3) { for (var a3 = r4, s3 = t4, u3 = e4.keys.length - 2; u3 >= 0; u3 -= 2) { var c3 = e4.keys[u3], f2 = e4.keys[u3 + 1]; o2.expand(a3, e4.tmp, 0), c3 ^= e4.tmp[0], f2 ^= e4.tmp[1]; var d2 = o2.substitute(c3, f2), l2 = a3; a3 = (s3 ^ o2.permute(d2)) >>> 0, s3 = l2; } o2.rip(a3, s3, n3, i3); }; }, 9413: (e3, t3, r3) => { var n2 = r3(94504), i2 = r3(41736), o2 = r3(19591), a2 = r3(63049); function s2(e4, t4) { n2.equal(t4.length, 24, "Invalid key length"); var r4 = t4.slice(0, 8), i3 = t4.slice(8, 16), o3 = t4.slice(16, 24); this.ciphers = "encrypt" === e4 ? [a2.create({ type: "encrypt", key: r4 }), a2.create({ type: "decrypt", key: i3 }), a2.create({ type: "encrypt", key: o3 })] : [a2.create({ type: "decrypt", key: o3 }), a2.create({ type: "encrypt", key: i3 }), a2.create({ type: "decrypt", key: r4 })]; } function u2(e4) { o2.call(this, e4); var t4 = new s2(this.type, this.options.key); this._edeState = t4; } i2(u2, o2), e3.exports = u2, u2.create = function(e4) { return new u2(e4); }, u2.prototype._update = function(e4, t4, r4, n3) { var i3 = this._edeState; i3.ciphers[0]._update(e4, t4, r4, n3), i3.ciphers[1]._update(r4, n3, r4, n3), i3.ciphers[2]._update(r4, n3, r4, n3); }, u2.prototype._pad = a2.prototype._pad, u2.prototype._unpad = a2.prototype._unpad; }, 43349: (e3, t3) => { t3.readUInt32BE = function(e4, t4) { return (e4[0 + t4] << 24 | e4[1 + t4] << 16 | e4[2 + t4] << 8 | e4[3 + t4]) >>> 0; }, t3.writeUInt32BE = function(e4, t4, r4) { e4[0 + r4] = t4 >>> 24, e4[1 + r4] = t4 >>> 16 & 255, e4[2 + r4] = t4 >>> 8 & 255, e4[3 + r4] = 255 & t4; }, t3.ip = function(e4, t4, r4, n3) { for (var i3 = 0, o2 = 0, a2 = 6; a2 >= 0; a2 -= 2) { for (var s2 = 0; s2 <= 24; s2 += 8) i3 <<= 1, i3 |= t4 >>> s2 + a2 & 1; for (s2 = 0; s2 <= 24; s2 += 8) i3 <<= 1, i3 |= e4 >>> s2 + a2 & 1; } for (a2 = 6; a2 >= 0; a2 -= 2) { for (s2 = 1; s2 <= 25; s2 += 8) o2 <<= 1, o2 |= t4 >>> s2 + a2 & 1; for (s2 = 1; s2 <= 25; s2 += 8) o2 <<= 1, o2 |= e4 >>> s2 + a2 & 1; } r4[n3 + 0] = i3 >>> 0, r4[n3 + 1] = o2 >>> 0; }, t3.rip = function(e4, t4, r4, n3) { for (var i3 = 0, o2 = 0, a2 = 0; a2 < 4; a2++) for (var s2 = 24; s2 >= 0; s2 -= 8) i3 <<= 1, i3 |= t4 >>> s2 + a2 & 1, i3 <<= 1, i3 |= e4 >>> s2 + a2 & 1; for (a2 = 4; a2 < 8; a2++) for (s2 = 24; s2 >= 0; s2 -= 8) o2 <<= 1, o2 |= t4 >>> s2 + a2 & 1, o2 <<= 1, o2 |= e4 >>> s2 + a2 & 1; r4[n3 + 0] = i3 >>> 0, r4[n3 + 1] = o2 >>> 0; }, t3.pc1 = function(e4, t4, r4, n3) { for (var i3 = 0, o2 = 0, a2 = 7; a2 >= 5; a2--) { for (var s2 = 0; s2 <= 24; s2 += 8) i3 <<= 1, i3 |= t4 >> s2 + a2 & 1; for (s2 = 0; s2 <= 24; s2 += 8) i3 <<= 1, i3 |= e4 >> s2 + a2 & 1; } for (s2 = 0; s2 <= 24; s2 += 8) i3 <<= 1, i3 |= t4 >> s2 + a2 & 1; for (a2 = 1; a2 <= 3; a2++) { for (s2 = 0; s2 <= 24; s2 += 8) o2 <<= 1, o2 |= t4 >> s2 + a2 & 1; for (s2 = 0; s2 <= 24; s2 += 8) o2 <<= 1, o2 |= e4 >> s2 + a2 & 1; } for (s2 = 0; s2 <= 24; s2 += 8) o2 <<= 1, o2 |= e4 >> s2 + a2 & 1; r4[n3 + 0] = i3 >>> 0, r4[n3 + 1] = o2 >>> 0; }, t3.r28shl = function(e4, t4) { return e4 << t4 & 268435455 | e4 >>> 28 - t4; }; var r3 = [14, 11, 17, 4, 27, 23, 25, 0, 13, 22, 7, 18, 5, 9, 16, 24, 2, 20, 12, 21, 1, 8, 15, 26, 15, 4, 25, 19, 9, 1, 26, 16, 5, 11, 23, 8, 12, 7, 17, 0, 22, 3, 10, 14, 6, 20, 27, 24]; t3.pc2 = function(e4, t4, n3, i3) { for (var o2 = 0, a2 = 0, s2 = r3.length >>> 1, u2 = 0; u2 < s2; u2++) o2 <<= 1, o2 |= e4 >>> r3[u2] & 1; for (u2 = s2; u2 < r3.length; u2++) a2 <<= 1, a2 |= t4 >>> r3[u2] & 1; n3[i3 + 0] = o2 >>> 0, n3[i3 + 1] = a2 >>> 0; }, t3.expand = function(e4, t4, r4) { var n3 = 0, i3 = 0; n3 = (1 & e4) << 5 | e4 >>> 27; for (var o2 = 23; o2 >= 15; o2 -= 4) n3 <<= 6, n3 |= e4 >>> o2 & 63; for (o2 = 11; o2 >= 3; o2 -= 4) i3 |= e4 >>> o2 & 63, i3 <<= 6; i3 |= (31 & e4) << 1 | e4 >>> 31, t4[r4 + 0] = n3 >>> 0, t4[r4 + 1] = i3 >>> 0; }; var n2 = [14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11]; t3.substitute = function(e4, t4) { for (var r4 = 0, i3 = 0; i3 < 4; i3++) r4 <<= 4, r4 |= n2[64 * i3 + (e4 >>> 18 - 6 * i3 & 63)]; for (i3 = 0; i3 < 4; i3++) r4 <<= 4, r4 |= n2[256 + 64 * i3 + (t4 >>> 18 - 6 * i3 & 63)]; return r4 >>> 0; }; var i2 = [16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7]; t3.permute = function(e4) { for (var t4 = 0, r4 = 0; r4 < i2.length; r4++) t4 <<= 1, t4 |= e4 >>> i2[r4] & 1; return t4 >>> 0; }, t3.padSplit = function(e4, t4, r4) { for (var n3 = e4.toString(2); n3.length < t4; ) n3 = "0" + n3; for (var i3 = [], o2 = 0; o2 < t4; o2 += r4) i3.push(n3.slice(o2, o2 + r4)); return i3.join(" "); }; }, 28333: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(78557), o2 = r3(29799), a2 = r3(51592), s2 = { binary: true, hex: true, base64: true }; t3.DiffieHellmanGroup = t3.createDiffieHellmanGroup = t3.getDiffieHellman = function(e4) { var t4 = new n2(o2[e4].prime, "hex"), r4 = new n2(o2[e4].gen, "hex"); return new a2(t4, r4); }, t3.createDiffieHellman = t3.DiffieHellman = function e4(t4, r4, o3, u2) { return n2.isBuffer(r4) || void 0 === s2[r4] ? e4(t4, "binary", r4, o3) : (r4 = r4 || "binary", u2 = u2 || "binary", o3 = o3 || new n2([2]), n2.isBuffer(o3) || (o3 = new n2(o3, u2)), "number" == typeof t4 ? new a2(i2(t4, o3), o3, true) : (n2.isBuffer(t4) || (t4 = new n2(t4, r4)), new a2(t4, o3, true))); }; }, 51592: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(31734), o2 = new (r3(31962))(), a2 = new i2(24), s2 = new i2(11), u2 = new i2(10), c2 = new i2(3), f2 = new i2(7), d2 = r3(78557), l2 = r3(75010); function h2(e4, t4) { return t4 = t4 || "utf8", n2.isBuffer(e4) || (e4 = new n2(e4, t4)), this._pub = new i2(e4), this; } function p2(e4, t4) { return t4 = t4 || "utf8", n2.isBuffer(e4) || (e4 = new n2(e4, t4)), this._priv = new i2(e4), this; } e3.exports = y2; var b2 = {}; function y2(e4, t4, r4) { this.setGenerator(t4), this.__prime = new i2(e4), this._prime = i2.mont(this.__prime), this._primeLen = e4.length, this._pub = void 0, this._priv = void 0, this._primeCode = void 0, r4 ? (this.setPublicKey = h2, this.setPrivateKey = p2) : this._primeCode = 8; } function v2(e4, t4) { var r4 = new n2(e4.toArray()); return t4 ? r4.toString(t4) : r4; } Object.defineProperty(y2.prototype, "verifyError", { enumerable: true, get: function() { return "number" != typeof this._primeCode && (this._primeCode = function(e4, t4) { var r4 = t4.toString("hex"), n3 = [r4, e4.toString(16)].join("_"); if (n3 in b2) return b2[n3]; var i3, l3 = 0; if (e4.isEven() || !d2.simpleSieve || !d2.fermatTest(e4) || !o2.test(e4)) return l3 += 1, l3 += "02" === r4 || "05" === r4 ? 8 : 4, b2[n3] = l3, l3; switch (o2.test(e4.shrn(1)) || (l3 += 2), r4) { case "02": e4.mod(a2).cmp(s2) && (l3 += 8); break; case "05": (i3 = e4.mod(u2)).cmp(c2) && i3.cmp(f2) && (l3 += 8); break; default: l3 += 4; } return b2[n3] = l3, l3; }(this.__prime, this.__gen)), this._primeCode; } }), y2.prototype.generateKeys = function() { return this._priv || (this._priv = new i2(l2(this._primeLen))), this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(), this.getPublicKey(); }, y2.prototype.computeSecret = function(e4) { var t4 = (e4 = (e4 = new i2(e4)).toRed(this._prime)).redPow(this._priv).fromRed(), r4 = new n2(t4.toArray()), o3 = this.getPrime(); if (r4.length < o3.length) { var a3 = new n2(o3.length - r4.length); a3.fill(0), r4 = n2.concat([a3, r4]); } return r4; }, y2.prototype.getPublicKey = function(e4) { return v2(this._pub, e4); }, y2.prototype.getPrivateKey = function(e4) { return v2(this._priv, e4); }, y2.prototype.getPrime = function(e4) { return v2(this.__prime, e4); }, y2.prototype.getGenerator = function(e4) { return v2(this._gen, e4); }, y2.prototype.setGenerator = function(e4, t4) { return t4 = t4 || "utf8", n2.isBuffer(e4) || (e4 = new n2(e4, t4)), this.__gen = e4, this._gen = new i2(e4), this; }; }, 78557: (e3, t3, r3) => { var n2 = r3(75010); e3.exports = m2, m2.simpleSieve = y2, m2.fermatTest = v2; var i2 = r3(31734), o2 = new i2(24), a2 = new (r3(31962))(), s2 = new i2(1), u2 = new i2(2), c2 = new i2(5), f2 = (new i2(16), new i2(8), new i2(10)), d2 = new i2(3), l2 = (new i2(7), new i2(11)), h2 = new i2(4), p2 = (new i2(12), null); function b2() { if (null !== p2) return p2; var e4 = []; e4[0] = 2; for (var t4 = 1, r4 = 3; r4 < 1048576; r4 += 2) { for (var n3 = Math.ceil(Math.sqrt(r4)), i3 = 0; i3 < t4 && e4[i3] <= n3 && r4 % e4[i3] != 0; i3++) ; t4 !== i3 && e4[i3] <= n3 || (e4[t4++] = r4); } return p2 = e4, e4; } function y2(e4) { for (var t4 = b2(), r4 = 0; r4 < t4.length; r4++) if (0 === e4.modn(t4[r4])) return 0 === e4.cmpn(t4[r4]); return true; } function v2(e4) { var t4 = i2.mont(e4); return 0 === u2.toRed(t4).redPow(e4.subn(1)).fromRed().cmpn(1); } function m2(e4, t4) { if (e4 < 16) return new i2(2 === t4 || 5 === t4 ? [140, 123] : [140, 39]); var r4, p3; for (t4 = new i2(t4); ; ) { for (r4 = new i2(n2(Math.ceil(e4 / 8))); r4.bitLength() > e4; ) r4.ishrn(1); if (r4.isEven() && r4.iadd(s2), r4.testn(1) || r4.iadd(u2), t4.cmp(u2)) { if (!t4.cmp(c2)) for (; r4.mod(f2).cmp(d2); ) r4.iadd(h2); } else for (; r4.mod(o2).cmp(l2); ) r4.iadd(h2); if (y2(p3 = r4.shrn(1)) && y2(r4) && v2(p3) && v2(r4) && a2.test(p3) && a2.test(r4)) return r4; } } }, 36597: (e3, t3, r3) => { var n2 = t3; n2.version = r3(18597).i8, n2.utils = r3(7528), n2.rand = r3(82202), n2.curve = r3(76063), n2.curves = r3(40506), n2.ec = r3(28320), n2.eddsa = r3(68027); }, 11249: (e3, t3, r3) => { var n2 = r3(31734), i2 = r3(7528), o2 = i2.getNAF, a2 = i2.getJSF, s2 = i2.assert; function u2(e4, t4) { this.type = e4, this.p = new n2(t4.p, 16), this.red = t4.prime ? n2.red(t4.prime) : n2.mont(this.p), this.zero = new n2(0).toRed(this.red), this.one = new n2(1).toRed(this.red), this.two = new n2(2).toRed(this.red), this.n = t4.n && new n2(t4.n, 16), this.g = t4.g && this.pointFromJSON(t4.g, t4.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 r4 = this.n && this.p.div(this.n); !r4 || r4.cmpn(100) > 0 ? this.redN = null : (this._maxwellTrick = true, this.redN = this.n.toRed(this.red)); } function c2(e4, t4) { this.curve = e4, this.type = t4, this.precomputed = null; } e3.exports = u2, u2.prototype.point = function() { throw new Error("Not implemented"); }, u2.prototype.validate = function() { throw new Error("Not implemented"); }, u2.prototype._fixedNafMul = function(e4, t4) { s2(e4.precomputed); var r4 = e4._getDoubles(), n3 = o2(t4, 1, this._bitLength), i3 = (1 << r4.step + 1) - (r4.step % 2 == 0 ? 2 : 1); i3 /= 3; var a3, u3, c3 = []; for (a3 = 0; a3 < n3.length; a3 += r4.step) { u3 = 0; for (var f2 = a3 + r4.step - 1; f2 >= a3; f2--) u3 = (u3 << 1) + n3[f2]; c3.push(u3); } for (var d2 = this.jpoint(null, null, null), l2 = this.jpoint(null, null, null), h2 = i3; h2 > 0; h2--) { for (a3 = 0; a3 < c3.length; a3++) (u3 = c3[a3]) === h2 ? l2 = l2.mixedAdd(r4.points[a3]) : u3 === -h2 && (l2 = l2.mixedAdd(r4.points[a3].neg())); d2 = d2.add(l2); } return d2.toP(); }, u2.prototype._wnafMul = function(e4, t4) { var r4 = 4, n3 = e4._getNAFPoints(r4); r4 = n3.wnd; for (var i3 = n3.points, a3 = o2(t4, r4, this._bitLength), u3 = this.jpoint(null, null, null), c3 = a3.length - 1; c3 >= 0; c3--) { for (var f2 = 0; c3 >= 0 && 0 === a3[c3]; c3--) f2++; if (c3 >= 0 && f2++, u3 = u3.dblp(f2), c3 < 0) break; var d2 = a3[c3]; s2(0 !== d2), u3 = "affine" === e4.type ? d2 > 0 ? u3.mixedAdd(i3[d2 - 1 >> 1]) : u3.mixedAdd(i3[-d2 - 1 >> 1].neg()) : d2 > 0 ? u3.add(i3[d2 - 1 >> 1]) : u3.add(i3[-d2 - 1 >> 1].neg()); } return "affine" === e4.type ? u3.toP() : u3; }, u2.prototype._wnafMulAdd = function(e4, t4, r4, n3, i3) { var s3, u3, c3, f2 = this._wnafT1, d2 = this._wnafT2, l2 = this._wnafT3, h2 = 0; for (s3 = 0; s3 < n3; s3++) { var p2 = (c3 = t4[s3])._getNAFPoints(e4); f2[s3] = p2.wnd, d2[s3] = p2.points; } for (s3 = n3 - 1; s3 >= 1; s3 -= 2) { var b2 = s3 - 1, y2 = s3; if (1 === f2[b2] && 1 === f2[y2]) { var v2 = [t4[b2], null, null, t4[y2]]; 0 === t4[b2].y.cmp(t4[y2].y) ? (v2[1] = t4[b2].add(t4[y2]), v2[2] = t4[b2].toJ().mixedAdd(t4[y2].neg())) : 0 === t4[b2].y.cmp(t4[y2].y.redNeg()) ? (v2[1] = t4[b2].toJ().mixedAdd(t4[y2]), v2[2] = t4[b2].add(t4[y2].neg())) : (v2[1] = t4[b2].toJ().mixedAdd(t4[y2]), v2[2] = t4[b2].toJ().mixedAdd(t4[y2].neg())); var m2 = [-3, -1, -5, -7, 0, 7, 5, 1, 3], g2 = a2(r4[b2], r4[y2]); for (h2 = Math.max(g2[0].length, h2), l2[b2] = new Array(h2), l2[y2] = new Array(h2), u3 = 0; u3 < h2; u3++) { var w2 = 0 | g2[0][u3], k2 = 0 | g2[1][u3]; l2[b2][u3] = m2[3 * (w2 + 1) + (k2 + 1)], l2[y2][u3] = 0, d2[b2] = v2; } } else l2[b2] = o2(r4[b2], f2[b2], this._bitLength), l2[y2] = o2(r4[y2], f2[y2], this._bitLength), h2 = Math.max(l2[b2].length, h2), h2 = Math.max(l2[y2].length, h2); } var _2 = this.jpoint(null, null, null), A2 = this._wnafT4; for (s3 = h2; s3 >= 0; s3--) { for (var E2 = 0; s3 >= 0; ) { var S2 = true; for (u3 = 0; u3 < n3; u3++) A2[u3] = 0 | l2[u3][s3], 0 !== A2[u3] && (S2 = false); if (!S2) break; E2++, s3--; } if (s3 >= 0 && E2++, _2 = _2.dblp(E2), s3 < 0) break; for (u3 = 0; u3 < n3; u3++) { var x2 = A2[u3]; 0 !== x2 && (x2 > 0 ? c3 = d2[u3][x2 - 1 >> 1] : x2 < 0 && (c3 = d2[u3][-x2 - 1 >> 1].neg()), _2 = "affine" === c3.type ? _2.mixedAdd(c3) : _2.add(c3)); } } for (s3 = 0; s3 < n3; s3++) d2[s3] = null; return i3 ? _2 : _2.toP(); }, u2.BasePoint = c2, c2.prototype.eq = function() { throw new Error("Not implemented"); }, c2.prototype.validate = function() { return this.curve.validate(this); }, u2.prototype.decodePoint = function(e4, t4) { e4 = i2.toArray(e4, t4); var r4 = this.p.byteLength(); if ((4 === e4[0] || 6 === e4[0] || 7 === e4[0]) && e4.length - 1 == 2 * r4) return 6 === e4[0] ? s2(e4[e4.length - 1] % 2 == 0) : 7 === e4[0] && s2(e4[e4.length - 1] % 2 == 1), this.point(e4.slice(1, 1 + r4), e4.slice(1 + r4, 1 + 2 * r4)); if ((2 === e4[0] || 3 === e4[0]) && e4.length - 1 === r4) return this.pointFromX(e4.slice(1, 1 + r4), 3 === e4[0]); throw new Error("Unknown point format"); }, c2.prototype.encodeCompressed = function(e4) { return this.encode(e4, true); }, c2.prototype._encode = function(e4) { var t4 = this.curve.p.byteLength(), r4 = this.getX().toArray("be", t4); return e4 ? [this.getY().isEven() ? 2 : 3].concat(r4) : [4].concat(r4, this.getY().toArray("be", t4)); }, c2.prototype.encode = function(e4, t4) { return i2.encode(this._encode(t4), e4); }, c2.prototype.precompute = function(e4) { if (this.precomputed) return this; var t4 = { doubles: null, naf: null, beta: null }; return t4.naf = this._getNAFPoints(8), t4.doubles = this._getDoubles(4, e4), t4.beta = this._getBeta(), this.precomputed = t4, this; }, c2.prototype._hasDoubles = function(e4) { if (!this.precomputed) return false; var t4 = this.precomputed.doubles; return !!t4 && t4.points.length >= Math.ceil((e4.bitLength() + 1) / t4.step); }, c2.prototype._getDoubles = function(e4, t4) { if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles; for (var r4 = [this], n3 = this, i3 = 0; i3 < t4; i3 += e4) { for (var o3 = 0; o3 < e4; o3++) n3 = n3.dbl(); r4.push(n3); } return { step: e4, points: r4 }; }, c2.prototype._getNAFPoints = function(e4) { if (this.precomputed && this.precomputed.naf) return this.precomputed.naf; for (var t4 = [this], r4 = (1 << e4) - 1, n3 = 1 === r4 ? null : this.dbl(), i3 = 1; i3 < r4; i3++) t4[i3] = t4[i3 - 1].add(n3); return { wnd: e4, points: t4 }; }, c2.prototype._getBeta = function() { return null; }, c2.prototype.dblp = function(e4) { for (var t4 = this, r4 = 0; r4 < e4; r4++) t4 = t4.dbl(); return t4; }; }, 81123: (e3, t3, r3) => { var n2 = r3(7528), i2 = r3(31734), o2 = r3(41736), a2 = r3(11249), s2 = n2.assert; function u2(e4) { this.twisted = 1 != (0 | e4.a), this.mOneA = this.twisted && -1 == (0 | e4.a), this.extended = this.mOneA, a2.call(this, "edwards", e4), this.a = new i2(e4.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new i2(e4.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new i2(e4.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), s2(!this.twisted || 0 === this.c.fromRed().cmpn(1)), this.oneC = 1 == (0 | e4.c); } function c2(e4, t4, r4, n3, o3) { a2.BasePoint.call(this, e4, "projective"), null === t4 && null === r4 && null === n3 ? (this.x = this.curve.zero, this.y = this.curve.one, this.z = this.curve.one, this.t = this.curve.zero, this.zOne = true) : (this.x = new i2(t4, 16), this.y = new i2(r4, 16), this.z = n3 ? new i2(n3, 16) : this.curve.one, this.t = o3 && new i2(o3, 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())))); } o2(u2, a2), e3.exports = u2, u2.prototype._mulA = function(e4) { return this.mOneA ? e4.redNeg() : this.a.redMul(e4); }, u2.prototype._mulC = function(e4) { return this.oneC ? e4 : this.c.redMul(e4); }, u2.prototype.jpoint = function(e4, t4, r4, n3) { return this.point(e4, t4, r4, n3); }, u2.prototype.pointFromX = function(e4, t4) { (e4 = new i2(e4, 16)).red || (e4 = e4.toRed(this.red)); var r4 = e4.redSqr(), n3 = this.c2.redSub(this.a.redMul(r4)), o3 = this.one.redSub(this.c2.redMul(this.d).redMul(r4)), a3 = n3.redMul(o3.redInvm()), s3 = a3.redSqrt(); if (0 !== s3.redSqr().redSub(a3).cmp(this.zero)) throw new Error("invalid point"); var u3 = s3.fromRed().isOdd(); return (t4 && !u3 || !t4 && u3) && (s3 = s3.redNeg()), this.point(e4, s3); }, u2.prototype.pointFromY = function(e4, t4) { (e4 = new i2(e4, 16)).red || (e4 = e4.toRed(this.red)); var r4 = e4.redSqr(), n3 = r4.redSub(this.c2), o3 = r4.redMul(this.d).redMul(this.c2).redSub(this.a), a3 = n3.redMul(o3.redInvm()); if (0 === a3.cmp(this.zero)) { if (t4) throw new Error("invalid point"); return this.point(this.zero, e4); } var s3 = a3.redSqrt(); if (0 !== s3.redSqr().redSub(a3).cmp(this.zero)) throw new Error("invalid point"); return s3.fromRed().isOdd() !== t4 && (s3 = s3.redNeg()), this.point(s3, e4); }, u2.prototype.validate = function(e4) { if (e4.isInfinity()) return true; e4.normalize(); var t4 = e4.x.redSqr(), r4 = e4.y.redSqr(), n3 = t4.redMul(this.a).redAdd(r4), i3 = this.c2.redMul(this.one.redAdd(this.d.redMul(t4).redMul(r4))); return 0 === n3.cmp(i3); }, o2(c2, a2.BasePoint), u2.prototype.pointFromJSON = function(e4) { return c2.fromJSON(this, e4); }, u2.prototype.point = function(e4, t4, r4, n3) { return new c2(this, e4, t4, r4, n3); }, c2.fromJSON = function(e4, t4) { return new c2(e4, t4[0], t4[1], t4[2]); }, c2.prototype.inspect = function() { return this.isInfinity() ? "" : ""; }, c2.prototype.isInfinity = function() { return 0 === this.x.cmpn(0) && (0 === this.y.cmp(this.z) || this.zOne && 0 === this.y.cmp(this.curve.c)); }, c2.prototype._extDbl = function() { var e4 = this.x.redSqr(), t4 = this.y.redSqr(), r4 = this.z.redSqr(); r4 = r4.redIAdd(r4); var n3 = this.curve._mulA(e4), i3 = this.x.redAdd(this.y).redSqr().redISub(e4).redISub(t4), o3 = n3.redAdd(t4), a3 = o3.redSub(r4), s3 = n3.redSub(t4), u3 = i3.redMul(a3), c3 = o3.redMul(s3), f2 = i3.redMul(s3), d2 = a3.redMul(o3); return this.curve.point(u3, c3, d2, f2); }, c2.prototype._projDbl = function() { var e4, t4, r4, n3, i3, o3, a3 = this.x.redAdd(this.y).redSqr(), s3 = this.x.redSqr(), u3 = this.y.redSqr(); if (this.curve.twisted) { var c3 = (n3 = this.curve._mulA(s3)).redAdd(u3); this.zOne ? (e4 = a3.redSub(s3).redSub(u3).redMul(c3.redSub(this.curve.two)), t4 = c3.redMul(n3.redSub(u3)), r4 = c3.redSqr().redSub(c3).redSub(c3)) : (i3 = this.z.redSqr(), o3 = c3.redSub(i3).redISub(i3), e4 = a3.redSub(s3).redISub(u3).redMul(o3), t4 = c3.redMul(n3.redSub(u3)), r4 = c3.redMul(o3)); } else n3 = s3.redAdd(u3), i3 = this.curve._mulC(this.z).redSqr(), o3 = n3.redSub(i3).redSub(i3), e4 = this.curve._mulC(a3.redISub(n3)).redMul(o3), t4 = this.curve._mulC(n3).redMul(s3.redISub(u3)), r4 = n3.redMul(o3); return this.curve.point(e4, t4, r4); }, c2.prototype.dbl = function() { return this.isInfinity() ? this : this.curve.extended ? this._extDbl() : this._projDbl(); }, c2.prototype._extAdd = function(e4) { var t4 = this.y.redSub(this.x).redMul(e4.y.redSub(e4.x)), r4 = this.y.redAdd(this.x).redMul(e4.y.redAdd(e4.x)), n3 = this.t.redMul(this.curve.dd).redMul(e4.t), i3 = this.z.redMul(e4.z.redAdd(e4.z)), o3 = r4.redSub(t4), a3 = i3.redSub(n3), s3 = i3.redAdd(n3), u3 = r4.redAdd(t4), c3 = o3.redMul(a3), f2 = s3.redMul(u3), d2 = o3.redMul(u3), l2 = a3.redMul(s3); return this.curve.point(c3, f2, l2, d2); }, c2.prototype._projAdd = function(e4) { var t4, r4, n3 = this.z.redMul(e4.z), i3 = n3.redSqr(), o3 = this.x.redMul(e4.x), a3 = this.y.redMul(e4.y), s3 = this.curve.d.redMul(o3).redMul(a3), u3 = i3.redSub(s3), c3 = i3.redAdd(s3), f2 = this.x.redAdd(this.y).redMul(e4.x.redAdd(e4.y)).redISub(o3).redISub(a3), d2 = n3.redMul(u3).redMul(f2); return this.curve.twisted ? (t4 = n3.redMul(c3).redMul(a3.redSub(this.curve._mulA(o3))), r4 = u3.redMul(c3)) : (t4 = n3.redMul(c3).redMul(a3.redSub(o3)), r4 = this.curve._mulC(u3).redMul(c3)), this.curve.point(d2, t4, r4); }, c2.prototype.add = function(e4) { return this.isInfinity() ? e4 : e4.isInfinity() ? this : this.curve.extended ? this._extAdd(e4) : this._projAdd(e4); }, c2.prototype.mul = function(e4) { return this._hasDoubles(e4) ? this.curve._fixedNafMul(this, e4) : this.curve._wnafMul(this, e4); }, c2.prototype.mulAdd = function(e4, t4, r4) { return this.curve._wnafMulAdd(1, [this, t4], [e4, r4], 2, false); }, c2.prototype.jmulAdd = function(e4, t4, r4) { return this.curve._wnafMulAdd(1, [this, t4], [e4, r4], 2, true); }, c2.prototype.normalize = function() { if (this.zOne) return this; var e4 = this.z.redInvm(); return this.x = this.x.redMul(e4), this.y = this.y.redMul(e4), this.t && (this.t = this.t.redMul(e4)), this.z = this.curve.one, this.zOne = true, this; }, c2.prototype.neg = function() { return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg()); }, c2.prototype.getX = function() { return this.normalize(), this.x.fromRed(); }, c2.prototype.getY = function() { return this.normalize(), this.y.fromRed(); }, c2.prototype.eq = function(e4) { return this === e4 || 0 === this.getX().cmp(e4.getX()) && 0 === this.getY().cmp(e4.getY()); }, c2.prototype.eqXToP = function(e4) { var t4 = e4.toRed(this.curve.red).redMul(this.z); if (0 === this.x.cmp(t4)) return true; for (var r4 = e4.clone(), n3 = this.curve.redN.redMul(this.z); ; ) { if (r4.iadd(this.curve.n), r4.cmp(this.curve.p) >= 0) return false; if (t4.redIAdd(n3), 0 === this.x.cmp(t4)) return true; } }, c2.prototype.toP = c2.prototype.normalize, c2.prototype.mixedAdd = c2.prototype.add; }, 76063: (e3, t3, r3) => { var n2 = t3; n2.base = r3(11249), n2.short = r3(53148), n2.mont = r3(51105), n2.edwards = r3(81123); }, 51105: (e3, t3, r3) => { var n2 = r3(31734), i2 = r3(41736), o2 = r3(11249), a2 = r3(7528); function s2(e4) { o2.call(this, "mont", e4), this.a = new n2(e4.a, 16).toRed(this.red), this.b = new n2(e4.b, 16).toRed(this.red), this.i4 = new n2(4).toRed(this.red).redInvm(), this.two = new n2(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two)); } function u2(e4, t4, r4) { o2.BasePoint.call(this, e4, "projective"), null === t4 && null === r4 ? (this.x = this.curve.one, this.z = this.curve.zero) : (this.x = new n2(t4, 16), this.z = new n2(r4, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red))); } i2(s2, o2), e3.exports = s2, s2.prototype.validate = function(e4) { var t4 = e4.normalize().x, r4 = t4.redSqr(), n3 = r4.redMul(t4).redAdd(r4.redMul(this.a)).redAdd(t4); return 0 === n3.redSqrt().redSqr().cmp(n3); }, i2(u2, o2.BasePoint), s2.prototype.decodePoint = function(e4, t4) { return this.point(a2.toArray(e4, t4), 1); }, s2.prototype.point = function(e4, t4) { return new u2(this, e4, t4); }, s2.prototype.pointFromJSON = function(e4) { return u2.fromJSON(this, e4); }, u2.prototype.precompute = function() { }, u2.prototype._encode = function() { return this.getX().toArray("be", this.curve.p.byteLength()); }, u2.fromJSON = function(e4, t4) { return new u2(e4, t4[0], t4[1] || e4.one); }, u2.prototype.inspect = function() { return this.isInfinity() ? "" : ""; }, u2.prototype.isInfinity = function() { return 0 === this.z.cmpn(0); }, u2.prototype.dbl = function() { var e4 = this.x.redAdd(this.z).redSqr(), t4 = this.x.redSub(this.z).redSqr(), r4 = e4.redSub(t4), n3 = e4.redMul(t4), i3 = r4.redMul(t4.redAdd(this.curve.a24.redMul(r4))); return this.curve.point(n3, i3); }, u2.prototype.add = function() { throw new Error("Not supported on Montgomery curve"); }, u2.prototype.diffAdd = function(e4, t4) { var r4 = this.x.redAdd(this.z), n3 = this.x.redSub(this.z), i3 = e4.x.redAdd(e4.z), o3 = e4.x.redSub(e4.z).redMul(r4), a3 = i3.redMul(n3), s3 = t4.z.redMul(o3.redAdd(a3).redSqr()), u3 = t4.x.redMul(o3.redISub(a3).redSqr()); return this.curve.point(s3, u3); }, u2.prototype.mul = function(e4) { for (var t4 = e4.clone(), r4 = this, n3 = this.curve.point(null, null), i3 = []; 0 !== t4.cmpn(0); t4.iushrn(1)) i3.push(t4.andln(1)); for (var o3 = i3.length - 1; o3 >= 0; o3--) 0 === i3[o3] ? (r4 = r4.diffAdd(n3, this), n3 = n3.dbl()) : (n3 = r4.diffAdd(n3, this), r4 = r4.dbl()); return n3; }, u2.prototype.mulAdd = function() { throw new Error("Not supported on Montgomery curve"); }, u2.prototype.jumlAdd = function() { throw new Error("Not supported on Montgomery curve"); }, u2.prototype.eq = function(e4) { return 0 === this.getX().cmp(e4.getX()); }, u2.prototype.normalize = function() { return this.x = this.x.redMul(this.z.redInvm()), this.z = this.curve.one, this; }, u2.prototype.getX = function() { return this.normalize(), this.x.fromRed(); }; }, 53148: (e3, t3, r3) => { var n2 = r3(7528), i2 = r3(31734), o2 = r3(41736), a2 = r3(11249), s2 = n2.assert; function u2(e4) { a2.call(this, "short", e4), this.a = new i2(e4.a, 16).toRed(this.red), this.b = new i2(e4.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = 0 === this.a.fromRed().cmpn(0), this.threeA = 0 === this.a.fromRed().sub(this.p).cmpn(-3), this.endo = this._getEndomorphism(e4), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4); } function c2(e4, t4, r4, n3) { a2.BasePoint.call(this, e4, "affine"), null === t4 && null === r4 ? (this.x = null, this.y = null, this.inf = true) : (this.x = new i2(t4, 16), this.y = new i2(r4, 16), n3 && (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 = false); } function f2(e4, t4, r4, n3) { a2.BasePoint.call(this, e4, "jacobian"), null === t4 && null === r4 && null === n3 ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new i2(0)) : (this.x = new i2(t4, 16), this.y = new i2(r4, 16), this.z = new i2(n3, 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; } o2(u2, a2), e3.exports = u2, u2.prototype._getEndomorphism = function(e4) { if (this.zeroA && this.g && this.n && 1 === this.p.modn(3)) { var t4, r4; if (e4.beta) t4 = new i2(e4.beta, 16).toRed(this.red); else { var n3 = this._getEndoRoots(this.p); t4 = (t4 = n3[0].cmp(n3[1]) < 0 ? n3[0] : n3[1]).toRed(this.red); } if (e4.lambda) r4 = new i2(e4.lambda, 16); else { var o3 = this._getEndoRoots(this.n); 0 === this.g.mul(o3[0]).x.cmp(this.g.x.redMul(t4)) ? r4 = o3[0] : (r4 = o3[1], s2(0 === this.g.mul(r4).x.cmp(this.g.x.redMul(t4)))); } return { beta: t4, lambda: r4, basis: e4.basis ? e4.basis.map(function(e5) { return { a: new i2(e5.a, 16), b: new i2(e5.b, 16) }; }) : this._getEndoBasis(r4) }; } }, u2.prototype._getEndoRoots = function(e4) { var t4 = e4 === this.p ? this.red : i2.mont(e4), r4 = new i2(2).toRed(t4).redInvm(), n3 = r4.redNeg(), o3 = new i2(3).toRed(t4).redNeg().redSqrt().redMul(r4); return [n3.redAdd(o3).fromRed(), n3.redSub(o3).fromRed()]; }, u2.prototype._getEndoBasis = function(e4) { for (var t4, r4, n3, o3, a3, s3, u3, c3, f3, d2 = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), l2 = e4, h2 = this.n.clone(), p2 = new i2(1), b2 = new i2(0), y2 = new i2(0), v2 = new i2(1), m2 = 0; 0 !== l2.cmpn(0); ) { var g2 = h2.div(l2); c3 = h2.sub(g2.mul(l2)), f3 = y2.sub(g2.mul(p2)); var w2 = v2.sub(g2.mul(b2)); if (!n3 && c3.cmp(d2) < 0) t4 = u3.neg(), r4 = p2, n3 = c3.neg(), o3 = f3; else if (n3 && 2 == ++m2) break; u3 = c3, h2 = l2, l2 = c3, y2 = p2, p2 = f3, v2 = b2, b2 = w2; } a3 = c3.neg(), s3 = f3; var k2 = n3.sqr().add(o3.sqr()); return a3.sqr().add(s3.sqr()).cmp(k2) >= 0 && (a3 = t4, s3 = r4), n3.negative && (n3 = n3.neg(), o3 = o3.neg()), a3.negative && (a3 = a3.neg(), s3 = s3.neg()), [{ a: n3, b: o3 }, { a: a3, b: s3 }]; }, u2.prototype._endoSplit = function(e4) { var t4 = this.endo.basis, r4 = t4[0], n3 = t4[1], i3 = n3.b.mul(e4).divRound(this.n), o3 = r4.b.neg().mul(e4).divRound(this.n), a3 = i3.mul(r4.a), s3 = o3.mul(n3.a), u3 = i3.mul(r4.b), c3 = o3.mul(n3.b); return { k1: e4.sub(a3).sub(s3), k2: u3.add(c3).neg() }; }, u2.prototype.pointFromX = function(e4, t4) { (e4 = new i2(e4, 16)).red || (e4 = e4.toRed(this.red)); var r4 = e4.redSqr().redMul(e4).redIAdd(e4.redMul(this.a)).redIAdd(this.b), n3 = r4.redSqrt(); if (0 !== n3.redSqr().redSub(r4).cmp(this.zero)) throw new Error("invalid point"); var o3 = n3.fromRed().isOdd(); return (t4 && !o3 || !t4 && o3) && (n3 = n3.redNeg()), this.point(e4, n3); }, u2.prototype.validate = function(e4) { if (e4.inf) return true; var t4 = e4.x, r4 = e4.y, n3 = this.a.redMul(t4), i3 = t4.redSqr().redMul(t4).redIAdd(n3).redIAdd(this.b); return 0 === r4.redSqr().redISub(i3).cmpn(0); }, u2.prototype._endoWnafMulAdd = function(e4, t4, r4) { for (var n3 = this._endoWnafT1, i3 = this._endoWnafT2, o3 = 0; o3 < e4.length; o3++) { var a3 = this._endoSplit(t4[o3]), s3 = e4[o3], u3 = s3._getBeta(); a3.k1.negative && (a3.k1.ineg(), s3 = s3.neg(true)), a3.k2.negative && (a3.k2.ineg(), u3 = u3.neg(true)), n3[2 * o3] = s3, n3[2 * o3 + 1] = u3, i3[2 * o3] = a3.k1, i3[2 * o3 + 1] = a3.k2; } for (var c3 = this._wnafMulAdd(1, n3, i3, 2 * o3, r4), f3 = 0; f3 < 2 * o3; f3++) n3[f3] = null, i3[f3] = null; return c3; }, o2(c2, a2.BasePoint), u2.prototype.point = function(e4, t4, r4) { return new c2(this, e4, t4, r4); }, u2.prototype.pointFromJSON = function(e4, t4) { return c2.fromJSON(this, e4, t4); }, c2.prototype._getBeta = function() { if (this.curve.endo) { var e4 = this.precomputed; if (e4 && e4.beta) return e4.beta; var t4 = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); if (e4) { var r4 = this.curve, n3 = function(e5) { return r4.point(e5.x.redMul(r4.endo.beta), e5.y); }; e4.beta = t4, t4.precomputed = { beta: null, naf: e4.naf && { wnd: e4.naf.wnd, points: e4.naf.points.map(n3) }, doubles: e4.doubles && { step: e4.doubles.step, points: e4.doubles.points.map(n3) } }; } return t4; } }, c2.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]; }, c2.fromJSON = function(e4, t4, r4) { "string" == typeof t4 && (t4 = JSON.parse(t4)); var n3 = e4.point(t4[0], t4[1], r4); if (!t4[2]) return n3; function i3(t5) { return e4.point(t5[0], t5[1], r4); } var o3 = t4[2]; return n3.precomputed = { beta: null, doubles: o3.doubles && { step: o3.doubles.step, points: [n3].concat(o3.doubles.points.map(i3)) }, naf: o3.naf && { wnd: o3.naf.wnd, points: [n3].concat(o3.naf.points.map(i3)) } }, n3; }, c2.prototype.inspect = function() { return this.isInfinity() ? "" : ""; }, c2.prototype.isInfinity = function() { return this.inf; }, c2.prototype.add = function(e4) { if (this.inf) return e4; if (e4.inf) return this; if (this.eq(e4)) return this.dbl(); if (this.neg().eq(e4)) return this.curve.point(null, null); if (0 === this.x.cmp(e4.x)) return this.curve.point(null, null); var t4 = this.y.redSub(e4.y); 0 !== t4.cmpn(0) && (t4 = t4.redMul(this.x.redSub(e4.x).redInvm())); var r4 = t4.redSqr().redISub(this.x).redISub(e4.x), n3 = t4.redMul(this.x.redSub(r4)).redISub(this.y); return this.curve.point(r4, n3); }, c2.prototype.dbl = function() { if (this.inf) return this; var e4 = this.y.redAdd(this.y); if (0 === e4.cmpn(0)) return this.curve.point(null, null); var t4 = this.curve.a, r4 = this.x.redSqr(), n3 = e4.redInvm(), i3 = r4.redAdd(r4).redIAdd(r4).redIAdd(t4).redMul(n3), o3 = i3.redSqr().redISub(this.x.redAdd(this.x)), a3 = i3.redMul(this.x.redSub(o3)).redISub(this.y); return this.curve.point(o3, a3); }, c2.prototype.getX = function() { return this.x.fromRed(); }, c2.prototype.getY = function() { return this.y.fromRed(); }, c2.prototype.mul = function(e4) { return e4 = new i2(e4, 16), this.isInfinity() ? this : this._hasDoubles(e4) ? this.curve._fixedNafMul(this, e4) : this.curve.endo ? this.curve._endoWnafMulAdd([this], [e4]) : this.curve._wnafMul(this, e4); }, c2.prototype.mulAdd = function(e4, t4, r4) { var n3 = [this, t4], i3 = [e4, r4]; return this.curve.endo ? this.curve._endoWnafMulAdd(n3, i3) : this.curve._wnafMulAdd(1, n3, i3, 2); }, c2.prototype.jmulAdd = function(e4, t4, r4) { var n3 = [this, t4], i3 = [e4, r4]; return this.curve.endo ? this.curve._endoWnafMulAdd(n3, i3, true) : this.curve._wnafMulAdd(1, n3, i3, 2, true); }, c2.prototype.eq = function(e4) { return this === e4 || this.inf === e4.inf && (this.inf || 0 === this.x.cmp(e4.x) && 0 === this.y.cmp(e4.y)); }, c2.prototype.neg = function(e4) { if (this.inf) return this; var t4 = this.curve.point(this.x, this.y.redNeg()); if (e4 && this.precomputed) { var r4 = this.precomputed, n3 = function(e5) { return e5.neg(); }; t4.precomputed = { naf: r4.naf && { wnd: r4.naf.wnd, points: r4.naf.points.map(n3) }, doubles: r4.doubles && { step: r4.doubles.step, points: r4.doubles.points.map(n3) } }; } return t4; }, c2.prototype.toJ = function() { return this.inf ? this.curve.jpoint(null, null, null) : this.curve.jpoint(this.x, this.y, this.curve.one); }, o2(f2, a2.BasePoint), u2.prototype.jpoint = function(e4, t4, r4) { return new f2(this, e4, t4, r4); }, f2.prototype.toP = function() { if (this.isInfinity()) return this.curve.point(null, null); var e4 = this.z.redInvm(), t4 = e4.redSqr(), r4 = this.x.redMul(t4), n3 = this.y.redMul(t4).redMul(e4); return this.curve.point(r4, n3); }, f2.prototype.neg = function() { return this.curve.jpoint(this.x, this.y.redNeg(), this.z); }, f2.prototype.add = function(e4) { if (this.isInfinity()) return e4; if (e4.isInfinity()) return this; var t4 = e4.z.redSqr(), r4 = this.z.redSqr(), n3 = this.x.redMul(t4), i3 = e4.x.redMul(r4), o3 = this.y.redMul(t4.redMul(e4.z)), a3 = e4.y.redMul(r4.redMul(this.z)), s3 = n3.redSub(i3), u3 = o3.redSub(a3); if (0 === s3.cmpn(0)) return 0 !== u3.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl(); var c3 = s3.redSqr(), f3 = c3.redMul(s3), d2 = n3.redMul(c3), l2 = u3.redSqr().redIAdd(f3).redISub(d2).redISub(d2), h2 = u3.redMul(d2.redISub(l2)).redISub(o3.redMul(f3)), p2 = this.z.redMul(e4.z).redMul(s3); return this.curve.jpoint(l2, h2, p2); }, f2.prototype.mixedAdd = function(e4) { if (this.isInfinity()) return e4.toJ(); if (e4.isInfinity()) return this; var t4 = this.z.redSqr(), r4 = this.x, n3 = e4.x.redMul(t4), i3 = this.y, o3 = e4.y.redMul(t4).redMul(this.z), a3 = r4.redSub(n3), s3 = i3.redSub(o3); if (0 === a3.cmpn(0)) return 0 !== s3.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl(); var u3 = a3.redSqr(), c3 = u3.redMul(a3), f3 = r4.redMul(u3), d2 = s3.redSqr().redIAdd(c3).redISub(f3).redISub(f3), l2 = s3.redMul(f3.redISub(d2)).redISub(i3.redMul(c3)), h2 = this.z.redMul(a3); return this.curve.jpoint(d2, l2, h2); }, f2.prototype.dblp = function(e4) { if (0 === e4) return this; if (this.isInfinity()) return this; if (!e4) return this.dbl(); var t4; if (this.curve.zeroA || this.curve.threeA) { var r4 = this; for (t4 = 0; t4 < e4; t4++) r4 = r4.dbl(); return r4; } var n3 = this.curve.a, i3 = this.curve.tinv, o3 = this.x, a3 = this.y, s3 = this.z, u3 = s3.redSqr().redSqr(), c3 = a3.redAdd(a3); for (t4 = 0; t4 < e4; t4++) { var f3 = o3.redSqr(), d2 = c3.redSqr(), l2 = d2.redSqr(), h2 = f3.redAdd(f3).redIAdd(f3).redIAdd(n3.redMul(u3)), p2 = o3.redMul(d2), b2 = h2.redSqr().redISub(p2.redAdd(p2)), y2 = p2.redISub(b2), v2 = h2.redMul(y2); v2 = v2.redIAdd(v2).redISub(l2); var m2 = c3.redMul(s3); t4 + 1 < e4 && (u3 = u3.redMul(l2)), o3 = b2, s3 = m2, c3 = v2; } return this.curve.jpoint(o3, c3.redMul(i3), s3); }, f2.prototype.dbl = function() { return this.isInfinity() ? this : this.curve.zeroA ? this._zeroDbl() : this.curve.threeA ? this._threeDbl() : this._dbl(); }, f2.prototype._zeroDbl = function() { var e4, t4, r4; if (this.zOne) { var n3 = this.x.redSqr(), i3 = this.y.redSqr(), o3 = i3.redSqr(), a3 = this.x.redAdd(i3).redSqr().redISub(n3).redISub(o3); a3 = a3.redIAdd(a3); var s3 = n3.redAdd(n3).redIAdd(n3), u3 = s3.redSqr().redISub(a3).redISub(a3), c3 = o3.redIAdd(o3); c3 = (c3 = c3.redIAdd(c3)).redIAdd(c3), e4 = u3, t4 = s3.redMul(a3.redISub(u3)).redISub(c3), r4 = this.y.redAdd(this.y); } else { var f3 = this.x.redSqr(), d2 = this.y.redSqr(), l2 = d2.redSqr(), h2 = this.x.redAdd(d2).redSqr().redISub(f3).redISub(l2); h2 = h2.redIAdd(h2); var p2 = f3.redAdd(f3).redIAdd(f3), b2 = p2.redSqr(), y2 = l2.redIAdd(l2); y2 = (y2 = y2.redIAdd(y2)).redIAdd(y2), e4 = b2.redISub(h2).redISub(h2), t4 = p2.redMul(h2.redISub(e4)).redISub(y2), r4 = (r4 = this.y.redMul(this.z)).redIAdd(r4); } return this.curve.jpoint(e4, t4, r4); }, f2.prototype._threeDbl = function() { var e4, t4, r4; if (this.zOne) { var n3 = this.x.redSqr(), i3 = this.y.redSqr(), o3 = i3.redSqr(), a3 = this.x.redAdd(i3).redSqr().redISub(n3).redISub(o3); a3 = a3.redIAdd(a3); var s3 = n3.redAdd(n3).redIAdd(n3).redIAdd(this.curve.a), u3 = s3.redSqr().redISub(a3).redISub(a3); e4 = u3; var c3 = o3.redIAdd(o3); c3 = (c3 = c3.redIAdd(c3)).redIAdd(c3), t4 = s3.redMul(a3.redISub(u3)).redISub(c3), r4 = this.y.redAdd(this.y); } else { var f3 = this.z.redSqr(), d2 = this.y.redSqr(), l2 = this.x.redMul(d2), h2 = this.x.redSub(f3).redMul(this.x.redAdd(f3)); h2 = h2.redAdd(h2).redIAdd(h2); var p2 = l2.redIAdd(l2), b2 = (p2 = p2.redIAdd(p2)).redAdd(p2); e4 = h2.redSqr().redISub(b2), r4 = this.y.redAdd(this.z).redSqr().redISub(d2).redISub(f3); var y2 = d2.redSqr(); y2 = (y2 = (y2 = y2.redIAdd(y2)).redIAdd(y2)).redIAdd(y2), t4 = h2.redMul(p2.redISub(e4)).redISub(y2); } return this.curve.jpoint(e4, t4, r4); }, f2.prototype._dbl = function() { var e4 = this.curve.a, t4 = this.x, r4 = this.y, n3 = this.z, i3 = n3.redSqr().redSqr(), o3 = t4.redSqr(), a3 = r4.redSqr(), s3 = o3.redAdd(o3).redIAdd(o3).redIAdd(e4.redMul(i3)), u3 = t4.redAdd(t4), c3 = (u3 = u3.redIAdd(u3)).redMul(a3), f3 = s3.redSqr().redISub(c3.redAdd(c3)), d2 = c3.redISub(f3), l2 = a3.redSqr(); l2 = (l2 = (l2 = l2.redIAdd(l2)).redIAdd(l2)).redIAdd(l2); var h2 = s3.redMul(d2).redISub(l2), p2 = r4.redAdd(r4).redMul(n3); return this.curve.jpoint(f3, h2, p2); }, f2.prototype.trpl = function() { if (!this.curve.zeroA) return this.dbl().add(this); var e4 = this.x.redSqr(), t4 = this.y.redSqr(), r4 = this.z.redSqr(), n3 = t4.redSqr(), i3 = e4.redAdd(e4).redIAdd(e4), o3 = i3.redSqr(), a3 = this.x.redAdd(t4).redSqr().redISub(e4).redISub(n3), s3 = (a3 = (a3 = (a3 = a3.redIAdd(a3)).redAdd(a3).redIAdd(a3)).redISub(o3)).redSqr(), u3 = n3.redIAdd(n3); u3 = (u3 = (u3 = u3.redIAdd(u3)).redIAdd(u3)).redIAdd(u3); var c3 = i3.redIAdd(a3).redSqr().redISub(o3).redISub(s3).redISub(u3), f3 = t4.redMul(c3); f3 = (f3 = f3.redIAdd(f3)).redIAdd(f3); var d2 = this.x.redMul(s3).redISub(f3); d2 = (d2 = d2.redIAdd(d2)).redIAdd(d2); var l2 = this.y.redMul(c3.redMul(u3.redISub(c3)).redISub(a3.redMul(s3))); l2 = (l2 = (l2 = l2.redIAdd(l2)).redIAdd(l2)).redIAdd(l2); var h2 = this.z.redAdd(a3).redSqr().redISub(r4).redISub(s3); return this.curve.jpoint(d2, l2, h2); }, f2.prototype.mul = function(e4, t4) { return e4 = new i2(e4, t4), this.curve._wnafMul(this, e4); }, f2.prototype.eq = function(e4) { if ("affine" === e4.type) return this.eq(e4.toJ()); if (this === e4) return true; var t4 = this.z.redSqr(), r4 = e4.z.redSqr(); if (0 !== this.x.redMul(r4).redISub(e4.x.redMul(t4)).cmpn(0)) return false; var n3 = t4.redMul(this.z), i3 = r4.redMul(e4.z); return 0 === this.y.redMul(i3).redISub(e4.y.redMul(n3)).cmpn(0); }, f2.prototype.eqXToP = function(e4) { var t4 = this.z.redSqr(), r4 = e4.toRed(this.curve.red).redMul(t4); if (0 === this.x.cmp(r4)) return true; for (var n3 = e4.clone(), i3 = this.curve.redN.redMul(t4); ; ) { if (n3.iadd(this.curve.n), n3.cmp(this.curve.p) >= 0) return false; if (r4.redIAdd(i3), 0 === this.x.cmp(r4)) return true; } }, f2.prototype.inspect = function() { return this.isInfinity() ? "" : ""; }, f2.prototype.isInfinity = function() { return 0 === this.z.cmpn(0); }; }, 40506: (e3, t3, r3) => { var n2, i2 = t3, o2 = r3(37198), a2 = r3(76063), s2 = r3(7528).assert; function u2(e4) { "short" === e4.type ? this.curve = new a2.short(e4) : "edwards" === e4.type ? this.curve = new a2.edwards(e4) : this.curve = new a2.mont(e4), this.g = this.curve.g, this.n = this.curve.n, this.hash = e4.hash, s2(this.g.validate(), "Invalid curve"), s2(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); } function c2(e4, t4) { Object.defineProperty(i2, e4, { configurable: true, enumerable: true, get: function() { var r4 = new u2(t4); return Object.defineProperty(i2, e4, { configurable: true, enumerable: true, value: r4 }), r4; } }); } i2.PresetCurve = u2, c2("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: o2.sha256, gRed: false, g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"] }), c2("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: o2.sha256, gRed: false, g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"] }), c2("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: o2.sha256, gRed: false, g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"] }), c2("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: o2.sha384, gRed: false, 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"] }), c2("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: o2.sha512, gRed: false, 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"] }), c2("curve25519", { type: "mont", prime: "p25519", p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", a: "76d06", b: "1", n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", hash: o2.sha256, gRed: false, g: ["9"] }), c2("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: o2.sha256, gRed: false, g: ["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", "6666666666666666666666666666666666666666666666666666666666666658"] }); try { n2 = r3(46401); } catch (e4) { n2 = void 0; } c2("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: o2.sha256, beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", basis: [{ a: "3086d221a7d46bcde86c90e49284eb15", b: "-e4437ed6010e88286f547fa90abfe4c3" }, { a: "114ca50f7a8e2f3f657c1108d9d44cfd8", b: "3086d221a7d46bcde86c90e49284eb15" }], gRed: false, g: ["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", n2] }); }, 28320: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(31734), o2 = r3(29410), a2 = r3(7528), s2 = r3(40506), u2 = r3(82202), c2 = a2.assert, f2 = r3(37791), d2 = r3(30488); function l2(e4) { if (!(this instanceof l2)) return new l2(e4); "string" == typeof e4 && (c2(Object.prototype.hasOwnProperty.call(s2, e4), "Unknown curve " + e4), e4 = s2[e4]), e4 instanceof s2.PresetCurve && (e4 = { curve: e4 }), this.curve = e4.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = e4.curve.g, this.g.precompute(e4.curve.n.bitLength() + 1), this.hash = e4.hash || e4.curve.hash; } e3.exports = l2, l2.prototype.keyPair = function(e4) { return new f2(this, e4); }, l2.prototype.keyFromPrivate = function(e4, t4) { return f2.fromPrivate(this, e4, t4); }, l2.prototype.keyFromPublic = function(e4, t4) { return f2.fromPublic(this, e4, t4); }, l2.prototype.genKeyPair = function(e4) { e4 || (e4 = {}); for (var t4 = new o2({ hash: this.hash, pers: e4.pers, persEnc: e4.persEnc || "utf8", entropy: e4.entropy || u2(this.hash.hmacStrength), entropyEnc: e4.entropy && e4.entropyEnc || "utf8", nonce: this.n.toArray() }), r4 = this.n.byteLength(), n3 = this.n.sub(new i2(2)); ; ) { var a3 = new i2(t4.generate(r4)); if (!(a3.cmp(n3) > 0)) return a3.iaddn(1), this.keyFromPrivate(a3); } }, l2.prototype._truncateToN = function(e4, t4) { var r4 = 8 * e4.byteLength() - this.n.bitLength(); return r4 > 0 && (e4 = e4.ushrn(r4)), !t4 && e4.cmp(this.n) >= 0 ? e4.sub(this.n) : e4; }, l2.prototype.sign = function(e4, t4, r4, a3) { "object" === (0, n2.default)(r4) && (a3 = r4, r4 = null), a3 || (a3 = {}), t4 = this.keyFromPrivate(t4, r4), e4 = this._truncateToN(new i2(e4, 16)); for (var s3 = this.n.byteLength(), u3 = t4.getPrivate().toArray("be", s3), c3 = e4.toArray("be", s3), f3 = new o2({ hash: this.hash, entropy: u3, nonce: c3, pers: a3.pers, persEnc: a3.persEnc || "utf8" }), l3 = this.n.sub(new i2(1)), h2 = 0; ; h2++) { var p2 = a3.k ? a3.k(h2) : new i2(f3.generate(this.n.byteLength())); if (!((p2 = this._truncateToN(p2, true)).cmpn(1) <= 0 || p2.cmp(l3) >= 0)) { var b2 = this.g.mul(p2); if (!b2.isInfinity()) { var y2 = b2.getX(), v2 = y2.umod(this.n); if (0 !== v2.cmpn(0)) { var m2 = p2.invm(this.n).mul(v2.mul(t4.getPrivate()).iadd(e4)); if (0 !== (m2 = m2.umod(this.n)).cmpn(0)) { var g2 = (b2.getY().isOdd() ? 1 : 0) | (0 !== y2.cmp(v2) ? 2 : 0); return a3.canonical && m2.cmp(this.nh) > 0 && (m2 = this.n.sub(m2), g2 ^= 1), new d2({ r: v2, s: m2, recoveryParam: g2 }); } } } } } }, l2.prototype.verify = function(e4, t4, r4, n3) { e4 = this._truncateToN(new i2(e4, 16)), r4 = this.keyFromPublic(r4, n3); var o3 = (t4 = new d2(t4, "hex")).r, a3 = t4.s; if (o3.cmpn(1) < 0 || o3.cmp(this.n) >= 0) return false; if (a3.cmpn(1) < 0 || a3.cmp(this.n) >= 0) return false; var s3, u3 = a3.invm(this.n), c3 = u3.mul(e4).umod(this.n), f3 = u3.mul(o3).umod(this.n); return this.curve._maxwellTrick ? !(s3 = this.g.jmulAdd(c3, r4.getPublic(), f3)).isInfinity() && s3.eqXToP(o3) : !(s3 = this.g.mulAdd(c3, r4.getPublic(), f3)).isInfinity() && 0 === s3.getX().umod(this.n).cmp(o3); }, l2.prototype.recoverPubKey = function(e4, t4, r4, n3) { c2((3 & r4) === r4, "The recovery param is more than two bits"), t4 = new d2(t4, n3); var o3 = this.n, a3 = new i2(e4), s3 = t4.r, u3 = t4.s, f3 = 1 & r4, l3 = r4 >> 1; if (s3.cmp(this.curve.p.umod(this.curve.n)) >= 0 && l3) throw new Error("Unable to find sencond key candinate"); s3 = l3 ? this.curve.pointFromX(s3.add(this.curve.n), f3) : this.curve.pointFromX(s3, f3); var h2 = t4.r.invm(o3), p2 = o3.sub(a3).mul(h2).umod(o3), b2 = u3.mul(h2).umod(o3); return this.g.mulAdd(p2, s3, b2); }, l2.prototype.getKeyRecoveryParam = function(e4, t4, r4, n3) { if (null !== (t4 = new d2(t4, n3)).recoveryParam) return t4.recoveryParam; for (var i3 = 0; i3 < 4; i3++) { var o3; try { o3 = this.recoverPubKey(e4, t4, i3); } catch (e5) { continue; } if (o3.eq(r4)) return i3; } throw new Error("Unable to find valid recovery factor"); }; }, 37791: (e3, t3, r3) => { var n2 = r3(31734), i2 = r3(7528).assert; function o2(e4, t4) { this.ec = e4, this.priv = null, this.pub = null, t4.priv && this._importPrivate(t4.priv, t4.privEnc), t4.pub && this._importPublic(t4.pub, t4.pubEnc); } e3.exports = o2, o2.fromPublic = function(e4, t4, r4) { return t4 instanceof o2 ? t4 : new o2(e4, { pub: t4, pubEnc: r4 }); }, o2.fromPrivate = function(e4, t4, r4) { return t4 instanceof o2 ? t4 : new o2(e4, { priv: t4, privEnc: r4 }); }, o2.prototype.validate = function() { var e4 = this.getPublic(); return e4.isInfinity() ? { result: false, reason: "Invalid public key" } : e4.validate() ? e4.mul(this.ec.curve.n).isInfinity() ? { result: true, reason: null } : { result: false, reason: "Public key * N != O" } : { result: false, reason: "Public key is not a point" }; }, o2.prototype.getPublic = function(e4, t4) { return "string" == typeof e4 && (t4 = e4, e4 = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), t4 ? this.pub.encode(t4, e4) : this.pub; }, o2.prototype.getPrivate = function(e4) { return "hex" === e4 ? this.priv.toString(16, 2) : this.priv; }, o2.prototype._importPrivate = function(e4, t4) { this.priv = new n2(e4, t4 || 16), this.priv = this.priv.umod(this.ec.curve.n); }, o2.prototype._importPublic = function(e4, t4) { if (e4.x || e4.y) return "mont" === this.ec.curve.type ? i2(e4.x, "Need x coordinate") : "short" !== this.ec.curve.type && "edwards" !== this.ec.curve.type || i2(e4.x && e4.y, "Need both x and y coordinate"), void (this.pub = this.ec.curve.point(e4.x, e4.y)); this.pub = this.ec.curve.decodePoint(e4, t4); }, o2.prototype.derive = function(e4) { return e4.validate() || i2(e4.validate(), "public point not validated"), e4.mul(this.priv).getX(); }, o2.prototype.sign = function(e4, t4, r4) { return this.ec.sign(e4, this, t4, r4); }, o2.prototype.verify = function(e4, t4) { return this.ec.verify(e4, t4, this); }, o2.prototype.inspect = function() { return ""; }; }, 30488: (e3, t3, r3) => { var n2 = r3(31734), i2 = r3(7528), o2 = i2.assert; function a2(e4, t4) { if (e4 instanceof a2) return e4; this._importDER(e4, t4) || (o2(e4.r && e4.s, "Signature without r or s"), this.r = new n2(e4.r, 16), this.s = new n2(e4.s, 16), void 0 === e4.recoveryParam ? this.recoveryParam = null : this.recoveryParam = e4.recoveryParam); } function s2() { this.place = 0; } function u2(e4, t4) { var r4 = e4[t4.place++]; if (!(128 & r4)) return r4; var n3 = 15 & r4; if (0 === n3 || n3 > 4) return false; for (var i3 = 0, o3 = 0, a3 = t4.place; o3 < n3; o3++, a3++) i3 <<= 8, i3 |= e4[a3], i3 >>>= 0; return !(i3 <= 127) && (t4.place = a3, i3); } function c2(e4) { for (var t4 = 0, r4 = e4.length - 1; !e4[t4] && !(128 & e4[t4 + 1]) && t4 < r4; ) t4++; return 0 === t4 ? e4 : e4.slice(t4); } function f2(e4, t4) { if (t4 < 128) e4.push(t4); else { var r4 = 1 + (Math.log(t4) / Math.LN2 >>> 3); for (e4.push(128 | r4); --r4; ) e4.push(t4 >>> (r4 << 3) & 255); e4.push(t4); } } e3.exports = a2, a2.prototype._importDER = function(e4, t4) { e4 = i2.toArray(e4, t4); var r4 = new s2(); if (48 !== e4[r4.place++]) return false; var o3 = u2(e4, r4); if (false === o3) return false; if (o3 + r4.place !== e4.length) return false; if (2 !== e4[r4.place++]) return false; var a3 = u2(e4, r4); if (false === a3) return false; var c3 = e4.slice(r4.place, a3 + r4.place); if (r4.place += a3, 2 !== e4[r4.place++]) return false; var f3 = u2(e4, r4); if (false === f3) return false; if (e4.length !== f3 + r4.place) return false; var d2 = e4.slice(r4.place, f3 + r4.place); if (0 === c3[0]) { if (!(128 & c3[1])) return false; c3 = c3.slice(1); } if (0 === d2[0]) { if (!(128 & d2[1])) return false; d2 = d2.slice(1); } return this.r = new n2(c3), this.s = new n2(d2), this.recoveryParam = null, true; }, a2.prototype.toDER = function(e4) { var t4 = this.r.toArray(), r4 = this.s.toArray(); for (128 & t4[0] && (t4 = [0].concat(t4)), 128 & r4[0] && (r4 = [0].concat(r4)), t4 = c2(t4), r4 = c2(r4); !(r4[0] || 128 & r4[1]); ) r4 = r4.slice(1); var n3 = [2]; f2(n3, t4.length), (n3 = n3.concat(t4)).push(2), f2(n3, r4.length); var o3 = n3.concat(r4), a3 = [48]; return f2(a3, o3.length), a3 = a3.concat(o3), i2.encode(a3, e4); }; }, 68027: (e3, t3, r3) => { var n2 = r3(37198), i2 = r3(40506), o2 = r3(7528), a2 = o2.assert, s2 = o2.parseBytes, u2 = r3(27303), c2 = r3(36646); function f2(e4) { if (a2("ed25519" === e4, "only tested with ed25519 so far"), !(this instanceof f2)) return new f2(e4); e4 = i2[e4].curve, this.curve = e4, this.g = e4.g, this.g.precompute(e4.n.bitLength() + 1), this.pointClass = e4.point().constructor, this.encodingLength = Math.ceil(e4.n.bitLength() / 8), this.hash = n2.sha512; } e3.exports = f2, f2.prototype.sign = function(e4, t4) { e4 = s2(e4); var r4 = this.keyFromSecret(t4), n3 = this.hashInt(r4.messagePrefix(), e4), i3 = this.g.mul(n3), o3 = this.encodePoint(i3), a3 = this.hashInt(o3, r4.pubBytes(), e4).mul(r4.priv()), u3 = n3.add(a3).umod(this.curve.n); return this.makeSignature({ R: i3, S: u3, Rencoded: o3 }); }, f2.prototype.verify = function(e4, t4, r4) { e4 = s2(e4), t4 = this.makeSignature(t4); var n3 = this.keyFromPublic(r4), i3 = this.hashInt(t4.Rencoded(), n3.pubBytes(), e4), o3 = this.g.mul(t4.S()); return t4.R().add(n3.pub().mul(i3)).eq(o3); }, f2.prototype.hashInt = function() { for (var e4 = this.hash(), t4 = 0; t4 < arguments.length; t4++) e4.update(arguments[t4]); return o2.intFromLE(e4.digest()).umod(this.curve.n); }, f2.prototype.keyFromPublic = function(e4) { return u2.fromPublic(this, e4); }, f2.prototype.keyFromSecret = function(e4) { return u2.fromSecret(this, e4); }, f2.prototype.makeSignature = function(e4) { return e4 instanceof c2 ? e4 : new c2(this, e4); }, f2.prototype.encodePoint = function(e4) { var t4 = e4.getY().toArray("le", this.encodingLength); return t4[this.encodingLength - 1] |= e4.getX().isOdd() ? 128 : 0, t4; }, f2.prototype.decodePoint = function(e4) { var t4 = (e4 = o2.parseBytes(e4)).length - 1, r4 = e4.slice(0, t4).concat(-129 & e4[t4]), n3 = 0 != (128 & e4[t4]), i3 = o2.intFromLE(r4); return this.curve.pointFromY(i3, n3); }, f2.prototype.encodeInt = function(e4) { return e4.toArray("le", this.encodingLength); }, f2.prototype.decodeInt = function(e4) { return o2.intFromLE(e4); }, f2.prototype.isPoint = function(e4) { return e4 instanceof this.pointClass; }; }, 27303: (e3, t3, r3) => { var n2 = r3(7528), i2 = n2.assert, o2 = n2.parseBytes, a2 = n2.cachedProperty; function s2(e4, t4) { this.eddsa = e4, this._secret = o2(t4.secret), e4.isPoint(t4.pub) ? this._pub = t4.pub : this._pubBytes = o2(t4.pub); } s2.fromPublic = function(e4, t4) { return t4 instanceof s2 ? t4 : new s2(e4, { pub: t4 }); }, s2.fromSecret = function(e4, t4) { return t4 instanceof s2 ? t4 : new s2(e4, { secret: t4 }); }, s2.prototype.secret = function() { return this._secret; }, a2(s2, "pubBytes", function() { return this.eddsa.encodePoint(this.pub()); }), a2(s2, "pub", function() { return this._pubBytes ? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv()); }), a2(s2, "privBytes", function() { var e4 = this.eddsa, t4 = this.hash(), r4 = e4.encodingLength - 1, n3 = t4.slice(0, e4.encodingLength); return n3[0] &= 248, n3[r4] &= 127, n3[r4] |= 64, n3; }), a2(s2, "priv", function() { return this.eddsa.decodeInt(this.privBytes()); }), a2(s2, "hash", function() { return this.eddsa.hash().update(this.secret()).digest(); }), a2(s2, "messagePrefix", function() { return this.hash().slice(this.eddsa.encodingLength); }), s2.prototype.sign = function(e4) { return i2(this._secret, "KeyPair can only verify"), this.eddsa.sign(e4, this); }, s2.prototype.verify = function(e4, t4) { return this.eddsa.verify(e4, t4, this); }, s2.prototype.getSecret = function(e4) { return i2(this._secret, "KeyPair is public only"), n2.encode(this.secret(), e4); }, s2.prototype.getPublic = function(e4) { return n2.encode(this.pubBytes(), e4); }, e3.exports = s2; }, 36646: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(31734), o2 = r3(7528), a2 = o2.assert, s2 = o2.cachedProperty, u2 = o2.parseBytes; function c2(e4, t4) { this.eddsa = e4, "object" !== (0, n2.default)(t4) && (t4 = u2(t4)), Array.isArray(t4) && (t4 = { R: t4.slice(0, e4.encodingLength), S: t4.slice(e4.encodingLength) }), a2(t4.R && t4.S, "Signature without R or S"), e4.isPoint(t4.R) && (this._R = t4.R), t4.S instanceof i2 && (this._S = t4.S), this._Rencoded = Array.isArray(t4.R) ? t4.R : t4.Rencoded, this._Sencoded = Array.isArray(t4.S) ? t4.S : t4.Sencoded; } s2(c2, "S", function() { return this.eddsa.decodeInt(this.Sencoded()); }), s2(c2, "R", function() { return this.eddsa.decodePoint(this.Rencoded()); }), s2(c2, "Rencoded", function() { return this.eddsa.encodePoint(this.R()); }), s2(c2, "Sencoded", function() { return this.eddsa.encodeInt(this.S()); }), c2.prototype.toBytes = function() { return this.Rencoded().concat(this.Sencoded()); }, c2.prototype.toHex = function() { return o2.encode(this.toBytes(), "hex").toUpperCase(); }, e3.exports = c2; }, 46401: (e3) => { e3.exports = { 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"]] } }; }, 7528: (e3, t3, r3) => { var n2 = t3, i2 = r3(31734), o2 = r3(94504), a2 = r3(96580); n2.assert = o2, n2.toArray = a2.toArray, n2.zero2 = a2.zero2, n2.toHex = a2.toHex, n2.encode = a2.encode, n2.getNAF = function(e4, t4, r4) { var n3 = new Array(Math.max(e4.bitLength(), r4) + 1); n3.fill(0); for (var i3 = 1 << t4 + 1, o3 = e4.clone(), a3 = 0; a3 < n3.length; a3++) { var s2, u2 = o3.andln(i3 - 1); o3.isOdd() ? (s2 = u2 > (i3 >> 1) - 1 ? (i3 >> 1) - u2 : u2, o3.isubn(s2)) : s2 = 0, n3[a3] = s2, o3.iushrn(1); } return n3; }, n2.getJSF = function(e4, t4) { var r4 = [[], []]; e4 = e4.clone(), t4 = t4.clone(); for (var n3, i3 = 0, o3 = 0; e4.cmpn(-i3) > 0 || t4.cmpn(-o3) > 0; ) { var a3, s2, u2 = e4.andln(3) + i3 & 3, c2 = t4.andln(3) + o3 & 3; 3 === u2 && (u2 = -1), 3 === c2 && (c2 = -1), a3 = 0 == (1 & u2) ? 0 : 3 != (n3 = e4.andln(7) + i3 & 7) && 5 !== n3 || 2 !== c2 ? u2 : -u2, r4[0].push(a3), s2 = 0 == (1 & c2) ? 0 : 3 != (n3 = t4.andln(7) + o3 & 7) && 5 !== n3 || 2 !== u2 ? c2 : -c2, r4[1].push(s2), 2 * i3 === a3 + 1 && (i3 = 1 - i3), 2 * o3 === s2 + 1 && (o3 = 1 - o3), e4.iushrn(1), t4.iushrn(1); } return r4; }, n2.cachedProperty = function(e4, t4, r4) { var n3 = "_" + t4; e4.prototype[t4] = function() { return void 0 !== this[n3] ? this[n3] : this[n3] = r4.call(this); }; }, n2.parseBytes = function(e4) { return "string" == typeof e4 ? n2.toArray(e4, "hex") : e4; }, n2.intFromLE = function(e4) { return new i2(e4, "hex", "le"); }; }, 26464: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = function() { if ("object" === ("undefined" == typeof self ? "undefined" : (0, n2.default)(self)) && self) return self; if ("object" === ("undefined" == typeof window ? "undefined" : (0, n2.default)(window)) && window) return window; throw new Error("Unable to resolve global `this`"); }; e3.exports = function() { if (this) return this; if ("object" === ("undefined" == typeof globalThis ? "undefined" : (0, n2.default)(globalThis)) && globalThis) return globalThis; try { Object.defineProperty(Object.prototype, "__global__", { get: function() { return this; }, configurable: true }); } catch (e4) { return i2(); } try { return __global__ || i2(); } finally { delete Object.prototype.__global__; } }(); }, 54258: (e3, t3, r3) => { var n2, i2, o2, a2 = r3(19142), s2 = r3(28847)(r3(3355)); o2 = function() { function e4(e5) { return "function" == typeof e5; } var t4 = Array.isArray ? Array.isArray : function(e5) { return "[object Array]" === Object.prototype.toString.call(e5); }, n3 = 0, i3 = void 0, o3 = void 0, u2 = function(e5, t5) { b2[n3] = e5, b2[n3 + 1] = t5, 2 === (n3 += 2) && (o3 ? o3(y2) : k2()); }, c2 = "undefined" != typeof window ? window : void 0, f2 = c2 || {}, d2 = f2.MutationObserver || f2.WebKitMutationObserver, l2 = "undefined" == typeof self && void 0 !== a2 && "[object process]" === {}.toString.call(a2), h2 = "undefined" != typeof Uint8ClampedArray && "undefined" != typeof importScripts && "undefined" != typeof MessageChannel; function p2() { var e5 = setTimeout; return function() { return e5(y2, 1); }; } var b2 = new Array(1e3); function y2() { for (var e5 = 0; e5 < n3; e5 += 2) (0, b2[e5])(b2[e5 + 1]), b2[e5] = void 0, b2[e5 + 1] = void 0; n3 = 0; } var v2, m2, g2, w2, k2 = void 0; function _2(e5, t5) { var r4 = this, n4 = new this.constructor(S2); void 0 === n4[E2] && L2(n4); var i4 = r4._state; if (i4) { var o4 = arguments[i4 - 1]; u2(function() { return N2(i4, n4, o4, r4._result); }); } else R2(r4, n4, e5, t5); return n4; } function A2(e5) { if (e5 && "object" === (0, s2.default)(e5) && e5.constructor === this) return e5; var t5 = new this(S2); return I2(t5, e5), t5; } l2 ? k2 = function() { return a2.nextTick(y2); } : d2 ? (m2 = 0, g2 = new d2(y2), w2 = document.createTextNode(""), g2.observe(w2, { characterData: true }), k2 = function() { w2.data = m2 = ++m2 % 2; }) : h2 ? ((v2 = new MessageChannel()).port1.onmessage = y2, k2 = function() { return v2.port2.postMessage(0); }) : k2 = void 0 === c2 ? function() { try { var e5 = Function("return this")().require("vertx"); return void 0 !== (i3 = e5.runOnLoop || e5.runOnContext) ? function() { i3(y2); } : p2(); } catch (e6) { return p2(); } }() : p2(); var E2 = Math.random().toString(36).substring(2); function S2() { } var x2 = void 0, B2 = 1, O2 = 2; function P2(t5, r4, n4) { r4.constructor === t5.constructor && n4 === _2 && r4.constructor.resolve === A2 ? function(e5, t6) { t6._state === B2 ? C2(e5, t6._result) : t6._state === O2 ? M2(e5, t6._result) : R2(t6, void 0, function(t7) { return I2(e5, t7); }, function(t7) { return M2(e5, t7); }); }(t5, r4) : void 0 === n4 ? C2(t5, r4) : e4(n4) ? function(e5, t6, r5) { u2(function(e6) { var n5 = false, i4 = function(r6, i5, o4, a3) { try { r6.call(i5, function(r7) { n5 || (n5 = true, t6 !== r7 ? I2(e6, r7) : C2(e6, r7)); }, function(t7) { n5 || (n5 = true, M2(e6, t7)); }); } catch (e7) { return e7; } }(r5, t6, 0, 0, e6._label); !n5 && i4 && (n5 = true, M2(e6, i4)); }, e5); }(t5, r4, n4) : C2(t5, r4); } function I2(e5, t5) { if (e5 === t5) M2(e5, new TypeError("You cannot resolve a promise with itself")); else if (n4 = t5, i4 = (0, s2.default)(n4), null === n4 || "object" !== i4 && "function" !== i4) C2(e5, t5); else { var r4 = void 0; try { r4 = t5.then; } catch (t6) { return void M2(e5, t6); } P2(e5, t5, r4); } var n4, i4; } function T2(e5) { e5._onerror && e5._onerror(e5._result), U2(e5); } function C2(e5, t5) { e5._state === x2 && (e5._result = t5, e5._state = B2, 0 !== e5._subscribers.length && u2(U2, e5)); } function M2(e5, t5) { e5._state === x2 && (e5._state = O2, e5._result = t5, u2(T2, e5)); } function R2(e5, t5, r4, n4) { var i4 = e5._subscribers, o4 = i4.length; e5._onerror = null, i4[o4] = t5, i4[o4 + B2] = r4, i4[o4 + O2] = n4, 0 === o4 && e5._state && u2(U2, e5); } function U2(e5) { var t5 = e5._subscribers, r4 = e5._state; if (0 !== t5.length) { for (var n4 = void 0, i4 = void 0, o4 = e5._result, a3 = 0; a3 < t5.length; a3 += 3) n4 = t5[a3], i4 = t5[a3 + r4], n4 ? N2(r4, n4, i4, o4) : i4(o4); e5._subscribers.length = 0; } } function N2(t5, r4, n4, i4) { var o4 = e4(n4), a3 = void 0, s3 = void 0, u3 = true; if (o4) { try { a3 = n4(i4); } catch (e5) { u3 = false, s3 = e5; } if (r4 === a3) return void M2(r4, new TypeError("A promises callback cannot return that same promise.")); } else a3 = i4; r4._state !== x2 || (o4 && u3 ? I2(r4, a3) : false === u3 ? M2(r4, s3) : t5 === B2 ? C2(r4, a3) : t5 === O2 && M2(r4, a3)); } var j2 = 0; function L2(e5) { e5[E2] = j2++, e5._state = void 0, e5._result = void 0, e5._subscribers = []; } var F2 = function() { function e5(e6, r4) { this._instanceConstructor = e6, this.promise = new e6(S2), this.promise[E2] || L2(this.promise), t4(r4) ? (this.length = r4.length, this._remaining = r4.length, this._result = new Array(this.length), 0 === this.length ? C2(this.promise, this._result) : (this.length = this.length || 0, this._enumerate(r4), 0 === this._remaining && C2(this.promise, this._result))) : M2(this.promise, new Error("Array Methods must be provided an Array")); } return e5.prototype._enumerate = function(e6) { for (var t5 = 0; this._state === x2 && t5 < e6.length; t5++) this._eachEntry(e6[t5], t5); }, e5.prototype._eachEntry = function(e6, t5) { var r4 = this._instanceConstructor, n4 = r4.resolve; if (n4 === A2) { var i4 = void 0, o4 = void 0, a3 = false; try { i4 = e6.then; } catch (e7) { a3 = true, o4 = e7; } if (i4 === _2 && e6._state !== x2) this._settledAt(e6._state, t5, e6._result); else if ("function" != typeof i4) this._remaining--, this._result[t5] = e6; else if (r4 === D2) { var s3 = new r4(S2); a3 ? M2(s3, o4) : P2(s3, e6, i4), this._willSettleAt(s3, t5); } else this._willSettleAt(new r4(function(t6) { return t6(e6); }), t5); } else this._willSettleAt(n4(e6), t5); }, e5.prototype._settledAt = function(e6, t5, r4) { var n4 = this.promise; n4._state === x2 && (this._remaining--, e6 === O2 ? M2(n4, r4) : this._result[t5] = r4), 0 === this._remaining && C2(n4, this._result); }, e5.prototype._willSettleAt = function(e6, t5) { var r4 = this; R2(e6, void 0, function(e7) { return r4._settledAt(B2, t5, e7); }, function(e7) { return r4._settledAt(O2, t5, e7); }); }, e5; }(), D2 = function() { function t5(e5) { this[E2] = j2++, this._result = this._state = void 0, this._subscribers = [], S2 !== e5 && ("function" != typeof e5 && function() { throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); }(), this instanceof t5 ? function(e6, t6) { try { t6(function(t7) { I2(e6, t7); }, function(t7) { M2(e6, t7); }); } catch (t7) { M2(e6, t7); } }(this, e5) : function() { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); }()); } return t5.prototype.catch = function(e5) { return this.then(null, e5); }, t5.prototype.finally = function(t6) { var r4 = this, n4 = r4.constructor; return e4(t6) ? r4.then(function(e5) { return n4.resolve(t6()).then(function() { return e5; }); }, function(e5) { return n4.resolve(t6()).then(function() { throw e5; }); }) : r4.then(t6, t6); }, t5; }(); return D2.prototype.then = _2, D2.all = function(e5) { return new F2(this, e5).promise; }, D2.race = function(e5) { var r4 = this; return t4(e5) ? new r4(function(t5, n4) { for (var i4 = e5.length, o4 = 0; o4 < i4; o4++) r4.resolve(e5[o4]).then(t5, n4); }) : new r4(function(e6, t5) { return t5(new TypeError("You must pass an array to race.")); }); }, D2.resolve = A2, D2.reject = function(e5) { var t5 = new this(S2); return M2(t5, e5), t5; }, D2._setScheduler = function(e5) { o3 = e5; }, D2._setAsap = function(e5) { u2 = e5; }, D2._asap = u2, D2.polyfill = function() { var e5 = void 0; if (void 0 !== r3.g) e5 = r3.g; else if ("undefined" != typeof self) e5 = self; else try { e5 = Function("return this")(); } catch (e6) { throw new Error("polyfill failed because global object is unavailable in this environment"); } var t5 = e5.Promise; if (t5) { var n4 = null; try { n4 = Object.prototype.toString.call(t5.resolve()); } catch (e6) { } if ("[object Promise]" === n4 && !t5.cast) return; } e5.Promise = D2; }, D2.Promise = D2, D2; }, "object" === (0, s2.default)(t3) ? e3.exports = o2() : void 0 === (i2 = "function" == typeof (n2 = o2) ? n2.call(t3, r3, t3, e3) : n2) || (e3.exports = i2); }, 21006: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(24858).keccak_256, o2 = r3(3956); function a2(e4) { return e4 ? o2.toUnicode(e4, { useStd3ASCII: true, transitional: false }) : e4; } t3.hash = function(e4) { for (var t4 = "", r4 = 0; r4 < 32; r4++) t4 += "00"; if (name = a2(e4), name) { var o3 = name.split("."); for (r4 = o3.length - 1; r4 >= 0; r4--) { var s2 = i2(o3[r4]); t4 = i2(new n2(t4 + s2, "hex")); } } return "0x" + t4; }, t3.normalize = a2; }, 53058: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(28847)(r3(74519)), o2 = r3(58320), a2 = r3(88645), s2 = r3(36597), u2 = (r3(46740), new s2.ec("secp256k1")), c2 = r3(22922), f2 = c2.keccak256, d2 = c2.keccak256s, l2 = function(e4) { for (var t4 = d2(e4.slice(2)), r4 = "0x", n3 = 0; n3 < 40; n3++) r4 += parseInt(t4[n3 + 2], 16) > 7 ? e4[n3 + 2].toUpperCase() : e4[n3 + 2]; return r4; }, h2 = function(e4) { var t4 = new n2(e4.slice(2), "hex"), r4 = "0x" + u2.keyFromPrivate(t4).getPublic(false, "hex").slice(2), i3 = f2(r4); return { address: l2("0x" + i3.slice(-40)), privateKey: e4 }; }, p2 = function(e4) { var t4 = (0, i2.default)(e4, 3), r4 = t4[0], n3 = t4[1], a3 = t4[2]; return o2.flatten([n3, a3, r4]); }, b2 = function(e4) { return [o2.slice(64, o2.length(e4), e4), o2.slice(0, 32, e4), o2.slice(32, 64, e4)]; }, y2 = function(e4) { return function(t4, r4) { var i3 = u2.keyFromPrivate(new n2(r4.slice(2), "hex")).sign(new n2(t4.slice(2), "hex"), { canonical: true }); return p2([a2.fromString(o2.fromNumber(e4 + i3.recoveryParam)), o2.pad(32, o2.fromNat("0x" + i3.r.toString(16))), o2.pad(32, o2.fromNat("0x" + i3.s.toString(16)))]); }; }, v2 = y2(27); e3.exports = { create: function(e4) { var t4 = f2(o2.concat(o2.random(32), e4 || o2.random(32))), r4 = o2.concat(o2.concat(o2.random(32), t4), o2.random(32)), n3 = f2(r4); return h2(n3); }, toChecksum: l2, fromPrivate: h2, sign: v2, makeSigner: y2, recover: function(e4, t4) { var r4 = b2(t4), i3 = { v: o2.toNumber(r4[0]), r: r4[1].slice(2), s: r4[2].slice(2) }, a3 = "0x" + u2.recoverPubKey(new n2(e4.slice(2), "hex"), i3, i3.v < 2 ? i3.v : 1 - i3.v % 2).encode("hex", false).slice(2), s3 = f2(a3); return l2("0x" + s3.slice(-40)); }, encodeSignature: p2, decodeSignature: b2 }; }, 51376: (e3) => { var t3 = function(e4, t4) { for (var r3 = [], n2 = 0; n2 < e4; ++n2) r3.push(t4(n2)); return r3; }; e3.exports = { generate: t3, replicate: function(e4, r3) { return t3(e4, function() { return r3; }); }, concat: function(e4, t4) { return e4.concat(t4); }, flatten: function(e4) { for (var t4 = [], r3 = 0, n2 = e4.length; r3 < n2; ++r3) for (var i2 = 0, o2 = e4[r3].length; i2 < o2; ++i2) t4.push(e4[r3][i2]); return t4; }, chunksOf: function(e4, t4) { for (var r3 = [], n2 = 0, i2 = t4.length; n2 < i2; n2 += e4) r3.push(t4.slice(n2, n2 + e4)); return r3; } }; }, 58320: (e3, t3, r3) => { r3(51376); var n2 = function(e4, t4) { return parseInt(e4.slice(2 * t4 + 2, 2 * t4 + 4), 16); }, i2 = function(e4) { return (e4.length - 2) / 2; }, o2 = function(e4) { for (var t4 = [], r4 = 2, n3 = e4.length; r4 < n3; r4 += 2) t4.push(parseInt(e4.slice(r4, r4 + 2), 16)); return t4; }, a2 = function(e4) { for (var t4 = "0x", r4 = 0, n3 = e4.length; r4 < n3; ++r4) { var i3 = e4[r4]; t4 += (i3 < 16 ? "0" : "") + i3.toString(16); } return t4; }; e3.exports = { random: function(e4) { var t4; t4 = "undefined" != typeof window && window.crypto && window.crypto.getRandomValues ? window.crypto.getRandomValues(new Uint8Array(e4)) : r3(24293).randomBytes(e4); for (var n3 = "0x", i3 = 0; i3 < e4; ++i3) n3 += ("00" + t4[i3].toString(16)).slice(-2); return n3; }, length: i2, concat: function(e4, t4) { return e4.concat(t4.slice(2)); }, flatten: function(e4) { return "0x" + e4.reduce(function(e5, t4) { return e5 + t4.slice(2); }, ""); }, slice: function(e4, t4, r4) { return "0x" + r4.slice(2 * e4 + 2, 2 * t4 + 2); }, reverse: function(e4) { for (var t4 = "0x", r4 = 0, n3 = i2(e4); r4 < n3; ++r4) t4 += e4.slice(2 * (n3 - r4), 2 * (n3 - r4 + 1)); return t4; }, pad: function e4(t4, r4) { return r4.length === 2 * t4 + 2 ? r4 : e4(t4, "0x0" + r4.slice(2)); }, padRight: function e4(t4, r4) { return r4.length === 2 * t4 + 2 ? r4 : e4(t4, r4 + "0"); }, fromAscii: function(e4) { for (var t4 = "0x", r4 = 0; r4 < e4.length; ++r4) t4 += ("00" + e4.charCodeAt(r4).toString(16)).slice(-2); return t4; }, toAscii: function(e4) { for (var t4 = "", r4 = 2; r4 < e4.length; r4 += 2) t4 += String.fromCharCode(parseInt(e4.slice(r4, r4 + 2), 16)); return t4; }, fromString: function(e4) { for (var t4 = function(e5) { var t5 = e5.toString(16); return t5.length < 2 ? "0" + t5 : t5; }, r4 = "0x", n3 = 0; n3 != e4.length; n3++) { var i3 = e4.charCodeAt(n3); if (i3 < 128) r4 += t4(i3); else { if (i3 < 2048) r4 += t4(i3 >> 6 | 192); else { if (i3 > 55295 && i3 < 56320) { if (++n3 == e4.length) return null; var o3 = e4.charCodeAt(n3); if (o3 < 56320 || o3 > 57343) return null; r4 += t4((i3 = 65536 + ((1023 & i3) << 10) + (1023 & o3)) >> 18 | 240), r4 += t4(i3 >> 12 & 63 | 128); } else r4 += t4(i3 >> 12 | 224); r4 += t4(i3 >> 6 & 63 | 128); } r4 += t4(63 & i3 | 128); } } return r4; }, toString: function(e4) { for (var t4 = "", r4 = 0, o3 = i2(e4); r4 < o3; ) { var a3 = n2(e4, r4++); if (a3 > 127) { if (a3 > 191 && a3 < 224) { if (r4 >= o3) return null; a3 = (31 & a3) << 6 | 63 & n2(e4, r4); } else if (a3 > 223 && a3 < 240) { if (r4 + 1 >= o3) return null; a3 = (15 & a3) << 12 | (63 & n2(e4, r4)) << 6 | 63 & n2(e4, ++r4); } else { if (!(a3 > 239 && a3 < 248)) return null; if (r4 + 2 >= o3) return null; a3 = (7 & a3) << 18 | (63 & n2(e4, r4)) << 12 | (63 & n2(e4, ++r4)) << 6 | 63 & n2(e4, ++r4); } ++r4; } if (a3 <= 65535) t4 += String.fromCharCode(a3); else { if (!(a3 <= 1114111)) return null; a3 -= 65536, t4 += String.fromCharCode(a3 >> 10 | 55296), t4 += String.fromCharCode(1023 & a3 | 56320); } } return t4; }, fromNumber: function(e4) { var t4 = e4.toString(16); return t4.length % 2 == 0 ? "0x" + t4 : "0x0" + t4; }, toNumber: function(e4) { return parseInt(e4.slice(2), 16); }, fromNat: function(e4) { return "0x0" === e4 ? "0x" : e4.length % 2 == 0 ? e4 : "0x0" + e4.slice(2); }, toNat: function(e4) { return "0" === e4[2] ? "0x" + e4.slice(3) : e4; }, fromArray: a2, toArray: o2, fromUint8Array: function(e4) { return a2([].slice.call(e4, 0)); }, toUint8Array: function(e4) { return new Uint8Array(o2(e4)); } }; }, 22922: (e3) => { var t3 = "0123456789abcdef".split(""), r3 = [1, 256, 65536, 16777216], n2 = [0, 8, 16, 24], i2 = [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], o2 = function(e4) { var t4, r4, n3, o3, a3, s2, u2, c2, f2, d2, l2, h2, p2, b2, y2, v2, m2, g2, w2, k2, _2, A2, E2, S2, x2, B2, O2, P2, I2, T2, C2, M2, R2, U2, N2, j2, L2, F2, D2, H2, z2, q2, K2, G2, V2, Z2, W2, J2, Y2, X2, Q2, $2, ee2, te2, re2, ne2, ie2, oe2, ae2, se2, ue2, ce2, fe2; for (n3 = 0; n3 < 48; n3 += 2) o3 = e4[0] ^ e4[10] ^ e4[20] ^ e4[30] ^ e4[40], a3 = e4[1] ^ e4[11] ^ e4[21] ^ e4[31] ^ e4[41], s2 = e4[2] ^ e4[12] ^ e4[22] ^ e4[32] ^ e4[42], u2 = e4[3] ^ e4[13] ^ e4[23] ^ e4[33] ^ e4[43], c2 = e4[4] ^ e4[14] ^ e4[24] ^ e4[34] ^ e4[44], f2 = e4[5] ^ e4[15] ^ e4[25] ^ e4[35] ^ e4[45], d2 = e4[6] ^ e4[16] ^ e4[26] ^ e4[36] ^ e4[46], l2 = e4[7] ^ e4[17] ^ e4[27] ^ e4[37] ^ e4[47], t4 = (h2 = e4[8] ^ e4[18] ^ e4[28] ^ e4[38] ^ e4[48]) ^ (s2 << 1 | u2 >>> 31), r4 = (p2 = e4[9] ^ e4[19] ^ e4[29] ^ e4[39] ^ e4[49]) ^ (u2 << 1 | s2 >>> 31), e4[0] ^= t4, e4[1] ^= r4, e4[10] ^= t4, e4[11] ^= r4, e4[20] ^= t4, e4[21] ^= r4, e4[30] ^= t4, e4[31] ^= r4, e4[40] ^= t4, e4[41] ^= r4, t4 = o3 ^ (c2 << 1 | f2 >>> 31), r4 = a3 ^ (f2 << 1 | c2 >>> 31), e4[2] ^= t4, e4[3] ^= r4, e4[12] ^= t4, e4[13] ^= r4, e4[22] ^= t4, e4[23] ^= r4, e4[32] ^= t4, e4[33] ^= r4, e4[42] ^= t4, e4[43] ^= r4, t4 = s2 ^ (d2 << 1 | l2 >>> 31), r4 = u2 ^ (l2 << 1 | d2 >>> 31), e4[4] ^= t4, e4[5] ^= r4, e4[14] ^= t4, e4[15] ^= r4, e4[24] ^= t4, e4[25] ^= r4, e4[34] ^= t4, e4[35] ^= r4, e4[44] ^= t4, e4[45] ^= r4, t4 = c2 ^ (h2 << 1 | p2 >>> 31), r4 = f2 ^ (p2 << 1 | h2 >>> 31), e4[6] ^= t4, e4[7] ^= r4, e4[16] ^= t4, e4[17] ^= r4, e4[26] ^= t4, e4[27] ^= r4, e4[36] ^= t4, e4[37] ^= r4, e4[46] ^= t4, e4[47] ^= r4, t4 = d2 ^ (o3 << 1 | a3 >>> 31), r4 = l2 ^ (a3 << 1 | o3 >>> 31), e4[8] ^= t4, e4[9] ^= r4, e4[18] ^= t4, e4[19] ^= r4, e4[28] ^= t4, e4[29] ^= r4, e4[38] ^= t4, e4[39] ^= r4, e4[48] ^= t4, e4[49] ^= r4, b2 = e4[0], y2 = e4[1], Z2 = e4[11] << 4 | e4[10] >>> 28, W2 = e4[10] << 4 | e4[11] >>> 28, P2 = e4[20] << 3 | e4[21] >>> 29, I2 = e4[21] << 3 | e4[20] >>> 29, se2 = e4[31] << 9 | e4[30] >>> 23, ue2 = e4[30] << 9 | e4[31] >>> 23, q2 = e4[40] << 18 | e4[41] >>> 14, K2 = e4[41] << 18 | e4[40] >>> 14, U2 = e4[2] << 1 | e4[3] >>> 31, N2 = e4[3] << 1 | e4[2] >>> 31, v2 = e4[13] << 12 | e4[12] >>> 20, m2 = e4[12] << 12 | e4[13] >>> 20, J2 = e4[22] << 10 | e4[23] >>> 22, Y2 = e4[23] << 10 | e4[22] >>> 22, T2 = e4[33] << 13 | e4[32] >>> 19, C2 = e4[32] << 13 | e4[33] >>> 19, ce2 = e4[42] << 2 | e4[43] >>> 30, fe2 = e4[43] << 2 | e4[42] >>> 30, te2 = e4[5] << 30 | e4[4] >>> 2, re2 = e4[4] << 30 | e4[5] >>> 2, j2 = e4[14] << 6 | e4[15] >>> 26, L2 = e4[15] << 6 | e4[14] >>> 26, g2 = e4[25] << 11 | e4[24] >>> 21, w2 = e4[24] << 11 | e4[25] >>> 21, X2 = e4[34] << 15 | e4[35] >>> 17, Q2 = e4[35] << 15 | e4[34] >>> 17, M2 = e4[45] << 29 | e4[44] >>> 3, R2 = e4[44] << 29 | e4[45] >>> 3, S2 = e4[6] << 28 | e4[7] >>> 4, x2 = e4[7] << 28 | e4[6] >>> 4, ne2 = e4[17] << 23 | e4[16] >>> 9, ie2 = e4[16] << 23 | e4[17] >>> 9, F2 = e4[26] << 25 | e4[27] >>> 7, D2 = e4[27] << 25 | e4[26] >>> 7, k2 = e4[36] << 21 | e4[37] >>> 11, _2 = e4[37] << 21 | e4[36] >>> 11, $2 = e4[47] << 24 | e4[46] >>> 8, ee2 = e4[46] << 24 | e4[47] >>> 8, G2 = e4[8] << 27 | e4[9] >>> 5, V2 = e4[9] << 27 | e4[8] >>> 5, B2 = e4[18] << 20 | e4[19] >>> 12, O2 = e4[19] << 20 | e4[18] >>> 12, oe2 = e4[29] << 7 | e4[28] >>> 25, ae2 = e4[28] << 7 | e4[29] >>> 25, H2 = e4[38] << 8 | e4[39] >>> 24, z2 = e4[39] << 8 | e4[38] >>> 24, A2 = e4[48] << 14 | e4[49] >>> 18, E2 = e4[49] << 14 | e4[48] >>> 18, e4[0] = b2 ^ ~v2 & g2, e4[1] = y2 ^ ~m2 & w2, e4[10] = S2 ^ ~B2 & P2, e4[11] = x2 ^ ~O2 & I2, e4[20] = U2 ^ ~j2 & F2, e4[21] = N2 ^ ~L2 & D2, e4[30] = G2 ^ ~Z2 & J2, e4[31] = V2 ^ ~W2 & Y2, e4[40] = te2 ^ ~ne2 & oe2, e4[41] = re2 ^ ~ie2 & ae2, e4[2] = v2 ^ ~g2 & k2, e4[3] = m2 ^ ~w2 & _2, e4[12] = B2 ^ ~P2 & T2, e4[13] = O2 ^ ~I2 & C2, e4[22] = j2 ^ ~F2 & H2, e4[23] = L2 ^ ~D2 & z2, e4[32] = Z2 ^ ~J2 & X2, e4[33] = W2 ^ ~Y2 & Q2, e4[42] = ne2 ^ ~oe2 & se2, e4[43] = ie2 ^ ~ae2 & ue2, e4[4] = g2 ^ ~k2 & A2, e4[5] = w2 ^ ~_2 & E2, e4[14] = P2 ^ ~T2 & M2, e4[15] = I2 ^ ~C2 & R2, e4[24] = F2 ^ ~H2 & q2, e4[25] = D2 ^ ~z2 & K2, e4[34] = J2 ^ ~X2 & $2, e4[35] = Y2 ^ ~Q2 & ee2, e4[44] = oe2 ^ ~se2 & ce2, e4[45] = ae2 ^ ~ue2 & fe2, e4[6] = k2 ^ ~A2 & b2, e4[7] = _2 ^ ~E2 & y2, e4[16] = T2 ^ ~M2 & S2, e4[17] = C2 ^ ~R2 & x2, e4[26] = H2 ^ ~q2 & U2, e4[27] = z2 ^ ~K2 & N2, e4[36] = X2 ^ ~$2 & G2, e4[37] = Q2 ^ ~ee2 & V2, e4[46] = se2 ^ ~ce2 & te2, e4[47] = ue2 ^ ~fe2 & re2, e4[8] = A2 ^ ~b2 & v2, e4[9] = E2 ^ ~y2 & m2, e4[18] = M2 ^ ~S2 & B2, e4[19] = R2 ^ ~x2 & O2, e4[28] = q2 ^ ~U2 & j2, e4[29] = K2 ^ ~N2 & L2, e4[38] = $2 ^ ~G2 & Z2, e4[39] = ee2 ^ ~V2 & W2, e4[48] = ce2 ^ ~te2 & ne2, e4[49] = fe2 ^ ~re2 & ie2, e4[0] ^= i2[n3], e4[1] ^= i2[n3 + 1]; }, a2 = function(e4) { return function(i3) { var a3; if ("0x" === i3.slice(0, 2)) { a3 = []; for (var s2 = 2, u2 = i3.length; s2 < u2; s2 += 2) a3.push(parseInt(i3.slice(s2, s2 + 2), 16)); } else a3 = i3; return function(e5, i4) { for (var a4, s3 = i4.length, u3 = e5.blocks, c2 = e5.blockCount << 2, f2 = e5.blockCount, d2 = e5.outputBlocks, l2 = e5.s, h2 = 0; h2 < s3; ) { if (e5.reset) for (e5.reset = false, u3[0] = e5.block, y2 = 1; y2 < f2 + 1; ++y2) u3[y2] = 0; if ("string" != typeof i4) for (y2 = e5.start; h2 < s3 && y2 < c2; ++h2) u3[y2 >> 2] |= i4[h2] << n2[3 & y2++]; else for (y2 = e5.start; h2 < s3 && y2 < c2; ++h2) (a4 = i4.charCodeAt(h2)) < 128 ? u3[y2 >> 2] |= a4 << n2[3 & y2++] : a4 < 2048 ? (u3[y2 >> 2] |= (192 | a4 >> 6) << n2[3 & y2++], u3[y2 >> 2] |= (128 | 63 & a4) << n2[3 & y2++]) : a4 < 55296 || a4 >= 57344 ? (u3[y2 >> 2] |= (224 | a4 >> 12) << n2[3 & y2++], u3[y2 >> 2] |= (128 | a4 >> 6 & 63) << n2[3 & y2++], u3[y2 >> 2] |= (128 | 63 & a4) << n2[3 & y2++]) : (a4 = 65536 + ((1023 & a4) << 10 | 1023 & i4.charCodeAt(++h2)), u3[y2 >> 2] |= (240 | a4 >> 18) << n2[3 & y2++], u3[y2 >> 2] |= (128 | a4 >> 12 & 63) << n2[3 & y2++], u3[y2 >> 2] |= (128 | a4 >> 6 & 63) << n2[3 & y2++], u3[y2 >> 2] |= (128 | 63 & a4) << n2[3 & y2++]); if (e5.lastByteIndex = y2, y2 >= c2) { for (e5.start = y2 - c2, e5.block = u3[f2], y2 = 0; y2 < f2; ++y2) l2[y2] ^= u3[y2]; o2(l2), e5.reset = true; } else e5.start = y2; } if (u3[(y2 = e5.lastByteIndex) >> 2] |= r3[3 & y2], e5.lastByteIndex === c2) for (u3[0] = u3[f2], y2 = 1; y2 < f2 + 1; ++y2) u3[y2] = 0; for (u3[f2 - 1] |= 2147483648, y2 = 0; y2 < f2; ++y2) l2[y2] ^= u3[y2]; o2(l2); for (var p2, b2 = "", y2 = 0, v2 = 0; v2 < d2; ) { for (y2 = 0; y2 < f2 && v2 < d2; ++y2, ++v2) p2 = l2[y2], b2 += t3[p2 >> 4 & 15] + t3[15 & p2] + t3[p2 >> 12 & 15] + t3[p2 >> 8 & 15] + t3[p2 >> 20 & 15] + t3[p2 >> 16 & 15] + t3[p2 >> 28 & 15] + t3[p2 >> 24 & 15]; v2 % f2 == 0 && (o2(l2), y2 = 0); } return "0x" + b2; }(function(e5) { return { blocks: [], reset: true, block: 0, start: 0, blockCount: 1600 - (e5 << 1) >> 5, outputBlocks: e5 >> 5, s: (t4 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [].concat(t4, t4, t4, t4, t4)) }; var t4; }(e4), a3); }; }; e3.exports = { keccak256: a2(256), keccak512: a2(512), keccak256s: a2(256), keccak512s: a2(512) }; }, 88645: (e3, t3, r3) => { var n2 = r3(31734), i2 = r3(58320), o2 = function(e4) { return new n2(e4.slice(2), 16); }, a2 = function(e4) { var t4 = "0x" + ("0x" === e4.slice(0, 2) ? new n2(e4.slice(2), 16) : new n2(e4, 10)).toString("hex"); return "0x0" === t4 ? "0x" : t4; }, s2 = function(e4) { return "string" == typeof e4 ? /^0x/.test(e4) ? e4 : "0x" + e4 : "0x" + new n2(e4).toString("hex"); }, u2 = function(e4) { return o2(e4).toNumber(); }, c2 = function(e4) { return function(t4, r4) { return "0x" + o2(t4)[e4](o2(r4)).toString("hex"); }; }, f2 = c2("add"), d2 = c2("mul"), l2 = c2("div"), h2 = c2("sub"); e3.exports = { toString: function(e4) { return o2(e4).toString(10); }, fromString: a2, toNumber: u2, fromNumber: s2, toEther: function(e4) { return u2(l2(e4, a2("10000000000"))) / 1e8; }, fromEther: function(e4) { return d2(s2(Math.floor(1e8 * e4)), a2("10000000000")); }, toUint256: function(e4) { return i2.pad(32, e4); }, add: f2, mul: d2, div: l2, sub: h2 }; }, 46740: (e3) => { e3.exports = { encode: function(e4) { var t3 = function(e5) { return (t4 = e5.toString(16)).length % 2 == 0 ? t4 : "0" + t4; var t4; }, r3 = function(e5, r4) { return e5 < 56 ? t3(r4 + e5) : t3(r4 + t3(e5).length / 2 + 55) + t3(e5); }; return "0x" + function e5(t4) { if ("string" == typeof t4) { var n2 = t4.slice(2); return (2 != n2.length || n2 >= "80" ? r3(n2.length / 2, 128) : "") + n2; } var i2 = t4.map(e5).join(""); return r3(i2.length / 2, 192) + i2; }(e4); }, decode: function(e4) { var t3 = 2, r3 = function() { if (t3 >= e4.length) throw ""; var r4 = e4.slice(t3, t3 + 2); return r4 < "80" ? (t3 += 2, "0x" + r4) : r4 < "c0" ? i2() : o2(); }, n2 = function() { var r4 = parseInt(e4.slice(t3, t3 += 2), 16) % 64; return r4 < 56 ? r4 : parseInt(e4.slice(t3, t3 += 2 * (r4 - 55)), 16); }, i2 = function() { var r4 = n2(); return "0x" + e4.slice(t3, t3 += 2 * r4); }, o2 = function() { for (var e5 = 2 * n2() + t3, i3 = []; t3 < e5; ) i3.push(r3()); return i3; }; try { return r3(); } catch (e5) { return []; } } }; }, 19313: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)); Object.defineProperty(t3, "__esModule", { value: true }); var i2 = r3(78179); function o2(e4) { return !("string" != typeof e4 || !/^(0x)?[0-9a-f]{512}$/i.test(e4) || !/^(0x)?[0-9a-f]{512}$/.test(e4) && !/^(0x)?[0-9A-F]{512}$/.test(e4)); } function a2(e4, t4) { "object" === (0, n2.default)(t4) && t4.constructor === Uint8Array && (t4 = i2.bytesToHex(t4)); for (var r4 = i2.keccak256(t4).replace("0x", ""), o3 = 0; o3 < 12; o3 += 4) { var a3 = (parseInt(r4.substr(o3, 2), 16) << 8) + parseInt(r4.substr(o3 + 2, 2), 16) & 2047, u3 = 1 << a3 % 4; if ((s2(e4.charCodeAt(e4.length - 1 - Math.floor(a3 / 4))) & u3) !== u3) return false; } return true; } function s2(e4) { if (e4 >= 48 && e4 <= 57) return e4 - 48; if (e4 >= 65 && e4 <= 70) return e4 - 55; if (e4 >= 97 && e4 <= 102) return e4 - 87; throw new Error("invalid bloom"); } function u2(e4) { return !("string" != typeof e4 || !/^(0x)?[0-9a-f]{64}$/i.test(e4) || !/^(0x)?[0-9a-f]{64}$/.test(e4) && !/^(0x)?[0-9A-F]{64}$/.test(e4)); } function c2(e4) { return !("string" != typeof e4 || !e4.match(/^(0x)?[0-9a-fA-F]{40}$/) && !e4.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)); } t3.isBloom = o2, t3.isInBloom = a2, t3.isUserEthereumAddressInBloom = function(e4, t4) { if (!o2(e4)) throw new Error("Invalid bloom given"); if (!c2(t4)) throw new Error('Invalid ethereum address given: "'.concat(t4, '"')); return a2(e4, i2.padLeft(t4, 64)); }, t3.isContractAddressInBloom = function(e4, t4) { if (!o2(e4)) throw new Error("Invalid bloom given"); if (!c2(t4)) throw new Error('Invalid contract address given: "'.concat(t4, '"')); return a2(e4, t4); }, t3.isTopicInBloom = function(e4, t4) { if (!o2(e4)) throw new Error("Invalid bloom given"); if (!u2(t4)) throw new Error("Invalid topic"); return a2(e4, t4); }, t3.isTopic = u2, t3.isAddress = c2; }, 78179: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }); var n2 = r3(34477); function i2(e4) { if (null == e4) throw new Error("cannot convert null value to array"); if ("string" == typeof e4) { var t4 = e4.match(/^(0x)?[0-9a-fA-F]*$/); if (!t4) throw new Error("invalid hexidecimal string"); if ("0x" !== t4[1]) throw new Error("hex string must have 0x prefix"); (e4 = e4.substring(2)).length % 2 && (e4 = "0" + e4); for (var r4 = [], n3 = 0; n3 < e4.length; n3 += 2) r4.push(parseInt(e4.substr(n3, 2), 16)); return o2(new Uint8Array(r4)); } if (function(e5) { if (!e5 || parseInt(String(e5.length)) != e5.length || "string" == typeof e5) return false; for (var t5 = 0; t5 < e5.length; t5++) { var r5 = e5[t5]; if (r5 < 0 || r5 >= 256 || parseInt(String(r5)) != r5) return false; } return true; }(e4)) return o2(new Uint8Array(e4)); throw new Error("invalid arrayify value"); } function o2(e4) { var t4 = arguments; return void 0 !== e4.slice || (e4.slice = function() { var r4 = Array.prototype.slice.call(t4); return o2(new Uint8Array(Array.prototype.slice.apply(e4, r4))); }), e4; } t3.keccak256 = function(e4) { return "0x" + n2.keccak_256(i2(e4)); }, t3.padLeft = function(e4, t4) { var r4 = /^0x/i.test(e4) || "number" == typeof e4, n3 = t4 - (e4 = e4.toString().replace(/^0x/i, "")).length + 1 >= 0 ? t4 - e4.length + 1 : 0; return (r4 ? "0x" : "") + new Array(n3).join("0") + e4; }, t3.bytesToHex = function(e4) { for (var t4 = [], r4 = 0; r4 < e4.length; r4++) t4.push((e4[r4] >>> 4).toString(16)), t4.push((15 & e4[r4]).toString(16)); return "0x".concat(t4.join("").replace(/^0+/, "")); }, t3.toByteArray = i2; }, 34477: (e3, t3, r3) => { e3 = r3.nmd(e3); var n2, i2 = r3(19142), o2 = r3(28847)(r3(3355)); !function() { var a2 = "input is invalid type", s2 = "object" === ("undefined" == typeof window ? "undefined" : (0, o2.default)(window)), u2 = s2 ? window : {}; u2.JS_SHA3_NO_WINDOW && (s2 = false); var c2 = !s2 && "object" === ("undefined" == typeof self ? "undefined" : (0, o2.default)(self)); !u2.JS_SHA3_NO_NODE_JS && "object" === (void 0 === i2 ? "undefined" : (0, o2.default)(i2)) && i2.versions && i2.versions.node ? u2 = r3.g : c2 && (u2 = self); var f2 = !u2.JS_SHA3_NO_COMMON_JS && "object" === (0, o2.default)(e3) && e3.exports, d2 = r3.amdO, l2 = !u2.JS_SHA3_NO_ARRAY_BUFFER && "undefined" != typeof ArrayBuffer, h2 = "0123456789abcdef".split(""), p2 = [4, 1024, 262144, 67108864], b2 = [0, 8, 16, 24], y2 = [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], v2 = [224, 256, 384, 512], m2 = [128, 256], g2 = ["hex", "buffer", "arrayBuffer", "array", "digest"], w2 = { 128: 168, 256: 136 }; !u2.JS_SHA3_NO_NODE_JS && Array.isArray || (Array.isArray = function(e4) { return "[object Array]" === Object.prototype.toString.call(e4); }), !l2 || !u2.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW && ArrayBuffer.isView || (ArrayBuffer.isView = function(e4) { return "object" === (0, o2.default)(e4) && e4.buffer && e4.buffer.constructor === ArrayBuffer; }); for (var k2 = function(e4, t4, r4) { return function(n3) { return new N2(e4, t4, e4).update(n3)[r4](); }; }, _2 = function(e4, t4, r4) { return function(n3, i3) { return new N2(e4, t4, i3).update(n3)[r4](); }; }, A2 = function(e4, t4, r4) { return function(t5, n3, i3, o3) { return O2["cshake" + e4].update(t5, n3, i3, o3)[r4](); }; }, E2 = function(e4, t4, r4) { return function(t5, n3, i3, o3) { return O2["kmac" + e4].update(t5, n3, i3, o3)[r4](); }; }, S2 = function(e4, t4, r4, n3) { for (var i3 = 0; i3 < g2.length; ++i3) { var o3 = g2[i3]; e4[o3] = t4(r4, n3, o3); } return e4; }, x2 = function(e4, t4) { var r4 = k2(e4, t4, "hex"); return r4.create = function() { return new N2(e4, t4, e4); }, r4.update = function(e5) { return r4.create().update(e5); }, S2(r4, k2, e4, t4); }, B2 = [{ name: "keccak", padding: [1, 256, 65536, 16777216], bits: v2, createMethod: x2 }, { name: "sha3", padding: [6, 1536, 393216, 100663296], bits: v2, createMethod: x2 }, { name: "shake", padding: [31, 7936, 2031616, 520093696], bits: m2, createMethod: function(e4, t4) { var r4 = _2(e4, t4, "hex"); return r4.create = function(r5) { return new N2(e4, t4, r5); }, r4.update = function(e5, t5) { return r4.create(t5).update(e5); }, S2(r4, _2, e4, t4); } }, { name: "cshake", padding: p2, bits: m2, createMethod: function(e4, t4) { var r4 = w2[e4], n3 = A2(e4, 0, "hex"); return n3.create = function(n4, i3, o3) { return i3 || o3 ? new N2(e4, t4, n4).bytepad([i3, o3], r4) : O2["shake" + e4].create(n4); }, n3.update = function(e5, t5, r5, i3) { return n3.create(t5, r5, i3).update(e5); }, S2(n3, A2, e4, t4); } }, { name: "kmac", padding: p2, bits: m2, createMethod: function(e4, t4) { var r4 = w2[e4], n3 = E2(e4, 0, "hex"); return n3.create = function(n4, i3, o3) { return new j2(e4, t4, i3).bytepad(["KMAC", o3], r4).bytepad([n4], r4); }, n3.update = function(e5, t5, r5, i3) { return n3.create(e5, r5, i3).update(t5); }, S2(n3, E2, e4, t4); } }], O2 = {}, P2 = [], I2 = 0; I2 < B2.length; ++I2) for (var T2 = B2[I2], C2 = T2.bits, M2 = 0; M2 < C2.length; ++M2) { var R2 = T2.name + "_" + C2[M2]; if (P2.push(R2), O2[R2] = T2.createMethod(C2[M2], T2.padding), "sha3" !== T2.name) { var U2 = T2.name + C2[M2]; P2.push(U2), O2[U2] = O2[R2]; } } function N2(e4, t4, r4) { this.blocks = [], this.s = [], this.padding = t4, this.outputBits = r4, this.reset = true, this.finalized = false, this.block = 0, this.start = 0, this.blockCount = 1600 - (e4 << 1) >> 5, this.byteCount = this.blockCount << 2, this.outputBlocks = r4 >> 5, this.extraBytes = (31 & r4) >> 3; for (var n3 = 0; n3 < 50; ++n3) this.s[n3] = 0; } function j2(e4, t4, r4) { N2.call(this, e4, t4, r4); } N2.prototype.update = function(e4) { if (this.finalized) throw new Error("finalize already called"); var t4, r4 = (0, o2.default)(e4); if ("string" !== r4) { if ("object" !== r4) throw new Error(a2); if (null === e4) throw new Error(a2); if (l2 && e4.constructor === ArrayBuffer) e4 = new Uint8Array(e4); else if (!(Array.isArray(e4) || l2 && ArrayBuffer.isView(e4))) throw new Error(a2); t4 = true; } for (var n3, i3, s3 = this.blocks, u3 = this.byteCount, c3 = e4.length, f3 = this.blockCount, d3 = 0, h3 = this.s; d3 < c3; ) { if (this.reset) for (this.reset = false, s3[0] = this.block, n3 = 1; n3 < f3 + 1; ++n3) s3[n3] = 0; if (t4) for (n3 = this.start; d3 < c3 && n3 < u3; ++d3) s3[n3 >> 2] |= e4[d3] << b2[3 & n3++]; else for (n3 = this.start; d3 < c3 && n3 < u3; ++d3) (i3 = e4.charCodeAt(d3)) < 128 ? s3[n3 >> 2] |= i3 << b2[3 & n3++] : i3 < 2048 ? (s3[n3 >> 2] |= (192 | i3 >> 6) << b2[3 & n3++], s3[n3 >> 2] |= (128 | 63 & i3) << b2[3 & n3++]) : i3 < 55296 || i3 >= 57344 ? (s3[n3 >> 2] |= (224 | i3 >> 12) << b2[3 & n3++], s3[n3 >> 2] |= (128 | i3 >> 6 & 63) << b2[3 & n3++], s3[n3 >> 2] |= (128 | 63 & i3) << b2[3 & n3++]) : (i3 = 65536 + ((1023 & i3) << 10 | 1023 & e4.charCodeAt(++d3)), s3[n3 >> 2] |= (240 | i3 >> 18) << b2[3 & n3++], s3[n3 >> 2] |= (128 | i3 >> 12 & 63) << b2[3 & n3++], s3[n3 >> 2] |= (128 | i3 >> 6 & 63) << b2[3 & n3++], s3[n3 >> 2] |= (128 | 63 & i3) << b2[3 & n3++]); if (this.lastByteIndex = n3, n3 >= u3) { for (this.start = n3 - u3, this.block = s3[f3], n3 = 0; n3 < f3; ++n3) h3[n3] ^= s3[n3]; L2(h3), this.reset = true; } else this.start = n3; } return this; }, N2.prototype.encode = function(e4, t4) { var r4 = 255 & e4, n3 = 1, i3 = [r4]; for (r4 = 255 & (e4 >>= 8); r4 > 0; ) i3.unshift(r4), r4 = 255 & (e4 >>= 8), ++n3; return t4 ? i3.push(n3) : i3.unshift(n3), this.update(i3), i3.length; }, N2.prototype.encodeString = function(e4) { var t4, r4 = (0, o2.default)(e4); if ("string" !== r4) { if ("object" !== r4) throw new Error(a2); if (null === e4) throw new Error(a2); if (l2 && e4.constructor === ArrayBuffer) e4 = new Uint8Array(e4); else if (!(Array.isArray(e4) || l2 && ArrayBuffer.isView(e4))) throw new Error(a2); t4 = true; } var n3 = 0, i3 = e4.length; if (t4) n3 = i3; else for (var s3 = 0; s3 < e4.length; ++s3) { var u3 = e4.charCodeAt(s3); u3 < 128 ? n3 += 1 : u3 < 2048 ? n3 += 2 : u3 < 55296 || u3 >= 57344 ? n3 += 3 : (u3 = 65536 + ((1023 & u3) << 10 | 1023 & e4.charCodeAt(++s3)), n3 += 4); } return n3 += this.encode(8 * n3), this.update(e4), n3; }, N2.prototype.bytepad = function(e4, t4) { for (var r4 = this.encode(t4), n3 = 0; n3 < e4.length; ++n3) r4 += this.encodeString(e4[n3]); var i3 = t4 - r4 % t4, o3 = []; return o3.length = i3, this.update(o3), this; }, N2.prototype.finalize = function() { if (!this.finalized) { this.finalized = true; var e4 = this.blocks, t4 = this.lastByteIndex, r4 = this.blockCount, n3 = this.s; if (e4[t4 >> 2] |= this.padding[3 & t4], this.lastByteIndex === this.byteCount) for (e4[0] = e4[r4], t4 = 1; t4 < r4 + 1; ++t4) e4[t4] = 0; for (e4[r4 - 1] |= 2147483648, t4 = 0; t4 < r4; ++t4) n3[t4] ^= e4[t4]; L2(n3); } }, N2.prototype.toString = N2.prototype.hex = function() { this.finalize(); for (var e4, t4 = this.blockCount, r4 = this.s, n3 = this.outputBlocks, i3 = this.extraBytes, o3 = 0, a3 = 0, s3 = ""; a3 < n3; ) { for (o3 = 0; o3 < t4 && a3 < n3; ++o3, ++a3) e4 = r4[o3], s3 += h2[e4 >> 4 & 15] + h2[15 & e4] + h2[e4 >> 12 & 15] + h2[e4 >> 8 & 15] + h2[e4 >> 20 & 15] + h2[e4 >> 16 & 15] + h2[e4 >> 28 & 15] + h2[e4 >> 24 & 15]; a3 % t4 == 0 && (L2(r4), o3 = 0); } return i3 && (e4 = r4[o3], s3 += h2[e4 >> 4 & 15] + h2[15 & e4], i3 > 1 && (s3 += h2[e4 >> 12 & 15] + h2[e4 >> 8 & 15]), i3 > 2 && (s3 += h2[e4 >> 20 & 15] + h2[e4 >> 16 & 15])), s3; }, N2.prototype.arrayBuffer = function() { this.finalize(); var e4, t4 = this.blockCount, r4 = this.s, n3 = this.outputBlocks, i3 = this.extraBytes, o3 = 0, a3 = 0, s3 = this.outputBits >> 3; e4 = i3 ? new ArrayBuffer(n3 + 1 << 2) : new ArrayBuffer(s3); for (var u3 = new Uint32Array(e4); a3 < n3; ) { for (o3 = 0; o3 < t4 && a3 < n3; ++o3, ++a3) u3[a3] = r4[o3]; a3 % t4 == 0 && L2(r4); } return i3 && (u3[o3] = r4[o3], e4 = e4.slice(0, s3)), e4; }, N2.prototype.buffer = N2.prototype.arrayBuffer, N2.prototype.digest = N2.prototype.array = function() { this.finalize(); for (var e4, t4, r4 = this.blockCount, n3 = this.s, i3 = this.outputBlocks, o3 = this.extraBytes, a3 = 0, s3 = 0, u3 = []; s3 < i3; ) { for (a3 = 0; a3 < r4 && s3 < i3; ++a3, ++s3) e4 = s3 << 2, t4 = n3[a3], u3[e4] = 255 & t4, u3[e4 + 1] = t4 >> 8 & 255, u3[e4 + 2] = t4 >> 16 & 255, u3[e4 + 3] = t4 >> 24 & 255; s3 % r4 == 0 && L2(n3); } return o3 && (e4 = s3 << 2, t4 = n3[a3], u3[e4] = 255 & t4, o3 > 1 && (u3[e4 + 1] = t4 >> 8 & 255), o3 > 2 && (u3[e4 + 2] = t4 >> 16 & 255)), u3; }, j2.prototype = new N2(), j2.prototype.finalize = function() { return this.encode(this.outputBits, true), N2.prototype.finalize.call(this); }; var L2 = function(e4) { var t4, r4, n3, i3, o3, a3, s3, u3, c3, f3, d3, l3, h3, p3, b3, v3, m3, g3, w3, k3, _3, A3, E3, S3, x3, B3, O3, P3, I3, T3, C3, M3, R3, U3, N3, j3, L3, F2, D2, H2, z2, q2, K2, G2, V2, Z2, W2, J2, Y2, X2, Q2, $2, ee2, te2, re2, ne2, ie2, oe2, ae2, se2, ue2, ce2, fe2; for (n3 = 0; n3 < 48; n3 += 2) i3 = e4[0] ^ e4[10] ^ e4[20] ^ e4[30] ^ e4[40], o3 = e4[1] ^ e4[11] ^ e4[21] ^ e4[31] ^ e4[41], a3 = e4[2] ^ e4[12] ^ e4[22] ^ e4[32] ^ e4[42], s3 = e4[3] ^ e4[13] ^ e4[23] ^ e4[33] ^ e4[43], u3 = e4[4] ^ e4[14] ^ e4[24] ^ e4[34] ^ e4[44], c3 = e4[5] ^ e4[15] ^ e4[25] ^ e4[35] ^ e4[45], f3 = e4[6] ^ e4[16] ^ e4[26] ^ e4[36] ^ e4[46], d3 = e4[7] ^ e4[17] ^ e4[27] ^ e4[37] ^ e4[47], t4 = (l3 = e4[8] ^ e4[18] ^ e4[28] ^ e4[38] ^ e4[48]) ^ (a3 << 1 | s3 >>> 31), r4 = (h3 = e4[9] ^ e4[19] ^ e4[29] ^ e4[39] ^ e4[49]) ^ (s3 << 1 | a3 >>> 31), e4[0] ^= t4, e4[1] ^= r4, e4[10] ^= t4, e4[11] ^= r4, e4[20] ^= t4, e4[21] ^= r4, e4[30] ^= t4, e4[31] ^= r4, e4[40] ^= t4, e4[41] ^= r4, t4 = i3 ^ (u3 << 1 | c3 >>> 31), r4 = o3 ^ (c3 << 1 | u3 >>> 31), e4[2] ^= t4, e4[3] ^= r4, e4[12] ^= t4, e4[13] ^= r4, e4[22] ^= t4, e4[23] ^= r4, e4[32] ^= t4, e4[33] ^= r4, e4[42] ^= t4, e4[43] ^= r4, t4 = a3 ^ (f3 << 1 | d3 >>> 31), r4 = s3 ^ (d3 << 1 | f3 >>> 31), e4[4] ^= t4, e4[5] ^= r4, e4[14] ^= t4, e4[15] ^= r4, e4[24] ^= t4, e4[25] ^= r4, e4[34] ^= t4, e4[35] ^= r4, e4[44] ^= t4, e4[45] ^= r4, t4 = u3 ^ (l3 << 1 | h3 >>> 31), r4 = c3 ^ (h3 << 1 | l3 >>> 31), e4[6] ^= t4, e4[7] ^= r4, e4[16] ^= t4, e4[17] ^= r4, e4[26] ^= t4, e4[27] ^= r4, e4[36] ^= t4, e4[37] ^= r4, e4[46] ^= t4, e4[47] ^= r4, t4 = f3 ^ (i3 << 1 | o3 >>> 31), r4 = d3 ^ (o3 << 1 | i3 >>> 31), e4[8] ^= t4, e4[9] ^= r4, e4[18] ^= t4, e4[19] ^= r4, e4[28] ^= t4, e4[29] ^= r4, e4[38] ^= t4, e4[39] ^= r4, e4[48] ^= t4, e4[49] ^= r4, p3 = e4[0], b3 = e4[1], Z2 = e4[11] << 4 | e4[10] >>> 28, W2 = e4[10] << 4 | e4[11] >>> 28, P3 = e4[20] << 3 | e4[21] >>> 29, I3 = e4[21] << 3 | e4[20] >>> 29, se2 = e4[31] << 9 | e4[30] >>> 23, ue2 = e4[30] << 9 | e4[31] >>> 23, q2 = e4[40] << 18 | e4[41] >>> 14, K2 = e4[41] << 18 | e4[40] >>> 14, U3 = e4[2] << 1 | e4[3] >>> 31, N3 = e4[3] << 1 | e4[2] >>> 31, v3 = e4[13] << 12 | e4[12] >>> 20, m3 = e4[12] << 12 | e4[13] >>> 20, J2 = e4[22] << 10 | e4[23] >>> 22, Y2 = e4[23] << 10 | e4[22] >>> 22, T3 = e4[33] << 13 | e4[32] >>> 19, C3 = e4[32] << 13 | e4[33] >>> 19, ce2 = e4[42] << 2 | e4[43] >>> 30, fe2 = e4[43] << 2 | e4[42] >>> 30, te2 = e4[5] << 30 | e4[4] >>> 2, re2 = e4[4] << 30 | e4[5] >>> 2, j3 = e4[14] << 6 | e4[15] >>> 26, L3 = e4[15] << 6 | e4[14] >>> 26, g3 = e4[25] << 11 | e4[24] >>> 21, w3 = e4[24] << 11 | e4[25] >>> 21, X2 = e4[34] << 15 | e4[35] >>> 17, Q2 = e4[35] << 15 | e4[34] >>> 17, M3 = e4[45] << 29 | e4[44] >>> 3, R3 = e4[44] << 29 | e4[45] >>> 3, S3 = e4[6] << 28 | e4[7] >>> 4, x3 = e4[7] << 28 | e4[6] >>> 4, ne2 = e4[17] << 23 | e4[16] >>> 9, ie2 = e4[16] << 23 | e4[17] >>> 9, F2 = e4[26] << 25 | e4[27] >>> 7, D2 = e4[27] << 25 | e4[26] >>> 7, k3 = e4[36] << 21 | e4[37] >>> 11, _3 = e4[37] << 21 | e4[36] >>> 11, $2 = e4[47] << 24 | e4[46] >>> 8, ee2 = e4[46] << 24 | e4[47] >>> 8, G2 = e4[8] << 27 | e4[9] >>> 5, V2 = e4[9] << 27 | e4[8] >>> 5, B3 = e4[18] << 20 | e4[19] >>> 12, O3 = e4[19] << 20 | e4[18] >>> 12, oe2 = e4[29] << 7 | e4[28] >>> 25, ae2 = e4[28] << 7 | e4[29] >>> 25, H2 = e4[38] << 8 | e4[39] >>> 24, z2 = e4[39] << 8 | e4[38] >>> 24, A3 = e4[48] << 14 | e4[49] >>> 18, E3 = e4[49] << 14 | e4[48] >>> 18, e4[0] = p3 ^ ~v3 & g3, e4[1] = b3 ^ ~m3 & w3, e4[10] = S3 ^ ~B3 & P3, e4[11] = x3 ^ ~O3 & I3, e4[20] = U3 ^ ~j3 & F2, e4[21] = N3 ^ ~L3 & D2, e4[30] = G2 ^ ~Z2 & J2, e4[31] = V2 ^ ~W2 & Y2, e4[40] = te2 ^ ~ne2 & oe2, e4[41] = re2 ^ ~ie2 & ae2, e4[2] = v3 ^ ~g3 & k3, e4[3] = m3 ^ ~w3 & _3, e4[12] = B3 ^ ~P3 & T3, e4[13] = O3 ^ ~I3 & C3, e4[22] = j3 ^ ~F2 & H2, e4[23] = L3 ^ ~D2 & z2, e4[32] = Z2 ^ ~J2 & X2, e4[33] = W2 ^ ~Y2 & Q2, e4[42] = ne2 ^ ~oe2 & se2, e4[43] = ie2 ^ ~ae2 & ue2, e4[4] = g3 ^ ~k3 & A3, e4[5] = w3 ^ ~_3 & E3, e4[14] = P3 ^ ~T3 & M3, e4[15] = I3 ^ ~C3 & R3, e4[24] = F2 ^ ~H2 & q2, e4[25] = D2 ^ ~z2 & K2, e4[34] = J2 ^ ~X2 & $2, e4[35] = Y2 ^ ~Q2 & ee2, e4[44] = oe2 ^ ~se2 & ce2, e4[45] = ae2 ^ ~ue2 & fe2, e4[6] = k3 ^ ~A3 & p3, e4[7] = _3 ^ ~E3 & b3, e4[16] = T3 ^ ~M3 & S3, e4[17] = C3 ^ ~R3 & x3, e4[26] = H2 ^ ~q2 & U3, e4[27] = z2 ^ ~K2 & N3, e4[36] = X2 ^ ~$2 & G2, e4[37] = Q2 ^ ~ee2 & V2, e4[46] = se2 ^ ~ce2 & te2, e4[47] = ue2 ^ ~fe2 & re2, e4[8] = A3 ^ ~p3 & v3, e4[9] = E3 ^ ~b3 & m3, e4[18] = M3 ^ ~S3 & B3, e4[19] = R3 ^ ~x3 & O3, e4[28] = q2 ^ ~U3 & j3, e4[29] = K2 ^ ~N3 & L3, e4[38] = $2 ^ ~G2 & Z2, e4[39] = ee2 ^ ~V2 & W2, e4[48] = ce2 ^ ~te2 & ne2, e4[49] = fe2 ^ ~re2 & ie2, e4[0] ^= y2[n3], e4[1] ^= y2[n3 + 1]; }; if (f2) e3.exports = O2; else { for (I2 = 0; I2 < P2.length; ++I2) u2[P2[I2]] = O2[P2[I2]]; d2 && (void 0 === (n2 = (function() { return O2; }).call(t3, r3, t3, e3)) || (e3.exports = n2)); } }(); }, 1243: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.keccak512 = t3.keccak384 = t3.keccak256 = t3.keccak224 = void 0; var n2, i2 = r3(64376), o2 = r3(40890); t3.keccak224 = (0, o2.wrapHash)(i2.keccak_224), t3.keccak256 = ((n2 = (0, o2.wrapHash)(i2.keccak_256)).create = i2.keccak_256.create, n2), t3.keccak384 = (0, o2.wrapHash)(i2.keccak_384), t3.keccak512 = (0, o2.wrapHash)(i2.keccak_512); }, 86992: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.secp256k1 = void 0; var n2 = r3(4158); Object.defineProperty(t3, "secp256k1", { enumerable: true, get: function() { return n2.secp256k1; } }); }, 40890: (e3, t3, r3) => { e3 = r3.nmd(e3); var n2 = r3(28847)(r3(3355)); Object.defineProperty(t3, "__esModule", { value: true }), t3.crypto = t3.wrapHash = t3.equalsBytes = t3.hexToBytes = t3.bytesToUtf8 = t3.utf8ToBytes = t3.createView = t3.concatBytes = t3.toHex = t3.bytesToHex = t3.assertBytes = t3.assertBool = void 0; var i2, o2 = (i2 = r3(96822)) && i2.__esModule ? i2 : { default: i2 }, a2 = r3(72434), s2 = o2.default.bool; t3.assertBool = s2; var u2 = o2.default.bytes; t3.assertBytes = u2; var c2, f2, d2 = r3(72434); Object.defineProperty(t3, "bytesToHex", { enumerable: true, get: function() { return d2.bytesToHex; } }), Object.defineProperty(t3, "toHex", { enumerable: true, get: function() { return d2.bytesToHex; } }), Object.defineProperty(t3, "concatBytes", { enumerable: true, get: function() { return d2.concatBytes; } }), Object.defineProperty(t3, "createView", { enumerable: true, get: function() { return d2.createView; } }), Object.defineProperty(t3, "utf8ToBytes", { enumerable: true, get: function() { return d2.utf8ToBytes; } }), t3.bytesToUtf8 = function(e4) { if (!(e4 instanceof Uint8Array)) throw new TypeError("bytesToUtf8 expected Uint8Array, got ".concat((0, n2.default)(e4))); return new TextDecoder().decode(e4); }, t3.hexToBytes = function(e4) { var t4 = e4.startsWith("0x") ? e4.substring(2) : e4; return (0, a2.hexToBytes)(t4); }, t3.equalsBytes = function(e4, t4) { if (e4.length !== t4.length) return false; for (var r4 = 0; r4 < e4.length; r4++) if (e4[r4] !== t4[r4]) return false; return true; }, t3.wrapHash = function(e4) { return function(t4) { return o2.default.bytes(t4), e4(t4); }; }, t3.crypto = (c2 = "object" === ("undefined" == typeof globalThis ? "undefined" : (0, n2.default)(globalThis)) && "crypto" in globalThis ? globalThis.crypto : void 0, { node: (f2 = "function" == typeof e3.require && e3.require.bind(e3)) && !c2 ? f2("crypto") : void 0, web: c2 }); }, 21968: (e3, t3, r3) => { var n2 = r3(29033).Buffer; Object.defineProperty(t3, "__esModule", { value: true }), t3.isZeroAddress = t3.zeroAddress = t3.importPublic = t3.privateToAddress = t3.privateToPublic = t3.publicToAddress = t3.pubToAddress = t3.isValidPublic = t3.isValidPrivate = t3.generateAddress2 = t3.generateAddress = t3.isValidChecksumAddress = t3.toChecksumAddress = t3.isValidAddress = t3.Account = void 0; var i2, o2 = (i2 = r3(3894)) && i2.__esModule ? i2 : { default: i2 }, a2 = r3(49100), s2 = r3(31439), u2 = r3(23271), c2 = r3(60986), f2 = r3(13464), d2 = r3(39808), l2 = r3(5725), h2 = r3(35513), p2 = function() { function e4(e5, t4, r4, n3) { void 0 === e5 && (e5 = new a2.BN(0)), void 0 === t4 && (t4 = new a2.BN(0)), void 0 === r4 && (r4 = c2.KECCAK256_RLP), void 0 === n3 && (n3 = c2.KECCAK256_NULL), this.nonce = e5, this.balance = t4, this.stateRoot = r4, this.codeHash = n3, this._validate(); } return e4.fromAccountData = function(t4) { var r4 = t4.nonce, n3 = t4.balance, i3 = t4.stateRoot, o3 = t4.codeHash; return new e4(r4 ? new a2.BN((0, f2.toBuffer)(r4)) : void 0, n3 ? new a2.BN((0, f2.toBuffer)(n3)) : void 0, i3 ? (0, f2.toBuffer)(i3) : void 0, o3 ? (0, f2.toBuffer)(o3) : void 0); }, e4.fromRlpSerializedAccount = function(e5) { var t4 = a2.rlp.decode(e5); if (!Array.isArray(t4)) throw new Error("Invalid serialized account input. Must be array"); return this.fromValuesArray(t4); }, e4.fromValuesArray = function(t4) { var r4 = function(e5, t5) { var r5 = "function" == typeof Symbol && e5[Symbol.iterator]; if (!r5) return e5; var n4, i4, o4 = r5.call(e5), a3 = []; try { for (; (void 0 === t5 || t5-- > 0) && !(n4 = o4.next()).done; ) a3.push(n4.value); } catch (e6) { i4 = { error: e6 }; } finally { try { n4 && !n4.done && (r5 = o4.return) && r5.call(o4); } finally { if (i4) throw i4.error; } } return a3; }(t4, 4), n3 = r4[0], i3 = r4[1], o3 = r4[2], s3 = r4[3]; return new e4(new a2.BN(n3), new a2.BN(i3), o3, s3); }, e4.prototype._validate = function() { if (this.nonce.lt(new a2.BN(0))) throw new Error("nonce must be greater than zero"); if (this.balance.lt(new a2.BN(0))) throw new Error("balance must be greater than zero"); if (32 !== this.stateRoot.length) throw new Error("stateRoot must have a length of 32"); if (32 !== this.codeHash.length) throw new Error("codeHash must have a length of 32"); }, e4.prototype.raw = function() { return [(0, h2.bnToUnpaddedBuffer)(this.nonce), (0, h2.bnToUnpaddedBuffer)(this.balance), this.stateRoot, this.codeHash]; }, e4.prototype.serialize = function() { return a2.rlp.encode(this.raw()); }, e4.prototype.isContract = function() { return !this.codeHash.equals(c2.KECCAK256_NULL); }, e4.prototype.isEmpty = function() { return this.balance.isZero() && this.nonce.isZero() && this.codeHash.equals(c2.KECCAK256_NULL); }, e4; }(); t3.Account = p2, t3.isValidAddress = function(e4) { try { (0, l2.assertIsString)(e4); } catch (e5) { return false; } return /^0x[0-9a-fA-F]{40}$/.test(e4); }, t3.toChecksumAddress = function(e4, t4) { (0, l2.assertIsHexString)(e4); var r4 = (0, u2.stripHexPrefix)(e4).toLowerCase(), n3 = ""; t4 && (n3 = (0, h2.toType)(t4, h2.TypeOutput.BN).toString() + "0x"); for (var i3 = (0, d2.keccakFromString)(n3 + r4).toString("hex"), o3 = "0x", a3 = 0; a3 < r4.length; a3++) parseInt(i3[a3], 16) >= 8 ? o3 += r4[a3].toUpperCase() : o3 += r4[a3]; return o3; }, t3.isValidChecksumAddress = function(e4, r4) { return (0, t3.isValidAddress)(e4) && (0, t3.toChecksumAddress)(e4, r4) === e4; }, t3.generateAddress = function(e4, t4) { (0, l2.assertIsBuffer)(e4), (0, l2.assertIsBuffer)(t4); var r4 = new a2.BN(t4); return r4.isZero() ? (0, d2.rlphash)([e4, null]).slice(-20) : (0, d2.rlphash)([e4, n2.from(r4.toArray())]).slice(-20); }, t3.generateAddress2 = function(e4, t4, r4) { return (0, l2.assertIsBuffer)(e4), (0, l2.assertIsBuffer)(t4), (0, l2.assertIsBuffer)(r4), (0, o2.default)(20 === e4.length), (0, o2.default)(32 === t4.length), (0, d2.keccak256)(n2.concat([n2.from("ff", "hex"), e4, t4, (0, d2.keccak256)(r4)])).slice(-20); }, t3.isValidPrivate = function(e4) { return (0, s2.privateKeyVerify)(e4); }, t3.isValidPublic = function(e4, t4) { return void 0 === t4 && (t4 = false), (0, l2.assertIsBuffer)(e4), 64 === e4.length ? (0, s2.publicKeyVerify)(n2.concat([n2.from([4]), e4])) : !!t4 && (0, s2.publicKeyVerify)(e4); }, t3.pubToAddress = function(e4, t4) { return void 0 === t4 && (t4 = false), (0, l2.assertIsBuffer)(e4), t4 && 64 !== e4.length && (e4 = n2.from((0, s2.publicKeyConvert)(e4, false).slice(1))), (0, o2.default)(64 === e4.length), (0, d2.keccak)(e4).slice(-20); }, t3.publicToAddress = t3.pubToAddress, t3.privateToPublic = function(e4) { return (0, l2.assertIsBuffer)(e4), n2.from((0, s2.publicKeyCreate)(e4, false)).slice(1); }, t3.privateToAddress = function(e4) { return (0, t3.publicToAddress)((0, t3.privateToPublic)(e4)); }, t3.importPublic = function(e4) { return (0, l2.assertIsBuffer)(e4), 64 !== e4.length && (e4 = n2.from((0, s2.publicKeyConvert)(e4, false).slice(1))), e4; }, t3.zeroAddress = function() { var e4 = (0, f2.zeros)(20); return (0, f2.bufferToHex)(e4); }, t3.isZeroAddress = function(e4) { try { (0, l2.assertIsString)(e4); } catch (e5) { return false; } return (0, t3.zeroAddress)() === e4; }; }, 41984: (e3, t3, r3) => { var n2 = r3(29033).Buffer; Object.defineProperty(t3, "__esModule", { value: true }), t3.Address = void 0; var i2, o2 = (i2 = r3(3894)) && i2.__esModule ? i2 : { default: i2 }, a2 = r3(49100), s2 = r3(13464), u2 = r3(21968), c2 = function() { function e4(e5) { (0, o2.default)(20 === e5.length, "Invalid address length"), this.buf = e5; } return e4.zero = function() { return new e4((0, s2.zeros)(20)); }, e4.fromString = function(t4) { return (0, o2.default)((0, u2.isValidAddress)(t4), "Invalid address"), new e4((0, s2.toBuffer)(t4)); }, e4.fromPublicKey = function(t4) { return (0, o2.default)(n2.isBuffer(t4), "Public key should be Buffer"), new e4((0, u2.pubToAddress)(t4)); }, e4.fromPrivateKey = function(t4) { return (0, o2.default)(n2.isBuffer(t4), "Private key should be Buffer"), new e4((0, u2.privateToAddress)(t4)); }, e4.generate = function(t4, r4) { return (0, o2.default)(a2.BN.isBN(r4)), new e4((0, u2.generateAddress)(t4.buf, r4.toArrayLike(n2))); }, e4.generate2 = function(t4, r4, i3) { return (0, o2.default)(n2.isBuffer(r4)), (0, o2.default)(n2.isBuffer(i3)), new e4((0, u2.generateAddress2)(t4.buf, r4, i3)); }, e4.prototype.equals = function(e5) { return this.buf.equals(e5.buf); }, e4.prototype.isZero = function() { return this.equals(e4.zero()); }, e4.prototype.isPrecompileOrSystemAddress = function() { var e5 = new a2.BN(this.buf), t4 = new a2.BN(0), r4 = new a2.BN("ffff", "hex"); return e5.gte(t4) && e5.lte(r4); }, e4.prototype.toString = function() { return "0x" + this.buf.toString("hex"); }, e4.prototype.toBuffer = function() { return n2.from(this.buf); }, e4; }(); t3.Address = c2; }, 13464: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = function(e4, t4) { var r4 = "function" == typeof Symbol && e4[Symbol.iterator]; if (!r4) return e4; var n3, i3, o3 = r4.call(e4), a3 = []; try { for (; (void 0 === t4 || t4-- > 0) && !(n3 = o3.next()).done; ) a3.push(n3.value); } catch (e5) { i3 = { error: e5 }; } finally { try { n3 && !n3.done && (r4 = o3.return) && r4.call(o3); } finally { if (i3) throw i3.error; } } return a3; }; Object.defineProperty(t3, "__esModule", { value: true }), t3.bufArrToArr = t3.arrToBufArr = t3.validateNoLeadingZeroes = t3.baToJSON = t3.toUtf8 = t3.addHexPrefix = t3.toUnsigned = t3.fromSigned = t3.bufferToHex = t3.bufferToInt = t3.toBuffer = t3.unpadHexString = t3.unpadArray = t3.unpadBuffer = t3.setLengthRight = t3.setLengthLeft = t3.zeros = t3.intToBuffer = t3.intToHex = void 0; var o2 = r3(49100), a2 = r3(23271), s2 = r3(5725); t3.intToHex = function(e4) { if (!Number.isSafeInteger(e4) || e4 < 0) throw new Error("Received an invalid integer type: ".concat(e4)); return "0x".concat(e4.toString(16)); }, t3.intToBuffer = function(e4) { var r4 = (0, t3.intToHex)(e4); return n2.from((0, a2.padToEven)(r4.slice(2)), "hex"); }, t3.zeros = function(e4) { return n2.allocUnsafe(e4).fill(0); }; var u2 = function(e4, r4, n3) { var i3 = (0, t3.zeros)(r4); return n3 ? e4.length < r4 ? (e4.copy(i3), i3) : e4.slice(0, r4) : e4.length < r4 ? (e4.copy(i3, r4 - e4.length), i3) : e4.slice(-r4); }; t3.setLengthLeft = function(e4, t4) { return (0, s2.assertIsBuffer)(e4), u2(e4, t4, false); }, t3.setLengthRight = function(e4, t4) { return (0, s2.assertIsBuffer)(e4), u2(e4, t4, true); }; var c2 = function(e4) { for (var t4 = e4[0]; e4.length > 0 && "0" === t4.toString(); ) t4 = (e4 = e4.slice(1))[0]; return e4; }; t3.unpadBuffer = function(e4) { return (0, s2.assertIsBuffer)(e4), c2(e4); }, t3.unpadArray = function(e4) { return (0, s2.assertIsArray)(e4), c2(e4); }, t3.unpadHexString = function(e4) { return (0, s2.assertIsHexString)(e4), e4 = (0, a2.stripHexPrefix)(e4), c2(e4); }, t3.toBuffer = function(e4) { if (null == e4) return n2.allocUnsafe(0); if (n2.isBuffer(e4)) return n2.from(e4); if (Array.isArray(e4) || e4 instanceof Uint8Array) return n2.from(e4); if ("string" == typeof e4) { if (!(0, a2.isHexString)(e4)) throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e4)); return n2.from((0, a2.padToEven)((0, a2.stripHexPrefix)(e4)), "hex"); } if ("number" == typeof e4) return (0, t3.intToBuffer)(e4); if (o2.BN.isBN(e4)) { if (e4.isNeg()) throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e4)); return e4.toArrayLike(n2); } if (e4.toArray) return n2.from(e4.toArray()); if (e4.toBuffer) return n2.from(e4.toBuffer()); throw new Error("invalid type"); }, t3.bufferToInt = function(e4) { return new o2.BN((0, t3.toBuffer)(e4)).toNumber(); }, t3.bufferToHex = function(e4) { return "0x" + (e4 = (0, t3.toBuffer)(e4)).toString("hex"); }, t3.fromSigned = function(e4) { return new o2.BN(e4).fromTwos(256); }, t3.toUnsigned = function(e4) { return n2.from(e4.toTwos(256).toArray()); }, t3.addHexPrefix = function(e4) { return "string" != typeof e4 || (0, a2.isHexPrefixed)(e4) ? e4 : "0x" + e4; }, t3.toUtf8 = function(e4) { if ((e4 = (0, a2.stripHexPrefix)(e4)).length % 2 != 0) throw new Error("Invalid non-even hex string input for toUtf8() provided"); return n2.from(e4.replace(/^(00)+|(00)+$/g, ""), "hex").toString("utf8"); }, t3.baToJSON = function(e4) { if (n2.isBuffer(e4)) return "0x".concat(e4.toString("hex")); if (e4 instanceof Array) { for (var r4 = [], i3 = 0; i3 < e4.length; i3++) r4.push((0, t3.baToJSON)(e4[i3])); return r4; } }, t3.validateNoLeadingZeroes = function(e4) { var t4, r4; try { for (var n3 = function(e5) { var t5 = "function" == typeof Symbol && Symbol.iterator, r5 = t5 && e5[t5], n4 = 0; if (r5) return r5.call(e5); if (e5 && "number" == typeof e5.length) return { next: function() { return e5 && n4 >= e5.length && (e5 = void 0), { value: e5 && e5[n4++], done: !e5 }; } }; throw new TypeError(t5 ? "Object is not iterable." : "Symbol.iterator is not defined."); }(Object.entries(e4)), o3 = n3.next(); !o3.done; o3 = n3.next()) { var a3 = i2(o3.value, 2), s3 = a3[0], u3 = a3[1]; if (void 0 !== u3 && u3.length > 0 && 0 === u3[0]) throw new Error("".concat(s3, " cannot have leading zeroes, received: ").concat(u3.toString("hex"))); } } catch (e5) { t4 = { error: e5 }; } finally { try { o3 && !o3.done && (r4 = n3.return) && r4.call(n3); } finally { if (t4) throw t4.error; } } }, t3.arrToBufArr = function e4(t4) { return Array.isArray(t4) ? t4.map(function(t5) { return e4(t5); }) : n2.from(t4); }, t3.bufArrToArr = function e4(t4) { return Array.isArray(t4) ? t4.map(function(t5) { return e4(t5); }) : Uint8Array.from(null != t4 ? t4 : []); }; }, 60986: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.KECCAK256_RLP = t3.KECCAK256_RLP_S = t3.KECCAK256_RLP_ARRAY = t3.KECCAK256_RLP_ARRAY_S = t3.KECCAK256_NULL = t3.KECCAK256_NULL_S = t3.TWO_POW256 = t3.MAX_INTEGER = t3.MAX_UINT64 = void 0; var n2 = r3(29033), i2 = r3(49100); t3.MAX_UINT64 = new i2.BN("ffffffffffffffff", 16), t3.MAX_INTEGER = new i2.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16), t3.TWO_POW256 = new i2.BN("10000000000000000000000000000000000000000000000000000000000000000", 16), t3.KECCAK256_NULL_S = "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", t3.KECCAK256_NULL = n2.Buffer.from(t3.KECCAK256_NULL_S, "hex"), t3.KECCAK256_RLP_ARRAY_S = "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", t3.KECCAK256_RLP_ARRAY = n2.Buffer.from(t3.KECCAK256_RLP_ARRAY_S, "hex"), t3.KECCAK256_RLP_S = "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", t3.KECCAK256_RLP = n2.Buffer.from(t3.KECCAK256_RLP_S, "hex"); }, 49100: (e3, t3, r3) => { var n2 = Object.create ? function(e4, t4, r4, n3) { void 0 === n3 && (n3 = r4); var i3 = Object.getOwnPropertyDescriptor(t4, r4); i3 && !("get" in i3 ? !t4.__esModule : i3.writable || i3.configurable) || (i3 = { enumerable: true, get: function() { return t4[r4]; } }), Object.defineProperty(e4, n3, i3); } : function(e4, t4, r4, n3) { void 0 === n3 && (n3 = r4), e4[n3] = t4[r4]; }, i2 = Object.create ? function(e4, t4) { Object.defineProperty(e4, "default", { enumerable: true, value: t4 }); } : function(e4, t4) { e4.default = t4; }; Object.defineProperty(t3, "__esModule", { value: true }), t3.rlp = t3.BN = void 0; var o2, a2 = (o2 = r3(31734)) && o2.__esModule ? o2 : { default: o2 }; t3.BN = a2.default; var s2 = function(e4) { if (e4 && e4.__esModule) return e4; var t4 = {}; if (null != e4) for (var r4 in e4) "default" !== r4 && Object.prototype.hasOwnProperty.call(e4, r4) && n2(t4, e4, r4); return i2(t4, e4), t4; }(r3(6905)); t3.rlp = s2; }, 39808: (e3, t3, r3) => { var n2 = r3(29033).Buffer; Object.defineProperty(t3, "__esModule", { value: true }), t3.rlphash = t3.ripemd160FromArray = t3.ripemd160FromString = t3.ripemd160 = t3.sha256FromArray = t3.sha256FromString = t3.sha256 = t3.keccakFromArray = t3.keccakFromHexString = t3.keccakFromString = t3.keccak256 = t3.keccak = void 0; var i2 = r3(8235), o2 = r3(35866), a2 = r3(49100), s2 = r3(13464), u2 = r3(5725); t3.keccak = function(e4, t4) { switch (void 0 === t4 && (t4 = 256), (0, u2.assertIsBuffer)(e4), t4) { case 224: return (0, i2.keccak224)(e4); case 256: return (0, i2.keccak256)(e4); case 384: return (0, i2.keccak384)(e4); case 512: return (0, i2.keccak512)(e4); default: throw new Error("Invald algorithm: keccak".concat(t4)); } }, t3.keccak256 = function(e4) { return (0, t3.keccak)(e4); }, t3.keccakFromString = function(e4, r4) { void 0 === r4 && (r4 = 256), (0, u2.assertIsString)(e4); var i3 = n2.from(e4, "utf8"); return (0, t3.keccak)(i3, r4); }, t3.keccakFromHexString = function(e4, r4) { return void 0 === r4 && (r4 = 256), (0, u2.assertIsHexString)(e4), (0, t3.keccak)((0, s2.toBuffer)(e4), r4); }, t3.keccakFromArray = function(e4, r4) { return void 0 === r4 && (r4 = 256), (0, u2.assertIsArray)(e4), (0, t3.keccak)((0, s2.toBuffer)(e4), r4); }; var c2 = function(e4) { return e4 = (0, s2.toBuffer)(e4), o2("sha256").update(e4).digest(); }; t3.sha256 = function(e4) { return (0, u2.assertIsBuffer)(e4), c2(e4); }, t3.sha256FromString = function(e4) { return (0, u2.assertIsString)(e4), c2(e4); }, t3.sha256FromArray = function(e4) { return (0, u2.assertIsArray)(e4), c2(e4); }; var f2 = function(e4, t4) { e4 = (0, s2.toBuffer)(e4); var r4 = o2("rmd160").update(e4).digest(); return true === t4 ? (0, s2.setLengthLeft)(r4, 32) : r4; }; t3.ripemd160 = function(e4, t4) { return (0, u2.assertIsBuffer)(e4), f2(e4, t4); }, t3.ripemd160FromString = function(e4, t4) { return (0, u2.assertIsString)(e4), f2(e4, t4); }, t3.ripemd160FromArray = function(e4, t4) { return (0, u2.assertIsArray)(e4), f2(e4, t4); }, t3.rlphash = function(e4) { return (0, t3.keccak)(a2.rlp.encode(e4)); }; }, 5725: (e3, t3, r3) => { var n2 = r3(29033).Buffer; Object.defineProperty(t3, "__esModule", { value: true }), t3.assertIsString = t3.assertIsArray = t3.assertIsBuffer = t3.assertIsHexString = void 0; var i2 = r3(23271); t3.assertIsHexString = function(e4) { if (!(0, i2.isHexString)(e4)) { var t4 = "This method only supports 0x-prefixed hex strings but input was: ".concat(e4); throw new Error(t4); } }, t3.assertIsBuffer = function(e4) { if (!n2.isBuffer(e4)) { var t4 = "This method only supports Buffer but input was: ".concat(e4); throw new Error(t4); } }, t3.assertIsArray = function(e4) { if (!Array.isArray(e4)) { var t4 = "This method only supports number arrays but input was: ".concat(e4); throw new Error(t4); } }, t3.assertIsString = function(e4) { if ("string" != typeof e4) { var t4 = "This method only supports strings but input was: ".concat(e4); throw new Error(t4); } }; }, 33062: (e3, t3, r3) => { var n2 = Object.create ? function(e4, t4, r4, n3) { void 0 === n3 && (n3 = r4); var i3 = Object.getOwnPropertyDescriptor(t4, r4); i3 && !("get" in i3 ? !t4.__esModule : i3.writable || i3.configurable) || (i3 = { enumerable: true, get: function() { return t4[r4]; } }), Object.defineProperty(e4, n3, i3); } : function(e4, t4, r4, n3) { void 0 === n3 && (n3 = r4), e4[n3] = t4[r4]; }, i2 = function(e4, t4) { for (var r4 in e4) "default" === r4 || Object.prototype.hasOwnProperty.call(t4, r4) || n2(t4, e4, r4); }; Object.defineProperty(t3, "__esModule", { value: true }), t3.isHexString = t3.getKeys = t3.fromAscii = t3.fromUtf8 = t3.toAscii = t3.arrayContainsArray = t3.getBinarySize = t3.padToEven = t3.stripHexPrefix = t3.isHexPrefixed = void 0, i2(r3(60986), t3), i2(r3(21968), t3), i2(r3(41984), t3), i2(r3(39808), t3), i2(r3(86081), t3), i2(r3(13464), t3), i2(r3(41677), t3), i2(r3(49100), t3), i2(r3(35513), t3); var o2 = r3(23271); Object.defineProperty(t3, "isHexPrefixed", { enumerable: true, get: function() { return o2.isHexPrefixed; } }), Object.defineProperty(t3, "stripHexPrefix", { enumerable: true, get: function() { return o2.stripHexPrefix; } }), Object.defineProperty(t3, "padToEven", { enumerable: true, get: function() { return o2.padToEven; } }), Object.defineProperty(t3, "getBinarySize", { enumerable: true, get: function() { return o2.getBinarySize; } }), Object.defineProperty(t3, "arrayContainsArray", { enumerable: true, get: function() { return o2.arrayContainsArray; } }), Object.defineProperty(t3, "toAscii", { enumerable: true, get: function() { return o2.toAscii; } }), Object.defineProperty(t3, "fromUtf8", { enumerable: true, get: function() { return o2.fromUtf8; } }), Object.defineProperty(t3, "fromAscii", { enumerable: true, get: function() { return o2.fromAscii; } }), Object.defineProperty(t3, "getKeys", { enumerable: true, get: function() { return o2.getKeys; } }), Object.defineProperty(t3, "isHexString", { enumerable: true, get: function() { return o2.isHexString; } }); }, 23271: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(28847)(r3(3355)); function o2(e4) { if ("string" != typeof e4) throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat((0, i2.default)(e4))); return "0" === e4[0] && "x" === e4[1]; } function a2(e4) { var t4 = e4; if ("string" != typeof t4) throw new Error("[padToEven] value must be type 'string', received ".concat((0, i2.default)(t4))); return t4.length % 2 && (t4 = "0".concat(t4)), t4; } Object.defineProperty(t3, "__esModule", { value: true }), t3.isHexString = t3.getKeys = t3.fromAscii = t3.fromUtf8 = t3.toAscii = t3.arrayContainsArray = t3.getBinarySize = t3.padToEven = t3.stripHexPrefix = t3.isHexPrefixed = void 0, t3.isHexPrefixed = o2, t3.stripHexPrefix = function(e4) { if ("string" != typeof e4) throw new Error("[stripHexPrefix] input must be type 'string', received ".concat((0, i2.default)(e4))); return o2(e4) ? e4.slice(2) : e4; }, t3.padToEven = a2, t3.getBinarySize = function(e4) { if ("string" != typeof e4) throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat((0, i2.default)(e4))); return n2.byteLength(e4, "utf8"); }, t3.arrayContainsArray = function(e4, t4, r4) { if (true !== Array.isArray(e4)) throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat((0, i2.default)(e4), "'")); if (true !== Array.isArray(t4)) throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat((0, i2.default)(t4), "'")); return t4[r4 ? "some" : "every"](function(t5) { return e4.indexOf(t5) >= 0; }); }, t3.toAscii = function(e4) { var t4 = "", r4 = 0, n3 = e4.length; for ("0x" === e4.substring(0, 2) && (r4 = 2); r4 < n3; r4 += 2) { var i3 = parseInt(e4.substr(r4, 2), 16); t4 += String.fromCharCode(i3); } return t4; }, t3.fromUtf8 = function(e4) { var t4 = n2.from(e4, "utf8"); return "0x".concat(a2(t4.toString("hex")).replace(/^0+|0+$/g, "")); }, t3.fromAscii = function(e4) { for (var t4 = "", r4 = 0; r4 < e4.length; r4++) { var n3 = e4.charCodeAt(r4).toString(16); t4 += n3.length < 2 ? "0".concat(n3) : n3; } return "0x".concat(t4); }, t3.getKeys = function(e4, t4, r4) { if (!Array.isArray(e4)) throw new Error("[getKeys] method expects input 'params' to be an array, got ".concat((0, i2.default)(e4))); if ("string" != typeof t4) throw new Error("[getKeys] method expects input 'key' to be type 'string', got ".concat((0, i2.default)(e4))); for (var n3 = [], o3 = 0; o3 < e4.length; o3++) { var a3 = e4[o3][t4]; if (r4 && !a3) a3 = ""; else if ("string" != typeof a3) throw new Error("invalid abi - expected type 'string', received ".concat((0, i2.default)(a3))); n3.push(a3); } return n3; }, t3.isHexString = function(e4, t4) { return !("string" != typeof e4 || !e4.match(/^0x[0-9A-Fa-f]*$/) || t4 && e4.length !== 2 + 2 * t4); }; }, 41677: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(28847)(r3(3355)); Object.defineProperty(t3, "__esModule", { value: true }), t3.defineProperties = void 0; var o2, a2 = (o2 = r3(3894)) && o2.__esModule ? o2 : { default: o2 }, s2 = r3(23271), u2 = r3(49100), c2 = r3(13464); t3.defineProperties = function(e4, t4, r4) { if (e4.raw = [], e4._fields = [], e4.toJSON = function(t5) { if (void 0 === t5 && (t5 = false), t5) { var r5 = {}; return e4._fields.forEach(function(t6) { r5[t6] = "0x".concat(e4[t6].toString("hex")); }), r5; } return (0, c2.baToJSON)(e4.raw); }, e4.serialize = function() { return u2.rlp.encode(e4.raw); }, t4.forEach(function(t5, r5) { function i3() { return e4.raw[r5]; } function o4(i4) { "00" !== (i4 = (0, c2.toBuffer)(i4)).toString("hex") || t5.allowZero || (i4 = n2.allocUnsafe(0)), t5.allowLess && t5.length ? (i4 = (0, c2.unpadBuffer)(i4), (0, a2.default)(t5.length >= i4.length, "The field ".concat(t5.name, " must not have more ").concat(t5.length, " bytes"))) : t5.allowZero && 0 === i4.length || !t5.length || (0, a2.default)(t5.length === i4.length, "The field ".concat(t5.name, " must have byte length of ").concat(t5.length)), e4.raw[r5] = i4; } e4._fields.push(t5.name), Object.defineProperty(e4, t5.name, { enumerable: true, configurable: true, get: i3, set: o4 }), t5.default && (e4[t5.name] = t5.default), t5.alias && Object.defineProperty(e4, t5.alias, { enumerable: false, configurable: true, set: o4, get: i3 }); }), r4) if ("string" == typeof r4 && (r4 = n2.from((0, s2.stripHexPrefix)(r4), "hex")), n2.isBuffer(r4) && (r4 = u2.rlp.decode(r4)), Array.isArray(r4)) { if (r4.length > e4._fields.length) throw new Error("wrong number of fields in data"); r4.forEach(function(t5, r5) { e4[e4._fields[r5]] = (0, c2.toBuffer)(t5); }); } else { if ("object" !== (0, i2.default)(r4)) throw new Error("invalid data"); var o3 = Object.keys(r4); t4.forEach(function(t5) { -1 !== o3.indexOf(t5.name) && (e4[t5.name] = r4[t5.name]), -1 !== o3.indexOf(t5.alias) && (e4[t5.alias] = r4[t5.alias]); }); } }; }, 86081: (e3, t3, r3) => { var n2 = r3(29033).Buffer; Object.defineProperty(t3, "__esModule", { value: true }), t3.hashPersonalMessage = t3.isValidSignature = t3.fromRpcSig = t3.toCompactSig = t3.toRpcSig = t3.ecrecover = t3.ecsign = void 0; var i2 = r3(31439), o2 = r3(49100), a2 = r3(13464), s2 = r3(39808), u2 = r3(5725), c2 = r3(35513); function f2(e4, t4) { var r4 = (0, c2.toType)(e4, c2.TypeOutput.BN); if (r4.eqn(0) || r4.eqn(1)) return (0, c2.toType)(e4, c2.TypeOutput.BN); if (!t4) return r4.subn(27); var n3 = (0, c2.toType)(t4, c2.TypeOutput.BN); return r4.sub(n3.muln(2).addn(35)); } function d2(e4) { var t4 = new o2.BN(e4); return t4.eqn(0) || t4.eqn(1); } t3.ecsign = function(e4, t4, r4) { var o3 = (0, i2.ecdsaSign)(e4, t4), a3 = o3.signature, s3 = o3.recid, u3 = n2.from(a3.slice(0, 32)), f3 = n2.from(a3.slice(32, 64)); if (!r4 || "number" == typeof r4) { if (r4 && !Number.isSafeInteger(r4)) throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)"); return { r: u3, s: f3, v: r4 ? s3 + (2 * r4 + 35) : s3 + 27 }; } return { r: u3, s: f3, v: (0, c2.toType)(r4, c2.TypeOutput.BN).muln(2).addn(35).addn(s3).toArrayLike(n2) }; }, t3.ecrecover = function(e4, t4, r4, o3, s3) { var u3 = n2.concat([(0, a2.setLengthLeft)(r4, 32), (0, a2.setLengthLeft)(o3, 32)], 64), c3 = f2(t4, s3); if (!d2(c3)) throw new Error("Invalid signature v value"); var l2 = (0, i2.ecdsaRecover)(u3, c3.toNumber(), e4); return n2.from((0, i2.publicKeyConvert)(l2, false).slice(1)); }, t3.toRpcSig = function(e4, t4, r4, i3) { if (!d2(f2(e4, i3))) throw new Error("Invalid signature v value"); return (0, a2.bufferToHex)(n2.concat([(0, a2.setLengthLeft)(t4, 32), (0, a2.setLengthLeft)(r4, 32), (0, a2.toBuffer)(e4)])); }, t3.toCompactSig = function(e4, t4, r4, i3) { if (!d2(f2(e4, i3))) throw new Error("Invalid signature v value"); var o3 = (0, c2.toType)(e4, c2.TypeOutput.Number), s3 = r4; return (o3 > 28 && o3 % 2 == 1 || 1 === o3 || 28 === o3) && ((s3 = n2.from(r4))[0] |= 128), (0, a2.bufferToHex)(n2.concat([(0, a2.setLengthLeft)(t4, 32), (0, a2.setLengthLeft)(s3, 32)])); }, t3.fromRpcSig = function(e4) { var t4, r4, n3, i3 = (0, a2.toBuffer)(e4); if (i3.length >= 65) t4 = i3.slice(0, 32), r4 = i3.slice(32, 64), n3 = (0, a2.bufferToInt)(i3.slice(64)); else { if (64 !== i3.length) throw new Error("Invalid signature length"); t4 = i3.slice(0, 32), r4 = i3.slice(32, 64), n3 = (0, a2.bufferToInt)(i3.slice(32, 33)) >> 7, r4[0] &= 127; } return n3 < 27 && (n3 += 27), { v: n3, r: t4, s: r4 }; }, t3.isValidSignature = function(e4, t4, r4, n3, i3) { void 0 === n3 && (n3 = true); var a3 = new o2.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0", 16), s3 = new o2.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16); if (32 !== t4.length || 32 !== r4.length) return false; if (!d2(f2(e4, i3))) return false; var u3 = new o2.BN(t4), c3 = new o2.BN(r4); return !(u3.isZero() || u3.gt(s3) || c3.isZero() || c3.gt(s3) || n3 && 1 === c3.cmp(a3)); }, t3.hashPersonalMessage = function(e4) { (0, u2.assertIsBuffer)(e4); var t4 = n2.from("Ethereum Signed Message:\n".concat(e4.length), "utf-8"); return (0, s2.keccak)(n2.concat([t4, e4])); }; }, 35513: (e3, t3, r3) => { var n2 = r3(29033).Buffer; Object.defineProperty(t3, "__esModule", { value: true }), t3.toType = t3.TypeOutput = t3.bnToRlp = t3.bnToUnpaddedBuffer = t3.bnToHex = void 0; var i2, o2 = r3(49100), a2 = r3(23271), s2 = r3(13464); function u2(e4) { return (0, s2.unpadBuffer)(e4.toArrayLike(n2)); } t3.bnToHex = function(e4) { return "0x".concat(e4.toString(16)); }, t3.bnToUnpaddedBuffer = u2, t3.bnToRlp = function(e4) { return u2(e4); }, function(e4) { e4[e4.Number = 0] = "Number", e4[e4.BN = 1] = "BN", e4[e4.Buffer = 2] = "Buffer", e4[e4.PrefixedHexString = 3] = "PrefixedHexString"; }(i2 = t3.TypeOutput || (t3.TypeOutput = {})), t3.toType = function(e4, t4) { if (null === e4) return null; if (void 0 !== e4) { if ("string" == typeof e4 && !(0, a2.isHexString)(e4)) throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e4)); if ("number" == typeof e4 && !Number.isSafeInteger(e4)) throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)"); var r4 = (0, s2.toBuffer)(e4); if (t4 === i2.Buffer) return r4; if (t4 === i2.BN) return new o2.BN(r4); if (t4 === i2.Number) { var n3 = new o2.BN(r4), u3 = new o2.BN(Number.MAX_SAFE_INTEGER.toString()); if (n3.gt(u3)) throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)"); return n3.toNumber(); } return "0x".concat(r4.toString("hex")); } }; }, 73303: (e3, t3, r3) => { var n2 = r3(29033).Buffer; Object.defineProperty(t3, "__esModule", { value: true }), t3.createHashFunction = function(e4) { return function(t4) { var r4 = e4(); return r4.update(t4), n2.from(r4.digest()); }; }; }, 8235: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }); var n2 = r3(73303), i2 = r3(93135); t3.keccak224 = n2.createHashFunction(function() { return i2("keccak224"); }), t3.keccak256 = n2.createHashFunction(function() { return i2("keccak256"); }), t3.keccak384 = n2.createHashFunction(function() { return i2("keccak384"); }), t3.keccak512 = n2.createHashFunction(function() { return i2("keccak512"); }); }, 40739: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }); var n2 = r3(75010); t3.getRandomBytes = function(e4) { return new Promise(function(t4, r4) { n2(e4, function(e5, n3) { e5 ? r4(e5) : t4(n3); }); }); }, t3.getRandomBytesSync = function(e4) { return n2(e4); }; }, 31439: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }); var n2 = r3(57902), i2 = r3(40739); t3.createPrivateKey = function() { return e4 = this, t4 = void 0, o2 = function() { var e5; return function(e6, t5) { var r5, n3, i3, o3, a2 = { label: 0, sent: function() { if (1 & i3[0]) throw i3[1]; return i3[1]; }, trys: [], ops: [] }; return o3 = { next: s2(0), throw: s2(1), return: s2(2) }, "function" == typeof Symbol && (o3[Symbol.iterator] = function() { return this; }), o3; function s2(o4) { return function(s3) { return function(o5) { if (r5) throw new TypeError("Generator is already executing."); for (; a2; ) try { if (r5 = 1, n3 && (i3 = 2 & o5[0] ? n3.return : o5[0] ? n3.throw || ((i3 = n3.return) && i3.call(n3), 0) : n3.next) && !(i3 = i3.call(n3, o5[1])).done) return i3; switch (n3 = 0, i3 && (o5 = [2 & o5[0], i3.value]), o5[0]) { case 0: case 1: i3 = o5; break; case 4: return a2.label++, { value: o5[1], done: false }; case 5: a2.label++, n3 = o5[1], o5 = [0]; continue; case 7: o5 = a2.ops.pop(), a2.trys.pop(); continue; default: if (!((i3 = (i3 = a2.trys).length > 0 && i3[i3.length - 1]) || 6 !== o5[0] && 2 !== o5[0])) { a2 = 0; continue; } if (3 === o5[0] && (!i3 || o5[1] > i3[0] && o5[1] < i3[3])) { a2.label = o5[1]; break; } if (6 === o5[0] && a2.label < i3[1]) { a2.label = i3[1], i3 = o5; break; } if (i3 && a2.label < i3[2]) { a2.label = i3[2], a2.ops.push(o5); break; } i3[2] && a2.ops.pop(), a2.trys.pop(); continue; } o5 = t5.call(e6, a2); } catch (e7) { o5 = [6, e7], n3 = 0; } finally { r5 = i3 = 0; } if (5 & o5[0]) throw o5[1]; return { value: o5[0] ? o5[1] : void 0, done: true }; }([o4, s3]); }; } }(this, function(t5) { switch (t5.label) { case 0: return [4, i2.getRandomBytes(32)]; case 1: return e5 = t5.sent(), n2.privateKeyVerify(e5) ? [2, e5] : [3, 0]; case 2: return [2]; } }); }, new ((r4 = void 0) || (r4 = Promise))(function(n3, i3) { function a2(e5) { try { u2(o2.next(e5)); } catch (e6) { i3(e6); } } function s2(e5) { try { u2(o2.throw(e5)); } catch (e6) { i3(e6); } } function u2(e5) { var t5; e5.done ? n3(e5.value) : (t5 = e5.value, t5 instanceof r4 ? t5 : new r4(function(e6) { e6(t5); })).then(a2, s2); } u2((o2 = o2.apply(e4, t4 || [])).next()); }); var e4, t4, r4, o2; }, t3.createPrivateKeySync = function() { for (; ; ) { var e4 = i2.getRandomBytesSync(32); if (n2.privateKeyVerify(e4)) return e4; } }, function(e4) { for (var r4 in e4) t3.hasOwnProperty(r4) || (t3[r4] = e4[r4]); }(r3(57902)); }, 17130: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(31734), o2 = r3(77277), a2 = new i2(0), s2 = new i2(-1), u2 = { noether: "0", wei: "1", kwei: "1000", Kwei: "1000", babbage: "1000", femtoether: "1000", mwei: "1000000", Mwei: "1000000", lovelace: "1000000", picoether: "1000000", gwei: "1000000000", Gwei: "1000000000", shannon: "1000000000", nanoether: "1000000000", nano: "1000000000", szabo: "1000000000000", microether: "1000000000000", micro: "1000000000000", finney: "1000000000000000", milliether: "1000000000000000", milli: "1000000000000000", ether: "1000000000000000000", kether: "1000000000000000000000", grand: "1000000000000000000000", mether: "1000000000000000000000000", gether: "1000000000000000000000000000", tether: "1000000000000000000000000000000" }; function c2(e4) { var t4 = e4 ? e4.toLowerCase() : "ether", r4 = u2[t4]; if ("string" != typeof r4) throw new Error("[ethjs-unit] the unit provided " + e4 + " doesn't exists, please use the one of the following units " + JSON.stringify(u2, null, 2)); return new i2(r4, 10); } function f2(e4) { if ("string" == typeof e4) { if (!e4.match(/^-?[0-9.]+$/)) throw new Error("while converting number to string, invalid number value '" + e4 + "', should be a number matching (^-?[0-9.]+)."); return e4; } if ("number" == typeof e4) return String(e4); if ("object" === (0, n2.default)(e4) && e4.toString && (e4.toTwos || e4.dividedToIntegerBy)) return e4.toPrecision ? String(e4.toPrecision()) : e4.toString(10); throw new Error("while converting number to string, invalid number value '" + e4 + "' type " + (0, n2.default)(e4) + "."); } e3.exports = { unitMap: u2, numberToString: f2, getValueOfUnit: c2, fromWei: function(e4, t4, r4) { var n3 = o2(e4), i3 = n3.lt(a2), f3 = c2(t4), d2 = u2[t4].length - 1 || 1, l2 = r4 || {}; i3 && (n3 = n3.mul(s2)); for (var h2 = n3.mod(f3).toString(10); h2.length < d2; ) h2 = "0" + h2; l2.pad || (h2 = h2.match(/^([0-9]*[1-9]|0)(0*)/)[1]); var p2 = n3.div(f3).toString(10); l2.commify && (p2 = p2.replace(/\B(?=(\d{3})+(?!\d))/g, ",")); var b2 = p2 + ("0" == h2 ? "" : "." + h2); return i3 && (b2 = "-" + b2), b2; }, toWei: function(e4, t4) { var r4 = f2(e4), n3 = c2(t4), o3 = u2[t4].length - 1 || 1, a3 = "-" === r4.substring(0, 1); if (a3 && (r4 = r4.substring(1)), "." === r4) throw new Error("[ethjs-unit] while converting number " + e4 + " to wei, invalid value"); var d2 = r4.split("."); if (d2.length > 2) throw new Error("[ethjs-unit] while converting number " + e4 + " to wei, too many decimal points"); var l2 = d2[0], h2 = d2[1]; if (l2 || (l2 = "0"), h2 || (h2 = "0"), h2.length > o3) throw new Error("[ethjs-unit] while converting number " + e4 + " to wei, too many decimal places"); for (; h2.length < o3; ) h2 += "0"; l2 = new i2(l2), h2 = new i2(h2); var p2 = l2.mul(n3).add(h2); return a3 && (p2 = p2.mul(s2)), new i2(p2.toString(10), 10); } }; }, 98008: (e3) => { var t3 = Object.prototype.hasOwnProperty, r3 = "~"; function n2() { } function i2(e4, t4, r4) { this.fn = e4, this.context = t4, this.once = r4 || false; } function o2(e4, t4, n3, o3, a3) { if ("function" != typeof n3) throw new TypeError("The listener must be a function"); var s3 = new i2(n3, o3 || e4, a3), u2 = r3 ? r3 + t4 : t4; return e4._events[u2] ? e4._events[u2].fn ? e4._events[u2] = [e4._events[u2], s3] : e4._events[u2].push(s3) : (e4._events[u2] = s3, e4._eventsCount++), e4; } function a2(e4, t4) { 0 == --e4._eventsCount ? e4._events = new n2() : delete e4._events[t4]; } function s2() { this._events = new n2(), this._eventsCount = 0; } Object.create && (n2.prototype = /* @__PURE__ */ Object.create(null), new n2().__proto__ || (r3 = false)), s2.prototype.eventNames = function() { var e4, n3, i3 = []; if (0 === this._eventsCount) return i3; for (n3 in e4 = this._events) t3.call(e4, n3) && i3.push(r3 ? n3.slice(1) : n3); return Object.getOwnPropertySymbols ? i3.concat(Object.getOwnPropertySymbols(e4)) : i3; }, s2.prototype.listeners = function(e4) { var t4 = r3 ? r3 + e4 : e4, n3 = this._events[t4]; if (!n3) return []; if (n3.fn) return [n3.fn]; for (var i3 = 0, o3 = n3.length, a3 = new Array(o3); i3 < o3; i3++) a3[i3] = n3[i3].fn; return a3; }, s2.prototype.listenerCount = function(e4) { var t4 = r3 ? r3 + e4 : e4, n3 = this._events[t4]; return n3 ? n3.fn ? 1 : n3.length : 0; }, s2.prototype.emit = function(e4, t4, n3, i3, o3, a3) { var s3 = r3 ? r3 + e4 : e4; if (!this._events[s3]) return false; var u2, c2, f2 = this._events[s3], d2 = arguments.length; if (f2.fn) { switch (f2.once && this.removeListener(e4, f2.fn, void 0, true), d2) { case 1: return f2.fn.call(f2.context), true; case 2: return f2.fn.call(f2.context, t4), true; case 3: return f2.fn.call(f2.context, t4, n3), true; case 4: return f2.fn.call(f2.context, t4, n3, i3), true; case 5: return f2.fn.call(f2.context, t4, n3, i3, o3), true; case 6: return f2.fn.call(f2.context, t4, n3, i3, o3, a3), true; } for (c2 = 1, u2 = new Array(d2 - 1); c2 < d2; c2++) u2[c2 - 1] = arguments[c2]; f2.fn.apply(f2.context, u2); } else { var l2, h2 = f2.length; for (c2 = 0; c2 < h2; c2++) switch (f2[c2].once && this.removeListener(e4, f2[c2].fn, void 0, true), d2) { case 1: f2[c2].fn.call(f2[c2].context); break; case 2: f2[c2].fn.call(f2[c2].context, t4); break; case 3: f2[c2].fn.call(f2[c2].context, t4, n3); break; case 4: f2[c2].fn.call(f2[c2].context, t4, n3, i3); break; default: if (!u2) for (l2 = 1, u2 = new Array(d2 - 1); l2 < d2; l2++) u2[l2 - 1] = arguments[l2]; f2[c2].fn.apply(f2[c2].context, u2); } } return true; }, s2.prototype.on = function(e4, t4, r4) { return o2(this, e4, t4, r4, false); }, s2.prototype.once = function(e4, t4, r4) { return o2(this, e4, t4, r4, true); }, s2.prototype.removeListener = function(e4, t4, n3, i3) { var o3 = r3 ? r3 + e4 : e4; if (!this._events[o3]) return this; if (!t4) return a2(this, o3), this; var s3 = this._events[o3]; if (s3.fn) s3.fn !== t4 || i3 && !s3.once || n3 && s3.context !== n3 || a2(this, o3); else { for (var u2 = 0, c2 = [], f2 = s3.length; u2 < f2; u2++) (s3[u2].fn !== t4 || i3 && !s3[u2].once || n3 && s3[u2].context !== n3) && c2.push(s3[u2]); c2.length ? this._events[o3] = 1 === c2.length ? c2[0] : c2 : a2(this, o3); } return this; }, s2.prototype.removeAllListeners = function(e4) { var t4; return e4 ? (t4 = r3 ? r3 + e4 : e4, this._events[t4] && a2(this, t4)) : (this._events = new n2(), this._eventsCount = 0), this; }, s2.prototype.off = s2.prototype.removeListener, s2.prototype.addListener = s2.prototype.on, s2.prefixed = r3, s2.EventEmitter = s2, e3.exports = s2; }, 38291: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = Object.create || function(e4) { var t4 = function() { }; return t4.prototype = e4, new t4(); }, o2 = Object.keys || function(e4) { var t4 = []; for (var r4 in e4) Object.prototype.hasOwnProperty.call(e4, r4) && t4.push(r4); return r4; }, a2 = Function.prototype.bind || function(e4) { var t4 = this; return function() { return t4.apply(e4, arguments); }; }; function s2() { this._events && Object.prototype.hasOwnProperty.call(this, "_events") || (this._events = i2(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0; } e3.exports = s2, s2.EventEmitter = s2, s2.prototype._events = void 0, s2.prototype._maxListeners = void 0; var u2, c2 = 10; try { var f2 = {}; Object.defineProperty && Object.defineProperty(f2, "x", { value: 0 }), u2 = 0 === f2.x; } catch (e4) { u2 = false; } function d2(e4) { return void 0 === e4._maxListeners ? s2.defaultMaxListeners : e4._maxListeners; } function l2(e4, t4, r4, o3) { var a3, s3, u3; if ("function" != typeof r4) throw new TypeError('"listener" argument must be a function'); if ((s3 = e4._events) ? (s3.newListener && (e4.emit("newListener", t4, r4.listener ? r4.listener : r4), s3 = e4._events), u3 = s3[t4]) : (s3 = e4._events = i2(null), e4._eventsCount = 0), u3) { if ("function" == typeof u3 ? u3 = s3[t4] = o3 ? [r4, u3] : [u3, r4] : o3 ? u3.unshift(r4) : u3.push(r4), !u3.warned && (a3 = d2(e4)) && a3 > 0 && u3.length > a3) { u3.warned = true; var c3 = new Error("Possible EventEmitter memory leak detected. " + u3.length + ' "' + String(t4) + '" listeners added. Use emitter.setMaxListeners() to increase limit.'); c3.name = "MaxListenersExceededWarning", c3.emitter = e4, c3.type = t4, c3.count = u3.length, "object" === ("undefined" == typeof console ? "undefined" : (0, n2.default)(console)) && console.warn && console.warn("%s: %s", c3.name, c3.message); } } else u3 = s3[t4] = r4, ++e4._eventsCount; return e4; } function h2() { if (!this.fired) switch (this.target.removeListener(this.type, this.wrapFn), this.fired = true, arguments.length) { case 0: return this.listener.call(this.target); case 1: return this.listener.call(this.target, arguments[0]); case 2: return this.listener.call(this.target, arguments[0], arguments[1]); case 3: return this.listener.call(this.target, arguments[0], arguments[1], arguments[2]); default: for (var e4 = new Array(arguments.length), t4 = 0; t4 < e4.length; ++t4) e4[t4] = arguments[t4]; this.listener.apply(this.target, e4); } } function p2(e4, t4, r4) { var n3 = { fired: false, wrapFn: void 0, target: e4, type: t4, listener: r4 }, i3 = a2.call(h2, n3); return i3.listener = r4, n3.wrapFn = i3, i3; } function b2(e4, t4, r4) { var n3 = e4._events; if (!n3) return []; var i3 = n3[t4]; return i3 ? "function" == typeof i3 ? r4 ? [i3.listener || i3] : [i3] : r4 ? function(e5) { for (var t5 = new Array(e5.length), r5 = 0; r5 < t5.length; ++r5) t5[r5] = e5[r5].listener || e5[r5]; return t5; }(i3) : v2(i3, i3.length) : []; } function y2(e4) { var t4 = this._events; if (t4) { var r4 = t4[e4]; if ("function" == typeof r4) return 1; if (r4) return r4.length; } return 0; } function v2(e4, t4) { for (var r4 = new Array(t4), n3 = 0; n3 < t4; ++n3) r4[n3] = e4[n3]; return r4; } u2 ? Object.defineProperty(s2, "defaultMaxListeners", { enumerable: true, get: function() { return c2; }, set: function(e4) { if ("number" != typeof e4 || e4 < 0 || e4 != e4) throw new TypeError('"defaultMaxListeners" must be a positive number'); c2 = e4; } }) : s2.defaultMaxListeners = c2, s2.prototype.setMaxListeners = function(e4) { if ("number" != typeof e4 || e4 < 0 || isNaN(e4)) throw new TypeError('"n" argument must be a positive number'); return this._maxListeners = e4, this; }, s2.prototype.getMaxListeners = function() { return d2(this); }, s2.prototype.emit = function(e4) { var t4, r4, n3, i3, o3, a3, s3 = "error" === e4; if (a3 = this._events) s3 = s3 && null == a3.error; else if (!s3) return false; if (s3) { if (arguments.length > 1 && (t4 = arguments[1]), t4 instanceof Error) throw t4; var u3 = new Error('Unhandled "error" event. (' + t4 + ")"); throw u3.context = t4, u3; } if (!(r4 = a3[e4])) return false; var c3 = "function" == typeof r4; switch (n3 = arguments.length) { case 1: !function(e5, t5, r5) { if (t5) e5.call(r5); else for (var n4 = e5.length, i4 = v2(e5, n4), o4 = 0; o4 < n4; ++o4) i4[o4].call(r5); }(r4, c3, this); break; case 2: !function(e5, t5, r5, n4) { if (t5) e5.call(r5, n4); else for (var i4 = e5.length, o4 = v2(e5, i4), a4 = 0; a4 < i4; ++a4) o4[a4].call(r5, n4); }(r4, c3, this, arguments[1]); break; case 3: !function(e5, t5, r5, n4, i4) { if (t5) e5.call(r5, n4, i4); else for (var o4 = e5.length, a4 = v2(e5, o4), s4 = 0; s4 < o4; ++s4) a4[s4].call(r5, n4, i4); }(r4, c3, this, arguments[1], arguments[2]); break; case 4: !function(e5, t5, r5, n4, i4, o4) { if (t5) e5.call(r5, n4, i4, o4); else for (var a4 = e5.length, s4 = v2(e5, a4), u4 = 0; u4 < a4; ++u4) s4[u4].call(r5, n4, i4, o4); }(r4, c3, this, arguments[1], arguments[2], arguments[3]); break; default: for (i3 = new Array(n3 - 1), o3 = 1; o3 < n3; o3++) i3[o3 - 1] = arguments[o3]; !function(e5, t5, r5, n4) { if (t5) e5.apply(r5, n4); else for (var i4 = e5.length, o4 = v2(e5, i4), a4 = 0; a4 < i4; ++a4) o4[a4].apply(r5, n4); }(r4, c3, this, i3); } return true; }, s2.prototype.addListener = function(e4, t4) { return l2(this, e4, t4, false); }, s2.prototype.on = s2.prototype.addListener, s2.prototype.prependListener = function(e4, t4) { return l2(this, e4, t4, true); }, s2.prototype.once = function(e4, t4) { if ("function" != typeof t4) throw new TypeError('"listener" argument must be a function'); return this.on(e4, p2(this, e4, t4)), this; }, s2.prototype.prependOnceListener = function(e4, t4) { if ("function" != typeof t4) throw new TypeError('"listener" argument must be a function'); return this.prependListener(e4, p2(this, e4, t4)), this; }, s2.prototype.removeListener = function(e4, t4) { var r4, n3, o3, a3, s3; if ("function" != typeof t4) throw new TypeError('"listener" argument must be a function'); if (!(n3 = this._events)) return this; if (!(r4 = n3[e4])) return this; if (r4 === t4 || r4.listener === t4) 0 == --this._eventsCount ? this._events = i2(null) : (delete n3[e4], n3.removeListener && this.emit("removeListener", e4, r4.listener || t4)); else if ("function" != typeof r4) { for (o3 = -1, a3 = r4.length - 1; a3 >= 0; a3--) if (r4[a3] === t4 || r4[a3].listener === t4) { s3 = r4[a3].listener, o3 = a3; break; } if (o3 < 0) return this; 0 === o3 ? r4.shift() : function(e5, t5) { for (var r5 = t5, n4 = r5 + 1, i3 = e5.length; n4 < i3; r5 += 1, n4 += 1) e5[r5] = e5[n4]; e5.pop(); }(r4, o3), 1 === r4.length && (n3[e4] = r4[0]), n3.removeListener && this.emit("removeListener", e4, s3 || t4); } return this; }, s2.prototype.removeAllListeners = function(e4) { var t4, r4, n3; if (!(r4 = this._events)) return this; if (!r4.removeListener) return 0 === arguments.length ? (this._events = i2(null), this._eventsCount = 0) : r4[e4] && (0 == --this._eventsCount ? this._events = i2(null) : delete r4[e4]), this; if (0 === arguments.length) { var a3, s3 = o2(r4); for (n3 = 0; n3 < s3.length; ++n3) "removeListener" !== (a3 = s3[n3]) && this.removeAllListeners(a3); return this.removeAllListeners("removeListener"), this._events = i2(null), this._eventsCount = 0, this; } if ("function" == typeof (t4 = r4[e4])) this.removeListener(e4, t4); else if (t4) for (n3 = t4.length - 1; n3 >= 0; n3--) this.removeListener(e4, t4[n3]); return this; }, s2.prototype.listeners = function(e4) { return b2(this, e4, true); }, s2.prototype.rawListeners = function(e4) { return b2(this, e4, false); }, s2.listenerCount = function(e4, t4) { return "function" == typeof e4.listenerCount ? e4.listenerCount(t4) : y2.call(e4, t4); }, s2.prototype.listenerCount = y2, s2.prototype.eventNames = function() { return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []; }; }, 27085: (e3, t3, r3) => { var n2 = r3(48850).Buffer, i2 = r3(50807); e3.exports = function(e4, t4, r4, o2) { if (n2.isBuffer(e4) || (e4 = n2.from(e4, "binary")), t4 && (n2.isBuffer(t4) || (t4 = n2.from(t4, "binary")), 8 !== t4.length)) throw new RangeError("salt should be Buffer with 8 byte length"); for (var a2 = r4 / 8, s2 = n2.alloc(a2), u2 = n2.alloc(o2 || 0), c2 = n2.alloc(0); a2 > 0 || o2 > 0; ) { var f2 = new i2(); f2.update(c2), f2.update(e4), t4 && f2.update(t4), c2 = f2.digest(); var d2 = 0; if (a2 > 0) { var l2 = s2.length - a2; d2 = Math.min(a2, c2.length), c2.copy(s2, l2, 0, d2), a2 -= d2; } if (d2 < c2.length && o2 > 0) { var h2 = u2.length - o2, p2 = Math.min(o2, c2.length - d2); c2.copy(u2, h2, d2, d2 + p2), o2 -= p2; } } return c2.fill(0), { key: s2, iv: u2 }; }; }, 48184: (e3, t3, r3) => { var n2 = r3(41493), i2 = Object.prototype.toString, o2 = Object.prototype.hasOwnProperty; e3.exports = function(e4, t4, r4) { if (!n2(t4)) throw new TypeError("iterator must be a function"); var a2; arguments.length >= 3 && (a2 = r4), "[object Array]" === i2.call(e4) ? function(e5, t5, r5) { for (var n3 = 0, i3 = e5.length; n3 < i3; n3++) o2.call(e5, n3) && (null == r5 ? t5(e5[n3], n3, e5) : t5.call(r5, e5[n3], n3, e5)); }(e4, t4, a2) : "string" == typeof e4 ? function(e5, t5, r5) { for (var n3 = 0, i3 = e5.length; n3 < i3; n3++) null == r5 ? t5(e5.charAt(n3), n3, e5) : t5.call(r5, e5.charAt(n3), n3, e5); }(e4, t4, a2) : function(e5, t5, r5) { for (var n3 in e5) o2.call(e5, n3) && (null == r5 ? t5(e5[n3], n3, e5) : t5.call(r5, e5[n3], n3, e5)); }(e4, t4, a2); }; }, 83161: (e3) => { var t3 = Object.prototype.toString, r3 = Math.max, n2 = function(e4, t4) { for (var r4 = [], n3 = 0; n3 < e4.length; n3 += 1) r4[n3] = e4[n3]; for (var i2 = 0; i2 < t4.length; i2 += 1) r4[i2 + e4.length] = t4[i2]; return r4; }; e3.exports = function(e4) { var i2 = this; if ("function" != typeof i2 || "[object Function]" !== t3.apply(i2)) throw new TypeError("Function.prototype.bind called on incompatible " + i2); for (var o2, a2 = function(e5, t4) { for (var r4 = [], n3 = 1, i3 = 0; n3 < e5.length; n3 += 1, i3 += 1) r4[i3] = e5[n3]; return r4; }(arguments), s2 = r3(0, i2.length - a2.length), u2 = [], c2 = 0; c2 < s2; c2++) u2[c2] = "$" + c2; if (o2 = Function("binder", "return function (" + function(e5, t4) { for (var r4 = "", n3 = 0; n3 < e5.length; n3 += 1) r4 += e5[n3], n3 + 1 < e5.length && (r4 += ","); return r4; }(u2) + "){ return binder.apply(this,arguments); }")(function() { if (this instanceof o2) { var t4 = i2.apply(this, n2(a2, arguments)); return Object(t4) === t4 ? t4 : this; } return i2.apply(e4, n2(a2, arguments)); }), i2.prototype) { var f2 = function() { }; f2.prototype = i2.prototype, o2.prototype = new f2(), f2.prototype = null; } return o2; }; }, 3767: (e3, t3, r3) => { var n2 = r3(83161); e3.exports = Function.prototype.bind || n2; }, 57701: (e3, t3, r3) => { var n2, i2 = r3(28847)(r3(3355)), o2 = SyntaxError, a2 = Function, s2 = TypeError, u2 = function(e4) { try { return a2('"use strict"; return (' + e4 + ").constructor;")(); } catch (e5) { } }, c2 = Object.getOwnPropertyDescriptor; if (c2) try { c2({}, ""); } catch (e4) { c2 = null; } var f2 = function() { throw new s2(); }, d2 = c2 ? function() { try { return f2; } catch (e4) { try { return c2(arguments, "callee").get; } catch (e5) { return f2; } } }() : f2, l2 = r3(58489)(), h2 = r3(61593)(), p2 = Object.getPrototypeOf || (h2 ? function(e4) { return e4.__proto__; } : null), b2 = {}, y2 = "undefined" != typeof Uint8Array && p2 ? p2(Uint8Array) : n2, v2 = { "%AggregateError%": "undefined" == typeof AggregateError ? n2 : AggregateError, "%Array%": Array, "%ArrayBuffer%": "undefined" == typeof ArrayBuffer ? n2 : ArrayBuffer, "%ArrayIteratorPrototype%": l2 && p2 ? p2([][Symbol.iterator]()) : n2, "%AsyncFromSyncIteratorPrototype%": n2, "%AsyncFunction%": b2, "%AsyncGenerator%": b2, "%AsyncGeneratorFunction%": b2, "%AsyncIteratorPrototype%": b2, "%Atomics%": "undefined" == typeof Atomics ? n2 : Atomics, "%BigInt%": "undefined" == typeof BigInt ? n2 : BigInt, "%BigInt64Array%": "undefined" == typeof BigInt64Array ? n2 : BigInt64Array, "%BigUint64Array%": "undefined" == typeof BigUint64Array ? n2 : BigUint64Array, "%Boolean%": Boolean, "%DataView%": "undefined" == typeof DataView ? n2 : DataView, "%Date%": Date, "%decodeURI%": decodeURI, "%decodeURIComponent%": decodeURIComponent, "%encodeURI%": encodeURI, "%encodeURIComponent%": encodeURIComponent, "%Error%": Error, "%eval%": eval, "%EvalError%": EvalError, "%Float32Array%": "undefined" == typeof Float32Array ? n2 : Float32Array, "%Float64Array%": "undefined" == typeof Float64Array ? n2 : Float64Array, "%FinalizationRegistry%": "undefined" == typeof FinalizationRegistry ? n2 : FinalizationRegistry, "%Function%": a2, "%GeneratorFunction%": b2, "%Int8Array%": "undefined" == typeof Int8Array ? n2 : Int8Array, "%Int16Array%": "undefined" == typeof Int16Array ? n2 : Int16Array, "%Int32Array%": "undefined" == typeof Int32Array ? n2 : Int32Array, "%isFinite%": isFinite, "%isNaN%": isNaN, "%IteratorPrototype%": l2 && p2 ? p2(p2([][Symbol.iterator]())) : n2, "%JSON%": "object" === ("undefined" == typeof JSON ? "undefined" : (0, i2.default)(JSON)) ? JSON : n2, "%Map%": "undefined" == typeof Map ? n2 : Map, "%MapIteratorPrototype%": "undefined" != typeof Map && l2 && p2 ? p2((/* @__PURE__ */ new Map())[Symbol.iterator]()) : n2, "%Math%": Math, "%Number%": Number, "%Object%": Object, "%parseFloat%": parseFloat, "%parseInt%": parseInt, "%Promise%": "undefined" == typeof Promise ? n2 : Promise, "%Proxy%": "undefined" == typeof Proxy ? n2 : Proxy, "%RangeError%": RangeError, "%ReferenceError%": ReferenceError, "%Reflect%": "undefined" == typeof Reflect ? n2 : Reflect, "%RegExp%": RegExp, "%Set%": "undefined" == typeof Set ? n2 : Set, "%SetIteratorPrototype%": "undefined" != typeof Set && l2 && p2 ? p2((/* @__PURE__ */ new Set())[Symbol.iterator]()) : n2, "%SharedArrayBuffer%": "undefined" == typeof SharedArrayBuffer ? n2 : SharedArrayBuffer, "%String%": String, "%StringIteratorPrototype%": l2 && p2 ? p2(""[Symbol.iterator]()) : n2, "%Symbol%": l2 ? Symbol : n2, "%SyntaxError%": o2, "%ThrowTypeError%": d2, "%TypedArray%": y2, "%TypeError%": s2, "%Uint8Array%": "undefined" == typeof Uint8Array ? n2 : Uint8Array, "%Uint8ClampedArray%": "undefined" == typeof Uint8ClampedArray ? n2 : Uint8ClampedArray, "%Uint16Array%": "undefined" == typeof Uint16Array ? n2 : Uint16Array, "%Uint32Array%": "undefined" == typeof Uint32Array ? n2 : Uint32Array, "%URIError%": URIError, "%WeakMap%": "undefined" == typeof WeakMap ? n2 : WeakMap, "%WeakRef%": "undefined" == typeof WeakRef ? n2 : WeakRef, "%WeakSet%": "undefined" == typeof WeakSet ? n2 : WeakSet }; if (p2) try { null.error; } catch (e4) { var m2 = p2(p2(e4)); v2["%Error.prototype%"] = m2; } var g2 = function e4(t4) { var r4; if ("%AsyncFunction%" === t4) r4 = u2("async function () {}"); else if ("%GeneratorFunction%" === t4) r4 = u2("function* () {}"); else if ("%AsyncGeneratorFunction%" === t4) r4 = u2("async function* () {}"); else if ("%AsyncGenerator%" === t4) { var n3 = e4("%AsyncGeneratorFunction%"); n3 && (r4 = n3.prototype); } else if ("%AsyncIteratorPrototype%" === t4) { var i3 = e4("%AsyncGenerator%"); i3 && p2 && (r4 = p2(i3.prototype)); } return v2[t4] = r4, r4; }, w2 = { "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], "%ArrayPrototype%": ["Array", "prototype"], "%ArrayProto_entries%": ["Array", "prototype", "entries"], "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], "%ArrayProto_keys%": ["Array", "prototype", "keys"], "%ArrayProto_values%": ["Array", "prototype", "values"], "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], "%BooleanPrototype%": ["Boolean", "prototype"], "%DataViewPrototype%": ["DataView", "prototype"], "%DatePrototype%": ["Date", "prototype"], "%ErrorPrototype%": ["Error", "prototype"], "%EvalErrorPrototype%": ["EvalError", "prototype"], "%Float32ArrayPrototype%": ["Float32Array", "prototype"], "%Float64ArrayPrototype%": ["Float64Array", "prototype"], "%FunctionPrototype%": ["Function", "prototype"], "%Generator%": ["GeneratorFunction", "prototype"], "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], "%Int8ArrayPrototype%": ["Int8Array", "prototype"], "%Int16ArrayPrototype%": ["Int16Array", "prototype"], "%Int32ArrayPrototype%": ["Int32Array", "prototype"], "%JSONParse%": ["JSON", "parse"], "%JSONStringify%": ["JSON", "stringify"], "%MapPrototype%": ["Map", "prototype"], "%NumberPrototype%": ["Number", "prototype"], "%ObjectPrototype%": ["Object", "prototype"], "%ObjProto_toString%": ["Object", "prototype", "toString"], "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], "%PromisePrototype%": ["Promise", "prototype"], "%PromiseProto_then%": ["Promise", "prototype", "then"], "%Promise_all%": ["Promise", "all"], "%Promise_reject%": ["Promise", "reject"], "%Promise_resolve%": ["Promise", "resolve"], "%RangeErrorPrototype%": ["RangeError", "prototype"], "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], "%RegExpPrototype%": ["RegExp", "prototype"], "%SetPrototype%": ["Set", "prototype"], "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], "%StringPrototype%": ["String", "prototype"], "%SymbolPrototype%": ["Symbol", "prototype"], "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], "%TypedArrayPrototype%": ["TypedArray", "prototype"], "%TypeErrorPrototype%": ["TypeError", "prototype"], "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], "%URIErrorPrototype%": ["URIError", "prototype"], "%WeakMapPrototype%": ["WeakMap", "prototype"], "%WeakSetPrototype%": ["WeakSet", "prototype"] }, k2 = r3(3767), _2 = r3(2383), A2 = k2.call(Function.call, Array.prototype.concat), E2 = k2.call(Function.apply, Array.prototype.splice), S2 = k2.call(Function.call, String.prototype.replace), x2 = k2.call(Function.call, String.prototype.slice), B2 = k2.call(Function.call, RegExp.prototype.exec), O2 = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, P2 = /\\(\\)?/g, I2 = function(e4, t4) { var r4, n3 = e4; if (_2(w2, n3) && (n3 = "%" + (r4 = w2[n3])[0] + "%"), _2(v2, n3)) { var i3 = v2[n3]; if (i3 === b2 && (i3 = g2(n3)), void 0 === i3 && !t4) throw new s2("intrinsic " + e4 + " exists, but is not available. Please file an issue!"); return { alias: r4, name: n3, value: i3 }; } throw new o2("intrinsic " + e4 + " does not exist!"); }; e3.exports = function(e4, t4) { if ("string" != typeof e4 || 0 === e4.length) throw new s2("intrinsic name must be a non-empty string"); if (arguments.length > 1 && "boolean" != typeof t4) throw new s2('"allowMissing" argument must be a boolean'); if (null === B2(/^%?[^%]*%?$/, e4)) throw new o2("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); var r4 = function(e5) { var t5 = x2(e5, 0, 1), r5 = x2(e5, -1); if ("%" === t5 && "%" !== r5) throw new o2("invalid intrinsic syntax, expected closing `%`"); if ("%" === r5 && "%" !== t5) throw new o2("invalid intrinsic syntax, expected opening `%`"); var n4 = []; return S2(e5, O2, function(e6, t6, r6, i4) { n4[n4.length] = r6 ? S2(i4, P2, "$1") : t6 || e6; }), n4; }(e4), n3 = r4.length > 0 ? r4[0] : "", i3 = I2("%" + n3 + "%", t4), a3 = i3.name, u3 = i3.value, f3 = false, d3 = i3.alias; d3 && (n3 = d3[0], E2(r4, A2([0, 1], d3))); for (var l3 = 1, h3 = true; l3 < r4.length; l3 += 1) { var p3 = r4[l3], b3 = x2(p3, 0, 1), y3 = x2(p3, -1); if (('"' === b3 || "'" === b3 || "`" === b3 || '"' === y3 || "'" === y3 || "`" === y3) && b3 !== y3) throw new o2("property names with quotes must have matching quotes"); if ("constructor" !== p3 && h3 || (f3 = true), _2(v2, a3 = "%" + (n3 += "." + p3) + "%")) u3 = v2[a3]; else if (null != u3) { if (!(p3 in u3)) { if (!t4) throw new s2("base intrinsic for " + e4 + " exists, but the property is not available."); return; } if (c2 && l3 + 1 >= r4.length) { var m3 = c2(u3, p3); u3 = (h3 = !!m3) && "get" in m3 && !("originalValue" in m3.get) ? m3.get : u3[p3]; } else h3 = _2(u3, p3), u3 = u3[p3]; h3 && !f3 && (v2[a3] = u3); } } return u3; }; }, 92948: (e3, t3, r3) => { var n2; n2 = "undefined" != typeof window ? window : void 0 !== r3.g ? r3.g : "undefined" != typeof self ? self : {}, e3.exports = n2; }, 53820: (e3, t3, r3) => { var n2 = r3(57701)("%Object.getOwnPropertyDescriptor%", true); if (n2) try { n2([], "length"); } catch (e4) { n2 = null; } e3.exports = n2; }, 1020: (e3, t3, r3) => { var n2 = r3(57701)("%Object.defineProperty%", true), i2 = function() { if (n2) try { return n2({}, "a", { value: 1 }), true; } catch (e4) { return false; } return false; }; i2.hasArrayLengthDefineBug = function() { if (!i2()) return null; try { return 1 !== n2([], "length", { value: 1 }).length; } catch (e4) { return true; } }, e3.exports = i2; }, 61593: (e3) => { var t3 = { foo: {} }, r3 = Object; e3.exports = function() { return { __proto__: t3 }.foo === t3.foo && !({ __proto__: null } instanceof r3); }; }, 58489: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = "undefined" != typeof Symbol && Symbol, o2 = r3(47027); e3.exports = function() { return "function" == typeof i2 && "function" == typeof Symbol && "symbol" === (0, n2.default)(i2("foo")) && "symbol" === (0, n2.default)(Symbol("bar")) && o2(); }; }, 47027: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)); e3.exports = function() { if ("function" != typeof Symbol || "function" != typeof Object.getOwnPropertySymbols) return false; if ("symbol" === (0, n2.default)(Symbol.iterator)) return true; var e4 = {}, t4 = Symbol("test"), r4 = Object(t4); if ("string" == typeof t4) return false; if ("[object Symbol]" !== Object.prototype.toString.call(t4)) return false; if ("[object Symbol]" !== Object.prototype.toString.call(r4)) return false; for (t4 in e4[t4] = 42, e4) return false; if ("function" == typeof Object.keys && 0 !== Object.keys(e4).length) return false; if ("function" == typeof Object.getOwnPropertyNames && 0 !== Object.getOwnPropertyNames(e4).length) return false; var i2 = Object.getOwnPropertySymbols(e4); if (1 !== i2.length || i2[0] !== t4) return false; if (!Object.prototype.propertyIsEnumerable.call(e4, t4)) return false; if ("function" == typeof Object.getOwnPropertyDescriptor) { var o2 = Object.getOwnPropertyDescriptor(e4, t4); if (42 !== o2.value || true !== o2.enumerable) return false; } return true; }; }, 11191: (e3, t3, r3) => { var n2 = r3(47027); e3.exports = function() { return n2() && !!Symbol.toStringTag; }; }, 22353: (e3, t3, r3) => { var n2 = r3(48850).Buffer, i2 = r3(86505).Transform; function o2(e4) { i2.call(this), this._block = n2.allocUnsafe(e4), this._blockSize = e4, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = false; } r3(41736)(o2, i2), o2.prototype._transform = function(e4, t4, r4) { var n3 = null; try { this.update(e4, t4); } catch (e5) { n3 = e5; } r4(n3); }, o2.prototype._flush = function(e4) { var t4 = null; try { this.push(this.digest()); } catch (e5) { t4 = e5; } e4(t4); }, o2.prototype.update = function(e4, t4) { if (function(e5, t5) { if (!n2.isBuffer(e5) && "string" != typeof e5) throw new TypeError("Data must be a string or a buffer"); }(e4), this._finalized) throw new Error("Digest already called"); n2.isBuffer(e4) || (e4 = n2.from(e4, t4)); for (var r4 = this._block, i3 = 0; this._blockOffset + e4.length - i3 >= this._blockSize; ) { for (var o3 = this._blockOffset; o3 < this._blockSize; ) r4[o3++] = e4[i3++]; this._update(), this._blockOffset = 0; } for (; i3 < e4.length; ) r4[this._blockOffset++] = e4[i3++]; for (var a2 = 0, s2 = 8 * e4.length; s2 > 0; ++a2) this._length[a2] += s2, (s2 = this._length[a2] / 4294967296 | 0) > 0 && (this._length[a2] -= 4294967296 * s2); return this; }, o2.prototype._update = function() { throw new Error("_update is not implemented"); }, o2.prototype.digest = function(e4) { if (this._finalized) throw new Error("Digest already called"); this._finalized = true; var t4 = this._digest(); void 0 !== e4 && (t4 = t4.toString(e4)), this._block.fill(0), this._blockOffset = 0; for (var r4 = 0; r4 < 4; ++r4) this._length[r4] = 0; return t4; }, o2.prototype._digest = function() { throw new Error("_digest is not implemented"); }, e3.exports = o2; }, 37198: (e3, t3, r3) => { var n2 = t3; n2.utils = r3(84268), n2.common = r3(64696), n2.sha = r3(39310), n2.ripemd = r3(69294), n2.hmac = r3(53201), n2.sha1 = n2.sha.sha1, n2.sha256 = n2.sha.sha256, n2.sha224 = n2.sha.sha224, n2.sha384 = n2.sha.sha384, n2.sha512 = n2.sha.sha512, n2.ripemd160 = n2.ripemd.ripemd160; }, 64696: (e3, t3, r3) => { var n2 = r3(84268), i2 = r3(94504); function o2() { 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; } t3.BlockHash = o2, o2.prototype.update = function(e4, t4) { if (e4 = n2.toArray(e4, t4), this.pending ? this.pending = this.pending.concat(e4) : this.pending = e4, this.pendingTotal += e4.length, this.pending.length >= this._delta8) { var r4 = (e4 = this.pending).length % this._delta8; this.pending = e4.slice(e4.length - r4, e4.length), 0 === this.pending.length && (this.pending = null), e4 = n2.join32(e4, 0, e4.length - r4, this.endian); for (var i3 = 0; i3 < e4.length; i3 += this._delta32) this._update(e4, i3, i3 + this._delta32); } return this; }, o2.prototype.digest = function(e4) { return this.update(this._pad()), i2(null === this.pending), this._digest(e4); }, o2.prototype._pad = function() { var e4 = this.pendingTotal, t4 = this._delta8, r4 = t4 - (e4 + this.padLength) % t4, n3 = new Array(r4 + this.padLength); n3[0] = 128; for (var i3 = 1; i3 < r4; i3++) n3[i3] = 0; if (e4 <<= 3, "big" === this.endian) { for (var o3 = 8; o3 < this.padLength; o3++) n3[i3++] = 0; n3[i3++] = 0, n3[i3++] = 0, n3[i3++] = 0, n3[i3++] = 0, n3[i3++] = e4 >>> 24 & 255, n3[i3++] = e4 >>> 16 & 255, n3[i3++] = e4 >>> 8 & 255, n3[i3++] = 255 & e4; } else for (n3[i3++] = 255 & e4, n3[i3++] = e4 >>> 8 & 255, n3[i3++] = e4 >>> 16 & 255, n3[i3++] = e4 >>> 24 & 255, n3[i3++] = 0, n3[i3++] = 0, n3[i3++] = 0, n3[i3++] = 0, o3 = 8; o3 < this.padLength; o3++) n3[i3++] = 0; return n3; }; }, 53201: (e3, t3, r3) => { var n2 = r3(84268), i2 = r3(94504); function o2(e4, t4, r4) { if (!(this instanceof o2)) return new o2(e4, t4, r4); this.Hash = e4, this.blockSize = e4.blockSize / 8, this.outSize = e4.outSize / 8, this.inner = null, this.outer = null, this._init(n2.toArray(t4, r4)); } e3.exports = o2, o2.prototype._init = function(e4) { e4.length > this.blockSize && (e4 = new this.Hash().update(e4).digest()), i2(e4.length <= this.blockSize); for (var t4 = e4.length; t4 < this.blockSize; t4++) e4.push(0); for (t4 = 0; t4 < e4.length; t4++) e4[t4] ^= 54; for (this.inner = new this.Hash().update(e4), t4 = 0; t4 < e4.length; t4++) e4[t4] ^= 106; this.outer = new this.Hash().update(e4); }, o2.prototype.update = function(e4, t4) { return this.inner.update(e4, t4), this; }, o2.prototype.digest = function(e4) { return this.outer.update(this.inner.digest()), this.outer.digest(e4); }; }, 69294: (e3, t3, r3) => { var n2 = r3(84268), i2 = r3(64696), o2 = n2.rotl32, a2 = n2.sum32, s2 = n2.sum32_3, u2 = n2.sum32_4, c2 = i2.BlockHash; function f2() { if (!(this instanceof f2)) return new f2(); c2.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = "little"; } function d2(e4, t4, r4, n3) { return e4 <= 15 ? t4 ^ r4 ^ n3 : e4 <= 31 ? t4 & r4 | ~t4 & n3 : e4 <= 47 ? (t4 | ~r4) ^ n3 : e4 <= 63 ? t4 & n3 | r4 & ~n3 : t4 ^ (r4 | ~n3); } function l2(e4) { return e4 <= 15 ? 0 : e4 <= 31 ? 1518500249 : e4 <= 47 ? 1859775393 : e4 <= 63 ? 2400959708 : 2840853838; } function h2(e4) { return e4 <= 15 ? 1352829926 : e4 <= 31 ? 1548603684 : e4 <= 47 ? 1836072691 : e4 <= 63 ? 2053994217 : 0; } n2.inherits(f2, c2), t3.ripemd160 = f2, f2.blockSize = 512, f2.outSize = 160, f2.hmacStrength = 192, f2.padLength = 64, f2.prototype._update = function(e4, t4) { for (var r4 = this.h[0], n3 = this.h[1], i3 = this.h[2], c3 = this.h[3], f3 = this.h[4], m2 = r4, g2 = n3, w2 = i3, k2 = c3, _2 = f3, A2 = 0; A2 < 80; A2++) { var E2 = a2(o2(u2(r4, d2(A2, n3, i3, c3), e4[p2[A2] + t4], l2(A2)), y2[A2]), f3); r4 = f3, f3 = c3, c3 = o2(i3, 10), i3 = n3, n3 = E2, E2 = a2(o2(u2(m2, d2(79 - A2, g2, w2, k2), e4[b2[A2] + t4], h2(A2)), v2[A2]), _2), m2 = _2, _2 = k2, k2 = o2(w2, 10), w2 = g2, g2 = E2; } E2 = s2(this.h[1], i3, k2), this.h[1] = s2(this.h[2], c3, _2), this.h[2] = s2(this.h[3], f3, m2), this.h[3] = s2(this.h[4], r4, g2), this.h[4] = s2(this.h[0], n3, w2), this.h[0] = E2; }, f2.prototype._digest = function(e4) { return "hex" === e4 ? n2.toHex32(this.h, "little") : n2.split32(this.h, "little"); }; var p2 = [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], b2 = [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], y2 = [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], v2 = [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]; }, 39310: (e3, t3, r3) => { t3.sha1 = r3(38142), t3.sha224 = r3(14909), t3.sha256 = r3(87682), t3.sha384 = r3(74532), t3.sha512 = r3(36515); }, 38142: (e3, t3, r3) => { var n2 = r3(84268), i2 = r3(64696), o2 = r3(90070), a2 = n2.rotl32, s2 = n2.sum32, u2 = n2.sum32_5, c2 = o2.ft_1, f2 = i2.BlockHash, d2 = [1518500249, 1859775393, 2400959708, 3395469782]; function l2() { if (!(this instanceof l2)) return new l2(); f2.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.W = new Array(80); } n2.inherits(l2, f2), e3.exports = l2, l2.blockSize = 512, l2.outSize = 160, l2.hmacStrength = 80, l2.padLength = 64, l2.prototype._update = function(e4, t4) { for (var r4 = this.W, n3 = 0; n3 < 16; n3++) r4[n3] = e4[t4 + n3]; for (; n3 < r4.length; n3++) r4[n3] = a2(r4[n3 - 3] ^ r4[n3 - 8] ^ r4[n3 - 14] ^ r4[n3 - 16], 1); var i3 = this.h[0], o3 = this.h[1], f3 = this.h[2], l3 = this.h[3], h2 = this.h[4]; for (n3 = 0; n3 < r4.length; n3++) { var p2 = ~~(n3 / 20), b2 = u2(a2(i3, 5), c2(p2, o3, f3, l3), h2, r4[n3], d2[p2]); h2 = l3, l3 = f3, f3 = a2(o3, 30), o3 = i3, i3 = b2; } this.h[0] = s2(this.h[0], i3), this.h[1] = s2(this.h[1], o3), this.h[2] = s2(this.h[2], f3), this.h[3] = s2(this.h[3], l3), this.h[4] = s2(this.h[4], h2); }, l2.prototype._digest = function(e4) { return "hex" === e4 ? n2.toHex32(this.h, "big") : n2.split32(this.h, "big"); }; }, 14909: (e3, t3, r3) => { var n2 = r3(84268), i2 = r3(87682); function o2() { if (!(this instanceof o2)) return new o2(); i2.call(this), this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]; } n2.inherits(o2, i2), e3.exports = o2, o2.blockSize = 512, o2.outSize = 224, o2.hmacStrength = 192, o2.padLength = 64, o2.prototype._digest = function(e4) { return "hex" === e4 ? n2.toHex32(this.h.slice(0, 7), "big") : n2.split32(this.h.slice(0, 7), "big"); }; }, 87682: (e3, t3, r3) => { var n2 = r3(84268), i2 = r3(64696), o2 = r3(90070), a2 = r3(94504), s2 = n2.sum32, u2 = n2.sum32_4, c2 = n2.sum32_5, f2 = o2.ch32, d2 = o2.maj32, l2 = o2.s0_256, h2 = o2.s1_256, p2 = o2.g0_256, b2 = o2.g1_256, y2 = i2.BlockHash, v2 = [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 m2() { if (!(this instanceof m2)) return new m2(); y2.call(this), this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], this.k = v2, this.W = new Array(64); } n2.inherits(m2, y2), e3.exports = m2, m2.blockSize = 512, m2.outSize = 256, m2.hmacStrength = 192, m2.padLength = 64, m2.prototype._update = function(e4, t4) { for (var r4 = this.W, n3 = 0; n3 < 16; n3++) r4[n3] = e4[t4 + n3]; for (; n3 < r4.length; n3++) r4[n3] = u2(b2(r4[n3 - 2]), r4[n3 - 7], p2(r4[n3 - 15]), r4[n3 - 16]); var i3 = this.h[0], o3 = this.h[1], y3 = this.h[2], v3 = this.h[3], m3 = this.h[4], g2 = this.h[5], w2 = this.h[6], k2 = this.h[7]; for (a2(this.k.length === r4.length), n3 = 0; n3 < r4.length; n3++) { var _2 = c2(k2, h2(m3), f2(m3, g2, w2), this.k[n3], r4[n3]), A2 = s2(l2(i3), d2(i3, o3, y3)); k2 = w2, w2 = g2, g2 = m3, m3 = s2(v3, _2), v3 = y3, y3 = o3, o3 = i3, i3 = s2(_2, A2); } this.h[0] = s2(this.h[0], i3), this.h[1] = s2(this.h[1], o3), this.h[2] = s2(this.h[2], y3), this.h[3] = s2(this.h[3], v3), this.h[4] = s2(this.h[4], m3), this.h[5] = s2(this.h[5], g2), this.h[6] = s2(this.h[6], w2), this.h[7] = s2(this.h[7], k2); }, m2.prototype._digest = function(e4) { return "hex" === e4 ? n2.toHex32(this.h, "big") : n2.split32(this.h, "big"); }; }, 74532: (e3, t3, r3) => { var n2 = r3(84268), i2 = r3(36515); function o2() { if (!(this instanceof o2)) return new o2(); i2.call(this), this.h = [3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, 355462360, 4144912697, 1731405415, 4290775857, 2394180231, 1750603025, 3675008525, 1694076839, 1203062813, 3204075428]; } n2.inherits(o2, i2), e3.exports = o2, o2.blockSize = 1024, o2.outSize = 384, o2.hmacStrength = 192, o2.padLength = 128, o2.prototype._digest = function(e4) { return "hex" === e4 ? n2.toHex32(this.h.slice(0, 12), "big") : n2.split32(this.h.slice(0, 12), "big"); }; }, 36515: (e3, t3, r3) => { var n2 = r3(84268), i2 = r3(64696), o2 = r3(94504), a2 = n2.rotr64_hi, s2 = n2.rotr64_lo, u2 = n2.shr64_hi, c2 = n2.shr64_lo, f2 = n2.sum64, d2 = n2.sum64_hi, l2 = n2.sum64_lo, h2 = n2.sum64_4_hi, p2 = n2.sum64_4_lo, b2 = n2.sum64_5_hi, y2 = n2.sum64_5_lo, v2 = i2.BlockHash, m2 = [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 g2() { if (!(this instanceof g2)) return new g2(); v2.call(this), this.h = [1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, 2773480762, 1595750129, 1359893119, 2917565137, 2600822924, 725511199, 528734635, 4215389547, 1541459225, 327033209], this.k = m2, this.W = new Array(160); } function w2(e4, t4, r4, n3, i3) { var o3 = e4 & r4 ^ ~e4 & i3; return o3 < 0 && (o3 += 4294967296), o3; } function k2(e4, t4, r4, n3, i3, o3) { var a3 = t4 & n3 ^ ~t4 & o3; return a3 < 0 && (a3 += 4294967296), a3; } function _2(e4, t4, r4, n3, i3) { var o3 = e4 & r4 ^ e4 & i3 ^ r4 & i3; return o3 < 0 && (o3 += 4294967296), o3; } function A2(e4, t4, r4, n3, i3, o3) { var a3 = t4 & n3 ^ t4 & o3 ^ n3 & o3; return a3 < 0 && (a3 += 4294967296), a3; } function E2(e4, t4) { var r4 = a2(e4, t4, 28) ^ a2(t4, e4, 2) ^ a2(t4, e4, 7); return r4 < 0 && (r4 += 4294967296), r4; } function S2(e4, t4) { var r4 = s2(e4, t4, 28) ^ s2(t4, e4, 2) ^ s2(t4, e4, 7); return r4 < 0 && (r4 += 4294967296), r4; } function x2(e4, t4) { var r4 = s2(e4, t4, 14) ^ s2(e4, t4, 18) ^ s2(t4, e4, 9); return r4 < 0 && (r4 += 4294967296), r4; } function B2(e4, t4) { var r4 = a2(e4, t4, 1) ^ a2(e4, t4, 8) ^ u2(e4, t4, 7); return r4 < 0 && (r4 += 4294967296), r4; } function O2(e4, t4) { var r4 = s2(e4, t4, 1) ^ s2(e4, t4, 8) ^ c2(e4, t4, 7); return r4 < 0 && (r4 += 4294967296), r4; } function P2(e4, t4) { var r4 = s2(e4, t4, 19) ^ s2(t4, e4, 29) ^ c2(e4, t4, 6); return r4 < 0 && (r4 += 4294967296), r4; } n2.inherits(g2, v2), e3.exports = g2, g2.blockSize = 1024, g2.outSize = 512, g2.hmacStrength = 192, g2.padLength = 128, g2.prototype._prepareBlock = function(e4, t4) { for (var r4 = this.W, n3 = 0; n3 < 32; n3++) r4[n3] = e4[t4 + n3]; for (; n3 < r4.length; n3 += 2) { var i3 = (y3 = r4[n3 - 4], v3 = r4[n3 - 3], m3 = void 0, (m3 = a2(y3, v3, 19) ^ a2(v3, y3, 29) ^ u2(y3, v3, 6)) < 0 && (m3 += 4294967296), m3), o3 = P2(r4[n3 - 4], r4[n3 - 3]), s3 = r4[n3 - 14], c3 = r4[n3 - 13], f3 = B2(r4[n3 - 30], r4[n3 - 29]), d3 = O2(r4[n3 - 30], r4[n3 - 29]), l3 = r4[n3 - 32], b3 = r4[n3 - 31]; r4[n3] = h2(i3, o3, s3, c3, f3, d3, l3, b3), r4[n3 + 1] = p2(i3, o3, s3, c3, f3, d3, l3, b3); } var y3, v3, m3; }, g2.prototype._update = function(e4, t4) { this._prepareBlock(e4, t4); var r4, n3, i3, s3 = this.W, u3 = this.h[0], c3 = this.h[1], h3 = this.h[2], p3 = this.h[3], v3 = this.h[4], m3 = this.h[5], g3 = this.h[6], B3 = this.h[7], O3 = this.h[8], P3 = this.h[9], I2 = this.h[10], T2 = this.h[11], C2 = this.h[12], M2 = this.h[13], R2 = this.h[14], U2 = this.h[15]; o2(this.k.length === s3.length); for (var N2 = 0; N2 < s3.length; N2 += 2) { var j2 = R2, L2 = U2, F2 = (i3 = void 0, (i3 = a2(r4 = O3, n3 = P3, 14) ^ a2(r4, n3, 18) ^ a2(n3, r4, 9)) < 0 && (i3 += 4294967296), i3), D2 = x2(O3, P3), H2 = w2(O3, 0, I2, 0, C2), z2 = k2(0, P3, 0, T2, 0, M2), q2 = this.k[N2], K2 = this.k[N2 + 1], G2 = s3[N2], V2 = s3[N2 + 1], Z2 = b2(j2, L2, F2, D2, H2, z2, q2, K2, G2, V2), W2 = y2(j2, L2, F2, D2, H2, z2, q2, K2, G2, V2); j2 = E2(u3, c3), L2 = S2(u3, c3), F2 = _2(u3, 0, h3, 0, v3), D2 = A2(0, c3, 0, p3, 0, m3); var J2 = d2(j2, L2, F2, D2), Y2 = l2(j2, L2, F2, D2); R2 = C2, U2 = M2, C2 = I2, M2 = T2, I2 = O3, T2 = P3, O3 = d2(g3, B3, Z2, W2), P3 = l2(B3, B3, Z2, W2), g3 = v3, B3 = m3, v3 = h3, m3 = p3, h3 = u3, p3 = c3, u3 = d2(Z2, W2, J2, Y2), c3 = l2(Z2, W2, J2, Y2); } f2(this.h, 0, u3, c3), f2(this.h, 2, h3, p3), f2(this.h, 4, v3, m3), f2(this.h, 6, g3, B3), f2(this.h, 8, O3, P3), f2(this.h, 10, I2, T2), f2(this.h, 12, C2, M2), f2(this.h, 14, R2, U2); }, g2.prototype._digest = function(e4) { return "hex" === e4 ? n2.toHex32(this.h, "big") : n2.split32(this.h, "big"); }; }, 90070: (e3, t3, r3) => { var n2 = r3(84268).rotr32; function i2(e4, t4, r4) { return e4 & t4 ^ ~e4 & r4; } function o2(e4, t4, r4) { return e4 & t4 ^ e4 & r4 ^ t4 & r4; } function a2(e4, t4, r4) { return e4 ^ t4 ^ r4; } t3.ft_1 = function(e4, t4, r4, n3) { return 0 === e4 ? i2(t4, r4, n3) : 1 === e4 || 3 === e4 ? a2(t4, r4, n3) : 2 === e4 ? o2(t4, r4, n3) : void 0; }, t3.ch32 = i2, t3.maj32 = o2, t3.p32 = a2, t3.s0_256 = function(e4) { return n2(e4, 2) ^ n2(e4, 13) ^ n2(e4, 22); }, t3.s1_256 = function(e4) { return n2(e4, 6) ^ n2(e4, 11) ^ n2(e4, 25); }, t3.g0_256 = function(e4) { return n2(e4, 7) ^ n2(e4, 18) ^ e4 >>> 3; }, t3.g1_256 = function(e4) { return n2(e4, 17) ^ n2(e4, 19) ^ e4 >>> 10; }; }, 84268: (e3, t3, r3) => { var n2 = r3(94504), i2 = r3(41736); function o2(e4, t4) { return 55296 == (64512 & e4.charCodeAt(t4)) && !(t4 < 0 || t4 + 1 >= e4.length) && 56320 == (64512 & e4.charCodeAt(t4 + 1)); } function a2(e4) { return (e4 >>> 24 | e4 >>> 8 & 65280 | e4 << 8 & 16711680 | (255 & e4) << 24) >>> 0; } function s2(e4) { return 1 === e4.length ? "0" + e4 : e4; } function u2(e4) { return 7 === e4.length ? "0" + e4 : 6 === e4.length ? "00" + e4 : 5 === e4.length ? "000" + e4 : 4 === e4.length ? "0000" + e4 : 3 === e4.length ? "00000" + e4 : 2 === e4.length ? "000000" + e4 : 1 === e4.length ? "0000000" + e4 : e4; } t3.inherits = i2, t3.toArray = function(e4, t4) { if (Array.isArray(e4)) return e4.slice(); if (!e4) return []; var r4 = []; if ("string" == typeof e4) if (t4) { if ("hex" === t4) for ((e4 = e4.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (e4 = "0" + e4), i3 = 0; i3 < e4.length; i3 += 2) r4.push(parseInt(e4[i3] + e4[i3 + 1], 16)); } else for (var n3 = 0, i3 = 0; i3 < e4.length; i3++) { var a3 = e4.charCodeAt(i3); a3 < 128 ? r4[n3++] = a3 : a3 < 2048 ? (r4[n3++] = a3 >> 6 | 192, r4[n3++] = 63 & a3 | 128) : o2(e4, i3) ? (a3 = 65536 + ((1023 & a3) << 10) + (1023 & e4.charCodeAt(++i3)), r4[n3++] = a3 >> 18 | 240, r4[n3++] = a3 >> 12 & 63 | 128, r4[n3++] = a3 >> 6 & 63 | 128, r4[n3++] = 63 & a3 | 128) : (r4[n3++] = a3 >> 12 | 224, r4[n3++] = a3 >> 6 & 63 | 128, r4[n3++] = 63 & a3 | 128); } else for (i3 = 0; i3 < e4.length; i3++) r4[i3] = 0 | e4[i3]; return r4; }, t3.toHex = function(e4) { for (var t4 = "", r4 = 0; r4 < e4.length; r4++) t4 += s2(e4[r4].toString(16)); return t4; }, t3.htonl = a2, t3.toHex32 = function(e4, t4) { for (var r4 = "", n3 = 0; n3 < e4.length; n3++) { var i3 = e4[n3]; "little" === t4 && (i3 = a2(i3)), r4 += u2(i3.toString(16)); } return r4; }, t3.zero2 = s2, t3.zero8 = u2, t3.join32 = function(e4, t4, r4, i3) { var o3 = r4 - t4; n2(o3 % 4 == 0); for (var a3 = new Array(o3 / 4), s3 = 0, u3 = t4; s3 < a3.length; s3++, u3 += 4) { var c2; c2 = "big" === i3 ? e4[u3] << 24 | e4[u3 + 1] << 16 | e4[u3 + 2] << 8 | e4[u3 + 3] : e4[u3 + 3] << 24 | e4[u3 + 2] << 16 | e4[u3 + 1] << 8 | e4[u3], a3[s3] = c2 >>> 0; } return a3; }, t3.split32 = function(e4, t4) { for (var r4 = new Array(4 * e4.length), n3 = 0, i3 = 0; n3 < e4.length; n3++, i3 += 4) { var o3 = e4[n3]; "big" === t4 ? (r4[i3] = o3 >>> 24, r4[i3 + 1] = o3 >>> 16 & 255, r4[i3 + 2] = o3 >>> 8 & 255, r4[i3 + 3] = 255 & o3) : (r4[i3 + 3] = o3 >>> 24, r4[i3 + 2] = o3 >>> 16 & 255, r4[i3 + 1] = o3 >>> 8 & 255, r4[i3] = 255 & o3); } return r4; }, t3.rotr32 = function(e4, t4) { return e4 >>> t4 | e4 << 32 - t4; }, t3.rotl32 = function(e4, t4) { return e4 << t4 | e4 >>> 32 - t4; }, t3.sum32 = function(e4, t4) { return e4 + t4 >>> 0; }, t3.sum32_3 = function(e4, t4, r4) { return e4 + t4 + r4 >>> 0; }, t3.sum32_4 = function(e4, t4, r4, n3) { return e4 + t4 + r4 + n3 >>> 0; }, t3.sum32_5 = function(e4, t4, r4, n3, i3) { return e4 + t4 + r4 + n3 + i3 >>> 0; }, t3.sum64 = function(e4, t4, r4, n3) { var i3 = e4[t4], o3 = n3 + e4[t4 + 1] >>> 0, a3 = (o3 < n3 ? 1 : 0) + r4 + i3; e4[t4] = a3 >>> 0, e4[t4 + 1] = o3; }, t3.sum64_hi = function(e4, t4, r4, n3) { return (t4 + n3 >>> 0 < t4 ? 1 : 0) + e4 + r4 >>> 0; }, t3.sum64_lo = function(e4, t4, r4, n3) { return t4 + n3 >>> 0; }, t3.sum64_4_hi = function(e4, t4, r4, n3, i3, o3, a3, s3) { var u3 = 0, c2 = t4; return u3 += (c2 = c2 + n3 >>> 0) < t4 ? 1 : 0, u3 += (c2 = c2 + o3 >>> 0) < o3 ? 1 : 0, e4 + r4 + i3 + a3 + (u3 += (c2 = c2 + s3 >>> 0) < s3 ? 1 : 0) >>> 0; }, t3.sum64_4_lo = function(e4, t4, r4, n3, i3, o3, a3, s3) { return t4 + n3 + o3 + s3 >>> 0; }, t3.sum64_5_hi = function(e4, t4, r4, n3, i3, o3, a3, s3, u3, c2) { var f2 = 0, d2 = t4; return f2 += (d2 = d2 + n3 >>> 0) < t4 ? 1 : 0, f2 += (d2 = d2 + o3 >>> 0) < o3 ? 1 : 0, f2 += (d2 = d2 + s3 >>> 0) < s3 ? 1 : 0, e4 + r4 + i3 + a3 + u3 + (f2 += (d2 = d2 + c2 >>> 0) < c2 ? 1 : 0) >>> 0; }, t3.sum64_5_lo = function(e4, t4, r4, n3, i3, o3, a3, s3, u3, c2) { return t4 + n3 + o3 + s3 + c2 >>> 0; }, t3.rotr64_hi = function(e4, t4, r4) { return (t4 << 32 - r4 | e4 >>> r4) >>> 0; }, t3.rotr64_lo = function(e4, t4, r4) { return (e4 << 32 - r4 | t4 >>> r4) >>> 0; }, t3.shr64_hi = function(e4, t4, r4) { return e4 >>> r4; }, t3.shr64_lo = function(e4, t4, r4) { return (e4 << 32 - r4 | t4 >>> r4) >>> 0; }; }, 2383: (e3, t3, r3) => { var n2 = Function.prototype.call, i2 = Object.prototype.hasOwnProperty, o2 = r3(3767); e3.exports = o2.call(n2, i2); }, 29410: (e3, t3, r3) => { var n2 = r3(37198), i2 = r3(96580), o2 = r3(94504); function a2(e4) { if (!(this instanceof a2)) return new a2(e4); this.hash = e4.hash, this.predResist = !!e4.predResist, this.outLen = this.hash.outSize, this.minEntropy = e4.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null; var t4 = i2.toArray(e4.entropy, e4.entropyEnc || "hex"), r4 = i2.toArray(e4.nonce, e4.nonceEnc || "hex"), n3 = i2.toArray(e4.pers, e4.persEnc || "hex"); o2(t4.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._init(t4, r4, n3); } e3.exports = a2, a2.prototype._init = function(e4, t4, r4) { var n3 = e4.concat(t4).concat(r4); this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8); for (var i3 = 0; i3 < this.V.length; i3++) this.K[i3] = 0, this.V[i3] = 1; this._update(n3), this._reseed = 1, this.reseedInterval = 281474976710656; }, a2.prototype._hmac = function() { return new n2.hmac(this.hash, this.K); }, a2.prototype._update = function(e4) { var t4 = this._hmac().update(this.V).update([0]); e4 && (t4 = t4.update(e4)), this.K = t4.digest(), this.V = this._hmac().update(this.V).digest(), e4 && (this.K = this._hmac().update(this.V).update([1]).update(e4).digest(), this.V = this._hmac().update(this.V).digest()); }, a2.prototype.reseed = function(e4, t4, r4, n3) { "string" != typeof t4 && (n3 = r4, r4 = t4, t4 = null), e4 = i2.toArray(e4, t4), r4 = i2.toArray(r4, n3), o2(e4.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._update(e4.concat(r4 || [])), this._reseed = 1; }, a2.prototype.generate = function(e4, t4, r4, n3) { if (this._reseed > this.reseedInterval) throw new Error("Reseed is required"); "string" != typeof t4 && (n3 = r4, r4 = t4, t4 = null), r4 && (r4 = i2.toArray(r4, n3 || "hex"), this._update(r4)); for (var o3 = []; o3.length < e4; ) this.V = this._hmac().update(this.V).digest(), o3 = o3.concat(this.V); var a3 = o3.slice(0, e4); return this._update(r4), this._reseed++, i2.encode(a3, t4); }; }, 90912: (e3, t3, r3) => { var n2 = r3(29519), i2 = r3(51143), o2 = e3.exports; for (var a2 in n2) n2.hasOwnProperty(a2) && (o2[a2] = n2[a2]); function s2(e4) { if ("string" == typeof e4 && (e4 = i2.parse(e4)), e4.protocol || (e4.protocol = "https:"), "https:" !== e4.protocol) throw new Error('Protocol "' + e4.protocol + '" not supported. Expected "https:"'); return e4; } o2.request = function(e4, t4) { return e4 = s2(e4), n2.request.call(this, e4, t4); }, o2.get = function(e4, t4) { return e4 = s2(e4), n2.get.call(this, e4, t4); }; }, 32996: (e3, t3, r3) => { var n2; r3(28847)(r3(3355)), void 0 === (n2 = (function() { return e4 = [new Uint32Array([2157250, 2157314, 2157378, 2157442, 2157506, 2157570, 2157634, 0, 2157698, 2157762, 2157826, 2157890, 2157954, 0, 2158018, 0]), new Uint32Array([2179041, 6291456, 2179073, 6291456, 2179105, 6291456, 2179137, 6291456, 2179169, 6291456, 2179201, 6291456, 2179233, 6291456, 2179265, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 14680064, 14680064, 14680064, 14680064, 14680064]), new Uint32Array([0, 2113729, 2197345, 2197377, 2113825, 2197409, 2197441, 2113921, 2197473, 2114017, 2197505, 2197537, 2197569, 2197601, 2197633, 2197665]), new Uint32Array([6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 23068672, 23068672, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 23068672, 23068672, 23068672, 0, 0, 0, 0, 23068672]), new Uint32Array([14680064, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 14680064, 14680064]), new Uint32Array([2196001, 2196033, 2196065, 2196097, 2196129, 2196161, 2196193, 2196225, 2196257, 2196289, 2196321, 2196353, 2196385, 2196417, 2196449, 2196481]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 6291456, 0, 0, 0, 0, 0]), new Uint32Array([2097281, 2105921, 2097729, 2106081, 0, 2097601, 2162337, 2106017, 2133281, 2097505, 2105889, 2097185, 2097697, 2135777, 2097633, 2097441]), new Uint32Array([2177025, 6291456, 2177057, 6291456, 2177089, 6291456, 2177121, 6291456, 2177153, 6291456, 2177185, 6291456, 2177217, 6291456, 2177249, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 0, 6291456, 6291456, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 6291456]), new Uint32Array([0, 23068672, 23068672, 23068672, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 6291456]), new Uint32Array([2134435, 2134531, 2134627, 2134723, 2134723, 2134819, 2134819, 2134915, 2134915, 2135011, 2105987, 2135107, 2135203, 2135299, 2131587, 2135395]), new Uint32Array([0, 0, 0, 0, 0, 0, 0, 6291456, 2168673, 2169249, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2147906, 2147970, 2148034, 2148098, 2148162, 2148226, 2148290, 2148354, 2147906, 2147970, 2148034, 2148098, 2148162, 2148226, 2148290, 2148354]), new Uint32Array([2125219, 2125315, 2152834, 2152898, 2125411, 2152962, 2153026, 2125506, 2125507, 2125603, 2153090, 2153154, 2153218, 2153282, 2153346, 2105348]), new Uint32Array([2203393, 6291456, 2203425, 6291456, 2203457, 6291456, 2203489, 6291456, 6291456, 6291456, 6291456, 2203521, 6291456, 2181281, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 23068672, 6291456, 2145538, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0, 6291456]), new Uint32Array([2139426, 2160834, 2160898, 2160962, 2134242, 2161026, 2161090, 2161154, 2161218, 2161282, 2161346, 2161410, 2138658, 2161474, 2161538, 2134722]), new Uint32Array([2119939, 2124930, 2125026, 2106658, 2125218, 2128962, 2129058, 2129154, 2129250, 2129346, 2129442, 2108866, 2108770, 2150466, 2150530, 2150594]), new Uint32Array([2201601, 6291456, 2201633, 6291456, 2201665, 6291456, 2201697, 6291456, 2201729, 6291456, 2201761, 6291456, 2201793, 6291456, 2201825, 6291456]), new Uint32Array([2193537, 2193569, 2193601, 2193633, 2193665, 2193697, 2193729, 2193761, 2193793, 2193825, 2193857, 2193889, 2193921, 2193953, 2193985, 2194017]), new Uint32Array([6291456, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([0, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2190561, 6291456, 2190593, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2190625, 6291456, 2190657, 6291456, 23068672]), new Uint32Array([2215905, 2215937, 2215969, 2216001, 2216033, 2216065, 2216097, 2216129, 2216161, 2216193, 2216225, 2216257, 2105441, 2216289, 2216321, 2216353]), new Uint32Array([23068672, 18884130, 23068672, 23068672, 23068672, 6291456, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672]), new Uint32Array([23068672, 23068672, 0, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 23068672, 23068672, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([2191233, 2191265, 2191297, 2191329, 2191361, 2191393, 2191425, 2117377, 2191457, 2191489, 2191521, 2191553, 2191585, 2191617, 2191649, 2117953]), new Uint32Array([2132227, 2132323, 2132419, 2132419, 2132515, 2132515, 2132611, 2132707, 2132707, 2132803, 2132899, 2132899, 2132995, 2132995, 2133091, 2133187]), new Uint32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 6291456, 0, 0]), new Uint32Array([2112481, 2112577, 2098177, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 10609889, 10610785, 10609921, 10610817, 2222241]), new Uint32Array([6291456, 6291456, 6291456, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 0, 0]), new Uint32Array([2219969, 2157121, 2157441, 2157505, 2157889, 2157953, 2220001, 2158465, 2158529, 10575617, 2156994, 2157058, 2129923, 2130019, 2157122, 2157186]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0, 0]), new Uint32Array([2185249, 6291456, 2185281, 6291456, 2185313, 6291456, 2185345, 6291456, 2185377, 6291456, 2185409, 6291456, 2185441, 6291456, 2185473, 6291456]), new Uint32Array([0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 23068672, 23068672, 0, 0, 23068672, 23068672, 23068672, 6291456, 0]), new Uint32Array([2183361, 6291456, 2183393, 6291456, 2183425, 6291456, 2183457, 6291456, 2183489, 6291456, 2183521, 6291456, 2183553, 6291456, 2183585, 6291456]), new Uint32Array([2192161, 2192193, 2192225, 2192257, 2192289, 2192321, 2192353, 2192385, 2192417, 2192449, 2192481, 2192513, 2192545, 2192577, 2192609, 2192641]), new Uint32Array([2212001, 2212033, 2212065, 2212097, 2212129, 2212161, 2212193, 2212225, 2212257, 2212289, 2212321, 2212353, 2212385, 2212417, 2212449, 2207265]), new Uint32Array([2249825, 2249857, 2249889, 2249921, 2249954, 2250018, 2250082, 2250145, 2250177, 2250209, 2250241, 2250274, 2250337, 2250370, 2250433, 2250465]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2147905, 2147969, 2148033, 2148097, 2148161, 2148225, 2148289, 2148353]), new Uint32Array([10485857, 6291456, 2197217, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 23068672, 23068672]), new Uint32Array([0, 23068672, 23068672, 23068672, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456]), new Uint32Array([2180353, 2180385, 2144033, 2180417, 2180449, 2180481, 2180513, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2112481, 2112577, 2098177, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 10610209, 10610465, 10610241, 10610753, 10609857]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 0, 0]), new Uint32Array([2223842, 2223906, 2223970, 2224034, 2224098, 2224162, 2224226, 2224290, 2224354, 2224418, 2224482, 2224546, 2224610, 2224674, 2224738, 2224802]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 18923650, 23068672, 23068672, 23068672, 23068672, 0, 23068672, 23068672, 23068672, 23068672, 18923714, 23068672, 23068672]), new Uint32Array([2126179, 2125538, 2126275, 2126371, 2126467, 2125634, 2126563, 2105603, 2105604, 2125346, 2126659, 2126755, 2126851, 2098179, 2098181, 2098182]), new Uint32Array([2227426, 2227490, 2227554, 2227618, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2192353, 2240642, 2240642, 2240705, 2240737, 2240737, 2240769, 2240802, 2240866, 2240929, 2240961, 2240993, 2241025, 2241057, 2241089, 2241121]), new Uint32Array([6291456, 2170881, 2170913, 2170945, 6291456, 2170977, 6291456, 2171009, 2171041, 6291456, 6291456, 6291456, 2171073, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([2132226, 2132514, 2163586, 2132610, 2160386, 2133090, 2133186, 2160450, 2160514, 2160578, 2133570, 2106178, 2160642, 2133858, 2160706, 2160770]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 10532162, 10532226, 10532290, 10532354, 10532418, 10532482, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 23068672]), new Uint32Array([2098209, 2108353, 2108193, 2108481, 2170241, 2111713, 2105473, 2105569, 2105601, 2112289, 2112481, 2098305, 2108321, 0, 0, 0]), new Uint32Array([2209121, 2209153, 2209185, 2209217, 2209249, 2209281, 2209313, 2209345, 2209377, 2209409, 2209441, 2209473, 2207265, 2209505, 2209537, 2209569]), new Uint32Array([2189025, 6291456, 2189057, 6291456, 2189089, 6291456, 2189121, 6291456, 2189153, 6291456, 2189185, 6291456, 2189217, 6291456, 2189249, 6291456]), new Uint32Array([2173825, 2153473, 2173857, 2173889, 2173921, 2173953, 2173985, 2173761, 2174017, 2174049, 2174081, 2174113, 2174145, 2174177, 2149057, 2233057]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2165764, 2140004]), new Uint32Array([2215105, 6291456, 2215137, 6291456, 6291456, 2215169, 2215201, 6291456, 6291456, 6291456, 2215233, 2215265, 2215297, 2215329, 2215361, 2215393]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 6291456, 6291456, 6291456, 23068672, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([10505091, 10505187, 10505283, 10505379, 10505475, 10505571, 10505667, 10505763, 10505859, 10505955, 10506051, 10506147, 10506243, 10506339, 10506435, 10506531]), new Uint32Array([2229730, 2229794, 2229858, 2229922, 2229986, 2230050, 2230114, 2230178, 2230242, 2230306, 2230370, 2230434, 2230498, 2230562, 2230626, 2230690]), new Uint32Array([2105505, 2098241, 2108353, 2108417, 2105825, 0, 2100897, 2111905, 2105473, 2105569, 2105601, 2112289, 2108193, 2112481, 2112577, 2098177]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 10502115, 10502178, 10502211, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([0, 23068672, 23068672, 23068672, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456]), new Uint32Array([2190305, 6291456, 2190337, 6291456, 2190369, 6291456, 2190401, 6291456, 2190433, 6291456, 2190465, 6291456, 2190497, 6291456, 2190529, 6291456]), new Uint32Array([2173793, 2173985, 2174017, 6291456, 2173761, 2173697, 6291456, 2174689, 6291456, 2174017, 2174721, 6291456, 6291456, 2174753, 2174785, 2174817]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2099521, 2099105, 2120705, 2098369, 2120801, 2103361, 2097985, 2098433, 2121377, 2121473, 2099169, 2099873, 2098401, 2099393, 2152609, 2100033]), new Uint32Array([2132898, 2163842, 2163906, 2133282, 2132034, 2131938, 2137410, 2132802, 2132706, 2164866, 2133282, 2160578, 2165186, 2165186, 6291456, 6291456]), new Uint32Array([10500003, 10500099, 10500195, 10500291, 10500387, 10500483, 10500579, 10500675, 10500771, 10500867, 10500963, 10501059, 10501155, 10501251, 10501347, 10501443]), new Uint32Array([2163458, 2130978, 2131074, 2131266, 2131362, 2163522, 2160130, 2132066, 2131010, 2131106, 2106018, 2131618, 2131298, 2132034, 2131938, 2137410]), new Uint32Array([2212961, 2116993, 2212993, 2213025, 2213057, 2213089, 2213121, 2213153, 2213185, 2213217, 2213249, 2209633, 2213281, 2213313, 2213345, 2213377]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456]), new Uint32Array([2113729, 2113825, 2113921, 2114017, 2114113, 2114209, 2114305, 2114401, 2114497, 2114593, 2114689, 2114785, 2114881, 2114977, 2115073, 2115169]), new Uint32Array([2238177, 2238209, 2238241, 2238273, 2238305, 2238337, 2238337, 2217537, 2238369, 2238401, 2238433, 2238465, 2215649, 2238497, 2238529, 2238561]), new Uint32Array([2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 2098209, 2111137, 2105505, 2098241, 2108353, 2108417, 2105825, 2111713, 2100897, 2111905]), new Uint32Array([6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 0, 0]), new Uint32Array([6291456, 0, 6291456, 2145026, 0, 6291456, 2145090, 0, 6291456, 6291456, 0, 0, 23068672, 0, 23068672, 23068672]), new Uint32Array([2099233, 2122017, 2200673, 2098113, 2121537, 2103201, 2200705, 2104033, 2121857, 2121953, 2122401, 2099649, 2099969, 2123009, 2100129, 2100289]), new Uint32Array([6291456, 23068672, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 23068672, 23068672, 0, 0, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0]), new Uint32Array([2187681, 2187713, 2187745, 2187777, 2187809, 2187841, 2187873, 2187905, 2187937, 2187969, 2188001, 2188033, 2188065, 2188097, 2188129, 2188161]), new Uint32Array([0, 10554498, 10554562, 10554626, 10554690, 10554754, 10554818, 10554882, 10554946, 10555010, 10555074, 6291456, 6291456, 0, 0, 0]), new Uint32Array([2235170, 2235234, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2181153, 6291456, 2188897, 6291456, 6291456, 2188929, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2111905, 2100865, 2188961, 2188993]), new Uint32Array([2100833, 2100897, 0, 0, 2101569, 2101697, 2101825, 2101953, 2102081, 2102209, 10575617, 2187041, 10502177, 10489601, 10489697, 2112289]), new Uint32Array([6291456, 2172833, 6291456, 2172865, 2172897, 2172929, 2172961, 6291456, 2172993, 6291456, 2173025, 6291456, 2173057, 6291456, 2173089, 6291456]), new Uint32Array([6291456, 0, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 23068672, 6291456, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 2190721]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 23068672, 6291456, 6291456]), new Uint32Array([2184993, 6291456, 2185025, 6291456, 2185057, 6291456, 2185089, 6291456, 2185121, 6291456, 2185153, 6291456, 2185185, 6291456, 2185217, 6291456]), new Uint32Array([2115265, 2115361, 2115457, 2115553, 2115649, 2115745, 2115841, 2115937, 2116033, 2116129, 2116225, 2116321, 2150658, 2150722, 2200225, 6291456]), new Uint32Array([2168321, 6291456, 2168353, 6291456, 2168385, 6291456, 2168417, 6291456, 2168449, 6291456, 2168481, 6291456, 2168513, 6291456, 2168545, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([6291456, 0, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 6291456, 6291456, 0, 6291456, 0, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 2186625, 0, 0, 6291456, 6291456, 2186657, 2186689, 2186721, 2173505, 0, 10496067, 10496163, 10496259]), new Uint32Array([2178785, 6291456, 2178817, 6291456, 2178849, 6291456, 2178881, 6291456, 2178913, 6291456, 2178945, 6291456, 2178977, 6291456, 2179009, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0]), new Uint32Array([2097152, 0, 0, 0, 2097152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456]), new Uint32Array([6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([0, 0, 2197857, 2197889, 2197921, 2197953, 2197985, 2198017, 0, 0, 2198049, 2198081, 2198113, 2198145, 2198177, 2198209]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2098209, 2167297, 2111137, 6291456]), new Uint32Array([2171393, 6291456, 2171425, 6291456, 2171457, 6291456, 2171489, 6291456, 2171521, 6291456, 2171553, 6291456, 2171585, 6291456, 2171617, 6291456]), new Uint32Array([2206753, 2206785, 2195457, 2206817, 2206849, 2206881, 2206913, 2197153, 2197153, 2206945, 2117857, 2206977, 2207009, 2207041, 2207073, 2207105]), new Uint32Array([0, 0, 0, 0, 0, 0, 0, 23068672, 0, 0, 0, 0, 2144834, 2144898, 0, 2144962]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 23068672]), new Uint32Array([2108193, 2112481, 2112577, 2098177, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 2098209, 0, 2105505, 2098241]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 2202049, 6291456, 2202081, 6291456, 2202113, 6291456, 2202145, 6291456, 2202177, 6291456, 2202209, 6291456, 2202241, 6291456]), new Uint32Array([10501155, 10501251, 10501347, 10501443, 10501539, 10501635, 10501731, 10501827, 10501923, 10502019, 2141731, 2105505, 2098177, 2155586, 2166530, 0]), new Uint32Array([2102081, 2102209, 2100833, 2100737, 2098337, 2101441, 2101569, 2101697, 2101825, 2101953, 2102081, 2102209, 2100833, 2100737, 2098337, 2101441]), new Uint32Array([2146882, 2146946, 2147010, 2147074, 2147138, 2147202, 2147266, 2147330, 2146882, 2146946, 2147010, 2147074, 2147138, 2147202, 2147266, 2147330]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0]), new Uint32Array([10502307, 10502403, 10502499, 10502595, 10502691, 10502787, 10502883, 10502979, 10503075, 10503171, 10503267, 10503363, 10503459, 10503555, 10503651, 10503747]), new Uint32Array([2179937, 2179969, 2180001, 2180033, 2156545, 2180065, 2156577, 2180097, 2180129, 2180161, 2180193, 2180225, 2180257, 2180289, 2156737, 2180321]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 0, 0, 0, 6291456, 0, 0, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0]), new Uint32Array([2227682, 2227746, 2227810, 2227874, 2227938, 2228002, 2228066, 2228130, 2228194, 2228258, 2228322, 2228386, 2228450, 2228514, 2228578, 2228642]), new Uint32Array([2105601, 2169121, 2108193, 2170049, 2181025, 2181057, 2112481, 2108321, 2108289, 2181089, 2170497, 2100865, 2181121, 2173601, 2173633, 2173665]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2180641, 6291456, 6291456, 6291456]), new Uint32Array([0, 6291456, 6291456, 6291456, 0, 6291456, 0, 6291456, 0, 0, 6291456, 6291456, 0, 6291456, 6291456, 6291456]), new Uint32Array([2178273, 6291456, 2178305, 6291456, 2178337, 6291456, 2178369, 6291456, 2178401, 6291456, 2178433, 6291456, 2178465, 6291456, 2178497, 6291456]), new Uint32Array([6291456, 6291456, 23068672, 23068672, 23068672, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456]), new Uint32Array([2237377, 2237409, 2236225, 2237441, 2237473, 2217441, 2215521, 2215553, 2217473, 2237505, 2237537, 2209697, 2237569, 2215585, 2237601, 2237633]), new Uint32Array([2221985, 2165601, 2165601, 2165665, 2165665, 2222017, 2222017, 2165729, 2165729, 2158913, 2158913, 2158913, 2158913, 2097281, 2097281, 2105921]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 0, 23068672, 23068672, 23068672, 0, 23068672, 23068672, 23068672, 23068672, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2149634, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2176897, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 2176929, 6291456, 2176961, 6291456, 2176993, 6291456]), new Uint32Array([2172641, 6291456, 2172673, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2172705, 2172737, 6291456, 2172769, 2172801, 6291456]), new Uint32Array([2099173, 2104196, 2121667, 2099395, 2121763, 2152258, 2152322, 2098946, 2152386, 2121859, 2121955, 2099333, 2122051, 2104324, 2099493, 2122147]), new Uint32Array([6291456, 6291456, 6291456, 2145794, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 2145858, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 0, 0, 6291456, 0]), new Uint32Array([0, 2105921, 2097729, 0, 2097377, 0, 0, 2106017, 0, 2097505, 2105889, 2097185, 2097697, 2135777, 2097633, 2097441]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([2239074, 2239138, 2239201, 2239233, 2239265, 2239297, 2239329, 2239361, 0, 2239393, 2239425, 2239425, 2239458, 2239521, 2239553, 2209569]), new Uint32Array([14680064, 2098209, 2111137, 2105505, 2098241, 2108353, 2108417, 2105825, 2111713, 2100897, 2111905, 2105473, 2105569, 2105601, 2112289, 2108193]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 6291456, 23068672]), new Uint32Array([2108321, 2108289, 2113153, 2098209, 2180897, 2180929, 2180961, 2111137, 2098241, 2108353, 2170241, 2170273, 2180993, 2105825, 6291456, 2105473]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2146114, 6291456, 6291456, 6291456, 0, 0, 0]), new Uint32Array([2105921, 2105921, 2105921, 2222049, 2222049, 2130977, 2130977, 2130977, 2130977, 2160065, 2160065, 2160065, 2160065, 2097729, 2097729, 2097729]), new Uint32Array([2218145, 2214785, 2207937, 2218177, 2218209, 2192993, 2210113, 2212769, 2218241, 2218273, 2216129, 2218305, 2216161, 2218337, 2218369, 2218401]), new Uint32Array([0, 0, 0, 2156546, 2156610, 2156674, 2156738, 2156802, 0, 0, 0, 0, 0, 2156866, 23068672, 2156930]), new Uint32Array([23068672, 23068672, 23068672, 0, 0, 0, 0, 23068672, 23068672, 0, 0, 23068672, 23068672, 23068672, 0, 0]), new Uint32Array([2213409, 2213441, 2213473, 2213505, 2213537, 2213569, 2213601, 2213633, 2213665, 2195681, 2213697, 2213729, 2213761, 2213793, 2213825, 2213857]), new Uint32Array([2100033, 2099233, 2122017, 2200673, 2098113, 2121537, 2103201, 2200705, 2104033, 2121857, 2121953, 2122401, 2099649, 2099969, 2123009, 2100129]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2201857, 6291456, 2201889, 6291456, 2201921, 6291456, 2201953, 6291456, 2201985, 6291456, 2202017, 6291456, 2176193, 2176257, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 23068672, 23068672, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2188193, 2188225, 2188257, 2188289, 2188321, 2188353, 2188385, 2188417, 2188449, 2188481, 2188513, 2188545, 2188577, 2188609, 2188641, 0]), new Uint32Array([10554529, 2221089, 0, 10502113, 10562017, 10537921, 10538049, 2221121, 2221153, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2213889, 2213921, 2213953, 2213985, 2214017, 2214049, 2214081, 2194177, 2214113, 2214145, 2214177, 2214209, 2214241, 2214273, 2214305, 2214337]), new Uint32Array([2166978, 2167042, 2099169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2180545, 6291456, 6291456, 6291456]), new Uint32Array([10518915, 10519011, 10519107, 10519203, 2162242, 2162306, 2159554, 2162370, 2159362, 2159618, 2105922, 2162434, 2159746, 2162498, 2159810, 2159874]), new Uint32Array([2161730, 2161794, 2135586, 2161858, 2161922, 2137186, 2131810, 2160290, 2135170, 2161986, 2137954, 2162050, 2162114, 2162178, 10518723, 10518819]), new Uint32Array([10506627, 10506723, 10506819, 10506915, 10507011, 10507107, 10507203, 10507299, 10507395, 10507491, 10507587, 10507683, 10507779, 10507875, 10507971, 10508067]), new Uint32Array([6291456, 23068672, 23068672, 23068672, 0, 23068672, 23068672, 0, 0, 0, 0, 0, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0]), new Uint32Array([2175873, 2175905, 2175937, 2175969, 2176001, 2176033, 2176065, 2176097, 2176129, 2176161, 2176193, 2176225, 2176257, 2176289, 2176321, 2176353]), new Uint32Array([2140006, 2140198, 2140390, 2140582, 2140774, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672]), new Uint32Array([2108193, 2112481, 2112577, 2098177, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 2098209, 2111137, 2105505, 2098241]), new Uint32Array([0, 23068672, 0, 0, 0, 0, 0, 0, 0, 2145154, 2145218, 2145282, 6291456, 0, 2145346, 0]), new Uint32Array([0, 0, 0, 0, 10531458, 10495395, 2148545, 2143201, 2173473, 2148865, 2173505, 0, 2173537, 0, 2173569, 2149121]), new Uint32Array([10537282, 10495683, 2148738, 2148802, 2148866, 0, 6291456, 2148930, 2186593, 2173473, 2148737, 2148865, 2148802, 10495779, 10495875, 10495971]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2215425, 2215457, 2215489, 2215521, 2215553, 2215585, 2215617, 2215649, 2215681, 2215713, 2215745, 2215777, 2192033, 2215809, 2215841, 2215873]), new Uint32Array([2242049, 2242081, 2242113, 2242145, 2242177, 2242209, 2242241, 2242273, 2215937, 2242305, 2242338, 2242401, 2242433, 2242465, 2242497, 2216001]), new Uint32Array([10554529, 2221089, 0, 0, 10562017, 10502113, 10538049, 10537921, 2221185, 10489601, 10489697, 10609889, 10609921, 2141729, 2141793, 10610273]), new Uint32Array([2141923, 2142019, 2142115, 2142211, 2142307, 2142403, 2142499, 2142595, 2142691, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([0, 2221185, 2221217, 10609857, 10609857, 10489601, 10489697, 10609889, 10609921, 2141729, 2141793, 2221345, 2221377, 2221409, 2221441, 2187105]), new Uint32Array([6291456, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 18923970, 23068672, 23068672, 23068672, 0, 6291456, 6291456]), new Uint32Array([2183105, 6291456, 2183137, 6291456, 2183169, 6291456, 2183201, 6291456, 2183233, 6291456, 2183265, 6291456, 2183297, 6291456, 2183329, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2134434, 2134818, 2097666, 2097186, 2097474, 2097698, 2105986, 2131586, 2132450, 2131874, 2131778, 2135970, 2135778, 2161602, 2136162, 2161666]), new Uint32Array([2236865, 2236897, 2236930, 2236993, 2237025, 2235681, 2237058, 2237121, 2237153, 2237185, 2237217, 2217281, 2237250, 2191233, 2237313, 2237345]), new Uint32Array([2190049, 6291456, 2190081, 6291456, 2190113, 6291456, 2190145, 6291456, 2190177, 6291456, 2190209, 6291456, 2190241, 6291456, 2190273, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2101922, 2102050, 2102178, 2102306, 10498755, 10498851, 10498947, 10499043, 10499139, 10499235, 10499331, 10499427, 10499523, 10489604, 10489732, 10489860]), new Uint32Array([2166914, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0, 0]), new Uint32Array([2181601, 2170561, 2181633, 2181665, 2170753, 2181697, 2172897, 2170881, 2181729, 2170913, 2172929, 2113441, 2181761, 2181793, 2171009, 2173761]), new Uint32Array([0, 2105921, 2097729, 2106081, 0, 2097601, 2162337, 2106017, 2133281, 2097505, 0, 2097185, 2097697, 2135777, 2097633, 2097441]), new Uint32Array([6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0]), new Uint32Array([2248001, 2248033, 2248066, 2248130, 2248193, 2248226, 2248289, 2248322, 2248385, 2248417, 2216673, 2248450, 2248514, 2248577, 2248610, 2248673]), new Uint32Array([6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 0, 0, 0]), new Uint32Array([2169729, 6291456, 2169761, 6291456, 2169793, 6291456, 2169825, 6291456, 2169857, 2169889, 6291456, 2169921, 6291456, 2143329, 6291456, 2098305]), new Uint32Array([2162178, 2163202, 2163266, 2135170, 2136226, 2161986, 2137954, 2159426, 2159490, 2163330, 2159554, 2163394, 2159682, 2139522, 2136450, 2159746]), new Uint32Array([2173953, 2173985, 0, 2174017, 2174049, 2174081, 2174113, 2174145, 2174177, 2149057, 2174209, 2174241, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 4271169, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2174273]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 6291456, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 2190785, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2189793, 6291456, 2189825, 6291456, 2189857, 6291456, 2189889, 6291456, 2189921, 6291456, 2189953, 6291456, 2189985, 6291456, 2190017, 6291456]), new Uint32Array([2105601, 2112289, 2108193, 2112481, 2112577, 0, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 0, 2098209, 2111137]), new Uint32Array([2172129, 6291456, 2172161, 6291456, 2172193, 6291456, 2172225, 6291456, 2172257, 6291456, 2172289, 6291456, 2172321, 6291456, 2172353, 6291456]), new Uint32Array([2214753, 6291456, 2214785, 6291456, 6291456, 2214817, 2214849, 2214881, 2214913, 2214945, 2214977, 2215009, 2215041, 2215073, 2194401, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([0, 0, 0, 0, 6291456, 6291456, 6291456, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([10610305, 10610337, 10575617, 2221761, 10610401, 10610433, 10502177, 0, 10610465, 10610497, 10610529, 10610561, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 23068672, 0, 0, 0, 0, 23068672]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2187105, 2187137, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2199393, 2199425, 2199457, 2199489, 2199521, 2199553, 2199585, 2199617, 2199649, 2199681, 2199713, 2199745, 2199777, 2199809, 2199841, 0]), new Uint32Array([2217249, 2217281, 2217313, 2217345, 2217377, 2217409, 2217441, 2217473, 2215617, 2217505, 2217537, 2217569, 2214753, 2217601, 2217633, 2217665]), new Uint32Array([2170273, 2170305, 6291456, 2170337, 2170369, 6291456, 2170401, 2170433, 2170465, 6291456, 6291456, 6291456, 2170497, 2170529, 6291456, 2170561]), new Uint32Array([2188673, 6291456, 2188705, 2188737, 2188769, 6291456, 6291456, 2188801, 6291456, 2188833, 6291456, 2188865, 6291456, 2180929, 2181505, 2180897]), new Uint32Array([10489988, 10490116, 10490244, 10490372, 10490500, 10490628, 10490756, 10490884, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2147393, 2147457, 2147521, 2147585, 2147649, 2147713, 2147777, 2147841]), new Uint32Array([23068672, 23068672, 0, 23068672, 23068672, 0, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0, 0]), new Uint32Array([2241153, 2241185, 2241217, 2215809, 2241250, 2241313, 2241345, 2241377, 2217921, 2241377, 2241409, 2215873, 2241441, 2241473, 2241505, 2241537]), new Uint32Array([23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2220417, 2220417, 2220449, 2220449, 2220481, 2220481, 2220513, 2220513, 2220545, 2220545, 2220577, 2220577, 2220609, 2220609, 2220641, 2220641]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2144002, 0, 6291456, 6291456, 0, 0, 6291456, 6291456, 6291456]), new Uint32Array([2167105, 2167137, 2167169, 2167201, 2167233, 2167265, 2167297, 2167329, 2167361, 2167393, 2167425, 2167457, 2167489, 2167521, 2167553, 2167585]), new Uint32Array([10575521, 2098209, 2111137, 2105505, 2098241, 2108353, 2108417, 2105825, 2111713, 2100897, 2111905, 2105473, 2105569, 2105601, 2112289, 2108193]), new Uint32Array([2234146, 2234210, 2234274, 2234338, 2234402, 2234466, 2234530, 2234594, 2234658, 2234722, 2234786, 2234850, 2234914, 2234978, 2235042, 2235106]), new Uint32Array([0, 0, 0, 0, 0, 0, 0, 2180577, 0, 0, 0, 0, 0, 2180609, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 6291456, 6291456]), new Uint32Array([2098209, 2111137, 2105505, 2098241, 2108353, 2108417, 2105825, 2111713, 2100897, 2111905, 2105473, 2105569, 2105601, 2112289, 2108193, 2112481]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2242529, 2242561, 2242593, 2242625, 2242657, 2242689, 2242721, 2242753, 2207937, 2218177, 2242785, 2242817, 2242849, 2242882, 2242945, 2242977]), new Uint32Array([2118049, 2105345, 2118241, 2105441, 2118433, 2118529, 2118625, 2118721, 2118817, 2200257, 2200289, 2191809, 2200321, 2200353, 2200385, 2200417]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0]), new Uint32Array([2185505, 6291456, 2185537, 6291456, 2185569, 6291456, 2185601, 6291456, 2185633, 6291456, 2185665, 6291456, 2185697, 6291456, 2185729, 6291456]), new Uint32Array([2231970, 2232034, 2232098, 2232162, 2232226, 2232290, 2232354, 2232418, 2232482, 2232546, 2232610, 2232674, 2232738, 2232802, 2232866, 2232930]), new Uint32Array([2218625, 2246402, 2246466, 2246530, 2246594, 2246657, 2246689, 2246689, 2218657, 2219681, 2246721, 2246753, 2246785, 2246818, 2246881, 2208481]), new Uint32Array([2197025, 2197057, 2197089, 2197121, 2197153, 2197185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2219137, 2216961, 2219169, 2219201, 2219233, 2219265, 2219297, 2217025, 2215041, 2219329, 2217057, 2219361, 2217089, 2219393, 2197153, 2219426]), new Uint32Array([23068672, 23068672, 23068672, 0, 0, 0, 23068672, 23068672, 23068672, 0, 23068672, 23068672, 23068672, 23068672, 0, 0]), new Uint32Array([2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 2098209, 2111137, 2105505, 2098241, 2108353, 2108417, 2105825, 2111713]), new Uint32Array([2243522, 2243585, 2243617, 2243649, 2243681, 2210113, 2243713, 2243746, 2243810, 2243874, 2243937, 2243970, 2244033, 2244065, 2244097, 2244129]), new Uint32Array([2178017, 6291456, 2178049, 6291456, 2178081, 6291456, 2178113, 6291456, 2178145, 6291456, 2178177, 6291456, 2178209, 6291456, 2178241, 6291456]), new Uint32Array([10553858, 2165314, 10518722, 6291456, 10518818, 0, 10518914, 2130690, 10519010, 2130786, 10519106, 2130882, 10519202, 2165378, 10554050, 2165506]), new Uint32Array([0, 0, 2135491, 2135587, 2135683, 2135779, 2135875, 2135971, 2135971, 2136067, 2136163, 2136259, 2136355, 2136355, 2136451, 2136547]), new Uint32Array([23068672, 23068672, 23068672, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456]), new Uint32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2220033, 2220033, 2220065, 2220065, 2220065, 2220065, 2220097, 2220097, 2220097, 2220097, 2220129, 2220129, 2220129, 2220129, 2220161, 2220161]), new Uint32Array([6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 0, 23068672, 0, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([2100897, 2100898, 2100899, 2150018, 2100865, 2100866, 2100867, 2100868, 2150082, 2108481, 2109858, 2109859, 2105569, 2105505, 2098241, 2105601]), new Uint32Array([2097217, 2097505, 2097505, 2097505, 2097505, 2165570, 2165570, 2165634, 2165634, 2165698, 2165698, 2097858, 2097858, 0, 0, 2097152]), new Uint32Array([23068672, 6291456, 23068672, 23068672, 23068672, 6291456, 6291456, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672]), new Uint32Array([23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0]), new Uint32Array([10503843, 10503939, 10504035, 10504131, 10504227, 10504323, 10504419, 10504515, 10504611, 10504707, 10504803, 10504899, 10504995, 10491140, 10491268, 0]), new Uint32Array([2173697, 2173729, 2148801, 2173761, 2143969, 2173793, 2173825, 2153473, 2173857, 2173889, 2173921, 2173953, 2173985, 2173761, 2174017, 2174049]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([2134145, 2097153, 2134241, 2105953, 2132705, 2130977, 2160065, 2131297, 2162049, 2133089, 2160577, 2133857, 2235297, 2220769, 2235329, 2235361]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([2222401, 2222433, 2222465, 10531394, 2222497, 2222529, 2222561, 0, 2222593, 2222625, 2222657, 2222689, 2222721, 2222753, 2222785, 0]), new Uint32Array([2184481, 6291456, 2184513, 6291456, 2184545, 6291456, 2184577, 6291456, 2184609, 6291456, 2184641, 6291456, 2184673, 6291456, 2184705, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2105570, 2156034, 2126947, 2156098, 2153666, 2127043, 2127139, 2156162, 0, 2127235, 2156226, 2156290, 2156354, 2156418, 2127331, 2127427]), new Uint32Array([2215905, 2207041, 2153185, 2241569, 2241601, 2241633, 2241665, 2241697, 2241730, 2241793, 2241825, 2241857, 2241889, 2241921, 2241954, 2242017]), new Uint32Array([2203777, 6291456, 2203809, 6291456, 2203841, 6291456, 2203873, 6291456, 2203905, 6291456, 2173121, 2180993, 2181249, 2203937, 2181313, 0]), new Uint32Array([2168577, 6291456, 2168609, 6291456, 2168641, 6291456, 2168673, 6291456, 2168705, 6291456, 2168737, 6291456, 2168769, 6291456, 2168801, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456, 23068672, 23068672, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 23068672, 23068672, 23068672, 0, 23068672, 23068672, 23068672, 0, 0]), new Uint32Array([2210113, 2195521, 2210145, 2210177, 2210209, 2210241, 2210273, 2210305, 2210337, 2210369, 2210401, 2210433, 2210465, 2210497, 2210529, 2210561]), new Uint32Array([6291456, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0]), new Uint32Array([2228706, 2228770, 2228834, 2228898, 2228962, 2229026, 2229090, 2229154, 2229218, 2229282, 2229346, 2229410, 2229474, 2229538, 2229602, 2229666]), new Uint32Array([23068672, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 18874368, 18874368, 18874368, 0, 0]), new Uint32Array([2133089, 2133281, 2133281, 2133281, 2133281, 2160577, 2160577, 2160577, 2160577, 2097441, 2097441, 2097441, 2097441, 2133857, 2133857, 2133857]), new Uint32Array([6291456, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2173825, 2153473, 2173857, 2173889, 2173921, 2173953, 2173985, 2174017, 2174017, 2174049, 2174081, 2174113, 2174145, 2174177, 2149057, 2233089]), new Uint32Array([2178529, 6291456, 2178561, 6291456, 2178593, 6291456, 2178625, 6291456, 2178657, 6291456, 2178689, 6291456, 2178721, 6291456, 2178753, 6291456]), new Uint32Array([2221025, 2221025, 2221057, 2221057, 2159329, 2159329, 2159329, 2159329, 2097217, 2097217, 2158914, 2158914, 2158978, 2158978, 2159042, 2159042]), new Uint32Array([2208161, 2208193, 2208225, 2208257, 2194433, 2208289, 2208321, 2208353, 2208385, 2208417, 2208449, 2208481, 2208513, 2208545, 2208577, 2208609]), new Uint32Array([2169217, 6291456, 2169249, 6291456, 2169281, 6291456, 2169313, 6291456, 2169345, 6291456, 2169377, 6291456, 2169409, 6291456, 2169441, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2133187, 2133283, 2133283, 2133379, 2133475, 2133571, 2133667, 2133667, 2133763, 2133859, 2133955, 2134051, 2134147, 2134147, 2134243, 2134339]), new Uint32Array([2197697, 2114113, 2114209, 2197729, 2197761, 2114305, 2197793, 2114401, 2114497, 2197825, 2114593, 2114689, 2114785, 2114881, 2114977, 0]), new Uint32Array([2193089, 2193121, 2193153, 2193185, 2117665, 2117569, 2193217, 2193249, 2193281, 2193313, 2193345, 2193377, 2193409, 2193441, 2193473, 2193505]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2184225, 6291456, 2184257, 6291456, 2184289, 6291456, 2184321, 6291456, 2184353, 6291456, 2184385, 6291456, 2184417, 6291456, 2184449, 6291456]), new Uint32Array([2112577, 2098177, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 2100833, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([2098657, 2098049, 2200737, 2123489, 2123681, 2200769, 2098625, 2100321, 2098145, 2100449, 2098017, 2098753, 2200801, 2200833, 2200865, 0]), new Uint32Array([23068672, 23068672, 23068672, 0, 0, 0, 0, 0, 0, 0, 0, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0, 0]), new Uint32Array([2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 2098209, 2111137, 0, 2098241, 2108353, 2108417, 2105825, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2181153, 2105505, 2181185, 2167617, 2180993]), new Uint32Array([2160002, 2160066, 2160130, 2160194, 2160258, 2132066, 2131010, 2131106, 2106018, 2131618, 2160322, 2131298, 2132034, 2131938, 2137410, 2132226]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6291456]), new Uint32Array([2183617, 6291456, 2183649, 6291456, 2183681, 6291456, 2183713, 6291456, 2183745, 6291456, 2183777, 6291456, 2183809, 6291456, 2183841, 6291456]), new Uint32Array([0, 6291456, 6291456, 0, 6291456, 0, 0, 6291456, 6291456, 0, 6291456, 0, 0, 6291456, 0, 0]), new Uint32Array([2250977, 2251009, 2251041, 2251073, 2195009, 2251106, 2251169, 2251201, 2251233, 2251265, 2251297, 2251330, 2251394, 2251457, 2251489, 2251521]), new Uint32Array([2205729, 2205761, 2205793, 2205825, 2205857, 2205889, 2205921, 2205953, 2205985, 2206017, 2206049, 2206081, 2206113, 2206145, 2206177, 2206209]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2143170, 2168993, 6291456, 2169025, 6291456, 2169057, 6291456, 2169089, 6291456, 2143234, 2169121, 6291456, 2169153, 6291456, 2169185, 6291456]), new Uint32Array([23068672, 23068672, 2190689, 6291456, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2248706, 2248769, 2248801, 2248833, 2248865, 2248897, 2248929, 2248962, 2249026, 2249090, 2249154, 2240705, 2249217, 2249249, 2249281, 2249313]), new Uint32Array([10485857, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 10495394, 6291456, 2098209, 6291456, 6291456, 2097152, 6291456, 10531394]), new Uint32Array([0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0]), new Uint32Array([14680064, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2173985, 2173953, 2148481, 2173601, 2173633, 2173665, 2173697, 2173729, 2148801, 2173761, 2143969, 2173793, 2173825, 2153473, 2173857, 2173889]), new Uint32Array([6291456, 2186977, 6291456, 6291456, 6291456, 6291456, 6291456, 10537858, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2209601, 2209633, 2209665, 2209697, 2209729, 2209761, 2209793, 2209825, 2209857, 2209889, 2209921, 2209953, 2209985, 2210017, 2210049, 2210081]), new Uint32Array([10501539, 10501635, 10501731, 10501827, 10501923, 10502019, 2098209, 2111137, 2105505, 2098241, 2108353, 2108417, 2105825, 2111713, 2100897, 2111905]), new Uint32Array([2173697, 2173729, 2148801, 2173761, 2143969, 2173793, 2173825, 2153473, 2173857, 2173889, 2173921, 2173953, 2173985, 2174017, 2174017, 2174049]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 0, 0]), new Uint32Array([6291456, 6291456, 23068672, 23068672, 23068672, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2194561, 2194593, 2194625, 2119777, 2119873, 2194657, 2194689, 2194721, 2194753, 2194785, 2194817, 2194849, 2194881, 2194913, 2194945, 2194977]), new Uint32Array([2113153, 2108481, 2113345, 2113441, 2098209, 2111137, 2105505, 2098241, 2108353, 2108417, 2105825, 2111713, 2100897, 2111905, 2105473, 2105569]), new Uint32Array([2222818, 2222882, 2222946, 2223010, 2223074, 2223138, 2223202, 2223266, 2223330, 2223394, 2223458, 2223522, 2223586, 2223650, 2223714, 2223778]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672]), new Uint32Array([0, 2179553, 2179585, 2179617, 2179649, 2144001, 2179681, 2179713, 2179745, 2179777, 2179809, 2156705, 2179841, 2156833, 2179873, 2179905]), new Uint32Array([6291456, 23068672, 6291456, 2145602, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 23068672, 23068672, 6291456, 0, 0]), new Uint32Array([2196513, 2196545, 2196577, 2196609, 2196641, 2196673, 2196705, 2196737, 2196769, 2196801, 2196833, 2196865, 2196897, 2196929, 2196961, 2196993]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2177281, 6291456, 2177313, 6291456, 2177345, 6291456, 2177377, 6291456, 2177409, 6291456, 2177441, 6291456, 2177473, 6291456, 2177505, 6291456]), new Uint32Array([2187137, 2221473, 2221505, 2221537, 2221569, 6291456, 6291456, 10610209, 10610241, 10537986, 10537986, 10537986, 10537986, 10609857, 10609857, 10609857]), new Uint32Array([2243009, 2243041, 2216033, 2243074, 2243137, 2243169, 2243201, 2219617, 2243233, 2243265, 2243297, 2243329, 2243362, 2243425, 2243457, 2243489]), new Uint32Array([10485857, 10485857, 10485857, 10485857, 10485857, 10485857, 10485857, 10485857, 10485857, 10485857, 10485857, 2097152, 4194304, 4194304, 0, 0]), new Uint32Array([2143042, 6291456, 2143106, 2143106, 2168833, 6291456, 2168865, 6291456, 6291456, 2168897, 6291456, 2168929, 6291456, 2168961, 6291456, 2143170]), new Uint32Array([6291456, 6291456, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2204193, 2204225, 2204257, 2204289, 2204321, 2204353, 2204385, 2204417, 2204449, 2204481, 2204513, 2204545, 2204577, 2204609, 2204641, 2204673]), new Uint32Array([2202753, 6291456, 2202785, 6291456, 2202817, 6291456, 2202849, 6291456, 2202881, 6291456, 2202913, 6291456, 2202945, 6291456, 2202977, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([2108353, 2108417, 2105825, 2111713, 2100897, 2111905, 2105473, 2105569, 2105601, 2112289, 2108193, 2112481, 2112577, 2098177, 2098305, 2108321]), new Uint32Array([2147394, 2147458, 2147522, 2147586, 2147650, 2147714, 2147778, 2147842, 2147394, 2147458, 2147522, 2147586, 2147650, 2147714, 2147778, 2147842]), new Uint32Array([2253313, 2253346, 2253409, 2253441, 2253473, 2253505, 2253537, 2253569, 2253601, 2253634, 2219393, 2253697, 2253729, 2253761, 2253793, 2253825]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456]), new Uint32Array([2162562, 2162626, 2131362, 2162690, 2159938, 2160002, 2162754, 2162818, 2160130, 2162882, 2160194, 2160258, 2160834, 2160898, 2161026, 2161090]), new Uint32Array([2175361, 2175393, 2175425, 2175457, 2175489, 2175521, 2175553, 2175585, 2175617, 2175649, 2175681, 2175713, 2175745, 2175777, 2175809, 2175841]), new Uint32Array([2253858, 2253921, 2253954, 2254018, 2254082, 2196737, 2254145, 2196865, 2254177, 2254209, 2254241, 2254273, 2197025, 2254306, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2202113, 2204129, 2188705, 2204161]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 0, 0]), new Uint32Array([2173985, 2174017, 2174017, 2174049, 2174081, 2174113, 2174145, 2174177, 2149057, 2233089, 2173697, 2173761, 2173793, 2174113, 2173985, 2173953]), new Uint32Array([2101569, 2101697, 2101825, 2101953, 2102081, 2102209, 2100833, 2100737, 2098337, 2101441, 2101569, 2101697, 2101825, 2101953, 2102081, 2102209]), new Uint32Array([2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 2098209, 2111137, 2105505, 2098241, 0, 2108417, 0, 2111713, 2100897, 2111905]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2175425, 2175489, 2175809, 2175905, 2175937, 2175937, 2176193, 2176417, 2180865, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 2143298, 2143298, 2143298, 2143362, 2143362, 2143362, 2143426, 2143426, 2143426, 2171105, 6291456, 2171137]), new Uint32Array([2120162, 2120258, 2151618, 2151682, 2151746, 2151810, 2151874, 2151938, 2152002, 2120035, 2120131, 2120227, 2152066, 2120323, 2152130, 2120419]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0, 0, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2195361, 2142433, 2236065, 2236097, 2236129, 2236161, 2118241, 2117473, 2236193, 2236225, 2236257, 2236289, 0, 0, 0, 0]), new Uint32Array([2189281, 6291456, 2189313, 6291456, 2189345, 6291456, 2189377, 6291456, 2189409, 6291456, 2189441, 6291456, 2189473, 6291456, 2189505, 6291456]), new Uint32Array([6291456, 6291456, 2145922, 6291456, 6291456, 6291456, 6291456, 2145986, 6291456, 6291456, 6291456, 6291456, 2146050, 6291456, 6291456, 6291456]), new Uint32Array([2100833, 2100737, 2098337, 2101441, 2101569, 2101697, 2101825, 2101953, 2102081, 2102209, 10502113, 10562017, 10610401, 10502177, 10610433, 10538049]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 2186401, 0, 2186433, 0, 2186465, 0, 2186497]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 23068672, 23068672, 23068672]), new Uint32Array([0, 0, 2198241, 2198273, 2198305, 2198337, 2198369, 2198401, 0, 0, 2198433, 2198465, 2198497, 0, 0, 0]), new Uint32Array([6291456, 0, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 0, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 23068672, 6291456, 23068672, 23068672]), new Uint32Array([0, 2105921, 2097729, 0, 2097377, 0, 0, 2106017, 2133281, 2097505, 2105889, 0, 2097697, 2135777, 2097633, 2097441]), new Uint32Array([2197889, 2197921, 2197953, 2197985, 2198017, 2198049, 2198081, 2198113, 2198145, 2198177, 2198209, 2198241, 2198273, 2198305, 2198337, 2198369]), new Uint32Array([2132514, 2132610, 2160386, 2133090, 2133186, 2160450, 2160514, 2133282, 2160578, 2133570, 2106178, 2160642, 2133858, 2160706, 2160770, 2134146]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 23068672, 23068672, 6291456, 23068672, 23068672, 6291456, 23068672, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2184737, 6291456, 2184769, 6291456, 2184801, 6291456, 2184833, 6291456, 2184865, 6291456, 2184897, 6291456, 2184929, 6291456, 2184961, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 0, 6291456]), new Uint32Array([6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 6291456, 23068672, 23068672, 23068672, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 2186753, 6291456, 6291456, 6291456, 6291456, 2186785, 2186817, 2186849, 2173569, 2186881, 10496355, 10495395, 10575521]), new Uint32Array([0, 0, 2097729, 0, 0, 0, 0, 2106017, 0, 2097505, 0, 2097185, 0, 2135777, 2097633, 2097441]), new Uint32Array([2189537, 6291456, 2189569, 6291456, 2189601, 6291456, 2189633, 6291456, 2189665, 6291456, 2189697, 6291456, 2189729, 6291456, 2189761, 6291456]), new Uint32Array([2202497, 6291456, 2202529, 6291456, 2202561, 6291456, 2202593, 6291456, 2202625, 6291456, 2202657, 6291456, 2202689, 6291456, 2202721, 6291456]), new Uint32Array([2245217, 2218369, 2245249, 2245282, 2245345, 2245377, 2245410, 2245474, 2245537, 2245569, 2245601, 2245633, 2245665, 2245665, 2245697, 2245729]), new Uint32Array([6291456, 0, 23068672, 23068672, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 0, 0, 0, 0, 0, 0, 23068672, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 6291456, 23068672, 6291456, 23068672, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672]), new Uint32Array([0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2097281, 2105921, 2097729, 2106081, 2097377, 2097601, 2162337, 2106017, 2133281, 2097505, 0, 2097185, 2097697, 2135777, 2097633, 2097441]), new Uint32Array([2176641, 6291456, 2176673, 6291456, 2176705, 6291456, 2176737, 6291456, 2176769, 6291456, 2176801, 6291456, 2176833, 6291456, 2176865, 6291456]), new Uint32Array([2174145, 2174177, 2149057, 2233089, 2173697, 2173761, 2173793, 2174113, 2173985, 2173953, 2174369, 2174369, 0, 0, 2100833, 2100737]), new Uint32Array([2116513, 2190817, 2190849, 2190881, 2190913, 2190945, 2116609, 2190977, 2191009, 2191041, 2191073, 2117185, 2191105, 2191137, 2191169, 2191201]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456]), new Uint32Array([0, 0, 0, 0, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456]), new Uint32Array([2167617, 2167649, 2167681, 2167713, 2167745, 2167777, 2167809, 6291456, 2167841, 2167873, 2167905, 2167937, 2167969, 2168001, 2168033, 4240130]), new Uint32Array([2165122, 2163970, 2164034, 2164098, 2164162, 2164226, 2164290, 2164354, 2164418, 2164482, 2164546, 2133122, 2134562, 2132162, 2132834, 2136866]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 2186209, 2186241, 2186273, 2186305, 2186337, 2186369, 0, 0]), new Uint32Array([2112481, 2112577, 2098177, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 14680064, 14680064, 14680064, 14680064, 14680064]), new Uint32Array([0, 0, 23068672, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 6291456, 6291456]), new Uint32Array([0, 10537921, 10610689, 10610273, 10610497, 10610529, 10610305, 10610721, 10489601, 10489697, 10610337, 10575617, 10554529, 2221761, 2197217, 10496577]), new Uint32Array([2105473, 2105569, 2105601, 2112289, 0, 2112481, 2112577, 2098177, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441]), new Uint32Array([2100897, 2111905, 2105473, 2105569, 2105601, 2112289, 2108193, 2112481, 2112577, 2098177, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481]), new Uint32Array([2125346, 2153410, 2153474, 2127394, 2153538, 2153602, 2153666, 2153730, 2105507, 2105476, 2153794, 2153858, 2153922, 2153986, 2154050, 2105794]), new Uint32Array([2200449, 2119681, 2200481, 2153313, 2199873, 2199905, 2199937, 2200513, 2200545, 2200577, 2200609, 2119105, 2119201, 2119297, 2119393, 2119489]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2175777, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2222273, 2197217, 2221473, 2221505, 2221089, 2222305, 2200865, 2099681, 2104481, 2222337, 2099905, 2120737, 2222369, 2103713, 2100225, 2098785]), new Uint32Array([2201377, 6291456, 2201409, 6291456, 2201441, 6291456, 2201473, 6291456, 2201505, 6291456, 2201537, 6291456, 2201569, 6291456, 6291456, 23068672]), new Uint32Array([2174081, 2174113, 2174145, 2174177, 2149057, 2233057, 2148481, 2173601, 2173633, 2173665, 2173697, 2173729, 2148801, 2173761, 2143969, 2173793]), new Uint32Array([2200897, 6291456, 2200929, 6291456, 2200961, 6291456, 2200993, 6291456, 2201025, 6291456, 2180865, 6291456, 2201057, 6291456, 2201089, 6291456]), new Uint32Array([0, 0, 0, 0, 0, 23068672, 23068672, 0, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0]), new Uint32Array([2161154, 2161410, 2138658, 2161474, 2161538, 2097666, 2097186, 2097474, 2162946, 2132450, 2163010, 2163074, 2136162, 2163138, 2161666, 2161730]), new Uint32Array([2148481, 2173601, 2173633, 2173665, 2173697, 2173729, 2148801, 2173761, 2143969, 2173793, 2173825, 2153473, 2173857, 2173889, 2173921, 2173953]), new Uint32Array([0, 0, 0, 0, 0, 0, 23068672, 23068672, 0, 0, 0, 0, 2145410, 2145474, 0, 6291456]), new Uint32Array([2244161, 2216065, 2212769, 2244193, 2244225, 2244257, 2244290, 2244353, 2244385, 2244417, 2244449, 2218273, 2244481, 2244514, 2244577, 2244609]), new Uint32Array([2125730, 2125699, 2125795, 2125891, 2125987, 2154114, 2154178, 2154242, 2154306, 2154370, 2154434, 2154498, 2126082, 2126178, 2126274, 2126083]), new Uint32Array([2237665, 2237697, 2237697, 2237697, 2237730, 2237793, 2237825, 2237857, 2237890, 2237953, 2237985, 2238017, 2238049, 2238081, 2238113, 2238145]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2150146, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 23068672, 23068672, 0, 0, 23068672, 23068672, 23068672, 0, 0]), new Uint32Array([2214369, 2238593, 2238625, 2238657, 2238689, 2238721, 2238753, 2238785, 2238817, 2238850, 2238913, 2238945, 2238977, 2235457, 2239009, 2239041]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0]), new Uint32Array([2252066, 2252130, 2252193, 2252225, 2252257, 2252290, 2252353, 2252385, 2252417, 2252449, 2252481, 2252513, 2252545, 2252578, 2252641, 2252673]), new Uint32Array([2197697, 2114113, 2114209, 2197729, 2197761, 2114305, 2197793, 2114401, 2114497, 2197825, 2114593, 2114689, 2114785, 2114881, 2114977, 2197857]), new Uint32Array([2224866, 2224930, 2224994, 2225058, 2225122, 2225186, 2225250, 2225314, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2219490, 2219554, 2219617, 2219649, 2219681, 2219714, 2219778, 2219842, 2219905, 2219937, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 23068672, 23068672, 23068672, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456]), new Uint32Array([2113345, 2113441, 2098209, 2111137, 2105505, 2098241, 2108353, 2108417, 2105825, 2111713, 2100897, 2111905, 2105473, 2105569, 2105601, 2112289]), new Uint32Array([2174081, 2174113, 2174145, 2174177, 2149057, 2233089, 2173697, 2173761, 2173793, 2174113, 2173985, 2173953, 2148481, 2173601, 2173633, 2173665]), new Uint32Array([2220161, 2220161, 2220193, 2220193, 2220193, 2220193, 2220225, 2220225, 2220225, 2220225, 2220257, 2220257, 2220257, 2220257, 2220289, 2220289]), new Uint32Array([2192673, 2192705, 2192737, 2192769, 2192801, 2192833, 2192865, 2118049, 2192897, 2117473, 2117761, 2192929, 2192961, 2192993, 2193025, 2193057]), new Uint32Array([2179297, 6291456, 2179329, 6291456, 2179361, 6291456, 2179393, 6291456, 2179425, 6291456, 2179457, 6291456, 2179489, 6291456, 2179521, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 23068672, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2235745, 2235777, 2193633, 2235809, 2235841, 2235873, 2235905, 2235937, 2235969, 2116513, 2116705, 2236001, 2200513, 2199905, 2200545, 2236033]), new Uint32Array([2113153, 2108481, 2113345, 2113441, 2232993, 2233025, 0, 0, 2148481, 2173601, 2173633, 2173665, 2173697, 2173729, 2148801, 2173761]), new Uint32Array([2170593, 6291456, 2170625, 6291456, 2170657, 6291456, 2170689, 2170721, 6291456, 2170753, 6291456, 6291456, 2170785, 6291456, 2170817, 2170849]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2166786, 2166850, 0, 0, 0, 0]), new Uint32Array([23068672, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456]), new Uint32Array([2100833, 2100737, 2098337, 2101441, 2101569, 2101697, 2101825, 2101953, 2102081, 2102209, 10575617, 2187041, 10502177, 10489601, 10489697, 0]), new Uint32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2134562, 2132162, 2132834, 2136866, 2136482, 2164610, 2164674, 2164738, 2164802, 2132802, 2132706, 2164866, 2132898, 2164930, 2164994, 2165058]), new Uint32Array([6291456, 6291456, 2098337, 2101441, 10531458, 2153473, 6291456, 6291456, 10531522, 2100737, 2108193, 6291456, 2106499, 2106595, 2106691, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2233122, 2233186, 2233250, 2233314, 2233378, 2233442, 2233506, 2233570, 2233634, 2233698, 2233762, 2233826, 2233890, 2233954, 2234018, 2234082]), new Uint32Array([23068672, 6291456, 23068672, 23068672, 23068672, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2205217, 2205249, 2205281, 2205313, 2205345, 2205377, 2205409, 2205441, 2205473, 2205505, 2205537, 2205569, 2205601, 2205633, 2205665, 2205697]), new Uint32Array([6291456, 0, 6291456, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 0, 0, 23068672, 6291456, 23068672, 23068672]), new Uint32Array([2173601, 2173761, 2174081, 2173569, 2174241, 2174113, 2173953, 6291456, 2174305, 6291456, 2174337, 6291456, 2174369, 6291456, 2174401, 6291456]), new Uint32Array([6291456, 23068672, 23068672, 23068672, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456]), new Uint32Array([2152450, 2152514, 2099653, 2104452, 2099813, 2122243, 2099973, 2152578, 2122339, 2122435, 2122531, 2122627, 2122723, 2104580, 2122819, 2152642]), new Uint32Array([2236385, 2236417, 2236449, 2236482, 2236545, 2215425, 2236577, 2236609, 2236641, 2236673, 2215457, 2236705, 2236737, 2236770, 2215489, 2236833]), new Uint32Array([2163394, 2159746, 2163458, 2131362, 2163522, 2160130, 2163778, 2132226, 2163842, 2132898, 2163906, 2161410, 2138658, 2097666, 2136162, 2163650]), new Uint32Array([2218721, 2246913, 2246946, 2216385, 2247010, 2247074, 2215009, 2247137, 2247169, 2216481, 2247201, 2247233, 2247266, 2247330, 2247330, 0]), new Uint32Array([2129730, 2129762, 2129858, 2129731, 2129827, 2156482, 2156482, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 0, 0, 0, 0, 0, 6291456, 0, 0]), new Uint32Array([2203969, 2204001, 2181377, 2204033, 2204065, 6291456, 2204097, 6291456, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2169473, 6291456, 2169505, 6291456, 2169537, 6291456, 2169569, 6291456, 2169601, 6291456, 2169633, 6291456, 2169665, 6291456, 2169697, 6291456]), new Uint32Array([2141542, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2220801, 2220801, 2220801, 2220801, 2220833, 2220833, 2220865, 2220865, 2220865, 2220865, 2220897, 2220897, 2220897, 2220897, 2139873, 2139873]), new Uint32Array([0, 0, 0, 0, 0, 23068672, 23068672, 0, 0, 0, 0, 0, 0, 0, 6291456, 0]), new Uint32Array([2214849, 2218433, 2218465, 2218497, 2218529, 2218561, 2214881, 2218593, 2218625, 2218657, 2218689, 2218721, 2218753, 2216545, 2218785, 2218817]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6291456]), new Uint32Array([2136482, 2164610, 2164674, 2164738, 2164802, 2132802, 2132706, 2164866, 2132898, 2164930, 2164994, 2165058, 2165122, 2132802, 2132706, 2164866]), new Uint32Array([2207649, 2207681, 2207713, 2207745, 2207777, 2207809, 2207841, 2207873, 2207905, 2207937, 2207969, 2208001, 2208033, 2208065, 2208097, 2208129]), new Uint32Array([2123683, 2105092, 2152706, 2123779, 2105220, 2152770, 2100453, 2098755, 2123906, 2124002, 2124098, 2124194, 2124290, 2124386, 2124482, 2124578]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 0, 0, 0, 6291456, 0, 0, 0, 0, 0, 0, 0, 10485857]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([10508163, 10508259, 10508355, 10508451, 2200129, 2200161, 2192737, 2200193, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2203553, 6291456, 2203585, 6291456, 6291456, 6291456, 2203617, 6291456, 2203649, 6291456, 2203681, 6291456, 2203713, 6291456, 2203745, 6291456]), new Uint32Array([18884449, 18884065, 23068672, 18884417, 18884034, 18921185, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 18874368]), new Uint32Array([2247393, 2247426, 2247489, 2247521, 2247553, 2247586, 2247649, 2247681, 2247713, 2247745, 2247777, 2247810, 2247873, 2247905, 2247937, 2247969]), new Uint32Array([6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 23068672]), new Uint32Array([2134145, 2097153, 2134241, 0, 2132705, 2130977, 2160065, 2131297, 0, 2133089, 2160577, 2133857, 2235297, 0, 2235329, 0]), new Uint32Array([2182593, 6291456, 2182625, 6291456, 2182657, 6291456, 2182689, 6291456, 2182721, 6291456, 2182753, 6291456, 2182785, 6291456, 2182817, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2102402, 2102403, 6291456, 2110050]), new Uint32Array([2149890, 2108323, 2149954, 6291456, 2113441, 6291456, 2149057, 6291456, 2113441, 6291456, 2105473, 2167265, 2111137, 2105505, 6291456, 2108353]), new Uint32Array([2219105, 2219137, 2195233, 2251554, 2251617, 2251649, 2251681, 2251713, 2251746, 2251810, 2251873, 2251905, 2251937, 2251970, 2252033, 2219169]), new Uint32Array([2203009, 6291456, 2203041, 6291456, 2203073, 6291456, 2203105, 6291456, 2203137, 6291456, 2203169, 6291456, 2203201, 6291456, 2203233, 6291456]), new Uint32Array([2128195, 2128291, 2128387, 2128483, 2128579, 2128675, 2128771, 2128867, 2128963, 2129059, 2129155, 2129251, 2129347, 2129443, 2129539, 2129635]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2140964, 2141156, 2140966, 2141158, 2141350]), new Uint32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([2225378, 2225442, 2225506, 2225570, 2225634, 2225698, 2225762, 2225826, 2225890, 2225954, 2226018, 2226082, 2226146, 2226210, 2226274, 2226338]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2112577, 2098177, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 2098209, 2111137, 2105505, 2098241, 2108353, 2108417]), new Uint32Array([2108353, 2108417, 0, 2105601, 2108193, 2157121, 2157313, 2157377, 2157441, 2100897, 6291456, 2108419, 2173953, 2173633, 2173633, 2173953]), new Uint32Array([2111713, 2173121, 2111905, 2098177, 2173153, 2173185, 2173217, 2113153, 2113345, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 2190753]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2197249, 6291456, 2117377, 2197281, 2197313, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 0, 0, 0, 0, 0, 0, 23068672, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456]), new Uint32Array([2098337, 2101441, 2101569, 2101697, 2101825, 2101953, 2102081, 2102209, 2100833, 2100737, 2098337, 2101441, 2101569, 2101697, 2101825, 2101953]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0]), new Uint32Array([0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 23068672, 23068672, 23068672]), new Uint32Array([2173281, 6291456, 2173313, 6291456, 2173345, 6291456, 2173377, 6291456, 0, 0, 10532546, 6291456, 6291456, 6291456, 10562017, 2173441]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 0, 0]), new Uint32Array([23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2159426, 2159490, 2159554, 2159362, 2159618, 2159682, 2139522, 2136450, 2159746, 2159810, 2159874, 2130978, 2131074, 2131266, 2131362, 2159938]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2203233, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2203265, 6291456, 2203297, 6291456, 2203329, 2203361, 6291456]), new Uint32Array([6291456, 6291456, 2148418, 2148482, 2148546, 0, 6291456, 2148610, 2186529, 2186561, 2148417, 2148545, 2148482, 10495778, 2143969, 10495778]), new Uint32Array([2134146, 2139426, 2160962, 2134242, 2161218, 2161282, 2161346, 2161410, 2138658, 2134722, 2134434, 2134818, 2097666, 2097346, 2097698, 2105986]), new Uint32Array([2198881, 2198913, 2198945, 2198977, 2199009, 2199041, 2199073, 2199105, 2199137, 2199169, 2199201, 2199233, 2199265, 2199297, 2199329, 2199361]), new Uint32Array([0, 23068672, 23068672, 23068672, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456]), new Uint32Array([10610561, 2098209, 2111137, 2105505, 2098241, 2108353, 2108417, 2105825, 2111713, 2100897, 2111905, 2105473, 2105569, 2105601, 2112289, 2108193]), new Uint32Array([2183873, 6291456, 2183905, 6291456, 2183937, 6291456, 2183969, 6291456, 2184001, 6291456, 2184033, 6291456, 2184065, 6291456, 2184097, 6291456]), new Uint32Array([2244642, 2244706, 2244769, 2244801, 2218305, 2244833, 2244865, 2244897, 2244929, 2244961, 2244993, 2245026, 2245089, 2245122, 2245185, 0]), new Uint32Array([6291456, 6291456, 2116513, 2116609, 2116705, 2116801, 2199873, 2199905, 2199937, 2199969, 2190913, 2200001, 2200033, 2200065, 2200097, 2191009]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 2180673, 2180705, 2180737, 2180769, 2180801, 2180833, 0, 0]), new Uint32Array([2098081, 2099521, 2099105, 2120705, 2098369, 2120801, 2103361, 2097985, 2098433, 2121377, 2121473, 2099169, 2099873, 2098401, 2099393, 2152609]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2150402]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 2145666, 2145730, 6291456, 6291456]), new Uint32Array([2173921, 2173953, 2173985, 2173761, 2174017, 2174049, 2174081, 2174113, 2174145, 2174177, 2149057, 2233057, 2148481, 2173601, 2173633, 2173665]), new Uint32Array([2187073, 6291456, 6291456, 6291456, 6291456, 2098241, 2098241, 2108353, 2100897, 2111905, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2102404, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2100612, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 10485857]), new Uint32Array([2149057, 2233057, 2148481, 2173601, 2173633, 2173665, 2173697, 2173729, 2148801, 2173761, 2143969, 2173793, 2173825, 2153473, 2173857, 2173889]), new Uint32Array([2217697, 2217729, 2217761, 2217793, 2217825, 2217857, 2217889, 2217921, 2217953, 2215873, 2217985, 2215905, 2218017, 2218049, 2218081, 2218113]), new Uint32Array([2211233, 2218849, 2216673, 2218881, 2218913, 2218945, 2218977, 2219009, 2216833, 2219041, 2215137, 2219073, 2216865, 2209505, 2219105, 2216897]), new Uint32Array([2240097, 2240129, 2240161, 2240193, 2240225, 2240257, 2240289, 2240321, 2240353, 2240386, 2240449, 2240481, 2240513, 2240545, 2207905, 2240578]), new Uint32Array([6291456, 6291456, 2202273, 6291456, 2202305, 6291456, 2202337, 6291456, 2202369, 6291456, 2202401, 6291456, 2202433, 6291456, 2202465, 6291456]), new Uint32Array([0, 23068672, 23068672, 18923394, 23068672, 18923458, 18923522, 18884099, 18923586, 18884195, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([2201121, 6291456, 2201153, 6291456, 2201185, 6291456, 2201217, 6291456, 2201249, 6291456, 2201281, 6291456, 2201313, 6291456, 2201345, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 6291456, 6291456]), new Uint32Array([2211041, 2211073, 2211105, 2211137, 2211169, 2211201, 2211233, 2211265, 2211297, 2211329, 2211361, 2211393, 2211425, 2211457, 2211489, 2211521]), new Uint32Array([2181825, 6291456, 2181857, 6291456, 2181889, 6291456, 2181921, 6291456, 2181953, 6291456, 2181985, 6291456, 2182017, 6291456, 2182049, 6291456]), new Uint32Array([2162337, 2097633, 2097633, 2097633, 2097633, 2132705, 2132705, 2132705, 2132705, 2097153, 2097153, 2097153, 2097153, 2133089, 2133089, 2133089]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 2148545, 6291456, 2173473, 6291456, 2148865, 6291456, 2173505, 6291456, 2173537, 6291456, 2173569, 6291456, 2149121, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 0, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0]), new Uint32Array([2148801, 2173761, 2143969, 2173793, 2173825, 2153473, 2173857, 2173889, 2173921, 2173953, 2173985, 2174017, 2174017, 2174049, 2174081, 2174113]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([2207137, 2207169, 2207201, 2207233, 2207265, 2207297, 2207329, 2207361, 2207393, 2207425, 2207457, 2207489, 2207521, 2207553, 2207585, 2207617]), new Uint32Array([6291456, 6291456, 23068672, 23068672, 23068672, 6291456, 6291456, 0, 23068672, 23068672, 0, 0, 0, 0, 0, 0]), new Uint32Array([2198401, 2198433, 2198465, 2198497, 0, 2198529, 2198561, 2198593, 2198625, 2198657, 2198689, 2198721, 2198753, 2198785, 2198817, 2198849]), new Uint32Array([2105505, 2098241, 2108353, 2108417, 2105825, 2111713, 2100897, 2111905, 2105473, 2105569, 2105601, 2112289, 2108193, 2112481, 2112577, 2098177]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 0, 0]), new Uint32Array([2216385, 2118721, 2216417, 2216449, 2216481, 2216513, 2216545, 2211233, 2216577, 2216609, 2216641, 2216673, 2216705, 2216737, 2216737, 2216769]), new Uint32Array([2216801, 2216833, 2216865, 2216897, 2216929, 2216961, 2216993, 2215169, 2217025, 2217057, 2217089, 2217121, 2217154, 2217217, 0, 0]), new Uint32Array([2210593, 2191809, 2210625, 2210657, 2210689, 2210721, 2210753, 2210785, 2210817, 2210849, 2191297, 2210881, 2210913, 2210945, 2210977, 2211009]), new Uint32Array([0, 0, 2105825, 0, 0, 2111905, 2105473, 0, 0, 2112289, 2108193, 2112481, 2112577, 0, 2098305, 2108321]), new Uint32Array([0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([0, 2097153, 2134241, 0, 2132705, 0, 0, 2131297, 0, 2133089, 0, 2133857, 0, 2220769, 0, 2235361]), new Uint32Array([14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 6291456, 6291456, 14680064]), new Uint32Array([23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2171873, 6291456, 2171905, 6291456, 2171937, 6291456, 2171969, 6291456, 2172001, 6291456, 2172033, 6291456, 2172065, 6291456, 2172097, 6291456]), new Uint32Array([2220929, 2220929, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2133857, 2134145, 2134145, 2134145, 2134145, 2134241, 2134241, 2134241, 2134241, 2105889, 2105889, 2105889, 2105889, 2097185, 2097185, 2097185]), new Uint32Array([2173697, 2173761, 2173793, 2174113, 2173985, 2173953, 2148481, 2173601, 2173633, 2173665, 2173697, 2173729, 2148801, 2173761, 2143969, 2173793]), new Uint32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10499619, 10499715, 10499811, 10499907]), new Uint32Array([0, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23068672]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 0, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 0, 23068672, 23068672, 23068672, 0, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 6291456, 23068672, 23068672]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 2144322, 2144386, 2144450, 2144514, 2144578, 2144642, 2144706, 2144770]), new Uint32Array([23068672, 23068672, 23068672, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2113153, 2108481, 2113345, 2113441, 2098209, 2111137, 0, 2098241, 2108353, 2108417, 2105825, 0, 0, 2111905, 2105473, 2105569]), new Uint32Array([2236321, 2236353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2152194, 2121283, 2103684, 2103812, 2097986, 2098533, 2097990, 2098693, 2098595, 2098853, 2099013, 2103940, 2121379, 2121475, 2121571, 2104068]), new Uint32Array([2206241, 2206273, 2206305, 2206337, 2206369, 2206401, 2206433, 2206465, 2206497, 2206529, 2206561, 2206593, 2206625, 2206657, 2206689, 2206721]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 16777216, 16777216, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 23068672, 23068672, 10538818, 10538882, 6291456, 6291456, 2150338]), new Uint32Array([6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2214369, 2214401, 2214433, 2214465, 2214497, 2214529, 2214561, 2214593, 2194977, 2214625, 2195073, 2214657, 2214689, 2214721, 6291456, 6291456]), new Uint32Array([2097152, 2097152, 2097152, 2097152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2182081, 6291456, 2182113, 6291456, 2182145, 6291456, 2182177, 6291456, 2182209, 6291456, 2182241, 6291456, 2182273, 6291456, 2182305, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2146881, 2146945, 2147009, 2147073, 2147137, 2147201, 2147265, 2147329]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456, 23068672, 23068672]), new Uint32Array([0, 0, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2122915, 2123011, 2123107, 2104708, 2123203, 2123299, 2123395, 2100133, 2104836, 2100290, 2100293, 2104962, 2104964, 2098052, 2123491, 2123587]), new Uint32Array([23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456]), new Uint32Array([6291456, 2171169, 6291456, 2171201, 6291456, 2171233, 6291456, 2171265, 6291456, 2171297, 6291456, 2171329, 6291456, 6291456, 2171361, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([0, 0, 2148994, 2149058, 2149122, 0, 6291456, 2149186, 2186945, 2173537, 2148993, 2149121, 2149058, 10531458, 10496066, 0]), new Uint32Array([2195009, 2195041, 2195073, 2195105, 2195137, 2195169, 2195201, 2195233, 2195265, 2195297, 2195329, 2195361, 2195393, 2195425, 2195457, 2195489]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 0, 0, 6291456, 6291456]), new Uint32Array([2182849, 6291456, 2182881, 6291456, 2182913, 6291456, 2182945, 6291456, 2182977, 6291456, 2183009, 6291456, 2183041, 6291456, 2183073, 6291456]), new Uint32Array([2211553, 2210081, 2211585, 2211617, 2211649, 2211681, 2211713, 2211745, 2211777, 2211809, 2209569, 2211841, 2211873, 2211905, 2211937, 2211969]), new Uint32Array([2112577, 2098177, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 2166594, 2127298, 2166658, 2142978, 2141827, 2166722]), new Uint32Array([2173985, 2173761, 2174017, 2174049, 2174081, 2174113, 2174145, 2174177, 2149057, 2233057, 2148481, 2173601, 2173633, 2173665, 2173697, 2173729]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 2185761, 2185793, 2185825, 2185857, 2185889, 2185921, 0, 0]), new Uint32Array([6291456, 2148481, 2173601, 2173633, 2173665, 2173697, 2173729, 2148801, 2173761, 2143969, 2173793, 2173825, 2153473, 2173857, 2173889, 2173921]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 6291456]), new Uint32Array([0, 0, 0, 2220961, 2220961, 2220961, 2220961, 2144193, 2144193, 2159201, 2159201, 2159265, 2159265, 2144194, 2220993, 2220993]), new Uint32Array([2192641, 2235393, 2235425, 2152257, 2116609, 2235457, 2235489, 2200065, 2235521, 2235553, 2235585, 2212449, 2235617, 2235649, 2235681, 2235713]), new Uint32Array([2194049, 2194081, 2194113, 2194145, 2194177, 2194209, 2194241, 2194273, 2194305, 2194337, 2194369, 2194401, 2194433, 2194465, 2194497, 2194529]), new Uint32Array([2196673, 2208641, 2208673, 2208705, 2208737, 2208769, 2208801, 2208833, 2208865, 2208897, 2208929, 2208961, 2208993, 2209025, 2209057, 2209089]), new Uint32Array([2191681, 2191713, 2191745, 2191777, 2153281, 2191809, 2191841, 2191873, 2191905, 2191937, 2191969, 2192001, 2192033, 2192065, 2192097, 2192129]), new Uint32Array([2230946, 2231010, 2231074, 2231138, 2231202, 2231266, 2231330, 2231394, 2231458, 2231522, 2231586, 2231650, 2231714, 2231778, 2231842, 2231906]), new Uint32Array([14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064, 14680064]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 2185953, 2185985, 2186017, 2186049, 2186081, 2186113, 2186145, 2186177]), new Uint32Array([2139811, 2139907, 2097284, 2105860, 2105988, 2106116, 2106244, 2097444, 2097604, 2097155, 10485778, 10486344, 2106372, 6291456, 0, 0]), new Uint32Array([2110051, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([0, 0, 0, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2172385, 6291456, 2172417, 6291456, 2172449, 6291456, 2172481, 6291456, 2172513, 6291456, 2172545, 6291456, 2172577, 6291456, 2172609, 6291456]), new Uint32Array([0, 0, 23068672, 23068672, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2249345, 2249377, 2249409, 2249441, 2249473, 2249505, 2249537, 2249570, 2210209, 2249633, 2249665, 2249697, 2249729, 2249761, 2249793, 2216769]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2187169, 2187201, 2187233, 2187265, 2187297, 2187329, 2187361, 2187393, 2187425, 2187457, 2187489, 2187521, 2187553, 2187585, 2187617, 2187649]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([0, 0, 0, 6291456, 6291456, 0, 0, 0, 6291456, 6291456, 6291456, 0, 0, 0, 6291456, 6291456]), new Uint32Array([2182337, 6291456, 2182369, 6291456, 2182401, 6291456, 2182433, 6291456, 2182465, 6291456, 2182497, 6291456, 2182529, 6291456, 2182561, 6291456]), new Uint32Array([2138179, 2138275, 2138371, 2138467, 2134243, 2134435, 2138563, 2138659, 2138755, 2138851, 2138947, 2139043, 2138947, 2138755, 2139139, 2139235]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([0, 0, 23068672, 23068672, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2250498, 2250562, 2250625, 2250657, 2208321, 2250689, 2250721, 2250753, 2250785, 2250817, 2250849, 2218945, 2250881, 2250913, 2250945, 0]), new Uint32Array([2170369, 2105569, 2098305, 2108481, 2173249, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456]), new Uint32Array([2100897, 2111905, 2105473, 2105569, 2105601, 0, 2108193, 0, 0, 0, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481]), new Uint32Array([2100897, 2100897, 2105569, 2105569, 6291456, 2112289, 2149826, 6291456, 6291456, 2112481, 2112577, 2098177, 2098177, 2098177, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 2169953, 2169985, 6291456, 2170017, 6291456, 2170049, 2170081, 6291456, 2170113, 2170145, 2170177, 6291456, 6291456, 2170209, 2170241]), new Uint32Array([6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([0, 0, 0, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2220641, 2220641, 2220673, 2220673, 2220673, 2220673, 2220705, 2220705, 2220705, 2220705, 2220737, 2220737, 2220737, 2220737, 2220769, 2220769]), new Uint32Array([2127650, 2127746, 2127842, 2127938, 2128034, 2128130, 2128226, 2128322, 2128418, 2127523, 2127619, 2127715, 2127811, 2127907, 2128003, 2128099]), new Uint32Array([2143969, 2173793, 2173825, 2153473, 2173857, 2173889, 2173921, 2173953, 2173985, 2173761, 2174017, 2174049, 2174081, 2174113, 2174145, 2174177]), new Uint32Array([0, 0, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([2204705, 2204737, 2204769, 2204801, 2204833, 2204865, 2204897, 2204929, 2204961, 2204993, 2205025, 2205057, 2205089, 2205121, 2205153, 2205185]), new Uint32Array([2176385, 6291456, 2176417, 6291456, 2176449, 6291456, 2176481, 6291456, 2176513, 6291456, 2176545, 6291456, 2176577, 6291456, 2176609, 6291456]), new Uint32Array([2195521, 2195553, 2195585, 2195617, 2195649, 2195681, 2117857, 2195713, 2195745, 2195777, 2195809, 2195841, 2195873, 2195905, 2195937, 2195969]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456]), new Uint32Array([2173921, 2173953, 2173985, 2174017, 2174017, 2174049, 2174081, 2174113, 2174145, 2174177, 2149057, 2233089, 2173697, 2173761, 2173793, 2174113]), new Uint32Array([2131586, 2132450, 2135970, 2135778, 2161602, 2136162, 2163650, 2161794, 2135586, 2163714, 2137186, 2131810, 2160290, 2135170, 2097506, 2159554]), new Uint32Array([2134145, 2097153, 2134241, 2105953, 2132705, 2130977, 2160065, 2131297, 2162049, 2133089, 2160577, 2133857, 0, 0, 0, 0]), new Uint32Array([2116513, 2116609, 2116705, 2116801, 2116897, 2116993, 2117089, 2117185, 2117281, 2117377, 2117473, 2117569, 2117665, 2117761, 2117857, 2117953]), new Uint32Array([2100737, 2098337, 2101441, 2101569, 2101697, 2101825, 2101953, 2102081, 2102209, 2100802, 2101154, 2101282, 2101410, 2101538, 2101666, 2101794]), new Uint32Array([2100289, 2098657, 2098049, 2200737, 2123489, 2123681, 2200769, 2098625, 2100321, 2098145, 2100449, 2098017, 2098753, 2098977, 2150241, 2150305]), new Uint32Array([6291456, 6291456, 6291456, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 2109955, 6291456, 6291456, 0, 0, 0, 0]), new Uint32Array([18874368, 18874368, 18874368, 18874368, 18874368, 18874368, 18874368, 18874368, 18874368, 18874368, 18874368, 18874368, 18874368, 18874368, 18874368, 18874368]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 6291456, 0, 6291456, 0, 0]), new Uint32Array([2130979, 2131075, 2131075, 2131171, 2131267, 2131363, 2131459, 2131555, 2131651, 2131651, 2131747, 2131843, 2131939, 2132035, 2132131, 2132227]), new Uint32Array([0, 2177793, 6291456, 2177825, 6291456, 2177857, 6291456, 2177889, 6291456, 2177921, 6291456, 2177953, 6291456, 2177985, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672]), new Uint32Array([6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2113345, 0, 2098209, 2111137, 2105505, 2098241, 2108353, 2108417, 2105825, 2111713, 2100897, 2111905, 2105473, 2105569, 2105601, 2112289]), new Uint32Array([2136643, 2136739, 2136835, 2136931, 2137027, 2137123, 2137219, 2137315, 2137411, 2137507, 2137603, 2137699, 2137795, 2137891, 2137987, 2138083]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0]), new Uint32Array([2174433, 6291456, 2174465, 6291456, 2174497, 6291456, 2174529, 6291456, 2174561, 6291456, 2174593, 6291456, 2174625, 6291456, 2174657, 6291456]), new Uint32Array([0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2105473, 2105569, 2105601, 2112289, 2108193, 2112481, 2112577, 2098177, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441]), new Uint32Array([10496547, 10496643, 2105505, 2149698, 6291456, 10496739, 10496835, 2170273, 6291456, 2149762, 2105825, 2111713, 2111713, 2111713, 2111713, 2168673]), new Uint32Array([6291456, 2143490, 2143490, 2143490, 2171649, 6291456, 2171681, 2171713, 2171745, 6291456, 2171777, 6291456, 2171809, 6291456, 2171841, 6291456]), new Uint32Array([2159106, 2159106, 2159170, 2159170, 2159234, 2159234, 2159298, 2159298, 2159298, 2159362, 2159362, 2159362, 2106401, 2106401, 2106401, 2106401]), new Uint32Array([2105601, 2112289, 2108193, 2112481, 2112577, 2098177, 2098305, 2108321, 2108289, 2100865, 2113153, 2108481, 2113345, 2113441, 2098209, 2111137]), new Uint32Array([2108417, 2181217, 2181249, 2181281, 2170433, 2170401, 2181313, 2181345, 2181377, 2181409, 2181441, 2181473, 2181505, 2181537, 2170529, 2181569]), new Uint32Array([2218433, 2245761, 2245793, 2245825, 2245857, 2245890, 2245953, 2245986, 2209665, 2246050, 2246113, 2246146, 2246210, 2246274, 2246337, 2246369]), new Uint32Array([2230754, 2230818, 2230882, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([6291456, 0, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 0, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2184129, 6291456, 2184161, 6291456, 2184193, 6291456, 6291456, 6291456, 6291456, 6291456, 2146818, 2183361, 6291456, 6291456, 2142978, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2135170, 2097506, 2130691, 2130787, 2130883, 2163970, 2164034, 2164098, 2164162, 2164226, 2164290, 2164354, 2164418, 2164482, 2164546, 2133122]), new Uint32Array([2108515, 2108611, 2100740, 2108707, 2108803, 2108899, 2108995, 2109091, 2109187, 2109283, 2109379, 2109475, 2109571, 2109667, 2109763, 2100738]), new Uint32Array([2102788, 2102916, 2103044, 2120515, 2103172, 2120611, 2120707, 2098373, 2103300, 2120803, 2120899, 2120995, 2103428, 2103556, 2121091, 2121187]), new Uint32Array([2158082, 2158146, 0, 2158210, 2158274, 0, 2158338, 2158402, 2158466, 2129922, 2158530, 2158594, 2158658, 2158722, 2158786, 2158850]), new Uint32Array([10499619, 10499715, 10499811, 10499907, 10500003, 10500099, 10500195, 10500291, 10500387, 10500483, 10500579, 10500675, 10500771, 10500867, 10500963, 10501059]), new Uint32Array([2239585, 2239618, 2239681, 2239713, 0, 2191969, 2239745, 2239777, 2192033, 2239809, 2239841, 2239874, 2239937, 2239970, 2240033, 2240065]), new Uint32Array([2252705, 2252738, 2252801, 2252833, 2252865, 2252897, 2252930, 2252994, 2253057, 2253089, 2253121, 2253154, 2253217, 2253250, 2219361, 2219361]), new Uint32Array([2105825, 2111713, 2100897, 2111905, 2105473, 2105569, 2105601, 2112289, 2108193, 2112481, 2112577, 2098177, 2098305, 2108321, 2108289, 2100865]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 10538050, 10538114, 10538178, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([2226402, 2226466, 2226530, 2226594, 2226658, 2226722, 2226786, 2226850, 2226914, 2226978, 2227042, 2227106, 2227170, 2227234, 2227298, 2227362]), new Uint32Array([23068672, 6291456, 6291456, 6291456, 6291456, 2144066, 2144130, 2144194, 2144258, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 23068672, 23068672, 6291456, 23068672, 23068672]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2124674, 2124770, 2123875, 2123971, 2124067, 2124163, 2124259, 2124355, 2124451, 2124547, 2124643, 2124739, 2124835, 2124931, 2125027, 2125123]), new Uint32Array([2168065, 6291456, 2168097, 6291456, 2168129, 6291456, 2168161, 6291456, 2168193, 6291456, 2168225, 6291456, 2168257, 6291456, 2168289, 6291456]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0]), new Uint32Array([23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 2100610, 2100611, 6291456, 2107842, 2107843, 6291456, 6291456, 6291456, 6291456, 10537922, 6291456, 10537986, 6291456]), new Uint32Array([2174849, 2174881, 2174913, 2174945, 2174977, 2175009, 2175041, 2175073, 2175105, 2175137, 2175169, 2175201, 2175233, 2175265, 2175297, 2175329]), new Uint32Array([2154562, 2154626, 2154690, 2154754, 2141858, 2154818, 2154882, 2127298, 2154946, 2127298, 2155010, 2155074, 2155138, 2155202, 2155266, 2155202]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 23068672, 0]), new Uint32Array([2200641, 2150786, 2150850, 2150914, 2150978, 2151042, 2106562, 2151106, 2150562, 2151170, 2151234, 2151298, 2151362, 2151426, 2151490, 2151554]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 0, 0, 0, 0, 0, 0, 0, 0, 6291456, 6291456]), new Uint32Array([2220289, 2220289, 2220321, 2220321, 2220321, 2220321, 2220353, 2220353, 2220353, 2220353, 2220385, 2220385, 2220385, 2220385, 2220417, 2220417]), new Uint32Array([2155330, 2155394, 0, 2155458, 2155522, 2155586, 2105732, 0, 2155650, 2155714, 2155778, 2125314, 2155842, 2155906, 2126274, 2155970]), new Uint32Array([23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456, 23068672, 23068672, 6291456, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0]), new Uint32Array([2097729, 2106017, 2106017, 2106017, 2106017, 2131297, 2131297, 2131297, 2131297, 2106081, 2106081, 2162049, 2162049, 2105953, 2105953, 2162337]), new Uint32Array([2097185, 2097697, 2097697, 2097697, 2097697, 2135777, 2135777, 2135777, 2135777, 2097377, 2097377, 2097377, 2097377, 2097601, 2097601, 2097217]), new Uint32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23068672]), new Uint32Array([2139331, 2139427, 2139523, 2139043, 2133571, 2132611, 2139619, 2139715, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2174113, 2174145, 2100897, 2098177, 2108289, 2100865, 2173601, 2173633, 2173985, 2174113, 2174145, 6291456, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([6291456, 6291456, 23068672, 6291456, 6291456, 6291456, 23068672, 6291456, 6291456, 6291456, 6291456, 23068672, 6291456, 6291456, 6291456, 6291456]), new Uint32Array([23068672, 23068672, 18923778, 23068672, 23068672, 23068672, 23068672, 18923842, 23068672, 23068672, 23068672, 23068672, 18923906, 23068672, 23068672, 23068672]), new Uint32Array([2134145, 2097153, 2134241, 0, 2132705, 2130977, 2160065, 2131297, 0, 2133089, 0, 2133857, 0, 0, 0, 0]), new Uint32Array([6291456, 6291456, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2177537, 6291456, 2177569, 6291456, 2177601, 6291456, 2177633, 6291456, 2177665, 6291456, 2177697, 6291456, 2177729, 6291456, 2177761, 6291456]), new Uint32Array([2212481, 2212513, 2212545, 2212577, 2197121, 2212609, 2212641, 2212673, 2212705, 2212737, 2212769, 2212801, 2212833, 2212865, 2212897, 2212929]), new Uint32Array([6291456, 6291456, 23068672, 23068672, 23068672, 6291456, 6291456, 0, 0, 0, 0, 0, 0, 0, 0, 0]), new Uint32Array([2098241, 2108353, 2170209, 2105825, 2111713, 2100897, 2111905, 2105473, 2105569, 2105601, 2112289, 6291456, 2108193, 2172417, 2112481, 2098177]), new Uint32Array([6291456, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 23068672, 6291456, 6291456])], t4 = new Uint16Array([616, 616, 565, 147, 161, 411, 330, 2, 131, 131, 328, 454, 241, 408, 86, 86, 696, 113, 285, 350, 325, 301, 473, 214, 639, 232, 447, 64, 369, 598, 124, 672, 567, 223, 621, 154, 107, 86, 86, 86, 86, 86, 86, 505, 86, 68, 634, 86, 218, 218, 218, 218, 486, 218, 218, 513, 188, 608, 216, 86, 217, 463, 668, 85, 700, 360, 184, 86, 86, 86, 647, 402, 153, 10, 346, 718, 662, 260, 145, 298, 117, 1, 443, 342, 138, 54, 563, 86, 240, 572, 218, 70, 387, 86, 118, 460, 641, 602, 86, 86, 306, 218, 86, 692, 86, 86, 86, 86, 86, 162, 707, 86, 458, 26, 86, 218, 638, 86, 86, 86, 86, 86, 65, 449, 86, 86, 306, 183, 86, 58, 391, 667, 86, 157, 131, 131, 131, 131, 86, 433, 131, 406, 31, 218, 247, 86, 86, 693, 218, 581, 351, 86, 438, 295, 69, 462, 45, 126, 173, 650, 14, 295, 69, 97, 168, 187, 641, 78, 523, 390, 69, 108, 287, 664, 173, 219, 83, 295, 69, 108, 431, 426, 173, 694, 412, 115, 628, 52, 257, 398, 641, 118, 501, 121, 69, 579, 151, 423, 173, 620, 464, 121, 69, 382, 151, 476, 173, 27, 53, 121, 86, 594, 578, 226, 173, 86, 632, 130, 86, 96, 228, 268, 641, 622, 563, 86, 86, 21, 148, 650, 131, 131, 321, 43, 144, 343, 381, 531, 131, 131, 178, 20, 86, 399, 156, 375, 164, 541, 30, 60, 715, 198, 92, 118, 131, 131, 86, 86, 306, 407, 86, 280, 457, 196, 488, 358, 131, 131, 244, 86, 86, 143, 86, 86, 86, 86, 86, 667, 563, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 336, 363, 86, 86, 336, 86, 86, 380, 678, 67, 86, 86, 86, 678, 86, 86, 86, 512, 86, 307, 86, 708, 86, 86, 86, 86, 86, 528, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 563, 307, 86, 86, 86, 86, 86, 104, 450, 337, 86, 720, 86, 32, 450, 397, 86, 86, 86, 587, 218, 558, 708, 708, 293, 708, 86, 86, 86, 86, 86, 694, 205, 86, 8, 86, 86, 86, 86, 549, 86, 667, 697, 697, 679, 86, 458, 460, 86, 86, 650, 86, 708, 543, 86, 86, 86, 245, 86, 86, 86, 140, 218, 127, 708, 708, 458, 197, 131, 131, 131, 131, 500, 86, 86, 483, 251, 86, 306, 510, 515, 86, 722, 86, 86, 86, 65, 201, 86, 86, 483, 580, 470, 86, 86, 86, 368, 131, 131, 131, 694, 114, 110, 555, 86, 86, 123, 721, 163, 142, 713, 418, 86, 317, 675, 209, 218, 218, 218, 371, 545, 592, 629, 490, 603, 199, 46, 320, 525, 680, 310, 279, 388, 111, 42, 252, 593, 607, 235, 617, 410, 377, 50, 548, 135, 356, 17, 520, 189, 116, 392, 600, 349, 332, 482, 699, 690, 535, 119, 106, 451, 71, 152, 667, 131, 218, 218, 265, 671, 637, 492, 504, 533, 683, 269, 269, 658, 86, 86, 86, 86, 86, 86, 86, 86, 86, 491, 619, 86, 86, 6, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 229, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 667, 86, 86, 171, 131, 118, 131, 656, 206, 234, 571, 89, 334, 670, 246, 311, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 534, 86, 86, 86, 86, 86, 86, 82, 86, 86, 86, 86, 86, 430, 86, 86, 86, 86, 86, 86, 86, 86, 86, 599, 86, 324, 86, 470, 69, 640, 264, 131, 626, 101, 174, 86, 86, 667, 233, 105, 73, 374, 394, 221, 204, 84, 28, 326, 86, 86, 471, 86, 86, 86, 109, 573, 86, 171, 200, 200, 200, 200, 218, 218, 86, 86, 86, 86, 460, 131, 131, 131, 86, 506, 86, 86, 86, 86, 86, 220, 404, 34, 614, 47, 442, 305, 25, 612, 338, 601, 648, 7, 344, 255, 131, 131, 51, 86, 312, 507, 563, 86, 86, 86, 86, 588, 86, 86, 86, 86, 86, 530, 511, 86, 458, 3, 435, 384, 556, 522, 230, 527, 86, 118, 86, 86, 717, 86, 137, 273, 79, 181, 484, 23, 93, 112, 655, 249, 417, 703, 370, 87, 98, 313, 684, 585, 155, 465, 596, 481, 695, 18, 416, 428, 61, 701, 706, 282, 643, 495, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 549, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 549, 131, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 307, 86, 86, 86, 171, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 650, 131, 422, 542, 420, 263, 24, 172, 86, 86, 86, 86, 86, 566, 86, 86, 132, 540, 395, 353, 494, 519, 19, 485, 284, 472, 131, 131, 131, 16, 714, 86, 211, 708, 86, 86, 86, 694, 698, 86, 86, 483, 704, 708, 218, 272, 86, 86, 120, 86, 159, 478, 86, 307, 247, 86, 86, 663, 597, 459, 627, 667, 86, 86, 277, 455, 39, 302, 86, 250, 86, 86, 86, 271, 99, 452, 306, 281, 329, 400, 200, 86, 86, 362, 549, 352, 646, 461, 323, 586, 86, 86, 4, 708, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 717, 86, 518, 86, 86, 650, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 125, 554, 480, 300, 613, 72, 333, 288, 561, 544, 604, 48, 719, 91, 169, 176, 590, 224, 76, 191, 29, 559, 560, 231, 537, 166, 477, 538, 256, 437, 131, 131, 469, 167, 40, 0, 685, 266, 441, 705, 239, 642, 475, 568, 640, 610, 299, 673, 517, 318, 385, 22, 202, 180, 179, 359, 424, 215, 90, 66, 521, 653, 467, 682, 453, 409, 479, 88, 131, 661, 35, 303, 15, 262, 666, 630, 712, 131, 131, 618, 659, 175, 218, 195, 347, 193, 227, 261, 150, 165, 709, 546, 294, 569, 710, 270, 413, 376, 524, 55, 242, 38, 419, 529, 170, 657, 3, 304, 122, 379, 278, 131, 651, 86, 67, 576, 458, 458, 131, 131, 86, 86, 86, 86, 86, 86, 86, 118, 309, 86, 86, 547, 86, 86, 86, 86, 667, 650, 664, 131, 131, 86, 86, 56, 131, 131, 131, 131, 131, 131, 131, 131, 86, 307, 86, 86, 86, 664, 238, 650, 86, 86, 717, 86, 118, 86, 86, 315, 86, 59, 86, 86, 574, 549, 131, 131, 340, 57, 436, 86, 86, 86, 86, 86, 86, 458, 708, 499, 691, 62, 86, 650, 86, 86, 694, 86, 86, 86, 319, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 171, 86, 549, 694, 131, 131, 131, 131, 131, 131, 131, 131, 131, 77, 86, 86, 139, 86, 502, 86, 86, 86, 667, 595, 131, 131, 131, 86, 12, 86, 13, 86, 609, 131, 131, 131, 131, 86, 86, 86, 625, 86, 669, 86, 86, 182, 129, 86, 5, 694, 104, 86, 86, 86, 86, 131, 131, 86, 86, 386, 171, 86, 86, 86, 345, 86, 324, 86, 589, 86, 213, 36, 131, 131, 131, 131, 131, 86, 86, 86, 86, 104, 131, 131, 131, 141, 290, 80, 677, 86, 86, 86, 267, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 667, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 515, 86, 86, 33, 136, 669, 86, 711, 515, 86, 86, 550, 640, 86, 104, 708, 515, 86, 159, 372, 717, 86, 86, 444, 515, 86, 86, 663, 37, 86, 563, 460, 86, 390, 624, 702, 131, 131, 131, 131, 389, 59, 708, 86, 86, 341, 208, 708, 635, 295, 69, 108, 431, 508, 100, 190, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 649, 516, 660, 131, 131, 86, 86, 86, 218, 631, 708, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 341, 575, 238, 514, 131, 131, 86, 86, 86, 218, 291, 708, 307, 131, 86, 86, 306, 367, 708, 131, 131, 131, 86, 378, 697, 86, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 615, 253, 86, 86, 86, 292, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 104, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 69, 86, 341, 553, 549, 86, 307, 86, 86, 645, 275, 455, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 708, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 86, 86, 667, 460, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 717, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 667, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 171, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 104, 86, 667, 459, 131, 131, 131, 131, 131, 131, 86, 458, 225, 86, 86, 86, 516, 549, 11, 390, 405, 86, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 460, 44, 218, 197, 711, 515, 131, 131, 131, 131, 664, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 307, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 308, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 640, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 86, 86, 118, 307, 104, 286, 591, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 549, 86, 86, 681, 86, 86, 75, 185, 314, 582, 86, 358, 496, 474, 86, 104, 131, 86, 86, 86, 86, 146, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 86, 171, 86, 640, 131, 131, 131, 131, 131, 131, 131, 131, 246, 503, 689, 339, 674, 81, 258, 415, 439, 128, 562, 366, 414, 246, 503, 689, 583, 222, 557, 316, 636, 665, 186, 355, 95, 670, 246, 503, 689, 339, 674, 557, 258, 415, 439, 186, 355, 95, 670, 246, 503, 689, 446, 644, 536, 652, 331, 532, 335, 440, 274, 421, 297, 570, 74, 425, 364, 425, 606, 552, 403, 509, 134, 365, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 218, 218, 218, 498, 218, 218, 577, 627, 551, 497, 572, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 553, 354, 236, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 296, 455, 131, 131, 456, 243, 103, 86, 41, 459, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 9, 276, 158, 716, 393, 564, 383, 489, 401, 654, 210, 654, 131, 131, 131, 640, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 650, 86, 86, 86, 86, 86, 86, 717, 667, 563, 563, 563, 86, 549, 102, 686, 133, 246, 605, 86, 448, 86, 86, 207, 307, 131, 131, 131, 641, 86, 177, 611, 445, 373, 194, 584, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 308, 307, 171, 86, 86, 86, 86, 86, 86, 86, 717, 86, 86, 86, 86, 86, 460, 131, 131, 650, 86, 86, 86, 694, 708, 86, 86, 694, 86, 458, 131, 131, 131, 131, 131, 131, 667, 694, 289, 650, 667, 131, 131, 86, 640, 131, 131, 664, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 171, 131, 131, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 460, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 458, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 640, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 466, 203, 149, 429, 94, 432, 160, 687, 539, 63, 237, 283, 192, 248, 348, 259, 427, 526, 396, 676, 254, 468, 487, 212, 327, 623, 49, 633, 322, 493, 434, 688, 357, 361, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131]), { mapStr: "صلى الله عليه وسلمجل جلالهキロメートルrad∕s2エスクードキログラムキロワットグラムトンクルゼイロサンチームパーセントピアストルファラッドブッシェルヘクタールマンションミリバールレントゲン′′′′1⁄10viii(10)(11)(12)(13)(14)(15)(16)(17)(18)(19)(20)∫∫∫∫(오전)(오후)アパートアルファアンペアイニングエーカーカラットカロリーキュリーギルダークローネサイクルシリングバーレルフィートポイントマイクロミクロンメガトンリットルルーブル株式会社kcalm∕s2c∕kgاكبرمحمدصلعمرسولریال1⁄41⁄23⁄4 ̈́ྲཱྀླཱྀ ̈͂ ̓̀ ̓́ ̓͂ ̔̀ ̔́ ̔͂ ̈̀‵‵‵a/ca/sc/oc/utelfax1⁄71⁄91⁄32⁄31⁄52⁄53⁄54⁄51⁄65⁄61⁄83⁄85⁄87⁄8xii0⁄3∮∮∮(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)::====(ᄀ)(ᄂ)(ᄃ)(ᄅ)(ᄆ)(ᄇ)(ᄉ)(ᄋ)(ᄌ)(ᄎ)(ᄏ)(ᄐ)(ᄑ)(ᄒ)(가)(나)(다)(라)(마)(바)(사)(아)(자)(차)(카)(타)(파)(하)(주)(一)(二)(三)(四)(五)(六)(七)(八)(九)(十)(月)(火)(水)(木)(金)(土)(日)(株)(有)(社)(名)(特)(財)(祝)(労)(代)(呼)(学)(監)(企)(資)(協)(祭)(休)(自)(至)pte10月11月12月ergltdアールインチウォンオンスオームカイリガロンガンマギニーケースコルナコーポセンチダースノットハイツパーツピクルフランペニヒヘルツペンスページベータボルトポンドホールホーンマイルマッハマルクヤードヤールユアンルピー10点11点12点13点14点15点16点17点18点19点20点21点22点23点24点hpabardm2dm3khzmhzghzthzmm2cm2km2mm3cm3km3kpampagpalogmilmolppmv∕ma∕m10日11日12日13日14日15日16日17日18日19日20日21日22日23日24日25日26日27日28日29日30日31日galffifflשּׁשּׂ ٌّ ٍّ َّ ُّ ِّ ّٰـَّـُّـِّتجمتحجتحمتخمتمجتمحتمخجمححميحمىسحجسجحسجىسمحسمجسممصححصممشحمشجيشمخشممضحىضخمطمحطممطميعجمعممعمىغممغميغمىفخمقمحقمملحملحيلحىلججلخملمحمحجمحيمجحمجممخممجخهمجهممنحمنحىنجمنجىنمينمىيممبخيتجيتجىتخيتخىتميتمىجميجحىجمىسخىصحيشحيضحيلجيلمييحييجييميمميقمينحيعميكمينجحمخيلجمكممجحيحجيمجيفميبحيسخينجيصلےقلے𝅘𝅥𝅮𝅘𝅥𝅯𝅘𝅥𝅰𝅘𝅥𝅱𝅘𝅥𝅲𝆹𝅥𝅮𝆺𝅥𝅮𝆹𝅥𝅯𝆺𝅥𝅯〔s〕ppv〔本〕〔三〕〔二〕〔安〕〔点〕〔打〕〔盗〕〔勝〕〔敗〕 ̄ ́ ̧ssi̇ijl·ʼndžljnjdz ̆ ̇ ̊ ̨ ̃ ̋ ιեւاٴوٴۇٴيٴक़ख़ग़ज़ड़ढ़फ़य़ড়ঢ়য়ਲ਼ਸ਼ਖ਼ਗ਼ਜ਼ਫ਼ଡ଼ଢ଼ําໍາຫນຫມགྷཌྷདྷབྷཛྷཀྵཱཱིུྲྀླྀྒྷྜྷྡྷྦྷྫྷྐྵaʾἀιἁιἂιἃιἄιἅιἆιἇιἠιἡιἢιἣιἤιἥιἦιἧιὠιὡιὢιὣιὤιὥιὦιὧιὰιαιάιᾶι ͂ὴιηιήιῆιὼιωιώιῶι ̳!! ̅???!!?rs°c°fnosmtmivix⫝̸ ゙ ゚よりコト333435참고주의363738394042444546474849503月4月5月6月7月8月9月hgevギガデシドルナノピコビルペソホンリラレムdaauovpciu平成昭和大正明治naμakakbmbgbpfnfμfμgmgμlmldlklfmnmμmpsnsμsmsnvμvkvpwnwμwmwkwkωmωbqcccddbgyhainkkktlnlxphprsrsvwbstմնմեմիվնմխיִײַשׁשׂאַאָאּבּגּדּהּוּזּטּיּךּכּלּמּנּסּףּפּצּקּרּתּוֹבֿכֿפֿאלئائەئوئۇئۆئۈئېئىئجئحئمئيبجبمبىبيتىتيثجثمثىثيخحضجضمطحظمغجفجفحفىفيقحقىقيكاكجكحكخكلكىكينخنىنيهجهىهييىذٰرٰىٰئرئزئنبزبنترتزتنثرثزثنمانرنزننيريزئخئهبهتهصخنههٰثهسهشهطىطيعىعيغىغيسىسيشىشيصىصيضىضيشخشرسرصرضراً ًـًـّ ْـْلآلألإ𝅗𝅥0,1,2,3,4,5,6,7,8,9,wzhvsdwcmcmddjほかココàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįĵķĺļľłńņňŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷÿźżɓƃƅɔƈɖɗƌǝəɛƒɠɣɩɨƙɯɲɵơƣƥʀƨʃƭʈưʊʋƴƶʒƹƽǎǐǒǔǖǘǚǜǟǡǣǥǧǩǫǭǯǵƕƿǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟƞȣȥȧȩȫȭȯȱȳⱥȼƚⱦɂƀʉʌɇɉɋɍɏɦɹɻʁʕͱͳʹͷ;ϳέίόύβγδεζθκλνξοπρστυφχψϊϋϗϙϛϝϟϡϣϥϧϩϫϭϯϸϻͻͼͽѐёђѓєѕіїјљњћќѝўџабвгдежзийклмнопрстуфхцчшщъыьэюяѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣԥԧԩԫԭԯաբգդզէըթժլծկհձղճյշոչպջռստրցփքօֆ་ⴧⴭნᏰᏱᏲᏳᏴᏵꙋɐɑᴂɜᴖᴗᴝᴥɒɕɟɡɥɪᵻʝɭᶅʟɱɰɳɴɸʂƫᴜʐʑḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿἐἑἒἓἔἕἰἱἲἳἴἵἶἷὀὁὂὃὄὅὑὓὕὗᾰᾱὲΐῐῑὶΰῠῡὺῥ`ὸ‐+−∑〈〉ⰰⰱⰲⰳⰴⰵⰶⰷⰸⰹⰺⰻⰼⰽⰾⰿⱀⱁⱂⱃⱄⱅⱆⱇⱈⱉⱊⱋⱌⱍⱎⱏⱐⱑⱒⱓⱔⱕⱖⱗⱘⱙⱚⱛⱜⱝⱞⱡɫᵽɽⱨⱪⱬⱳⱶȿɀⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣⳬⳮⳳⵡ母龟丨丶丿乙亅亠人儿入冂冖冫几凵刀力勹匕匚匸卜卩厂厶又口囗士夂夊夕女子宀寸小尢尸屮山巛工己巾干幺广廴廾弋弓彐彡彳心戈戶手支攴文斗斤方无曰欠止歹殳毋比毛氏气爪父爻爿片牙牛犬玄玉瓜瓦甘生用田疋疒癶白皮皿目矛矢石示禸禾穴立竹米糸缶网羊羽老而耒耳聿肉臣臼舌舛舟艮色艸虍虫血行衣襾見角言谷豆豕豸貝赤走足身車辛辰辵邑酉釆里長門阜隶隹雨靑非面革韋韭音頁風飛食首香馬骨高髟鬥鬯鬲鬼魚鳥鹵鹿麥麻黃黍黑黹黽鼎鼓鼠鼻齊齒龍龜龠.〒卄卅ᄁᆪᆬᆭᄄᆰᆱᆲᆳᆴᆵᄚᄈᄡᄊ짜ᅢᅣᅤᅥᅦᅧᅨᅩᅪᅫᅬᅭᅮᅯᅰᅱᅲᅳᅴᅵᄔᄕᇇᇈᇌᇎᇓᇗᇙᄜᇝᇟᄝᄞᄠᄢᄣᄧᄩᄫᄬᄭᄮᄯᄲᄶᅀᅇᅌᇱᇲᅗᅘᅙᆄᆅᆈᆑᆒᆔᆞᆡ上中下甲丙丁天地問幼箏우秘男適優印注項写左右医宗夜テヌモヨヰヱヲꙁꙃꙅꙇꙉꙍꙏꙑꙓꙕꙗꙙꙛꙝꙟꙡꙣꙥꙧꙩꙫꙭꚁꚃꚅꚇꚉꚋꚍꚏꚑꚓꚕꚗꚙꚛꜣꜥꜧꜩꜫꜭꜯꜳꜵꜷꜹꜻꜽꜿꝁꝃꝅꝇꝉꝋꝍꝏꝑꝓꝕꝗꝙꝛꝝꝟꝡꝣꝥꝧꝩꝫꝭꝯꝺꝼᵹꝿꞁꞃꞅꞇꞌꞑꞓꞗꞙꞛꞝꞟꞡꞣꞥꞧꞩɬʞʇꭓꞵꞷꬷꭒᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩᎪᎫᎬᎭᎮᎯᎰᎱᎲᎳᎴᎵᎶᎷᎸᎹᎺᎻᎼᎽᎾᎿᏀᏁᏂᏃᏄᏅᏆᏇᏈᏉᏊᏋᏌᏍᏎᏏᏐᏑᏒᏓᏔᏕᏖᏗᏘᏙᏚᏛᏜᏝᏞᏟᏠᏡᏢᏣᏤᏥᏦᏧᏨᏩᏪᏫᏬᏭᏮᏯ豈更賈滑串句契喇奈懶癩羅蘿螺裸邏樂洛烙珞落酪駱亂卵欄爛蘭鸞嵐濫藍襤拉臘蠟廊朗浪狼郎來冷勞擄櫓爐盧蘆虜路露魯鷺碌祿綠菉錄論壟弄籠聾牢磊賂雷壘屢樓淚漏累縷陋勒肋凜凌稜綾菱陵讀拏諾丹寧怒率異北磻便復不泌數索參塞省葉說殺沈拾若掠略亮兩凉梁糧良諒量勵呂廬旅濾礪閭驪麗黎曆歷轢年憐戀撚漣煉璉秊練聯輦蓮連鍊列劣咽烈裂廉念捻殮簾獵令囹嶺怜玲瑩羚聆鈴零靈領例禮醴隸惡了僚寮尿料燎療蓼遼暈阮劉杻柳流溜琉留硫紐類戮陸倫崙淪輪律慄栗隆利吏履易李梨泥理痢罹裏裡離匿溺吝燐璘藺隣鱗麟林淋臨笠粒狀炙識什茶刺切度拓糖宅洞暴輻降廓兀嗀塚晴凞猪益礼神祥福靖精蘒諸逸都飯飼館鶴郞隷侮僧免勉勤卑喝嘆器塀墨層悔慨憎懲敏既暑梅海渚漢煮爫琢碑祉祈祐祖禍禎穀突節縉繁署者臭艹著褐視謁謹賓贈辶難響頻恵𤋮舘並况全侀充冀勇勺啕喙嗢墳奄奔婢嬨廒廙彩徭惘慎愈慠戴揄搜摒敖望杖滛滋瀞瞧爵犯瑱甆画瘝瘟盛直睊着磌窱类絛缾荒華蝹襁覆調請諭變輸遲醙鉶陼韛頋鬒𢡊𢡄𣏕㮝䀘䀹𥉉𥳐𧻓齃龎עםٱٻپڀٺٿٹڤڦڄڃچڇڍڌڎڈژڑکگڳڱںڻۀہھۓڭۋۅۉ、〖〗—–_{}【】《》「」『』[]#&*-<>\\$%@ءؤة\"'^|~⦅⦆・ゥャ¢£¬¦¥₩│←↑→↓■○𐐨𐐩𐐪𐐫𐐬𐐭𐐮𐐯𐐰𐐱𐐲𐐳𐐴𐐵𐐶𐐷𐐸𐐹𐐺𐐻𐐼𐐽𐐾𐐿𐑀𐑁𐑂𐑃𐑄𐑅𐑆𐑇𐑈𐑉𐑊𐑋𐑌𐑍𐑎𐑏𐓘𐓙𐓚𐓛𐓜𐓝𐓞𐓟𐓠𐓡𐓢𐓣𐓤𐓥𐓦𐓧𐓨𐓩𐓪𐓫𐓬𐓭𐓮𐓯𐓰𐓱𐓲𐓳𐓴𐓵𐓶𐓷𐓸𐓹𐓺𐓻𐳀𐳁𐳂𐳃𐳄𐳅𐳆𐳇𐳈𐳉𐳊𐳋𐳌𐳍𐳎𐳏𐳐𐳑𐳒𐳓𐳔𐳕𐳖𐳗𐳘𐳙𐳚𐳛𐳜𐳝𐳞𐳟𐳠𐳡𐳢𐳣𐳤𐳥𐳦𐳧𐳨𐳩𐳪𐳫𐳬𐳭𐳮𐳯𐳰𐳱𐳲𑣀𑣁𑣂𑣃𑣄𑣅𑣆𑣇𑣈𑣉𑣊𑣋𑣌𑣍𑣎𑣏𑣐𑣑𑣒𑣓𑣔𑣕𑣖𑣗𑣘𑣙𑣚𑣛𑣜𑣝𑣞𑣟ıȷ∇∂𞤢𞤣𞤤𞤥𞤦𞤧𞤨𞤩𞤪𞤫𞤬𞤭𞤮𞤯𞤰𞤱𞤲𞤳𞤴𞤵𞤶𞤷𞤸𞤹𞤺𞤻𞤼𞤽𞤾𞤿𞥀𞥁𞥂𞥃ٮڡٯ字双多解交映無前後再新初終販声吹演投捕遊指禁空合満申割営配得可丽丸乁𠄢你侻倂偺備像㒞𠘺兔兤具𠔜㒹內𠕋冗冤仌冬𩇟刃㓟刻剆剷㔕包匆卉博即卽卿𠨬灰及叟𠭣叫叱吆咞吸呈周咢哶唐啓啣善喫喳嗂圖圗噑噴壮城埴堍型堲報墬𡓤売壷夆夢奢𡚨𡛪姬娛娧姘婦㛮嬈嬾𡧈寃寘寳𡬘寿将㞁屠峀岍𡷤嵃𡷦嵮嵫嵼巡巢㠯巽帨帽幩㡢𢆃㡼庰庳庶𪎒𢌱舁弢㣇𣊸𦇚形彫㣣徚忍志忹悁㤺㤜𢛔惇慈慌慺憲憤憯懞戛扝抱拔捐𢬌挽拼捨掃揤𢯱搢揅掩㨮摩摾撝摷㩬敬𣀊旣書晉㬙㬈㫤冒冕最暜肭䏙朡杞杓𣏃㭉柺枅桒𣑭梎栟椔楂榣槪檨𣚣櫛㰘次𣢧歔㱎歲殟殻𣪍𡴋𣫺汎𣲼沿泍汧洖派浩浸涅𣴞洴港湮㴳滇𣻑淹潮𣽞𣾎濆瀹瀛㶖灊災灷炭𠔥煅𤉣熜爨牐𤘈犀犕𤜵𤠔獺王㺬玥㺸瑇瑜璅瓊㼛甤𤰶甾𤲒𢆟瘐𤾡𤾸𥁄㿼䀈𥃳𥃲𥄙𥄳眞真瞋䁆䂖𥐝硎䃣𥘦𥚚𥛅秫䄯穊穏𥥼𥪧䈂𥮫篆築䈧𥲀糒䊠糨糣紀𥾆絣䌁緇縂繅䌴𦈨𦉇䍙𦋙罺𦌾羕翺𦓚𦔣聠𦖨聰𣍟䏕育脃䐋脾媵𦞧𦞵𣎓𣎜舄辞䑫芑芋芝劳花芳芽苦𦬼茝荣莭茣莽菧荓菊菌菜𦰶𦵫𦳕䔫蓱蓳蔖𧏊蕤𦼬䕝䕡𦾱𧃒䕫虐虧虩蚩蚈蜎蛢蜨蝫螆蟡蠁䗹衠𧙧裗裞䘵裺㒻𧢮𧥦䚾䛇誠𧲨貫賁贛起𧼯𠠄跋趼跰𠣞軔𨗒𨗭邔郱鄑𨜮鄛鈸鋗鋘鉼鏹鐕𨯺開䦕閷𨵷䧦雃嶲霣𩅅𩈚䩮䩶韠𩐊䪲𩒖頩𩖶飢䬳餩馧駂駾䯎𩬰鱀鳽䳎䳭鵧𪃎䳸𪄅𪈎𪊑䵖黾鼅鼏鼖𪘀", mapChar: function(r4) { return r4 >= 196608 ? r4 >= 917760 && r4 <= 917999 ? 18874368 : 0 : e4[t4[r4 >> 4]][15 & r4]; } }; var e4, t4; }).apply(t3, [])) || (e3.exports = n2); }, 94489: (e3, t3, r3) => { var n2 = r3(28847)(r3(93106)); function i2(e4, t4) { var r4 = "undefined" != typeof Symbol && e4[Symbol.iterator] || e4["@@iterator"]; if (!r4) { if (Array.isArray(e4) || (r4 = function(e5, t5) { if (e5) { if ("string" == typeof e5) return o2(e5, t5); var r5 = Object.prototype.toString.call(e5).slice(8, -1); return "Object" === r5 && e5.constructor && (r5 = e5.constructor.name), "Map" === r5 || "Set" === r5 ? Array.from(e5) : "Arguments" === r5 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r5) ? o2(e5, t5) : void 0; } }(e4)) || t4 && e4 && "number" == typeof e4.length) { r4 && (e4 = r4); var n3 = 0, i3 = function() { }; return { s: i3, n: function() { return n3 >= e4.length ? { done: true } : { done: false, value: e4[n3++] }; }, e: function(e5) { throw e5; }, f: i3 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var a3, s3 = true, u3 = false; return { s: function() { r4 = r4.call(e4); }, n: function() { var e5 = r4.next(); return s3 = e5.done, e5; }, e: function(e5) { u3 = true, a3 = e5; }, f: function() { try { s3 || null == r4.return || r4.return(); } finally { if (u3) throw a3; } } }; } function o2(e4, t4) { (null == t4 || t4 > e4.length) && (t4 = e4.length); for (var r4 = 0, n3 = new Array(t4); r4 < t4; r4++) n3[r4] = e4[r4]; return n3; } var a2 = 2147483647, s2 = 36, u2 = /^xn--/, c2 = /[^\0-\x7E]/, f2 = /[\x2E\u3002\uFF0E\uFF61]/g, d2 = { overflow: "Overflow: input needs wider integers to process", "not-basic": "Illegal input >= 0x80 (not a basic code point)", "invalid-input": "Invalid input" }, l2 = Math.floor, h2 = String.fromCharCode; function p2(e4) { throw new RangeError(d2[e4]); } function b2(e4, t4) { var r4 = e4.split("@"), n3 = ""; r4.length > 1 && (n3 = r4[0] + "@", e4 = r4[1]); var i3 = function(e5, t5) { for (var r5 = [], n4 = e5.length; n4--; ) r5[n4] = t5(e5[n4]); return r5; }((e4 = e4.replace(f2, ".")).split("."), t4).join("."); return n3 + i3; } function y2(e4) { for (var t4 = [], r4 = 0, n3 = e4.length; r4 < n3; ) { var i3 = e4.charCodeAt(r4++); if (i3 >= 55296 && i3 <= 56319 && r4 < n3) { var o3 = e4.charCodeAt(r4++); 56320 == (64512 & o3) ? t4.push(((1023 & i3) << 10) + (1023 & o3) + 65536) : (t4.push(i3), r4--); } else t4.push(i3); } return t4; } var v2 = function(e4, t4) { return e4 + 22 + 75 * (e4 < 26) - ((0 != t4) << 5); }, m2 = function(e4, t4, r4) { var n3 = 0; for (e4 = r4 ? l2(e4 / 700) : e4 >> 1, e4 += l2(e4 / t4); e4 > 455; n3 += s2) e4 = l2(e4 / 35); return l2(n3 + 36 * e4 / (e4 + 38)); }, g2 = function(e4) { var t4, r4 = [], n3 = e4.length, i3 = 0, o3 = 128, u3 = 72, c3 = e4.lastIndexOf("-"); c3 < 0 && (c3 = 0); for (var f3 = 0; f3 < c3; ++f3) e4.charCodeAt(f3) >= 128 && p2("not-basic"), r4.push(e4.charCodeAt(f3)); for (var d3 = c3 > 0 ? c3 + 1 : 0; d3 < n3; ) { for (var h3 = i3, b3 = 1, y3 = s2; ; y3 += s2) { d3 >= n3 && p2("invalid-input"); var v3 = (t4 = e4.charCodeAt(d3++)) - 48 < 10 ? t4 - 22 : t4 - 65 < 26 ? t4 - 65 : t4 - 97 < 26 ? t4 - 97 : s2; (v3 >= s2 || v3 > l2((a2 - i3) / b3)) && p2("overflow"), i3 += v3 * b3; var g3 = y3 <= u3 ? 1 : y3 >= u3 + 26 ? 26 : y3 - u3; if (v3 < g3) break; var w3 = s2 - g3; b3 > l2(a2 / w3) && p2("overflow"), b3 *= w3; } var k3 = r4.length + 1; u3 = m2(i3 - h3, k3, 0 == h3), l2(i3 / k3) > a2 - o3 && p2("overflow"), o3 += l2(i3 / k3), i3 %= k3, r4.splice(i3++, 0, o3); } return String.fromCodePoint.apply(String, r4); }, w2 = function(e4) { var t4, r4 = [], n3 = (e4 = y2(e4)).length, o3 = 128, u3 = 0, c3 = 72, f3 = i2(e4); try { for (f3.s(); !(t4 = f3.n()).done; ) { var d3 = t4.value; d3 < 128 && r4.push(h2(d3)); } } catch (e5) { f3.e(e5); } finally { f3.f(); } var b3 = r4.length, g3 = b3; for (b3 && r4.push("-"); g3 < n3; ) { var w3, k3 = a2, _2 = i2(e4); try { for (_2.s(); !(w3 = _2.n()).done; ) { var A2 = w3.value; A2 >= o3 && A2 < k3 && (k3 = A2); } } catch (e5) { _2.e(e5); } finally { _2.f(); } var E2 = g3 + 1; k3 - o3 > l2((a2 - u3) / E2) && p2("overflow"), u3 += (k3 - o3) * E2, o3 = k3; var S2, x2 = i2(e4); try { for (x2.s(); !(S2 = x2.n()).done; ) { var B2 = S2.value; if (B2 < o3 && ++u3 > a2 && p2("overflow"), B2 == o3) { for (var O2 = u3, P2 = s2; ; P2 += s2) { var I2 = P2 <= c3 ? 1 : P2 >= c3 + 26 ? 26 : P2 - c3; if (O2 < I2) break; var T2 = O2 - I2, C2 = s2 - I2; r4.push(h2(v2(I2 + T2 % C2, 0))), O2 = l2(T2 / C2); } r4.push(h2(v2(O2, 0))), c3 = m2(u3, E2, g3 == b3), u3 = 0, ++g3; } } } catch (e5) { x2.e(e5); } finally { x2.f(); } ++u3, ++o3; } return r4.join(""); }, k2 = { version: "2.1.0", ucs2: { decode: y2, encode: function(e4) { return String.fromCodePoint.apply(String, (0, n2.default)(e4)); } }, decode: g2, encode: w2, toASCII: function(e4) { return b2(e4, function(e5) { return c2.test(e5) ? "xn--" + w2(e5) : e5; }); }, toUnicode: function(e4) { return b2(e4, function(e5) { return u2.test(e5) ? g2(e5.slice(4).toLowerCase()) : e5; }); } }; e3.exports = k2; }, 3956: (e3, t3, r3) => { var n2, i2; r3(28847)(r3(3355)), n2 = [r3(94489), r3(32996)], void 0 === (i2 = (function(e4, t4) { return function(e5, t5) { function r4(r5, n4, i4) { for (var o2 = [], a2 = e5.ucs2.decode(r5), s2 = 0; s2 < a2.length; s2++) { var u2 = a2[s2], c2 = e5.ucs2.encode([a2[s2]]), f2 = t5.mapChar(u2), d2 = f2 >> 23, l2 = f2 >> 21 & 3, h2 = f2 >> 5 & 65535, p2 = 31 & f2, b2 = t5.mapStr.substr(h2, p2); if (0 === l2 || n4 && 1 & d2) throw new Error("Illegal char " + c2); 1 === l2 ? o2.push(b2) : 2 === l2 ? o2.push(i4 ? b2 : c2) : 3 === l2 && o2.push(c2); } return o2.join("").normalize("NFC"); } function n3(t6, n4, o2) { void 0 === o2 && (o2 = false); var a2 = r4(t6, o2, n4).split("."); return (a2 = a2.map(function(t7) { return t7.startsWith("xn--") ? i3(t7 = e5.decode(t7.substring(4)), o2, false) : i3(t7, o2, n4), t7; })).join("."); } function i3(e6, n4, i4) { if ("-" === e6[2] && "-" === e6[3]) throw new Error("Failed to validate " + e6); if (e6.startsWith("-") || e6.endsWith("-")) throw new Error("Failed to validate " + e6); if (e6.includes(".")) throw new Error("Failed to validate " + e6); if (r4(e6, n4, i4) !== e6) throw new Error("Failed to validate " + e6); var o2 = e6.codePointAt(0); if (t5.mapChar(o2) & 2 << 23) throw new Error("Label contains illegal character: " + o2); } return { toUnicode: function(e6, t6) { return void 0 === t6 && (t6 = {}), n3(e6, false, "useStd3ASCII" in t6 && t6.useStd3ASCII); }, toAscii: function(t6, r5) { void 0 === r5 && (r5 = {}); var i4, o2 = !("transitional" in r5) || r5.transitional, a2 = "useStd3ASCII" in r5 && r5.useStd3ASCII, s2 = "verifyDnsLength" in r5 && r5.verifyDnsLength, u2 = n3(t6, o2, a2).split(".").map(e5.toASCII), c2 = u2.join("."); if (s2) { if (c2.length < 1 || c2.length > 253) throw new Error("DNS name has wrong length: " + c2); for (i4 = 0; i4 < u2.length; i4++) { var f2 = u2[i4]; if (f2.length < 1 || f2.length > 63) throw new Error("DNS label has wrong length: " + f2); } } return c2; } }; }(e4, t4); }).apply(t3, n2)) || (e3.exports = i2); }, 83226: (e3, t3) => { t3.read = function(e4, t4, r3, n2, i2) { var o2, a2, s2 = 8 * i2 - n2 - 1, u2 = (1 << s2) - 1, c2 = u2 >> 1, f2 = -7, d2 = r3 ? i2 - 1 : 0, l2 = r3 ? -1 : 1, h2 = e4[t4 + d2]; for (d2 += l2, o2 = h2 & (1 << -f2) - 1, h2 >>= -f2, f2 += s2; f2 > 0; o2 = 256 * o2 + e4[t4 + d2], d2 += l2, f2 -= 8) ; for (a2 = o2 & (1 << -f2) - 1, o2 >>= -f2, f2 += n2; f2 > 0; a2 = 256 * a2 + e4[t4 + d2], d2 += l2, f2 -= 8) ; if (0 === o2) o2 = 1 - c2; else { if (o2 === u2) return a2 ? NaN : 1 / 0 * (h2 ? -1 : 1); a2 += Math.pow(2, n2), o2 -= c2; } return (h2 ? -1 : 1) * a2 * Math.pow(2, o2 - n2); }, t3.write = function(e4, t4, r3, n2, i2, o2) { var a2, s2, u2, c2 = 8 * o2 - i2 - 1, f2 = (1 << c2) - 1, d2 = f2 >> 1, l2 = 23 === i2 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, h2 = n2 ? 0 : o2 - 1, p2 = n2 ? 1 : -1, b2 = t4 < 0 || 0 === t4 && 1 / t4 < 0 ? 1 : 0; for (t4 = Math.abs(t4), isNaN(t4) || t4 === 1 / 0 ? (s2 = isNaN(t4) ? 1 : 0, a2 = f2) : (a2 = Math.floor(Math.log(t4) / Math.LN2), t4 * (u2 = Math.pow(2, -a2)) < 1 && (a2--, u2 *= 2), (t4 += a2 + d2 >= 1 ? l2 / u2 : l2 * Math.pow(2, 1 - d2)) * u2 >= 2 && (a2++, u2 /= 2), a2 + d2 >= f2 ? (s2 = 0, a2 = f2) : a2 + d2 >= 1 ? (s2 = (t4 * u2 - 1) * Math.pow(2, i2), a2 += d2) : (s2 = t4 * Math.pow(2, d2 - 1) * Math.pow(2, i2), a2 = 0)); i2 >= 8; e4[r3 + h2] = 255 & s2, h2 += p2, s2 /= 256, i2 -= 8) ; for (a2 = a2 << i2 | s2, c2 += i2; c2 > 0; e4[r3 + h2] = 255 & a2, h2 += p2, a2 /= 256, c2 -= 8) ; e4[r3 + h2 - p2] |= 128 * b2; }; }, 41736: (e3) => { "function" == typeof Object.create ? e3.exports = function(e4, t3) { t3 && (e4.super_ = t3, e4.prototype = Object.create(t3.prototype, { constructor: { value: e4, enumerable: false, writable: true, configurable: true } })); } : e3.exports = function(e4, t3) { if (t3) { e4.super_ = t3; var r3 = function() { }; r3.prototype = t3.prototype, e4.prototype = new r3(), e4.prototype.constructor = e4; } }; }, 69446: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(11191)(), o2 = r3(80593)("Object.prototype.toString"), a2 = function(e4) { return !(i2 && e4 && "object" === (0, n2.default)(e4) && Symbol.toStringTag in e4) && "[object Arguments]" === o2(e4); }, s2 = function(e4) { return !!a2(e4) || null !== e4 && "object" === (0, n2.default)(e4) && "number" == typeof e4.length && e4.length >= 0 && "[object Array]" !== o2(e4) && "[object Function]" === o2(e4.callee); }, u2 = function() { return a2(arguments); }(); a2.isLegacyArguments = s2, e3.exports = u2 ? a2 : s2; }, 41493: (e3, t3, r3) => { var n2, i2, o2 = r3(28847)(r3(3355)), a2 = Function.prototype.toString, s2 = "object" === ("undefined" == typeof Reflect ? "undefined" : (0, o2.default)(Reflect)) && null !== Reflect && Reflect.apply; if ("function" == typeof s2 && "function" == typeof Object.defineProperty) try { n2 = Object.defineProperty({}, "length", { get: function() { throw i2; } }), i2 = {}, s2(function() { throw 42; }, null, n2); } catch (e4) { e4 !== i2 && (s2 = null); } else s2 = null; var u2 = /^\s*class\b/, c2 = function(e4) { try { var t4 = a2.call(e4); return u2.test(t4); } catch (e5) { return false; } }, f2 = function(e4) { try { return !c2(e4) && (a2.call(e4), true); } catch (e5) { return false; } }, d2 = Object.prototype.toString, l2 = "function" == typeof Symbol && !!Symbol.toStringTag, h2 = !(0 in [,]), p2 = function() { return false; }; if ("object" === ("undefined" == typeof document ? "undefined" : (0, o2.default)(document))) { var b2 = document.all; d2.call(b2) === d2.call(document.all) && (p2 = function(e4) { if ((h2 || !e4) && (void 0 === e4 || "object" === (0, o2.default)(e4))) try { var t4 = d2.call(e4); return ("[object HTMLAllCollection]" === t4 || "[object HTML document.all class]" === t4 || "[object HTMLCollection]" === t4 || "[object Object]" === t4) && null == e4(""); } catch (e5) { } return false; }); } e3.exports = s2 ? function(e4) { if (p2(e4)) return true; if (!e4) return false; if ("function" != typeof e4 && "object" !== (0, o2.default)(e4)) return false; try { s2(e4, null, n2); } catch (e5) { if (e5 !== i2) return false; } return !c2(e4) && f2(e4); } : function(e4) { if (p2(e4)) return true; if (!e4) return false; if ("function" != typeof e4 && "object" !== (0, o2.default)(e4)) return false; if (l2) return f2(e4); if (c2(e4)) return false; var t4 = d2.call(e4); return !("[object Function]" !== t4 && "[object GeneratorFunction]" !== t4 && !/^\[object HTML/.test(t4)) && f2(e4); }; }, 27277: (e3) => { e3.exports = function(e4) { if (!e4) return false; var r3 = t3.call(e4); return "[object Function]" === r3 || "function" == typeof e4 && "[object RegExp]" !== r3 || "undefined" != typeof window && (e4 === window.setTimeout || e4 === window.alert || e4 === window.confirm || e4 === window.prompt); }; var t3 = Object.prototype.toString; }, 14477: (e3, t3, r3) => { var n2, i2 = Object.prototype.toString, o2 = Function.prototype.toString, a2 = /^\s*(?:function)?\*/, s2 = r3(11191)(), u2 = Object.getPrototypeOf; e3.exports = function(e4) { if ("function" != typeof e4) return false; if (a2.test(o2.call(e4))) return true; if (!s2) return "[object GeneratorFunction]" === i2.call(e4); if (!u2) return false; if (void 0 === n2) { var t4 = function() { if (!s2) return false; try { return Function("return function*() {}")(); } catch (e5) { } }(); n2 = !!t4 && u2(t4); } return u2(e4) === n2; }; }, 8619: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)); e3.exports = function(e4) { if ("string" != typeof e4) throw new Error("[is-hex-prefixed] value must be type 'string', is currently type " + (0, n2.default)(e4) + ", while checking isHexPrefixed."); return "0x" === e4.slice(0, 2); }; }, 28915: (e3, t3, r3) => { var n2 = r3(72337); e3.exports = function(e4) { return !!n2(e4); }; }, 39484: (e3) => { var t3 = {}.toString; e3.exports = Array.isArray || function(e4) { return "[object Array]" == t3.call(e4); }; }, 24858: (e3, t3, r3) => { e3 = r3.nmd(e3); var n2 = r3(19142), i2 = r3(28847)(r3(3355)); !function() { var t4 = "object" === ("undefined" == typeof window ? "undefined" : (0, i2.default)(window)) ? window : {}; !t4.JS_SHA3_NO_NODE_JS && "object" === (void 0 === n2 ? "undefined" : (0, i2.default)(n2)) && n2.versions && n2.versions.node && (t4 = r3.g); for (var o2 = !t4.JS_SHA3_NO_COMMON_JS && "object" === (0, i2.default)(e3) && e3.exports, a2 = "0123456789abcdef".split(""), s2 = [0, 8, 16, 24], u2 = [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], c2 = [224, 256, 384, 512], f2 = ["hex", "buffer", "arrayBuffer", "array"], d2 = function(e4, t5, r4) { return function(n3) { return new _2(e4, t5, e4).update(n3)[r4](); }; }, l2 = function(e4, t5, r4) { return function(n3, i3) { return new _2(e4, t5, i3).update(n3)[r4](); }; }, h2 = function(e4, t5) { var r4 = d2(e4, t5, "hex"); r4.create = function() { return new _2(e4, t5, e4); }, r4.update = function(e5) { return r4.create().update(e5); }; for (var n3 = 0; n3 < f2.length; ++n3) { var i3 = f2[n3]; r4[i3] = d2(e4, t5, i3); } return r4; }, p2 = [{ name: "keccak", padding: [1, 256, 65536, 16777216], bits: c2, createMethod: h2 }, { name: "sha3", padding: [6, 1536, 393216, 100663296], bits: c2, createMethod: h2 }, { name: "shake", padding: [31, 7936, 2031616, 520093696], bits: [128, 256], createMethod: function(e4, t5) { var r4 = l2(e4, t5, "hex"); r4.create = function(r5) { return new _2(e4, t5, r5); }, r4.update = function(e5, t6) { return r4.create(t6).update(e5); }; for (var n3 = 0; n3 < f2.length; ++n3) { var i3 = f2[n3]; r4[i3] = l2(e4, t5, i3); } return r4; } }], b2 = {}, y2 = [], v2 = 0; v2 < p2.length; ++v2) for (var m2 = p2[v2], g2 = m2.bits, w2 = 0; w2 < g2.length; ++w2) { var k2 = m2.name + "_" + g2[w2]; y2.push(k2), b2[k2] = m2.createMethod(g2[w2], m2.padding); } function _2(e4, t5, r4) { this.blocks = [], this.s = [], this.padding = t5, this.outputBits = r4, this.reset = true, this.block = 0, this.start = 0, this.blockCount = 1600 - (e4 << 1) >> 5, this.byteCount = this.blockCount << 2, this.outputBlocks = r4 >> 5, this.extraBytes = (31 & r4) >> 3; for (var n3 = 0; n3 < 50; ++n3) this.s[n3] = 0; } _2.prototype.update = function(e4) { var t5 = "string" != typeof e4; t5 && e4.constructor === ArrayBuffer && (e4 = new Uint8Array(e4)); for (var r4, n3, i3 = e4.length, o3 = this.blocks, a3 = this.byteCount, u3 = this.blockCount, c3 = 0, f3 = this.s; c3 < i3; ) { if (this.reset) for (this.reset = false, o3[0] = this.block, r4 = 1; r4 < u3 + 1; ++r4) o3[r4] = 0; if (t5) for (r4 = this.start; c3 < i3 && r4 < a3; ++c3) o3[r4 >> 2] |= e4[c3] << s2[3 & r4++]; else for (r4 = this.start; c3 < i3 && r4 < a3; ++c3) (n3 = e4.charCodeAt(c3)) < 128 ? o3[r4 >> 2] |= n3 << s2[3 & r4++] : n3 < 2048 ? (o3[r4 >> 2] |= (192 | n3 >> 6) << s2[3 & r4++], o3[r4 >> 2] |= (128 | 63 & n3) << s2[3 & r4++]) : n3 < 55296 || n3 >= 57344 ? (o3[r4 >> 2] |= (224 | n3 >> 12) << s2[3 & r4++], o3[r4 >> 2] |= (128 | n3 >> 6 & 63) << s2[3 & r4++], o3[r4 >> 2] |= (128 | 63 & n3) << s2[3 & r4++]) : (n3 = 65536 + ((1023 & n3) << 10 | 1023 & e4.charCodeAt(++c3)), o3[r4 >> 2] |= (240 | n3 >> 18) << s2[3 & r4++], o3[r4 >> 2] |= (128 | n3 >> 12 & 63) << s2[3 & r4++], o3[r4 >> 2] |= (128 | n3 >> 6 & 63) << s2[3 & r4++], o3[r4 >> 2] |= (128 | 63 & n3) << s2[3 & r4++]); if (this.lastByteIndex = r4, r4 >= a3) { for (this.start = r4 - a3, this.block = o3[u3], r4 = 0; r4 < u3; ++r4) f3[r4] ^= o3[r4]; A2(f3), this.reset = true; } else this.start = r4; } return this; }, _2.prototype.finalize = function() { var e4 = this.blocks, t5 = this.lastByteIndex, r4 = this.blockCount, n3 = this.s; if (e4[t5 >> 2] |= this.padding[3 & t5], this.lastByteIndex === this.byteCount) for (e4[0] = e4[r4], t5 = 1; t5 < r4 + 1; ++t5) e4[t5] = 0; for (e4[r4 - 1] |= 2147483648, t5 = 0; t5 < r4; ++t5) n3[t5] ^= e4[t5]; A2(n3); }, _2.prototype.toString = _2.prototype.hex = function() { this.finalize(); for (var e4, t5 = this.blockCount, r4 = this.s, n3 = this.outputBlocks, i3 = this.extraBytes, o3 = 0, s3 = 0, u3 = ""; s3 < n3; ) { for (o3 = 0; o3 < t5 && s3 < n3; ++o3, ++s3) e4 = r4[o3], u3 += a2[e4 >> 4 & 15] + a2[15 & e4] + a2[e4 >> 12 & 15] + a2[e4 >> 8 & 15] + a2[e4 >> 20 & 15] + a2[e4 >> 16 & 15] + a2[e4 >> 28 & 15] + a2[e4 >> 24 & 15]; s3 % t5 == 0 && (A2(r4), o3 = 0); } return i3 && (e4 = r4[o3], i3 > 0 && (u3 += a2[e4 >> 4 & 15] + a2[15 & e4]), i3 > 1 && (u3 += a2[e4 >> 12 & 15] + a2[e4 >> 8 & 15]), i3 > 2 && (u3 += a2[e4 >> 20 & 15] + a2[e4 >> 16 & 15])), u3; }, _2.prototype.arrayBuffer = function() { this.finalize(); var e4, t5 = this.blockCount, r4 = this.s, n3 = this.outputBlocks, i3 = this.extraBytes, o3 = 0, a3 = 0, s3 = this.outputBits >> 3; e4 = i3 ? new ArrayBuffer(n3 + 1 << 2) : new ArrayBuffer(s3); for (var u3 = new Uint32Array(e4); a3 < n3; ) { for (o3 = 0; o3 < t5 && a3 < n3; ++o3, ++a3) u3[a3] = r4[o3]; a3 % t5 == 0 && A2(r4); } return i3 && (u3[o3] = r4[o3], e4 = e4.slice(0, s3)), e4; }, _2.prototype.buffer = _2.prototype.arrayBuffer, _2.prototype.digest = _2.prototype.array = function() { this.finalize(); for (var e4, t5, r4 = this.blockCount, n3 = this.s, i3 = this.outputBlocks, o3 = this.extraBytes, a3 = 0, s3 = 0, u3 = []; s3 < i3; ) { for (a3 = 0; a3 < r4 && s3 < i3; ++a3, ++s3) e4 = s3 << 2, t5 = n3[a3], u3[e4] = 255 & t5, u3[e4 + 1] = t5 >> 8 & 255, u3[e4 + 2] = t5 >> 16 & 255, u3[e4 + 3] = t5 >> 24 & 255; s3 % r4 == 0 && A2(n3); } return o3 && (e4 = s3 << 2, t5 = n3[a3], o3 > 0 && (u3[e4] = 255 & t5), o3 > 1 && (u3[e4 + 1] = t5 >> 8 & 255), o3 > 2 && (u3[e4 + 2] = t5 >> 16 & 255)), u3; }; var A2 = function(e4) { var t5, r4, n3, i3, o3, a3, s3, c3, f3, d3, l3, h3, p3, b3, y3, v3, m3, g3, w3, k3, _3, A3, E2, S2, x2, B2, O2, P2, I2, T2, C2, M2, R2, U2, N2, j2, L2, F2, D2, H2, z2, q2, K2, G2, V2, Z2, W2, J2, Y2, X2, Q2, $2, ee2, te2, re2, ne2, ie2, oe2, ae2, se2, ue2, ce2, fe2; for (n3 = 0; n3 < 48; n3 += 2) i3 = e4[0] ^ e4[10] ^ e4[20] ^ e4[30] ^ e4[40], o3 = e4[1] ^ e4[11] ^ e4[21] ^ e4[31] ^ e4[41], a3 = e4[2] ^ e4[12] ^ e4[22] ^ e4[32] ^ e4[42], s3 = e4[3] ^ e4[13] ^ e4[23] ^ e4[33] ^ e4[43], c3 = e4[4] ^ e4[14] ^ e4[24] ^ e4[34] ^ e4[44], f3 = e4[5] ^ e4[15] ^ e4[25] ^ e4[35] ^ e4[45], d3 = e4[6] ^ e4[16] ^ e4[26] ^ e4[36] ^ e4[46], l3 = e4[7] ^ e4[17] ^ e4[27] ^ e4[37] ^ e4[47], t5 = (h3 = e4[8] ^ e4[18] ^ e4[28] ^ e4[38] ^ e4[48]) ^ (a3 << 1 | s3 >>> 31), r4 = (p3 = e4[9] ^ e4[19] ^ e4[29] ^ e4[39] ^ e4[49]) ^ (s3 << 1 | a3 >>> 31), e4[0] ^= t5, e4[1] ^= r4, e4[10] ^= t5, e4[11] ^= r4, e4[20] ^= t5, e4[21] ^= r4, e4[30] ^= t5, e4[31] ^= r4, e4[40] ^= t5, e4[41] ^= r4, t5 = i3 ^ (c3 << 1 | f3 >>> 31), r4 = o3 ^ (f3 << 1 | c3 >>> 31), e4[2] ^= t5, e4[3] ^= r4, e4[12] ^= t5, e4[13] ^= r4, e4[22] ^= t5, e4[23] ^= r4, e4[32] ^= t5, e4[33] ^= r4, e4[42] ^= t5, e4[43] ^= r4, t5 = a3 ^ (d3 << 1 | l3 >>> 31), r4 = s3 ^ (l3 << 1 | d3 >>> 31), e4[4] ^= t5, e4[5] ^= r4, e4[14] ^= t5, e4[15] ^= r4, e4[24] ^= t5, e4[25] ^= r4, e4[34] ^= t5, e4[35] ^= r4, e4[44] ^= t5, e4[45] ^= r4, t5 = c3 ^ (h3 << 1 | p3 >>> 31), r4 = f3 ^ (p3 << 1 | h3 >>> 31), e4[6] ^= t5, e4[7] ^= r4, e4[16] ^= t5, e4[17] ^= r4, e4[26] ^= t5, e4[27] ^= r4, e4[36] ^= t5, e4[37] ^= r4, e4[46] ^= t5, e4[47] ^= r4, t5 = d3 ^ (i3 << 1 | o3 >>> 31), r4 = l3 ^ (o3 << 1 | i3 >>> 31), e4[8] ^= t5, e4[9] ^= r4, e4[18] ^= t5, e4[19] ^= r4, e4[28] ^= t5, e4[29] ^= r4, e4[38] ^= t5, e4[39] ^= r4, e4[48] ^= t5, e4[49] ^= r4, b3 = e4[0], y3 = e4[1], Z2 = e4[11] << 4 | e4[10] >>> 28, W2 = e4[10] << 4 | e4[11] >>> 28, P2 = e4[20] << 3 | e4[21] >>> 29, I2 = e4[21] << 3 | e4[20] >>> 29, se2 = e4[31] << 9 | e4[30] >>> 23, ue2 = e4[30] << 9 | e4[31] >>> 23, q2 = e4[40] << 18 | e4[41] >>> 14, K2 = e4[41] << 18 | e4[40] >>> 14, U2 = e4[2] << 1 | e4[3] >>> 31, N2 = e4[3] << 1 | e4[2] >>> 31, v3 = e4[13] << 12 | e4[12] >>> 20, m3 = e4[12] << 12 | e4[13] >>> 20, J2 = e4[22] << 10 | e4[23] >>> 22, Y2 = e4[23] << 10 | e4[22] >>> 22, T2 = e4[33] << 13 | e4[32] >>> 19, C2 = e4[32] << 13 | e4[33] >>> 19, ce2 = e4[42] << 2 | e4[43] >>> 30, fe2 = e4[43] << 2 | e4[42] >>> 30, te2 = e4[5] << 30 | e4[4] >>> 2, re2 = e4[4] << 30 | e4[5] >>> 2, j2 = e4[14] << 6 | e4[15] >>> 26, L2 = e4[15] << 6 | e4[14] >>> 26, g3 = e4[25] << 11 | e4[24] >>> 21, w3 = e4[24] << 11 | e4[25] >>> 21, X2 = e4[34] << 15 | e4[35] >>> 17, Q2 = e4[35] << 15 | e4[34] >>> 17, M2 = e4[45] << 29 | e4[44] >>> 3, R2 = e4[44] << 29 | e4[45] >>> 3, S2 = e4[6] << 28 | e4[7] >>> 4, x2 = e4[7] << 28 | e4[6] >>> 4, ne2 = e4[17] << 23 | e4[16] >>> 9, ie2 = e4[16] << 23 | e4[17] >>> 9, F2 = e4[26] << 25 | e4[27] >>> 7, D2 = e4[27] << 25 | e4[26] >>> 7, k3 = e4[36] << 21 | e4[37] >>> 11, _3 = e4[37] << 21 | e4[36] >>> 11, $2 = e4[47] << 24 | e4[46] >>> 8, ee2 = e4[46] << 24 | e4[47] >>> 8, G2 = e4[8] << 27 | e4[9] >>> 5, V2 = e4[9] << 27 | e4[8] >>> 5, B2 = e4[18] << 20 | e4[19] >>> 12, O2 = e4[19] << 20 | e4[18] >>> 12, oe2 = e4[29] << 7 | e4[28] >>> 25, ae2 = e4[28] << 7 | e4[29] >>> 25, H2 = e4[38] << 8 | e4[39] >>> 24, z2 = e4[39] << 8 | e4[38] >>> 24, A3 = e4[48] << 14 | e4[49] >>> 18, E2 = e4[49] << 14 | e4[48] >>> 18, e4[0] = b3 ^ ~v3 & g3, e4[1] = y3 ^ ~m3 & w3, e4[10] = S2 ^ ~B2 & P2, e4[11] = x2 ^ ~O2 & I2, e4[20] = U2 ^ ~j2 & F2, e4[21] = N2 ^ ~L2 & D2, e4[30] = G2 ^ ~Z2 & J2, e4[31] = V2 ^ ~W2 & Y2, e4[40] = te2 ^ ~ne2 & oe2, e4[41] = re2 ^ ~ie2 & ae2, e4[2] = v3 ^ ~g3 & k3, e4[3] = m3 ^ ~w3 & _3, e4[12] = B2 ^ ~P2 & T2, e4[13] = O2 ^ ~I2 & C2, e4[22] = j2 ^ ~F2 & H2, e4[23] = L2 ^ ~D2 & z2, e4[32] = Z2 ^ ~J2 & X2, e4[33] = W2 ^ ~Y2 & Q2, e4[42] = ne2 ^ ~oe2 & se2, e4[43] = ie2 ^ ~ae2 & ue2, e4[4] = g3 ^ ~k3 & A3, e4[5] = w3 ^ ~_3 & E2, e4[14] = P2 ^ ~T2 & M2, e4[15] = I2 ^ ~C2 & R2, e4[24] = F2 ^ ~H2 & q2, e4[25] = D2 ^ ~z2 & K2, e4[34] = J2 ^ ~X2 & $2, e4[35] = Y2 ^ ~Q2 & ee2, e4[44] = oe2 ^ ~se2 & ce2, e4[45] = ae2 ^ ~ue2 & fe2, e4[6] = k3 ^ ~A3 & b3, e4[7] = _3 ^ ~E2 & y3, e4[16] = T2 ^ ~M2 & S2, e4[17] = C2 ^ ~R2 & x2, e4[26] = H2 ^ ~q2 & U2, e4[27] = z2 ^ ~K2 & N2, e4[36] = X2 ^ ~$2 & G2, e4[37] = Q2 ^ ~ee2 & V2, e4[46] = se2 ^ ~ce2 & te2, e4[47] = ue2 ^ ~fe2 & re2, e4[8] = A3 ^ ~b3 & v3, e4[9] = E2 ^ ~y3 & m3, e4[18] = M2 ^ ~S2 & B2, e4[19] = R2 ^ ~x2 & O2, e4[28] = q2 ^ ~U2 & j2, e4[29] = K2 ^ ~N2 & L2, e4[38] = $2 ^ ~G2 & Z2, e4[39] = ee2 ^ ~V2 & W2, e4[48] = ce2 ^ ~te2 & ne2, e4[49] = fe2 ^ ~re2 & ie2, e4[0] ^= u2[n3], e4[1] ^= u2[n3 + 1]; }; if (o2) e3.exports = b2; else for (v2 = 0; v2 < y2.length; ++v2) t4[y2[v2]] = b2[y2[v2]]; }(); }, 93135: (e3, t3, r3) => { e3.exports = r3(22109)(r3(80801)); }, 22109: (e3, t3, r3) => { var n2 = r3(46543), i2 = r3(40274); e3.exports = function(e4) { var t4 = n2(e4), r4 = i2(e4); return function(e5, n3) { switch ("string" == typeof e5 ? e5.toLowerCase() : e5) { case "keccak224": return new t4(1152, 448, null, 224, n3); case "keccak256": return new t4(1088, 512, null, 256, n3); case "keccak384": return new t4(832, 768, null, 384, n3); case "keccak512": return new t4(576, 1024, null, 512, n3); case "sha3-224": return new t4(1152, 448, 6, 224, n3); case "sha3-256": return new t4(1088, 512, 6, 256, n3); case "sha3-384": return new t4(832, 768, 6, 384, n3); case "sha3-512": return new t4(576, 1024, 6, 512, n3); case "shake128": return new r4(1344, 256, 31, n3); case "shake256": return new r4(1088, 512, 31, n3); default: throw new Error("Invald algorithm: " + e5); } }; }; }, 46543: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(28847), o2 = i2(r3(69721)), a2 = i2(r3(58985)), s2 = i2(r3(15163)), u2 = i2(r3(34650)), c2 = i2(r3(21949)); var f2 = r3(86505).Transform; e3.exports = function(e4) { return function(t4) { (0, s2.default)(d2, t4); var r4, i3, f3 = (r4 = d2, i3 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, t5 = (0, c2.default)(r4); if (i3) { var n3 = (0, c2.default)(this).constructor; e5 = Reflect.construct(t5, arguments, n3); } else e5 = t5.apply(this, arguments); return (0, u2.default)(this, e5); }); function d2(t5, r5, n3, i4, a3) { var s3; return (0, o2.default)(this, d2), (s3 = f3.call(this, a3))._rate = t5, s3._capacity = r5, s3._delimitedSuffix = n3, s3._hashBitLength = i4, s3._options = a3, s3._state = new e4(), s3._state.initialize(t5, r5), s3._finalized = false, s3; } return (0, a2.default)(d2, [{ key: "_transform", value: function(e5, t5, r5) { var n3 = null; try { this.update(e5, t5); } catch (e6) { n3 = e6; } r5(n3); } }, { key: "_flush", value: function(e5) { var t5 = null; try { this.push(this.digest()); } catch (e6) { t5 = e6; } e5(t5); } }, { key: "update", value: function(e5, t5) { if (!n2.isBuffer(e5) && "string" != typeof e5) throw new TypeError("Data must be a string or a buffer"); if (this._finalized) throw new Error("Digest already called"); return n2.isBuffer(e5) || (e5 = n2.from(e5, t5)), this._state.absorb(e5), this; } }, { key: "digest", value: function(e5) { if (this._finalized) throw new Error("Digest already called"); this._finalized = true, this._delimitedSuffix && this._state.absorbLastFewBits(this._delimitedSuffix); var t5 = this._state.squeeze(this._hashBitLength / 8); return void 0 !== e5 && (t5 = t5.toString(e5)), this._resetState(), t5; } }, { key: "_resetState", value: function() { return this._state.initialize(this._rate, this._capacity), this; } }, { key: "_clone", value: function() { var e5 = new d2(this._rate, this._capacity, this._delimitedSuffix, this._hashBitLength, this._options); return this._state.copy(e5._state), e5._finalized = this._finalized, e5; } }]), d2; }(f2); }; }, 40274: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(28847), o2 = i2(r3(69721)), a2 = i2(r3(58985)), s2 = i2(r3(15163)), u2 = i2(r3(34650)), c2 = i2(r3(21949)); var f2 = r3(86505).Transform; e3.exports = function(e4) { return function(t4) { (0, s2.default)(d2, t4); var r4, i3, f3 = (r4 = d2, i3 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(), function() { var e5, t5 = (0, c2.default)(r4); if (i3) { var n3 = (0, c2.default)(this).constructor; e5 = Reflect.construct(t5, arguments, n3); } else e5 = t5.apply(this, arguments); return (0, u2.default)(this, e5); }); function d2(t5, r5, n3, i4) { var a3; return (0, o2.default)(this, d2), (a3 = f3.call(this, i4))._rate = t5, a3._capacity = r5, a3._delimitedSuffix = n3, a3._options = i4, a3._state = new e4(), a3._state.initialize(t5, r5), a3._finalized = false, a3; } return (0, a2.default)(d2, [{ key: "_transform", value: function(e5, t5, r5) { var n3 = null; try { this.update(e5, t5); } catch (e6) { n3 = e6; } r5(n3); } }, { key: "_flush", value: function() { } }, { key: "_read", value: function(e5) { this.push(this.squeeze(e5)); } }, { key: "update", value: function(e5, t5) { if (!n2.isBuffer(e5) && "string" != typeof e5) throw new TypeError("Data must be a string or a buffer"); if (this._finalized) throw new Error("Squeeze already called"); return n2.isBuffer(e5) || (e5 = n2.from(e5, t5)), this._state.absorb(e5), this; } }, { key: "squeeze", value: function(e5, t5) { this._finalized || (this._finalized = true, this._state.absorbLastFewBits(this._delimitedSuffix)); var r5 = this._state.squeeze(e5); return void 0 !== t5 && (r5 = r5.toString(t5)), r5; } }, { key: "_resetState", value: function() { return this._state.initialize(this._rate, this._capacity), this; } }, { key: "_clone", value: function() { var e5 = new d2(this._rate, this._capacity, this._delimitedSuffix, this._options); return this._state.copy(e5._state), e5._finalized = this._finalized, e5; } }]), d2; }(f2); }; }, 25612: (e3, t3) => { var r3 = [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]; t3.p1600 = function(e4) { for (var t4 = 0; t4 < 24; ++t4) { var n2 = e4[0] ^ e4[10] ^ e4[20] ^ e4[30] ^ e4[40], i2 = e4[1] ^ e4[11] ^ e4[21] ^ e4[31] ^ e4[41], o2 = e4[2] ^ e4[12] ^ e4[22] ^ e4[32] ^ e4[42], a2 = e4[3] ^ e4[13] ^ e4[23] ^ e4[33] ^ e4[43], s2 = e4[4] ^ e4[14] ^ e4[24] ^ e4[34] ^ e4[44], u2 = e4[5] ^ e4[15] ^ e4[25] ^ e4[35] ^ e4[45], c2 = e4[6] ^ e4[16] ^ e4[26] ^ e4[36] ^ e4[46], f2 = e4[7] ^ e4[17] ^ e4[27] ^ e4[37] ^ e4[47], d2 = e4[8] ^ e4[18] ^ e4[28] ^ e4[38] ^ e4[48], l2 = e4[9] ^ e4[19] ^ e4[29] ^ e4[39] ^ e4[49], h2 = d2 ^ (o2 << 1 | a2 >>> 31), p2 = l2 ^ (a2 << 1 | o2 >>> 31), b2 = e4[0] ^ h2, y2 = e4[1] ^ p2, v2 = e4[10] ^ h2, m2 = e4[11] ^ p2, g2 = e4[20] ^ h2, w2 = e4[21] ^ p2, k2 = e4[30] ^ h2, _2 = e4[31] ^ p2, A2 = e4[40] ^ h2, E2 = e4[41] ^ p2; h2 = n2 ^ (s2 << 1 | u2 >>> 31), p2 = i2 ^ (u2 << 1 | s2 >>> 31); var S2 = e4[2] ^ h2, x2 = e4[3] ^ p2, B2 = e4[12] ^ h2, O2 = e4[13] ^ p2, P2 = e4[22] ^ h2, I2 = e4[23] ^ p2, T2 = e4[32] ^ h2, C2 = e4[33] ^ p2, M2 = e4[42] ^ h2, R2 = e4[43] ^ p2; h2 = o2 ^ (c2 << 1 | f2 >>> 31), p2 = a2 ^ (f2 << 1 | c2 >>> 31); var U2 = e4[4] ^ h2, N2 = e4[5] ^ p2, j2 = e4[14] ^ h2, L2 = e4[15] ^ p2, F2 = e4[24] ^ h2, D2 = e4[25] ^ p2, H2 = e4[34] ^ h2, z2 = e4[35] ^ p2, q2 = e4[44] ^ h2, K2 = e4[45] ^ p2; h2 = s2 ^ (d2 << 1 | l2 >>> 31), p2 = u2 ^ (l2 << 1 | d2 >>> 31); var G2 = e4[6] ^ h2, V2 = e4[7] ^ p2, Z2 = e4[16] ^ h2, W2 = e4[17] ^ p2, J2 = e4[26] ^ h2, Y2 = e4[27] ^ p2, X2 = e4[36] ^ h2, Q2 = e4[37] ^ p2, $2 = e4[46] ^ h2, ee2 = e4[47] ^ p2; h2 = c2 ^ (n2 << 1 | i2 >>> 31), p2 = f2 ^ (i2 << 1 | n2 >>> 31); var te2 = e4[8] ^ h2, re2 = e4[9] ^ p2, ne2 = e4[18] ^ h2, ie2 = e4[19] ^ p2, oe2 = e4[28] ^ h2, ae2 = e4[29] ^ p2, se2 = e4[38] ^ h2, ue2 = e4[39] ^ p2, ce2 = e4[48] ^ h2, fe2 = e4[49] ^ p2, de2 = b2, le2 = y2, he2 = m2 << 4 | v2 >>> 28, pe2 = v2 << 4 | m2 >>> 28, be2 = g2 << 3 | w2 >>> 29, ye2 = w2 << 3 | g2 >>> 29, ve2 = _2 << 9 | k2 >>> 23, me2 = k2 << 9 | _2 >>> 23, ge2 = A2 << 18 | E2 >>> 14, we2 = E2 << 18 | A2 >>> 14, ke2 = S2 << 1 | x2 >>> 31, _e2 = x2 << 1 | S2 >>> 31, Ae2 = O2 << 12 | B2 >>> 20, Ee2 = B2 << 12 | O2 >>> 20, Se = P2 << 10 | I2 >>> 22, xe2 = I2 << 10 | P2 >>> 22, Be2 = C2 << 13 | T2 >>> 19, Oe2 = T2 << 13 | C2 >>> 19, Pe2 = M2 << 2 | R2 >>> 30, Ie2 = R2 << 2 | M2 >>> 30, Te2 = N2 << 30 | U2 >>> 2, Ce2 = U2 << 30 | N2 >>> 2, Me2 = j2 << 6 | L2 >>> 26, Re2 = L2 << 6 | j2 >>> 26, Ue2 = D2 << 11 | F2 >>> 21, Ne2 = F2 << 11 | D2 >>> 21, je2 = H2 << 15 | z2 >>> 17, Le2 = z2 << 15 | H2 >>> 17, Fe2 = K2 << 29 | q2 >>> 3, De2 = q2 << 29 | K2 >>> 3, He2 = G2 << 28 | V2 >>> 4, ze2 = V2 << 28 | G2 >>> 4, qe2 = W2 << 23 | Z2 >>> 9, Ke2 = Z2 << 23 | W2 >>> 9, Ge2 = J2 << 25 | Y2 >>> 7, Ve2 = Y2 << 25 | J2 >>> 7, Ze2 = X2 << 21 | Q2 >>> 11, We2 = Q2 << 21 | X2 >>> 11, Je2 = ee2 << 24 | $2 >>> 8, Ye2 = $2 << 24 | ee2 >>> 8, Xe2 = te2 << 27 | re2 >>> 5, Qe2 = re2 << 27 | te2 >>> 5, $e2 = ne2 << 20 | ie2 >>> 12, et2 = ie2 << 20 | ne2 >>> 12, tt2 = ae2 << 7 | oe2 >>> 25, rt2 = oe2 << 7 | ae2 >>> 25, nt2 = se2 << 8 | ue2 >>> 24, it2 = ue2 << 8 | se2 >>> 24, ot2 = ce2 << 14 | fe2 >>> 18, at2 = fe2 << 14 | ce2 >>> 18; e4[0] = de2 ^ ~Ae2 & Ue2, e4[1] = le2 ^ ~Ee2 & Ne2, e4[10] = He2 ^ ~$e2 & be2, e4[11] = ze2 ^ ~et2 & ye2, e4[20] = ke2 ^ ~Me2 & Ge2, e4[21] = _e2 ^ ~Re2 & Ve2, e4[30] = Xe2 ^ ~he2 & Se, e4[31] = Qe2 ^ ~pe2 & xe2, e4[40] = Te2 ^ ~qe2 & tt2, e4[41] = Ce2 ^ ~Ke2 & rt2, e4[2] = Ae2 ^ ~Ue2 & Ze2, e4[3] = Ee2 ^ ~Ne2 & We2, e4[12] = $e2 ^ ~be2 & Be2, e4[13] = et2 ^ ~ye2 & Oe2, e4[22] = Me2 ^ ~Ge2 & nt2, e4[23] = Re2 ^ ~Ve2 & it2, e4[32] = he2 ^ ~Se & je2, e4[33] = pe2 ^ ~xe2 & Le2, e4[42] = qe2 ^ ~tt2 & ve2, e4[43] = Ke2 ^ ~rt2 & me2, e4[4] = Ue2 ^ ~Ze2 & ot2, e4[5] = Ne2 ^ ~We2 & at2, e4[14] = be2 ^ ~Be2 & Fe2, e4[15] = ye2 ^ ~Oe2 & De2, e4[24] = Ge2 ^ ~nt2 & ge2, e4[25] = Ve2 ^ ~it2 & we2, e4[34] = Se ^ ~je2 & Je2, e4[35] = xe2 ^ ~Le2 & Ye2, e4[44] = tt2 ^ ~ve2 & Pe2, e4[45] = rt2 ^ ~me2 & Ie2, e4[6] = Ze2 ^ ~ot2 & de2, e4[7] = We2 ^ ~at2 & le2, e4[16] = Be2 ^ ~Fe2 & He2, e4[17] = Oe2 ^ ~De2 & ze2, e4[26] = nt2 ^ ~ge2 & ke2, e4[27] = it2 ^ ~we2 & _e2, e4[36] = je2 ^ ~Je2 & Xe2, e4[37] = Le2 ^ ~Ye2 & Qe2, e4[46] = ve2 ^ ~Pe2 & Te2, e4[47] = me2 ^ ~Ie2 & Ce2, e4[8] = ot2 ^ ~de2 & Ae2, e4[9] = at2 ^ ~le2 & Ee2, e4[18] = Fe2 ^ ~He2 & $e2, e4[19] = De2 ^ ~ze2 & et2, e4[28] = ge2 ^ ~ke2 & Me2, e4[29] = we2 ^ ~_e2 & Re2, e4[38] = Je2 ^ ~Xe2 & he2, e4[39] = Ye2 ^ ~Qe2 & pe2, e4[48] = Pe2 ^ ~Te2 & qe2, e4[49] = Ie2 ^ ~Ce2 & Ke2, e4[0] ^= r3[2 * t4], e4[1] ^= r3[2 * t4 + 1]; } }; }, 80801: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(25612); function o2() { 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 = false; } o2.prototype.initialize = function(e4, t4) { for (var r4 = 0; r4 < 50; ++r4) this.state[r4] = 0; this.blockSize = e4 / 8, this.count = 0, this.squeezing = false; }, o2.prototype.absorb = function(e4) { for (var t4 = 0; t4 < e4.length; ++t4) this.state[~~(this.count / 4)] ^= e4[t4] << this.count % 4 * 8, this.count += 1, this.count === this.blockSize && (i2.p1600(this.state), this.count = 0); }, o2.prototype.absorbLastFewBits = function(e4) { this.state[~~(this.count / 4)] ^= e4 << this.count % 4 * 8, 0 != (128 & e4) && this.count === this.blockSize - 1 && i2.p1600(this.state), this.state[~~((this.blockSize - 1) / 4)] ^= 128 << (this.blockSize - 1) % 4 * 8, i2.p1600(this.state), this.count = 0, this.squeezing = true; }, o2.prototype.squeeze = function(e4) { this.squeezing || this.absorbLastFewBits(1); for (var t4 = n2.alloc(e4), r4 = 0; r4 < e4; ++r4) t4[r4] = this.state[~~(this.count / 4)] >>> this.count % 4 * 8 & 255, this.count += 1, this.count === this.blockSize && (i2.p1600(this.state), this.count = 0); return t4; }, o2.prototype.copy = function(e4) { for (var t4 = 0; t4 < 50; ++t4) e4.state[t4] = this.state[t4]; e4.blockSize = this.blockSize, e4.count = this.count, e4.squeezing = this.squeezing; }, e3.exports = o2; }, 50807: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(22353), o2 = r3(48850).Buffer, a2 = new Array(16); function s2() { i2.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878; } function u2(e4, t4) { return e4 << t4 | e4 >>> 32 - t4; } function c2(e4, t4, r4, n3, i3, o3, a3) { return u2(e4 + (t4 & r4 | ~t4 & n3) + i3 + o3 | 0, a3) + t4 | 0; } function f2(e4, t4, r4, n3, i3, o3, a3) { return u2(e4 + (t4 & n3 | r4 & ~n3) + i3 + o3 | 0, a3) + t4 | 0; } function d2(e4, t4, r4, n3, i3, o3, a3) { return u2(e4 + (t4 ^ r4 ^ n3) + i3 + o3 | 0, a3) + t4 | 0; } function l2(e4, t4, r4, n3, i3, o3, a3) { return u2(e4 + (r4 ^ (t4 | ~n3)) + i3 + o3 | 0, a3) + t4 | 0; } n2(s2, i2), s2.prototype._update = function() { for (var e4 = a2, t4 = 0; t4 < 16; ++t4) e4[t4] = this._block.readInt32LE(4 * t4); var r4 = this._a, n3 = this._b, i3 = this._c, o3 = this._d; r4 = c2(r4, n3, i3, o3, e4[0], 3614090360, 7), o3 = c2(o3, r4, n3, i3, e4[1], 3905402710, 12), i3 = c2(i3, o3, r4, n3, e4[2], 606105819, 17), n3 = c2(n3, i3, o3, r4, e4[3], 3250441966, 22), r4 = c2(r4, n3, i3, o3, e4[4], 4118548399, 7), o3 = c2(o3, r4, n3, i3, e4[5], 1200080426, 12), i3 = c2(i3, o3, r4, n3, e4[6], 2821735955, 17), n3 = c2(n3, i3, o3, r4, e4[7], 4249261313, 22), r4 = c2(r4, n3, i3, o3, e4[8], 1770035416, 7), o3 = c2(o3, r4, n3, i3, e4[9], 2336552879, 12), i3 = c2(i3, o3, r4, n3, e4[10], 4294925233, 17), n3 = c2(n3, i3, o3, r4, e4[11], 2304563134, 22), r4 = c2(r4, n3, i3, o3, e4[12], 1804603682, 7), o3 = c2(o3, r4, n3, i3, e4[13], 4254626195, 12), i3 = c2(i3, o3, r4, n3, e4[14], 2792965006, 17), r4 = f2(r4, n3 = c2(n3, i3, o3, r4, e4[15], 1236535329, 22), i3, o3, e4[1], 4129170786, 5), o3 = f2(o3, r4, n3, i3, e4[6], 3225465664, 9), i3 = f2(i3, o3, r4, n3, e4[11], 643717713, 14), n3 = f2(n3, i3, o3, r4, e4[0], 3921069994, 20), r4 = f2(r4, n3, i3, o3, e4[5], 3593408605, 5), o3 = f2(o3, r4, n3, i3, e4[10], 38016083, 9), i3 = f2(i3, o3, r4, n3, e4[15], 3634488961, 14), n3 = f2(n3, i3, o3, r4, e4[4], 3889429448, 20), r4 = f2(r4, n3, i3, o3, e4[9], 568446438, 5), o3 = f2(o3, r4, n3, i3, e4[14], 3275163606, 9), i3 = f2(i3, o3, r4, n3, e4[3], 4107603335, 14), n3 = f2(n3, i3, o3, r4, e4[8], 1163531501, 20), r4 = f2(r4, n3, i3, o3, e4[13], 2850285829, 5), o3 = f2(o3, r4, n3, i3, e4[2], 4243563512, 9), i3 = f2(i3, o3, r4, n3, e4[7], 1735328473, 14), r4 = d2(r4, n3 = f2(n3, i3, o3, r4, e4[12], 2368359562, 20), i3, o3, e4[5], 4294588738, 4), o3 = d2(o3, r4, n3, i3, e4[8], 2272392833, 11), i3 = d2(i3, o3, r4, n3, e4[11], 1839030562, 16), n3 = d2(n3, i3, o3, r4, e4[14], 4259657740, 23), r4 = d2(r4, n3, i3, o3, e4[1], 2763975236, 4), o3 = d2(o3, r4, n3, i3, e4[4], 1272893353, 11), i3 = d2(i3, o3, r4, n3, e4[7], 4139469664, 16), n3 = d2(n3, i3, o3, r4, e4[10], 3200236656, 23), r4 = d2(r4, n3, i3, o3, e4[13], 681279174, 4), o3 = d2(o3, r4, n3, i3, e4[0], 3936430074, 11), i3 = d2(i3, o3, r4, n3, e4[3], 3572445317, 16), n3 = d2(n3, i3, o3, r4, e4[6], 76029189, 23), r4 = d2(r4, n3, i3, o3, e4[9], 3654602809, 4), o3 = d2(o3, r4, n3, i3, e4[12], 3873151461, 11), i3 = d2(i3, o3, r4, n3, e4[15], 530742520, 16), r4 = l2(r4, n3 = d2(n3, i3, o3, r4, e4[2], 3299628645, 23), i3, o3, e4[0], 4096336452, 6), o3 = l2(o3, r4, n3, i3, e4[7], 1126891415, 10), i3 = l2(i3, o3, r4, n3, e4[14], 2878612391, 15), n3 = l2(n3, i3, o3, r4, e4[5], 4237533241, 21), r4 = l2(r4, n3, i3, o3, e4[12], 1700485571, 6), o3 = l2(o3, r4, n3, i3, e4[3], 2399980690, 10), i3 = l2(i3, o3, r4, n3, e4[10], 4293915773, 15), n3 = l2(n3, i3, o3, r4, e4[1], 2240044497, 21), r4 = l2(r4, n3, i3, o3, e4[8], 1873313359, 6), o3 = l2(o3, r4, n3, i3, e4[15], 4264355552, 10), i3 = l2(i3, o3, r4, n3, e4[6], 2734768916, 15), n3 = l2(n3, i3, o3, r4, e4[13], 1309151649, 21), r4 = l2(r4, n3, i3, o3, e4[4], 4149444226, 6), o3 = l2(o3, r4, n3, i3, e4[11], 3174756917, 10), i3 = l2(i3, o3, r4, n3, e4[2], 718787259, 15), n3 = l2(n3, i3, o3, r4, e4[9], 3951481745, 21), this._a = this._a + r4 | 0, this._b = this._b + n3 | 0, this._c = this._c + i3 | 0, this._d = this._d + o3 | 0; }, s2.prototype._digest = function() { this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update(); var e4 = o2.allocUnsafe(16); return e4.writeInt32LE(this._a, 0), e4.writeInt32LE(this._b, 4), e4.writeInt32LE(this._c, 8), e4.writeInt32LE(this._d, 12), e4; }, e3.exports = s2; }, 37441: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(19142), o2 = r3(28847), a2 = o2(r3(82247)), s2 = o2(r3(3355)), u2 = o2(r3(94571)), c2 = o2(r3(90775)), f2 = o2(r3(58985)), d2 = o2(r3(69721)), l2 = o2(r3(15163)), h2 = o2(r3(34650)), p2 = o2(r3(21949)), b2 = o2(r3(22940)); function y2(e4, t4) { var r4 = Object.keys(e4); if (Object.getOwnPropertySymbols) { var n3 = Object.getOwnPropertySymbols(e4); t4 && (n3 = n3.filter(function(t5) { return Object.getOwnPropertyDescriptor(e4, t5).enumerable; })), r4.push.apply(r4, n3); } return r4; } function v2(e4) { for (var t4 = 1; t4 < arguments.length; t4++) { var r4 = null != arguments[t4] ? arguments[t4] : {}; t4 % 2 ? y2(Object(r4), true).forEach(function(t5) { (0, c2.default)(e4, t5, r4[t5]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(r4)) : y2(Object(r4)).forEach(function(t5) { Object.defineProperty(e4, t5, Object.getOwnPropertyDescriptor(r4, t5)); }); } return e4; } function m2(e4) { var t4 = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e5) { return false; } }(); return function() { var r4, n3 = (0, p2.default)(e4); if (t4) { var i3 = (0, p2.default)(this).constructor; r4 = Reflect.construct(n3, arguments, i3); } else r4 = n3.apply(this, arguments); return (0, h2.default)(this, r4); }; } function g2(e4) { var t4, r4, n3, i3 = 2; for ("undefined" != typeof Symbol && (r4 = Symbol.asyncIterator, n3 = Symbol.iterator); i3--; ) { if (r4 && null != (t4 = e4[r4])) return t4.call(e4); if (n3 && null != (t4 = e4[n3])) return new w2(t4.call(e4)); r4 = "@@asyncIterator", n3 = "@@iterator"; } throw new TypeError("Object is not async iterable"); } function w2(e4) { function t4(e5) { if (Object(e5) !== e5) return Promise.reject(new TypeError(e5 + " is not an object.")); var t5 = e5.done; return Promise.resolve(e5.value).then(function(e6) { return { value: e6, done: t5 }; }); } return w2 = function(e5) { this.s = e5, this.n = e5.next; }, w2.prototype = { s: null, n: null, next: function() { return t4(this.n.apply(this.s, arguments)); }, return: function(e5) { var r4 = this.s.return; return void 0 === r4 ? Promise.resolve({ value: e5, done: true }) : t4(r4.apply(this.s, arguments)); }, throw: function(e5) { var r4 = this.s.return; return void 0 === r4 ? Promise.reject(e5) : t4(r4.apply(this.s, arguments)); } }, new w2(e4); } Object.defineProperty(t3, "__esModule", { value: true }), t3.InvalidStatusCodeError = t3.InvalidCertError = void 0; var k2 = Object.freeze({ redirect: true, expectStatusCode: 200, headers: {}, full: false, keepAlive: true, cors: false, referrer: false, sslAllowSelfSigned: false, _redirectCount: 0 }), _2 = function(e4) { (0, l2.default)(r4, e4); var t4 = m2(r4); function r4(e5, n3) { var i3; return (0, d2.default)(this, r4), (i3 = t4.call(this, e5)).fingerprint256 = n3, i3; } return (0, f2.default)(r4); }((0, b2.default)(Error)); t3.InvalidCertError = _2; var A2 = function(e4) { (0, l2.default)(r4, e4); var t4 = m2(r4); function r4(e5) { var n3; return (0, d2.default)(this, r4), (n3 = t4.call(this, "Request Failed. Status Code: ".concat(e5))).statusCode = e5, n3; } return (0, f2.default)(r4); }((0, b2.default)(Error)); function E2(e4, t4) { if (!t4 || "text" === t4 || "json" === t4) try { var r4 = new TextDecoder("utf8", { fatal: true }).decode(e4); if ("text" === t4) return r4; try { return JSON.parse(r4); } catch (e5) { if ("json" === t4) throw e5; return r4; } } catch (e5) { if ("text" === t4 || "json" === t4) throw e5; } return e4; } t3.InvalidStatusCodeError = A2; var S2 = {}; function x2(e4, t4) { var i3 = v2(v2({}, k2), t4), o3 = r3(29519), s3 = r3(90912), c3 = r3(77611), f3 = r3(45058).promisify, d3 = r3(51143).resolve, l3 = !!/^https/.test(e4), h3 = { method: i3.method || "GET", headers: { "Accept-Encoding": "gzip, deflate, br" } }, p3 = function(e5) { return e5.replace(/:| /g, "").toLowerCase(); }; if (i3.keepAlive) { var b3, y3 = [l3, l3 && (null === (b3 = i3.sslPinnedCertificates) || void 0 === b3 ? void 0 : b3.map(function(e5) { return p3(e5); }).sort())].join(); h3.agent = S2[y3] || (S2[y3] = new (l3 ? s3 : o3).Agent({ keepAlive: true, keepAliveMsecs: 3e4, maxFreeSockets: 1024, maxCachedSessions: 1024 })); } "json" === i3.type && (h3.headers["Content-Type"] = "application/json"), i3.data && (i3.method || (h3.method = "POST"), h3.body = "json" === i3.type ? JSON.stringify(i3.data) : i3.data), h3.headers = v2(v2({}, h3.headers), i3.headers), i3.sslAllowSelfSigned && (h3.rejectUnauthorized = false); var m3 = function() { var t5 = (0, u2.default)(a2.default.mark(function t6(r4) { var o4, s4, u3, l4, h4, p4, b4, y4, v3, m4, w3; return a2.default.wrap(function(t7) { for (; ; ) switch (t7.prev = t7.next) { case 0: if (o4 = r4.statusCode, !(i3.redirect && 300 <= o4 && o4 < 400 && r4.headers.location)) { t7.next = 8; break; } if (10 != i3._redirectCount) { t7.next = 4; break; } throw new Error("Request failed. Too much redirects."); case 4: return i3._redirectCount += 1, t7.next = 7, x2(d3(e4, r4.headers.location), i3); case 7: return t7.abrupt("return", t7.sent); case 8: if (!i3.expectStatusCode || o4 === i3.expectStatusCode) { t7.next = 11; break; } throw r4.resume(), new A2(o4); case 11: s4 = [], u3 = false, l4 = false, t7.prev = 14, p4 = g2(r4); case 16: return t7.next = 18, p4.next(); case 18: if (!(u3 = !(b4 = t7.sent).done)) { t7.next = 24; break; } y4 = b4.value, s4.push(y4); case 21: u3 = false, t7.next = 16; break; case 24: t7.next = 30; break; case 26: t7.prev = 26, t7.t0 = t7.catch(14), l4 = true, h4 = t7.t0; case 30: if (t7.prev = 30, t7.prev = 31, !u3 || null == p4.return) { t7.next = 35; break; } return t7.next = 35, p4.return(); case 35: if (t7.prev = 35, !l4) { t7.next = 38; break; } throw h4; case 38: return t7.finish(35); case 39: return t7.finish(30); case 40: if (v3 = n2.concat(s4), "br" !== (m4 = r4.headers["content-encoding"])) { t7.next = 46; break; } return t7.next = 45, f3(c3.brotliDecompress)(v3); case 45: v3 = t7.sent; case 46: if ("gzip" !== m4 && "deflate" !== m4) { t7.next = 50; break; } return t7.next = 49, f3(c3.unzip)(v3); case 49: v3 = t7.sent; case 50: if (w3 = E2(v3, i3.type), !i3.full) { t7.next = 53; break; } return t7.abrupt("return", { headers: r4.headers, status: o4, body: w3 }); case 53: return t7.abrupt("return", w3); case 54: case "end": return t7.stop(); } }, t6, null, [[14, 26, 30, 40], [31, , 35, 39]]); })); return function(e5) { return t5.apply(this, arguments); }; }(); return new Promise(function(t5, r4) { var n3, c4 = function() { var t6 = (0, u2.default)(a2.default.mark(function t7(n4) { return a2.default.wrap(function(t8) { for (; ; ) switch (t8.prev = t8.next) { case 0: if (!n4 || "DEPTH_ZERO_SELF_SIGNED_CERT" !== n4.code) { t8.next = 9; break; } return t8.prev = 1, t8.next = 4, x2(e4, v2(v2({}, i3), {}, { sslAllowSelfSigned: true, sslPinnedCertificates: [] })); case 4: t8.next = 9; break; case 6: t8.prev = 6, t8.t0 = t8.catch(1), t8.t0 && t8.t0.fingerprint256 && (n4 = new _2("Self-signed SSL certificate: ".concat(t8.t0.fingerprint256), t8.t0.fingerprint256)); case 9: r4(n4); case 10: case "end": return t8.stop(); } }, t7, null, [[1, 6]]); })); return function(e5) { return t6.apply(this, arguments); }; }(), f4 = (l3 ? s3 : o3).request(e4, h3, function(e5) { e5.on("error", c4), (0, u2.default)(a2.default.mark(function n4() { return a2.default.wrap(function(n5) { for (; ; ) switch (n5.prev = n5.next) { case 0: return n5.prev = 0, n5.t0 = t5, n5.next = 4, m3(e5); case 4: n5.t1 = n5.sent, (0, n5.t0)(n5.t1), n5.next = 11; break; case 8: n5.prev = 8, n5.t2 = n5.catch(0), r4(n5.t2); case 11: case "end": return n5.stop(); } }, n4, null, [[0, 8]]); }))(); }); f4.on("error", c4); var d4 = null === (n3 = i3.sslPinnedCertificates) || void 0 === n3 ? void 0 : n3.map(function(e5) { return p3(e5); }), b4 = function(e5) { var t6, r5 = p3((null === (t6 = e5.getPeerCertificate()) || void 0 === t6 ? void 0 : t6.fingerprint256) || ""); if ((r5 || !e5.isSessionReused()) && !d4.includes(r5)) return f4.emit("error", new _2("Invalid SSL certificate: ".concat(r5, " Expected: ").concat(d4), r5)), f4.abort(); }; i3.sslPinnedCertificates && f4.on("socket", function(e5) { e5.listeners("secureConnect").map(function(e6) { return (e6.name || "").replace("bound ", ""); }).includes("mfetchSecureConnect") || e5.on("secureConnect", b4.bind(null, e5)); }), i3.keepAlive && f4.setNoDelay(true), h3.body && f4.write(h3.body), f4.end(); }); } var B2 = new Set(["Accept", "Accept-Language", "Content-Language", "Content-Type"].map(function(e4) { return e4.toLowerCase(); })), O2 = new Set(["Accept-Charset", "Accept-Encoding", "Access-Control-Request-Headers", "Access-Control-Request-Method", "Connection", "Content-Length", "Cookie", "Cookie2", "Date", "DNT", "Expect", "Host", "Keep-Alive", "Origin", "Referer", "TE", "Trailer", "Transfer-Encoding", "Upgrade", "Via"].map(function(e4) { return e4.toLowerCase(); })); function P2(e4, t4) { return I2.apply(this, arguments); } function I2() { return (I2 = (0, u2.default)(a2.default.mark(function e4(t4, r4) { var n3, i3, o3, s3, u3, c3, f3, d3, l3; return a2.default.wrap(function(e5) { for (; ; ) switch (e5.prev = e5.next) { case 0: for (u3 in n3 = v2(v2({}, k2), r4), i3 = new Headers(), "json" === n3.type && i3.set("Content-Type", "application/json"), (o3 = new URL(t4)).username && (s3 = btoa("".concat(o3.username, ":").concat(o3.password)), i3.set("Authorization", "Basic ".concat(s3)), o3.username = "", o3.password = ""), t4 = "" + o3, n3.headers) c3 = u3.toLowerCase(), (B2.has(c3) || n3.cors && !O2.has(c3)) && i3.set(u3, n3.headers[u3]); return f3 = { headers: i3, redirect: n3.redirect ? "follow" : "manual" }, n3.referrer || (f3.referrerPolicy = "no-referrer"), n3.cors && (f3.mode = "cors"), n3.data && (n3.method || (f3.method = "POST"), f3.body = "json" === n3.type ? JSON.stringify(n3.data) : n3.data), e5.next = 13, fetch(t4, f3); case 13: if (d3 = e5.sent, !n3.expectStatusCode || d3.status === n3.expectStatusCode) { e5.next = 16; break; } throw new A2(d3.status); case 16: return e5.t0 = E2, e5.t1 = Uint8Array, e5.next = 20, d3.arrayBuffer(); case 20: if (e5.t2 = e5.sent, e5.t3 = new e5.t1(e5.t2), e5.t4 = n3.type, l3 = (0, e5.t0)(e5.t3, e5.t4), !n3.full) { e5.next = 26; break; } return e5.abrupt("return", { headers: Object.fromEntries(d3.headers.entries()), status: d3.status, body: l3 }); case 26: return e5.abrupt("return", l3); case 27: case "end": return e5.stop(); } }, e4); }))).apply(this, arguments); } var T2 = !!("object" == (void 0 === i2 ? "undefined" : (0, s2.default)(i2)) && i2.versions && i2.versions.node && i2.versions.v8); t3.default = function(e4, t4) { return (T2 ? x2 : P2)(e4, t4); }; }, 31962: (e3, t3, r3) => { var n2 = r3(31734), i2 = r3(82202); function o2(e4) { this.rand = e4 || new i2.Rand(); } e3.exports = o2, o2.create = function(e4) { return new o2(e4); }, o2.prototype._randbelow = function(e4) { var t4 = e4.bitLength(), r4 = Math.ceil(t4 / 8); do { var i3 = new n2(this.rand.generate(r4)); } while (i3.cmp(e4) >= 0); return i3; }, o2.prototype._randrange = function(e4, t4) { var r4 = t4.sub(e4); return e4.add(this._randbelow(r4)); }, o2.prototype.test = function(e4, t4, r4) { var i3 = e4.bitLength(), o3 = n2.mont(e4), a2 = new n2(1).toRed(o3); t4 || (t4 = Math.max(1, i3 / 48 | 0)); for (var s2 = e4.subn(1), u2 = 0; !s2.testn(u2); u2++) ; for (var c2 = e4.shrn(u2), f2 = s2.toRed(o3); t4 > 0; t4--) { var d2 = this._randrange(new n2(2), s2); r4 && r4(d2); var l2 = d2.toRed(o3).redPow(c2); if (0 !== l2.cmp(a2) && 0 !== l2.cmp(f2)) { for (var h2 = 1; h2 < u2; h2++) { if (0 === (l2 = l2.redSqr()).cmp(a2)) return false; if (0 === l2.cmp(f2)) break; } if (h2 === u2) return false; } } return true; }, o2.prototype.getDivisor = function(e4, t4) { var r4 = e4.bitLength(), i3 = n2.mont(e4), o3 = new n2(1).toRed(i3); t4 || (t4 = Math.max(1, r4 / 48 | 0)); for (var a2 = e4.subn(1), s2 = 0; !a2.testn(s2); s2++) ; for (var u2 = e4.shrn(s2), c2 = a2.toRed(i3); t4 > 0; t4--) { var f2 = this._randrange(new n2(2), a2), d2 = e4.gcd(f2); if (0 !== d2.cmpn(1)) return d2; var l2 = f2.toRed(i3).redPow(u2); if (0 !== l2.cmp(o3) && 0 !== l2.cmp(c2)) { for (var h2 = 1; h2 < s2; h2++) { if (0 === (l2 = l2.redSqr()).cmp(o3)) return l2.fromRed().subn(1).gcd(e4); if (0 === l2.cmp(c2)) break; } if (h2 === s2) return (l2 = l2.redSqr()).fromRed().subn(1).gcd(e4); } } return false; }; }, 94504: (e3) => { function t3(e4, t4) { if (!e4) throw new Error(t4 || "Assertion failed"); } e3.exports = t3, t3.equal = function(e4, t4, r3) { if (e4 != t4) throw new Error(r3 || "Assertion failed: " + e4 + " != " + t4); }; }, 96580: (e3, t3) => { var r3 = t3; function n2(e4) { return 1 === e4.length ? "0" + e4 : e4; } function i2(e4) { for (var t4 = "", r4 = 0; r4 < e4.length; r4++) t4 += n2(e4[r4].toString(16)); return t4; } r3.toArray = function(e4, t4) { if (Array.isArray(e4)) return e4.slice(); if (!e4) return []; var r4 = []; if ("string" != typeof e4) { for (var n3 = 0; n3 < e4.length; n3++) r4[n3] = 0 | e4[n3]; return r4; } if ("hex" === t4) for ((e4 = e4.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (e4 = "0" + e4), n3 = 0; n3 < e4.length; n3 += 2) r4.push(parseInt(e4[n3] + e4[n3 + 1], 16)); else for (n3 = 0; n3 < e4.length; n3++) { var i3 = e4.charCodeAt(n3), o2 = i3 >> 8, a2 = 255 & i3; o2 ? r4.push(o2, a2) : r4.push(a2); } return r4; }, r3.zero2 = n2, r3.toHex = i2, r3.encode = function(e4, t4) { return "hex" === t4 ? i2(e4) : e4; }; }, 36565: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = function() { function e4(t4, r4, n3, o3) { (0, i2.default)(this, e4), this.name = t4, this.code = r4, this.alphabet = o3, n3 && o3 && (this.engine = n3(o3)); } return (0, o2.default)(e4, [{ key: "encode", value: function(e5) { return this.engine.encode(e5); } }, { key: "decode", value: function(e5) { return this.engine.decode(e5); } }, { key: "isImplemented", value: function() { return this.engine; } }]), e4; }(); e3.exports = a2; }, 52642: (e3, t3, r3) => { function n2(e4, t4) { (null == t4 || t4 > e4.length) && (t4 = e4.length); for (var r4 = 0, n3 = new Array(t4); r4 < t4; r4++) n3[r4] = e4[r4]; return n3; } var i2 = r3(29033).Buffer; e3.exports = function(e4) { return { encode: function(e5) { return "string" == typeof e5 ? i2.from(e5).toString("hex") : e5.toString("hex"); }, decode: function(t4) { var r4, o2 = function(e5, t5) { var r5 = "undefined" != typeof Symbol && e5[Symbol.iterator] || e5["@@iterator"]; if (!r5) { if (Array.isArray(e5) || (r5 = function(e6, t6) { if (e6) { if ("string" == typeof e6) return n2(e6, t6); var r6 = Object.prototype.toString.call(e6).slice(8, -1); return "Object" === r6 && e6.constructor && (r6 = e6.constructor.name), "Map" === r6 || "Set" === r6 ? Array.from(e6) : "Arguments" === r6 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r6) ? n2(e6, t6) : void 0; } }(e5)) || t5 && e5 && "number" == typeof e5.length) { r5 && (e5 = r5); var i3 = 0, o3 = function() { }; return { s: o3, n: function() { return i3 >= e5.length ? { done: true } : { done: false, value: e5[i3++] }; }, e: function(e6) { throw e6; }, f: o3 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var a3, s2 = true, u2 = false; return { s: function() { r5 = r5.call(e5); }, n: function() { var e6 = r5.next(); return s2 = e6.done, e6; }, e: function(e6) { u2 = true, a3 = e6; }, f: function() { try { s2 || null == r5.return || r5.return(); } finally { if (u2) throw a3; } } }; }(t4); try { for (o2.s(); !(r4 = o2.n()).done; ) { var a2 = r4.value; if (e4.indexOf(a2) < 0) throw new Error("invalid base16 character"); } } catch (e5) { o2.e(e5); } finally { o2.f(); } return i2.from(t4, "hex"); } }; }; }, 96494: (e3) => { function t3(e4, t4) { (null == t4 || t4 > e4.length) && (t4 = e4.length); for (var r3 = 0, n2 = new Array(t4); r3 < t4; r3++) n2[r3] = e4[r3]; return n2; } e3.exports = function(e4) { return { encode: function(t4) { return function(e5, t5) { var r3 = e5.byteLength, n2 = new Uint8Array(e5), i2 = t5.indexOf("=") === t5.length - 1; i2 && (t5 = t5.substring(0, t5.length - 1)); for (var o2 = 0, a2 = 0, s2 = "", u2 = 0; u2 < r3; u2++) for (a2 = a2 << 8 | n2[u2], o2 += 8; o2 >= 5; ) s2 += t5[a2 >>> o2 - 5 & 31], o2 -= 5; if (o2 > 0 && (s2 += t5[a2 << 5 - o2 & 31]), i2) for (; s2.length % 8 != 0; ) s2 += "="; return s2; }("string" == typeof t4 ? Uint8Array.from(t4) : t4, e4); }, decode: function(r3) { var n2, i2 = function(e5, r4) { var n3 = "undefined" != typeof Symbol && e5[Symbol.iterator] || e5["@@iterator"]; if (!n3) { if (Array.isArray(e5) || (n3 = function(e6, r5) { if (e6) { if ("string" == typeof e6) return t3(e6, r5); var n4 = Object.prototype.toString.call(e6).slice(8, -1); return "Object" === n4 && e6.constructor && (n4 = e6.constructor.name), "Map" === n4 || "Set" === n4 ? Array.from(e6) : "Arguments" === n4 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4) ? t3(e6, r5) : void 0; } }(e5)) || r4 && e5 && "number" == typeof e5.length) { n3 && (e5 = n3); var i3 = 0, o3 = function() { }; return { s: o3, n: function() { return i3 >= e5.length ? { done: true } : { done: false, value: e5[i3++] }; }, e: function(e6) { throw e6; }, f: o3 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var a2, s2 = true, u2 = false; return { s: function() { n3 = n3.call(e5); }, n: function() { var e6 = n3.next(); return s2 = e6.done, e6; }, e: function(e6) { u2 = true, a2 = e6; }, f: function() { try { s2 || null == n3.return || n3.return(); } finally { if (u2) throw a2; } } }; }(r3); try { for (i2.s(); !(n2 = i2.n()).done; ) { var o2 = n2.value; if (e4.indexOf(o2) < 0) throw new Error("invalid base32 character"); } } catch (e5) { i2.e(e5); } finally { i2.f(); } return function(e5, t4) { for (var r4 = (e5 = e5.replace(new RegExp("=", "g"), "")).length, n3 = 0, i3 = 0, o3 = 0, a2 = new Uint8Array(5 * r4 / 8 | 0), s2 = 0; s2 < r4; s2++) i3 = i3 << 5 | t4.indexOf(e5[s2]), (n3 += 5) >= 8 && (a2[o3++] = i3 >>> n3 - 8 & 255, n3 -= 8); return a2.buffer; }(r3, e4); } }; }; }, 76627: (e3, t3, r3) => { function n2(e4, t4) { (null == t4 || t4 > e4.length) && (t4 = e4.length); for (var r4 = 0, n3 = new Array(t4); r4 < t4; r4++) n3[r4] = e4[r4]; return n3; } var i2 = r3(29033).Buffer; e3.exports = function(e4) { var t4 = e4.indexOf("=") > -1, r4 = e4.indexOf("-") > -1 && e4.indexOf("_") > -1; return { encode: function(e5) { var n3 = ""; n3 = "string" == typeof e5 ? i2.from(e5).toString("base64") : e5.toString("base64"), r4 && (n3 = n3.replace(/\+/g, "-").replace(/\//g, "_")); var o2 = n3.indexOf("="); return o2 > 0 && !t4 && (n3 = n3.substring(0, o2)), n3; }, decode: function(t5) { var r5, o2 = function(e5, t6) { var r6 = "undefined" != typeof Symbol && e5[Symbol.iterator] || e5["@@iterator"]; if (!r6) { if (Array.isArray(e5) || (r6 = function(e6, t7) { if (e6) { if ("string" == typeof e6) return n2(e6, t7); var r7 = Object.prototype.toString.call(e6).slice(8, -1); return "Object" === r7 && e6.constructor && (r7 = e6.constructor.name), "Map" === r7 || "Set" === r7 ? Array.from(e6) : "Arguments" === r7 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r7) ? n2(e6, t7) : void 0; } }(e5)) || t6 && e5 && "number" == typeof e5.length) { r6 && (e5 = r6); var i3 = 0, o3 = function() { }; return { s: o3, n: function() { return i3 >= e5.length ? { done: true } : { done: false, value: e5[i3++] }; }, e: function(e6) { throw e6; }, f: o3 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var a3, s2 = true, u2 = false; return { s: function() { r6 = r6.call(e5); }, n: function() { var e6 = r6.next(); return s2 = e6.done, e6; }, e: function(e6) { u2 = true, a3 = e6; }, f: function() { try { s2 || null == r6.return || r6.return(); } finally { if (u2) throw a3; } } }; }(t5); try { for (o2.s(); !(r5 = o2.n()).done; ) { var a2 = r5.value; if (e4.indexOf(a2) < 0) throw new Error("invalid base64 character"); } } catch (e5) { o2.e(e5); } finally { o2.f(); } return i2.from(t5, "base64"); } }; }; }, 7905: (e3, t3, r3) => { var n2 = r3(36565), i2 = r3(27548), o2 = r3(52642), a2 = r3(96494), s2 = r3(76627), u2 = [["base1", "1", "", "1"], ["base2", "0", i2, "01"], ["base8", "7", i2, "01234567"], ["base10", "9", i2, "0123456789"], ["base16", "f", o2, "0123456789abcdef"], ["base32", "b", a2, "abcdefghijklmnopqrstuvwxyz234567"], ["base32pad", "c", a2, "abcdefghijklmnopqrstuvwxyz234567="], ["base32hex", "v", a2, "0123456789abcdefghijklmnopqrstuv"], ["base32hexpad", "t", a2, "0123456789abcdefghijklmnopqrstuv="], ["base32z", "h", a2, "ybndrfg8ejkmcpqxot1uwisza345h769"], ["base58flickr", "Z", i2, "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"], ["base58btc", "z", i2, "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"], ["base64", "m", s2, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"], ["base64pad", "M", s2, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="], ["base64url", "u", s2, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"], ["base64urlpad", "U", s2, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]], c2 = u2.reduce(function(e4, t4) { return e4[t4[0]] = new n2(t4[0], t4[1], t4[2], t4[3]), e4; }, {}), f2 = u2.reduce(function(e4, t4) { return e4[t4[1]] = c2[t4[0]], e4; }, {}); e3.exports = { names: c2, codes: f2 }; }, 6086: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(7905); (t3 = e3.exports = a2).encode = function(e4, t4) { var r4 = s2(e4); return a2(r4.name, n2.from(r4.encode(t4))); }, t3.decode = function(e4) { n2.isBuffer(e4) && (e4 = e4.toString()); var t4 = e4.substring(0, 1); "string" == typeof (e4 = e4.substring(1, e4.length)) && (e4 = n2.from(e4)); var r4 = s2(t4); return n2.from(r4.decode(e4.toString())); }, t3.isEncoded = function(e4) { if (n2.isBuffer(e4) && (e4 = e4.toString()), "[object String]" !== Object.prototype.toString.call(e4)) return false; var t4 = e4.substring(0, 1); try { return s2(t4).name; } catch (e5) { return false; } }, t3.names = Object.freeze(Object.keys(i2.names)), t3.codes = Object.freeze(Object.keys(i2.codes)); var o2 = new Error("Unsupported encoding"); function a2(e4, t4) { if (!t4) throw new Error("requires an encoded buffer"); var r4 = s2(e4), i3 = n2.from(r4.code); return function(e5, t5) { s2(e5).decode(t5.toString()); }(r4.name, t4), n2.concat([i3, t4]); } function s2(e4) { var t4; if (i2.names[e4]) t4 = i2.names[e4]; else { if (!i2.codes[e4]) throw o2; t4 = i2.codes[e4]; } if (!t4.isImplemented()) throw new Error("Base " + e4 + " is not implemented yet"); return t4; } }, 54093: (e3, t3, r3) => { for (var n2 = r3(28847)(r3(74519)), i2 = r3(24070), o2 = {}, a2 = 0, s2 = Object.entries(i2); a2 < s2.length; a2++) { var u2 = (0, n2.default)(s2[a2], 2), c2 = u2[0], f2 = u2[1]; o2[c2.toUpperCase().replace(/-/g, "_")] = f2; } e3.exports = Object.freeze(o2); }, 69206: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(26657), o2 = r3(7054), a2 = r3(86002), s2 = r3(55576); (t3 = e3.exports).addPrefix = function(e4, t4) { var r4; if (n2.isBuffer(e4)) r4 = s2.varintBufferEncode(e4); else { if (!a2[e4]) throw new Error("multicodec not recognized"); r4 = a2[e4]; } return n2.concat([r4, t4]); }, t3.rmPrefix = function(e4) { return i2.decode(e4), e4.slice(i2.decode.bytes); }, t3.getCodec = function(e4) { var t4 = i2.decode(e4), r4 = o2.get(t4); if (void 0 === r4) throw new Error("Code ".concat(t4, " not found")); return r4; }, t3.getName = function(e4) { return o2.get(e4); }, t3.getNumber = function(e4) { var t4 = a2[e4]; if (void 0 === t4) throw new Error("Codec `" + e4 + "` not found"); return s2.varintBufferDecode(t4)[0]; }, t3.getCode = function(e4) { return i2.decode(e4); }, t3.getCodeVarint = function(e4) { var t4 = a2[e4]; if (void 0 === t4) throw new Error("Codec `" + e4 + "` not found"); return t4; }, t3.getVarint = function(e4) { return i2.encode(e4); }; var u2 = r3(54093); Object.assign(t3, u2), t3.print = r3(11032); }, 7054: (e3, t3, r3) => { var n2 = r3(24070), i2 = /* @__PURE__ */ new Map(); for (var o2 in n2) { var a2 = n2[o2]; i2.set(a2, o2); } e3.exports = Object.freeze(i2); }, 11032: (e3, t3, r3) => { for (var n2 = r3(28847)(r3(74519)), i2 = r3(24070), o2 = {}, a2 = 0, s2 = Object.entries(i2); a2 < s2.length; a2++) { var u2 = (0, n2.default)(s2[a2], 2), c2 = u2[0], f2 = u2[1]; void 0 === o2[f2] && (o2[f2] = c2); } e3.exports = Object.freeze(o2); }, 55576: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(26657); function o2(e4) { return parseInt(e4.toString("hex"), 16); } function a2(e4) { var t4 = e4.toString(16); return t4.length % 2 == 1 && (t4 = "0" + t4), n2.from(t4, "hex"); } e3.exports = { numberToBuffer: a2, bufferToNumber: o2, varintBufferEncode: function(e4) { return n2.from(i2.encode(o2(e4))); }, varintBufferDecode: function(e4) { return a2(i2.decode(e4)); }, varintEncode: function(e4) { return n2.from(i2.encode(e4)); } }; }, 86002: (e3, t3, r3) => { var n2 = r3(24070), i2 = r3(55576).varintEncode, o2 = {}; for (var a2 in n2) { var s2 = n2[a2]; o2[a2] = i2(s2); } e3.exports = Object.freeze(o2); }, 71786: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = function() { function e4(t4, r4, n3, o3) { (0, i2.default)(this, e4), this.name = t4, this.code = r4, this.alphabet = o3, n3 && o3 && (this.engine = n3(o3)); } return (0, o2.default)(e4, [{ key: "encode", value: function(e5) { return this.engine.encode(e5); } }, { key: "decode", value: function(e5) { return this.engine.decode(e5); } }, { key: "isImplemented", value: function() { return this.engine; } }]), e4; }(); e3.exports = a2; }, 37739: (e3, t3, r3) => { function n2(e4, t4) { (null == t4 || t4 > e4.length) && (t4 = e4.length); for (var r4 = 0, n3 = new Array(t4); r4 < t4; r4++) n3[r4] = e4[r4]; return n3; } var i2 = r3(29033).Buffer; e3.exports = function(e4) { return { encode: function(e5) { return "string" == typeof e5 ? i2.from(e5).toString("hex") : e5.toString("hex"); }, decode: function(t4) { var r4, o2 = function(e5, t5) { var r5 = "undefined" != typeof Symbol && e5[Symbol.iterator] || e5["@@iterator"]; if (!r5) { if (Array.isArray(e5) || (r5 = function(e6, t6) { if (e6) { if ("string" == typeof e6) return n2(e6, t6); var r6 = Object.prototype.toString.call(e6).slice(8, -1); return "Object" === r6 && e6.constructor && (r6 = e6.constructor.name), "Map" === r6 || "Set" === r6 ? Array.from(e6) : "Arguments" === r6 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r6) ? n2(e6, t6) : void 0; } }(e5)) || t5 && e5 && "number" == typeof e5.length) { r5 && (e5 = r5); var i3 = 0, o3 = function() { }; return { s: o3, n: function() { return i3 >= e5.length ? { done: true } : { done: false, value: e5[i3++] }; }, e: function(e6) { throw e6; }, f: o3 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var a3, s2 = true, u2 = false; return { s: function() { r5 = r5.call(e5); }, n: function() { var e6 = r5.next(); return s2 = e6.done, e6; }, e: function(e6) { u2 = true, a3 = e6; }, f: function() { try { s2 || null == r5.return || r5.return(); } finally { if (u2) throw a3; } } }; }(t4); try { for (o2.s(); !(r4 = o2.n()).done; ) { var a2 = r4.value; if (e4.indexOf(a2) < 0) throw new Error("invalid base16 character"); } } catch (e5) { o2.e(e5); } finally { o2.f(); } return i2.from(t4, "hex"); } }; }; }, 70976: (e3) => { function t3(e4, t4) { (null == t4 || t4 > e4.length) && (t4 = e4.length); for (var r3 = 0, n2 = new Array(t4); r3 < t4; r3++) n2[r3] = e4[r3]; return n2; } e3.exports = function(e4) { return { encode: function(t4) { return function(e5, t5) { var r3 = e5.byteLength, n2 = new Uint8Array(e5), i2 = t5.indexOf("=") === t5.length - 1; i2 && (t5 = t5.substring(0, t5.length - 1)); for (var o2 = 0, a2 = 0, s2 = "", u2 = 0; u2 < r3; u2++) for (a2 = a2 << 8 | n2[u2], o2 += 8; o2 >= 5; ) s2 += t5[a2 >>> o2 - 5 & 31], o2 -= 5; if (o2 > 0 && (s2 += t5[a2 << 5 - o2 & 31]), i2) for (; s2.length % 8 != 0; ) s2 += "="; return s2; }("string" == typeof t4 ? Uint8Array.from(t4) : t4, e4); }, decode: function(r3) { var n2, i2 = function(e5, r4) { var n3 = "undefined" != typeof Symbol && e5[Symbol.iterator] || e5["@@iterator"]; if (!n3) { if (Array.isArray(e5) || (n3 = function(e6, r5) { if (e6) { if ("string" == typeof e6) return t3(e6, r5); var n4 = Object.prototype.toString.call(e6).slice(8, -1); return "Object" === n4 && e6.constructor && (n4 = e6.constructor.name), "Map" === n4 || "Set" === n4 ? Array.from(e6) : "Arguments" === n4 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4) ? t3(e6, r5) : void 0; } }(e5)) || r4 && e5 && "number" == typeof e5.length) { n3 && (e5 = n3); var i3 = 0, o3 = function() { }; return { s: o3, n: function() { return i3 >= e5.length ? { done: true } : { done: false, value: e5[i3++] }; }, e: function(e6) { throw e6; }, f: o3 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var a2, s2 = true, u2 = false; return { s: function() { n3 = n3.call(e5); }, n: function() { var e6 = n3.next(); return s2 = e6.done, e6; }, e: function(e6) { u2 = true, a2 = e6; }, f: function() { try { s2 || null == n3.return || n3.return(); } finally { if (u2) throw a2; } } }; }(r3); try { for (i2.s(); !(n2 = i2.n()).done; ) { var o2 = n2.value; if (e4.indexOf(o2) < 0) throw new Error("invalid base32 character"); } } catch (e5) { i2.e(e5); } finally { i2.f(); } return function(e5, t4) { for (var r4 = (e5 = e5.replace(new RegExp("=", "g"), "")).length, n3 = 0, i3 = 0, o3 = 0, a2 = new Uint8Array(5 * r4 / 8 | 0), s2 = 0; s2 < r4; s2++) i3 = i3 << 5 | t4.indexOf(e5[s2]), (n3 += 5) >= 8 && (a2[o3++] = i3 >>> n3 - 8 & 255, n3 -= 8); return a2.buffer; }(r3, e4); } }; }; }, 88504: (e3, t3, r3) => { function n2(e4, t4) { (null == t4 || t4 > e4.length) && (t4 = e4.length); for (var r4 = 0, n3 = new Array(t4); r4 < t4; r4++) n3[r4] = e4[r4]; return n3; } var i2 = r3(29033).Buffer; e3.exports = function(e4) { var t4 = e4.indexOf("=") > -1, r4 = e4.indexOf("-") > -1 && e4.indexOf("_") > -1; return { encode: function(e5) { var n3 = ""; n3 = "string" == typeof e5 ? i2.from(e5).toString("base64") : e5.toString("base64"), r4 && (n3 = n3.replace(/\+/g, "-").replace(/\//g, "_")); var o2 = n3.indexOf("="); return o2 > 0 && !t4 && (n3 = n3.substring(0, o2)), n3; }, decode: function(t5) { var r5, o2 = function(e5, t6) { var r6 = "undefined" != typeof Symbol && e5[Symbol.iterator] || e5["@@iterator"]; if (!r6) { if (Array.isArray(e5) || (r6 = function(e6, t7) { if (e6) { if ("string" == typeof e6) return n2(e6, t7); var r7 = Object.prototype.toString.call(e6).slice(8, -1); return "Object" === r7 && e6.constructor && (r7 = e6.constructor.name), "Map" === r7 || "Set" === r7 ? Array.from(e6) : "Arguments" === r7 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r7) ? n2(e6, t7) : void 0; } }(e5)) || t6 && e5 && "number" == typeof e5.length) { r6 && (e5 = r6); var i3 = 0, o3 = function() { }; return { s: o3, n: function() { return i3 >= e5.length ? { done: true } : { done: false, value: e5[i3++] }; }, e: function(e6) { throw e6; }, f: o3 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var a3, s2 = true, u2 = false; return { s: function() { r6 = r6.call(e5); }, n: function() { var e6 = r6.next(); return s2 = e6.done, e6; }, e: function(e6) { u2 = true, a3 = e6; }, f: function() { try { s2 || null == r6.return || r6.return(); } finally { if (u2) throw a3; } } }; }(t5); try { for (o2.s(); !(r5 = o2.n()).done; ) { var a2 = r5.value; if (e4.indexOf(a2) < 0) throw new Error("invalid base64 character"); } } catch (e5) { o2.e(e5); } finally { o2.f(); } return i2.from(t5, "base64"); } }; }; }, 12263: (e3, t3, r3) => { var n2 = r3(71786), i2 = r3(27548), o2 = r3(37739), a2 = r3(70976), s2 = r3(88504), u2 = [["base1", "1", "", "1"], ["base2", "0", i2, "01"], ["base8", "7", i2, "01234567"], ["base10", "9", i2, "0123456789"], ["base16", "f", o2, "0123456789abcdef"], ["base32", "b", a2, "abcdefghijklmnopqrstuvwxyz234567"], ["base32pad", "c", a2, "abcdefghijklmnopqrstuvwxyz234567="], ["base32hex", "v", a2, "0123456789abcdefghijklmnopqrstuv"], ["base32hexpad", "t", a2, "0123456789abcdefghijklmnopqrstuv="], ["base32z", "h", a2, "ybndrfg8ejkmcpqxot1uwisza345h769"], ["base58flickr", "Z", i2, "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"], ["base58btc", "z", i2, "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"], ["base64", "m", s2, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"], ["base64pad", "M", s2, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="], ["base64url", "u", s2, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"], ["base64urlpad", "U", s2, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]], c2 = u2.reduce(function(e4, t4) { return e4[t4[0]] = new n2(t4[0], t4[1], t4[2], t4[3]), e4; }, {}), f2 = u2.reduce(function(e4, t4) { return e4[t4[1]] = c2[t4[0]], e4; }, {}); e3.exports = { names: c2, codes: f2 }; }, 2592: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(12263); function o2(e4, t4) { if (!t4) throw new Error("requires an encoded buffer"); var r4 = a2(e4), i3 = n2.from(r4.code); return function(e5, t5) { a2(e5).decode(t5.toString()); }(r4.name, t4), n2.concat([i3, t4]); } function a2(e4) { var t4; if (i2.names[e4]) t4 = i2.names[e4]; else { if (!i2.codes[e4]) throw new Error("Unsupported encoding"); t4 = i2.codes[e4]; } if (!t4.isImplemented()) throw new Error("Base " + e4 + " is not implemented yet"); return t4; } (t3 = e3.exports = o2).encode = function(e4, t4) { var r4 = a2(e4); return o2(r4.name, n2.from(r4.encode(t4))); }, t3.decode = function(e4) { n2.isBuffer(e4) && (e4 = e4.toString()); var t4 = e4.substring(0, 1); "string" == typeof (e4 = e4.substring(1, e4.length)) && (e4 = n2.from(e4)); var r4 = a2(t4); return n2.from(r4.decode(e4.toString())); }, t3.isEncoded = function(e4) { if (n2.isBuffer(e4) && (e4 = e4.toString()), "[object String]" !== Object.prototype.toString.call(e4)) return false; var t4 = e4.substring(0, 1); try { return a2(t4).name; } catch (e5) { return false; } }, t3.names = Object.freeze(Object.keys(i2.names)), t3.codes = Object.freeze(Object.keys(i2.codes)); }, 81269: (e3, t3) => { t3.names = Object.freeze({ identity: 0, sha1: 17, "sha2-256": 18, "sha2-512": 19, "dbl-sha2-256": 86, "sha3-224": 23, "sha3-256": 22, "sha3-384": 21, "sha3-512": 20, "shake-128": 24, "shake-256": 25, "keccak-224": 26, "keccak-256": 27, "keccak-384": 28, "keccak-512": 29, "murmur3-128": 34, "murmur3-32": 35, md4: 212, md5: 213, "blake2b-8": 45569, "blake2b-16": 45570, "blake2b-24": 45571, "blake2b-32": 45572, "blake2b-40": 45573, "blake2b-48": 45574, "blake2b-56": 45575, "blake2b-64": 45576, "blake2b-72": 45577, "blake2b-80": 45578, "blake2b-88": 45579, "blake2b-96": 45580, "blake2b-104": 45581, "blake2b-112": 45582, "blake2b-120": 45583, "blake2b-128": 45584, "blake2b-136": 45585, "blake2b-144": 45586, "blake2b-152": 45587, "blake2b-160": 45588, "blake2b-168": 45589, "blake2b-176": 45590, "blake2b-184": 45591, "blake2b-192": 45592, "blake2b-200": 45593, "blake2b-208": 45594, "blake2b-216": 45595, "blake2b-224": 45596, "blake2b-232": 45597, "blake2b-240": 45598, "blake2b-248": 45599, "blake2b-256": 45600, "blake2b-264": 45601, "blake2b-272": 45602, "blake2b-280": 45603, "blake2b-288": 45604, "blake2b-296": 45605, "blake2b-304": 45606, "blake2b-312": 45607, "blake2b-320": 45608, "blake2b-328": 45609, "blake2b-336": 45610, "blake2b-344": 45611, "blake2b-352": 45612, "blake2b-360": 45613, "blake2b-368": 45614, "blake2b-376": 45615, "blake2b-384": 45616, "blake2b-392": 45617, "blake2b-400": 45618, "blake2b-408": 45619, "blake2b-416": 45620, "blake2b-424": 45621, "blake2b-432": 45622, "blake2b-440": 45623, "blake2b-448": 45624, "blake2b-456": 45625, "blake2b-464": 45626, "blake2b-472": 45627, "blake2b-480": 45628, "blake2b-488": 45629, "blake2b-496": 45630, "blake2b-504": 45631, "blake2b-512": 45632, "blake2s-8": 45633, "blake2s-16": 45634, "blake2s-24": 45635, "blake2s-32": 45636, "blake2s-40": 45637, "blake2s-48": 45638, "blake2s-56": 45639, "blake2s-64": 45640, "blake2s-72": 45641, "blake2s-80": 45642, "blake2s-88": 45643, "blake2s-96": 45644, "blake2s-104": 45645, "blake2s-112": 45646, "blake2s-120": 45647, "blake2s-128": 45648, "blake2s-136": 45649, "blake2s-144": 45650, "blake2s-152": 45651, "blake2s-160": 45652, "blake2s-168": 45653, "blake2s-176": 45654, "blake2s-184": 45655, "blake2s-192": 45656, "blake2s-200": 45657, "blake2s-208": 45658, "blake2s-216": 45659, "blake2s-224": 45660, "blake2s-232": 45661, "blake2s-240": 45662, "blake2s-248": 45663, "blake2s-256": 45664, "Skein256-8": 45825, "Skein256-16": 45826, "Skein256-24": 45827, "Skein256-32": 45828, "Skein256-40": 45829, "Skein256-48": 45830, "Skein256-56": 45831, "Skein256-64": 45832, "Skein256-72": 45833, "Skein256-80": 45834, "Skein256-88": 45835, "Skein256-96": 45836, "Skein256-104": 45837, "Skein256-112": 45838, "Skein256-120": 45839, "Skein256-128": 45840, "Skein256-136": 45841, "Skein256-144": 45842, "Skein256-152": 45843, "Skein256-160": 45844, "Skein256-168": 45845, "Skein256-176": 45846, "Skein256-184": 45847, "Skein256-192": 45848, "Skein256-200": 45849, "Skein256-208": 45850, "Skein256-216": 45851, "Skein256-224": 45852, "Skein256-232": 45853, "Skein256-240": 45854, "Skein256-248": 45855, "Skein256-256": 45856, "Skein512-8": 45857, "Skein512-16": 45858, "Skein512-24": 45859, "Skein512-32": 45860, "Skein512-40": 45861, "Skein512-48": 45862, "Skein512-56": 45863, "Skein512-64": 45864, "Skein512-72": 45865, "Skein512-80": 45866, "Skein512-88": 45867, "Skein512-96": 45868, "Skein512-104": 45869, "Skein512-112": 45870, "Skein512-120": 45871, "Skein512-128": 45872, "Skein512-136": 45873, "Skein512-144": 45874, "Skein512-152": 45875, "Skein512-160": 45876, "Skein512-168": 45877, "Skein512-176": 45878, "Skein512-184": 45879, "Skein512-192": 45880, "Skein512-200": 45881, "Skein512-208": 45882, "Skein512-216": 45883, "Skein512-224": 45884, "Skein512-232": 45885, "Skein512-240": 45886, "Skein512-248": 45887, "Skein512-256": 45888, "Skein512-264": 45889, "Skein512-272": 45890, "Skein512-280": 45891, "Skein512-288": 45892, "Skein512-296": 45893, "Skein512-304": 45894, "Skein512-312": 45895, "Skein512-320": 45896, "Skein512-328": 45897, "Skein512-336": 45898, "Skein512-344": 45899, "Skein512-352": 45900, "Skein512-360": 45901, "Skein512-368": 45902, "Skein512-376": 45903, "Skein512-384": 45904, "Skein512-392": 45905, "Skein512-400": 45906, "Skein512-408": 45907, "Skein512-416": 45908, "Skein512-424": 45909, "Skein512-432": 45910, "Skein512-440": 45911, "Skein512-448": 45912, "Skein512-456": 45913, "Skein512-464": 45914, "Skein512-472": 45915, "Skein512-480": 45916, "Skein512-488": 45917, "Skein512-496": 45918, "Skein512-504": 45919, "Skein512-512": 45920, "Skein1024-8": 45921, "Skein1024-16": 45922, "Skein1024-24": 45923, "Skein1024-32": 45924, "Skein1024-40": 45925, "Skein1024-48": 45926, "Skein1024-56": 45927, "Skein1024-64": 45928, "Skein1024-72": 45929, "Skein1024-80": 45930, "Skein1024-88": 45931, "Skein1024-96": 45932, "Skein1024-104": 45933, "Skein1024-112": 45934, "Skein1024-120": 45935, "Skein1024-128": 45936, "Skein1024-136": 45937, "Skein1024-144": 45938, "Skein1024-152": 45939, "Skein1024-160": 45940, "Skein1024-168": 45941, "Skein1024-176": 45942, "Skein1024-184": 45943, "Skein1024-192": 45944, "Skein1024-200": 45945, "Skein1024-208": 45946, "Skein1024-216": 45947, "Skein1024-224": 45948, "Skein1024-232": 45949, "Skein1024-240": 45950, "Skein1024-248": 45951, "Skein1024-256": 45952, "Skein1024-264": 45953, "Skein1024-272": 45954, "Skein1024-280": 45955, "Skein1024-288": 45956, "Skein1024-296": 45957, "Skein1024-304": 45958, "Skein1024-312": 45959, "Skein1024-320": 45960, "Skein1024-328": 45961, "Skein1024-336": 45962, "Skein1024-344": 45963, "Skein1024-352": 45964, "Skein1024-360": 45965, "Skein1024-368": 45966, "Skein1024-376": 45967, "Skein1024-384": 45968, "Skein1024-392": 45969, "Skein1024-400": 45970, "Skein1024-408": 45971, "Skein1024-416": 45972, "Skein1024-424": 45973, "Skein1024-432": 45974, "Skein1024-440": 45975, "Skein1024-448": 45976, "Skein1024-456": 45977, "Skein1024-464": 45978, "Skein1024-472": 45979, "Skein1024-480": 45980, "Skein1024-488": 45981, "Skein1024-496": 45982, "Skein1024-504": 45983, "Skein1024-512": 45984, "Skein1024-520": 45985, "Skein1024-528": 45986, "Skein1024-536": 45987, "Skein1024-544": 45988, "Skein1024-552": 45989, "Skein1024-560": 45990, "Skein1024-568": 45991, "Skein1024-576": 45992, "Skein1024-584": 45993, "Skein1024-592": 45994, "Skein1024-600": 45995, "Skein1024-608": 45996, "Skein1024-616": 45997, "Skein1024-624": 45998, "Skein1024-632": 45999, "Skein1024-640": 46e3, "Skein1024-648": 46001, "Skein1024-656": 46002, "Skein1024-664": 46003, "Skein1024-672": 46004, "Skein1024-680": 46005, "Skein1024-688": 46006, "Skein1024-696": 46007, "Skein1024-704": 46008, "Skein1024-712": 46009, "Skein1024-720": 46010, "Skein1024-728": 46011, "Skein1024-736": 46012, "Skein1024-744": 46013, "Skein1024-752": 46014, "Skein1024-760": 46015, "Skein1024-768": 46016, "Skein1024-776": 46017, "Skein1024-784": 46018, "Skein1024-792": 46019, "Skein1024-800": 46020, "Skein1024-808": 46021, "Skein1024-816": 46022, "Skein1024-824": 46023, "Skein1024-832": 46024, "Skein1024-840": 46025, "Skein1024-848": 46026, "Skein1024-856": 46027, "Skein1024-864": 46028, "Skein1024-872": 46029, "Skein1024-880": 46030, "Skein1024-888": 46031, "Skein1024-896": 46032, "Skein1024-904": 46033, "Skein1024-912": 46034, "Skein1024-920": 46035, "Skein1024-928": 46036, "Skein1024-936": 46037, "Skein1024-944": 46038, "Skein1024-952": 46039, "Skein1024-960": 46040, "Skein1024-968": 46041, "Skein1024-976": 46042, "Skein1024-984": 46043, "Skein1024-992": 46044, "Skein1024-1000": 46045, "Skein1024-1008": 46046, "Skein1024-1016": 46047, "Skein1024-1024": 46048 }), t3.codes = Object.freeze({ 0: "identity", 17: "sha1", 18: "sha2-256", 19: "sha2-512", 86: "dbl-sha2-256", 23: "sha3-224", 22: "sha3-256", 21: "sha3-384", 20: "sha3-512", 24: "shake-128", 25: "shake-256", 26: "keccak-224", 27: "keccak-256", 28: "keccak-384", 29: "keccak-512", 34: "murmur3-128", 35: "murmur3-32", 212: "md4", 213: "md5", 45569: "blake2b-8", 45570: "blake2b-16", 45571: "blake2b-24", 45572: "blake2b-32", 45573: "blake2b-40", 45574: "blake2b-48", 45575: "blake2b-56", 45576: "blake2b-64", 45577: "blake2b-72", 45578: "blake2b-80", 45579: "blake2b-88", 45580: "blake2b-96", 45581: "blake2b-104", 45582: "blake2b-112", 45583: "blake2b-120", 45584: "blake2b-128", 45585: "blake2b-136", 45586: "blake2b-144", 45587: "blake2b-152", 45588: "blake2b-160", 45589: "blake2b-168", 45590: "blake2b-176", 45591: "blake2b-184", 45592: "blake2b-192", 45593: "blake2b-200", 45594: "blake2b-208", 45595: "blake2b-216", 45596: "blake2b-224", 45597: "blake2b-232", 45598: "blake2b-240", 45599: "blake2b-248", 45600: "blake2b-256", 45601: "blake2b-264", 45602: "blake2b-272", 45603: "blake2b-280", 45604: "blake2b-288", 45605: "blake2b-296", 45606: "blake2b-304", 45607: "blake2b-312", 45608: "blake2b-320", 45609: "blake2b-328", 45610: "blake2b-336", 45611: "blake2b-344", 45612: "blake2b-352", 45613: "blake2b-360", 45614: "blake2b-368", 45615: "blake2b-376", 45616: "blake2b-384", 45617: "blake2b-392", 45618: "blake2b-400", 45619: "blake2b-408", 45620: "blake2b-416", 45621: "blake2b-424", 45622: "blake2b-432", 45623: "blake2b-440", 45624: "blake2b-448", 45625: "blake2b-456", 45626: "blake2b-464", 45627: "blake2b-472", 45628: "blake2b-480", 45629: "blake2b-488", 45630: "blake2b-496", 45631: "blake2b-504", 45632: "blake2b-512", 45633: "blake2s-8", 45634: "blake2s-16", 45635: "blake2s-24", 45636: "blake2s-32", 45637: "blake2s-40", 45638: "blake2s-48", 45639: "blake2s-56", 45640: "blake2s-64", 45641: "blake2s-72", 45642: "blake2s-80", 45643: "blake2s-88", 45644: "blake2s-96", 45645: "blake2s-104", 45646: "blake2s-112", 45647: "blake2s-120", 45648: "blake2s-128", 45649: "blake2s-136", 45650: "blake2s-144", 45651: "blake2s-152", 45652: "blake2s-160", 45653: "blake2s-168", 45654: "blake2s-176", 45655: "blake2s-184", 45656: "blake2s-192", 45657: "blake2s-200", 45658: "blake2s-208", 45659: "blake2s-216", 45660: "blake2s-224", 45661: "blake2s-232", 45662: "blake2s-240", 45663: "blake2s-248", 45664: "blake2s-256", 45825: "Skein256-8", 45826: "Skein256-16", 45827: "Skein256-24", 45828: "Skein256-32", 45829: "Skein256-40", 45830: "Skein256-48", 45831: "Skein256-56", 45832: "Skein256-64", 45833: "Skein256-72", 45834: "Skein256-80", 45835: "Skein256-88", 45836: "Skein256-96", 45837: "Skein256-104", 45838: "Skein256-112", 45839: "Skein256-120", 45840: "Skein256-128", 45841: "Skein256-136", 45842: "Skein256-144", 45843: "Skein256-152", 45844: "Skein256-160", 45845: "Skein256-168", 45846: "Skein256-176", 45847: "Skein256-184", 45848: "Skein256-192", 45849: "Skein256-200", 45850: "Skein256-208", 45851: "Skein256-216", 45852: "Skein256-224", 45853: "Skein256-232", 45854: "Skein256-240", 45855: "Skein256-248", 45856: "Skein256-256", 45857: "Skein512-8", 45858: "Skein512-16", 45859: "Skein512-24", 45860: "Skein512-32", 45861: "Skein512-40", 45862: "Skein512-48", 45863: "Skein512-56", 45864: "Skein512-64", 45865: "Skein512-72", 45866: "Skein512-80", 45867: "Skein512-88", 45868: "Skein512-96", 45869: "Skein512-104", 45870: "Skein512-112", 45871: "Skein512-120", 45872: "Skein512-128", 45873: "Skein512-136", 45874: "Skein512-144", 45875: "Skein512-152", 45876: "Skein512-160", 45877: "Skein512-168", 45878: "Skein512-176", 45879: "Skein512-184", 45880: "Skein512-192", 45881: "Skein512-200", 45882: "Skein512-208", 45883: "Skein512-216", 45884: "Skein512-224", 45885: "Skein512-232", 45886: "Skein512-240", 45887: "Skein512-248", 45888: "Skein512-256", 45889: "Skein512-264", 45890: "Skein512-272", 45891: "Skein512-280", 45892: "Skein512-288", 45893: "Skein512-296", 45894: "Skein512-304", 45895: "Skein512-312", 45896: "Skein512-320", 45897: "Skein512-328", 45898: "Skein512-336", 45899: "Skein512-344", 45900: "Skein512-352", 45901: "Skein512-360", 45902: "Skein512-368", 45903: "Skein512-376", 45904: "Skein512-384", 45905: "Skein512-392", 45906: "Skein512-400", 45907: "Skein512-408", 45908: "Skein512-416", 45909: "Skein512-424", 45910: "Skein512-432", 45911: "Skein512-440", 45912: "Skein512-448", 45913: "Skein512-456", 45914: "Skein512-464", 45915: "Skein512-472", 45916: "Skein512-480", 45917: "Skein512-488", 45918: "Skein512-496", 45919: "Skein512-504", 45920: "Skein512-512", 45921: "Skein1024-8", 45922: "Skein1024-16", 45923: "Skein1024-24", 45924: "Skein1024-32", 45925: "Skein1024-40", 45926: "Skein1024-48", 45927: "Skein1024-56", 45928: "Skein1024-64", 45929: "Skein1024-72", 45930: "Skein1024-80", 45931: "Skein1024-88", 45932: "Skein1024-96", 45933: "Skein1024-104", 45934: "Skein1024-112", 45935: "Skein1024-120", 45936: "Skein1024-128", 45937: "Skein1024-136", 45938: "Skein1024-144", 45939: "Skein1024-152", 45940: "Skein1024-160", 45941: "Skein1024-168", 45942: "Skein1024-176", 45943: "Skein1024-184", 45944: "Skein1024-192", 45945: "Skein1024-200", 45946: "Skein1024-208", 45947: "Skein1024-216", 45948: "Skein1024-224", 45949: "Skein1024-232", 45950: "Skein1024-240", 45951: "Skein1024-248", 45952: "Skein1024-256", 45953: "Skein1024-264", 45954: "Skein1024-272", 45955: "Skein1024-280", 45956: "Skein1024-288", 45957: "Skein1024-296", 45958: "Skein1024-304", 45959: "Skein1024-312", 45960: "Skein1024-320", 45961: "Skein1024-328", 45962: "Skein1024-336", 45963: "Skein1024-344", 45964: "Skein1024-352", 45965: "Skein1024-360", 45966: "Skein1024-368", 45967: "Skein1024-376", 45968: "Skein1024-384", 45969: "Skein1024-392", 45970: "Skein1024-400", 45971: "Skein1024-408", 45972: "Skein1024-416", 45973: "Skein1024-424", 45974: "Skein1024-432", 45975: "Skein1024-440", 45976: "Skein1024-448", 45977: "Skein1024-456", 45978: "Skein1024-464", 45979: "Skein1024-472", 45980: "Skein1024-480", 45981: "Skein1024-488", 45982: "Skein1024-496", 45983: "Skein1024-504", 45984: "Skein1024-512", 45985: "Skein1024-520", 45986: "Skein1024-528", 45987: "Skein1024-536", 45988: "Skein1024-544", 45989: "Skein1024-552", 45990: "Skein1024-560", 45991: "Skein1024-568", 45992: "Skein1024-576", 45993: "Skein1024-584", 45994: "Skein1024-592", 45995: "Skein1024-600", 45996: "Skein1024-608", 45997: "Skein1024-616", 45998: "Skein1024-624", 45999: "Skein1024-632", 46e3: "Skein1024-640", 46001: "Skein1024-648", 46002: "Skein1024-656", 46003: "Skein1024-664", 46004: "Skein1024-672", 46005: "Skein1024-680", 46006: "Skein1024-688", 46007: "Skein1024-696", 46008: "Skein1024-704", 46009: "Skein1024-712", 46010: "Skein1024-720", 46011: "Skein1024-728", 46012: "Skein1024-736", 46013: "Skein1024-744", 46014: "Skein1024-752", 46015: "Skein1024-760", 46016: "Skein1024-768", 46017: "Skein1024-776", 46018: "Skein1024-784", 46019: "Skein1024-792", 46020: "Skein1024-800", 46021: "Skein1024-808", 46022: "Skein1024-816", 46023: "Skein1024-824", 46024: "Skein1024-832", 46025: "Skein1024-840", 46026: "Skein1024-848", 46027: "Skein1024-856", 46028: "Skein1024-864", 46029: "Skein1024-872", 46030: "Skein1024-880", 46031: "Skein1024-888", 46032: "Skein1024-896", 46033: "Skein1024-904", 46034: "Skein1024-912", 46035: "Skein1024-920", 46036: "Skein1024-928", 46037: "Skein1024-936", 46038: "Skein1024-944", 46039: "Skein1024-952", 46040: "Skein1024-960", 46041: "Skein1024-968", 46042: "Skein1024-976", 46043: "Skein1024-984", 46044: "Skein1024-992", 46045: "Skein1024-1000", 46046: "Skein1024-1008", 46047: "Skein1024-1016", 46048: "Skein1024-1024" }), t3.defaultLengths = Object.freeze({ 17: 20, 18: 32, 19: 64, 86: 32, 23: 28, 22: 32, 21: 48, 20: 64, 24: 32, 25: 64, 26: 28, 27: 32, 28: 48, 29: 64, 34: 32, 45569: 1, 45570: 2, 45571: 3, 45572: 4, 45573: 5, 45574: 6, 45575: 7, 45576: 8, 45577: 9, 45578: 10, 45579: 11, 45580: 12, 45581: 13, 45582: 14, 45583: 15, 45584: 16, 45585: 17, 45586: 18, 45587: 19, 45588: 20, 45589: 21, 45590: 22, 45591: 23, 45592: 24, 45593: 25, 45594: 26, 45595: 27, 45596: 28, 45597: 29, 45598: 30, 45599: 31, 45600: 32, 45601: 33, 45602: 34, 45603: 35, 45604: 36, 45605: 37, 45606: 38, 45607: 39, 45608: 40, 45609: 41, 45610: 42, 45611: 43, 45612: 44, 45613: 45, 45614: 46, 45615: 47, 45616: 48, 45617: 49, 45618: 50, 45619: 51, 45620: 52, 45621: 53, 45622: 54, 45623: 55, 45624: 56, 45625: 57, 45626: 58, 45627: 59, 45628: 60, 45629: 61, 45630: 62, 45631: 63, 45632: 64, 45633: 1, 45634: 2, 45635: 3, 45636: 4, 45637: 5, 45638: 6, 45639: 7, 45640: 8, 45641: 9, 45642: 10, 45643: 11, 45644: 12, 45645: 13, 45646: 14, 45647: 15, 45648: 16, 45649: 17, 45650: 18, 45651: 19, 45652: 20, 45653: 21, 45654: 22, 45655: 23, 45656: 24, 45657: 25, 45658: 26, 45659: 27, 45660: 28, 45661: 29, 45662: 30, 45663: 31, 45664: 32, 45825: 1, 45826: 2, 45827: 3, 45828: 4, 45829: 5, 45830: 6, 45831: 7, 45832: 8, 45833: 9, 45834: 10, 45835: 11, 45836: 12, 45837: 13, 45838: 14, 45839: 15, 45840: 16, 45841: 17, 45842: 18, 45843: 19, 45844: 20, 45845: 21, 45846: 22, 45847: 23, 45848: 24, 45849: 25, 45850: 26, 45851: 27, 45852: 28, 45853: 29, 45854: 30, 45855: 31, 45856: 32, 45857: 1, 45858: 2, 45859: 3, 45860: 4, 45861: 5, 45862: 6, 45863: 7, 45864: 8, 45865: 9, 45866: 10, 45867: 11, 45868: 12, 45869: 13, 45870: 14, 45871: 15, 45872: 16, 45873: 17, 45874: 18, 45875: 19, 45876: 20, 45877: 21, 45878: 22, 45879: 23, 45880: 24, 45881: 25, 45882: 26, 45883: 27, 45884: 28, 45885: 29, 45886: 30, 45887: 31, 45888: 32, 45889: 33, 45890: 34, 45891: 35, 45892: 36, 45893: 37, 45894: 38, 45895: 39, 45896: 40, 45897: 41, 45898: 42, 45899: 43, 45900: 44, 45901: 45, 45902: 46, 45903: 47, 45904: 48, 45905: 49, 45906: 50, 45907: 51, 45908: 52, 45909: 53, 45910: 54, 45911: 55, 45912: 56, 45913: 57, 45914: 58, 45915: 59, 45916: 60, 45917: 61, 45918: 62, 45919: 63, 45920: 64, 45921: 1, 45922: 2, 45923: 3, 45924: 4, 45925: 5, 45926: 6, 45927: 7, 45928: 8, 45929: 9, 45930: 10, 45931: 11, 45932: 12, 45933: 13, 45934: 14, 45935: 15, 45936: 16, 45937: 17, 45938: 18, 45939: 19, 45940: 20, 45941: 21, 45942: 22, 45943: 23, 45944: 24, 45945: 25, 45946: 26, 45947: 27, 45948: 28, 45949: 29, 45950: 30, 45951: 31, 45952: 32, 45953: 33, 45954: 34, 45955: 35, 45956: 36, 45957: 37, 45958: 38, 45959: 39, 45960: 40, 45961: 41, 45962: 42, 45963: 43, 45964: 44, 45965: 45, 45966: 46, 45967: 47, 45968: 48, 45969: 49, 45970: 50, 45971: 51, 45972: 52, 45973: 53, 45974: 54, 45975: 55, 45976: 56, 45977: 57, 45978: 58, 45979: 59, 45980: 60, 45981: 61, 45982: 62, 45983: 63, 45984: 64, 45985: 65, 45986: 66, 45987: 67, 45988: 68, 45989: 69, 45990: 70, 45991: 71, 45992: 72, 45993: 73, 45994: 74, 45995: 75, 45996: 76, 45997: 77, 45998: 78, 45999: 79, 46e3: 80, 46001: 81, 46002: 82, 46003: 83, 46004: 84, 46005: 85, 46006: 86, 46007: 87, 46008: 88, 46009: 89, 46010: 90, 46011: 91, 46012: 92, 46013: 93, 46014: 94, 46015: 95, 46016: 96, 46017: 97, 46018: 98, 46019: 99, 46020: 100, 46021: 101, 46022: 102, 46023: 103, 46024: 104, 46025: 105, 46026: 106, 46027: 107, 46028: 108, 46029: 109, 46030: 110, 46031: 111, 46032: 112, 46033: 113, 46034: 114, 46035: 115, 46036: 116, 46037: 117, 46038: 118, 46039: 119, 46040: 120, 46041: 121, 46042: 122, 46043: 123, 46044: 124, 46045: 125, 46046: 126, 46047: 127, 46048: 128 }); }, 77748: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(2592), o2 = r3(26657), a2 = r3(81269); function s2(e4) { t3.decode(e4); } t3.names = a2.names, t3.codes = a2.codes, t3.defaultLengths = a2.defaultLengths, t3.toHexString = function(e4) { if (!n2.isBuffer(e4)) throw new Error("must be passed a buffer"); return e4.toString("hex"); }, t3.fromHexString = function(e4) { return n2.from(e4, "hex"); }, t3.toB58String = function(e4) { if (!n2.isBuffer(e4)) throw new Error("must be passed a buffer"); return i2.encode("base58btc", e4).toString().slice(1); }, t3.fromB58String = function(e4) { var t4 = e4; return n2.isBuffer(e4) && (t4 = e4.toString()), i2.decode("z" + t4); }, t3.decode = function(e4) { if (!n2.isBuffer(e4)) throw new Error("multihash must be a Buffer"); if (e4.length < 2) throw new Error("multihash too short. must be > 2 bytes."); var r4 = o2.decode(e4); if (!t3.isValidCode(r4)) throw new Error("multihash unknown function code: 0x".concat(r4.toString(16))); e4 = e4.slice(o2.decode.bytes); var i3 = o2.decode(e4); if (i3 < 0) throw new Error("multihash invalid length: ".concat(i3)); if ((e4 = e4.slice(o2.decode.bytes)).length !== i3) throw new Error("multihash length inconsistent: 0x".concat(e4.toString("hex"))); return { code: r4, name: a2.codes[r4], length: i3, digest: e4 }; }, t3.encode = function(e4, r4, i3) { if (!e4 || void 0 === r4) throw new Error("multihash encode requires at least two args: digest, code"); var a3 = t3.coerceCode(r4); if (!n2.isBuffer(e4)) throw new Error("digest should be a Buffer"); if (null == i3 && (i3 = e4.length), i3 && e4.length !== i3) throw new Error("digest length should be equal to specified length."); return n2.concat([n2.from(o2.encode(a3)), n2.from(o2.encode(i3)), e4]); }, t3.coerceCode = function(e4) { var r4 = e4; if ("string" == typeof e4) { if (void 0 === a2.names[e4]) throw new Error("Unrecognized hash function named: ".concat(e4)); r4 = a2.names[e4]; } if ("number" != typeof r4) throw new Error("Hash function code should be a number. Got: ".concat(r4)); if (void 0 === a2.codes[r4] && !t3.isAppCode(r4)) throw new Error("Unrecognized function code: ".concat(r4)); return r4; }, t3.isAppCode = function(e4) { return e4 > 0 && e4 < 16; }, t3.isValidCode = function(e4) { return !!t3.isAppCode(e4) || !!a2.codes[e4]; }, t3.validate = s2, t3.prefix = function(e4) { return s2(e4), e4.slice(0, 2); }; }, 77277: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(31734), o2 = r3(36931); e3.exports = function(e4) { if ("string" == typeof e4 || "number" == typeof e4) { var t4 = new i2(1), r4 = String(e4).toLowerCase().trim(), a2 = "0x" === r4.substr(0, 2) || "-0x" === r4.substr(0, 3), s2 = o2(r4); if ("-" === s2.substr(0, 1) && (s2 = o2(s2.slice(1)), t4 = new i2(-1, 10)), !(s2 = "" === s2 ? "0" : s2).match(/^-?[0-9]+$/) && s2.match(/^[0-9A-Fa-f]+$/) || s2.match(/^[a-fA-F]+$/) || true === a2 && s2.match(/^[0-9A-Fa-f]+$/)) return new i2(s2, 16).mul(t4); if ((s2.match(/^-?[0-9]+$/) || "" === s2) && false === a2) return new i2(s2, 10).mul(t4); } else if ("object" === (0, n2.default)(e4) && e4.toString && !e4.pop && !e4.push && e4.toString(10).match(/^-?[0-9]+$/) && (e4.mul || e4.dividedToIntegerBy)) return new i2(e4.toString(10), 10); throw new Error("[number-to-bn] while converting number " + JSON.stringify(e4) + " to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported."); }; }, 33103: (e3) => { var t3 = Object.getOwnPropertySymbols, r3 = Object.prototype.hasOwnProperty, n2 = Object.prototype.propertyIsEnumerable; e3.exports = function() { try { if (!Object.assign) return false; var e4 = new String("abc"); if (e4[5] = "de", "5" === Object.getOwnPropertyNames(e4)[0]) return false; for (var t4 = {}, r4 = 0; r4 < 10; r4++) t4["_" + String.fromCharCode(r4)] = r4; if ("0123456789" !== Object.getOwnPropertyNames(t4).map(function(e5) { return t4[e5]; }).join("")) return false; var n3 = {}; return "abcdefghijklmnopqrst".split("").forEach(function(e5) { n3[e5] = e5; }), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, n3)).join(""); } catch (e5) { return false; } }() ? Object.assign : function(e4, i2) { for (var o2, a2, s2 = function(e5) { if (null == e5) throw new TypeError("Object.assign cannot be called with null or undefined"); return Object(e5); }(e4), u2 = 1; u2 < arguments.length; u2++) { for (var c2 in o2 = Object(arguments[u2])) r3.call(o2, c2) && (s2[c2] = o2[c2]); if (t3) { a2 = t3(o2); for (var f2 = 0; f2 < a2.length; f2++) n2.call(o2, a2[f2]) && (s2[a2[f2]] = o2[a2[f2]]); } } return s2; }; }, 83150: (e3, t3, r3) => { var n2, i2, o2; e3 = r3.nmd(e3); var a2, s2 = r3(28847)(r3(3355)); a2 = function() { return function(e4) { var t4 = {}; function r4(n3) { if (t4[n3]) return t4[n3].exports; var i3 = t4[n3] = { i: n3, l: false, exports: {} }; return e4[n3].call(i3.exports, i3, i3.exports, r4), i3.l = true, i3.exports; } return r4.m = e4, r4.c = t4, r4.d = function(e5, t5, n3) { r4.o(e5, t5) || Object.defineProperty(e5, t5, { configurable: false, enumerable: true, get: n3 }); }, r4.n = function(e5) { var t5 = e5 && e5.__esModule ? function() { return e5.default; } : function() { return e5; }; return r4.d(t5, "a", t5), t5; }, r4.o = function(e5, t5) { return Object.prototype.hasOwnProperty.call(e5, t5); }, r4.p = "", r4(r4.s = 7); }([function(e4, t4, r4) { r4.d(t4, "j", function() { return i3; }), r4.d(t4, "d", function() { return o3; }), r4.d(t4, "c", function() { return a3; }), r4.d(t4, "h", function() { return s3; }), r4.d(t4, "b", function() { return u2; }), r4.d(t4, "k", function() { return c2; }), r4.d(t4, "e", function() { return f2; }), r4.d(t4, "g", function() { return d2; }), r4.d(t4, "i", function() { return l2; }), r4.d(t4, "a", function() { return h2; }), r4.d(t4, "f", function() { return p2; }); var n3 = r4(1), i3 = c2(function(e5, t5) { var r5 = t5.length; return c2(function(n4) { for (var i4 = 0; i4 < n4.length; i4++) t5[r5 + i4] = n4[i4]; return t5.length = r5 + n4.length, e5.apply(this, t5); }); }); function o3(e5, t5) { return function() { return e5.call(this, t5.apply(this, arguments)); }; } function a3(e5) { return function(t5) { return t5[e5]; }; } c2(function(e5) { var t5 = Object(n3.c)(e5); function r5(e6, t6) { return [u2(e6, t6)]; } return c2(function(e6) { return Object(n3.f)(r5, e6, t5)[0]; }); }); var s3 = c2(function(e5) { return c2(function(t5) { for (var r5, n4 = 0; n4 < a3("length")(e5); n4++) if (r5 = u2(t5, e5[n4])) return r5; }); }); function u2(e5, t5) { return t5.apply(void 0, e5); } function c2(e5) { var t5 = e5.length - 1, r5 = Array.prototype.slice; if (0 === t5) return function() { return e5.call(this, r5.call(arguments)); }; if (1 === t5) return function() { return e5.call(this, arguments[0], r5.call(arguments, 1)); }; var n4 = Array(e5.length); return function() { for (var i4 = 0; i4 < t5; i4++) n4[i4] = arguments[i4]; return n4[t5] = r5.call(arguments, t5), e5.apply(this, n4); }; } function f2(e5) { return function(t5, r5) { return e5(r5, t5); }; } function d2(e5, t5) { return function(r5) { return e5(r5) && t5(r5); }; } function l2() { } function h2() { return true; } function p2(e5) { return function() { return e5; }; } }, function(e4, t4, r4) { r4.d(t4, "d", function() { return i3; }), r4.d(t4, "g", function() { return a3; }), r4.d(t4, "l", function() { return s3; }), r4.d(t4, "c", function() { return u2; }), r4.d(t4, "h", function() { return c2; }), r4.d(t4, "i", function() { return f2; }), r4.d(t4, "j", function() { return d2; }), r4.d(t4, "f", function() { return l2; }), r4.d(t4, "m", function() { return h2; }), r4.d(t4, "a", function() { return p2; }), r4.d(t4, "b", function() { return b2; }), r4.d(t4, "k", function() { return y2; }), r4.d(t4, "e", function() { return v2; }); var n3 = r4(0); function i3(e5, t5) { return [e5, t5]; } var o3 = null, a3 = Object(n3.c)(0), s3 = Object(n3.c)(1); function u2(e5) { return y2(e5.reduce(Object(n3.e)(i3), o3)); } var c2 = Object(n3.k)(u2); function f2(e5) { return l2(function(e6, t5) { return e6.unshift(t5), e6; }, [], e5); } function d2(e5, t5) { return t5 ? i3(e5(a3(t5)), d2(e5, s3(t5))) : o3; } function l2(e5, t5, r5) { return r5 ? e5(l2(e5, t5, s3(r5)), a3(r5)) : t5; } function h2(e5, t5, r5) { return function e6(r6, n4) { return r6 ? t5(a3(r6)) ? (n4(a3(r6)), s3(r6)) : i3(a3(r6), e6(s3(r6), n4)) : o3; }(e5, r5 || n3.i); } function p2(e5, t5) { return !t5 || e5(a3(t5)) && p2(e5, s3(t5)); } function b2(e5, t5) { e5 && (a3(e5).apply(null, t5), b2(s3(e5), t5)); } function y2(e5) { return function e6(t5, r5) { return t5 ? e6(s3(t5), i3(a3(t5), r5)) : r5; }(e5, o3); } function v2(e5, t5) { return t5 && (e5(a3(t5)) ? a3(t5) : v2(e5, s3(t5))); } }, function(e4, t4, r4) { r4.d(t4, "c", function() { return o3; }), r4.d(t4, "e", function() { return a3; }), r4.d(t4, "d", function() { return s3; }), r4.d(t4, "a", function() { return u2; }), r4.d(t4, "b", function() { return c2; }); var n3 = r4(1), i3 = r4(0); function o3(e5, t5) { return t5 && t5.constructor === e5; } var a3 = Object(i3.c)("length"), s3 = Object(i3.j)(o3, String); function u2(e5) { return void 0 !== e5; } function c2(e5, t5) { return t5 instanceof Object && Object(n3.a)(function(e6) { return e6 in t5; }, e5); } }, function(e4, t4, r4) { r4.d(t4, "f", function() { return i3; }), r4.d(t4, "d", function() { return o3; }), r4.d(t4, "g", function() { return a3; }), r4.d(t4, "e", function() { return s3; }), r4.d(t4, "b", function() { return u2; }), r4.d(t4, "h", function() { return c2; }), r4.d(t4, "i", function() { return f2; }), r4.d(t4, "c", function() { return d2; }), r4.d(t4, "m", function() { return l2; }), r4.d(t4, "n", function() { return h2; }), r4.d(t4, "a", function() { return p2; }), r4.d(t4, "j", function() { return b2; }), r4.d(t4, "l", function() { return y2; }), r4.d(t4, "k", function() { return v2; }), r4.d(t4, "o", function() { return m2; }); var n3 = 1, i3 = n3++, o3 = n3++, a3 = n3++, s3 = n3++, u2 = "fail", c2 = n3++, f2 = n3++, d2 = "start", l2 = "data", h2 = "end", p2 = n3++, b2 = n3++, y2 = n3++, v2 = n3++; function m2(e5, t5, r5) { try { var n4 = JSON.parse(t5); } catch (e6) { } return { statusCode: e5, body: t5, jsonBody: n4, thrown: r5 }; } }, function(e4, t4, r4) { r4.d(t4, "b", function() { return i3; }), r4.d(t4, "a", function() { return o3; }), r4.d(t4, "c", function() { return a3; }); var n3 = r4(0); function i3(e5, t5) { return { key: e5, node: t5 }; } var o3 = Object(n3.c)("key"), a3 = Object(n3.c)("node"); }, function(e4, t4, r4) { r4.d(t4, "a", function() { return u2; }); var n3 = r4(1), i3 = r4(0), o3 = r4(2), a3 = r4(8), s3 = r4(9); function u2(e5) { var t5 = Object(n3.h)("resume", "pause", "pipe"), r5 = Object(i3.j)(o3.b, t5); return e5 ? r5(e5) || Object(o3.d)(e5) ? Object(a3.a)(s3.a, e5) : Object(a3.a)(s3.a, e5.url, e5.method, e5.body, e5.headers, e5.withCredentials, e5.cached) : Object(s3.a)(); } u2.drop = function() { return u2.drop; }; }, function(e4, t4, r4) { r4.d(t4, "b", function() { return u2; }), r4.d(t4, "a", function() { return s3; }); var n3 = r4(3), i3 = r4(4), o3 = r4(2), a3 = r4(1), s3 = {}; function u2(e5) { var t5 = e5(n3.f).emit, r5 = e5(n3.d).emit, u3 = e5(n3.i).emit, c2 = e5(n3.h).emit; function f2(e6, t6, r6) { Object(i3.c)(Object(a3.g)(e6))[t6] = r6; } function d2(e6, r6, n4) { e6 && f2(e6, r6, n4); var o4 = Object(a3.d)(Object(i3.b)(r6, n4), e6); return t5(o4), o4; } var l2 = {}; return l2[n3.l] = function(e6, t6) { if (!e6) return u3(t6), d2(e6, s3, t6); var r6 = function(e7, t7) { var r7 = Object(i3.c)(Object(a3.g)(e7)); return Object(o3.c)(Array, r7) ? d2(e7, Object(o3.e)(r7), t7) : e7; }(e6, t6), n4 = Object(a3.l)(r6), c3 = Object(i3.a)(Object(a3.g)(r6)); return f2(n4, c3, t6), Object(a3.d)(Object(i3.b)(c3, t6), n4); }, l2[n3.k] = function(e6) { return r5(e6), Object(a3.l)(e6) || c2(Object(i3.c)(Object(a3.g)(e6))); }, l2[n3.j] = d2, l2; } }, function(e4, t4, r4) { Object.defineProperty(t4, "__esModule", { value: true }); var n3 = r4(5); t4.default = n3.a; }, function(e4, t4, r4) { r4.d(t4, "a", function() { return i3; }); var n3 = r4(2); function i3(e5, t5, r5, i4, o3, a3, s3) { return o3 = o3 ? JSON.parse(JSON.stringify(o3)) : {}, i4 ? (Object(n3.d)(i4) || (i4 = JSON.stringify(i4), o3["Content-Type"] = o3["Content-Type"] || "application/json"), o3["Content-Length"] = o3["Content-Length"] || i4.length) : i4 = null, e5(r5 || "GET", function(e6, t6) { return false === t6 && (-1 === e6.indexOf("?") ? e6 += "?" : e6 += "&", e6 += "_=" + (/* @__PURE__ */ new Date()).getTime()), e6; }(t5, s3), i4, o3, a3 || false); } }, function(e4, t4, r4) { r4.d(t4, "a", function() { return d2; }); var n3 = r4(10), i3 = r4(12), o3 = r4(6), a3 = r4(13), s3 = r4(14), u2 = r4(16), c2 = r4(17), f2 = r4(18); function d2(e5, t5, r5, d3, l2) { var h2 = Object(n3.a)(); return t5 && Object(f2.b)(h2, Object(f2.a)(), e5, t5, r5, d3, l2), Object(c2.a)(h2), Object(i3.a)(h2, Object(o3.b)(h2)), Object(a3.a)(h2, s3.a), Object(u2.a)(h2, t5); } }, function(e4, t4, r4) { r4.d(t4, "a", function() { return o3; }); var n3 = r4(11), i3 = r4(0); function o3() { var e5 = {}, t5 = o4("newListener"), r5 = o4("removeListener"); function o4(i4) { return e5[i4] = Object(n3.a)(i4, t5, r5), e5[i4]; } function a3(t6) { return e5[t6] || o4(t6); } return ["emit", "on", "un"].forEach(function(e6) { a3[e6] = Object(i3.k)(function(t6, r6) { Object(i3.b)(r6, a3(t6)[e6]); }); }), a3; } }, function(e4, t4, r4) { r4.d(t4, "a", function() { return a3; }); var n3 = r4(1), i3 = r4(2), o3 = r4(0); function a3(e5, t5, r5) { var a4, s3; function u2(e6) { return function(t6) { return t6.id === e6; }; } return { on: function(r6, i4) { var o4 = { listener: r6, id: i4 || r6 }; return t5 && t5.emit(e5, r6, o4.id), a4 = Object(n3.d)(o4, a4), s3 = Object(n3.d)(r6, s3), this; }, emit: function() { Object(n3.b)(s3, arguments); }, un: function(t6) { var i4; a4 = Object(n3.m)(a4, u2(t6), function(e6) { i4 = e6; }), i4 && (s3 = Object(n3.m)(s3, function(e6) { return e6 === i4.listener; }), r5 && r5.emit(e5, i4.listener, i4.id)); }, listeners: function() { return s3; }, hasListener: function(e6) { var t6 = e6 ? u2(e6) : o3.a; return Object(i3.a)(Object(n3.e)(t6, a4)); } }; } }, function(e4, t4, r4) { r4.d(t4, "a", function() { return a3; }); var n3 = r4(4), i3 = r4(3), o3 = r4(1); function a3(e5, t5) { var r5, a4 = {}; function s3(e6) { return function(t6) { r5 = e6(r5, t6); }; } for (var u2 in t5) e5(u2).on(s3(t5[u2]), a4); e5(i3.g).on(function(e6) { var t6 = Object(o3.g)(r5), i4 = Object(n3.a)(t6), a5 = Object(o3.l)(r5); a5 && (Object(n3.c)(Object(o3.g)(a5))[i4] = e6); }), e5(i3.e).on(function() { var e6 = Object(o3.g)(r5), t6 = Object(n3.a)(e6), i4 = Object(o3.l)(r5); i4 && delete Object(n3.c)(Object(o3.g)(i4))[t6]; }), e5(i3.a).on(function() { for (var r6 in t5) e5(r6).un(a4); }); } }, function(e4, t4, r4) { r4.d(t4, "a", function() { return a3; }); var n3 = r4(3), i3 = r4(1), o3 = r4(4); function a3(e5, t5) { var r5 = { node: e5(n3.d), path: e5(n3.f) }; e5("newListener").on(function(n4) { var a4 = /(node|path):(.*)/.exec(n4); if (a4) { var s3 = r5[a4[1]]; s3.hasListener(n4) || function(t6, r6, n5) { var a5 = e5(t6).emit; r6.on(function(e6) { var t7 = n5(e6); false !== t7 && function(e7, t8, r7) { var n6 = Object(i3.k)(r7); e7(t8, Object(i3.i)(Object(i3.l)(Object(i3.j)(o3.a, n6))), Object(i3.i)(Object(i3.j)(o3.c, n6))); }(a5, Object(o3.c)(t7), e6); }, t6), e5("removeListener").on(function(n6) { n6 === t6 && (e5(n6).listeners() || r6.un(t6)); }); }(n4, s3, t5(a4[2])); } }); } }, function(e4, t4, r4) { r4.d(t4, "a", function() { return c2; }); var n3 = r4(0), i3 = r4(1), o3 = r4(4), a3 = r4(2), s3 = r4(6), u2 = r4(15), c2 = Object(u2.a)(function(e5, t5, r5, u3, c3) { var f2 = 1, d2 = Object(n3.d)(o3.a, i3.g), l2 = Object(n3.d)(o3.c, i3.g); function h2(e6, t6) { return t6[f2] ? Object(n3.g)(e6, i3.g) : e6; } function p2(e6) { return e6 === n3.a ? n3.a : Object(n3.g)(function(e7) { return d2(e7) !== s3.a; }, Object(n3.d)(e6, i3.l)); } function b2() { return function(e6) { return d2(e6) === s3.a; }; } function y2(e6, t6, r6, n4, o4) { var s4 = e6(r6); if (s4) { var u4 = function(e7, t7, r7) { return Object(i3.f)(function(e8, t8) { return t8(e8, r7); }, t7, e7); }(t6, n4, s4); return o4(r6.substr(Object(a3.e)(s4[0])), u4); } } function v2(e6, t6) { return Object(n3.j)(y2, e6, t6); } var m2 = Object(n3.h)(v2(e5, Object(i3.h)(h2, function(e6, t6) { var r6 = t6[3]; if (!r6) return e6; var o4 = Object(n3.j)(a3.b, Object(i3.c)(r6.split(/\W+/))), s4 = Object(n3.d)(o4, l2); return Object(n3.g)(s4, e6); }, function(e6, t6) { var r6 = t6[2], i4 = r6 && "*" !== r6 ? function(e7) { return String(d2(e7)) === r6; } : n3.a; return Object(n3.g)(i4, e6); }, p2)), v2(t5, Object(i3.h)(function(e6) { if (e6 === n3.a) return n3.a; var t6 = b2(), r6 = e6, i4 = p2(function(e7) { return o4(e7); }), o4 = Object(n3.h)(t6, r6, i4); return o4; })), v2(r5, Object(i3.h)()), v2(u3, Object(i3.h)(h2, b2)), v2(c3, Object(i3.h)(function(e6) { return function(t6) { var r6 = e6(t6); return true === r6 ? Object(i3.g)(t6) : r6; }; })), function(e6) { throw Error('"' + e6 + '" could not be tokenised'); }); function g2(e6, t6) { return t6; } function w2(e6, t6) { return m2(e6, t6, e6 ? w2 : g2); } return function(e6) { try { return w2(e6, n3.a); } catch (t6) { throw Error('Could not compile "' + e6 + '" because ' + t6.message); } }; }); }, function(e4, t4, r4) { r4.d(t4, "a", function() { return b2; }); var n3, i3, o3, a3, s3, u2, c2, f2, d2, l2, h2, p2 = r4(0), b2 = (n3 = Object(p2.k)(function(e5) { return e5.unshift(/^/), (t5 = RegExp(e5.map(Object(p2.c)("source")).join(""))).exec.bind(t5); var t5; }), a3 = n3(i3 = /(\$?)/, /([\w-_]+|\*)/, o3 = /(?:{([\w ]*?)})?/), s3 = n3(i3, /\["([^"]+)"\]/, o3), u2 = n3(i3, /\[(\d+|\*)\]/, o3), c2 = n3(i3, /()/, /{([\w ]*?)}/), f2 = n3(/\.\./), d2 = n3(/\./), l2 = n3(i3, /!/), h2 = n3(/$/), function(e5) { return e5(Object(p2.h)(a3, s3, u2, c2), f2, d2, l2, h2); }); }, function(e4, t4, r4) { r4.d(t4, "a", function() { return s3; }); var n3 = r4(3), i3 = r4(0), o3 = r4(2), a3 = r4(5); function s3(e5, t5) { var r5, s4 = /^(node|path):./, u2 = e5(n3.h), c2 = e5(n3.e).emit, f2 = e5(n3.g).emit, d2 = Object(i3.k)(function(t6, n4) { if (r5[t6]) Object(i3.b)(n4, r5[t6]); else { var o4 = e5(t6), a4 = n4[0]; s4.test(t6) ? l2(o4, p2(a4)) : o4.on(a4); } return r5; }); function l2(e6, t6, n4) { n4 = n4 || t6; var o4 = h2(t6); return e6.on(function() { var t7 = false; r5.forget = function() { t7 = true; }, Object(i3.b)(arguments, o4), delete r5.forget, t7 && e6.un(n4); }, n4), r5; } function h2(e6) { return function() { try { return e6.apply(r5, arguments); } catch (e7) { setTimeout(function() { throw new Error(e7.message); }); } }; } function p2(e6) { return function() { var t6 = e6.apply(this, arguments); Object(o3.a)(t6) && (t6 === a3.a.drop ? c2() : f2(t6)); }; } function b2(t6, r6, n4) { var i4; i4 = "node" === t6 ? p2(n4) : n4, l2(function(t7, r7) { return e5(t7 + ":" + r7); }(t6, r6), i4, n4); } function y2(e6, t6, n4) { return Object(o3.d)(t6) ? b2(e6, t6, n4) : function(e7, t7) { for (var r6 in t7) b2(e7, r6, t7[r6]); }(e6, t6), r5; } return e5(n3.i).on(function(e6) { r5.root = Object(i3.f)(e6); }), e5(n3.c).on(function(e6, t6) { r5.header = function(e7) { return e7 ? t6[e7] : t6; }; }), r5 = { on: d2, addListener: d2, removeListener: function(t6, n4, i4) { if ("done" === t6) u2.un(n4); else if ("node" === t6 || "path" === t6) e5.un(t6 + ":" + n4, i4); else { var o4 = n4; e5(t6).un(o4); } return r5; }, emit: e5.emit, node: Object(i3.j)(y2, "node"), path: Object(i3.j)(y2, "path"), done: Object(i3.j)(l2, u2), start: Object(i3.j)(function(t6, n4) { return e5(t6).on(h2(n4), n4), r5; }, n3.c), fail: e5(n3.b).on, abort: e5(n3.a).emit, header: i3.i, root: i3.i, source: t5 }; } }, function(e4, t4, r4) { r4.d(t4, "a", function() { return i3; }); var n3 = r4(3); function i3(e5) { var t5, r5, i4, o3, a3 = e5(n3.j).emit, s3 = e5(n3.l).emit, u2 = e5(n3.k).emit, c2 = e5(n3.b).emit, f2 = 65536, d2 = /[\\"\n]/g, l2 = 0, h2 = l2++, p2 = l2++, b2 = l2++, y2 = l2++, v2 = l2++, m2 = l2++, g2 = l2++, w2 = l2++, k2 = l2++, _2 = l2++, A2 = l2++, E2 = l2++, S2 = l2++, x2 = l2++, B2 = l2++, O2 = l2++, P2 = l2++, I2 = l2++, T2 = l2++, C2 = l2++, M2 = f2, R2 = "", U2 = false, N2 = false, j2 = h2, L2 = [], F2 = null, D2 = 0, H2 = 0, z2 = 0, q2 = 0, K2 = 1; function G2(e6) { void 0 !== o3 && (s3(o3), u2(), o3 = void 0), t5 = Error(e6 + "\nLn: " + K2 + "\nCol: " + q2 + "\nChr: " + r5), c2(Object(n3.o)(void 0, void 0, t5)); } function V2(e6) { return "\r" === e6 || "\n" === e6 || " " === e6 || " " === e6; } e5(n3.m).on(function(e6) { if (!t5) { if (N2) return G2("Cannot write after close"); var n4, c3 = 0; for (r5 = e6[0]; r5 && (c3 > 0 && (i4 = r5), r5 = e6[c3++]); ) switch (z2++, "\n" === r5 ? (K2++, q2 = 0) : q2++, j2) { case h2: if ("{" === r5) j2 = b2; else if ("[" === r5) j2 = v2; else if (!V2(r5)) return G2("Non-whitespace before {[."); continue; case w2: case b2: if (V2(r5)) continue; if (j2 === w2) L2.push(k2); else { if ("}" === r5) { s3({}), u2(), j2 = L2.pop() || p2; continue; } L2.push(y2); } if ('"' !== r5) return G2('Malformed object key should start with " '); j2 = g2; continue; case k2: case y2: if (V2(r5)) continue; if (":" === r5) j2 === y2 ? (L2.push(y2), void 0 !== o3 && (s3({}), a3(o3), o3 = void 0), H2++) : void 0 !== o3 && (a3(o3), o3 = void 0), j2 = p2; else if ("}" === r5) void 0 !== o3 && (s3(o3), u2(), o3 = void 0), u2(), H2--, j2 = L2.pop() || p2; else { if ("," !== r5) return G2("Bad object"); j2 === y2 && L2.push(y2), void 0 !== o3 && (s3(o3), u2(), o3 = void 0), j2 = w2; } continue; case v2: case p2: if (V2(r5)) continue; if (j2 === v2) { if (s3([]), H2++, j2 = p2, "]" === r5) { u2(), H2--, j2 = L2.pop() || p2; continue; } L2.push(m2); } if ('"' === r5) j2 = g2; else if ("{" === r5) j2 = b2; else if ("[" === r5) j2 = v2; else if ("t" === r5) j2 = _2; else if ("f" === r5) j2 = S2; else if ("n" === r5) j2 = P2; else if ("-" === r5) R2 += r5; else if ("0" === r5) R2 += r5, j2 = 20; else { if (-1 === "123456789".indexOf(r5)) return G2("Bad value"); R2 += r5, j2 = 20; } continue; case m2: if ("," === r5) L2.push(m2), void 0 !== o3 && (s3(o3), u2(), o3 = void 0), j2 = p2; else { if ("]" !== r5) { if (V2(r5)) continue; return G2("Bad array"); } void 0 !== o3 && (s3(o3), u2(), o3 = void 0), u2(), H2--, j2 = L2.pop() || p2; } continue; case g2: void 0 === o3 && (o3 = ""); var l3 = c3 - 1; e: for (; ; ) { for (; D2 > 0; ) if (F2 += r5, r5 = e6.charAt(c3++), 4 === D2 ? (o3 += String.fromCharCode(parseInt(F2, 16)), D2 = 0, l3 = c3 - 1) : D2++, !r5) break e; if ('"' === r5 && !U2) { j2 = L2.pop() || p2, o3 += e6.substring(l3, c3 - 1); break; } if (!("\\" !== r5 || U2 || (U2 = true, o3 += e6.substring(l3, c3 - 1), r5 = e6.charAt(c3++)))) break; if (U2) { if (U2 = false, "n" === r5 ? o3 += "\n" : "r" === r5 ? o3 += "\r" : "t" === r5 ? o3 += " " : "f" === r5 ? o3 += "\f" : "b" === r5 ? o3 += "\b" : "u" === r5 ? (D2 = 1, F2 = "") : o3 += r5, r5 = e6.charAt(c3++), l3 = c3 - 1, r5) continue; break; } d2.lastIndex = c3; var Z2 = d2.exec(e6); if (!Z2) { c3 = e6.length + 1, o3 += e6.substring(l3, c3 - 1); break; } if (c3 = Z2.index + 1, !(r5 = e6.charAt(Z2.index))) { o3 += e6.substring(l3, c3 - 1); break; } } continue; case _2: if (!r5) continue; if ("r" !== r5) return G2("Invalid true started with t" + r5); j2 = A2; continue; case A2: if (!r5) continue; if ("u" !== r5) return G2("Invalid true started with tr" + r5); j2 = E2; continue; case E2: if (!r5) continue; if ("e" !== r5) return G2("Invalid true started with tru" + r5); s3(true), u2(), j2 = L2.pop() || p2; continue; case S2: if (!r5) continue; if ("a" !== r5) return G2("Invalid false started with f" + r5); j2 = x2; continue; case x2: if (!r5) continue; if ("l" !== r5) return G2("Invalid false started with fa" + r5); j2 = B2; continue; case B2: if (!r5) continue; if ("s" !== r5) return G2("Invalid false started with fal" + r5); j2 = O2; continue; case O2: if (!r5) continue; if ("e" !== r5) return G2("Invalid false started with fals" + r5); s3(false), u2(), j2 = L2.pop() || p2; continue; case P2: if (!r5) continue; if ("u" !== r5) return G2("Invalid null started with n" + r5); j2 = I2; continue; case I2: if (!r5) continue; if ("l" !== r5) return G2("Invalid null started with nu" + r5); j2 = T2; continue; case T2: if (!r5) continue; if ("l" !== r5) return G2("Invalid null started with nul" + r5); s3(null), u2(), j2 = L2.pop() || p2; continue; case C2: if ("." !== r5) return G2("Leading zero not followed by ."); R2 += r5, j2 = 20; continue; case 20: if (-1 !== "0123456789".indexOf(r5)) R2 += r5; else if ("." === r5) { if (-1 !== R2.indexOf(".")) return G2("Invalid number has two dots"); R2 += r5; } else if ("e" === r5 || "E" === r5) { if (-1 !== R2.indexOf("e") || -1 !== R2.indexOf("E")) return G2("Invalid number has two exponential"); R2 += r5; } else if ("+" === r5 || "-" === r5) { if ("e" !== i4 && "E" !== i4) return G2("Invalid symbol in number"); R2 += r5; } else R2 && (s3(parseFloat(R2)), u2(), R2 = ""), c3--, j2 = L2.pop() || p2; continue; default: return G2("Unknown state: " + j2); } z2 >= M2 && (n4 = 0, void 0 !== o3 && o3.length > f2 && (G2("Max buffer length exceeded: textNode"), n4 = Math.max(n4, o3.length)), R2.length > f2 && (G2("Max buffer length exceeded: numberNode"), n4 = Math.max(n4, R2.length)), M2 = f2 - n4 + z2); } }), e5(n3.n).on(function() { if (j2 === h2) return s3({}), u2(), void (N2 = true); j2 === p2 && 0 === H2 || G2("Unexpected end"), void 0 !== o3 && (s3(o3), u2(), o3 = void 0), N2 = true; }); } }, function(e4, t4, r4) { r4.d(t4, "a", function() { return u2; }), r4.d(t4, "b", function() { return c2; }); var n3 = r4(19), i3 = r4(3), o3 = r4(2), a3 = r4(20), s3 = r4(0); function u2() { return new XMLHttpRequest(); } function c2(e5, t5, r5, u3, c3, f2, d2) { var l2 = e5(i3.m).emit, h2 = e5(i3.b).emit, p2 = 0, b2 = true; function y2() { if ("2" === String(t5.status)[0]) { var e6 = t5.responseText, r6 = (" " + e6.substr(p2)).substr(1); r6 && l2(r6), p2 = Object(o3.e)(e6); } } function v2(t6) { try { b2 && e5(i3.c).emit(t6.status, Object(a3.a)(t6.getAllResponseHeaders())), b2 = false; } catch (e6) { } } e5(i3.a).on(function() { t5.onreadystatechange = null, t5.abort(); }), "onprogress" in t5 && (t5.onprogress = y2), t5.onreadystatechange = function() { switch (t5.readyState) { case 2: case 3: return v2(t5); case 4: v2(t5), "2" === String(t5.status)[0] ? (y2(), e5(i3.n).emit()) : h2(Object(i3.o)(t5.status, t5.responseText)); } }; try { for (var m2 in t5.open(r5, u3, true), f2) t5.setRequestHeader(m2, f2[m2]); Object(n3.a)(window.location, Object(n3.b)(u3)) || t5.setRequestHeader("X-Requested-With", "XMLHttpRequest"), t5.withCredentials = d2, t5.send(c3); } catch (e6) { window.setTimeout(Object(s3.j)(h2, Object(i3.o)(void 0, void 0, e6)), 0); } } }, function(e4, t4, r4) { function n3(e5, t5) { function r5(t6) { return String(t6.port || { "http:": 80, "https:": 443 }[t6.protocol || e5.protocol]); } return !!(t5.protocol && t5.protocol !== e5.protocol || t5.host && t5.host !== e5.host || t5.host && r5(t5) !== r5(e5)); } function i3(e5) { var t5 = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e5) || []; return { protocol: t5[1] || "", host: t5[2] || "", port: t5[3] || "" }; } r4.d(t4, "a", function() { return n3; }), r4.d(t4, "b", function() { return i3; }); }, function(e4, t4, r4) { function n3(e5) { var t5 = {}; return e5 && e5.split("\r\n").forEach(function(e6) { var r5 = e6.indexOf(": "); t5[e6.substring(0, r5)] = e6.substring(r5 + 2); }), t5; } r4.d(t4, "a", function() { return n3; }); }]).default; }, "object" === (0, s2.default)(t3) && "object" === (0, s2.default)(e3) ? e3.exports = a2() : (i2 = [], void 0 === (o2 = "function" == typeof (n2 = a2) ? n2.apply(t3, i2) : n2) || (e3.exports = o2)); }, 21307: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array; function o2(e4, t4) { return Object.prototype.hasOwnProperty.call(e4, t4); } t3.assign = function(e4) { for (var t4 = Array.prototype.slice.call(arguments, 1); t4.length; ) { var r4 = t4.shift(); if (r4) { if ("object" !== (0, n2.default)(r4)) throw new TypeError(r4 + "must be non-object"); for (var i3 in r4) o2(r4, i3) && (e4[i3] = r4[i3]); } } return e4; }, t3.shrinkBuf = function(e4, t4) { return e4.length === t4 ? e4 : e4.subarray ? e4.subarray(0, t4) : (e4.length = t4, e4); }; var a2 = { arraySet: function(e4, t4, r4, n3, i3) { if (t4.subarray && e4.subarray) e4.set(t4.subarray(r4, r4 + n3), i3); else for (var o3 = 0; o3 < n3; o3++) e4[i3 + o3] = t4[r4 + o3]; }, flattenChunks: function(e4) { var t4, r4, n3, i3, o3, a3; for (n3 = 0, t4 = 0, r4 = e4.length; t4 < r4; t4++) n3 += e4[t4].length; for (a3 = new Uint8Array(n3), i3 = 0, t4 = 0, r4 = e4.length; t4 < r4; t4++) o3 = e4[t4], a3.set(o3, i3), i3 += o3.length; return a3; } }, s2 = { arraySet: function(e4, t4, r4, n3, i3) { for (var o3 = 0; o3 < n3; o3++) e4[i3 + o3] = t4[r4 + o3]; }, flattenChunks: function(e4) { return [].concat.apply([], e4); } }; t3.setTyped = function(e4) { e4 ? (t3.Buf8 = Uint8Array, t3.Buf16 = Uint16Array, t3.Buf32 = Int32Array, t3.assign(t3, a2)) : (t3.Buf8 = Array, t3.Buf16 = Array, t3.Buf32 = Array, t3.assign(t3, s2)); }, t3.setTyped(i2); }, 57506: (e3) => { e3.exports = function(e4, t3, r3, n2) { for (var i2 = 65535 & e4 | 0, o2 = e4 >>> 16 & 65535 | 0, a2 = 0; 0 !== r3; ) { r3 -= a2 = r3 > 2e3 ? 2e3 : r3; do { o2 = o2 + (i2 = i2 + t3[n2++] | 0) | 0; } while (--a2); i2 %= 65521, o2 %= 65521; } return i2 | o2 << 16 | 0; }; }, 29806: (e3) => { e3.exports = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 }; }, 28548: (e3) => { var t3 = function() { for (var e4, t4 = [], r3 = 0; r3 < 256; r3++) { e4 = r3; for (var n2 = 0; n2 < 8; n2++) e4 = 1 & e4 ? 3988292384 ^ e4 >>> 1 : e4 >>> 1; t4[r3] = e4; } return t4; }(); e3.exports = function(e4, r3, n2, i2) { var o2 = t3, a2 = i2 + n2; e4 ^= -1; for (var s2 = i2; s2 < a2; s2++) e4 = e4 >>> 8 ^ o2[255 & (e4 ^ r3[s2])]; return -1 ^ e4; }; }, 54151: (e3, t3, r3) => { var n2, i2 = r3(21307), o2 = r3(25280), a2 = r3(57506), s2 = r3(28548), u2 = r3(78021), c2 = 0, f2 = 4, d2 = 0, l2 = -2, h2 = -1, p2 = 1, b2 = 4, y2 = 2, v2 = 8, m2 = 9, g2 = 286, w2 = 30, k2 = 19, _2 = 2 * g2 + 1, A2 = 15, E2 = 3, S2 = 258, x2 = S2 + E2 + 1, B2 = 42, O2 = 103, P2 = 113, I2 = 666, T2 = 1, C2 = 2, M2 = 3, R2 = 4; function U2(e4, t4) { return e4.msg = u2[t4], t4; } function N2(e4) { return (e4 << 1) - (e4 > 4 ? 9 : 0); } function j2(e4) { for (var t4 = e4.length; --t4 >= 0; ) e4[t4] = 0; } function L2(e4) { var t4 = e4.state, r4 = t4.pending; r4 > e4.avail_out && (r4 = e4.avail_out), 0 !== r4 && (i2.arraySet(e4.output, t4.pending_buf, t4.pending_out, r4, e4.next_out), e4.next_out += r4, t4.pending_out += r4, e4.total_out += r4, e4.avail_out -= r4, t4.pending -= r4, 0 === t4.pending && (t4.pending_out = 0)); } function F2(e4, t4) { o2._tr_flush_block(e4, e4.block_start >= 0 ? e4.block_start : -1, e4.strstart - e4.block_start, t4), e4.block_start = e4.strstart, L2(e4.strm); } function D2(e4, t4) { e4.pending_buf[e4.pending++] = t4; } function H2(e4, t4) { e4.pending_buf[e4.pending++] = t4 >>> 8 & 255, e4.pending_buf[e4.pending++] = 255 & t4; } function z2(e4, t4) { var r4, n3, i3 = e4.max_chain_length, o3 = e4.strstart, a3 = e4.prev_length, s3 = e4.nice_match, u3 = e4.strstart > e4.w_size - x2 ? e4.strstart - (e4.w_size - x2) : 0, c3 = e4.window, f3 = e4.w_mask, d3 = e4.prev, l3 = e4.strstart + S2, h3 = c3[o3 + a3 - 1], p3 = c3[o3 + a3]; e4.prev_length >= e4.good_match && (i3 >>= 2), s3 > e4.lookahead && (s3 = e4.lookahead); do { if (c3[(r4 = t4) + a3] === p3 && c3[r4 + a3 - 1] === h3 && c3[r4] === c3[o3] && c3[++r4] === c3[o3 + 1]) { o3 += 2, r4++; do { } while (c3[++o3] === c3[++r4] && c3[++o3] === c3[++r4] && c3[++o3] === c3[++r4] && c3[++o3] === c3[++r4] && c3[++o3] === c3[++r4] && c3[++o3] === c3[++r4] && c3[++o3] === c3[++r4] && c3[++o3] === c3[++r4] && o3 < l3); if (n3 = S2 - (l3 - o3), o3 = l3 - S2, n3 > a3) { if (e4.match_start = t4, a3 = n3, n3 >= s3) break; h3 = c3[o3 + a3 - 1], p3 = c3[o3 + a3]; } } } while ((t4 = d3[t4 & f3]) > u3 && 0 != --i3); return a3 <= e4.lookahead ? a3 : e4.lookahead; } function q2(e4) { var t4, r4, n3, o3, u3, c3, f3, d3, l3, h3, p3 = e4.w_size; do { if (o3 = e4.window_size - e4.lookahead - e4.strstart, e4.strstart >= p3 + (p3 - x2)) { i2.arraySet(e4.window, e4.window, p3, p3, 0), e4.match_start -= p3, e4.strstart -= p3, e4.block_start -= p3, t4 = r4 = e4.hash_size; do { n3 = e4.head[--t4], e4.head[t4] = n3 >= p3 ? n3 - p3 : 0; } while (--r4); t4 = r4 = p3; do { n3 = e4.prev[--t4], e4.prev[t4] = n3 >= p3 ? n3 - p3 : 0; } while (--r4); o3 += p3; } if (0 === e4.strm.avail_in) break; if (c3 = e4.strm, f3 = e4.window, d3 = e4.strstart + e4.lookahead, l3 = o3, h3 = void 0, (h3 = c3.avail_in) > l3 && (h3 = l3), r4 = 0 === h3 ? 0 : (c3.avail_in -= h3, i2.arraySet(f3, c3.input, c3.next_in, h3, d3), 1 === c3.state.wrap ? c3.adler = a2(c3.adler, f3, h3, d3) : 2 === c3.state.wrap && (c3.adler = s2(c3.adler, f3, h3, d3)), c3.next_in += h3, c3.total_in += h3, h3), e4.lookahead += r4, e4.lookahead + e4.insert >= E2) for (u3 = e4.strstart - e4.insert, e4.ins_h = e4.window[u3], e4.ins_h = (e4.ins_h << e4.hash_shift ^ e4.window[u3 + 1]) & e4.hash_mask; e4.insert && (e4.ins_h = (e4.ins_h << e4.hash_shift ^ e4.window[u3 + E2 - 1]) & e4.hash_mask, e4.prev[u3 & e4.w_mask] = e4.head[e4.ins_h], e4.head[e4.ins_h] = u3, u3++, e4.insert--, !(e4.lookahead + e4.insert < E2)); ) ; } while (e4.lookahead < x2 && 0 !== e4.strm.avail_in); } function K2(e4, t4) { for (var r4, n3; ; ) { if (e4.lookahead < x2) { if (q2(e4), e4.lookahead < x2 && t4 === c2) return T2; if (0 === e4.lookahead) break; } if (r4 = 0, e4.lookahead >= E2 && (e4.ins_h = (e4.ins_h << e4.hash_shift ^ e4.window[e4.strstart + E2 - 1]) & e4.hash_mask, r4 = e4.prev[e4.strstart & e4.w_mask] = e4.head[e4.ins_h], e4.head[e4.ins_h] = e4.strstart), 0 !== r4 && e4.strstart - r4 <= e4.w_size - x2 && (e4.match_length = z2(e4, r4)), e4.match_length >= E2) if (n3 = o2._tr_tally(e4, e4.strstart - e4.match_start, e4.match_length - E2), e4.lookahead -= e4.match_length, e4.match_length <= e4.max_lazy_match && e4.lookahead >= E2) { e4.match_length--; do { e4.strstart++, e4.ins_h = (e4.ins_h << e4.hash_shift ^ e4.window[e4.strstart + E2 - 1]) & e4.hash_mask, r4 = e4.prev[e4.strstart & e4.w_mask] = e4.head[e4.ins_h], e4.head[e4.ins_h] = e4.strstart; } while (0 != --e4.match_length); e4.strstart++; } else e4.strstart += e4.match_length, e4.match_length = 0, e4.ins_h = e4.window[e4.strstart], e4.ins_h = (e4.ins_h << e4.hash_shift ^ e4.window[e4.strstart + 1]) & e4.hash_mask; else n3 = o2._tr_tally(e4, 0, e4.window[e4.strstart]), e4.lookahead--, e4.strstart++; if (n3 && (F2(e4, false), 0 === e4.strm.avail_out)) return T2; } return e4.insert = e4.strstart < E2 - 1 ? e4.strstart : E2 - 1, t4 === f2 ? (F2(e4, true), 0 === e4.strm.avail_out ? M2 : R2) : e4.last_lit && (F2(e4, false), 0 === e4.strm.avail_out) ? T2 : C2; } function G2(e4, t4) { for (var r4, n3, i3; ; ) { if (e4.lookahead < x2) { if (q2(e4), e4.lookahead < x2 && t4 === c2) return T2; if (0 === e4.lookahead) break; } if (r4 = 0, e4.lookahead >= E2 && (e4.ins_h = (e4.ins_h << e4.hash_shift ^ e4.window[e4.strstart + E2 - 1]) & e4.hash_mask, r4 = e4.prev[e4.strstart & e4.w_mask] = e4.head[e4.ins_h], e4.head[e4.ins_h] = e4.strstart), e4.prev_length = e4.match_length, e4.prev_match = e4.match_start, e4.match_length = E2 - 1, 0 !== r4 && e4.prev_length < e4.max_lazy_match && e4.strstart - r4 <= e4.w_size - x2 && (e4.match_length = z2(e4, r4), e4.match_length <= 5 && (e4.strategy === p2 || e4.match_length === E2 && e4.strstart - e4.match_start > 4096) && (e4.match_length = E2 - 1)), e4.prev_length >= E2 && e4.match_length <= e4.prev_length) { i3 = e4.strstart + e4.lookahead - E2, n3 = o2._tr_tally(e4, e4.strstart - 1 - e4.prev_match, e4.prev_length - E2), e4.lookahead -= e4.prev_length - 1, e4.prev_length -= 2; do { ++e4.strstart <= i3 && (e4.ins_h = (e4.ins_h << e4.hash_shift ^ e4.window[e4.strstart + E2 - 1]) & e4.hash_mask, r4 = e4.prev[e4.strstart & e4.w_mask] = e4.head[e4.ins_h], e4.head[e4.ins_h] = e4.strstart); } while (0 != --e4.prev_length); if (e4.match_available = 0, e4.match_length = E2 - 1, e4.strstart++, n3 && (F2(e4, false), 0 === e4.strm.avail_out)) return T2; } else if (e4.match_available) { if ((n3 = o2._tr_tally(e4, 0, e4.window[e4.strstart - 1])) && F2(e4, false), e4.strstart++, e4.lookahead--, 0 === e4.strm.avail_out) return T2; } else e4.match_available = 1, e4.strstart++, e4.lookahead--; } return e4.match_available && (n3 = o2._tr_tally(e4, 0, e4.window[e4.strstart - 1]), e4.match_available = 0), e4.insert = e4.strstart < E2 - 1 ? e4.strstart : E2 - 1, t4 === f2 ? (F2(e4, true), 0 === e4.strm.avail_out ? M2 : R2) : e4.last_lit && (F2(e4, false), 0 === e4.strm.avail_out) ? T2 : C2; } function V2(e4, t4, r4, n3, i3) { this.good_length = e4, this.max_lazy = t4, this.nice_length = r4, this.max_chain = n3, this.func = i3; } function Z2() { this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = v2, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new i2.Buf16(2 * _2), this.dyn_dtree = new i2.Buf16(2 * (2 * w2 + 1)), this.bl_tree = new i2.Buf16(2 * (2 * k2 + 1)), j2(this.dyn_ltree), j2(this.dyn_dtree), j2(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new i2.Buf16(A2 + 1), this.heap = new i2.Buf16(2 * g2 + 1), j2(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new i2.Buf16(2 * g2 + 1), j2(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; } function W2(e4) { var t4; return e4 && e4.state ? (e4.total_in = e4.total_out = 0, e4.data_type = y2, (t4 = e4.state).pending = 0, t4.pending_out = 0, t4.wrap < 0 && (t4.wrap = -t4.wrap), t4.status = t4.wrap ? B2 : P2, e4.adler = 2 === t4.wrap ? 0 : 1, t4.last_flush = c2, o2._tr_init(t4), d2) : U2(e4, l2); } function J2(e4) { var t4, r4 = W2(e4); return r4 === d2 && ((t4 = e4.state).window_size = 2 * t4.w_size, j2(t4.head), t4.max_lazy_match = n2[t4.level].max_lazy, t4.good_match = n2[t4.level].good_length, t4.nice_match = n2[t4.level].nice_length, t4.max_chain_length = n2[t4.level].max_chain, t4.strstart = 0, t4.block_start = 0, t4.lookahead = 0, t4.insert = 0, t4.match_length = t4.prev_length = E2 - 1, t4.match_available = 0, t4.ins_h = 0), r4; } function Y2(e4, t4, r4, n3, o3, a3) { if (!e4) return l2; var s3 = 1; if (t4 === h2 && (t4 = 6), n3 < 0 ? (s3 = 0, n3 = -n3) : n3 > 15 && (s3 = 2, n3 -= 16), o3 < 1 || o3 > m2 || r4 !== v2 || n3 < 8 || n3 > 15 || t4 < 0 || t4 > 9 || a3 < 0 || a3 > b2) return U2(e4, l2); 8 === n3 && (n3 = 9); var u3 = new Z2(); return e4.state = u3, u3.strm = e4, u3.wrap = s3, u3.gzhead = null, u3.w_bits = n3, u3.w_size = 1 << u3.w_bits, u3.w_mask = u3.w_size - 1, u3.hash_bits = o3 + 7, u3.hash_size = 1 << u3.hash_bits, u3.hash_mask = u3.hash_size - 1, u3.hash_shift = ~~((u3.hash_bits + E2 - 1) / E2), u3.window = new i2.Buf8(2 * u3.w_size), u3.head = new i2.Buf16(u3.hash_size), u3.prev = new i2.Buf16(u3.w_size), u3.lit_bufsize = 1 << o3 + 6, u3.pending_buf_size = 4 * u3.lit_bufsize, u3.pending_buf = new i2.Buf8(u3.pending_buf_size), u3.d_buf = 1 * u3.lit_bufsize, u3.l_buf = 3 * u3.lit_bufsize, u3.level = t4, u3.strategy = a3, u3.method = r4, J2(e4); } n2 = [new V2(0, 0, 0, 0, function(e4, t4) { var r4 = 65535; for (r4 > e4.pending_buf_size - 5 && (r4 = e4.pending_buf_size - 5); ; ) { if (e4.lookahead <= 1) { if (q2(e4), 0 === e4.lookahead && t4 === c2) return T2; if (0 === e4.lookahead) break; } e4.strstart += e4.lookahead, e4.lookahead = 0; var n3 = e4.block_start + r4; if ((0 === e4.strstart || e4.strstart >= n3) && (e4.lookahead = e4.strstart - n3, e4.strstart = n3, F2(e4, false), 0 === e4.strm.avail_out)) return T2; if (e4.strstart - e4.block_start >= e4.w_size - x2 && (F2(e4, false), 0 === e4.strm.avail_out)) return T2; } return e4.insert = 0, t4 === f2 ? (F2(e4, true), 0 === e4.strm.avail_out ? M2 : R2) : (e4.strstart > e4.block_start && (F2(e4, false), e4.strm.avail_out), T2); }), new V2(4, 4, 8, 4, K2), new V2(4, 5, 16, 8, K2), new V2(4, 6, 32, 32, K2), new V2(4, 4, 16, 16, G2), new V2(8, 16, 32, 32, G2), new V2(8, 16, 128, 128, G2), new V2(8, 32, 128, 256, G2), new V2(32, 128, 258, 1024, G2), new V2(32, 258, 258, 4096, G2)], t3.deflateInit = function(e4, t4) { return Y2(e4, t4, v2, 15, 8, 0); }, t3.deflateInit2 = Y2, t3.deflateReset = J2, t3.deflateResetKeep = W2, t3.deflateSetHeader = function(e4, t4) { return e4 && e4.state ? 2 !== e4.state.wrap ? l2 : (e4.state.gzhead = t4, d2) : l2; }, t3.deflate = function(e4, t4) { var r4, i3, a3, u3; if (!e4 || !e4.state || t4 > 5 || t4 < 0) return e4 ? U2(e4, l2) : l2; if (i3 = e4.state, !e4.output || !e4.input && 0 !== e4.avail_in || i3.status === I2 && t4 !== f2) return U2(e4, 0 === e4.avail_out ? -5 : l2); if (i3.strm = e4, r4 = i3.last_flush, i3.last_flush = t4, i3.status === B2) if (2 === i3.wrap) e4.adler = 0, D2(i3, 31), D2(i3, 139), D2(i3, 8), i3.gzhead ? (D2(i3, (i3.gzhead.text ? 1 : 0) + (i3.gzhead.hcrc ? 2 : 0) + (i3.gzhead.extra ? 4 : 0) + (i3.gzhead.name ? 8 : 0) + (i3.gzhead.comment ? 16 : 0)), D2(i3, 255 & i3.gzhead.time), D2(i3, i3.gzhead.time >> 8 & 255), D2(i3, i3.gzhead.time >> 16 & 255), D2(i3, i3.gzhead.time >> 24 & 255), D2(i3, 9 === i3.level ? 2 : i3.strategy >= 2 || i3.level < 2 ? 4 : 0), D2(i3, 255 & i3.gzhead.os), i3.gzhead.extra && i3.gzhead.extra.length && (D2(i3, 255 & i3.gzhead.extra.length), D2(i3, i3.gzhead.extra.length >> 8 & 255)), i3.gzhead.hcrc && (e4.adler = s2(e4.adler, i3.pending_buf, i3.pending, 0)), i3.gzindex = 0, i3.status = 69) : (D2(i3, 0), D2(i3, 0), D2(i3, 0), D2(i3, 0), D2(i3, 0), D2(i3, 9 === i3.level ? 2 : i3.strategy >= 2 || i3.level < 2 ? 4 : 0), D2(i3, 3), i3.status = P2); else { var h3 = v2 + (i3.w_bits - 8 << 4) << 8; h3 |= (i3.strategy >= 2 || i3.level < 2 ? 0 : i3.level < 6 ? 1 : 6 === i3.level ? 2 : 3) << 6, 0 !== i3.strstart && (h3 |= 32), h3 += 31 - h3 % 31, i3.status = P2, H2(i3, h3), 0 !== i3.strstart && (H2(i3, e4.adler >>> 16), H2(i3, 65535 & e4.adler)), e4.adler = 1; } if (69 === i3.status) if (i3.gzhead.extra) { for (a3 = i3.pending; i3.gzindex < (65535 & i3.gzhead.extra.length) && (i3.pending !== i3.pending_buf_size || (i3.gzhead.hcrc && i3.pending > a3 && (e4.adler = s2(e4.adler, i3.pending_buf, i3.pending - a3, a3)), L2(e4), a3 = i3.pending, i3.pending !== i3.pending_buf_size)); ) D2(i3, 255 & i3.gzhead.extra[i3.gzindex]), i3.gzindex++; i3.gzhead.hcrc && i3.pending > a3 && (e4.adler = s2(e4.adler, i3.pending_buf, i3.pending - a3, a3)), i3.gzindex === i3.gzhead.extra.length && (i3.gzindex = 0, i3.status = 73); } else i3.status = 73; if (73 === i3.status) if (i3.gzhead.name) { a3 = i3.pending; do { if (i3.pending === i3.pending_buf_size && (i3.gzhead.hcrc && i3.pending > a3 && (e4.adler = s2(e4.adler, i3.pending_buf, i3.pending - a3, a3)), L2(e4), a3 = i3.pending, i3.pending === i3.pending_buf_size)) { u3 = 1; break; } u3 = i3.gzindex < i3.gzhead.name.length ? 255 & i3.gzhead.name.charCodeAt(i3.gzindex++) : 0, D2(i3, u3); } while (0 !== u3); i3.gzhead.hcrc && i3.pending > a3 && (e4.adler = s2(e4.adler, i3.pending_buf, i3.pending - a3, a3)), 0 === u3 && (i3.gzindex = 0, i3.status = 91); } else i3.status = 91; if (91 === i3.status) if (i3.gzhead.comment) { a3 = i3.pending; do { if (i3.pending === i3.pending_buf_size && (i3.gzhead.hcrc && i3.pending > a3 && (e4.adler = s2(e4.adler, i3.pending_buf, i3.pending - a3, a3)), L2(e4), a3 = i3.pending, i3.pending === i3.pending_buf_size)) { u3 = 1; break; } u3 = i3.gzindex < i3.gzhead.comment.length ? 255 & i3.gzhead.comment.charCodeAt(i3.gzindex++) : 0, D2(i3, u3); } while (0 !== u3); i3.gzhead.hcrc && i3.pending > a3 && (e4.adler = s2(e4.adler, i3.pending_buf, i3.pending - a3, a3)), 0 === u3 && (i3.status = O2); } else i3.status = O2; if (i3.status === O2 && (i3.gzhead.hcrc ? (i3.pending + 2 > i3.pending_buf_size && L2(e4), i3.pending + 2 <= i3.pending_buf_size && (D2(i3, 255 & e4.adler), D2(i3, e4.adler >> 8 & 255), e4.adler = 0, i3.status = P2)) : i3.status = P2), 0 !== i3.pending) { if (L2(e4), 0 === e4.avail_out) return i3.last_flush = -1, d2; } else if (0 === e4.avail_in && N2(t4) <= N2(r4) && t4 !== f2) return U2(e4, -5); if (i3.status === I2 && 0 !== e4.avail_in) return U2(e4, -5); if (0 !== e4.avail_in || 0 !== i3.lookahead || t4 !== c2 && i3.status !== I2) { var p3 = 2 === i3.strategy ? function(e5, t5) { for (var r5; ; ) { if (0 === e5.lookahead && (q2(e5), 0 === e5.lookahead)) { if (t5 === c2) return T2; break; } if (e5.match_length = 0, r5 = o2._tr_tally(e5, 0, e5.window[e5.strstart]), e5.lookahead--, e5.strstart++, r5 && (F2(e5, false), 0 === e5.strm.avail_out)) return T2; } return e5.insert = 0, t5 === f2 ? (F2(e5, true), 0 === e5.strm.avail_out ? M2 : R2) : e5.last_lit && (F2(e5, false), 0 === e5.strm.avail_out) ? T2 : C2; }(i3, t4) : 3 === i3.strategy ? function(e5, t5) { for (var r5, n3, i4, a4, s3 = e5.window; ; ) { if (e5.lookahead <= S2) { if (q2(e5), e5.lookahead <= S2 && t5 === c2) return T2; if (0 === e5.lookahead) break; } if (e5.match_length = 0, e5.lookahead >= E2 && e5.strstart > 0 && (n3 = s3[i4 = e5.strstart - 1]) === s3[++i4] && n3 === s3[++i4] && n3 === s3[++i4]) { a4 = e5.strstart + S2; do { } while (n3 === s3[++i4] && n3 === s3[++i4] && n3 === s3[++i4] && n3 === s3[++i4] && n3 === s3[++i4] && n3 === s3[++i4] && n3 === s3[++i4] && n3 === s3[++i4] && i4 < a4); e5.match_length = S2 - (a4 - i4), e5.match_length > e5.lookahead && (e5.match_length = e5.lookahead); } if (e5.match_length >= E2 ? (r5 = o2._tr_tally(e5, 1, e5.match_length - E2), e5.lookahead -= e5.match_length, e5.strstart += e5.match_length, e5.match_length = 0) : (r5 = o2._tr_tally(e5, 0, e5.window[e5.strstart]), e5.lookahead--, e5.strstart++), r5 && (F2(e5, false), 0 === e5.strm.avail_out)) return T2; } return e5.insert = 0, t5 === f2 ? (F2(e5, true), 0 === e5.strm.avail_out ? M2 : R2) : e5.last_lit && (F2(e5, false), 0 === e5.strm.avail_out) ? T2 : C2; }(i3, t4) : n2[i3.level].func(i3, t4); if (p3 !== M2 && p3 !== R2 || (i3.status = I2), p3 === T2 || p3 === M2) return 0 === e4.avail_out && (i3.last_flush = -1), d2; if (p3 === C2 && (1 === t4 ? o2._tr_align(i3) : 5 !== t4 && (o2._tr_stored_block(i3, 0, 0, false), 3 === t4 && (j2(i3.head), 0 === i3.lookahead && (i3.strstart = 0, i3.block_start = 0, i3.insert = 0))), L2(e4), 0 === e4.avail_out)) return i3.last_flush = -1, d2; } return t4 !== f2 ? d2 : i3.wrap <= 0 ? 1 : (2 === i3.wrap ? (D2(i3, 255 & e4.adler), D2(i3, e4.adler >> 8 & 255), D2(i3, e4.adler >> 16 & 255), D2(i3, e4.adler >> 24 & 255), D2(i3, 255 & e4.total_in), D2(i3, e4.total_in >> 8 & 255), D2(i3, e4.total_in >> 16 & 255), D2(i3, e4.total_in >> 24 & 255)) : (H2(i3, e4.adler >>> 16), H2(i3, 65535 & e4.adler)), L2(e4), i3.wrap > 0 && (i3.wrap = -i3.wrap), 0 !== i3.pending ? d2 : 1); }, t3.deflateEnd = function(e4) { var t4; return e4 && e4.state ? (t4 = e4.state.status) !== B2 && 69 !== t4 && 73 !== t4 && 91 !== t4 && t4 !== O2 && t4 !== P2 && t4 !== I2 ? U2(e4, l2) : (e4.state = null, t4 === P2 ? U2(e4, -3) : d2) : l2; }, t3.deflateSetDictionary = function(e4, t4) { var r4, n3, o3, s3, u3, c3, f3, h3, p3 = t4.length; if (!e4 || !e4.state) return l2; if (2 === (s3 = (r4 = e4.state).wrap) || 1 === s3 && r4.status !== B2 || r4.lookahead) return l2; for (1 === s3 && (e4.adler = a2(e4.adler, t4, p3, 0)), r4.wrap = 0, p3 >= r4.w_size && (0 === s3 && (j2(r4.head), r4.strstart = 0, r4.block_start = 0, r4.insert = 0), h3 = new i2.Buf8(r4.w_size), i2.arraySet(h3, t4, p3 - r4.w_size, r4.w_size, 0), t4 = h3, p3 = r4.w_size), u3 = e4.avail_in, c3 = e4.next_in, f3 = e4.input, e4.avail_in = p3, e4.next_in = 0, e4.input = t4, q2(r4); r4.lookahead >= E2; ) { n3 = r4.strstart, o3 = r4.lookahead - (E2 - 1); do { r4.ins_h = (r4.ins_h << r4.hash_shift ^ r4.window[n3 + E2 - 1]) & r4.hash_mask, r4.prev[n3 & r4.w_mask] = r4.head[r4.ins_h], r4.head[r4.ins_h] = n3, n3++; } while (--o3); r4.strstart = n3, r4.lookahead = E2 - 1, q2(r4); } return r4.strstart += r4.lookahead, r4.block_start = r4.strstart, r4.insert = r4.lookahead, r4.lookahead = 0, r4.match_length = r4.prev_length = E2 - 1, r4.match_available = 0, e4.next_in = c3, e4.input = f3, e4.avail_in = u3, r4.wrap = s3, d2; }, t3.deflateInfo = "pako deflate (from Nodeca project)"; }, 52399: (e3) => { e3.exports = function(e4, t3) { var r3, n2, i2, o2, a2, s2, u2, c2, f2, d2, l2, h2, p2, b2, y2, v2, m2, g2, w2, k2, _2, A2, E2, S2, x2; r3 = e4.state, n2 = e4.next_in, S2 = e4.input, i2 = n2 + (e4.avail_in - 5), o2 = e4.next_out, x2 = e4.output, a2 = o2 - (t3 - e4.avail_out), s2 = o2 + (e4.avail_out - 257), u2 = r3.dmax, c2 = r3.wsize, f2 = r3.whave, d2 = r3.wnext, l2 = r3.window, h2 = r3.hold, p2 = r3.bits, b2 = r3.lencode, y2 = r3.distcode, v2 = (1 << r3.lenbits) - 1, m2 = (1 << r3.distbits) - 1; e: do { p2 < 15 && (h2 += S2[n2++] << p2, p2 += 8, h2 += S2[n2++] << p2, p2 += 8), g2 = b2[h2 & v2]; t: for (; ; ) { if (h2 >>>= w2 = g2 >>> 24, p2 -= w2, 0 == (w2 = g2 >>> 16 & 255)) x2[o2++] = 65535 & g2; else { if (!(16 & w2)) { if (0 == (64 & w2)) { g2 = b2[(65535 & g2) + (h2 & (1 << w2) - 1)]; continue t; } if (32 & w2) { r3.mode = 12; break e; } e4.msg = "invalid literal/length code", r3.mode = 30; break e; } k2 = 65535 & g2, (w2 &= 15) && (p2 < w2 && (h2 += S2[n2++] << p2, p2 += 8), k2 += h2 & (1 << w2) - 1, h2 >>>= w2, p2 -= w2), p2 < 15 && (h2 += S2[n2++] << p2, p2 += 8, h2 += S2[n2++] << p2, p2 += 8), g2 = y2[h2 & m2]; r: for (; ; ) { if (h2 >>>= w2 = g2 >>> 24, p2 -= w2, !(16 & (w2 = g2 >>> 16 & 255))) { if (0 == (64 & w2)) { g2 = y2[(65535 & g2) + (h2 & (1 << w2) - 1)]; continue r; } e4.msg = "invalid distance code", r3.mode = 30; break e; } if (_2 = 65535 & g2, p2 < (w2 &= 15) && (h2 += S2[n2++] << p2, (p2 += 8) < w2 && (h2 += S2[n2++] << p2, p2 += 8)), (_2 += h2 & (1 << w2) - 1) > u2) { e4.msg = "invalid distance too far back", r3.mode = 30; break e; } if (h2 >>>= w2, p2 -= w2, _2 > (w2 = o2 - a2)) { if ((w2 = _2 - w2) > f2 && r3.sane) { e4.msg = "invalid distance too far back", r3.mode = 30; break e; } if (A2 = 0, E2 = l2, 0 === d2) { if (A2 += c2 - w2, w2 < k2) { k2 -= w2; do { x2[o2++] = l2[A2++]; } while (--w2); A2 = o2 - _2, E2 = x2; } } else if (d2 < w2) { if (A2 += c2 + d2 - w2, (w2 -= d2) < k2) { k2 -= w2; do { x2[o2++] = l2[A2++]; } while (--w2); if (A2 = 0, d2 < k2) { k2 -= w2 = d2; do { x2[o2++] = l2[A2++]; } while (--w2); A2 = o2 - _2, E2 = x2; } } } else if (A2 += d2 - w2, w2 < k2) { k2 -= w2; do { x2[o2++] = l2[A2++]; } while (--w2); A2 = o2 - _2, E2 = x2; } for (; k2 > 2; ) x2[o2++] = E2[A2++], x2[o2++] = E2[A2++], x2[o2++] = E2[A2++], k2 -= 3; k2 && (x2[o2++] = E2[A2++], k2 > 1 && (x2[o2++] = E2[A2++])); } else { A2 = o2 - _2; do { x2[o2++] = x2[A2++], x2[o2++] = x2[A2++], x2[o2++] = x2[A2++], k2 -= 3; } while (k2 > 2); k2 && (x2[o2++] = x2[A2++], k2 > 1 && (x2[o2++] = x2[A2++])); } break; } } break; } } while (n2 < i2 && o2 < s2); n2 -= k2 = p2 >> 3, h2 &= (1 << (p2 -= k2 << 3)) - 1, e4.next_in = n2, e4.next_out = o2, e4.avail_in = n2 < i2 ? i2 - n2 + 5 : 5 - (n2 - i2), e4.avail_out = o2 < s2 ? s2 - o2 + 257 : 257 - (o2 - s2), r3.hold = h2, r3.bits = p2; }; }, 63534: (e3, t3, r3) => { var n2 = r3(21307), i2 = r3(57506), o2 = r3(28548), a2 = r3(52399), s2 = r3(51721), u2 = 1, c2 = 2, f2 = 0, d2 = -2, l2 = 1, h2 = 12, p2 = 30, b2 = 852, y2 = 592; function v2(e4) { return (e4 >>> 24 & 255) + (e4 >>> 8 & 65280) + ((65280 & e4) << 8) + ((255 & e4) << 24); } function m2() { this.mode = 0, this.last = false, this.wrap = 0, this.havedict = false, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new n2.Buf16(320), this.work = new n2.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0; } function g2(e4) { var t4; return e4 && e4.state ? (t4 = e4.state, e4.total_in = e4.total_out = t4.total = 0, e4.msg = "", t4.wrap && (e4.adler = 1 & t4.wrap), t4.mode = l2, t4.last = 0, t4.havedict = 0, t4.dmax = 32768, t4.head = null, t4.hold = 0, t4.bits = 0, t4.lencode = t4.lendyn = new n2.Buf32(b2), t4.distcode = t4.distdyn = new n2.Buf32(y2), t4.sane = 1, t4.back = -1, f2) : d2; } function w2(e4) { var t4; return e4 && e4.state ? ((t4 = e4.state).wsize = 0, t4.whave = 0, t4.wnext = 0, g2(e4)) : d2; } function k2(e4, t4) { var r4, n3; return e4 && e4.state ? (n3 = e4.state, t4 < 0 ? (r4 = 0, t4 = -t4) : (r4 = 1 + (t4 >> 4), t4 < 48 && (t4 &= 15)), t4 && (t4 < 8 || t4 > 15) ? d2 : (null !== n3.window && n3.wbits !== t4 && (n3.window = null), n3.wrap = r4, n3.wbits = t4, w2(e4))) : d2; } function _2(e4, t4) { var r4, n3; return e4 ? (n3 = new m2(), e4.state = n3, n3.window = null, (r4 = k2(e4, t4)) !== f2 && (e4.state = null), r4) : d2; } var A2, E2, S2 = true; function x2(e4) { if (S2) { var t4; for (A2 = new n2.Buf32(512), E2 = new n2.Buf32(32), t4 = 0; t4 < 144; ) e4.lens[t4++] = 8; for (; t4 < 256; ) e4.lens[t4++] = 9; for (; t4 < 280; ) e4.lens[t4++] = 7; for (; t4 < 288; ) e4.lens[t4++] = 8; for (s2(u2, e4.lens, 0, 288, A2, 0, e4.work, { bits: 9 }), t4 = 0; t4 < 32; ) e4.lens[t4++] = 5; s2(c2, e4.lens, 0, 32, E2, 0, e4.work, { bits: 5 }), S2 = false; } e4.lencode = A2, e4.lenbits = 9, e4.distcode = E2, e4.distbits = 5; } function B2(e4, t4, r4, i3) { var o3, a3 = e4.state; return null === a3.window && (a3.wsize = 1 << a3.wbits, a3.wnext = 0, a3.whave = 0, a3.window = new n2.Buf8(a3.wsize)), i3 >= a3.wsize ? (n2.arraySet(a3.window, t4, r4 - a3.wsize, a3.wsize, 0), a3.wnext = 0, a3.whave = a3.wsize) : ((o3 = a3.wsize - a3.wnext) > i3 && (o3 = i3), n2.arraySet(a3.window, t4, r4 - i3, o3, a3.wnext), (i3 -= o3) ? (n2.arraySet(a3.window, t4, r4 - i3, i3, 0), a3.wnext = i3, a3.whave = a3.wsize) : (a3.wnext += o3, a3.wnext === a3.wsize && (a3.wnext = 0), a3.whave < a3.wsize && (a3.whave += o3))), 0; } t3.inflateReset = w2, t3.inflateReset2 = k2, t3.inflateResetKeep = g2, t3.inflateInit = function(e4) { return _2(e4, 15); }, t3.inflateInit2 = _2, t3.inflate = function(e4, t4) { var r4, b3, y3, m3, g3, w3, k3, _3, A3, E3, S3, O2, P2, I2, T2, C2, M2, R2, U2, N2, j2, L2, F2, D2, H2 = 0, z2 = new n2.Buf8(4), q2 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; if (!e4 || !e4.state || !e4.output || !e4.input && 0 !== e4.avail_in) return d2; (r4 = e4.state).mode === h2 && (r4.mode = 13), g3 = e4.next_out, y3 = e4.output, k3 = e4.avail_out, m3 = e4.next_in, b3 = e4.input, w3 = e4.avail_in, _3 = r4.hold, A3 = r4.bits, E3 = w3, S3 = k3, L2 = f2; e: for (; ; ) switch (r4.mode) { case l2: if (0 === r4.wrap) { r4.mode = 13; break; } for (; A3 < 16; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } if (2 & r4.wrap && 35615 === _3) { r4.check = 0, z2[0] = 255 & _3, z2[1] = _3 >>> 8 & 255, r4.check = o2(r4.check, z2, 2, 0), _3 = 0, A3 = 0, r4.mode = 2; break; } if (r4.flags = 0, r4.head && (r4.head.done = false), !(1 & r4.wrap) || (((255 & _3) << 8) + (_3 >> 8)) % 31) { e4.msg = "incorrect header check", r4.mode = p2; break; } if (8 != (15 & _3)) { e4.msg = "unknown compression method", r4.mode = p2; break; } if (A3 -= 4, j2 = 8 + (15 & (_3 >>>= 4)), 0 === r4.wbits) r4.wbits = j2; else if (j2 > r4.wbits) { e4.msg = "invalid window size", r4.mode = p2; break; } r4.dmax = 1 << j2, e4.adler = r4.check = 1, r4.mode = 512 & _3 ? 10 : h2, _3 = 0, A3 = 0; break; case 2: for (; A3 < 16; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } if (r4.flags = _3, 8 != (255 & r4.flags)) { e4.msg = "unknown compression method", r4.mode = p2; break; } if (57344 & r4.flags) { e4.msg = "unknown header flags set", r4.mode = p2; break; } r4.head && (r4.head.text = _3 >> 8 & 1), 512 & r4.flags && (z2[0] = 255 & _3, z2[1] = _3 >>> 8 & 255, r4.check = o2(r4.check, z2, 2, 0)), _3 = 0, A3 = 0, r4.mode = 3; case 3: for (; A3 < 32; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } r4.head && (r4.head.time = _3), 512 & r4.flags && (z2[0] = 255 & _3, z2[1] = _3 >>> 8 & 255, z2[2] = _3 >>> 16 & 255, z2[3] = _3 >>> 24 & 255, r4.check = o2(r4.check, z2, 4, 0)), _3 = 0, A3 = 0, r4.mode = 4; case 4: for (; A3 < 16; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } r4.head && (r4.head.xflags = 255 & _3, r4.head.os = _3 >> 8), 512 & r4.flags && (z2[0] = 255 & _3, z2[1] = _3 >>> 8 & 255, r4.check = o2(r4.check, z2, 2, 0)), _3 = 0, A3 = 0, r4.mode = 5; case 5: if (1024 & r4.flags) { for (; A3 < 16; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } r4.length = _3, r4.head && (r4.head.extra_len = _3), 512 & r4.flags && (z2[0] = 255 & _3, z2[1] = _3 >>> 8 & 255, r4.check = o2(r4.check, z2, 2, 0)), _3 = 0, A3 = 0; } else r4.head && (r4.head.extra = null); r4.mode = 6; case 6: if (1024 & r4.flags && ((O2 = r4.length) > w3 && (O2 = w3), O2 && (r4.head && (j2 = r4.head.extra_len - r4.length, r4.head.extra || (r4.head.extra = new Array(r4.head.extra_len)), n2.arraySet(r4.head.extra, b3, m3, O2, j2)), 512 & r4.flags && (r4.check = o2(r4.check, b3, O2, m3)), w3 -= O2, m3 += O2, r4.length -= O2), r4.length)) break e; r4.length = 0, r4.mode = 7; case 7: if (2048 & r4.flags) { if (0 === w3) break e; O2 = 0; do { j2 = b3[m3 + O2++], r4.head && j2 && r4.length < 65536 && (r4.head.name += String.fromCharCode(j2)); } while (j2 && O2 < w3); if (512 & r4.flags && (r4.check = o2(r4.check, b3, O2, m3)), w3 -= O2, m3 += O2, j2) break e; } else r4.head && (r4.head.name = null); r4.length = 0, r4.mode = 8; case 8: if (4096 & r4.flags) { if (0 === w3) break e; O2 = 0; do { j2 = b3[m3 + O2++], r4.head && j2 && r4.length < 65536 && (r4.head.comment += String.fromCharCode(j2)); } while (j2 && O2 < w3); if (512 & r4.flags && (r4.check = o2(r4.check, b3, O2, m3)), w3 -= O2, m3 += O2, j2) break e; } else r4.head && (r4.head.comment = null); r4.mode = 9; case 9: if (512 & r4.flags) { for (; A3 < 16; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } if (_3 !== (65535 & r4.check)) { e4.msg = "header crc mismatch", r4.mode = p2; break; } _3 = 0, A3 = 0; } r4.head && (r4.head.hcrc = r4.flags >> 9 & 1, r4.head.done = true), e4.adler = r4.check = 0, r4.mode = h2; break; case 10: for (; A3 < 32; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } e4.adler = r4.check = v2(_3), _3 = 0, A3 = 0, r4.mode = 11; case 11: if (0 === r4.havedict) return e4.next_out = g3, e4.avail_out = k3, e4.next_in = m3, e4.avail_in = w3, r4.hold = _3, r4.bits = A3, 2; e4.adler = r4.check = 1, r4.mode = h2; case h2: if (5 === t4 || 6 === t4) break e; case 13: if (r4.last) { _3 >>>= 7 & A3, A3 -= 7 & A3, r4.mode = 27; break; } for (; A3 < 3; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } switch (r4.last = 1 & _3, A3 -= 1, 3 & (_3 >>>= 1)) { case 0: r4.mode = 14; break; case 1: if (x2(r4), r4.mode = 20, 6 === t4) { _3 >>>= 2, A3 -= 2; break e; } break; case 2: r4.mode = 17; break; case 3: e4.msg = "invalid block type", r4.mode = p2; } _3 >>>= 2, A3 -= 2; break; case 14: for (_3 >>>= 7 & A3, A3 -= 7 & A3; A3 < 32; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } if ((65535 & _3) != (_3 >>> 16 ^ 65535)) { e4.msg = "invalid stored block lengths", r4.mode = p2; break; } if (r4.length = 65535 & _3, _3 = 0, A3 = 0, r4.mode = 15, 6 === t4) break e; case 15: r4.mode = 16; case 16: if (O2 = r4.length) { if (O2 > w3 && (O2 = w3), O2 > k3 && (O2 = k3), 0 === O2) break e; n2.arraySet(y3, b3, m3, O2, g3), w3 -= O2, m3 += O2, k3 -= O2, g3 += O2, r4.length -= O2; break; } r4.mode = h2; break; case 17: for (; A3 < 14; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } if (r4.nlen = 257 + (31 & _3), _3 >>>= 5, A3 -= 5, r4.ndist = 1 + (31 & _3), _3 >>>= 5, A3 -= 5, r4.ncode = 4 + (15 & _3), _3 >>>= 4, A3 -= 4, r4.nlen > 286 || r4.ndist > 30) { e4.msg = "too many length or distance symbols", r4.mode = p2; break; } r4.have = 0, r4.mode = 18; case 18: for (; r4.have < r4.ncode; ) { for (; A3 < 3; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } r4.lens[q2[r4.have++]] = 7 & _3, _3 >>>= 3, A3 -= 3; } for (; r4.have < 19; ) r4.lens[q2[r4.have++]] = 0; if (r4.lencode = r4.lendyn, r4.lenbits = 7, F2 = { bits: r4.lenbits }, L2 = s2(0, r4.lens, 0, 19, r4.lencode, 0, r4.work, F2), r4.lenbits = F2.bits, L2) { e4.msg = "invalid code lengths set", r4.mode = p2; break; } r4.have = 0, r4.mode = 19; case 19: for (; r4.have < r4.nlen + r4.ndist; ) { for (; C2 = (H2 = r4.lencode[_3 & (1 << r4.lenbits) - 1]) >>> 16 & 255, M2 = 65535 & H2, !((T2 = H2 >>> 24) <= A3); ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } if (M2 < 16) _3 >>>= T2, A3 -= T2, r4.lens[r4.have++] = M2; else { if (16 === M2) { for (D2 = T2 + 2; A3 < D2; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } if (_3 >>>= T2, A3 -= T2, 0 === r4.have) { e4.msg = "invalid bit length repeat", r4.mode = p2; break; } j2 = r4.lens[r4.have - 1], O2 = 3 + (3 & _3), _3 >>>= 2, A3 -= 2; } else if (17 === M2) { for (D2 = T2 + 3; A3 < D2; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } A3 -= T2, j2 = 0, O2 = 3 + (7 & (_3 >>>= T2)), _3 >>>= 3, A3 -= 3; } else { for (D2 = T2 + 7; A3 < D2; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } A3 -= T2, j2 = 0, O2 = 11 + (127 & (_3 >>>= T2)), _3 >>>= 7, A3 -= 7; } if (r4.have + O2 > r4.nlen + r4.ndist) { e4.msg = "invalid bit length repeat", r4.mode = p2; break; } for (; O2--; ) r4.lens[r4.have++] = j2; } } if (r4.mode === p2) break; if (0 === r4.lens[256]) { e4.msg = "invalid code -- missing end-of-block", r4.mode = p2; break; } if (r4.lenbits = 9, F2 = { bits: r4.lenbits }, L2 = s2(u2, r4.lens, 0, r4.nlen, r4.lencode, 0, r4.work, F2), r4.lenbits = F2.bits, L2) { e4.msg = "invalid literal/lengths set", r4.mode = p2; break; } if (r4.distbits = 6, r4.distcode = r4.distdyn, F2 = { bits: r4.distbits }, L2 = s2(c2, r4.lens, r4.nlen, r4.ndist, r4.distcode, 0, r4.work, F2), r4.distbits = F2.bits, L2) { e4.msg = "invalid distances set", r4.mode = p2; break; } if (r4.mode = 20, 6 === t4) break e; case 20: r4.mode = 21; case 21: if (w3 >= 6 && k3 >= 258) { e4.next_out = g3, e4.avail_out = k3, e4.next_in = m3, e4.avail_in = w3, r4.hold = _3, r4.bits = A3, a2(e4, S3), g3 = e4.next_out, y3 = e4.output, k3 = e4.avail_out, m3 = e4.next_in, b3 = e4.input, w3 = e4.avail_in, _3 = r4.hold, A3 = r4.bits, r4.mode === h2 && (r4.back = -1); break; } for (r4.back = 0; C2 = (H2 = r4.lencode[_3 & (1 << r4.lenbits) - 1]) >>> 16 & 255, M2 = 65535 & H2, !((T2 = H2 >>> 24) <= A3); ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } if (C2 && 0 == (240 & C2)) { for (R2 = T2, U2 = C2, N2 = M2; C2 = (H2 = r4.lencode[N2 + ((_3 & (1 << R2 + U2) - 1) >> R2)]) >>> 16 & 255, M2 = 65535 & H2, !(R2 + (T2 = H2 >>> 24) <= A3); ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } _3 >>>= R2, A3 -= R2, r4.back += R2; } if (_3 >>>= T2, A3 -= T2, r4.back += T2, r4.length = M2, 0 === C2) { r4.mode = 26; break; } if (32 & C2) { r4.back = -1, r4.mode = h2; break; } if (64 & C2) { e4.msg = "invalid literal/length code", r4.mode = p2; break; } r4.extra = 15 & C2, r4.mode = 22; case 22: if (r4.extra) { for (D2 = r4.extra; A3 < D2; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } r4.length += _3 & (1 << r4.extra) - 1, _3 >>>= r4.extra, A3 -= r4.extra, r4.back += r4.extra; } r4.was = r4.length, r4.mode = 23; case 23: for (; C2 = (H2 = r4.distcode[_3 & (1 << r4.distbits) - 1]) >>> 16 & 255, M2 = 65535 & H2, !((T2 = H2 >>> 24) <= A3); ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } if (0 == (240 & C2)) { for (R2 = T2, U2 = C2, N2 = M2; C2 = (H2 = r4.distcode[N2 + ((_3 & (1 << R2 + U2) - 1) >> R2)]) >>> 16 & 255, M2 = 65535 & H2, !(R2 + (T2 = H2 >>> 24) <= A3); ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } _3 >>>= R2, A3 -= R2, r4.back += R2; } if (_3 >>>= T2, A3 -= T2, r4.back += T2, 64 & C2) { e4.msg = "invalid distance code", r4.mode = p2; break; } r4.offset = M2, r4.extra = 15 & C2, r4.mode = 24; case 24: if (r4.extra) { for (D2 = r4.extra; A3 < D2; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } r4.offset += _3 & (1 << r4.extra) - 1, _3 >>>= r4.extra, A3 -= r4.extra, r4.back += r4.extra; } if (r4.offset > r4.dmax) { e4.msg = "invalid distance too far back", r4.mode = p2; break; } r4.mode = 25; case 25: if (0 === k3) break e; if (O2 = S3 - k3, r4.offset > O2) { if ((O2 = r4.offset - O2) > r4.whave && r4.sane) { e4.msg = "invalid distance too far back", r4.mode = p2; break; } O2 > r4.wnext ? (O2 -= r4.wnext, P2 = r4.wsize - O2) : P2 = r4.wnext - O2, O2 > r4.length && (O2 = r4.length), I2 = r4.window; } else I2 = y3, P2 = g3 - r4.offset, O2 = r4.length; O2 > k3 && (O2 = k3), k3 -= O2, r4.length -= O2; do { y3[g3++] = I2[P2++]; } while (--O2); 0 === r4.length && (r4.mode = 21); break; case 26: if (0 === k3) break e; y3[g3++] = r4.length, k3--, r4.mode = 21; break; case 27: if (r4.wrap) { for (; A3 < 32; ) { if (0 === w3) break e; w3--, _3 |= b3[m3++] << A3, A3 += 8; } if (S3 -= k3, e4.total_out += S3, r4.total += S3, S3 && (e4.adler = r4.check = r4.flags ? o2(r4.check, y3, S3, g3 - S3) : i2(r4.check, y3, S3, g3 - S3)), S3 = k3, (r4.flags ? _3 : v2(_3)) !== r4.check) { e4.msg = "incorrect data check", r4.mode = p2; break; } _3 = 0, A3 = 0; } r4.mode = 28; case 28: if (r4.wrap && r4.flags) { for (; A3 < 32; ) { if (0 === w3) break e; w3--, _3 += b3[m3++] << A3, A3 += 8; } if (_3 !== (4294967295 & r4.total)) { e4.msg = "incorrect length check", r4.mode = p2; break; } _3 = 0, A3 = 0; } r4.mode = 29; case 29: L2 = 1; break e; case p2: L2 = -3; break e; case 31: return -4; default: return d2; } return e4.next_out = g3, e4.avail_out = k3, e4.next_in = m3, e4.avail_in = w3, r4.hold = _3, r4.bits = A3, (r4.wsize || S3 !== e4.avail_out && r4.mode < p2 && (r4.mode < 27 || 4 !== t4)) && B2(e4, e4.output, e4.next_out, S3 - e4.avail_out) ? (r4.mode = 31, -4) : (E3 -= e4.avail_in, S3 -= e4.avail_out, e4.total_in += E3, e4.total_out += S3, r4.total += S3, r4.wrap && S3 && (e4.adler = r4.check = r4.flags ? o2(r4.check, y3, S3, e4.next_out - S3) : i2(r4.check, y3, S3, e4.next_out - S3)), e4.data_type = r4.bits + (r4.last ? 64 : 0) + (r4.mode === h2 ? 128 : 0) + (20 === r4.mode || 15 === r4.mode ? 256 : 0), (0 === E3 && 0 === S3 || 4 === t4) && L2 === f2 && (L2 = -5), L2); }, t3.inflateEnd = function(e4) { if (!e4 || !e4.state) return d2; var t4 = e4.state; return t4.window && (t4.window = null), e4.state = null, f2; }, t3.inflateGetHeader = function(e4, t4) { var r4; return e4 && e4.state ? 0 == (2 & (r4 = e4.state).wrap) ? d2 : (r4.head = t4, t4.done = false, f2) : d2; }, t3.inflateSetDictionary = function(e4, t4) { var r4, n3 = t4.length; return e4 && e4.state ? 0 !== (r4 = e4.state).wrap && 11 !== r4.mode ? d2 : 11 === r4.mode && i2(1, t4, n3, 0) !== r4.check ? -3 : B2(e4, t4, n3, n3) ? (r4.mode = 31, -4) : (r4.havedict = 1, f2) : d2; }, t3.inflateInfo = "pako inflate (from Nodeca project)"; }, 51721: (e3, t3, r3) => { var n2 = r3(21307), i2 = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], o2 = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], a2 = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0], s2 = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]; e3.exports = function(e4, t4, r4, u2, c2, f2, d2, l2) { var h2, p2, b2, y2, v2, m2, g2, w2, k2, _2 = l2.bits, A2 = 0, E2 = 0, S2 = 0, x2 = 0, B2 = 0, O2 = 0, P2 = 0, I2 = 0, T2 = 0, C2 = 0, M2 = null, R2 = 0, U2 = new n2.Buf16(16), N2 = new n2.Buf16(16), j2 = null, L2 = 0; for (A2 = 0; A2 <= 15; A2++) U2[A2] = 0; for (E2 = 0; E2 < u2; E2++) U2[t4[r4 + E2]]++; for (B2 = _2, x2 = 15; x2 >= 1 && 0 === U2[x2]; x2--) ; if (B2 > x2 && (B2 = x2), 0 === x2) return c2[f2++] = 20971520, c2[f2++] = 20971520, l2.bits = 1, 0; for (S2 = 1; S2 < x2 && 0 === U2[S2]; S2++) ; for (B2 < S2 && (B2 = S2), I2 = 1, A2 = 1; A2 <= 15; A2++) if (I2 <<= 1, (I2 -= U2[A2]) < 0) return -1; if (I2 > 0 && (0 === e4 || 1 !== x2)) return -1; for (N2[1] = 0, A2 = 1; A2 < 15; A2++) N2[A2 + 1] = N2[A2] + U2[A2]; for (E2 = 0; E2 < u2; E2++) 0 !== t4[r4 + E2] && (d2[N2[t4[r4 + E2]]++] = E2); if (0 === e4 ? (M2 = j2 = d2, m2 = 19) : 1 === e4 ? (M2 = i2, R2 -= 257, j2 = o2, L2 -= 257, m2 = 256) : (M2 = a2, j2 = s2, m2 = -1), C2 = 0, E2 = 0, A2 = S2, v2 = f2, O2 = B2, P2 = 0, b2 = -1, y2 = (T2 = 1 << B2) - 1, 1 === e4 && T2 > 852 || 2 === e4 && T2 > 592) return 1; for (; ; ) { g2 = A2 - P2, d2[E2] < m2 ? (w2 = 0, k2 = d2[E2]) : d2[E2] > m2 ? (w2 = j2[L2 + d2[E2]], k2 = M2[R2 + d2[E2]]) : (w2 = 96, k2 = 0), h2 = 1 << A2 - P2, S2 = p2 = 1 << O2; do { c2[v2 + (C2 >> P2) + (p2 -= h2)] = g2 << 24 | w2 << 16 | k2 | 0; } while (0 !== p2); for (h2 = 1 << A2 - 1; C2 & h2; ) h2 >>= 1; if (0 !== h2 ? (C2 &= h2 - 1, C2 += h2) : C2 = 0, E2++, 0 == --U2[A2]) { if (A2 === x2) break; A2 = t4[r4 + d2[E2]]; } if (A2 > B2 && (C2 & y2) !== b2) { for (0 === P2 && (P2 = B2), v2 += S2, I2 = 1 << (O2 = A2 - P2); O2 + P2 < x2 && !((I2 -= U2[O2 + P2]) <= 0); ) O2++, I2 <<= 1; if (T2 += 1 << O2, 1 === e4 && T2 > 852 || 2 === e4 && T2 > 592) return 1; c2[b2 = C2 & y2] = B2 << 24 | O2 << 16 | v2 - f2 | 0; } } return 0 !== C2 && (c2[v2 + C2] = A2 - P2 << 24 | 64 << 16 | 0), l2.bits = B2, 0; }; }, 78021: (e3) => { e3.exports = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" }; }, 25280: (e3, t3, r3) => { var n2 = r3(21307); function i2(e4) { for (var t4 = e4.length; --t4 >= 0; ) e4[t4] = 0; } var o2 = 0, a2 = 256, s2 = a2 + 1 + 29, u2 = 30, c2 = 19, f2 = 2 * s2 + 1, d2 = 15, l2 = 16, h2 = 256, p2 = 16, b2 = 17, y2 = 18, v2 = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], m2 = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], g2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], w2 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], k2 = new Array(2 * (s2 + 2)); i2(k2); var _2 = new Array(2 * u2); i2(_2); var A2 = new Array(512); i2(A2); var E2 = new Array(256); i2(E2); var S2 = new Array(29); i2(S2); var x2, B2, O2, P2 = new Array(u2); function I2(e4, t4, r4, n3, i3) { this.static_tree = e4, this.extra_bits = t4, this.extra_base = r4, this.elems = n3, this.max_length = i3, this.has_stree = e4 && e4.length; } function T2(e4, t4) { this.dyn_tree = e4, this.max_code = 0, this.stat_desc = t4; } function C2(e4) { return e4 < 256 ? A2[e4] : A2[256 + (e4 >>> 7)]; } function M2(e4, t4) { e4.pending_buf[e4.pending++] = 255 & t4, e4.pending_buf[e4.pending++] = t4 >>> 8 & 255; } function R2(e4, t4, r4) { e4.bi_valid > l2 - r4 ? (e4.bi_buf |= t4 << e4.bi_valid & 65535, M2(e4, e4.bi_buf), e4.bi_buf = t4 >> l2 - e4.bi_valid, e4.bi_valid += r4 - l2) : (e4.bi_buf |= t4 << e4.bi_valid & 65535, e4.bi_valid += r4); } function U2(e4, t4, r4) { R2(e4, r4[2 * t4], r4[2 * t4 + 1]); } function N2(e4, t4) { var r4 = 0; do { r4 |= 1 & e4, e4 >>>= 1, r4 <<= 1; } while (--t4 > 0); return r4 >>> 1; } function j2(e4, t4, r4) { var n3, i3, o3 = new Array(d2 + 1), a3 = 0; for (n3 = 1; n3 <= d2; n3++) o3[n3] = a3 = a3 + r4[n3 - 1] << 1; for (i3 = 0; i3 <= t4; i3++) { var s3 = e4[2 * i3 + 1]; 0 !== s3 && (e4[2 * i3] = N2(o3[s3]++, s3)); } } function L2(e4) { var t4; for (t4 = 0; t4 < s2; t4++) e4.dyn_ltree[2 * t4] = 0; for (t4 = 0; t4 < u2; t4++) e4.dyn_dtree[2 * t4] = 0; for (t4 = 0; t4 < c2; t4++) e4.bl_tree[2 * t4] = 0; e4.dyn_ltree[2 * h2] = 1, e4.opt_len = e4.static_len = 0, e4.last_lit = e4.matches = 0; } function F2(e4) { e4.bi_valid > 8 ? M2(e4, e4.bi_buf) : e4.bi_valid > 0 && (e4.pending_buf[e4.pending++] = e4.bi_buf), e4.bi_buf = 0, e4.bi_valid = 0; } function D2(e4, t4, r4, n3) { var i3 = 2 * t4, o3 = 2 * r4; return e4[i3] < e4[o3] || e4[i3] === e4[o3] && n3[t4] <= n3[r4]; } function H2(e4, t4, r4) { for (var n3 = e4.heap[r4], i3 = r4 << 1; i3 <= e4.heap_len && (i3 < e4.heap_len && D2(t4, e4.heap[i3 + 1], e4.heap[i3], e4.depth) && i3++, !D2(t4, n3, e4.heap[i3], e4.depth)); ) e4.heap[r4] = e4.heap[i3], r4 = i3, i3 <<= 1; e4.heap[r4] = n3; } function z2(e4, t4, r4) { var n3, i3, o3, s3, u3 = 0; if (0 !== e4.last_lit) do { n3 = e4.pending_buf[e4.d_buf + 2 * u3] << 8 | e4.pending_buf[e4.d_buf + 2 * u3 + 1], i3 = e4.pending_buf[e4.l_buf + u3], u3++, 0 === n3 ? U2(e4, i3, t4) : (U2(e4, (o3 = E2[i3]) + a2 + 1, t4), 0 !== (s3 = v2[o3]) && R2(e4, i3 -= S2[o3], s3), U2(e4, o3 = C2(--n3), r4), 0 !== (s3 = m2[o3]) && R2(e4, n3 -= P2[o3], s3)); } while (u3 < e4.last_lit); U2(e4, h2, t4); } function q2(e4, t4) { var r4, n3, i3, o3 = t4.dyn_tree, a3 = t4.stat_desc.static_tree, s3 = t4.stat_desc.has_stree, u3 = t4.stat_desc.elems, c3 = -1; for (e4.heap_len = 0, e4.heap_max = f2, r4 = 0; r4 < u3; r4++) 0 !== o3[2 * r4] ? (e4.heap[++e4.heap_len] = c3 = r4, e4.depth[r4] = 0) : o3[2 * r4 + 1] = 0; for (; e4.heap_len < 2; ) o3[2 * (i3 = e4.heap[++e4.heap_len] = c3 < 2 ? ++c3 : 0)] = 1, e4.depth[i3] = 0, e4.opt_len--, s3 && (e4.static_len -= a3[2 * i3 + 1]); for (t4.max_code = c3, r4 = e4.heap_len >> 1; r4 >= 1; r4--) H2(e4, o3, r4); i3 = u3; do { r4 = e4.heap[1], e4.heap[1] = e4.heap[e4.heap_len--], H2(e4, o3, 1), n3 = e4.heap[1], e4.heap[--e4.heap_max] = r4, e4.heap[--e4.heap_max] = n3, o3[2 * i3] = o3[2 * r4] + o3[2 * n3], e4.depth[i3] = (e4.depth[r4] >= e4.depth[n3] ? e4.depth[r4] : e4.depth[n3]) + 1, o3[2 * r4 + 1] = o3[2 * n3 + 1] = i3, e4.heap[1] = i3++, H2(e4, o3, 1); } while (e4.heap_len >= 2); e4.heap[--e4.heap_max] = e4.heap[1], function(e5, t5) { var r5, n4, i4, o4, a4, s4, u4 = t5.dyn_tree, c4 = t5.max_code, l3 = t5.stat_desc.static_tree, h3 = t5.stat_desc.has_stree, p3 = t5.stat_desc.extra_bits, b3 = t5.stat_desc.extra_base, y3 = t5.stat_desc.max_length, v3 = 0; for (o4 = 0; o4 <= d2; o4++) e5.bl_count[o4] = 0; for (u4[2 * e5.heap[e5.heap_max] + 1] = 0, r5 = e5.heap_max + 1; r5 < f2; r5++) (o4 = u4[2 * u4[2 * (n4 = e5.heap[r5]) + 1] + 1] + 1) > y3 && (o4 = y3, v3++), u4[2 * n4 + 1] = o4, n4 > c4 || (e5.bl_count[o4]++, a4 = 0, n4 >= b3 && (a4 = p3[n4 - b3]), s4 = u4[2 * n4], e5.opt_len += s4 * (o4 + a4), h3 && (e5.static_len += s4 * (l3[2 * n4 + 1] + a4))); if (0 !== v3) { do { for (o4 = y3 - 1; 0 === e5.bl_count[o4]; ) o4--; e5.bl_count[o4]--, e5.bl_count[o4 + 1] += 2, e5.bl_count[y3]--, v3 -= 2; } while (v3 > 0); for (o4 = y3; 0 !== o4; o4--) for (n4 = e5.bl_count[o4]; 0 !== n4; ) (i4 = e5.heap[--r5]) > c4 || (u4[2 * i4 + 1] !== o4 && (e5.opt_len += (o4 - u4[2 * i4 + 1]) * u4[2 * i4], u4[2 * i4 + 1] = o4), n4--); } }(e4, t4), j2(o3, c3, e4.bl_count); } function K2(e4, t4, r4) { var n3, i3, o3 = -1, a3 = t4[1], s3 = 0, u3 = 7, c3 = 4; for (0 === a3 && (u3 = 138, c3 = 3), t4[2 * (r4 + 1) + 1] = 65535, n3 = 0; n3 <= r4; n3++) i3 = a3, a3 = t4[2 * (n3 + 1) + 1], ++s3 < u3 && i3 === a3 || (s3 < c3 ? e4.bl_tree[2 * i3] += s3 : 0 !== i3 ? (i3 !== o3 && e4.bl_tree[2 * i3]++, e4.bl_tree[2 * p2]++) : s3 <= 10 ? e4.bl_tree[2 * b2]++ : e4.bl_tree[2 * y2]++, s3 = 0, o3 = i3, 0 === a3 ? (u3 = 138, c3 = 3) : i3 === a3 ? (u3 = 6, c3 = 3) : (u3 = 7, c3 = 4)); } function G2(e4, t4, r4) { var n3, i3, o3 = -1, a3 = t4[1], s3 = 0, u3 = 7, c3 = 4; for (0 === a3 && (u3 = 138, c3 = 3), n3 = 0; n3 <= r4; n3++) if (i3 = a3, a3 = t4[2 * (n3 + 1) + 1], !(++s3 < u3 && i3 === a3)) { if (s3 < c3) do { U2(e4, i3, e4.bl_tree); } while (0 != --s3); else 0 !== i3 ? (i3 !== o3 && (U2(e4, i3, e4.bl_tree), s3--), U2(e4, p2, e4.bl_tree), R2(e4, s3 - 3, 2)) : s3 <= 10 ? (U2(e4, b2, e4.bl_tree), R2(e4, s3 - 3, 3)) : (U2(e4, y2, e4.bl_tree), R2(e4, s3 - 11, 7)); s3 = 0, o3 = i3, 0 === a3 ? (u3 = 138, c3 = 3) : i3 === a3 ? (u3 = 6, c3 = 3) : (u3 = 7, c3 = 4); } } i2(P2); var V2 = false; function Z2(e4, t4, r4, i3) { R2(e4, (o2 << 1) + (i3 ? 1 : 0), 3), function(e5, t5, r5, i4) { F2(e5), M2(e5, r5), M2(e5, ~r5), n2.arraySet(e5.pending_buf, e5.window, t5, r5, e5.pending), e5.pending += r5; }(e4, t4, r4); } t3._tr_init = function(e4) { V2 || (function() { var e5, t4, r4, n3, i3, o3 = new Array(d2 + 1); for (r4 = 0, n3 = 0; n3 < 28; n3++) for (S2[n3] = r4, e5 = 0; e5 < 1 << v2[n3]; e5++) E2[r4++] = n3; for (E2[r4 - 1] = n3, i3 = 0, n3 = 0; n3 < 16; n3++) for (P2[n3] = i3, e5 = 0; e5 < 1 << m2[n3]; e5++) A2[i3++] = n3; for (i3 >>= 7; n3 < u2; n3++) for (P2[n3] = i3 << 7, e5 = 0; e5 < 1 << m2[n3] - 7; e5++) A2[256 + i3++] = n3; for (t4 = 0; t4 <= d2; t4++) o3[t4] = 0; for (e5 = 0; e5 <= 143; ) k2[2 * e5 + 1] = 8, e5++, o3[8]++; for (; e5 <= 255; ) k2[2 * e5 + 1] = 9, e5++, o3[9]++; for (; e5 <= 279; ) k2[2 * e5 + 1] = 7, e5++, o3[7]++; for (; e5 <= 287; ) k2[2 * e5 + 1] = 8, e5++, o3[8]++; for (j2(k2, s2 + 1, o3), e5 = 0; e5 < u2; e5++) _2[2 * e5 + 1] = 5, _2[2 * e5] = N2(e5, 5); x2 = new I2(k2, v2, a2 + 1, s2, d2), B2 = new I2(_2, m2, 0, u2, d2), O2 = new I2(new Array(0), g2, 0, c2, 7); }(), V2 = true), e4.l_desc = new T2(e4.dyn_ltree, x2), e4.d_desc = new T2(e4.dyn_dtree, B2), e4.bl_desc = new T2(e4.bl_tree, O2), e4.bi_buf = 0, e4.bi_valid = 0, L2(e4); }, t3._tr_stored_block = Z2, t3._tr_flush_block = function(e4, t4, r4, n3) { var i3, o3, s3 = 0; e4.level > 0 ? (2 === e4.strm.data_type && (e4.strm.data_type = function(e5) { var t5, r5 = 4093624447; for (t5 = 0; t5 <= 31; t5++, r5 >>>= 1) if (1 & r5 && 0 !== e5.dyn_ltree[2 * t5]) return 0; if (0 !== e5.dyn_ltree[18] || 0 !== e5.dyn_ltree[20] || 0 !== e5.dyn_ltree[26]) return 1; for (t5 = 32; t5 < a2; t5++) if (0 !== e5.dyn_ltree[2 * t5]) return 1; return 0; }(e4)), q2(e4, e4.l_desc), q2(e4, e4.d_desc), s3 = function(e5) { var t5; for (K2(e5, e5.dyn_ltree, e5.l_desc.max_code), K2(e5, e5.dyn_dtree, e5.d_desc.max_code), q2(e5, e5.bl_desc), t5 = c2 - 1; t5 >= 3 && 0 === e5.bl_tree[2 * w2[t5] + 1]; t5--) ; return e5.opt_len += 3 * (t5 + 1) + 5 + 5 + 4, t5; }(e4), i3 = e4.opt_len + 3 + 7 >>> 3, (o3 = e4.static_len + 3 + 7 >>> 3) <= i3 && (i3 = o3)) : i3 = o3 = r4 + 5, r4 + 4 <= i3 && -1 !== t4 ? Z2(e4, t4, r4, n3) : 4 === e4.strategy || o3 === i3 ? (R2(e4, 2 + (n3 ? 1 : 0), 3), z2(e4, k2, _2)) : (R2(e4, 4 + (n3 ? 1 : 0), 3), function(e5, t5, r5, n4) { var i4; for (R2(e5, t5 - 257, 5), R2(e5, r5 - 1, 5), R2(e5, n4 - 4, 4), i4 = 0; i4 < n4; i4++) R2(e5, e5.bl_tree[2 * w2[i4] + 1], 3); G2(e5, e5.dyn_ltree, t5 - 1), G2(e5, e5.dyn_dtree, r5 - 1); }(e4, e4.l_desc.max_code + 1, e4.d_desc.max_code + 1, s3 + 1), z2(e4, e4.dyn_ltree, e4.dyn_dtree)), L2(e4), n3 && F2(e4); }, t3._tr_tally = function(e4, t4, r4) { return e4.pending_buf[e4.d_buf + 2 * e4.last_lit] = t4 >>> 8 & 255, e4.pending_buf[e4.d_buf + 2 * e4.last_lit + 1] = 255 & t4, e4.pending_buf[e4.l_buf + e4.last_lit] = 255 & r4, e4.last_lit++, 0 === t4 ? e4.dyn_ltree[2 * r4]++ : (e4.matches++, t4--, e4.dyn_ltree[2 * (E2[r4] + a2 + 1)]++, e4.dyn_dtree[2 * C2(t4)]++), e4.last_lit === e4.lit_bufsize - 1; }, t3._tr_align = function(e4) { R2(e4, 2, 3), U2(e4, h2, k2), function(e5) { 16 === e5.bi_valid ? (M2(e5, e5.bi_buf), e5.bi_buf = 0, e5.bi_valid = 0) : e5.bi_valid >= 8 && (e5.pending_buf[e5.pending++] = 255 & e5.bi_buf, e5.bi_buf >>= 8, e5.bi_valid -= 8); }(e4); }; }, 47563: (e3) => { e3.exports = function() { this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0; }; }, 81823: (e3, t3, r3) => { var n2 = r3(68357); t3.certificate = r3(41320); var i2 = n2.define("RSAPrivateKey", function() { this.seq().obj(this.key("version").int(), this.key("modulus").int(), this.key("publicExponent").int(), this.key("privateExponent").int(), this.key("prime1").int(), this.key("prime2").int(), this.key("exponent1").int(), this.key("exponent2").int(), this.key("coefficient").int()); }); t3.RSAPrivateKey = i2; var o2 = n2.define("RSAPublicKey", function() { this.seq().obj(this.key("modulus").int(), this.key("publicExponent").int()); }); t3.RSAPublicKey = o2; var a2 = n2.define("SubjectPublicKeyInfo", function() { this.seq().obj(this.key("algorithm").use(s2), this.key("subjectPublicKey").bitstr()); }); t3.PublicKey = a2; var s2 = n2.define("AlgorithmIdentifier", function() { this.seq().obj(this.key("algorithm").objid(), this.key("none").null_().optional(), this.key("curve").objid().optional(), this.key("params").seq().obj(this.key("p").int(), this.key("q").int(), this.key("g").int()).optional()); }), u2 = n2.define("PrivateKeyInfo", function() { this.seq().obj(this.key("version").int(), this.key("algorithm").use(s2), this.key("subjectPrivateKey").octstr()); }); t3.PrivateKey = u2; var c2 = n2.define("EncryptedPrivateKeyInfo", function() { this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(), this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(), this.key("kdeparams").seq().obj(this.key("salt").octstr(), this.key("iters").int())), this.key("cipher").seq().obj(this.key("algo").objid(), this.key("iv").octstr()))), this.key("subjectPrivateKey").octstr()); }); t3.EncryptedPrivateKey = c2; var f2 = n2.define("DSAPrivateKey", function() { this.seq().obj(this.key("version").int(), this.key("p").int(), this.key("q").int(), this.key("g").int(), this.key("pub_key").int(), this.key("priv_key").int()); }); t3.DSAPrivateKey = f2, t3.DSAparam = n2.define("DSAparam", function() { this.int(); }); var d2 = n2.define("ECPrivateKey", function() { this.seq().obj(this.key("version").int(), this.key("privateKey").octstr(), this.key("parameters").optional().explicit(0).use(l2), this.key("publicKey").optional().explicit(1).bitstr()); }); t3.ECPrivateKey = d2; var l2 = n2.define("ECParameters", function() { this.choice({ namedCurve: this.objid() }); }); t3.signature = n2.define("signature", function() { this.seq().obj(this.key("r").int(), this.key("s").int()); }); }, 41320: (e3, t3, r3) => { var n2 = r3(68357), i2 = n2.define("Time", function() { this.choice({ utcTime: this.utctime(), generalTime: this.gentime() }); }), o2 = n2.define("AttributeTypeValue", function() { this.seq().obj(this.key("type").objid(), this.key("value").any()); }), a2 = n2.define("AlgorithmIdentifier", function() { this.seq().obj(this.key("algorithm").objid(), this.key("parameters").optional(), this.key("curve").objid().optional()); }), s2 = n2.define("SubjectPublicKeyInfo", function() { this.seq().obj(this.key("algorithm").use(a2), this.key("subjectPublicKey").bitstr()); }), u2 = n2.define("RelativeDistinguishedName", function() { this.setof(o2); }), c2 = n2.define("RDNSequence", function() { this.seqof(u2); }), f2 = n2.define("Name", function() { this.choice({ rdnSequence: this.use(c2) }); }), d2 = n2.define("Validity", function() { this.seq().obj(this.key("notBefore").use(i2), this.key("notAfter").use(i2)); }), l2 = n2.define("Extension", function() { this.seq().obj(this.key("extnID").objid(), this.key("critical").bool().def(false), this.key("extnValue").octstr()); }), h2 = n2.define("TBSCertificate", function() { this.seq().obj(this.key("version").explicit(0).int().optional(), this.key("serialNumber").int(), this.key("signature").use(a2), this.key("issuer").use(f2), this.key("validity").use(d2), this.key("subject").use(f2), this.key("subjectPublicKeyInfo").use(s2), this.key("issuerUniqueID").implicit(1).bitstr().optional(), this.key("subjectUniqueID").implicit(2).bitstr().optional(), this.key("extensions").explicit(3).seqof(l2).optional()); }), p2 = n2.define("X509Certificate", function() { this.seq().obj(this.key("tbsCertificate").use(h2), this.key("signatureAlgorithm").use(a2), this.key("signatureValue").bitstr()); }); e3.exports = p2; }, 64988: (e3, t3, r3) => { var n2 = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m, i2 = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m, o2 = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m, a2 = r3(27085), s2 = r3(98073), u2 = r3(48850).Buffer; e3.exports = function(e4, t4) { var r4, c2 = e4.toString(), f2 = c2.match(n2); if (f2) { var d2 = "aes" + f2[1], l2 = u2.from(f2[2], "hex"), h2 = u2.from(f2[3].replace(/[\r\n]/g, ""), "base64"), p2 = a2(t4, l2.slice(0, 8), parseInt(f2[1], 10)).key, b2 = [], y2 = s2.createDecipheriv(d2, p2, l2); b2.push(y2.update(h2)), b2.push(y2.final()), r4 = u2.concat(b2); } else { var v2 = c2.match(o2); r4 = u2.from(v2[2].replace(/[\r\n]/g, ""), "base64"); } return { tag: c2.match(i2)[1], data: r4 }; }; }, 27552: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(81823), o2 = r3(22562), a2 = r3(64988), s2 = r3(98073), u2 = r3(54192), c2 = r3(48850).Buffer; function f2(e4) { var t4; "object" !== (0, n2.default)(e4) || c2.isBuffer(e4) || (t4 = e4.passphrase, e4 = e4.key), "string" == typeof e4 && (e4 = c2.from(e4)); var r4, f3, d2 = a2(e4, t4), l2 = d2.tag, h2 = d2.data; switch (l2) { case "CERTIFICATE": f3 = i2.certificate.decode(h2, "der").tbsCertificate.subjectPublicKeyInfo; case "PUBLIC KEY": switch (f3 || (f3 = i2.PublicKey.decode(h2, "der")), r4 = f3.algorithm.algorithm.join(".")) { case "1.2.840.113549.1.1.1": return i2.RSAPublicKey.decode(f3.subjectPublicKey.data, "der"); case "1.2.840.10045.2.1": return f3.subjectPrivateKey = f3.subjectPublicKey, { type: "ec", data: f3 }; case "1.2.840.10040.4.1": return f3.algorithm.params.pub_key = i2.DSAparam.decode(f3.subjectPublicKey.data, "der"), { type: "dsa", data: f3.algorithm.params }; default: throw new Error("unknown key id " + r4); } case "ENCRYPTED PRIVATE KEY": h2 = function(e5, t5) { var r5 = e5.algorithm.decrypt.kde.kdeparams.salt, n3 = parseInt(e5.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), i3 = o2[e5.algorithm.decrypt.cipher.algo.join(".")], a3 = e5.algorithm.decrypt.cipher.iv, f4 = e5.subjectPrivateKey, d3 = parseInt(i3.split("-")[1], 10) / 8, l3 = u2.pbkdf2Sync(t5, r5, n3, d3, "sha1"), h3 = s2.createDecipheriv(i3, l3, a3), p2 = []; return p2.push(h3.update(f4)), p2.push(h3.final()), c2.concat(p2); }(h2 = i2.EncryptedPrivateKey.decode(h2, "der"), t4); case "PRIVATE KEY": switch (r4 = (f3 = i2.PrivateKey.decode(h2, "der")).algorithm.algorithm.join(".")) { case "1.2.840.113549.1.1.1": return i2.RSAPrivateKey.decode(f3.subjectPrivateKey, "der"); case "1.2.840.10045.2.1": return { curve: f3.algorithm.curve, privateKey: i2.ECPrivateKey.decode(f3.subjectPrivateKey, "der").privateKey }; case "1.2.840.10040.4.1": return f3.algorithm.params.priv_key = i2.DSAparam.decode(f3.subjectPrivateKey, "der"), { type: "dsa", params: f3.algorithm.params }; default: throw new Error("unknown key id " + r4); } case "RSA PUBLIC KEY": return i2.RSAPublicKey.decode(h2, "der"); case "RSA PRIVATE KEY": return i2.RSAPrivateKey.decode(h2, "der"); case "DSA PRIVATE KEY": return { type: "dsa", params: i2.DSAPrivateKey.decode(h2, "der") }; case "EC PRIVATE KEY": return { curve: (h2 = i2.ECPrivateKey.decode(h2, "der")).parameters.value, privateKey: h2.privateKey }; default: throw new Error("unknown key type " + l2); } } e3.exports = f2, f2.signature = i2.signature; }, 48209: (e3) => { var t3 = function(e4) { return e4.replace(/^\s+|\s+$/g, ""); }; e3.exports = function(e4) { if (!e4) return {}; for (var r3, n2 = {}, i2 = t3(e4).split("\n"), o2 = 0; o2 < i2.length; o2++) { var a2 = i2[o2], s2 = a2.indexOf(":"), u2 = t3(a2.slice(0, s2)).toLowerCase(), c2 = t3(a2.slice(s2 + 1)); void 0 === n2[u2] ? n2[u2] = c2 : (r3 = n2[u2], "[object Array]" === Object.prototype.toString.call(r3) ? n2[u2].push(c2) : n2[u2] = [n2[u2], c2]); } return n2; }; }, 54192: (e3, t3, r3) => { t3.pbkdf2 = r3(1882), t3.pbkdf2Sync = r3(1658); }, 1882: (e3, t3, r3) => { var n2, i2, o2 = r3(48850).Buffer, a2 = r3(63127), s2 = r3(77401), u2 = r3(1658), c2 = r3(98398), f2 = r3.g.crypto && r3.g.crypto.subtle, d2 = { sha: "SHA-1", "sha-1": "SHA-1", sha1: "SHA-1", sha256: "SHA-256", "sha-256": "SHA-256", sha384: "SHA-384", "sha-384": "SHA-384", "sha-512": "SHA-512", sha512: "SHA-512" }, l2 = []; function h2() { return i2 || (i2 = r3.g.process && r3.g.process.nextTick ? r3.g.process.nextTick : r3.g.queueMicrotask ? r3.g.queueMicrotask : r3.g.setImmediate ? r3.g.setImmediate : r3.g.setTimeout); } function p2(e4, t4, r4, n3, i3) { return f2.importKey("raw", e4, { name: "PBKDF2" }, false, ["deriveBits"]).then(function(e5) { return f2.deriveBits({ name: "PBKDF2", salt: t4, iterations: r4, hash: { name: i3 } }, e5, n3 << 3); }).then(function(e5) { return o2.from(e5); }); } e3.exports = function(e4, t4, i3, b2, y2, v2) { "function" == typeof y2 && (v2 = y2, y2 = void 0); var m2 = d2[(y2 = y2 || "sha1").toLowerCase()]; if (m2 && "function" == typeof r3.g.Promise) { if (a2(i3, b2), e4 = c2(e4, s2, "Password"), t4 = c2(t4, s2, "Salt"), "function" != typeof v2) throw new Error("No callback provided to pbkdf2"); !function(e5, t5) { e5.then(function(e6) { h2()(function() { t5(null, e6); }); }, function(e6) { h2()(function() { t5(e6); }); }); }(function(e5) { if (r3.g.process && !r3.g.process.browser) return Promise.resolve(false); if (!f2 || !f2.importKey || !f2.deriveBits) return Promise.resolve(false); if (void 0 !== l2[e5]) return l2[e5]; var t5 = p2(n2 = n2 || o2.alloc(8), n2, 10, 128, e5).then(function() { return true; }).catch(function() { return false; }); return l2[e5] = t5, t5; }(m2).then(function(r4) { return r4 ? p2(e4, t4, i3, b2, m2) : u2(e4, t4, i3, b2, y2); }), v2); } else h2()(function() { var r4; try { r4 = u2(e4, t4, i3, b2, y2); } catch (e5) { return v2(e5); } v2(null, r4); }); }; }, 77401: (e3, t3, r3) => { var n2, i2 = r3(19142); n2 = r3.g.process && r3.g.process.browser ? "utf-8" : r3.g.process && r3.g.process.version ? parseInt(i2.version.split(".")[0].slice(1), 10) >= 6 ? "utf-8" : "binary" : "utf-8", e3.exports = n2; }, 63127: (e3) => { var t3 = Math.pow(2, 30) - 1; e3.exports = function(e4, r3) { if ("number" != typeof e4) throw new TypeError("Iterations not a number"); if (e4 < 0) throw new TypeError("Bad iterations"); if ("number" != typeof r3) throw new TypeError("Key length not a number"); if (r3 < 0 || r3 > t3 || r3 != r3) throw new TypeError("Bad key length"); }; }, 1658: (e3, t3, r3) => { var n2 = r3(55349), i2 = r3(26707), o2 = r3(51708), a2 = r3(48850).Buffer, s2 = r3(63127), u2 = r3(77401), c2 = r3(98398), f2 = a2.alloc(128), d2 = { md5: 16, sha1: 20, sha224: 28, sha256: 32, sha384: 48, sha512: 64, rmd160: 20, ripemd160: 20 }; function l2(e4, t4, r4) { var s3 = function(e5) { return "rmd160" === e5 || "ripemd160" === e5 ? function(e6) { return new i2().update(e6).digest(); } : "md5" === e5 ? n2 : function(t5) { return o2(e5).update(t5).digest(); }; }(e4), u3 = "sha512" === e4 || "sha384" === e4 ? 128 : 64; t4.length > u3 ? t4 = s3(t4) : t4.length < u3 && (t4 = a2.concat([t4, f2], u3)); for (var c3 = a2.allocUnsafe(u3 + d2[e4]), l3 = a2.allocUnsafe(u3 + d2[e4]), h2 = 0; h2 < u3; h2++) c3[h2] = 54 ^ t4[h2], l3[h2] = 92 ^ t4[h2]; var p2 = a2.allocUnsafe(u3 + r4 + 4); c3.copy(p2, 0, 0, u3), this.ipad1 = p2, this.ipad2 = c3, this.opad = l3, this.alg = e4, this.blocksize = u3, this.hash = s3, this.size = d2[e4]; } l2.prototype.run = function(e4, t4) { return e4.copy(t4, this.blocksize), this.hash(t4).copy(this.opad, this.blocksize), this.hash(this.opad); }, e3.exports = function(e4, t4, r4, n3, i3) { s2(r4, n3); var o3 = new l2(i3 = i3 || "sha1", e4 = c2(e4, u2, "Password"), (t4 = c2(t4, u2, "Salt")).length), f3 = a2.allocUnsafe(n3), h2 = a2.allocUnsafe(t4.length + 4); t4.copy(h2, 0, 0, t4.length); for (var p2 = 0, b2 = d2[i3], y2 = Math.ceil(n3 / b2), v2 = 1; v2 <= y2; v2++) { h2.writeUInt32BE(v2, t4.length); for (var m2 = o3.run(h2, o3.ipad1), g2 = m2, w2 = 1; w2 < r4; w2++) { g2 = o3.run(g2, o3.ipad2); for (var k2 = 0; k2 < b2; k2++) m2[k2] ^= g2[k2]; } m2.copy(f3, p2), p2 += b2; } return f3; }; }, 98398: (e3, t3, r3) => { var n2 = r3(48850).Buffer; e3.exports = function(e4, t4, r4) { if (n2.isBuffer(e4)) return e4; if ("string" == typeof e4) return n2.from(e4, t4); if (ArrayBuffer.isView(e4)) return n2.from(e4.buffer); throw new TypeError(r4 + " must be a string, a Buffer, a typed array or a DataView"); }; }, 19142: (e3) => { var t3, r3, n2 = e3.exports = {}; function i2() { throw new Error("setTimeout has not been defined"); } function o2() { throw new Error("clearTimeout has not been defined"); } function a2(e4) { if (t3 === setTimeout) return setTimeout(e4, 0); if ((t3 === i2 || !t3) && setTimeout) return t3 = setTimeout, setTimeout(e4, 0); try { return t3(e4, 0); } catch (r4) { try { return t3.call(null, e4, 0); } catch (r5) { return t3.call(this, e4, 0); } } } !function() { try { t3 = "function" == typeof setTimeout ? setTimeout : i2; } catch (e4) { t3 = i2; } try { r3 = "function" == typeof clearTimeout ? clearTimeout : o2; } catch (e4) { r3 = o2; } }(); var s2, u2 = [], c2 = false, f2 = -1; function d2() { c2 && s2 && (c2 = false, s2.length ? u2 = s2.concat(u2) : f2 = -1, u2.length && l2()); } function l2() { if (!c2) { var e4 = a2(d2); c2 = true; for (var t4 = u2.length; t4; ) { for (s2 = u2, u2 = []; ++f2 < t4; ) s2 && s2[f2].run(); f2 = -1, t4 = u2.length; } s2 = null, c2 = false, function(e5) { if (r3 === clearTimeout) return clearTimeout(e5); if ((r3 === o2 || !r3) && clearTimeout) return r3 = clearTimeout, clearTimeout(e5); try { return r3(e5); } catch (t5) { try { return r3.call(null, e5); } catch (t6) { return r3.call(this, e5); } } }(e4); } } function h2(e4, t4) { this.fun = e4, this.array = t4; } function p2() { } n2.nextTick = function(e4) { var t4 = new Array(arguments.length - 1); if (arguments.length > 1) for (var r4 = 1; r4 < arguments.length; r4++) t4[r4 - 1] = arguments[r4]; u2.push(new h2(e4, t4)), 1 !== u2.length || c2 || a2(l2); }, h2.prototype.run = function() { this.fun.apply(null, this.array); }, n2.title = "browser", n2.browser = true, n2.env = {}, n2.argv = [], n2.version = "", n2.versions = {}, n2.on = p2, n2.addListener = p2, n2.once = p2, n2.off = p2, n2.removeListener = p2, n2.removeAllListeners = p2, n2.emit = p2, n2.prependListener = p2, n2.prependOnceListener = p2, n2.listeners = function(e4) { return []; }, n2.binding = function(e4) { throw new Error("process.binding is not supported"); }, n2.cwd = function() { return "/"; }, n2.chdir = function(e4) { throw new Error("process.chdir is not supported"); }, n2.umask = function() { return 0; }; }, 86991: (e3, t3, r3) => { t3.publicEncrypt = r3(82466), t3.privateDecrypt = r3(53144), t3.privateEncrypt = function(e4, r4) { return t3.publicEncrypt(e4, r4, true); }, t3.publicDecrypt = function(e4, r4) { return t3.privateDecrypt(e4, r4, true); }; }, 26873: (e3, t3, r3) => { var n2 = r3(35866), i2 = r3(48850).Buffer; function o2(e4) { var t4 = i2.allocUnsafe(4); return t4.writeUInt32BE(e4, 0), t4; } e3.exports = function(e4, t4) { for (var r4, a2 = i2.alloc(0), s2 = 0; a2.length < t4; ) r4 = o2(s2++), a2 = i2.concat([a2, n2("sha1").update(e4).update(r4).digest()]); return a2.slice(0, t4); }; }, 53144: (e3, t3, r3) => { var n2 = r3(27552), i2 = r3(26873), o2 = r3(27223), a2 = r3(31734), s2 = r3(99782), u2 = r3(35866), c2 = r3(2561), f2 = r3(48850).Buffer; e3.exports = function(e4, t4, r4) { var d2; d2 = e4.padding ? e4.padding : r4 ? 1 : 4; var l2, h2 = n2(e4), p2 = h2.modulus.byteLength(); if (t4.length > p2 || new a2(t4).cmp(h2.modulus) >= 0) throw new Error("decryption error"); l2 = r4 ? c2(new a2(t4), h2) : s2(t4, h2); var b2 = f2.alloc(p2 - l2.length); if (l2 = f2.concat([b2, l2], p2), 4 === d2) return function(e5, t5) { var r5 = e5.modulus.byteLength(), n3 = u2("sha1").update(f2.alloc(0)).digest(), a3 = n3.length; if (0 !== t5[0]) throw new Error("decryption error"); var s3 = t5.slice(1, a3 + 1), c3 = t5.slice(a3 + 1), d3 = o2(s3, i2(c3, a3)), l3 = o2(c3, i2(d3, r5 - a3 - 1)); if (function(e6, t6) { e6 = f2.from(e6), t6 = f2.from(t6); var r6 = 0, n4 = e6.length; e6.length !== t6.length && (r6++, n4 = Math.min(e6.length, t6.length)); for (var i3 = -1; ++i3 < n4; ) r6 += e6[i3] ^ t6[i3]; return r6; }(n3, l3.slice(0, a3))) throw new Error("decryption error"); for (var h3 = a3; 0 === l3[h3]; ) h3++; if (1 !== l3[h3++]) throw new Error("decryption error"); return l3.slice(h3); }(h2, l2); if (1 === d2) return function(e5, t5, r5) { for (var n3 = t5.slice(0, 2), i3 = 2, o3 = 0; 0 !== t5[i3++]; ) if (i3 >= t5.length) { o3++; break; } var a3 = t5.slice(2, i3 - 1); if (("0002" !== n3.toString("hex") && !r5 || "0001" !== n3.toString("hex") && r5) && o3++, a3.length < 8 && o3++, o3) throw new Error("decryption error"); return t5.slice(i3); }(0, l2, r4); if (3 === d2) return l2; throw new Error("unknown padding"); }; }, 82466: (e3, t3, r3) => { var n2 = r3(27552), i2 = r3(75010), o2 = r3(35866), a2 = r3(26873), s2 = r3(27223), u2 = r3(31734), c2 = r3(2561), f2 = r3(99782), d2 = r3(48850).Buffer; e3.exports = function(e4, t4, r4) { var l2; l2 = e4.padding ? e4.padding : r4 ? 1 : 4; var h2, p2 = n2(e4); if (4 === l2) h2 = function(e5, t5) { var r5 = e5.modulus.byteLength(), n3 = t5.length, c3 = o2("sha1").update(d2.alloc(0)).digest(), f3 = c3.length, l3 = 2 * f3; if (n3 > r5 - l3 - 2) throw new Error("message too long"); var h3 = d2.alloc(r5 - n3 - l3 - 2), p3 = r5 - f3 - 1, b2 = i2(f3), y2 = s2(d2.concat([c3, h3, d2.alloc(1, 1), t5], p3), a2(b2, p3)), v2 = s2(b2, a2(y2, f3)); return new u2(d2.concat([d2.alloc(1), v2, y2], r5)); }(p2, t4); else if (1 === l2) h2 = function(e5, t5, r5) { var n3, o3 = t5.length, a3 = e5.modulus.byteLength(); if (o3 > a3 - 11) throw new Error("message too long"); return n3 = r5 ? d2.alloc(a3 - o3 - 3, 255) : function(e6) { for (var t6, r6 = d2.allocUnsafe(e6), n4 = 0, o4 = i2(2 * e6), a4 = 0; n4 < e6; ) a4 === o4.length && (o4 = i2(2 * e6), a4 = 0), (t6 = o4[a4++]) && (r6[n4++] = t6); return r6; }(a3 - o3 - 3), new u2(d2.concat([d2.from([0, r5 ? 1 : 2]), n3, d2.alloc(1), t5], a3)); }(p2, t4, r4); else { if (3 !== l2) throw new Error("unknown padding"); if ((h2 = new u2(t4)).cmp(p2.modulus) >= 0) throw new Error("data too long for modulus"); } return r4 ? f2(h2, p2) : c2(h2, p2); }; }, 2561: (e3, t3, r3) => { var n2 = r3(31734), i2 = r3(48850).Buffer; e3.exports = function(e4, t4) { return i2.from(e4.toRed(n2.mont(t4.modulus)).redPow(new n2(t4.publicExponent)).fromRed().toArray()); }; }, 27223: (e3) => { e3.exports = function(e4, t3) { for (var r3 = e4.length, n2 = -1; ++n2 < r3; ) e4[n2] ^= t3[n2]; return e4; }; }, 31296: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(22028), o2 = r3(33103), a2 = r3(80034); function s2(e4, t4) { return t4.encode ? t4.strict ? i2(e4) : encodeURIComponent(e4) : e4; } function u2(e4) { return Array.isArray(e4) ? e4.sort() : "object" === (0, n2.default)(e4) ? u2(Object.keys(e4)).sort(function(e5, t4) { return Number(e5) - Number(t4); }).map(function(t4) { return e4[t4]; }) : e4; } function c2(e4) { var t4 = e4.indexOf("?"); return -1 === t4 ? "" : e4.slice(t4 + 1); } function f2(e4, t4) { var r4 = function(e5) { var t5; switch (e5.arrayFormat) { case "index": return function(e6, r5, n3) { t5 = /\[(\d*)\]$/.exec(e6), e6 = e6.replace(/\[\d*\]$/, ""), t5 ? (void 0 === n3[e6] && (n3[e6] = {}), n3[e6][t5[1]] = r5) : n3[e6] = r5; }; case "bracket": return function(e6, r5, n3) { t5 = /(\[\])$/.exec(e6), e6 = e6.replace(/\[\]$/, ""), t5 ? void 0 !== n3[e6] ? n3[e6] = [].concat(n3[e6], r5) : n3[e6] = [r5] : n3[e6] = r5; }; default: return function(e6, t6, r5) { void 0 !== r5[e6] ? r5[e6] = [].concat(r5[e6], t6) : r5[e6] = t6; }; } }(t4 = o2({ arrayFormat: "none" }, t4)), i3 = /* @__PURE__ */ Object.create(null); return "string" != typeof e4 ? i3 : (e4 = e4.trim().replace(/^[?#&]/, "")) ? (e4.split("&").forEach(function(e5) { var t5 = e5.replace(/\+/g, " ").split("="), n3 = t5.shift(), o3 = t5.length > 0 ? t5.join("=") : void 0; o3 = void 0 === o3 ? null : a2(o3), r4(a2(n3), o3, i3); }), Object.keys(i3).sort().reduce(function(e5, t5) { var r5 = i3[t5]; return Boolean(r5) && "object" === (0, n2.default)(r5) && !Array.isArray(r5) ? e5[t5] = u2(r5) : e5[t5] = r5, e5; }, /* @__PURE__ */ Object.create(null))) : i3; } t3.extract = c2, t3.parse = f2, t3.stringify = function(e4, t4) { false === (t4 = o2({ encode: true, strict: true, arrayFormat: "none" }, t4)).sort && (t4.sort = function() { }); var r4 = function(e5) { switch (e5.arrayFormat) { case "index": return function(t5, r5, n3) { return null === r5 ? [s2(t5, e5), "[", n3, "]"].join("") : [s2(t5, e5), "[", s2(n3, e5), "]=", s2(r5, e5)].join(""); }; case "bracket": return function(t5, r5) { return null === r5 ? s2(t5, e5) : [s2(t5, e5), "[]=", s2(r5, e5)].join(""); }; default: return function(t5, r5) { return null === r5 ? s2(t5, e5) : [s2(t5, e5), "=", s2(r5, e5)].join(""); }; } }(t4); return e4 ? Object.keys(e4).sort(t4.sort).map(function(n3) { var i3 = e4[n3]; if (void 0 === i3) return ""; if (null === i3) return s2(n3, t4); if (Array.isArray(i3)) { var o3 = []; return i3.slice().forEach(function(e5) { void 0 !== e5 && o3.push(r4(n3, e5, o3.length)); }), o3.join("&"); } return s2(n3, t4) + "=" + s2(i3, t4); }).filter(function(e5) { return e5.length > 0; }).join("&") : ""; }, t3.parseUrl = function(e4, t4) { return { url: e4.split("?")[0] || "", query: f2(c2(e4), t4) }; }; }, 75010: (e3, t3, r3) => { var n2 = r3(19142), i2 = 65536, o2 = r3(48850).Buffer, a2 = r3.g.crypto || r3.g.msCrypto; a2 && a2.getRandomValues ? e3.exports = function(e4, t4) { if (e4 > 4294967295) throw new RangeError("requested too many random bytes"); var r4 = o2.allocUnsafe(e4); if (e4 > 0) if (e4 > i2) for (var s2 = 0; s2 < e4; s2 += i2) a2.getRandomValues(r4.slice(s2, s2 + i2)); else a2.getRandomValues(r4); return "function" == typeof t4 ? n2.nextTick(function() { t4(null, r4); }) : r4; } : e3.exports = function() { throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11"); }; }, 36509: (e3, t3, r3) => { var n2 = r3(19142); function i2() { throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11"); } var o2 = r3(48850), a2 = r3(75010), s2 = o2.Buffer, u2 = o2.kMaxLength, c2 = r3.g.crypto || r3.g.msCrypto, f2 = Math.pow(2, 32) - 1; function d2(e4, t4) { if ("number" != typeof e4 || e4 != e4) throw new TypeError("offset must be a number"); if (e4 > f2 || e4 < 0) throw new TypeError("offset must be a uint32"); if (e4 > u2 || e4 > t4) throw new RangeError("offset out of range"); } function l2(e4, t4, r4) { if ("number" != typeof e4 || e4 != e4) throw new TypeError("size must be a number"); if (e4 > f2 || e4 < 0) throw new TypeError("size must be a uint32"); if (e4 + t4 > r4 || e4 > u2) throw new RangeError("buffer too small"); } function h2(e4, t4, r4, i3) { if (n2.browser) { var o3 = e4.buffer, s3 = new Uint8Array(o3, t4, r4); return c2.getRandomValues(s3), i3 ? void n2.nextTick(function() { i3(null, e4); }) : e4; } if (!i3) return a2(r4).copy(e4, t4), e4; a2(r4, function(r5, n3) { if (r5) return i3(r5); n3.copy(e4, t4), i3(null, e4); }); } c2 && c2.getRandomValues || !n2.browser ? (t3.randomFill = function(e4, t4, n3, i3) { if (!(s2.isBuffer(e4) || e4 instanceof r3.g.Uint8Array)) throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); if ("function" == typeof t4) i3 = t4, t4 = 0, n3 = e4.length; else if ("function" == typeof n3) i3 = n3, n3 = e4.length - t4; else if ("function" != typeof i3) throw new TypeError('"cb" argument must be a function'); return d2(t4, e4.length), l2(n3, t4, e4.length), h2(e4, t4, n3, i3); }, t3.randomFillSync = function(e4, t4, n3) { if (void 0 === t4 && (t4 = 0), !(s2.isBuffer(e4) || e4 instanceof r3.g.Uint8Array)) throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); return d2(t4, e4.length), void 0 === n3 && (n3 = e4.length - t4), l2(n3, t4, e4.length), h2(e4, t4, n3); }) : (t3.randomFill = i2, t3.randomFillSync = i2); }, 79024: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = {}; function o2(e4, t4, r4) { r4 || (r4 = Error); var n3 = function(e5) { var r5, n4; function i3(r6, n5, i4) { return e5.call(this, function(e6, r7, n6) { return "string" == typeof t4 ? t4 : t4(e6, r7, n6); }(r6, n5, i4)) || this; } return n4 = e5, (r5 = i3).prototype = Object.create(n4.prototype), r5.prototype.constructor = r5, r5.__proto__ = n4, i3; }(r4); n3.prototype.name = r4.name, n3.prototype.code = e4, i2[e4] = n3; } function a2(e4, t4) { if (Array.isArray(e4)) { var r4 = e4.length; return e4 = e4.map(function(e5) { return String(e5); }), r4 > 2 ? "one of ".concat(t4, " ").concat(e4.slice(0, r4 - 1).join(", "), ", or ") + e4[r4 - 1] : 2 === r4 ? "one of ".concat(t4, " ").concat(e4[0], " or ").concat(e4[1]) : "of ".concat(t4, " ").concat(e4[0]); } return "of ".concat(t4, " ").concat(String(e4)); } o2("ERR_INVALID_OPT_VALUE", function(e4, t4) { return 'The value "' + t4 + '" is invalid for option "' + e4 + '"'; }, TypeError), o2("ERR_INVALID_ARG_TYPE", function(e4, t4, r4) { var i3, o3, s2, u2, c2; if ("string" == typeof t4 && (o3 = "not ", t4.substr(0, o3.length) === o3) ? (i3 = "must not be", t4 = t4.replace(/^not /, "")) : i3 = "must be", function(e5, t5, r5) { return (void 0 === r5 || r5 > e5.length) && (r5 = e5.length), e5.substring(r5 - t5.length, r5) === t5; }(e4, " argument")) s2 = "The ".concat(e4, " ").concat(i3, " ").concat(a2(t4, "type")); else { var f2 = ("number" != typeof c2 && (c2 = 0), c2 + ".".length > (u2 = e4).length || -1 === u2.indexOf(".", c2) ? "argument" : "property"); s2 = 'The "'.concat(e4, '" ').concat(f2, " ").concat(i3, " ").concat(a2(t4, "type")); } return s2 + ". Received type ".concat((0, n2.default)(r4)); }, TypeError), o2("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"), o2("ERR_METHOD_NOT_IMPLEMENTED", function(e4) { return "The " + e4 + " method is not implemented"; }), o2("ERR_STREAM_PREMATURE_CLOSE", "Premature close"), o2("ERR_STREAM_DESTROYED", function(e4) { return "Cannot call " + e4 + " after a stream was destroyed"; }), o2("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"), o2("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"), o2("ERR_STREAM_WRITE_AFTER_END", "write after end"), o2("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError), o2("ERR_UNKNOWN_ENCODING", function(e4) { return "Unknown encoding: " + e4; }, TypeError), o2("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"), e3.exports.q = i2; }, 76884: (e3, t3, r3) => { var n2 = r3(19142), i2 = Object.keys || function(e4) { var t4 = []; for (var r4 in e4) t4.push(r4); return t4; }; e3.exports = f2; var o2 = r3(6297), a2 = r3(71471); r3(41736)(f2, o2); for (var s2 = i2(a2.prototype), u2 = 0; u2 < s2.length; u2++) { var c2 = s2[u2]; f2.prototype[c2] || (f2.prototype[c2] = a2.prototype[c2]); } function f2(e4) { if (!(this instanceof f2)) return new f2(e4); o2.call(this, e4), a2.call(this, e4), this.allowHalfOpen = true, e4 && (false === e4.readable && (this.readable = false), false === e4.writable && (this.writable = false), false === e4.allowHalfOpen && (this.allowHalfOpen = false, this.once("end", d2))); } function d2() { this._writableState.ended || n2.nextTick(l2, this); } function l2(e4) { e4.end(); } Object.defineProperty(f2.prototype, "writableHighWaterMark", { enumerable: false, get: function() { return this._writableState.highWaterMark; } }), Object.defineProperty(f2.prototype, "writableBuffer", { enumerable: false, get: function() { return this._writableState && this._writableState.getBuffer(); } }), Object.defineProperty(f2.prototype, "writableLength", { enumerable: false, get: function() { return this._writableState.length; } }), Object.defineProperty(f2.prototype, "destroyed", { enumerable: false, get: function() { return void 0 !== this._readableState && void 0 !== this._writableState && this._readableState.destroyed && this._writableState.destroyed; }, set: function(e4) { void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = e4, this._writableState.destroyed = e4); } }); }, 53582: (e3, t3, r3) => { e3.exports = i2; var n2 = r3(99154); function i2(e4) { if (!(this instanceof i2)) return new i2(e4); n2.call(this, e4); } r3(41736)(i2, n2), i2.prototype._transform = function(e4, t4, r4) { r4(null, e4); }; }, 6297: (e3, t3, r3) => { var n2, i2 = r3(19142); e3.exports = S2, S2.ReadableState = E2, r3(38291).EventEmitter; var o2, a2 = function(e4, t4) { return e4.listeners(t4).length; }, s2 = r3(37144), u2 = r3(29033).Buffer, c2 = (void 0 !== r3.g ? r3.g : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {}).Uint8Array || function() { }, f2 = r3(94616); o2 = f2 && f2.debuglog ? f2.debuglog("stream") : function() { }; var d2, l2, h2, p2 = r3(25392), b2 = r3(57572), y2 = r3(6756).getHighWaterMark, v2 = r3(79024).q, m2 = v2.ERR_INVALID_ARG_TYPE, g2 = v2.ERR_STREAM_PUSH_AFTER_EOF, w2 = v2.ERR_METHOD_NOT_IMPLEMENTED, k2 = v2.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; r3(41736)(S2, s2); var _2 = b2.errorOrDestroy, A2 = ["error", "close", "destroy", "pause", "resume"]; function E2(e4, t4, i3) { n2 = n2 || r3(76884), e4 = e4 || {}, "boolean" != typeof i3 && (i3 = t4 instanceof n2), this.objectMode = !!e4.objectMode, i3 && (this.objectMode = this.objectMode || !!e4.readableObjectMode), this.highWaterMark = y2(this, e4, "readableHighWaterMark", i3), this.buffer = new p2(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = false, this.endEmitted = false, this.reading = false, this.sync = true, this.needReadable = false, this.emittedReadable = false, this.readableListening = false, this.resumeScheduled = false, this.paused = true, this.emitClose = false !== e4.emitClose, this.autoDestroy = !!e4.autoDestroy, this.destroyed = false, this.defaultEncoding = e4.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = false, this.decoder = null, this.encoding = null, e4.encoding && (d2 || (d2 = r3(23462).s), this.decoder = new d2(e4.encoding), this.encoding = e4.encoding); } function S2(e4) { if (n2 = n2 || r3(76884), !(this instanceof S2)) return new S2(e4); var t4 = this instanceof n2; this._readableState = new E2(e4, this, t4), this.readable = true, e4 && ("function" == typeof e4.read && (this._read = e4.read), "function" == typeof e4.destroy && (this._destroy = e4.destroy)), s2.call(this); } function x2(e4, t4, r4, n3, i3) { o2("readableAddChunk", t4); var a3, s3 = e4._readableState; if (null === t4) s3.reading = false, function(e5, t5) { if (o2("onEofChunk"), !t5.ended) { if (t5.decoder) { var r5 = t5.decoder.end(); r5 && r5.length && (t5.buffer.push(r5), t5.length += t5.objectMode ? 1 : r5.length); } t5.ended = true, t5.sync ? I2(e5) : (t5.needReadable = false, t5.emittedReadable || (t5.emittedReadable = true, T2(e5))); } }(e4, s3); else if (i3 || (a3 = function(e5, t5) { var r5, n4; return n4 = t5, u2.isBuffer(n4) || n4 instanceof c2 || "string" == typeof t5 || void 0 === t5 || e5.objectMode || (r5 = new m2("chunk", ["string", "Buffer", "Uint8Array"], t5)), r5; }(s3, t4)), a3) _2(e4, a3); else if (s3.objectMode || t4 && t4.length > 0) if ("string" == typeof t4 || s3.objectMode || Object.getPrototypeOf(t4) === u2.prototype || (t4 = function(e5) { return u2.from(e5); }(t4)), n3) s3.endEmitted ? _2(e4, new k2()) : B2(e4, s3, t4, true); else if (s3.ended) _2(e4, new g2()); else { if (s3.destroyed) return false; s3.reading = false, s3.decoder && !r4 ? (t4 = s3.decoder.write(t4), s3.objectMode || 0 !== t4.length ? B2(e4, s3, t4, false) : C2(e4, s3)) : B2(e4, s3, t4, false); } else n3 || (s3.reading = false, C2(e4, s3)); return !s3.ended && (s3.length < s3.highWaterMark || 0 === s3.length); } function B2(e4, t4, r4, n3) { t4.flowing && 0 === t4.length && !t4.sync ? (t4.awaitDrain = 0, e4.emit("data", r4)) : (t4.length += t4.objectMode ? 1 : r4.length, n3 ? t4.buffer.unshift(r4) : t4.buffer.push(r4), t4.needReadable && I2(e4)), C2(e4, t4); } Object.defineProperty(S2.prototype, "destroyed", { enumerable: false, get: function() { return void 0 !== this._readableState && this._readableState.destroyed; }, set: function(e4) { this._readableState && (this._readableState.destroyed = e4); } }), S2.prototype.destroy = b2.destroy, S2.prototype._undestroy = b2.undestroy, S2.prototype._destroy = function(e4, t4) { t4(e4); }, S2.prototype.push = function(e4, t4) { var r4, n3 = this._readableState; return n3.objectMode ? r4 = true : "string" == typeof e4 && ((t4 = t4 || n3.defaultEncoding) !== n3.encoding && (e4 = u2.from(e4, t4), t4 = ""), r4 = true), x2(this, e4, t4, false, r4); }, S2.prototype.unshift = function(e4) { return x2(this, e4, null, true, false); }, S2.prototype.isPaused = function() { return false === this._readableState.flowing; }, S2.prototype.setEncoding = function(e4) { d2 || (d2 = r3(23462).s); var t4 = new d2(e4); this._readableState.decoder = t4, this._readableState.encoding = this._readableState.decoder.encoding; for (var n3 = this._readableState.buffer.head, i3 = ""; null !== n3; ) i3 += t4.write(n3.data), n3 = n3.next; return this._readableState.buffer.clear(), "" !== i3 && this._readableState.buffer.push(i3), this._readableState.length = i3.length, this; }; var O2 = 1073741824; function P2(e4, t4) { return e4 <= 0 || 0 === t4.length && t4.ended ? 0 : t4.objectMode ? 1 : e4 != e4 ? t4.flowing && t4.length ? t4.buffer.head.data.length : t4.length : (e4 > t4.highWaterMark && (t4.highWaterMark = function(e5) { return e5 >= O2 ? e5 = O2 : (e5--, e5 |= e5 >>> 1, e5 |= e5 >>> 2, e5 |= e5 >>> 4, e5 |= e5 >>> 8, e5 |= e5 >>> 16, e5++), e5; }(e4)), e4 <= t4.length ? e4 : t4.ended ? t4.length : (t4.needReadable = true, 0)); } function I2(e4) { var t4 = e4._readableState; o2("emitReadable", t4.needReadable, t4.emittedReadable), t4.needReadable = false, t4.emittedReadable || (o2("emitReadable", t4.flowing), t4.emittedReadable = true, i2.nextTick(T2, e4)); } function T2(e4) { var t4 = e4._readableState; o2("emitReadable_", t4.destroyed, t4.length, t4.ended), t4.destroyed || !t4.length && !t4.ended || (e4.emit("readable"), t4.emittedReadable = false), t4.needReadable = !t4.flowing && !t4.ended && t4.length <= t4.highWaterMark, j2(e4); } function C2(e4, t4) { t4.readingMore || (t4.readingMore = true, i2.nextTick(M2, e4, t4)); } function M2(e4, t4) { for (; !t4.reading && !t4.ended && (t4.length < t4.highWaterMark || t4.flowing && 0 === t4.length); ) { var r4 = t4.length; if (o2("maybeReadMore read 0"), e4.read(0), r4 === t4.length) break; } t4.readingMore = false; } function R2(e4) { var t4 = e4._readableState; t4.readableListening = e4.listenerCount("readable") > 0, t4.resumeScheduled && !t4.paused ? t4.flowing = true : e4.listenerCount("data") > 0 && e4.resume(); } function U2(e4) { o2("readable nexttick read 0"), e4.read(0); } function N2(e4, t4) { o2("resume", t4.reading), t4.reading || e4.read(0), t4.resumeScheduled = false, e4.emit("resume"), j2(e4), t4.flowing && !t4.reading && e4.read(0); } function j2(e4) { var t4 = e4._readableState; for (o2("flow", t4.flowing); t4.flowing && null !== e4.read(); ) ; } function L2(e4, t4) { return 0 === t4.length ? null : (t4.objectMode ? r4 = t4.buffer.shift() : !e4 || e4 >= t4.length ? (r4 = t4.decoder ? t4.buffer.join("") : 1 === t4.buffer.length ? t4.buffer.first() : t4.buffer.concat(t4.length), t4.buffer.clear()) : r4 = t4.buffer.consume(e4, t4.decoder), r4); var r4; } function F2(e4) { var t4 = e4._readableState; o2("endReadable", t4.endEmitted), t4.endEmitted || (t4.ended = true, i2.nextTick(D2, t4, e4)); } function D2(e4, t4) { if (o2("endReadableNT", e4.endEmitted, e4.length), !e4.endEmitted && 0 === e4.length && (e4.endEmitted = true, t4.readable = false, t4.emit("end"), e4.autoDestroy)) { var r4 = t4._writableState; (!r4 || r4.autoDestroy && r4.finished) && t4.destroy(); } } function H2(e4, t4) { for (var r4 = 0, n3 = e4.length; r4 < n3; r4++) if (e4[r4] === t4) return r4; return -1; } S2.prototype.read = function(e4) { o2("read", e4), e4 = parseInt(e4, 10); var t4 = this._readableState, r4 = e4; if (0 !== e4 && (t4.emittedReadable = false), 0 === e4 && t4.needReadable && ((0 !== t4.highWaterMark ? t4.length >= t4.highWaterMark : t4.length > 0) || t4.ended)) return o2("read: emitReadable", t4.length, t4.ended), 0 === t4.length && t4.ended ? F2(this) : I2(this), null; if (0 === (e4 = P2(e4, t4)) && t4.ended) return 0 === t4.length && F2(this), null; var n3, i3 = t4.needReadable; return o2("need readable", i3), (0 === t4.length || t4.length - e4 < t4.highWaterMark) && o2("length less than watermark", i3 = true), t4.ended || t4.reading ? o2("reading or ended", i3 = false) : i3 && (o2("do read"), t4.reading = true, t4.sync = true, 0 === t4.length && (t4.needReadable = true), this._read(t4.highWaterMark), t4.sync = false, t4.reading || (e4 = P2(r4, t4))), null === (n3 = e4 > 0 ? L2(e4, t4) : null) ? (t4.needReadable = t4.length <= t4.highWaterMark, e4 = 0) : (t4.length -= e4, t4.awaitDrain = 0), 0 === t4.length && (t4.ended || (t4.needReadable = true), r4 !== e4 && t4.ended && F2(this)), null !== n3 && this.emit("data", n3), n3; }, S2.prototype._read = function(e4) { _2(this, new w2("_read()")); }, S2.prototype.pipe = function(e4, t4) { var r4 = this, n3 = this._readableState; switch (n3.pipesCount) { case 0: n3.pipes = e4; break; case 1: n3.pipes = [n3.pipes, e4]; break; default: n3.pipes.push(e4); } n3.pipesCount += 1, o2("pipe count=%d opts=%j", n3.pipesCount, t4); var s3 = t4 && false === t4.end || e4 === i2.stdout || e4 === i2.stderr ? b3 : u3; function u3() { o2("onend"), e4.end(); } n3.endEmitted ? i2.nextTick(s3) : r4.once("end", s3), e4.on("unpipe", function t5(i3, a3) { o2("onunpipe"), i3 === r4 && a3 && false === a3.hasUnpiped && (a3.hasUnpiped = true, o2("cleanup"), e4.removeListener("close", h3), e4.removeListener("finish", p3), e4.removeListener("drain", c3), e4.removeListener("error", l3), e4.removeListener("unpipe", t5), r4.removeListener("end", u3), r4.removeListener("end", b3), r4.removeListener("data", d3), f3 = true, !n3.awaitDrain || e4._writableState && !e4._writableState.needDrain || c3()); }); var c3 = function(e5) { return function() { var t5 = e5._readableState; o2("pipeOnDrain", t5.awaitDrain), t5.awaitDrain && t5.awaitDrain--, 0 === t5.awaitDrain && a2(e5, "data") && (t5.flowing = true, j2(e5)); }; }(r4); e4.on("drain", c3); var f3 = false; function d3(t5) { o2("ondata"); var i3 = e4.write(t5); o2("dest.write", i3), false === i3 && ((1 === n3.pipesCount && n3.pipes === e4 || n3.pipesCount > 1 && -1 !== H2(n3.pipes, e4)) && !f3 && (o2("false write response, pause", n3.awaitDrain), n3.awaitDrain++), r4.pause()); } function l3(t5) { o2("onerror", t5), b3(), e4.removeListener("error", l3), 0 === a2(e4, "error") && _2(e4, t5); } function h3() { e4.removeListener("finish", p3), b3(); } function p3() { o2("onfinish"), e4.removeListener("close", h3), b3(); } function b3() { o2("unpipe"), r4.unpipe(e4); } return r4.on("data", d3), function(e5, t5, r5) { if ("function" == typeof e5.prependListener) return e5.prependListener(t5, r5); e5._events && e5._events[t5] ? Array.isArray(e5._events[t5]) ? e5._events[t5].unshift(r5) : e5._events[t5] = [r5, e5._events[t5]] : e5.on(t5, r5); }(e4, "error", l3), e4.once("close", h3), e4.once("finish", p3), e4.emit("pipe", r4), n3.flowing || (o2("pipe resume"), r4.resume()), e4; }, S2.prototype.unpipe = function(e4) { var t4 = this._readableState, r4 = { hasUnpiped: false }; if (0 === t4.pipesCount) return this; if (1 === t4.pipesCount) return e4 && e4 !== t4.pipes || (e4 || (e4 = t4.pipes), t4.pipes = null, t4.pipesCount = 0, t4.flowing = false, e4 && e4.emit("unpipe", this, r4)), this; if (!e4) { var n3 = t4.pipes, i3 = t4.pipesCount; t4.pipes = null, t4.pipesCount = 0, t4.flowing = false; for (var o3 = 0; o3 < i3; o3++) n3[o3].emit("unpipe", this, { hasUnpiped: false }); return this; } var a3 = H2(t4.pipes, e4); return -1 === a3 || (t4.pipes.splice(a3, 1), t4.pipesCount -= 1, 1 === t4.pipesCount && (t4.pipes = t4.pipes[0]), e4.emit("unpipe", this, r4)), this; }, S2.prototype.on = function(e4, t4) { var r4 = s2.prototype.on.call(this, e4, t4), n3 = this._readableState; return "data" === e4 ? (n3.readableListening = this.listenerCount("readable") > 0, false !== n3.flowing && this.resume()) : "readable" === e4 && (n3.endEmitted || n3.readableListening || (n3.readableListening = n3.needReadable = true, n3.flowing = false, n3.emittedReadable = false, o2("on readable", n3.length, n3.reading), n3.length ? I2(this) : n3.reading || i2.nextTick(U2, this))), r4; }, S2.prototype.addListener = S2.prototype.on, S2.prototype.removeListener = function(e4, t4) { var r4 = s2.prototype.removeListener.call(this, e4, t4); return "readable" === e4 && i2.nextTick(R2, this), r4; }, S2.prototype.removeAllListeners = function(e4) { var t4 = s2.prototype.removeAllListeners.apply(this, arguments); return "readable" !== e4 && void 0 !== e4 || i2.nextTick(R2, this), t4; }, S2.prototype.resume = function() { var e4 = this._readableState; return e4.flowing || (o2("resume"), e4.flowing = !e4.readableListening, function(e5, t4) { t4.resumeScheduled || (t4.resumeScheduled = true, i2.nextTick(N2, e5, t4)); }(this, e4)), e4.paused = false, this; }, S2.prototype.pause = function() { return o2("call pause flowing=%j", this._readableState.flowing), false !== this._readableState.flowing && (o2("pause"), this._readableState.flowing = false, this.emit("pause")), this._readableState.paused = true, this; }, S2.prototype.wrap = function(e4) { var t4 = this, r4 = this._readableState, n3 = false; for (var i3 in e4.on("end", function() { if (o2("wrapped end"), r4.decoder && !r4.ended) { var e5 = r4.decoder.end(); e5 && e5.length && t4.push(e5); } t4.push(null); }), e4.on("data", function(i4) { o2("wrapped data"), r4.decoder && (i4 = r4.decoder.write(i4)), r4.objectMode && null == i4 || (r4.objectMode || i4 && i4.length) && (t4.push(i4) || (n3 = true, e4.pause())); }), e4) void 0 === this[i3] && "function" == typeof e4[i3] && (this[i3] = function(t5) { return function() { return e4[t5].apply(e4, arguments); }; }(i3)); for (var a3 = 0; a3 < A2.length; a3++) e4.on(A2[a3], this.emit.bind(this, A2[a3])); return this._read = function(t5) { o2("wrapped _read", t5), n3 && (n3 = false, e4.resume()); }, this; }, "function" == typeof Symbol && (S2.prototype[Symbol.asyncIterator] = function() { return void 0 === l2 && (l2 = r3(32317)), l2(this); }), Object.defineProperty(S2.prototype, "readableHighWaterMark", { enumerable: false, get: function() { return this._readableState.highWaterMark; } }), Object.defineProperty(S2.prototype, "readableBuffer", { enumerable: false, get: function() { return this._readableState && this._readableState.buffer; } }), Object.defineProperty(S2.prototype, "readableFlowing", { enumerable: false, get: function() { return this._readableState.flowing; }, set: function(e4) { this._readableState && (this._readableState.flowing = e4); } }), S2._fromList = L2, Object.defineProperty(S2.prototype, "readableLength", { enumerable: false, get: function() { return this._readableState.length; } }), "function" == typeof Symbol && (S2.from = function(e4, t4) { return void 0 === h2 && (h2 = r3(16218)), h2(S2, e4, t4); }); }, 99154: (e3, t3, r3) => { e3.exports = f2; var n2 = r3(79024).q, i2 = n2.ERR_METHOD_NOT_IMPLEMENTED, o2 = n2.ERR_MULTIPLE_CALLBACK, a2 = n2.ERR_TRANSFORM_ALREADY_TRANSFORMING, s2 = n2.ERR_TRANSFORM_WITH_LENGTH_0, u2 = r3(76884); function c2(e4, t4) { var r4 = this._transformState; r4.transforming = false; var n3 = r4.writecb; if (null === n3) return this.emit("error", new o2()); r4.writechunk = null, r4.writecb = null, null != t4 && this.push(t4), n3(e4); var i3 = this._readableState; i3.reading = false, (i3.needReadable || i3.length < i3.highWaterMark) && this._read(i3.highWaterMark); } function f2(e4) { if (!(this instanceof f2)) return new f2(e4); u2.call(this, e4), this._transformState = { afterTransform: c2.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }, this._readableState.needReadable = true, this._readableState.sync = false, e4 && ("function" == typeof e4.transform && (this._transform = e4.transform), "function" == typeof e4.flush && (this._flush = e4.flush)), this.on("prefinish", d2); } function d2() { var e4 = this; "function" != typeof this._flush || this._readableState.destroyed ? l2(this, null, null) : this._flush(function(t4, r4) { l2(e4, t4, r4); }); } function l2(e4, t4, r4) { if (t4) return e4.emit("error", t4); if (null != r4 && e4.push(r4), e4._writableState.length) throw new s2(); if (e4._transformState.transforming) throw new a2(); return e4.push(null); } r3(41736)(f2, u2), f2.prototype.push = function(e4, t4) { return this._transformState.needTransform = false, u2.prototype.push.call(this, e4, t4); }, f2.prototype._transform = function(e4, t4, r4) { r4(new i2("_transform()")); }, f2.prototype._write = function(e4, t4, r4) { var n3 = this._transformState; if (n3.writecb = r4, n3.writechunk = e4, n3.writeencoding = t4, !n3.transforming) { var i3 = this._readableState; (n3.needTransform || i3.needReadable || i3.length < i3.highWaterMark) && this._read(i3.highWaterMark); } }, f2.prototype._read = function(e4) { var t4 = this._transformState; null === t4.writechunk || t4.transforming ? t4.needTransform = true : (t4.transforming = true, this._transform(t4.writechunk, t4.writeencoding, t4.afterTransform)); }, f2.prototype._destroy = function(e4, t4) { u2.prototype._destroy.call(this, e4, function(e5) { t4(e5); }); }; }, 71471: (e3, t3, r3) => { var n2, i2 = r3(19142); function o2(e4) { var t4 = this; this.next = null, this.entry = null, this.finish = function() { !function(e5, t5, r4) { var n3 = e5.entry; for (e5.entry = null; n3; ) { var i3 = n3.callback; t5.pendingcb--, i3(void 0), n3 = n3.next; } t5.corkedRequestsFree.next = e5; }(t4, e4); }; } e3.exports = S2, S2.WritableState = E2; var a2, s2 = { deprecate: r3(96219) }, u2 = r3(37144), c2 = r3(29033).Buffer, f2 = (void 0 !== r3.g ? r3.g : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {}).Uint8Array || function() { }, d2 = r3(57572), l2 = r3(6756).getHighWaterMark, h2 = r3(79024).q, p2 = h2.ERR_INVALID_ARG_TYPE, b2 = h2.ERR_METHOD_NOT_IMPLEMENTED, y2 = h2.ERR_MULTIPLE_CALLBACK, v2 = h2.ERR_STREAM_CANNOT_PIPE, m2 = h2.ERR_STREAM_DESTROYED, g2 = h2.ERR_STREAM_NULL_VALUES, w2 = h2.ERR_STREAM_WRITE_AFTER_END, k2 = h2.ERR_UNKNOWN_ENCODING, _2 = d2.errorOrDestroy; function A2() { } function E2(e4, t4, a3) { n2 = n2 || r3(76884), e4 = e4 || {}, "boolean" != typeof a3 && (a3 = t4 instanceof n2), this.objectMode = !!e4.objectMode, a3 && (this.objectMode = this.objectMode || !!e4.writableObjectMode), this.highWaterMark = l2(this, e4, "writableHighWaterMark", a3), this.finalCalled = false, this.needDrain = false, this.ending = false, this.ended = false, this.finished = false, this.destroyed = false; var s3 = false === e4.decodeStrings; this.decodeStrings = !s3, this.defaultEncoding = e4.defaultEncoding || "utf8", this.length = 0, this.writing = false, this.corked = 0, this.sync = true, this.bufferProcessing = false, this.onwrite = function(e5) { !function(e6, t5) { var r4 = e6._writableState, n3 = r4.sync, o3 = r4.writecb; if ("function" != typeof o3) throw new y2(); if (function(e7) { e7.writing = false, e7.writecb = null, e7.length -= e7.writelen, e7.writelen = 0; }(r4), t5) !function(e7, t6, r5, n4, o4) { --t6.pendingcb, r5 ? (i2.nextTick(o4, n4), i2.nextTick(T2, e7, t6), e7._writableState.errorEmitted = true, _2(e7, n4)) : (o4(n4), e7._writableState.errorEmitted = true, _2(e7, n4), T2(e7, t6)); }(e6, r4, n3, t5, o3); else { var a4 = P2(r4) || e6.destroyed; a4 || r4.corked || r4.bufferProcessing || !r4.bufferedRequest || O2(e6, r4), n3 ? i2.nextTick(B2, e6, r4, a4, o3) : B2(e6, r4, a4, o3); } }(t4, e5); }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = false, this.errorEmitted = false, this.emitClose = false !== e4.emitClose, this.autoDestroy = !!e4.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new o2(this); } function S2(e4) { var t4 = this instanceof (n2 = n2 || r3(76884)); if (!t4 && !a2.call(S2, this)) return new S2(e4); this._writableState = new E2(e4, this, t4), this.writable = true, e4 && ("function" == typeof e4.write && (this._write = e4.write), "function" == typeof e4.writev && (this._writev = e4.writev), "function" == typeof e4.destroy && (this._destroy = e4.destroy), "function" == typeof e4.final && (this._final = e4.final)), u2.call(this); } function x2(e4, t4, r4, n3, i3, o3, a3) { t4.writelen = n3, t4.writecb = a3, t4.writing = true, t4.sync = true, t4.destroyed ? t4.onwrite(new m2("write")) : r4 ? e4._writev(i3, t4.onwrite) : e4._write(i3, o3, t4.onwrite), t4.sync = false; } function B2(e4, t4, r4, n3) { r4 || function(e5, t5) { 0 === t5.length && t5.needDrain && (t5.needDrain = false, e5.emit("drain")); }(e4, t4), t4.pendingcb--, n3(), T2(e4, t4); } function O2(e4, t4) { t4.bufferProcessing = true; var r4 = t4.bufferedRequest; if (e4._writev && r4 && r4.next) { var n3 = t4.bufferedRequestCount, i3 = new Array(n3), a3 = t4.corkedRequestsFree; a3.entry = r4; for (var s3 = 0, u3 = true; r4; ) i3[s3] = r4, r4.isBuf || (u3 = false), r4 = r4.next, s3 += 1; i3.allBuffers = u3, x2(e4, t4, true, t4.length, i3, "", a3.finish), t4.pendingcb++, t4.lastBufferedRequest = null, a3.next ? (t4.corkedRequestsFree = a3.next, a3.next = null) : t4.corkedRequestsFree = new o2(t4), t4.bufferedRequestCount = 0; } else { for (; r4; ) { var c3 = r4.chunk, f3 = r4.encoding, d3 = r4.callback; if (x2(e4, t4, false, t4.objectMode ? 1 : c3.length, c3, f3, d3), r4 = r4.next, t4.bufferedRequestCount--, t4.writing) break; } null === r4 && (t4.lastBufferedRequest = null); } t4.bufferedRequest = r4, t4.bufferProcessing = false; } function P2(e4) { return e4.ending && 0 === e4.length && null === e4.bufferedRequest && !e4.finished && !e4.writing; } function I2(e4, t4) { e4._final(function(r4) { t4.pendingcb--, r4 && _2(e4, r4), t4.prefinished = true, e4.emit("prefinish"), T2(e4, t4); }); } function T2(e4, t4) { var r4 = P2(t4); if (r4 && (function(e5, t5) { t5.prefinished || t5.finalCalled || ("function" != typeof e5._final || t5.destroyed ? (t5.prefinished = true, e5.emit("prefinish")) : (t5.pendingcb++, t5.finalCalled = true, i2.nextTick(I2, e5, t5))); }(e4, t4), 0 === t4.pendingcb && (t4.finished = true, e4.emit("finish"), t4.autoDestroy))) { var n3 = e4._readableState; (!n3 || n3.autoDestroy && n3.endEmitted) && e4.destroy(); } return r4; } r3(41736)(S2, u2), E2.prototype.getBuffer = function() { for (var e4 = this.bufferedRequest, t4 = []; e4; ) t4.push(e4), e4 = e4.next; return t4; }, function() { try { Object.defineProperty(E2.prototype, "buffer", { get: s2.deprecate(function() { return this.getBuffer(); }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); } catch (e4) { } }(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (a2 = Function.prototype[Symbol.hasInstance], Object.defineProperty(S2, Symbol.hasInstance, { value: function(e4) { return !!a2.call(this, e4) || this === S2 && e4 && e4._writableState instanceof E2; } })) : a2 = function(e4) { return e4 instanceof this; }, S2.prototype.pipe = function() { _2(this, new v2()); }, S2.prototype.write = function(e4, t4, r4) { var n3, o3 = this._writableState, a3 = false, s3 = !o3.objectMode && (n3 = e4, c2.isBuffer(n3) || n3 instanceof f2); return s3 && !c2.isBuffer(e4) && (e4 = function(e5) { return c2.from(e5); }(e4)), "function" == typeof t4 && (r4 = t4, t4 = null), s3 ? t4 = "buffer" : t4 || (t4 = o3.defaultEncoding), "function" != typeof r4 && (r4 = A2), o3.ending ? function(e5, t5) { var r5 = new w2(); _2(e5, r5), i2.nextTick(t5, r5); }(this, r4) : (s3 || function(e5, t5, r5, n4) { var o4; return null === r5 ? o4 = new g2() : "string" == typeof r5 || t5.objectMode || (o4 = new p2("chunk", ["string", "Buffer"], r5)), !o4 || (_2(e5, o4), i2.nextTick(n4, o4), false); }(this, o3, e4, r4)) && (o3.pendingcb++, a3 = function(e5, t5, r5, n4, i3, o4) { if (!r5) { var a4 = function(e6, t6, r6) { return e6.objectMode || false === e6.decodeStrings || "string" != typeof t6 || (t6 = c2.from(t6, r6)), t6; }(t5, n4, i3); n4 !== a4 && (r5 = true, i3 = "buffer", n4 = a4); } var s4 = t5.objectMode ? 1 : n4.length; t5.length += s4; var u3 = t5.length < t5.highWaterMark; if (u3 || (t5.needDrain = true), t5.writing || t5.corked) { var f3 = t5.lastBufferedRequest; t5.lastBufferedRequest = { chunk: n4, encoding: i3, isBuf: r5, callback: o4, next: null }, f3 ? f3.next = t5.lastBufferedRequest : t5.bufferedRequest = t5.lastBufferedRequest, t5.bufferedRequestCount += 1; } else x2(e5, t5, false, s4, n4, i3, o4); return u3; }(this, o3, s3, e4, t4, r4)), a3; }, S2.prototype.cork = function() { this._writableState.corked++; }, S2.prototype.uncork = function() { var e4 = this._writableState; e4.corked && (e4.corked--, e4.writing || e4.corked || e4.bufferProcessing || !e4.bufferedRequest || O2(this, e4)); }, S2.prototype.setDefaultEncoding = function(e4) { if ("string" == typeof e4 && (e4 = e4.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e4 + "").toLowerCase()) > -1)) throw new k2(e4); return this._writableState.defaultEncoding = e4, this; }, Object.defineProperty(S2.prototype, "writableBuffer", { enumerable: false, get: function() { return this._writableState && this._writableState.getBuffer(); } }), Object.defineProperty(S2.prototype, "writableHighWaterMark", { enumerable: false, get: function() { return this._writableState.highWaterMark; } }), S2.prototype._write = function(e4, t4, r4) { r4(new b2("_write()")); }, S2.prototype._writev = null, S2.prototype.end = function(e4, t4, r4) { var n3 = this._writableState; return "function" == typeof e4 ? (r4 = e4, e4 = null, t4 = null) : "function" == typeof t4 && (r4 = t4, t4 = null), null != e4 && this.write(e4, t4), n3.corked && (n3.corked = 1, this.uncork()), n3.ending || function(e5, t5, r5) { t5.ending = true, T2(e5, t5), r5 && (t5.finished ? i2.nextTick(r5) : e5.once("finish", r5)), t5.ended = true, e5.writable = false; }(this, n3, r4), this; }, Object.defineProperty(S2.prototype, "writableLength", { enumerable: false, get: function() { return this._writableState.length; } }), Object.defineProperty(S2.prototype, "destroyed", { enumerable: false, get: function() { return void 0 !== this._writableState && this._writableState.destroyed; }, set: function(e4) { this._writableState && (this._writableState.destroyed = e4); } }), S2.prototype.destroy = d2.destroy, S2.prototype._undestroy = d2.undestroy, S2.prototype._destroy = function(e4, t4) { t4(e4); }; }, 32317: (e3, t3, r3) => { var n2, i2 = r3(19142), o2 = r3(28847)(r3(3355)); function a2(e4, t4, r4) { return (t4 = function(e5) { var t5 = function(e6, t6) { if ("object" !== (0, o2.default)(e6) || null === e6) return e6; var r5 = e6[Symbol.toPrimitive]; if (void 0 !== r5) { var n3 = r5.call(e6, "string"); if ("object" !== (0, o2.default)(n3)) return n3; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(e6); }(e5); return "symbol" === (0, o2.default)(t5) ? t5 : String(t5); }(t4)) in e4 ? Object.defineProperty(e4, t4, { value: r4, enumerable: true, configurable: true, writable: true }) : e4[t4] = r4, e4; } var s2 = r3(5831), u2 = Symbol("lastResolve"), c2 = Symbol("lastReject"), f2 = Symbol("error"), d2 = Symbol("ended"), l2 = Symbol("lastPromise"), h2 = Symbol("handlePromise"), p2 = Symbol("stream"); function b2(e4, t4) { return { value: e4, done: t4 }; } function y2(e4) { var t4 = e4[u2]; if (null !== t4) { var r4 = e4[p2].read(); null !== r4 && (e4[l2] = null, e4[u2] = null, e4[c2] = null, t4(b2(r4, false))); } } function v2(e4) { i2.nextTick(y2, e4); } var m2 = Object.getPrototypeOf(function() { }), g2 = Object.setPrototypeOf((a2(n2 = { get stream() { return this[p2]; }, next: function() { var e4 = this, t4 = this[f2]; if (null !== t4) return Promise.reject(t4); if (this[d2]) return Promise.resolve(b2(void 0, true)); if (this[p2].destroyed) return new Promise(function(t5, r5) { i2.nextTick(function() { e4[f2] ? r5(e4[f2]) : t5(b2(void 0, true)); }); }); var r4, n3 = this[l2]; if (n3) r4 = new Promise(function(e5, t5) { return function(r5, n4) { e5.then(function() { t5[d2] ? r5(b2(void 0, true)) : t5[h2](r5, n4); }, n4); }; }(n3, this)); else { var o3 = this[p2].read(); if (null !== o3) return Promise.resolve(b2(o3, false)); r4 = new Promise(this[h2]); } return this[l2] = r4, r4; } }, Symbol.asyncIterator, function() { return this; }), a2(n2, "return", function() { var e4 = this; return new Promise(function(t4, r4) { e4[p2].destroy(null, function(e5) { e5 ? r4(e5) : t4(b2(void 0, true)); }); }); }), n2), m2); e3.exports = function(e4) { var t4, r4 = Object.create(g2, (a2(t4 = {}, p2, { value: e4, writable: true }), a2(t4, u2, { value: null, writable: true }), a2(t4, c2, { value: null, writable: true }), a2(t4, f2, { value: null, writable: true }), a2(t4, d2, { value: e4._readableState.endEmitted, writable: true }), a2(t4, h2, { value: function(e5, t5) { var n3 = r4[p2].read(); n3 ? (r4[l2] = null, r4[u2] = null, r4[c2] = null, e5(b2(n3, false))) : (r4[u2] = e5, r4[c2] = t5); }, writable: true }), t4)); return r4[l2] = null, s2(e4, function(e5) { if (e5 && "ERR_STREAM_PREMATURE_CLOSE" !== e5.code) { var t5 = r4[c2]; return null !== t5 && (r4[l2] = null, r4[u2] = null, r4[c2] = null, t5(e5)), void (r4[f2] = e5); } var n3 = r4[u2]; null !== n3 && (r4[l2] = null, r4[u2] = null, r4[c2] = null, n3(b2(void 0, true))), r4[d2] = true; }), e4.on("readable", v2.bind(null, r4)), r4; }; }, 25392: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)); function i2(e4, t4) { var r4 = Object.keys(e4); if (Object.getOwnPropertySymbols) { var n3 = Object.getOwnPropertySymbols(e4); t4 && (n3 = n3.filter(function(t5) { return Object.getOwnPropertyDescriptor(e4, t5).enumerable; })), r4.push.apply(r4, n3); } return r4; } function o2(e4) { for (var t4 = 1; t4 < arguments.length; t4++) { var r4 = null != arguments[t4] ? arguments[t4] : {}; t4 % 2 ? i2(Object(r4), true).forEach(function(t5) { a2(e4, t5, r4[t5]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(r4)) : i2(Object(r4)).forEach(function(t5) { Object.defineProperty(e4, t5, Object.getOwnPropertyDescriptor(r4, t5)); }); } return e4; } function a2(e4, t4, r4) { return (t4 = u2(t4)) in e4 ? Object.defineProperty(e4, t4, { value: r4, enumerable: true, configurable: true, writable: true }) : e4[t4] = r4, e4; } function s2(e4, t4) { for (var r4 = 0; r4 < t4.length; r4++) { var n3 = t4[r4]; n3.enumerable = n3.enumerable || false, n3.configurable = true, "value" in n3 && (n3.writable = true), Object.defineProperty(e4, u2(n3.key), n3); } } function u2(e4) { var t4 = function(e5, t5) { if ("object" !== (0, n2.default)(e5) || null === e5) return e5; var r4 = e5[Symbol.toPrimitive]; if (void 0 !== r4) { var i3 = r4.call(e5, "string"); if ("object" !== (0, n2.default)(i3)) return i3; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(e5); }(e4); return "symbol" === (0, n2.default)(t4) ? t4 : String(t4); } var c2 = r3(29033).Buffer, f2 = r3(52361).inspect, d2 = f2 && f2.custom || "inspect"; e3.exports = function() { function e4() { !function(e5, t5) { if (!(e5 instanceof t5)) throw new TypeError("Cannot call a class as a function"); }(this, e4), this.head = null, this.tail = null, this.length = 0; } var t4, r4; return t4 = e4, (r4 = [{ key: "push", value: function(e5) { var t5 = { data: e5, next: null }; this.length > 0 ? this.tail.next = t5 : this.head = t5, this.tail = t5, ++this.length; } }, { key: "unshift", value: function(e5) { var t5 = { data: e5, next: this.head }; 0 === this.length && (this.tail = t5), this.head = t5, ++this.length; } }, { key: "shift", value: function() { if (0 !== this.length) { var e5 = this.head.data; return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, e5; } } }, { key: "clear", value: function() { this.head = this.tail = null, this.length = 0; } }, { key: "join", value: function(e5) { if (0 === this.length) return ""; for (var t5 = this.head, r5 = "" + t5.data; t5 = t5.next; ) r5 += e5 + t5.data; return r5; } }, { key: "concat", value: function(e5) { if (0 === this.length) return c2.alloc(0); for (var t5, r5, n3, i3 = c2.allocUnsafe(e5 >>> 0), o3 = this.head, a3 = 0; o3; ) t5 = o3.data, r5 = i3, n3 = a3, c2.prototype.copy.call(t5, r5, n3), a3 += o3.data.length, o3 = o3.next; return i3; } }, { key: "consume", value: function(e5, t5) { var r5; return e5 < this.head.data.length ? (r5 = this.head.data.slice(0, e5), this.head.data = this.head.data.slice(e5)) : r5 = e5 === this.head.data.length ? this.shift() : t5 ? this._getString(e5) : this._getBuffer(e5), r5; } }, { key: "first", value: function() { return this.head.data; } }, { key: "_getString", value: function(e5) { var t5 = this.head, r5 = 1, n3 = t5.data; for (e5 -= n3.length; t5 = t5.next; ) { var i3 = t5.data, o3 = e5 > i3.length ? i3.length : e5; if (o3 === i3.length ? n3 += i3 : n3 += i3.slice(0, e5), 0 == (e5 -= o3)) { o3 === i3.length ? (++r5, t5.next ? this.head = t5.next : this.head = this.tail = null) : (this.head = t5, t5.data = i3.slice(o3)); break; } ++r5; } return this.length -= r5, n3; } }, { key: "_getBuffer", value: function(e5) { var t5 = c2.allocUnsafe(e5), r5 = this.head, n3 = 1; for (r5.data.copy(t5), e5 -= r5.data.length; r5 = r5.next; ) { var i3 = r5.data, o3 = e5 > i3.length ? i3.length : e5; if (i3.copy(t5, t5.length - e5, 0, o3), 0 == (e5 -= o3)) { o3 === i3.length ? (++n3, r5.next ? this.head = r5.next : this.head = this.tail = null) : (this.head = r5, r5.data = i3.slice(o3)); break; } ++n3; } return this.length -= n3, t5; } }, { key: d2, value: function(e5, t5) { return f2(this, o2(o2({}, t5), {}, { depth: 0, customInspect: false })); } }]) && s2(t4.prototype, r4), Object.defineProperty(t4, "prototype", { writable: false }), e4; }(); }, 57572: (e3, t3, r3) => { var n2 = r3(19142); function i2(e4, t4) { a2(e4, t4), o2(e4); } function o2(e4) { e4._writableState && !e4._writableState.emitClose || e4._readableState && !e4._readableState.emitClose || e4.emit("close"); } function a2(e4, t4) { e4.emit("error", t4); } e3.exports = { destroy: function(e4, t4) { var r4 = this, s2 = this._readableState && this._readableState.destroyed, u2 = this._writableState && this._writableState.destroyed; return s2 || u2 ? (t4 ? t4(e4) : e4 && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = true, n2.nextTick(a2, this, e4)) : n2.nextTick(a2, this, e4)), this) : (this._readableState && (this._readableState.destroyed = true), this._writableState && (this._writableState.destroyed = true), this._destroy(e4 || null, function(e5) { !t4 && e5 ? r4._writableState ? r4._writableState.errorEmitted ? n2.nextTick(o2, r4) : (r4._writableState.errorEmitted = true, n2.nextTick(i2, r4, e5)) : n2.nextTick(i2, r4, e5) : t4 ? (n2.nextTick(o2, r4), t4(e5)) : n2.nextTick(o2, r4); }), this); }, undestroy: function() { this._readableState && (this._readableState.destroyed = false, this._readableState.reading = false, this._readableState.ended = false, this._readableState.endEmitted = false), this._writableState && (this._writableState.destroyed = false, this._writableState.ended = false, this._writableState.ending = false, this._writableState.finalCalled = false, this._writableState.prefinished = false, this._writableState.finished = false, this._writableState.errorEmitted = false); }, errorOrDestroy: function(e4, t4) { var r4 = e4._readableState, n3 = e4._writableState; r4 && r4.autoDestroy || n3 && n3.autoDestroy ? e4.destroy(t4) : e4.emit("error", t4); } }; }, 5831: (e3, t3, r3) => { var n2 = r3(79024).q.ERR_STREAM_PREMATURE_CLOSE; function i2() { } e3.exports = function e4(t4, r4, o2) { if ("function" == typeof r4) return e4(t4, null, r4); r4 || (r4 = {}), o2 = function(e5) { var t5 = false; return function() { if (!t5) { t5 = true; for (var r5 = arguments.length, n3 = new Array(r5), i3 = 0; i3 < r5; i3++) n3[i3] = arguments[i3]; e5.apply(this, n3); } }; }(o2 || i2); var a2 = r4.readable || false !== r4.readable && t4.readable, s2 = r4.writable || false !== r4.writable && t4.writable, u2 = function() { t4.writable || f2(); }, c2 = t4._writableState && t4._writableState.finished, f2 = function() { s2 = false, c2 = true, a2 || o2.call(t4); }, d2 = t4._readableState && t4._readableState.endEmitted, l2 = function() { a2 = false, d2 = true, s2 || o2.call(t4); }, h2 = function(e5) { o2.call(t4, e5); }, p2 = function() { var e5; return a2 && !d2 ? (t4._readableState && t4._readableState.ended || (e5 = new n2()), o2.call(t4, e5)) : s2 && !c2 ? (t4._writableState && t4._writableState.ended || (e5 = new n2()), o2.call(t4, e5)) : void 0; }, b2 = function() { t4.req.on("finish", f2); }; return function(e5) { return e5.setHeader && "function" == typeof e5.abort; }(t4) ? (t4.on("complete", f2), t4.on("abort", p2), t4.req ? b2() : t4.on("request", b2)) : s2 && !t4._writableState && (t4.on("end", u2), t4.on("close", u2)), t4.on("end", l2), t4.on("finish", f2), false !== r4.error && t4.on("error", h2), t4.on("close", p2), function() { t4.removeListener("complete", f2), t4.removeListener("abort", p2), t4.removeListener("request", b2), t4.req && t4.req.removeListener("finish", f2), t4.removeListener("end", u2), t4.removeListener("close", u2), t4.removeListener("finish", f2), t4.removeListener("end", l2), t4.removeListener("error", h2), t4.removeListener("close", p2); }; }; }, 16218: (e3) => { e3.exports = function() { throw new Error("Readable.from is not available in the browser"); }; }, 60384: (e3, t3, r3) => { var n2, i2 = r3(79024).q, o2 = i2.ERR_MISSING_ARGS, a2 = i2.ERR_STREAM_DESTROYED; function s2(e4) { if (e4) throw e4; } function u2(e4) { e4(); } function c2(e4, t4) { return e4.pipe(t4); } e3.exports = function() { for (var e4 = arguments.length, t4 = new Array(e4), i3 = 0; i3 < e4; i3++) t4[i3] = arguments[i3]; var f2, d2 = function(e5) { return e5.length ? "function" != typeof e5[e5.length - 1] ? s2 : e5.pop() : s2; }(t4); if (Array.isArray(t4[0]) && (t4 = t4[0]), t4.length < 2) throw new o2("streams"); var l2 = t4.map(function(e5, i4) { var o3 = i4 < t4.length - 1; return function(e6, t5, i5, o4) { o4 = function(e7) { var t6 = false; return function() { t6 || (t6 = true, e7.apply(void 0, arguments)); }; }(o4); var s3 = false; e6.on("close", function() { s3 = true; }), void 0 === n2 && (n2 = r3(5831)), n2(e6, { readable: t5, writable: i5 }, function(e7) { if (e7) return o4(e7); s3 = true, o4(); }); var u3 = false; return function(t6) { if (!s3 && !u3) return u3 = true, function(e7) { return e7.setHeader && "function" == typeof e7.abort; }(e6) ? e6.abort() : "function" == typeof e6.destroy ? e6.destroy() : void o4(t6 || new a2("pipe")); }; }(e5, o3, i4 > 0, function(e6) { f2 || (f2 = e6), e6 && l2.forEach(u2), o3 || (l2.forEach(u2), d2(f2)); }); }); return t4.reduce(c2); }; }, 6756: (e3, t3, r3) => { var n2 = r3(79024).q.ERR_INVALID_OPT_VALUE; e3.exports = { getHighWaterMark: function(e4, t4, r4, i2) { var o2 = function(e5, t5, r5) { return null != e5.highWaterMark ? e5.highWaterMark : t5 ? e5[r5] : null; }(t4, i2, r4); if (null != o2) { if (!isFinite(o2) || Math.floor(o2) !== o2 || o2 < 0) throw new n2(i2 ? r4 : "highWaterMark", o2); return Math.floor(o2); } return e4.objectMode ? 16 : 16384; } }; }, 37144: (e3, t3, r3) => { e3.exports = r3(38291).EventEmitter; }, 86505: (e3, t3, r3) => { (t3 = e3.exports = r3(6297)).Stream = t3, t3.Readable = t3, t3.Writable = r3(71471), t3.Duplex = r3(76884), t3.Transform = r3(99154), t3.PassThrough = r3(53582), t3.finished = r3(5831), t3.pipeline = r3(60384); }, 26707: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(41736), o2 = r3(22353), a2 = new Array(16), s2 = [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], u2 = [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], c2 = [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], f2 = [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], d2 = [0, 1518500249, 1859775393, 2400959708, 2840853838], l2 = [1352829926, 1548603684, 1836072691, 2053994217, 0]; function h2() { o2.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520; } function p2(e4, t4) { return e4 << t4 | e4 >>> 32 - t4; } function b2(e4, t4, r4, n3, i3, o3, a3, s3) { return p2(e4 + (t4 ^ r4 ^ n3) + o3 + a3 | 0, s3) + i3 | 0; } function y2(e4, t4, r4, n3, i3, o3, a3, s3) { return p2(e4 + (t4 & r4 | ~t4 & n3) + o3 + a3 | 0, s3) + i3 | 0; } function v2(e4, t4, r4, n3, i3, o3, a3, s3) { return p2(e4 + ((t4 | ~r4) ^ n3) + o3 + a3 | 0, s3) + i3 | 0; } function m2(e4, t4, r4, n3, i3, o3, a3, s3) { return p2(e4 + (t4 & n3 | r4 & ~n3) + o3 + a3 | 0, s3) + i3 | 0; } function g2(e4, t4, r4, n3, i3, o3, a3, s3) { return p2(e4 + (t4 ^ (r4 | ~n3)) + o3 + a3 | 0, s3) + i3 | 0; } i2(h2, o2), h2.prototype._update = function() { for (var e4 = a2, t4 = 0; t4 < 16; ++t4) e4[t4] = this._block.readInt32LE(4 * t4); for (var r4 = 0 | this._a, n3 = 0 | this._b, i3 = 0 | this._c, o3 = 0 | this._d, h3 = 0 | this._e, w2 = 0 | this._a, k2 = 0 | this._b, _2 = 0 | this._c, A2 = 0 | this._d, E2 = 0 | this._e, S2 = 0; S2 < 80; S2 += 1) { var x2, B2; S2 < 16 ? (x2 = b2(r4, n3, i3, o3, h3, e4[s2[S2]], d2[0], c2[S2]), B2 = g2(w2, k2, _2, A2, E2, e4[u2[S2]], l2[0], f2[S2])) : S2 < 32 ? (x2 = y2(r4, n3, i3, o3, h3, e4[s2[S2]], d2[1], c2[S2]), B2 = m2(w2, k2, _2, A2, E2, e4[u2[S2]], l2[1], f2[S2])) : S2 < 48 ? (x2 = v2(r4, n3, i3, o3, h3, e4[s2[S2]], d2[2], c2[S2]), B2 = v2(w2, k2, _2, A2, E2, e4[u2[S2]], l2[2], f2[S2])) : S2 < 64 ? (x2 = m2(r4, n3, i3, o3, h3, e4[s2[S2]], d2[3], c2[S2]), B2 = y2(w2, k2, _2, A2, E2, e4[u2[S2]], l2[3], f2[S2])) : (x2 = g2(r4, n3, i3, o3, h3, e4[s2[S2]], d2[4], c2[S2]), B2 = b2(w2, k2, _2, A2, E2, e4[u2[S2]], l2[4], f2[S2])), r4 = h3, h3 = o3, o3 = p2(i3, 10), i3 = n3, n3 = x2, w2 = E2, E2 = A2, A2 = p2(_2, 10), _2 = k2, k2 = B2; } var O2 = this._b + i3 + A2 | 0; this._b = this._c + o3 + E2 | 0, this._c = this._d + h3 + w2 | 0, this._d = this._e + r4 + k2 | 0, this._e = this._a + n3 + _2 | 0, this._a = O2; }, h2.prototype._digest = function() { this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update(); var e4 = n2.alloc ? n2.alloc(20) : new n2(20); return e4.writeInt32LE(this._a, 0), e4.writeInt32LE(this._b, 4), e4.writeInt32LE(this._c, 8), e4.writeInt32LE(this._d, 12), e4.writeInt32LE(this._e, 16), e4; }, e3.exports = h2; }, 6905: (e3, t3, r3) => { var n2 = r3(29033).Buffer; Object.defineProperty(t3, "__esModule", { value: true }), t3.getLength = t3.decode = t3.encode = void 0; var i2, o2 = (i2 = r3(31734)) && i2.__esModule ? i2 : { default: i2 }; function a2(e4, t4) { if ("0" === e4[0] && "0" === e4[1]) throw new Error("invalid RLP: extra zeros"); return parseInt(e4, t4); } function s2(e4, t4) { if (e4 < 56) return n2.from([e4 + t4]); var r4 = f2(e4), i3 = f2(t4 + 55 + r4.length / 2); return n2.from(i3 + r4, "hex"); } function u2(e4) { var t4, r4, i3, o3, s3, c3 = [], f3 = e4[0]; if (f3 <= 127) return { data: e4.slice(0, 1), remainder: e4.slice(1) }; if (f3 <= 183) { if (t4 = f3 - 127, i3 = 128 === f3 ? n2.from([]) : e4.slice(1, t4), 2 === t4 && i3[0] < 128) throw new Error("invalid rlp encoding: byte must be less 0x80"); return { data: i3, remainder: e4.slice(t4) }; } if (f3 <= 191) { if (r4 = f3 - 182, e4.length - 1 < r4) throw new Error("invalid RLP: not enough bytes for string length"); if ((t4 = a2(e4.slice(1, r4).toString("hex"), 16)) <= 55) throw new Error("invalid RLP: expected string length to be greater than 55"); if ((i3 = e4.slice(r4, t4 + r4)).length < t4) throw new Error("invalid RLP: not enough bytes for string"); return { data: i3, remainder: e4.slice(t4 + r4) }; } if (f3 <= 247) { for (t4 = f3 - 191, o3 = e4.slice(1, t4); o3.length; ) s3 = u2(o3), c3.push(s3.data), o3 = s3.remainder; return { data: c3, remainder: e4.slice(t4) }; } var d3 = (r4 = f3 - 246) + (t4 = a2(e4.slice(1, r4).toString("hex"), 16)); if (d3 > e4.length) throw new Error("invalid rlp: total length is larger than the data"); if (0 === (o3 = e4.slice(r4, d3)).length) throw new Error("invalid rlp, List has a invalid length"); for (; o3.length; ) s3 = u2(o3), c3.push(s3.data), o3 = s3.remainder; return { data: c3, remainder: e4.slice(d3) }; } function c2(e4) { return "0x" === e4.slice(0, 2); } function f2(e4) { if (e4 < 0) throw new Error("Invalid integer as argument, must be unsigned!"); var t4 = e4.toString(16); return t4.length % 2 ? "0" + t4 : t4; } function d2(e4) { if (!n2.isBuffer(e4)) { if ("string" == typeof e4) return c2(e4) ? n2.from((r4 = "string" != typeof (i3 = e4) ? i3 : c2(i3) ? i3.slice(2) : i3).length % 2 ? "0" + r4 : r4, "hex") : n2.from(e4); if ("number" == typeof e4 || "bigint" == typeof e4) return e4 ? (t4 = f2(e4), n2.from(t4, "hex")) : n2.from([]); if (null == e4) return n2.from([]); if (e4 instanceof Uint8Array) return n2.from(e4); if (o2.default.isBN(e4)) return n2.from(e4.toArray()); throw new Error("invalid type"); } var t4, r4, i3; return e4; } t3.encode = function e4(t4) { if (Array.isArray(t4)) { for (var r4 = [], i3 = 0; i3 < t4.length; i3++) r4.push(e4(t4[i3])); var o3 = n2.concat(r4); return n2.concat([s2(o3.length, 192), o3]); } var a3 = d2(t4); return 1 === a3.length && a3[0] < 128 ? a3 : n2.concat([s2(a3.length, 128), a3]); }, t3.decode = function(e4, t4) { if (void 0 === t4 && (t4 = false), !e4 || 0 === e4.length) return n2.from([]); var r4 = u2(d2(e4)); if (t4) return r4; if (0 !== r4.remainder.length) throw new Error("invalid remainder"); return r4.data; }, t3.getLength = function(e4) { if (!e4 || 0 === e4.length) return n2.from([]); var t4 = d2(e4), r4 = t4[0]; if (r4 <= 127) return t4.length; if (r4 <= 183) return r4 - 127; if (r4 <= 191) return r4 - 182; if (r4 <= 247) return r4 - 191; var i3 = r4 - 246; return i3 + a2(t4.slice(1, i3).toString("hex"), 16); }; }, 48850: (e3, t3, r3) => { var n2 = r3(29033), i2 = n2.Buffer; function o2(e4, t4) { for (var r4 in e4) t4[r4] = e4[r4]; } function a2(e4, t4, r4) { return i2(e4, t4, r4); } i2.from && i2.alloc && i2.allocUnsafe && i2.allocUnsafeSlow ? e3.exports = n2 : (o2(n2, t3), t3.Buffer = a2), a2.prototype = Object.create(i2.prototype), o2(i2, a2), a2.from = function(e4, t4, r4) { if ("number" == typeof e4) throw new TypeError("Argument must not be a number"); return i2(e4, t4, r4); }, a2.alloc = function(e4, t4, r4) { if ("number" != typeof e4) throw new TypeError("Argument must be a number"); var n3 = i2(e4); return void 0 !== t4 ? "string" == typeof r4 ? n3.fill(t4, r4) : n3.fill(t4) : n3.fill(0), n3; }, a2.allocUnsafe = function(e4) { if ("number" != typeof e4) throw new TypeError("Argument must be a number"); return i2(e4); }, a2.allocUnsafeSlow = function(e4) { if ("number" != typeof e4) throw new TypeError("Argument must be a number"); return n2.SlowBuffer(e4); }; }, 11755: (e3, t3, r3) => { var n2, i2 = r3(19142), o2 = r3(28847)(r3(3355)), a2 = r3(29033), s2 = a2.Buffer, u2 = {}; for (n2 in a2) a2.hasOwnProperty(n2) && "SlowBuffer" !== n2 && "Buffer" !== n2 && (u2[n2] = a2[n2]); var c2 = u2.Buffer = {}; for (n2 in s2) s2.hasOwnProperty(n2) && "allocUnsafe" !== n2 && "allocUnsafeSlow" !== n2 && (c2[n2] = s2[n2]); if (u2.Buffer.prototype = s2.prototype, c2.from && c2.from !== Uint8Array.from || (c2.from = function(e4, t4, r4) { if ("number" == typeof e4) throw new TypeError('The "value" argument must not be of type number. Received type ' + (0, o2.default)(e4)); if (e4 && void 0 === e4.length) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + (0, o2.default)(e4)); return s2(e4, t4, r4); }), c2.alloc || (c2.alloc = function(e4, t4, r4) { if ("number" != typeof e4) throw new TypeError('The "size" argument must be of type number. Received type ' + (0, o2.default)(e4)); if (e4 < 0 || e4 >= 2 * (1 << 30)) throw new RangeError('The value "' + e4 + '" is invalid for option "size"'); var n3 = s2(e4); return t4 && 0 !== t4.length ? "string" == typeof r4 ? n3.fill(t4, r4) : n3.fill(t4) : n3.fill(0), n3; }), !u2.kStringMaxLength) try { u2.kStringMaxLength = i2.binding("buffer").kStringMaxLength; } catch (e4) { } u2.constants || (u2.constants = { MAX_LENGTH: u2.kMaxLength }, u2.kStringMaxLength && (u2.constants.MAX_STRING_LENGTH = u2.kStringMaxLength)), e3.exports = u2; }, 67799: (e3) => { !function(t3) { var r3 = 2147483647; function n2(e4) { var t4 = 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]), r4 = 1779033703, n3 = 3144134277, i3 = 1013904242, o3 = 2773480762, a3 = 1359893119, s3 = 2600822924, u3 = 528734635, c3 = 1541459225, f3 = new Uint32Array(64); function d3(e5) { for (var d4 = 0, l4 = e5.length; l4 >= 64; ) { var h4 = r4, p3 = n3, b3 = i3, y3 = o3, v3 = a3, m2 = s3, g2 = u3, w2 = c3, k2 = void 0, _2 = void 0, A2 = void 0, E2 = void 0, S2 = void 0; for (_2 = 0; _2 < 16; _2++) A2 = d4 + 4 * _2, f3[_2] = (255 & e5[A2]) << 24 | (255 & e5[A2 + 1]) << 16 | (255 & e5[A2 + 2]) << 8 | 255 & e5[A2 + 3]; for (_2 = 16; _2 < 64; _2++) E2 = ((k2 = f3[_2 - 2]) >>> 17 | k2 << 15) ^ (k2 >>> 19 | k2 << 13) ^ k2 >>> 10, S2 = ((k2 = f3[_2 - 15]) >>> 7 | k2 << 25) ^ (k2 >>> 18 | k2 << 14) ^ k2 >>> 3, f3[_2] = (E2 + f3[_2 - 7] | 0) + (S2 + f3[_2 - 16] | 0) | 0; for (_2 = 0; _2 < 64; _2++) E2 = (((v3 >>> 6 | v3 << 26) ^ (v3 >>> 11 | v3 << 21) ^ (v3 >>> 25 | v3 << 7)) + (v3 & m2 ^ ~v3 & g2) | 0) + (w2 + (t4[_2] + f3[_2] | 0) | 0) | 0, S2 = ((h4 >>> 2 | h4 << 30) ^ (h4 >>> 13 | h4 << 19) ^ (h4 >>> 22 | h4 << 10)) + (h4 & p3 ^ h4 & b3 ^ p3 & b3) | 0, w2 = g2, g2 = m2, m2 = v3, v3 = y3 + E2 | 0, y3 = b3, b3 = p3, p3 = h4, h4 = E2 + S2 | 0; r4 = r4 + h4 | 0, n3 = n3 + p3 | 0, i3 = i3 + b3 | 0, o3 = o3 + y3 | 0, a3 = a3 + v3 | 0, s3 = s3 + m2 | 0, u3 = u3 + g2 | 0, c3 = c3 + w2 | 0, d4 += 64, l4 -= 64; } } d3(e4); var l3, h3 = e4.length % 64, p2 = e4.length / 536870912 | 0, b2 = e4.length << 3, y2 = h3 < 56 ? 56 : 120, v2 = e4.slice(e4.length - h3, e4.length); for (v2.push(128), l3 = h3 + 1; l3 < y2; l3++) v2.push(0); return v2.push(p2 >>> 24 & 255), v2.push(p2 >>> 16 & 255), v2.push(p2 >>> 8 & 255), v2.push(p2 >>> 0 & 255), v2.push(b2 >>> 24 & 255), v2.push(b2 >>> 16 & 255), v2.push(b2 >>> 8 & 255), v2.push(b2 >>> 0 & 255), d3(v2), [r4 >>> 24 & 255, r4 >>> 16 & 255, r4 >>> 8 & 255, r4 >>> 0 & 255, n3 >>> 24 & 255, n3 >>> 16 & 255, n3 >>> 8 & 255, n3 >>> 0 & 255, i3 >>> 24 & 255, i3 >>> 16 & 255, i3 >>> 8 & 255, i3 >>> 0 & 255, o3 >>> 24 & 255, o3 >>> 16 & 255, o3 >>> 8 & 255, o3 >>> 0 & 255, a3 >>> 24 & 255, a3 >>> 16 & 255, a3 >>> 8 & 255, a3 >>> 0 & 255, s3 >>> 24 & 255, s3 >>> 16 & 255, s3 >>> 8 & 255, s3 >>> 0 & 255, u3 >>> 24 & 255, u3 >>> 16 & 255, u3 >>> 8 & 255, u3 >>> 0 & 255, c3 >>> 24 & 255, c3 >>> 16 & 255, c3 >>> 8 & 255, c3 >>> 0 & 255]; } function i2(e4, t4, r4) { e4 = e4.length <= 64 ? e4 : n2(e4); var i3, o3 = 64 + t4.length + 4, a3 = new Array(o3), s3 = new Array(64), u3 = []; for (i3 = 0; i3 < 64; i3++) a3[i3] = 54; for (i3 = 0; i3 < e4.length; i3++) a3[i3] ^= e4[i3]; for (i3 = 0; i3 < t4.length; i3++) a3[64 + i3] = t4[i3]; for (i3 = o3 - 4; i3 < o3; i3++) a3[i3] = 0; for (i3 = 0; i3 < 64; i3++) s3[i3] = 92; for (i3 = 0; i3 < e4.length; i3++) s3[i3] ^= e4[i3]; function c3() { for (var e5 = o3 - 1; e5 >= o3 - 4; e5--) { if (a3[e5]++, a3[e5] <= 255) return; a3[e5] = 0; } } for (; r4 >= 32; ) c3(), u3 = u3.concat(n2(s3.concat(n2(a3)))), r4 -= 32; return r4 > 0 && (c3(), u3 = u3.concat(n2(s3.concat(n2(a3))).slice(0, r4))), u3; } function o2(e4, t4, r4, n3, i3) { var o3; for (c2(e4, 16 * (2 * r4 - 1), i3, 0, 16), o3 = 0; o3 < 2 * r4; o3++) u2(e4, 16 * o3, i3, 16), s2(i3, n3), c2(i3, 0, e4, t4 + 16 * o3, 16); for (o3 = 0; o3 < r4; o3++) c2(e4, t4 + 2 * o3 * 16, e4, 16 * o3, 16); for (o3 = 0; o3 < r4; o3++) c2(e4, t4 + 16 * (2 * o3 + 1), e4, 16 * (o3 + r4), 16); } function a2(e4, t4) { return e4 << t4 | e4 >>> 32 - t4; } function s2(e4, t4) { c2(e4, 0, t4, 0, 16); for (var r4 = 8; r4 > 0; r4 -= 2) t4[4] ^= a2(t4[0] + t4[12], 7), t4[8] ^= a2(t4[4] + t4[0], 9), t4[12] ^= a2(t4[8] + t4[4], 13), t4[0] ^= a2(t4[12] + t4[8], 18), t4[9] ^= a2(t4[5] + t4[1], 7), t4[13] ^= a2(t4[9] + t4[5], 9), t4[1] ^= a2(t4[13] + t4[9], 13), t4[5] ^= a2(t4[1] + t4[13], 18), t4[14] ^= a2(t4[10] + t4[6], 7), t4[2] ^= a2(t4[14] + t4[10], 9), t4[6] ^= a2(t4[2] + t4[14], 13), t4[10] ^= a2(t4[6] + t4[2], 18), t4[3] ^= a2(t4[15] + t4[11], 7), t4[7] ^= a2(t4[3] + t4[15], 9), t4[11] ^= a2(t4[7] + t4[3], 13), t4[15] ^= a2(t4[11] + t4[7], 18), t4[1] ^= a2(t4[0] + t4[3], 7), t4[2] ^= a2(t4[1] + t4[0], 9), t4[3] ^= a2(t4[2] + t4[1], 13), t4[0] ^= a2(t4[3] + t4[2], 18), t4[6] ^= a2(t4[5] + t4[4], 7), t4[7] ^= a2(t4[6] + t4[5], 9), t4[4] ^= a2(t4[7] + t4[6], 13), t4[5] ^= a2(t4[4] + t4[7], 18), t4[11] ^= a2(t4[10] + t4[9], 7), t4[8] ^= a2(t4[11] + t4[10], 9), t4[9] ^= a2(t4[8] + t4[11], 13), t4[10] ^= a2(t4[9] + t4[8], 18), t4[12] ^= a2(t4[15] + t4[14], 7), t4[13] ^= a2(t4[12] + t4[15], 9), t4[14] ^= a2(t4[13] + t4[12], 13), t4[15] ^= a2(t4[14] + t4[13], 18); for (var n3 = 0; n3 < 16; ++n3) e4[n3] += t4[n3]; } function u2(e4, t4, r4, n3) { for (var i3 = 0; i3 < n3; i3++) r4[i3] ^= e4[t4 + i3]; } function c2(e4, t4, r4, n3, i3) { for (; i3--; ) r4[n3++] = e4[t4++]; } function f2(e4) { if (!e4 || "number" != typeof e4.length) return false; for (var t4 = 0; t4 < e4.length; t4++) { var r4 = e4[t4]; if ("number" != typeof r4 || r4 % 1 || r4 < 0 || r4 >= 256) return false; } return true; } function d2(e4, t4) { if ("number" != typeof e4 || e4 % 1) throw new Error("invalid " + t4); return e4; } function l2(e4, t4, n3, a3, s3, l3, h3) { if (n3 = d2(n3, "N"), a3 = d2(a3, "r"), s3 = d2(s3, "p"), l3 = d2(l3, "dkLen"), 0 === n3 || 0 != (n3 & n3 - 1)) throw new Error("N must be power of 2"); if (n3 > r3 / 128 / a3) throw new Error("N too large"); if (a3 > r3 / 128 / s3) throw new Error("r too large"); if (!f2(e4)) throw new Error("password must be an array or buffer"); if (e4 = Array.prototype.slice.call(e4), !f2(t4)) throw new Error("salt must be an array or buffer"); t4 = Array.prototype.slice.call(t4); for (var p2 = i2(e4, t4, 128 * s3 * a3), b2 = new Uint32Array(32 * s3 * a3), y2 = 0; y2 < b2.length; y2++) { var v2 = 4 * y2; b2[y2] = (255 & p2[v2 + 3]) << 24 | (255 & p2[v2 + 2]) << 16 | (255 & p2[v2 + 1]) << 8 | (255 & p2[v2 + 0]) << 0; } var m2, g2, w2 = new Uint32Array(64 * a3), k2 = new Uint32Array(32 * a3 * n3), _2 = 32 * a3, A2 = new Uint32Array(16), E2 = new Uint32Array(16), S2 = s3 * n3 * 2, x2 = 0, B2 = null, O2 = false, P2 = 0, I2 = 0, T2 = h3 ? parseInt(1e3 / a3) : 4294967295, C2 = "undefined" != typeof setImmediate ? setImmediate : setTimeout, M2 = function t5() { if (O2) return h3(new Error("cancelled"), x2 / S2); var r4; switch (P2) { case 0: c2(b2, g2 = 32 * I2 * a3, w2, 0, _2), P2 = 1, m2 = 0; case 1: (r4 = n3 - m2) > T2 && (r4 = T2); for (var f3 = 0; f3 < r4; f3++) c2(w2, 0, k2, (m2 + f3) * _2, _2), o2(w2, _2, a3, A2, E2); if (m2 += r4, x2 += r4, h3) { var d3 = parseInt(1e3 * x2 / S2); if (d3 !== B2) { if (O2 = h3(null, x2 / S2)) break; B2 = d3; } } if (m2 < n3) break; m2 = 0, P2 = 2; case 2: (r4 = n3 - m2) > T2 && (r4 = T2); for (var y3 = 0; y3 < r4; y3++) { var v3 = w2[16 * (2 * a3 - 1)] & n3 - 1; u2(k2, v3 * _2, w2, _2), o2(w2, _2, a3, A2, E2); } if (m2 += r4, x2 += r4, h3) { var M3 = parseInt(1e3 * x2 / S2); if (M3 !== B2) { if (O2 = h3(null, x2 / S2)) break; B2 = M3; } } if (m2 < n3) break; if (c2(w2, 0, b2, g2, _2), ++I2 < s3) { P2 = 0; break; } p2 = []; for (var R3 = 0; R3 < b2.length; R3++) p2.push(b2[R3] >> 0 & 255), p2.push(b2[R3] >> 8 & 255), p2.push(b2[R3] >> 16 & 255), p2.push(b2[R3] >> 24 & 255); var U2 = i2(e4, p2, l3); return h3 && h3(null, 1, U2), U2; } h3 && C2(t5); }; if (!h3) for (; ; ) { var R2 = M2(); if (null != R2) return R2; } M2(); } var h2 = { scrypt: function(e4, t4, r4, n3, i3, o3, a3) { return new Promise(function(s3, u3) { var c3 = 0; a3 && a3(0), l2(e4, t4, r4, n3, i3, o3, function(e5, t5, r5) { if (e5) u3(e5); else if (r5) a3 && 1 !== c3 && a3(1), s3(new Uint8Array(r5)); else if (a3 && t5 !== c3) return c3 = t5, a3(t5); }); }); }, syncScrypt: function(e4, t4, r4, n3, i3, o3) { return new Uint8Array(l2(e4, t4, r4, n3, i3, o3)); } }; e3.exports = h2; }(); }, 57902: (e3, t3, r3) => { e3.exports = r3(36922)(r3(38123)); }, 38123: (e3, t3, r3) => { var n2 = new (r3(36597)).ec("secp256k1"), i2 = n2.curve, o2 = i2.n.constructor; function a2(e4) { var t4 = e4[0]; switch (t4) { case 2: case 3: return 33 !== e4.length ? null : function(e5, t5) { var r4 = new o2(t5); if (r4.cmp(i2.p) >= 0) return null; var a3 = (r4 = r4.toRed(i2.red)).redSqr().redIMul(r4).redIAdd(i2.b).redSqrt(); return 3 === e5 !== a3.isOdd() && (a3 = a3.redNeg()), n2.keyPair({ pub: { x: r4, y: a3 } }); }(t4, e4.subarray(1, 33)); case 4: case 6: case 7: return 65 !== e4.length ? null : function(e5, t5, r4) { var a3 = new o2(t5), s3 = new o2(r4); if (a3.cmp(i2.p) >= 0 || s3.cmp(i2.p) >= 0) return null; if (a3 = a3.toRed(i2.red), s3 = s3.toRed(i2.red), (6 === e5 || 7 === e5) && s3.isOdd() !== (7 === e5)) return null; var u2 = a3.redSqr().redIMul(a3); return s3.redSqr().redISub(u2.redIAdd(i2.b)).isZero() ? n2.keyPair({ pub: { x: a3, y: s3 } }) : null; }(t4, e4.subarray(1, 33), e4.subarray(33, 65)); default: return null; } } function s2(e4, t4) { for (var r4 = t4.encode(null, 33 === e4.length), n3 = 0; n3 < e4.length; ++n3) e4[n3] = r4[n3]; } e3.exports = { contextRandomize: function() { return 0; }, privateKeyVerify: function(e4) { var t4 = new o2(e4); return t4.cmp(i2.n) < 0 && !t4.isZero() ? 0 : 1; }, privateKeyNegate: function(e4) { var t4 = new o2(e4), r4 = i2.n.sub(t4).umod(i2.n).toArrayLike(Uint8Array, "be", 32); return e4.set(r4), 0; }, privateKeyTweakAdd: function(e4, t4) { var r4 = new o2(t4); if (r4.cmp(i2.n) >= 0) return 1; if (r4.iadd(new o2(e4)), r4.cmp(i2.n) >= 0 && r4.isub(i2.n), r4.isZero()) return 1; var n3 = r4.toArrayLike(Uint8Array, "be", 32); return e4.set(n3), 0; }, privateKeyTweakMul: function(e4, t4) { var r4 = new o2(t4); if (r4.cmp(i2.n) >= 0 || r4.isZero()) return 1; r4.imul(new o2(e4)), r4.cmp(i2.n) >= 0 && (r4 = r4.umod(i2.n)); var n3 = r4.toArrayLike(Uint8Array, "be", 32); return e4.set(n3), 0; }, publicKeyVerify: function(e4) { return null === a2(e4) ? 1 : 0; }, publicKeyCreate: function(e4, t4) { var r4 = new o2(t4); return r4.cmp(i2.n) >= 0 || r4.isZero() ? 1 : (s2(e4, n2.keyFromPrivate(t4).getPublic()), 0); }, publicKeyConvert: function(e4, t4) { var r4 = a2(t4); return null === r4 ? 1 : (s2(e4, r4.getPublic()), 0); }, publicKeyNegate: function(e4, t4) { var r4 = a2(t4); if (null === r4) return 1; var n3 = r4.getPublic(); return n3.y = n3.y.redNeg(), s2(e4, n3), 0; }, publicKeyCombine: function(e4, t4) { for (var r4 = new Array(t4.length), n3 = 0; n3 < t4.length; ++n3) if (r4[n3] = a2(t4[n3]), null === r4[n3]) return 1; for (var i3 = r4[0].getPublic(), o3 = 1; o3 < r4.length; ++o3) i3 = i3.add(r4[o3].pub); return i3.isInfinity() ? 2 : (s2(e4, i3), 0); }, publicKeyTweakAdd: function(e4, t4, r4) { var n3 = a2(t4); if (null === n3) return 1; if ((r4 = new o2(r4)).cmp(i2.n) >= 0) return 2; var u2 = n3.getPublic().add(i2.g.mul(r4)); return u2.isInfinity() ? 2 : (s2(e4, u2), 0); }, publicKeyTweakMul: function(e4, t4, r4) { var n3 = a2(t4); return null === n3 ? 1 : (r4 = new o2(r4)).cmp(i2.n) >= 0 || r4.isZero() ? 2 : (s2(e4, n3.getPublic().mul(r4)), 0); }, signatureNormalize: function(e4) { var t4 = new o2(e4.subarray(0, 32)), r4 = new o2(e4.subarray(32, 64)); return t4.cmp(i2.n) >= 0 || r4.cmp(i2.n) >= 0 ? 1 : (1 === r4.cmp(n2.nh) && e4.set(i2.n.sub(r4).toArrayLike(Uint8Array, "be", 32), 32), 0); }, signatureExport: function(e4, t4) { var r4 = t4.subarray(0, 32), n3 = t4.subarray(32, 64); if (new o2(r4).cmp(i2.n) >= 0) return 1; if (new o2(n3).cmp(i2.n) >= 0) return 1; var a3 = e4.output, s3 = a3.subarray(4, 37); s3[0] = 0, s3.set(r4, 1); for (var u2 = 33, c2 = 0; u2 > 1 && 0 === s3[c2] && !(128 & s3[c2 + 1]); --u2, ++c2) ; if (128 & (s3 = s3.subarray(c2))[0]) return 1; if (u2 > 1 && 0 === s3[0] && !(128 & s3[1])) return 1; var f2 = a3.subarray(39, 72); f2[0] = 0, f2.set(n3, 1); for (var d2 = 33, l2 = 0; d2 > 1 && 0 === f2[l2] && !(128 & f2[l2 + 1]); --d2, ++l2) ; return 128 & (f2 = f2.subarray(l2))[0] || d2 > 1 && 0 === f2[0] && !(128 & f2[1]) ? 1 : (e4.outputlen = 6 + u2 + d2, a3[0] = 48, a3[1] = e4.outputlen - 2, a3[2] = 2, a3[3] = s3.length, a3.set(s3, 4), a3[4 + u2] = 2, a3[5 + u2] = f2.length, a3.set(f2, 6 + u2), 0); }, signatureImport: function(e4, t4) { if (t4.length < 8) return 1; if (t4.length > 72) return 1; if (48 !== t4[0]) return 1; if (t4[1] !== t4.length - 2) return 1; if (2 !== t4[2]) return 1; var r4 = t4[3]; if (0 === r4) return 1; if (5 + r4 >= t4.length) return 1; if (2 !== t4[4 + r4]) return 1; var n3 = t4[5 + r4]; if (0 === n3) return 1; if (6 + r4 + n3 !== t4.length) return 1; if (128 & t4[4]) return 1; if (r4 > 1 && 0 === t4[4] && !(128 & t4[5])) return 1; if (128 & t4[r4 + 6]) return 1; if (n3 > 1 && 0 === t4[r4 + 6] && !(128 & t4[r4 + 7])) return 1; var a3 = t4.subarray(4, 4 + r4); if (33 === a3.length && 0 === a3[0] && (a3 = a3.subarray(1)), a3.length > 32) return 1; var s3 = t4.subarray(6 + r4); if (33 === s3.length && 0 === s3[0] && (s3 = s3.slice(1)), s3.length > 32) throw new Error("S length is too long"); var u2 = new o2(a3); u2.cmp(i2.n) >= 0 && (u2 = new o2(0)); var c2 = new o2(t4.subarray(6 + r4)); return c2.cmp(i2.n) >= 0 && (c2 = new o2(0)), e4.set(u2.toArrayLike(Uint8Array, "be", 32), 0), e4.set(c2.toArrayLike(Uint8Array, "be", 32), 32), 0; }, ecdsaSign: function(e4, t4, r4, a3, s3) { if (s3) { var u2 = s3; s3 = function(e5) { var n3 = u2(t4, r4, null, a3, e5); if (!(n3 instanceof Uint8Array && 32 === n3.length)) throw new Error("This is the way"); return new o2(n3); }; } var c2, f2 = new o2(r4); if (f2.cmp(i2.n) >= 0 || f2.isZero()) return 1; try { c2 = n2.sign(t4, r4, { canonical: true, k: s3, pers: a3 }); } catch (e5) { return 1; } return e4.signature.set(c2.r.toArrayLike(Uint8Array, "be", 32), 0), e4.signature.set(c2.s.toArrayLike(Uint8Array, "be", 32), 32), e4.recid = c2.recoveryParam, 0; }, ecdsaVerify: function(e4, t4, r4) { var s3 = { r: e4.subarray(0, 32), s: e4.subarray(32, 64) }, u2 = new o2(s3.r), c2 = new o2(s3.s); if (u2.cmp(i2.n) >= 0 || c2.cmp(i2.n) >= 0) return 1; if (1 === c2.cmp(n2.nh) || u2.isZero() || c2.isZero()) return 3; var f2 = a2(r4); if (null === f2) return 2; var d2 = f2.getPublic(); return n2.verify(t4, s3, d2) ? 0 : 3; }, ecdsaRecover: function(e4, t4, r4, a3) { var u2, c2 = { r: t4.slice(0, 32), s: t4.slice(32, 64) }, f2 = new o2(c2.r), d2 = new o2(c2.s); if (f2.cmp(i2.n) >= 0 || d2.cmp(i2.n) >= 0) return 1; if (f2.isZero() || d2.isZero()) return 2; try { u2 = n2.recoverPubKey(a3, c2, r4); } catch (e5) { return 2; } return s2(e4, u2), 0; }, ecdh: function(e4, t4, r4, s3, u2, c2, f2) { var d2 = a2(t4); if (null === d2) return 1; var l2 = new o2(r4); if (l2.cmp(i2.n) >= 0 || l2.isZero()) return 2; var h2 = d2.getPublic().mul(l2); if (void 0 === u2) for (var p2 = h2.encode(null, true), b2 = n2.hash().update(p2).digest(), y2 = 0; y2 < 32; ++y2) e4[y2] = b2[y2]; else { c2 || (c2 = new Uint8Array(32)); for (var v2 = h2.getX().toArray("be", 32), m2 = 0; m2 < 32; ++m2) c2[m2] = v2[m2]; f2 || (f2 = new Uint8Array(32)); for (var g2 = h2.getY().toArray("be", 32), w2 = 0; w2 < 32; ++w2) f2[w2] = g2[w2]; var k2 = u2(c2, f2, s3); if (!(k2 instanceof Uint8Array && k2.length === e4.length)) return 2; e4.set(k2); } return 0; } }; }, 36922: (e3) => { function t3(e4, t4) { (null == t4 || t4 > e4.length) && (t4 = e4.length); for (var r4 = 0, n3 = new Array(t4); r4 < t4; r4++) n3[r4] = e4[r4]; return n3; } var r3 = "Impossible case. Please create issue.", n2 = "The tweak was out of range or the resulted private key is invalid", i2 = "The tweak was out of range or equal to zero", o2 = "Public Key could not be parsed", a2 = "Public Key serialization error", s2 = "Signature could not be parsed"; function u2(e4, t4) { if (!e4) throw new Error(t4); } function c2(e4, t4, r4) { if (u2(t4 instanceof Uint8Array, "Expected ".concat(e4, " to be an Uint8Array")), void 0 !== r4) if (Array.isArray(r4)) { var n3 = r4.join(", "), i3 = "Expected ".concat(e4, " to be an Uint8Array with length [").concat(n3, "]"); u2(r4.includes(t4.length), i3); } else { var o3 = "Expected ".concat(e4, " to be an Uint8Array with length ").concat(r4); u2(t4.length === r4, o3); } } function f2(e4) { u2("Boolean" === l2(e4), "Expected compressed to be a Boolean"); } function d2() { var e4 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : function(e5) { return new Uint8Array(e5); }, t4 = arguments.length > 1 ? arguments[1] : void 0; return "function" == typeof e4 && (e4 = e4(t4)), c2("output", e4, t4), e4; } function l2(e4) { return Object.prototype.toString.call(e4).slice(8, -1); } e3.exports = function(e4) { return { contextRandomize: function(t4) { if (u2(null === t4 || t4 instanceof Uint8Array, "Expected seed to be an Uint8Array or null"), null !== t4 && c2("seed", t4, 32), 1 === e4.contextRandomize(t4)) throw new Error("Unknow error on context randomization"); }, privateKeyVerify: function(t4) { return c2("private key", t4, 32), 0 === e4.privateKeyVerify(t4); }, privateKeyNegate: function(t4) { switch (c2("private key", t4, 32), e4.privateKeyNegate(t4)) { case 0: return t4; case 1: throw new Error(r3); } }, privateKeyTweakAdd: function(t4, r4) { switch (c2("private key", t4, 32), c2("tweak", r4, 32), e4.privateKeyTweakAdd(t4, r4)) { case 0: return t4; case 1: throw new Error(n2); } }, privateKeyTweakMul: function(t4, r4) { switch (c2("private key", t4, 32), c2("tweak", r4, 32), e4.privateKeyTweakMul(t4, r4)) { case 0: return t4; case 1: throw new Error(i2); } }, publicKeyVerify: function(t4) { return c2("public key", t4, [33, 65]), 0 === e4.publicKeyVerify(t4); }, publicKeyCreate: function(t4) { var r4 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], n3 = arguments.length > 2 ? arguments[2] : void 0; switch (c2("private key", t4, 32), f2(r4), n3 = d2(n3, r4 ? 33 : 65), e4.publicKeyCreate(n3, t4)) { case 0: return n3; case 1: throw new Error("Private Key is invalid"); case 2: throw new Error(a2); } }, publicKeyConvert: function(t4) { var r4 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], n3 = arguments.length > 2 ? arguments[2] : void 0; switch (c2("public key", t4, [33, 65]), f2(r4), n3 = d2(n3, r4 ? 33 : 65), e4.publicKeyConvert(n3, t4)) { case 0: return n3; case 1: throw new Error(o2); case 2: throw new Error(a2); } }, publicKeyNegate: function(t4) { var n3 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i3 = arguments.length > 2 ? arguments[2] : void 0; switch (c2("public key", t4, [33, 65]), f2(n3), i3 = d2(i3, n3 ? 33 : 65), e4.publicKeyNegate(i3, t4)) { case 0: return i3; case 1: throw new Error(o2); case 2: throw new Error(r3); case 3: throw new Error(a2); } }, publicKeyCombine: function(r4) { var n3 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i3 = arguments.length > 2 ? arguments[2] : void 0; u2(Array.isArray(r4), "Expected public keys to be an Array"), u2(r4.length > 0, "Expected public keys array will have more than zero items"); var s3, l3 = function(e5, r5) { var n4 = "undefined" != typeof Symbol && e5[Symbol.iterator] || e5["@@iterator"]; if (!n4) { if (Array.isArray(e5) || (n4 = function(e6, r6) { if (e6) { if ("string" == typeof e6) return t3(e6, r6); var n5 = Object.prototype.toString.call(e6).slice(8, -1); return "Object" === n5 && e6.constructor && (n5 = e6.constructor.name), "Map" === n5 || "Set" === n5 ? Array.from(e6) : "Arguments" === n5 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n5) ? t3(e6, r6) : void 0; } }(e5)) || r5 && e5 && "number" == typeof e5.length) { n4 && (e5 = n4); var i4 = 0, o3 = function() { }; return { s: o3, n: function() { return i4 >= e5.length ? { done: true } : { done: false, value: e5[i4++] }; }, e: function(e6) { throw e6; }, f: o3 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var a3, s4 = true, u3 = false; return { s: function() { n4 = n4.call(e5); }, n: function() { var e6 = n4.next(); return s4 = e6.done, e6; }, e: function(e6) { u3 = true, a3 = e6; }, f: function() { try { s4 || null == n4.return || n4.return(); } finally { if (u3) throw a3; } } }; }(r4); try { for (l3.s(); !(s3 = l3.n()).done; ) c2("public key", s3.value, [33, 65]); } catch (e5) { l3.e(e5); } finally { l3.f(); } switch (f2(n3), i3 = d2(i3, n3 ? 33 : 65), e4.publicKeyCombine(i3, r4)) { case 0: return i3; case 1: throw new Error(o2); case 2: throw new Error("The sum of the public keys is not valid"); case 3: throw new Error(a2); } }, publicKeyTweakAdd: function(t4, r4) { var i3 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], a3 = arguments.length > 3 ? arguments[3] : void 0; switch (c2("public key", t4, [33, 65]), c2("tweak", r4, 32), f2(i3), a3 = d2(a3, i3 ? 33 : 65), e4.publicKeyTweakAdd(a3, t4, r4)) { case 0: return a3; case 1: throw new Error(o2); case 2: throw new Error(n2); } }, publicKeyTweakMul: function(t4, r4) { var n3 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], a3 = arguments.length > 3 ? arguments[3] : void 0; switch (c2("public key", t4, [33, 65]), c2("tweak", r4, 32), f2(n3), a3 = d2(a3, n3 ? 33 : 65), e4.publicKeyTweakMul(a3, t4, r4)) { case 0: return a3; case 1: throw new Error(o2); case 2: throw new Error(i2); } }, signatureNormalize: function(t4) { switch (c2("signature", t4, 64), e4.signatureNormalize(t4)) { case 0: return t4; case 1: throw new Error(s2); } }, signatureExport: function(t4, n3) { c2("signature", t4, 64); var i3 = { output: n3 = d2(n3, 72), outputlen: 72 }; switch (e4.signatureExport(i3, t4)) { case 0: return n3.slice(0, i3.outputlen); case 1: throw new Error(s2); case 2: throw new Error(r3); } }, signatureImport: function(t4, n3) { switch (c2("signature", t4), n3 = d2(n3, 64), e4.signatureImport(n3, t4)) { case 0: return n3; case 1: throw new Error(s2); case 2: throw new Error(r3); } }, ecdsaSign: function(t4, n3) { var i3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, o3 = arguments.length > 3 ? arguments[3] : void 0; c2("message", t4, 32), c2("private key", n3, 32), u2("Object" === l2(i3), "Expected options to be an Object"), void 0 !== i3.data && c2("options.data", i3.data), void 0 !== i3.noncefn && u2("Function" === l2(i3.noncefn), "Expected options.noncefn to be a Function"); var a3 = { signature: o3 = d2(o3, 64), recid: null }; switch (e4.ecdsaSign(a3, t4, n3, i3.data, i3.noncefn)) { case 0: return a3; case 1: throw new Error("The nonce generation function failed, or the private key was invalid"); case 2: throw new Error(r3); } }, ecdsaVerify: function(t4, r4, n3) { switch (c2("signature", t4, 64), c2("message", r4, 32), c2("public key", n3, [33, 65]), e4.ecdsaVerify(t4, r4, n3)) { case 0: return true; case 3: return false; case 1: throw new Error(s2); case 2: throw new Error(o2); } }, ecdsaRecover: function(t4, n3, i3) { var o3 = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], a3 = arguments.length > 4 ? arguments[4] : void 0; switch (c2("signature", t4, 64), u2("Number" === l2(n3) && n3 >= 0 && n3 <= 3, "Expected recovery id to be a Number within interval [0, 3]"), c2("message", i3, 32), f2(o3), a3 = d2(a3, o3 ? 33 : 65), e4.ecdsaRecover(a3, t4, n3, i3)) { case 0: return a3; case 1: throw new Error(s2); case 2: throw new Error("Public key could not be recover"); case 3: throw new Error(r3); } }, ecdh: function(t4, r4) { var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, i3 = arguments.length > 3 ? arguments[3] : void 0; switch (c2("public key", t4, [33, 65]), c2("private key", r4, 32), u2("Object" === l2(n3), "Expected options to be an Object"), void 0 !== n3.data && c2("options.data", n3.data), void 0 !== n3.hashfn ? (u2("Function" === l2(n3.hashfn), "Expected options.hashfn to be a Function"), void 0 !== n3.xbuf && c2("options.xbuf", n3.xbuf, 32), void 0 !== n3.ybuf && c2("options.ybuf", n3.ybuf, 32), c2("output", i3)) : i3 = d2(i3, 32), e4.ecdh(i3, t4, r4, n3.data, n3.hashfn, n3.xbuf, n3.ybuf)) { case 0: return i3; case 1: throw new Error(o2); case 2: throw new Error("Scalar was invalid (zero or overflow)"); } } }; }; }, 77990: (e3, t3, r3) => { var n2 = r3(57701), i2 = r3(94919), o2 = r3(1020)(), a2 = r3(53820), s2 = n2("%TypeError%"), u2 = n2("%Math.floor%"); e3.exports = function(e4, t4) { if ("function" != typeof e4) throw new s2("`fn` is not a function"); if ("number" != typeof t4 || t4 < 0 || t4 > 4294967295 || u2(t4) !== t4) throw new s2("`length` must be a positive 32-bit integer"); var r4 = arguments.length > 2 && !!arguments[2], n3 = true, c2 = true; if ("length" in e4 && a2) { var f2 = a2(e4, "length"); f2 && !f2.configurable && (n3 = false), f2 && !f2.writable && (c2 = false); } return (n3 || c2 || !r4) && (o2 ? i2(e4, "length", t4, true, true) : i2(e4, "length", t4)), e4; }; }, 76003: (e3, t3, r3) => { var n2 = r3(48850).Buffer; function i2(e4, t4) { this._block = n2.alloc(e4), this._finalSize = t4, this._blockSize = e4, this._len = 0; } i2.prototype.update = function(e4, t4) { "string" == typeof e4 && (t4 = t4 || "utf8", e4 = n2.from(e4, t4)); for (var r4 = this._block, i3 = this._blockSize, o2 = e4.length, a2 = this._len, s2 = 0; s2 < o2; ) { for (var u2 = a2 % i3, c2 = Math.min(o2 - s2, i3 - u2), f2 = 0; f2 < c2; f2++) r4[u2 + f2] = e4[s2 + f2]; s2 += c2, (a2 += c2) % i3 == 0 && this._update(r4); } return this._len += o2, this; }, i2.prototype.digest = function(e4) { var t4 = this._len % this._blockSize; this._block[t4] = 128, this._block.fill(0, t4 + 1), t4 >= this._finalSize && (this._update(this._block), this._block.fill(0)); var r4 = 8 * this._len; if (r4 <= 4294967295) this._block.writeUInt32BE(r4, this._blockSize - 4); else { var n3 = (4294967295 & r4) >>> 0, i3 = (r4 - n3) / 4294967296; this._block.writeUInt32BE(i3, this._blockSize - 8), this._block.writeUInt32BE(n3, this._blockSize - 4); } this._update(this._block); var o2 = this._hash(); return e4 ? o2.toString(e4) : o2; }, i2.prototype._update = function() { throw new Error("_update must be implemented by subclass"); }, e3.exports = i2; }, 51708: (e3, t3, r3) => { var n2 = e3.exports = function(e4) { e4 = e4.toLowerCase(); var t4 = n2[e4]; if (!t4) throw new Error(e4 + " is not supported (we accept pull requests)"); return new t4(); }; n2.sha = r3(8210), n2.sha1 = r3(10544), n2.sha224 = r3(66288), n2.sha256 = r3(34571), n2.sha384 = r3(46959), n2.sha512 = r3(14515); }, 8210: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(76003), o2 = r3(48850).Buffer, a2 = [1518500249, 1859775393, -1894007588, -899497514], s2 = new Array(80); function u2() { this.init(), this._w = s2, i2.call(this, 64, 56); } function c2(e4) { return e4 << 30 | e4 >>> 2; } function f2(e4, t4, r4, n3) { return 0 === e4 ? t4 & r4 | ~t4 & n3 : 2 === e4 ? t4 & r4 | t4 & n3 | r4 & n3 : t4 ^ r4 ^ n3; } n2(u2, i2), u2.prototype.init = function() { return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this; }, u2.prototype._update = function(e4) { for (var t4, r4 = this._w, n3 = 0 | this._a, i3 = 0 | this._b, o3 = 0 | this._c, s3 = 0 | this._d, u3 = 0 | this._e, d2 = 0; d2 < 16; ++d2) r4[d2] = e4.readInt32BE(4 * d2); for (; d2 < 80; ++d2) r4[d2] = r4[d2 - 3] ^ r4[d2 - 8] ^ r4[d2 - 14] ^ r4[d2 - 16]; for (var l2 = 0; l2 < 80; ++l2) { var h2 = ~~(l2 / 20), p2 = 0 | ((t4 = n3) << 5 | t4 >>> 27) + f2(h2, i3, o3, s3) + u3 + r4[l2] + a2[h2]; u3 = s3, s3 = o3, o3 = c2(i3), i3 = n3, n3 = p2; } this._a = n3 + this._a | 0, this._b = i3 + this._b | 0, this._c = o3 + this._c | 0, this._d = s3 + this._d | 0, this._e = u3 + this._e | 0; }, u2.prototype._hash = function() { var e4 = o2.allocUnsafe(20); return e4.writeInt32BE(0 | this._a, 0), e4.writeInt32BE(0 | this._b, 4), e4.writeInt32BE(0 | this._c, 8), e4.writeInt32BE(0 | this._d, 12), e4.writeInt32BE(0 | this._e, 16), e4; }, e3.exports = u2; }, 10544: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(76003), o2 = r3(48850).Buffer, a2 = [1518500249, 1859775393, -1894007588, -899497514], s2 = new Array(80); function u2() { this.init(), this._w = s2, i2.call(this, 64, 56); } function c2(e4) { return e4 << 5 | e4 >>> 27; } function f2(e4) { return e4 << 30 | e4 >>> 2; } function d2(e4, t4, r4, n3) { return 0 === e4 ? t4 & r4 | ~t4 & n3 : 2 === e4 ? t4 & r4 | t4 & n3 | r4 & n3 : t4 ^ r4 ^ n3; } n2(u2, i2), u2.prototype.init = function() { return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this; }, u2.prototype._update = function(e4) { for (var t4, r4 = this._w, n3 = 0 | this._a, i3 = 0 | this._b, o3 = 0 | this._c, s3 = 0 | this._d, u3 = 0 | this._e, l2 = 0; l2 < 16; ++l2) r4[l2] = e4.readInt32BE(4 * l2); for (; l2 < 80; ++l2) r4[l2] = (t4 = r4[l2 - 3] ^ r4[l2 - 8] ^ r4[l2 - 14] ^ r4[l2 - 16]) << 1 | t4 >>> 31; for (var h2 = 0; h2 < 80; ++h2) { var p2 = ~~(h2 / 20), b2 = c2(n3) + d2(p2, i3, o3, s3) + u3 + r4[h2] + a2[p2] | 0; u3 = s3, s3 = o3, o3 = f2(i3), i3 = n3, n3 = b2; } this._a = n3 + this._a | 0, this._b = i3 + this._b | 0, this._c = o3 + this._c | 0, this._d = s3 + this._d | 0, this._e = u3 + this._e | 0; }, u2.prototype._hash = function() { var e4 = o2.allocUnsafe(20); return e4.writeInt32BE(0 | this._a, 0), e4.writeInt32BE(0 | this._b, 4), e4.writeInt32BE(0 | this._c, 8), e4.writeInt32BE(0 | this._d, 12), e4.writeInt32BE(0 | this._e, 16), e4; }, e3.exports = u2; }, 66288: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(34571), o2 = r3(76003), a2 = r3(48850).Buffer, s2 = new Array(64); function u2() { this.init(), this._w = s2, o2.call(this, 64, 56); } n2(u2, i2), u2.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; }, u2.prototype._hash = function() { var e4 = a2.allocUnsafe(28); return e4.writeInt32BE(this._a, 0), e4.writeInt32BE(this._b, 4), e4.writeInt32BE(this._c, 8), e4.writeInt32BE(this._d, 12), e4.writeInt32BE(this._e, 16), e4.writeInt32BE(this._f, 20), e4.writeInt32BE(this._g, 24), e4; }, e3.exports = u2; }, 34571: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(76003), o2 = r3(48850).Buffer, a2 = [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], s2 = new Array(64); function u2() { this.init(), this._w = s2, i2.call(this, 64, 56); } function c2(e4, t4, r4) { return r4 ^ e4 & (t4 ^ r4); } function f2(e4, t4, r4) { return e4 & t4 | r4 & (e4 | t4); } function d2(e4) { return (e4 >>> 2 | e4 << 30) ^ (e4 >>> 13 | e4 << 19) ^ (e4 >>> 22 | e4 << 10); } function l2(e4) { return (e4 >>> 6 | e4 << 26) ^ (e4 >>> 11 | e4 << 21) ^ (e4 >>> 25 | e4 << 7); } function h2(e4) { return (e4 >>> 7 | e4 << 25) ^ (e4 >>> 18 | e4 << 14) ^ e4 >>> 3; } n2(u2, i2), u2.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; }, u2.prototype._update = function(e4) { for (var t4, r4 = this._w, n3 = 0 | this._a, i3 = 0 | this._b, o3 = 0 | this._c, s3 = 0 | this._d, u3 = 0 | this._e, p2 = 0 | this._f, b2 = 0 | this._g, y2 = 0 | this._h, v2 = 0; v2 < 16; ++v2) r4[v2] = e4.readInt32BE(4 * v2); for (; v2 < 64; ++v2) r4[v2] = 0 | (((t4 = r4[v2 - 2]) >>> 17 | t4 << 15) ^ (t4 >>> 19 | t4 << 13) ^ t4 >>> 10) + r4[v2 - 7] + h2(r4[v2 - 15]) + r4[v2 - 16]; for (var m2 = 0; m2 < 64; ++m2) { var g2 = y2 + l2(u3) + c2(u3, p2, b2) + a2[m2] + r4[m2] | 0, w2 = d2(n3) + f2(n3, i3, o3) | 0; y2 = b2, b2 = p2, p2 = u3, u3 = s3 + g2 | 0, s3 = o3, o3 = i3, i3 = n3, n3 = g2 + w2 | 0; } this._a = n3 + this._a | 0, this._b = i3 + this._b | 0, this._c = o3 + this._c | 0, this._d = s3 + this._d | 0, this._e = u3 + this._e | 0, this._f = p2 + this._f | 0, this._g = b2 + this._g | 0, this._h = y2 + this._h | 0; }, u2.prototype._hash = function() { var e4 = o2.allocUnsafe(32); return e4.writeInt32BE(this._a, 0), e4.writeInt32BE(this._b, 4), e4.writeInt32BE(this._c, 8), e4.writeInt32BE(this._d, 12), e4.writeInt32BE(this._e, 16), e4.writeInt32BE(this._f, 20), e4.writeInt32BE(this._g, 24), e4.writeInt32BE(this._h, 28), e4; }, e3.exports = u2; }, 46959: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(14515), o2 = r3(76003), a2 = r3(48850).Buffer, s2 = new Array(160); function u2() { this.init(), this._w = s2, o2.call(this, 128, 112); } n2(u2, i2), u2.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; }, u2.prototype._hash = function() { var e4 = a2.allocUnsafe(48); function t4(t5, r4, n3) { e4.writeInt32BE(t5, n3), e4.writeInt32BE(r4, n3 + 4); } return t4(this._ah, this._al, 0), t4(this._bh, this._bl, 8), t4(this._ch, this._cl, 16), t4(this._dh, this._dl, 24), t4(this._eh, this._el, 32), t4(this._fh, this._fl, 40), e4; }, e3.exports = u2; }, 14515: (e3, t3, r3) => { var n2 = r3(41736), i2 = r3(76003), o2 = r3(48850).Buffer, a2 = [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], s2 = new Array(160); function u2() { this.init(), this._w = s2, i2.call(this, 128, 112); } function c2(e4, t4, r4) { return r4 ^ e4 & (t4 ^ r4); } function f2(e4, t4, r4) { return e4 & t4 | r4 & (e4 | t4); } function d2(e4, t4) { return (e4 >>> 28 | t4 << 4) ^ (t4 >>> 2 | e4 << 30) ^ (t4 >>> 7 | e4 << 25); } function l2(e4, t4) { return (e4 >>> 14 | t4 << 18) ^ (e4 >>> 18 | t4 << 14) ^ (t4 >>> 9 | e4 << 23); } function h2(e4, t4) { return (e4 >>> 1 | t4 << 31) ^ (e4 >>> 8 | t4 << 24) ^ e4 >>> 7; } function p2(e4, t4) { return (e4 >>> 1 | t4 << 31) ^ (e4 >>> 8 | t4 << 24) ^ (e4 >>> 7 | t4 << 25); } function b2(e4, t4) { return (e4 >>> 19 | t4 << 13) ^ (t4 >>> 29 | e4 << 3) ^ e4 >>> 6; } function y2(e4, t4) { return (e4 >>> 19 | t4 << 13) ^ (t4 >>> 29 | e4 << 3) ^ (e4 >>> 6 | t4 << 26); } function v2(e4, t4) { return e4 >>> 0 < t4 >>> 0 ? 1 : 0; } n2(u2, i2), u2.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; }, u2.prototype._update = function(e4) { for (var t4 = this._w, r4 = 0 | this._ah, n3 = 0 | this._bh, i3 = 0 | this._ch, o3 = 0 | this._dh, s3 = 0 | this._eh, u3 = 0 | this._fh, m2 = 0 | this._gh, g2 = 0 | this._hh, w2 = 0 | this._al, k2 = 0 | this._bl, _2 = 0 | this._cl, A2 = 0 | this._dl, E2 = 0 | this._el, S2 = 0 | this._fl, x2 = 0 | this._gl, B2 = 0 | this._hl, O2 = 0; O2 < 32; O2 += 2) t4[O2] = e4.readInt32BE(4 * O2), t4[O2 + 1] = e4.readInt32BE(4 * O2 + 4); for (; O2 < 160; O2 += 2) { var P2 = t4[O2 - 30], I2 = t4[O2 - 30 + 1], T2 = h2(P2, I2), C2 = p2(I2, P2), M2 = b2(P2 = t4[O2 - 4], I2 = t4[O2 - 4 + 1]), R2 = y2(I2, P2), U2 = t4[O2 - 14], N2 = t4[O2 - 14 + 1], j2 = t4[O2 - 32], L2 = t4[O2 - 32 + 1], F2 = C2 + N2 | 0, D2 = T2 + U2 + v2(F2, C2) | 0; D2 = (D2 = D2 + M2 + v2(F2 = F2 + R2 | 0, R2) | 0) + j2 + v2(F2 = F2 + L2 | 0, L2) | 0, t4[O2] = D2, t4[O2 + 1] = F2; } for (var H2 = 0; H2 < 160; H2 += 2) { D2 = t4[H2], F2 = t4[H2 + 1]; var z2 = f2(r4, n3, i3), q2 = f2(w2, k2, _2), K2 = d2(r4, w2), G2 = d2(w2, r4), V2 = l2(s3, E2), Z2 = l2(E2, s3), W2 = a2[H2], J2 = a2[H2 + 1], Y2 = c2(s3, u3, m2), X2 = c2(E2, S2, x2), Q2 = B2 + Z2 | 0, $2 = g2 + V2 + v2(Q2, B2) | 0; $2 = ($2 = ($2 = $2 + Y2 + v2(Q2 = Q2 + X2 | 0, X2) | 0) + W2 + v2(Q2 = Q2 + J2 | 0, J2) | 0) + D2 + v2(Q2 = Q2 + F2 | 0, F2) | 0; var ee2 = G2 + q2 | 0, te2 = K2 + z2 + v2(ee2, G2) | 0; g2 = m2, B2 = x2, m2 = u3, x2 = S2, u3 = s3, S2 = E2, s3 = o3 + $2 + v2(E2 = A2 + Q2 | 0, A2) | 0, o3 = i3, A2 = _2, i3 = n3, _2 = k2, n3 = r4, k2 = w2, r4 = $2 + te2 + v2(w2 = Q2 + ee2 | 0, Q2) | 0; } this._al = this._al + w2 | 0, this._bl = this._bl + k2 | 0, this._cl = this._cl + _2 | 0, this._dl = this._dl + A2 | 0, this._el = this._el + E2 | 0, this._fl = this._fl + S2 | 0, this._gl = this._gl + x2 | 0, this._hl = this._hl + B2 | 0, this._ah = this._ah + r4 + v2(this._al, w2) | 0, this._bh = this._bh + n3 + v2(this._bl, k2) | 0, this._ch = this._ch + i3 + v2(this._cl, _2) | 0, this._dh = this._dh + o3 + v2(this._dl, A2) | 0, this._eh = this._eh + s3 + v2(this._el, E2) | 0, this._fh = this._fh + u3 + v2(this._fl, S2) | 0, this._gh = this._gh + m2 + v2(this._gl, x2) | 0, this._hh = this._hh + g2 + v2(this._hl, B2) | 0; }, u2.prototype._hash = function() { var e4 = o2.allocUnsafe(64); function t4(t5, r4, n3) { e4.writeInt32BE(t5, n3), e4.writeInt32BE(r4, n3 + 4); } return t4(this._ah, this._al, 0), t4(this._bh, this._bl, 8), t4(this._ch, this._cl, 16), t4(this._dh, this._dl, 24), t4(this._eh, this._el, 32), t4(this._fh, this._fl, 40), t4(this._gh, this._gl, 48), t4(this._hh, this._hl, 56), e4; }, e3.exports = u2; }, 57245: (e3, t3, r3) => { e3.exports = i2; var n2 = r3(38291).EventEmitter; function i2() { n2.call(this); } r3(41736)(i2, n2), i2.Readable = r3(6297), i2.Writable = r3(71471), i2.Duplex = r3(76884), i2.Transform = r3(99154), i2.PassThrough = r3(53582), i2.finished = r3(5831), i2.pipeline = r3(60384), i2.Stream = i2, i2.prototype.pipe = function(e4, t4) { var r4 = this; function i3(t5) { e4.writable && false === e4.write(t5) && r4.pause && r4.pause(); } function o2() { r4.readable && r4.resume && r4.resume(); } r4.on("data", i3), e4.on("drain", o2), e4._isStdio || t4 && false === t4.end || (r4.on("end", s2), r4.on("close", u2)); var a2 = false; function s2() { a2 || (a2 = true, e4.end()); } function u2() { a2 || (a2 = true, "function" == typeof e4.destroy && e4.destroy()); } function c2(e5) { if (f2(), 0 === n2.listenerCount(this, "error")) throw e5; } function f2() { r4.removeListener("data", i3), e4.removeListener("drain", o2), r4.removeListener("end", s2), r4.removeListener("close", u2), r4.removeListener("error", c2), e4.removeListener("error", c2), r4.removeListener("end", f2), r4.removeListener("close", f2), e4.removeListener("close", f2); } return r4.on("error", c2), e4.on("error", c2), r4.on("end", f2), r4.on("close", f2), e4.on("close", f2), e4.emit("pipe", r4), e4; }; }, 29519: (e3, t3, r3) => { var n2 = r3(38844), i2 = r3(53319), o2 = r3(87705), a2 = r3(83675), s2 = r3(51143), u2 = t3; u2.request = function(e4, t4) { e4 = "string" == typeof e4 ? s2.parse(e4) : o2(e4); var i3 = -1 === r3.g.location.protocol.search(/^https?:$/) ? "http:" : "", a3 = e4.protocol || i3, u3 = e4.hostname || e4.host, c2 = e4.port, f2 = e4.path || "/"; u3 && -1 !== u3.indexOf(":") && (u3 = "[" + u3 + "]"), e4.url = (u3 ? a3 + "//" + u3 : "") + (c2 ? ":" + c2 : "") + f2, e4.method = (e4.method || "GET").toUpperCase(), e4.headers = e4.headers || {}; var d2 = new n2(e4); return t4 && d2.on("response", t4), d2; }, u2.get = function(e4, t4) { var r4 = u2.request(e4, t4); return r4.end(), r4; }, u2.ClientRequest = n2, u2.IncomingMessage = i2.IncomingMessage, u2.Agent = function() { }, u2.Agent.defaultMaxSockets = 4, u2.globalAgent = new u2.Agent(), u2.STATUS_CODES = a2, u2.METHODS = ["CHECKOUT", "CONNECT", "COPY", "DELETE", "GET", "HEAD", "LOCK", "M-SEARCH", "MERGE", "MKACTIVITY", "MKCOL", "MOVE", "NOTIFY", "OPTIONS", "PATCH", "POST", "PROPFIND", "PROPPATCH", "PURGE", "PUT", "REPORT", "SEARCH", "SUBSCRIBE", "TRACE", "UNLOCK", "UNSUBSCRIBE"]; }, 23928: (e3, t3, r3) => { var n2; function i2() { if (void 0 !== n2) return n2; if (r3.g.XMLHttpRequest) { n2 = new r3.g.XMLHttpRequest(); try { n2.open("GET", r3.g.XDomainRequest ? "/" : "https://example.com"); } catch (e4) { n2 = null; } } else n2 = null; return n2; } function o2(e4) { var t4 = i2(); if (!t4) return false; try { return t4.responseType = e4, t4.responseType === e4; } catch (e5) { } return false; } function a2(e4) { return "function" == typeof e4; } t3.fetch = a2(r3.g.fetch) && a2(r3.g.ReadableStream), t3.writableStream = a2(r3.g.WritableStream), t3.abortController = a2(r3.g.AbortController), t3.arraybuffer = t3.fetch || o2("arraybuffer"), t3.msstream = !t3.fetch && o2("ms-stream"), t3.mozchunkedarraybuffer = !t3.fetch && o2("moz-chunked-arraybuffer"), t3.overrideMimeType = t3.fetch || !!i2() && a2(i2().overrideMimeType), n2 = null; }, 38844: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(19142), o2 = r3(23928), a2 = r3(41736), s2 = r3(53319), u2 = r3(86505), c2 = s2.IncomingMessage, f2 = s2.readyStates, d2 = e3.exports = function(e4) { var t4, r4 = this; u2.Writable.call(r4), r4._opts = e4, r4._body = [], r4._headers = {}, e4.auth && r4.setHeader("Authorization", "Basic " + n2.from(e4.auth).toString("base64")), Object.keys(e4.headers).forEach(function(t5) { r4.setHeader(t5, e4.headers[t5]); }); var i3 = true; if ("disable-fetch" === e4.mode || "requestTimeout" in e4 && !o2.abortController) i3 = false, t4 = true; else if ("prefer-streaming" === e4.mode) t4 = false; else if ("allow-wrong-content-type" === e4.mode) t4 = !o2.overrideMimeType; else { if (e4.mode && "default" !== e4.mode && "prefer-fast" !== e4.mode) throw new Error("Invalid value for opts.mode"); t4 = true; } r4._mode = function(e5, t5) { return o2.fetch && t5 ? "fetch" : o2.mozchunkedarraybuffer ? "moz-chunked-arraybuffer" : o2.msstream ? "ms-stream" : o2.arraybuffer && e5 ? "arraybuffer" : "text"; }(t4, i3), r4._fetchTimer = null, r4._socketTimeout = null, r4._socketTimer = null, r4.on("finish", function() { r4._onFinish(); }); }; a2(d2, u2.Writable), d2.prototype.setHeader = function(e4, t4) { var r4 = e4.toLowerCase(); -1 === l2.indexOf(r4) && (this._headers[r4] = { name: e4, value: t4 }); }, d2.prototype.getHeader = function(e4) { var t4 = this._headers[e4.toLowerCase()]; return t4 ? t4.value : null; }, d2.prototype.removeHeader = function(e4) { delete this._headers[e4.toLowerCase()]; }, d2.prototype._onFinish = function() { var e4 = this; if (!e4._destroyed) { var t4 = e4._opts; "timeout" in t4 && 0 !== t4.timeout && e4.setTimeout(t4.timeout); var n3 = e4._headers, a3 = null; "GET" !== t4.method && "HEAD" !== t4.method && (a3 = new Blob(e4._body, { type: (n3["content-type"] || {}).value || "" })); var s3 = []; if (Object.keys(n3).forEach(function(e5) { var t5 = n3[e5].name, r4 = n3[e5].value; Array.isArray(r4) ? r4.forEach(function(e6) { s3.push([t5, e6]); }) : s3.push([t5, r4]); }), "fetch" === e4._mode) { var u3 = null; if (o2.abortController) { var c3 = new AbortController(); u3 = c3.signal, e4._fetchAbortController = c3, "requestTimeout" in t4 && 0 !== t4.requestTimeout && (e4._fetchTimer = r3.g.setTimeout(function() { e4.emit("requestTimeout"), e4._fetchAbortController && e4._fetchAbortController.abort(); }, t4.requestTimeout)); } r3.g.fetch(e4._opts.url, { method: e4._opts.method, headers: s3, body: a3 || void 0, mode: "cors", credentials: t4.withCredentials ? "include" : "same-origin", signal: u3 }).then(function(t5) { e4._fetchResponse = t5, e4._resetTimers(false), e4._connect(); }, function(t5) { e4._resetTimers(true), e4._destroyed || e4.emit("error", t5); }); } else { var d3 = e4._xhr = new r3.g.XMLHttpRequest(); try { d3.open(e4._opts.method, e4._opts.url, true); } catch (t5) { return void i2.nextTick(function() { e4.emit("error", t5); }); } "responseType" in d3 && (d3.responseType = e4._mode), "withCredentials" in d3 && (d3.withCredentials = !!t4.withCredentials), "text" === e4._mode && "overrideMimeType" in d3 && d3.overrideMimeType("text/plain; charset=x-user-defined"), "requestTimeout" in t4 && (d3.timeout = t4.requestTimeout, d3.ontimeout = function() { e4.emit("requestTimeout"); }), s3.forEach(function(e5) { d3.setRequestHeader(e5[0], e5[1]); }), e4._response = null, d3.onreadystatechange = function() { switch (d3.readyState) { case f2.LOADING: case f2.DONE: e4._onXHRProgress(); } }, "moz-chunked-arraybuffer" === e4._mode && (d3.onprogress = function() { e4._onXHRProgress(); }), d3.onerror = function() { e4._destroyed || (e4._resetTimers(true), e4.emit("error", new Error("XHR error"))); }; try { d3.send(a3); } catch (t5) { return void i2.nextTick(function() { e4.emit("error", t5); }); } } } }, d2.prototype._onXHRProgress = function() { var e4 = this; e4._resetTimers(false), function(e5) { try { var t4 = e5.status; return null !== t4 && 0 !== t4; } catch (e6) { return false; } }(e4._xhr) && !e4._destroyed && (e4._response || e4._connect(), e4._response._onXHRProgress(e4._resetTimers.bind(e4))); }, d2.prototype._connect = function() { var e4 = this; e4._destroyed || (e4._response = new c2(e4._xhr, e4._fetchResponse, e4._mode, e4._resetTimers.bind(e4)), e4._response.on("error", function(t4) { e4.emit("error", t4); }), e4.emit("response", e4._response)); }, d2.prototype._write = function(e4, t4, r4) { this._body.push(e4), r4(); }, d2.prototype._resetTimers = function(e4) { var t4 = this; r3.g.clearTimeout(t4._socketTimer), t4._socketTimer = null, e4 ? (r3.g.clearTimeout(t4._fetchTimer), t4._fetchTimer = null) : t4._socketTimeout && (t4._socketTimer = r3.g.setTimeout(function() { t4.emit("timeout"); }, t4._socketTimeout)); }, d2.prototype.abort = d2.prototype.destroy = function(e4) { var t4 = this; t4._destroyed = true, t4._resetTimers(true), t4._response && (t4._response._destroyed = true), t4._xhr ? t4._xhr.abort() : t4._fetchAbortController && t4._fetchAbortController.abort(), e4 && t4.emit("error", e4); }, d2.prototype.end = function(e4, t4, r4) { "function" == typeof e4 && (r4 = e4, e4 = void 0), u2.Writable.prototype.end.call(this, e4, t4, r4); }, d2.prototype.setTimeout = function(e4, t4) { var r4 = this; t4 && r4.once("timeout", t4), r4._socketTimeout = e4, r4._resetTimers(false); }, d2.prototype.flushHeaders = function() { }, d2.prototype.setNoDelay = function() { }, d2.prototype.setSocketKeepAlive = function() { }; var l2 = ["accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "date", "dnt", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "via"]; }, 53319: (e3, t3, r3) => { var n2 = r3(19142), i2 = r3(29033).Buffer, o2 = r3(23928), a2 = r3(41736), s2 = r3(86505), u2 = t3.readyStates = { UNSENT: 0, OPENED: 1, HEADERS_RECEIVED: 2, LOADING: 3, DONE: 4 }, c2 = t3.IncomingMessage = function(e4, t4, r4, a3) { var u3 = this; if (s2.Readable.call(u3), u3._mode = r4, u3.headers = {}, u3.rawHeaders = [], u3.trailers = {}, u3.rawTrailers = [], u3.on("end", function() { n2.nextTick(function() { u3.emit("close"); }); }), "fetch" === r4) { if (u3._fetchResponse = t4, u3.url = t4.url, u3.statusCode = t4.status, u3.statusMessage = t4.statusText, t4.headers.forEach(function(e5, t5) { u3.headers[t5.toLowerCase()] = e5, u3.rawHeaders.push(t5, e5); }), o2.writableStream) { var c3 = new WritableStream({ write: function(e5) { return a3(false), new Promise(function(t5, r5) { u3._destroyed ? r5() : u3.push(i2.from(e5)) ? t5() : u3._resumeFetch = t5; }); }, close: function() { a3(true), u3._destroyed || u3.push(null); }, abort: function(e5) { a3(true), u3._destroyed || u3.emit("error", e5); } }); try { return void t4.body.pipeTo(c3).catch(function(e5) { a3(true), u3._destroyed || u3.emit("error", e5); }); } catch (e5) { } } var f2 = t4.body.getReader(); !function e5() { f2.read().then(function(t5) { u3._destroyed || (a3(t5.done), t5.done ? u3.push(null) : (u3.push(i2.from(t5.value)), e5())); }).catch(function(e6) { a3(true), u3._destroyed || u3.emit("error", e6); }); }(); } else if (u3._xhr = e4, u3._pos = 0, u3.url = e4.responseURL, u3.statusCode = e4.status, u3.statusMessage = e4.statusText, e4.getAllResponseHeaders().split(/\r?\n/).forEach(function(e5) { var t5 = e5.match(/^([^:]+):\s*(.*)/); if (t5) { var r5 = t5[1].toLowerCase(); "set-cookie" === r5 ? (void 0 === u3.headers[r5] && (u3.headers[r5] = []), u3.headers[r5].push(t5[2])) : void 0 !== u3.headers[r5] ? u3.headers[r5] += ", " + t5[2] : u3.headers[r5] = t5[2], u3.rawHeaders.push(t5[1], t5[2]); } }), u3._charset = "x-user-defined", !o2.overrideMimeType) { var d2 = u3.rawHeaders["mime-type"]; if (d2) { var l2 = d2.match(/;\s*charset=([^;])(;|$)/); l2 && (u3._charset = l2[1].toLowerCase()); } u3._charset || (u3._charset = "utf-8"); } }; a2(c2, s2.Readable), c2.prototype._read = function() { var e4 = this._resumeFetch; e4 && (this._resumeFetch = null, e4()); }, c2.prototype._onXHRProgress = function(e4) { var t4 = this, n3 = t4._xhr, o3 = null; switch (t4._mode) { case "text": if ((o3 = n3.responseText).length > t4._pos) { var a3 = o3.substr(t4._pos); if ("x-user-defined" === t4._charset) { for (var s3 = i2.alloc(a3.length), c3 = 0; c3 < a3.length; c3++) s3[c3] = 255 & a3.charCodeAt(c3); t4.push(s3); } else t4.push(a3, t4._charset); t4._pos = o3.length; } break; case "arraybuffer": if (n3.readyState !== u2.DONE || !n3.response) break; o3 = n3.response, t4.push(i2.from(new Uint8Array(o3))); break; case "moz-chunked-arraybuffer": if (o3 = n3.response, n3.readyState !== u2.LOADING || !o3) break; t4.push(i2.from(new Uint8Array(o3))); break; case "ms-stream": if (o3 = n3.response, n3.readyState !== u2.LOADING) break; var f2 = new r3.g.MSStreamReader(); f2.onprogress = function() { f2.result.byteLength > t4._pos && (t4.push(i2.from(new Uint8Array(f2.result.slice(t4._pos)))), t4._pos = f2.result.byteLength); }, f2.onload = function() { e4(true), t4.push(null); }, f2.readAsArrayBuffer(o3); } t4._xhr.readyState === u2.DONE && "ms-stream" !== t4._mode && (e4(true), t4.push(null)); }; }, 22028: (e3) => { e3.exports = function(e4) { return encodeURIComponent(e4).replace(/[!'()*]/g, function(e5) { return "%" + e5.charCodeAt(0).toString(16).toUpperCase(); }); }; }, 23462: (e3, t3, r3) => { var n2 = r3(48850).Buffer, i2 = n2.isEncoding || function(e4) { switch ((e4 = "" + e4) && e4.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 true; default: return false; } }; function o2(e4) { var t4; switch (this.encoding = function(e5) { var t5 = function(e6) { if (!e6) return "utf8"; for (var t6; ; ) switch (e6) { 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 e6; default: if (t6) return; e6 = ("" + e6).toLowerCase(), t6 = true; } }(e5); if ("string" != typeof t5 && (n2.isEncoding === i2 || !i2(e5))) throw new Error("Unknown encoding: " + e5); return t5 || e5; }(e4), this.encoding) { case "utf16le": this.text = u2, this.end = c2, t4 = 4; break; case "utf8": this.fillLast = s2, t4 = 4; break; case "base64": this.text = f2, this.end = d2, t4 = 3; break; default: return this.write = l2, void (this.end = h2); } this.lastNeed = 0, this.lastTotal = 0, this.lastChar = n2.allocUnsafe(t4); } function a2(e4) { return e4 <= 127 ? 0 : e4 >> 5 == 6 ? 2 : e4 >> 4 == 14 ? 3 : e4 >> 3 == 30 ? 4 : e4 >> 6 == 2 ? -1 : -2; } function s2(e4) { var t4 = this.lastTotal - this.lastNeed, r4 = function(e5, t5, r5) { if (128 != (192 & t5[0])) return e5.lastNeed = 0, "�"; if (e5.lastNeed > 1 && t5.length > 1) { if (128 != (192 & t5[1])) return e5.lastNeed = 1, "�"; if (e5.lastNeed > 2 && t5.length > 2 && 128 != (192 & t5[2])) return e5.lastNeed = 2, "�"; } }(this, e4); return void 0 !== r4 ? r4 : this.lastNeed <= e4.length ? (e4.copy(this.lastChar, t4, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (e4.copy(this.lastChar, t4, 0, e4.length), void (this.lastNeed -= e4.length)); } function u2(e4, t4) { if ((e4.length - t4) % 2 == 0) { var r4 = e4.toString("utf16le", t4); if (r4) { var n3 = r4.charCodeAt(r4.length - 1); if (n3 >= 55296 && n3 <= 56319) return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = e4[e4.length - 2], this.lastChar[1] = e4[e4.length - 1], r4.slice(0, -1); } return r4; } return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = e4[e4.length - 1], e4.toString("utf16le", t4, e4.length - 1); } function c2(e4) { var t4 = e4 && e4.length ? this.write(e4) : ""; if (this.lastNeed) { var r4 = this.lastTotal - this.lastNeed; return t4 + this.lastChar.toString("utf16le", 0, r4); } return t4; } function f2(e4, t4) { var r4 = (e4.length - t4) % 3; return 0 === r4 ? e4.toString("base64", t4) : (this.lastNeed = 3 - r4, this.lastTotal = 3, 1 === r4 ? this.lastChar[0] = e4[e4.length - 1] : (this.lastChar[0] = e4[e4.length - 2], this.lastChar[1] = e4[e4.length - 1]), e4.toString("base64", t4, e4.length - r4)); } function d2(e4) { var t4 = e4 && e4.length ? this.write(e4) : ""; return this.lastNeed ? t4 + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : t4; } function l2(e4) { return e4.toString(this.encoding); } function h2(e4) { return e4 && e4.length ? this.write(e4) : ""; } t3.s = o2, o2.prototype.write = function(e4) { if (0 === e4.length) return ""; var t4, r4; if (this.lastNeed) { if (void 0 === (t4 = this.fillLast(e4))) return ""; r4 = this.lastNeed, this.lastNeed = 0; } else r4 = 0; return r4 < e4.length ? t4 ? t4 + this.text(e4, r4) : this.text(e4, r4) : t4 || ""; }, o2.prototype.end = function(e4) { var t4 = e4 && e4.length ? this.write(e4) : ""; return this.lastNeed ? t4 + "�" : t4; }, o2.prototype.text = function(e4, t4) { var r4 = function(e5, t5, r5) { var n4 = t5.length - 1; if (n4 < r5) return 0; var i3 = a2(t5[n4]); return i3 >= 0 ? (i3 > 0 && (e5.lastNeed = i3 - 1), i3) : --n4 < r5 || -2 === i3 ? 0 : (i3 = a2(t5[n4])) >= 0 ? (i3 > 0 && (e5.lastNeed = i3 - 2), i3) : --n4 < r5 || -2 === i3 ? 0 : (i3 = a2(t5[n4])) >= 0 ? (i3 > 0 && (2 === i3 ? i3 = 0 : e5.lastNeed = i3 - 3), i3) : 0; }(this, e4, t4); if (!this.lastNeed) return e4.toString("utf8", t4); this.lastTotal = r4; var n3 = e4.length - (r4 - this.lastNeed); return e4.copy(this.lastChar, 0, n3), e4.toString("utf8", t4, n3); }, o2.prototype.fillLast = function(e4) { if (this.lastNeed <= e4.length) return e4.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal); e4.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, e4.length), this.lastNeed -= e4.length; }; }, 36931: (e3, t3, r3) => { var n2 = r3(8619); e3.exports = function(e4) { return "string" != typeof e4 ? e4 : n2(e4) ? e4.slice(2) : e4; }; }, 26427: (e3, t3, r3) => { var n2 = function() { throw "This swarm.js function isn't available on the browser."; }, i2 = { readFile: n2 }, o2 = { download: n2, safeDownloadArchived: n2, directoryTree: n2 }, a2 = { platform: n2, arch: n2 }, s2 = { join: n2, slice: n2 }, u2 = { spawn: n2 }, c2 = { lookup: n2 }, f2 = r3(31357), d2 = r3(40631), l2 = r3(42733), h2 = r3(52510), p2 = r3(13094); e3.exports = p2({ fs: i2, files: o2, os: a2, path: s2, child_process: u2, defaultArchives: {}, mimetype: c2, request: f2, downloadUrl: null, bytes: d2, hash: l2, pick: h2 }); }, 52510: (e3) => { var t3 = function(e4) { return function() { return new Promise(function(t4, r3) { var n2, i2 = function(r4) { var n3 = {}, i3 = r4.target.files.length, o3 = 0; [].map.call(r4.target.files, function(r5) { var a2 = new FileReader(); a2.onload = function(a3) { var s2 = new Uint8Array(a3.target.result); if ("directory" === e4) { var u2 = r5.webkitRelativePath; n3[u2.slice(u2.indexOf("/") + 1)] = { type: "text/plain", data: s2 }, ++o3 === i3 && t4(n3); } else if ("file" === e4) { var c2 = r5.webkitRelativePath; t4({ type: mimetype.lookup(c2), data: s2 }); } else t4(s2); }, a2.readAsArrayBuffer(r5); }); }; "directory" === e4 ? ((n2 = document.createElement("input")).addEventListener("change", i2), n2.type = "file", n2.webkitdirectory = true, n2.mozdirectory = true, n2.msdirectory = true, n2.odirectory = true, n2.directory = true) : ((n2 = document.createElement("input")).addEventListener("change", i2), n2.type = "file"); var o2 = document.createEvent("MouseEvents"); o2.initEvent("click", true, false), n2.dispatchEvent(o2); }); }; }; e3.exports = { data: t3("data"), file: t3("file"), directory: t3("directory") }; }, 42733: (e3, t3, r3) => { var n2 = r3(49574).keccak256, i2 = r3(40631), o2 = function(e4, t4) { var r4 = i2.reverse(i2.pad(6, i2.fromNumber(e4))), o3 = i2.flatten([r4, "0x0000", t4]); return n2(o3).slice(2); }; e3.exports = function e4(t4) { "string" == typeof t4 && "0x" !== t4.slice(0, 2) ? t4 = i2.fromString(t4) : "string" != typeof t4 && void 0 !== t4.length && (t4 = i2.fromUint8Array(t4)); var r4 = i2.length(t4); if (r4 <= 4096) return o2(r4, t4); for (var n3 = 4096; 128 * n3 < r4; ) n3 *= 128; for (var a2 = [], s2 = 0; s2 < r4; s2 += n3) { var u2 = n3 < r4 - s2 ? n3 : r4 - s2; a2.push(e4(i2.slice(t4, s2, s2 + u2))); } return o2(r4, i2.flatten(a2)); }; }, 13094: (e3) => { e3.exports = function(e4) { var t3 = e4.fs, r3 = e4.files, n2 = e4.os, i2 = e4.path, o2 = e4.child_process, a2 = e4.mimetype, s2 = e4.defaultArchives, u2 = e4.request, c2 = e4.downloadUrl, f2 = e4.bytes, d2 = e4.hash, l2 = e4.pick, h2 = function(e5) { return function(t4) { for (var r4 = {}, n3 = 0, i3 = e5.length; n3 < i3; ++n3) r4[e5[n3]] = t4[n3]; return r4; }; }, p2 = function(e5) { return function(t4) { return "".concat(e5, "/bzz-raw:/").concat(t4); }; }, b2 = function(e5) { return function(t4) { return new Promise(function(r4, n3) { u2(p2(e5)(t4), { responseType: "arraybuffer" }, function(e6, t5, i3) { return e6 ? n3(e6) : i3.statusCode >= 400 ? n3(new Error("Error ".concat(i3.statusCode, "."))) : r4(new Uint8Array(t5)); }); }); }; }, y2 = function(e5) { return function(t4) { return function t5(r4) { return function(n3) { return function(i3) { var o3 = function(e6) { return void 0 === e6.path ? Promise.resolve() : "application/bzz-manifest+json" === e6.contentType ? t5(e6.hash)(n3 + e6.path)(i3) : Promise.resolve((r5 = n3 + e6.path, function(e7) { return function(t6) { return t6[r5] = e7, t6; }; })(function(e7) { return { type: e7.contentType, hash: e7.hash }; }(e6))(i3)); var r5; }; return b2(e5)(r4).then(function(e6) { return JSON.parse(N2(e6)).entries; }).then(function(e6) { return Promise.all(e6.map(o3)); }).then(function() { return i3; }); }; }; }(t4)("")({}); }; }, v2 = function(e5) { return function(t4) { return y2(e5)(t4).then(function(e6) { return h2(Object.keys(e6))(Object.keys(e6).map(function(t5) { return e6[t5].hash; })); }); }; }, m2 = function(e5) { return function(t4) { return y2(e5)(t4).then(function(t5) { var r4 = Object.keys(t5), n3 = r4.map(function(e6) { return t5[e6].hash; }), i3 = r4.map(function(e6) { return t5[e6].type; }), o3 = n3.map(b2(e5)); return Promise.all(o3).then(function(e6) { return h2(r4)(function(e7) { return e7.map(function(e8, t6) { return { type: i3[t6], data: e8 }; }); }(e6)); }); }); }; }, g2 = function(e5) { return function(t4) { return function(n3) { return r3.download(p2(e5)(t4))(n3); }; }; }, w2 = function(e5) { return function(t4) { return function(r4) { return v2(e5)(t4).then(function(t5) { var n3 = []; for (var o3 in t5) if (o3.length > 0) { var a3 = i2.join(r4, o3); n3.push(g2(e5)(t5[o3])(a3)); } return Promise.all(n3).then(function() { return r4; }); }); }; }; }, k2 = function(e5) { return function(t4) { return new Promise(function(r4, n3) { var i3 = { body: "string" == typeof t4 ? j2(t4) : t4, method: "POST" }; u2("".concat(e5, "/bzz-raw:/"), i3, function(e6, t5) { return e6 ? n3(e6) : r4(t5); }); }); }; }, _2 = function(e5) { return function(t4) { return function(r4) { return function(n3) { return function i3(o3) { var a3 = "/" === r4[0] ? r4 : "/" + r4, s3 = "".concat(e5, "/bzz:/").concat(t4).concat(a3), c3 = { method: "PUT", headers: { "Content-Type": n3.type }, body: n3.data }; return new Promise(function(e6, t5) { u2(s3, c3, function(r5, n4) { return r5 ? t5(r5) : -1 !== n4.indexOf("error") ? t5(n4) : e6(n4); }); }).catch(function(e6) { return o3 > 0 && i3(o3 - 1); }); }(3); }; }; }; }, A2 = function(e5) { return function(t4) { return S2(e5)({ "": t4 }); }; }, E2 = function(e5) { return function(r4) { return t3.readFile(r4).then(function(t4) { return A2(e5)({ type: a2.lookup(r4), data: t4 }); }); }; }, S2 = function(e5) { return function(t4) { return k2(e5)("{}").then(function(r4) { return Object.keys(t4).reduce(function(r5, n3) { return r5.then(function(r6) { return function(n4) { return _2(e5)(n4)(r6)(t4[r6]); }; }(n3)); }, Promise.resolve(r4)); }); }; }, x2 = function(e5) { return function(r4) { return t3.readFile(r4).then(k2(e5)); }; }, B2 = function(e5) { return function(n3) { return function(i3) { return r3.directoryTree(i3).then(function(e6) { return Promise.all(e6.map(function(e7) { return t3.readFile(e7); })).then(function(t4) { var r4 = e6.map(function(e7) { return e7.slice(i3.length); }), n4 = e6.map(function(e7) { return a2.lookup(e7) || "text/plain"; }); return h2(r4)(t4.map(function(e7, t5) { return { type: n4[t5], data: e7 }; })); }); }).then(function(e6) { return (t4 = n3 ? { "": e6[n3] } : {}, function(e7) { var r4 = {}; for (var n4 in t4) r4[n4] = t4[n4]; for (var i4 in e7) r4[i4] = e7[i4]; return r4; })(e6); var t4; }).then(S2(e5)); }; }; }, O2 = function(e5) { return function(t4) { if ("data" === t4.pick) return l2.data().then(k2(e5)); if ("file" === t4.pick) return l2.file().then(A2(e5)); if ("directory" === t4.pick) return l2.directory().then(S2(e5)); if (t4.path) switch (t4.kind) { case "data": return x2(e5)(t4.path); case "file": return E2(e5)(t4.path); case "directory": return B2(e5)(t4.defaultFile)(t4.path); } else { if (t4.length || "string" == typeof t4) return k2(e5)(t4); if (t4 instanceof Object) return S2(e5)(t4); } return Promise.reject(new Error("Bad arguments")); }; }, P2 = function(e5) { return function(t4) { return function(r4) { return R2(e5)(t4).then(function(n3) { return n3 ? r4 ? w2(e5)(t4)(r4) : m2(e5)(t4) : r4 ? g2(e5)(t4)(r4) : b2(e5)(t4); }); }; }; }, I2 = function(e5, t4) { var i3 = n2.platform().replace("win32", "windows") + "-" + ("x64" === n2.arch() ? "amd64" : "386"), o3 = (t4 || s2)[i3], a3 = c2 + o3.archive + ".tar.gz", u3 = o3.archiveMD5, f3 = o3.binaryMD5; return r3.safeDownloadArchived(a3)(u3)(f3)(e5); }, T2 = function(e5) { return new Promise(function(t4, r4) { var n3 = o2.spawn, i3 = function(e6) { return function(t5) { return -1 !== ("" + t5).indexOf(e6); }; }, a3 = e5.account, s3 = e5.password, u3 = e5.dataDir, c3 = e5.ensApi, f3 = e5.privateKey, d3 = 0, l3 = n3(e5.binPath, ["--bzzaccount", a3 || f3, "--datadir", u3, "--ens-api", c3]), h3 = function(e6) { 0 === d3 && i3("Passphrase")(e6) ? setTimeout(function() { d3 = 1, l3.stdin.write(s3 + "\n"); }, 500) : i3("Swarm http proxy started")(e6) && (d3 = 2, clearTimeout(p3), t4(l3)); }; l3.stdout.on("data", h3), l3.stderr.on("data", h3); var p3 = setTimeout(function() { return r4(new Error("Couldn't start swarm process.")); }, 2e4); }); }, C2 = function(e5) { return new Promise(function(t4, r4) { e5.stderr.removeAllListeners("data"), e5.stdout.removeAllListeners("data"), e5.stdin.removeAllListeners("error"), e5.removeAllListeners("error"), e5.removeAllListeners("exit"), e5.kill("SIGINT"); var n3 = setTimeout(function() { return e5.kill("SIGKILL"); }, 8e3); e5.once("close", function() { clearTimeout(n3), t4(); }); }); }, M2 = function(e5) { return k2(e5)("test").then(function(e6) { return "c9a99c7d326dcc6316f32fe2625b311f6dc49a175e6877681ded93137d3569e7" === e6; }).catch(function() { return false; }); }, R2 = function(e5) { return function(t4) { return b2(e5)(t4).then(function(e6) { try { return !!JSON.parse(N2(e6)).entries; } catch (e7) { return false; } }); }; }, U2 = function(e5) { return function(t4, r4, n3, i3, o3) { var a3; return void 0 !== t4 && (a3 = e5(t4)), void 0 !== r4 && (a3 = e5(r4)), void 0 !== n3 && (a3 = e5(n3)), void 0 !== i3 && (a3 = e5(i3)), void 0 !== o3 && (a3 = e5(o3)), a3; }; }, N2 = function(e5) { return f2.toString(f2.fromUint8Array(e5)); }, j2 = function(e5) { return f2.toUint8Array(f2.fromString(e5)); }, L2 = function(e5) { return { download: function(t4, r4) { return P2(e5)(t4)(r4); }, downloadData: U2(b2(e5)), downloadDataToDisk: U2(g2(e5)), downloadDirectory: U2(m2(e5)), downloadDirectoryToDisk: U2(w2(e5)), downloadEntries: U2(y2(e5)), downloadRoutes: U2(v2(e5)), isAvailable: function() { return M2(e5); }, upload: function(t4) { return O2(e5)(t4); }, uploadData: U2(k2(e5)), uploadFile: U2(A2(e5)), uploadFileFromDisk: U2(A2(e5)), uploadDataFromDisk: U2(x2(e5)), uploadDirectory: U2(S2(e5)), uploadDirectoryFromDisk: U2(B2(e5)), uploadToManifest: U2(_2(e5)), pick: l2, hash: d2, fromString: j2, toString: N2 }; }; return { at: L2, local: function(e5) { return function(t4) { return M2("http://localhost:8500").then(function(r4) { return r4 ? t4(L2("http://localhost:8500")).then(function() { }) : I2(e5.binPath, e5.archives).onData(function(t5) { return (e5.onProgress || function() { })(t5.length); }).then(function() { return T2(e5); }).then(function(e6) { return t4(L2("http://localhost:8500")).then(function() { return e6; }); }).then(C2); }); }; }, download: P2, downloadBinary: I2, downloadData: b2, downloadDataToDisk: g2, downloadDirectory: m2, downloadDirectoryToDisk: w2, downloadEntries: y2, downloadRoutes: v2, isAvailable: M2, startProcess: T2, stopProcess: C2, upload: O2, uploadData: k2, uploadDataFromDisk: x2, uploadFile: A2, uploadFileFromDisk: E2, uploadDirectory: S2, uploadDirectoryFromDisk: B2, uploadToManifest: _2, pick: l2, hash: d2, fromString: j2, toString: N2 }; }; }, 16873: (e3) => { var t3 = function(e4, t4) { for (var r3 = [], n2 = 0; n2 < e4; ++n2) r3.push(t4(n2)); return r3; }; e3.exports = { generate: t3, replicate: function(e4, r3) { return t3(e4, function() { return r3; }); }, concat: function(e4, t4) { return e4.concat(t4); }, flatten: function(e4) { for (var t4 = [], r3 = 0, n2 = e4.length; r3 < n2; ++r3) for (var i2 = 0, o2 = e4[r3].length; i2 < o2; ++i2) t4.push(e4[r3][i2]); return t4; }, chunksOf: function(e4, t4) { for (var r3 = [], n2 = 0, i2 = t4.length; n2 < i2; n2 += e4) r3.push(t4.slice(n2, n2 + e4)); return r3; } }; }, 40631: (e3, t3, r3) => { r3(16873); var n2 = function(e4, t4) { return parseInt(e4.slice(2 * t4 + 2, 2 * t4 + 4), 16); }, i2 = function(e4) { return (e4.length - 2) / 2; }, o2 = function(e4) { for (var t4 = [], r4 = 2, n3 = e4.length; r4 < n3; r4 += 2) t4.push(parseInt(e4.slice(r4, r4 + 2), 16)); return t4; }, a2 = function(e4) { for (var t4 = "0x", r4 = 0, n3 = e4.length; r4 < n3; ++r4) { var i3 = e4[r4]; t4 += (i3 < 16 ? "0" : "") + i3.toString(16); } return t4; }; e3.exports = { random: function(e4) { var t4 = void 0; t4 = "undefined" != typeof window && window.crypto && window.crypto.getRandomValues ? window.crypto.getRandomValues(new Uint8Array(e4)) : r3(24293).randomBytes(e4); for (var n3 = "0x", i3 = 0; i3 < e4; ++i3) n3 += ("00" + t4[i3].toString(16)).slice(-2); return n3; }, length: i2, concat: function(e4, t4) { return e4.concat(t4.slice(2)); }, flatten: function(e4) { return "0x" + e4.reduce(function(e5, t4) { return e5 + t4.slice(2); }, ""); }, slice: function(e4, t4, r4) { return "0x" + r4.slice(2 * e4 + 2, 2 * t4 + 2); }, reverse: function(e4) { for (var t4 = "0x", r4 = 0, n3 = i2(e4); r4 < n3; ++r4) t4 += e4.slice(2 * (n3 - r4), 2 * (n3 - r4 + 1)); return t4; }, pad: function e4(t4, r4) { return r4.length === 2 * t4 + 2 ? r4 : e4(t4, "0x0" + r4.slice(2)); }, padRight: function e4(t4, r4) { return r4.length === 2 * t4 + 2 ? r4 : e4(t4, r4 + "0"); }, fromAscii: function(e4) { for (var t4 = "0x", r4 = 0; r4 < e4.length; ++r4) t4 += ("00" + e4.charCodeAt(r4).toString(16)).slice(-2); return t4; }, toAscii: function(e4) { for (var t4 = "", r4 = 2; r4 < e4.length; r4 += 2) t4 += String.fromCharCode(parseInt(e4.slice(r4, r4 + 2), 16)); return t4; }, fromString: function(e4) { for (var t4 = function(e5) { var t5 = e5.toString(16); return t5.length < 2 ? "0" + t5 : t5; }, r4 = "0x", n3 = 0; n3 != e4.length; n3++) { var i3 = e4.charCodeAt(n3); if (i3 < 128) r4 += t4(i3); else { if (i3 < 2048) r4 += t4(i3 >> 6 | 192); else { if (i3 > 55295 && i3 < 56320) { if (++n3 == e4.length) return null; var o3 = e4.charCodeAt(n3); if (o3 < 56320 || o3 > 57343) return null; r4 += t4((i3 = 65536 + ((1023 & i3) << 10) + (1023 & o3)) >> 18 | 240), r4 += t4(i3 >> 12 & 63 | 128); } else r4 += t4(i3 >> 12 | 224); r4 += t4(i3 >> 6 & 63 | 128); } r4 += t4(63 & i3 | 128); } } return r4; }, toString: function(e4) { for (var t4 = "", r4 = 0, o3 = i2(e4); r4 < o3; ) { var a3 = n2(e4, r4++); if (a3 > 127) { if (a3 > 191 && a3 < 224) { if (r4 >= o3) return null; a3 = (31 & a3) << 6 | 63 & n2(e4, r4); } else if (a3 > 223 && a3 < 240) { if (r4 + 1 >= o3) return null; a3 = (15 & a3) << 12 | (63 & n2(e4, r4)) << 6 | 63 & n2(e4, ++r4); } else { if (!(a3 > 239 && a3 < 248)) return null; if (r4 + 2 >= o3) return null; a3 = (7 & a3) << 18 | (63 & n2(e4, r4)) << 12 | (63 & n2(e4, ++r4)) << 6 | 63 & n2(e4, ++r4); } ++r4; } if (a3 <= 65535) t4 += String.fromCharCode(a3); else { if (!(a3 <= 1114111)) return null; a3 -= 65536, t4 += String.fromCharCode(a3 >> 10 | 55296), t4 += String.fromCharCode(1023 & a3 | 56320); } } return t4; }, fromNumber: function(e4) { var t4 = e4.toString(16); return t4.length % 2 == 0 ? "0x" + t4 : "0x0" + t4; }, toNumber: function(e4) { return parseInt(e4.slice(2), 16); }, fromNat: function(e4) { return "0x0" === e4 ? "0x" : e4.length % 2 == 0 ? e4 : "0x0" + e4.slice(2); }, toNat: function(e4) { return "0" === e4[2] ? "0x" + e4.slice(3) : e4; }, fromArray: a2, toArray: o2, fromUint8Array: function(e4) { return a2([].slice.call(e4, 0)); }, toUint8Array: function(e4) { return new Uint8Array(o2(e4)); } }; }, 49574: (e3) => { var t3 = "0123456789abcdef".split(""), r3 = [1, 256, 65536, 16777216], n2 = [0, 8, 16, 24], i2 = [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], o2 = function(e4) { var t4, r4, n3, o3, a3, s2, u2, c2, f2, d2, l2, h2, p2, b2, y2, v2, m2, g2, w2, k2, _2, A2, E2, S2, x2, B2, O2, P2, I2, T2, C2, M2, R2, U2, N2, j2, L2, F2, D2, H2, z2, q2, K2, G2, V2, Z2, W2, J2, Y2, X2, Q2, $2, ee2, te2, re2, ne2, ie2, oe2, ae2, se2, ue2, ce2, fe2; for (n3 = 0; n3 < 48; n3 += 2) o3 = e4[0] ^ e4[10] ^ e4[20] ^ e4[30] ^ e4[40], a3 = e4[1] ^ e4[11] ^ e4[21] ^ e4[31] ^ e4[41], s2 = e4[2] ^ e4[12] ^ e4[22] ^ e4[32] ^ e4[42], u2 = e4[3] ^ e4[13] ^ e4[23] ^ e4[33] ^ e4[43], c2 = e4[4] ^ e4[14] ^ e4[24] ^ e4[34] ^ e4[44], f2 = e4[5] ^ e4[15] ^ e4[25] ^ e4[35] ^ e4[45], d2 = e4[6] ^ e4[16] ^ e4[26] ^ e4[36] ^ e4[46], l2 = e4[7] ^ e4[17] ^ e4[27] ^ e4[37] ^ e4[47], t4 = (h2 = e4[8] ^ e4[18] ^ e4[28] ^ e4[38] ^ e4[48]) ^ (s2 << 1 | u2 >>> 31), r4 = (p2 = e4[9] ^ e4[19] ^ e4[29] ^ e4[39] ^ e4[49]) ^ (u2 << 1 | s2 >>> 31), e4[0] ^= t4, e4[1] ^= r4, e4[10] ^= t4, e4[11] ^= r4, e4[20] ^= t4, e4[21] ^= r4, e4[30] ^= t4, e4[31] ^= r4, e4[40] ^= t4, e4[41] ^= r4, t4 = o3 ^ (c2 << 1 | f2 >>> 31), r4 = a3 ^ (f2 << 1 | c2 >>> 31), e4[2] ^= t4, e4[3] ^= r4, e4[12] ^= t4, e4[13] ^= r4, e4[22] ^= t4, e4[23] ^= r4, e4[32] ^= t4, e4[33] ^= r4, e4[42] ^= t4, e4[43] ^= r4, t4 = s2 ^ (d2 << 1 | l2 >>> 31), r4 = u2 ^ (l2 << 1 | d2 >>> 31), e4[4] ^= t4, e4[5] ^= r4, e4[14] ^= t4, e4[15] ^= r4, e4[24] ^= t4, e4[25] ^= r4, e4[34] ^= t4, e4[35] ^= r4, e4[44] ^= t4, e4[45] ^= r4, t4 = c2 ^ (h2 << 1 | p2 >>> 31), r4 = f2 ^ (p2 << 1 | h2 >>> 31), e4[6] ^= t4, e4[7] ^= r4, e4[16] ^= t4, e4[17] ^= r4, e4[26] ^= t4, e4[27] ^= r4, e4[36] ^= t4, e4[37] ^= r4, e4[46] ^= t4, e4[47] ^= r4, t4 = d2 ^ (o3 << 1 | a3 >>> 31), r4 = l2 ^ (a3 << 1 | o3 >>> 31), e4[8] ^= t4, e4[9] ^= r4, e4[18] ^= t4, e4[19] ^= r4, e4[28] ^= t4, e4[29] ^= r4, e4[38] ^= t4, e4[39] ^= r4, e4[48] ^= t4, e4[49] ^= r4, b2 = e4[0], y2 = e4[1], Z2 = e4[11] << 4 | e4[10] >>> 28, W2 = e4[10] << 4 | e4[11] >>> 28, P2 = e4[20] << 3 | e4[21] >>> 29, I2 = e4[21] << 3 | e4[20] >>> 29, se2 = e4[31] << 9 | e4[30] >>> 23, ue2 = e4[30] << 9 | e4[31] >>> 23, q2 = e4[40] << 18 | e4[41] >>> 14, K2 = e4[41] << 18 | e4[40] >>> 14, U2 = e4[2] << 1 | e4[3] >>> 31, N2 = e4[3] << 1 | e4[2] >>> 31, v2 = e4[13] << 12 | e4[12] >>> 20, m2 = e4[12] << 12 | e4[13] >>> 20, J2 = e4[22] << 10 | e4[23] >>> 22, Y2 = e4[23] << 10 | e4[22] >>> 22, T2 = e4[33] << 13 | e4[32] >>> 19, C2 = e4[32] << 13 | e4[33] >>> 19, ce2 = e4[42] << 2 | e4[43] >>> 30, fe2 = e4[43] << 2 | e4[42] >>> 30, te2 = e4[5] << 30 | e4[4] >>> 2, re2 = e4[4] << 30 | e4[5] >>> 2, j2 = e4[14] << 6 | e4[15] >>> 26, L2 = e4[15] << 6 | e4[14] >>> 26, g2 = e4[25] << 11 | e4[24] >>> 21, w2 = e4[24] << 11 | e4[25] >>> 21, X2 = e4[34] << 15 | e4[35] >>> 17, Q2 = e4[35] << 15 | e4[34] >>> 17, M2 = e4[45] << 29 | e4[44] >>> 3, R2 = e4[44] << 29 | e4[45] >>> 3, S2 = e4[6] << 28 | e4[7] >>> 4, x2 = e4[7] << 28 | e4[6] >>> 4, ne2 = e4[17] << 23 | e4[16] >>> 9, ie2 = e4[16] << 23 | e4[17] >>> 9, F2 = e4[26] << 25 | e4[27] >>> 7, D2 = e4[27] << 25 | e4[26] >>> 7, k2 = e4[36] << 21 | e4[37] >>> 11, _2 = e4[37] << 21 | e4[36] >>> 11, $2 = e4[47] << 24 | e4[46] >>> 8, ee2 = e4[46] << 24 | e4[47] >>> 8, G2 = e4[8] << 27 | e4[9] >>> 5, V2 = e4[9] << 27 | e4[8] >>> 5, B2 = e4[18] << 20 | e4[19] >>> 12, O2 = e4[19] << 20 | e4[18] >>> 12, oe2 = e4[29] << 7 | e4[28] >>> 25, ae2 = e4[28] << 7 | e4[29] >>> 25, H2 = e4[38] << 8 | e4[39] >>> 24, z2 = e4[39] << 8 | e4[38] >>> 24, A2 = e4[48] << 14 | e4[49] >>> 18, E2 = e4[49] << 14 | e4[48] >>> 18, e4[0] = b2 ^ ~v2 & g2, e4[1] = y2 ^ ~m2 & w2, e4[10] = S2 ^ ~B2 & P2, e4[11] = x2 ^ ~O2 & I2, e4[20] = U2 ^ ~j2 & F2, e4[21] = N2 ^ ~L2 & D2, e4[30] = G2 ^ ~Z2 & J2, e4[31] = V2 ^ ~W2 & Y2, e4[40] = te2 ^ ~ne2 & oe2, e4[41] = re2 ^ ~ie2 & ae2, e4[2] = v2 ^ ~g2 & k2, e4[3] = m2 ^ ~w2 & _2, e4[12] = B2 ^ ~P2 & T2, e4[13] = O2 ^ ~I2 & C2, e4[22] = j2 ^ ~F2 & H2, e4[23] = L2 ^ ~D2 & z2, e4[32] = Z2 ^ ~J2 & X2, e4[33] = W2 ^ ~Y2 & Q2, e4[42] = ne2 ^ ~oe2 & se2, e4[43] = ie2 ^ ~ae2 & ue2, e4[4] = g2 ^ ~k2 & A2, e4[5] = w2 ^ ~_2 & E2, e4[14] = P2 ^ ~T2 & M2, e4[15] = I2 ^ ~C2 & R2, e4[24] = F2 ^ ~H2 & q2, e4[25] = D2 ^ ~z2 & K2, e4[34] = J2 ^ ~X2 & $2, e4[35] = Y2 ^ ~Q2 & ee2, e4[44] = oe2 ^ ~se2 & ce2, e4[45] = ae2 ^ ~ue2 & fe2, e4[6] = k2 ^ ~A2 & b2, e4[7] = _2 ^ ~E2 & y2, e4[16] = T2 ^ ~M2 & S2, e4[17] = C2 ^ ~R2 & x2, e4[26] = H2 ^ ~q2 & U2, e4[27] = z2 ^ ~K2 & N2, e4[36] = X2 ^ ~$2 & G2, e4[37] = Q2 ^ ~ee2 & V2, e4[46] = se2 ^ ~ce2 & te2, e4[47] = ue2 ^ ~fe2 & re2, e4[8] = A2 ^ ~b2 & v2, e4[9] = E2 ^ ~y2 & m2, e4[18] = M2 ^ ~S2 & B2, e4[19] = R2 ^ ~x2 & O2, e4[28] = q2 ^ ~U2 & j2, e4[29] = K2 ^ ~N2 & L2, e4[38] = $2 ^ ~G2 & Z2, e4[39] = ee2 ^ ~V2 & W2, e4[48] = ce2 ^ ~te2 & ne2, e4[49] = fe2 ^ ~re2 & ie2, e4[0] ^= i2[n3], e4[1] ^= i2[n3 + 1]; }, a2 = function(e4) { return function(i3) { var a3; if ("0x" === i3.slice(0, 2)) { a3 = []; for (var s2 = 2, u2 = i3.length; s2 < u2; s2 += 2) a3.push(parseInt(i3.slice(s2, s2 + 2), 16)); } else a3 = i3; return function(e5, i4) { for (var a4, s3 = i4.length, u3 = e5.blocks, c2 = e5.blockCount << 2, f2 = e5.blockCount, d2 = e5.outputBlocks, l2 = e5.s, h2 = 0; h2 < s3; ) { if (e5.reset) for (e5.reset = false, u3[0] = e5.block, y2 = 1; y2 < f2 + 1; ++y2) u3[y2] = 0; if ("string" != typeof i4) for (y2 = e5.start; h2 < s3 && y2 < c2; ++h2) u3[y2 >> 2] |= i4[h2] << n2[3 & y2++]; else for (y2 = e5.start; h2 < s3 && y2 < c2; ++h2) (a4 = i4.charCodeAt(h2)) < 128 ? u3[y2 >> 2] |= a4 << n2[3 & y2++] : a4 < 2048 ? (u3[y2 >> 2] |= (192 | a4 >> 6) << n2[3 & y2++], u3[y2 >> 2] |= (128 | 63 & a4) << n2[3 & y2++]) : a4 < 55296 || a4 >= 57344 ? (u3[y2 >> 2] |= (224 | a4 >> 12) << n2[3 & y2++], u3[y2 >> 2] |= (128 | a4 >> 6 & 63) << n2[3 & y2++], u3[y2 >> 2] |= (128 | 63 & a4) << n2[3 & y2++]) : (a4 = 65536 + ((1023 & a4) << 10 | 1023 & i4.charCodeAt(++h2)), u3[y2 >> 2] |= (240 | a4 >> 18) << n2[3 & y2++], u3[y2 >> 2] |= (128 | a4 >> 12 & 63) << n2[3 & y2++], u3[y2 >> 2] |= (128 | a4 >> 6 & 63) << n2[3 & y2++], u3[y2 >> 2] |= (128 | 63 & a4) << n2[3 & y2++]); if (e5.lastByteIndex = y2, y2 >= c2) { for (e5.start = y2 - c2, e5.block = u3[f2], y2 = 0; y2 < f2; ++y2) l2[y2] ^= u3[y2]; o2(l2), e5.reset = true; } else e5.start = y2; } if (u3[(y2 = e5.lastByteIndex) >> 2] |= r3[3 & y2], e5.lastByteIndex === c2) for (u3[0] = u3[f2], y2 = 1; y2 < f2 + 1; ++y2) u3[y2] = 0; for (u3[f2 - 1] |= 2147483648, y2 = 0; y2 < f2; ++y2) l2[y2] ^= u3[y2]; o2(l2); for (var p2, b2 = "", y2 = 0, v2 = 0; v2 < d2; ) { for (y2 = 0; y2 < f2 && v2 < d2; ++y2, ++v2) p2 = l2[y2], b2 += t3[p2 >> 4 & 15] + t3[15 & p2] + t3[p2 >> 12 & 15] + t3[p2 >> 8 & 15] + t3[p2 >> 20 & 15] + t3[p2 >> 16 & 15] + t3[p2 >> 28 & 15] + t3[p2 >> 24 & 15]; v2 % f2 == 0 && (o2(l2), y2 = 0); } return "0x" + b2; }(function(e5) { return { blocks: [], reset: true, block: 0, start: 0, blockCount: 1600 - (e5 << 1) >> 5, outputBlocks: e5 >> 5, s: (t4 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [].concat(t4, t4, t4, t4, t4)) }; var t4; }(e4), a3); }; }; e3.exports = { keccak256: a2(256), keccak512: a2(512), keccak256s: a2(256), keccak512s: a2(512) }; }, 68419: (e3) => { e3.exports = function(e4, t3) { if (t3) { t3 = (t3 = t3.trim().replace(/^(\?|#|&)/, "")) ? "?" + t3 : t3; var r3 = e4.split(/[\?\#]/)[0]; t3 && /\:\/\/[^\/]*$/.test(r3) && (r3 += "/"); var n2 = e4.match(/(\#.*)$/); e4 = r3 + t3, n2 && (e4 += n2[0]); } return e4; }; }, 78677: (e3, t3, r3) => { var n2; e3 = r3.nmd(e3); var i2 = r3(28847)(r3(3355)); !function(o2) { var a2 = "object" == (0, i2.default)(t3) && t3 && !t3.nodeType && t3, s2 = "object" == (0, i2.default)(e3) && e3 && !e3.nodeType && e3, u2 = "object" == (void 0 === r3.g ? "undefined" : (0, i2.default)(r3.g)) && r3.g; u2.global !== u2 && u2.window !== u2 && u2.self !== u2 || (o2 = u2); var c2, f2, d2 = 2147483647, l2 = 36, h2 = 1, p2 = 26, b2 = 38, y2 = 700, v2 = 72, m2 = 128, g2 = "-", w2 = /^xn--/, k2 = /[^\x20-\x7E]/, _2 = /[\x2E\u3002\uFF0E\uFF61]/g, A2 = { overflow: "Overflow: input needs wider integers to process", "not-basic": "Illegal input >= 0x80 (not a basic code point)", "invalid-input": "Invalid input" }, E2 = l2 - h2, S2 = Math.floor, x2 = String.fromCharCode; function B2(e4) { throw RangeError(A2[e4]); } function O2(e4, t4) { for (var r4 = e4.length, n3 = []; r4--; ) n3[r4] = t4(e4[r4]); return n3; } function P2(e4, t4) { var r4 = e4.split("@"), n3 = ""; return r4.length > 1 && (n3 = r4[0] + "@", e4 = r4[1]), n3 + O2((e4 = e4.replace(_2, ".")).split("."), t4).join("."); } function I2(e4) { for (var t4, r4, n3 = [], i3 = 0, o3 = e4.length; i3 < o3; ) (t4 = e4.charCodeAt(i3++)) >= 55296 && t4 <= 56319 && i3 < o3 ? 56320 == (64512 & (r4 = e4.charCodeAt(i3++))) ? n3.push(((1023 & t4) << 10) + (1023 & r4) + 65536) : (n3.push(t4), i3--) : n3.push(t4); return n3; } function T2(e4) { return O2(e4, function(e5) { var t4 = ""; return e5 > 65535 && (t4 += x2((e5 -= 65536) >>> 10 & 1023 | 55296), e5 = 56320 | 1023 & e5), t4 + x2(e5); }).join(""); } function C2(e4, t4) { return e4 + 22 + 75 * (e4 < 26) - ((0 != t4) << 5); } function M2(e4, t4, r4) { var n3 = 0; for (e4 = r4 ? S2(e4 / y2) : e4 >> 1, e4 += S2(e4 / t4); e4 > E2 * p2 >> 1; n3 += l2) e4 = S2(e4 / E2); return S2(n3 + (E2 + 1) * e4 / (e4 + b2)); } function R2(e4) { var t4, r4, n3, i3, o3, a3, s3, u3, c3, f3, b3, y3 = [], w3 = e4.length, k3 = 0, _3 = m2, A3 = v2; for ((r4 = e4.lastIndexOf(g2)) < 0 && (r4 = 0), n3 = 0; n3 < r4; ++n3) e4.charCodeAt(n3) >= 128 && B2("not-basic"), y3.push(e4.charCodeAt(n3)); for (i3 = r4 > 0 ? r4 + 1 : 0; i3 < w3; ) { for (o3 = k3, a3 = 1, s3 = l2; i3 >= w3 && B2("invalid-input"), ((u3 = (b3 = e4.charCodeAt(i3++)) - 48 < 10 ? b3 - 22 : b3 - 65 < 26 ? b3 - 65 : b3 - 97 < 26 ? b3 - 97 : l2) >= l2 || u3 > S2((d2 - k3) / a3)) && B2("overflow"), k3 += u3 * a3, !(u3 < (c3 = s3 <= A3 ? h2 : s3 >= A3 + p2 ? p2 : s3 - A3)); s3 += l2) a3 > S2(d2 / (f3 = l2 - c3)) && B2("overflow"), a3 *= f3; A3 = M2(k3 - o3, t4 = y3.length + 1, 0 == o3), S2(k3 / t4) > d2 - _3 && B2("overflow"), _3 += S2(k3 / t4), k3 %= t4, y3.splice(k3++, 0, _3); } return T2(y3); } function U2(e4) { var t4, r4, n3, i3, o3, a3, s3, u3, c3, f3, b3, y3, w3, k3, _3, A3 = []; for (y3 = (e4 = I2(e4)).length, t4 = m2, r4 = 0, o3 = v2, a3 = 0; a3 < y3; ++a3) (b3 = e4[a3]) < 128 && A3.push(x2(b3)); for (n3 = i3 = A3.length, i3 && A3.push(g2); n3 < y3; ) { for (s3 = d2, a3 = 0; a3 < y3; ++a3) (b3 = e4[a3]) >= t4 && b3 < s3 && (s3 = b3); for (s3 - t4 > S2((d2 - r4) / (w3 = n3 + 1)) && B2("overflow"), r4 += (s3 - t4) * w3, t4 = s3, a3 = 0; a3 < y3; ++a3) if ((b3 = e4[a3]) < t4 && ++r4 > d2 && B2("overflow"), b3 == t4) { for (u3 = r4, c3 = l2; !(u3 < (f3 = c3 <= o3 ? h2 : c3 >= o3 + p2 ? p2 : c3 - o3)); c3 += l2) _3 = u3 - f3, k3 = l2 - f3, A3.push(x2(C2(f3 + _3 % k3, 0))), u3 = S2(_3 / k3); A3.push(x2(C2(u3, 0))), o3 = M2(r4, w3, n3 == i3), r4 = 0, ++n3; } ++r4, ++t4; } return A3.join(""); } if (c2 = { version: "1.3.2", ucs2: { decode: I2, encode: T2 }, decode: R2, encode: U2, toASCII: function(e4) { return P2(e4, function(e5) { return k2.test(e5) ? "xn--" + U2(e5) : e5; }); }, toUnicode: function(e4) { return P2(e4, function(e5) { return w2.test(e5) ? R2(e5.slice(4).toLowerCase()) : e5; }); } }, "object" == (0, i2.default)(r3.amdO) && r3.amdO) void 0 === (n2 = (function() { return c2; }).call(t3, r3, t3, e3)) || (e3.exports = n2); else if (a2 && s2) if (e3.exports == a2) s2.exports = c2; else for (f2 in c2) c2.hasOwnProperty(f2) && (a2[f2] = c2[f2]); else o2.punycode = c2; }(void 0); }, 98983: (e3) => { function t3(e4, t4) { return Object.prototype.hasOwnProperty.call(e4, t4); } e3.exports = function(e4, r3, n2, i2) { r3 = r3 || "&", n2 = n2 || "="; var o2 = {}; if ("string" != typeof e4 || 0 === e4.length) return o2; var a2 = /\+/g; e4 = e4.split(r3); var s2 = 1e3; i2 && "number" == typeof i2.maxKeys && (s2 = i2.maxKeys); var u2 = e4.length; s2 > 0 && u2 > s2 && (u2 = s2); for (var c2 = 0; c2 < u2; ++c2) { var f2, d2, l2, h2, p2 = e4[c2].replace(a2, "%20"), b2 = p2.indexOf(n2); b2 >= 0 ? (f2 = p2.substr(0, b2), d2 = p2.substr(b2 + 1)) : (f2 = p2, d2 = ""), l2 = decodeURIComponent(f2), h2 = decodeURIComponent(d2), t3(o2, l2) ? Array.isArray(o2[l2]) ? o2[l2].push(h2) : o2[l2] = [o2[l2], h2] : o2[l2] = h2; } return o2; }; }, 84031: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = function(e4) { switch ((0, n2.default)(e4)) { case "string": return e4; case "boolean": return e4 ? "true" : "false"; case "number": return isFinite(e4) ? e4 : ""; default: return ""; } }; e3.exports = function(e4, t4, r4, o2) { return t4 = t4 || "&", r4 = r4 || "=", null === e4 && (e4 = void 0), "object" === (0, n2.default)(e4) ? Object.keys(e4).map(function(n3) { var o3 = encodeURIComponent(i2(n3)) + r4; return Array.isArray(e4[n3]) ? e4[n3].map(function(e5) { return o3 + encodeURIComponent(i2(e5)); }).join(t4) : o3 + encodeURIComponent(i2(e4[n3])); }).join(t4) : o2 ? encodeURIComponent(i2(o2)) + r4 + encodeURIComponent(i2(e4)) : ""; }; }, 845: (e3, t3, r3) => { t3.decode = t3.parse = r3(98983), t3.encode = t3.stringify = r3(84031); }, 51143: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(78677), o2 = r3(95751); function a2() { this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null; } t3.parse = w2, t3.resolve = function(e4, t4) { return w2(e4, false, true).resolve(t4); }, t3.resolveObject = function(e4, t4) { return e4 ? w2(e4, false, true).resolveObject(t4) : t4; }, t3.format = function(e4) { return o2.isString(e4) && (e4 = w2(e4)), e4 instanceof a2 ? e4.format() : a2.prototype.format.call(e4); }, t3.Url = a2; var s2 = /^([a-z0-9.+-]+:)/i, u2 = /:[0-9]*$/, c2 = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, f2 = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", " "]), d2 = ["'"].concat(f2), l2 = ["%", "/", "?", ";", "#"].concat(d2), h2 = ["/", "?", "#"], p2 = /^[+a-z0-9A-Z_-]{0,63}$/, b2 = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, y2 = { javascript: true, "javascript:": true }, v2 = { javascript: true, "javascript:": true }, m2 = { http: true, https: true, ftp: true, gopher: true, file: true, "http:": true, "https:": true, "ftp:": true, "gopher:": true, "file:": true }, g2 = r3(845); function w2(e4, t4, r4) { if (e4 && o2.isObject(e4) && e4 instanceof a2) return e4; var n3 = new a2(); return n3.parse(e4, t4, r4), n3; } a2.prototype.parse = function(e4, t4, r4) { if (!o2.isString(e4)) throw new TypeError("Parameter 'url' must be a string, not " + (0, n2.default)(e4)); var a3 = e4.indexOf("?"), u3 = -1 !== a3 && a3 < e4.indexOf("#") ? "?" : "#", f3 = e4.split(u3); f3[0] = f3[0].replace(/\\/g, "/"); var w3 = e4 = f3.join(u3); if (w3 = w3.trim(), !r4 && 1 === e4.split("#").length) { var k2 = c2.exec(w3); if (k2) return this.path = w3, this.href = w3, this.pathname = k2[1], k2[2] ? (this.search = k2[2], this.query = t4 ? g2.parse(this.search.substr(1)) : this.search.substr(1)) : t4 && (this.search = "", this.query = {}), this; } var _2 = s2.exec(w3); if (_2) { var A2 = (_2 = _2[0]).toLowerCase(); this.protocol = A2, w3 = w3.substr(_2.length); } if (r4 || _2 || w3.match(/^\/\/[^@\/]+@[^@\/]+/)) { var E2 = "//" === w3.substr(0, 2); !E2 || _2 && v2[_2] || (w3 = w3.substr(2), this.slashes = true); } if (!v2[_2] && (E2 || _2 && !m2[_2])) { for (var S2, x2, B2 = -1, O2 = 0; O2 < h2.length; O2++) -1 !== (P2 = w3.indexOf(h2[O2])) && (-1 === B2 || P2 < B2) && (B2 = P2); for (-1 !== (x2 = -1 === B2 ? w3.lastIndexOf("@") : w3.lastIndexOf("@", B2)) && (S2 = w3.slice(0, x2), w3 = w3.slice(x2 + 1), this.auth = decodeURIComponent(S2)), B2 = -1, O2 = 0; O2 < l2.length; O2++) { var P2; -1 !== (P2 = w3.indexOf(l2[O2])) && (-1 === B2 || P2 < B2) && (B2 = P2); } -1 === B2 && (B2 = w3.length), this.host = w3.slice(0, B2), w3 = w3.slice(B2), this.parseHost(), this.hostname = this.hostname || ""; var I2 = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1]; if (!I2) for (var T2 = this.hostname.split(/\./), C2 = (O2 = 0, T2.length); O2 < C2; O2++) { var M2 = T2[O2]; if (M2 && !M2.match(p2)) { for (var R2 = "", U2 = 0, N2 = M2.length; U2 < N2; U2++) M2.charCodeAt(U2) > 127 ? R2 += "x" : R2 += M2[U2]; if (!R2.match(p2)) { var j2 = T2.slice(0, O2), L2 = T2.slice(O2 + 1), F2 = M2.match(b2); F2 && (j2.push(F2[1]), L2.unshift(F2[2])), L2.length && (w3 = "/" + L2.join(".") + w3), this.hostname = j2.join("."); break; } } } this.hostname.length > 255 ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), I2 || (this.hostname = i2.toASCII(this.hostname)); var D2 = this.port ? ":" + this.port : "", H2 = this.hostname || ""; this.host = H2 + D2, this.href += this.host, I2 && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), "/" !== w3[0] && (w3 = "/" + w3)); } if (!y2[A2]) for (O2 = 0, C2 = d2.length; O2 < C2; O2++) { var z2 = d2[O2]; if (-1 !== w3.indexOf(z2)) { var q2 = encodeURIComponent(z2); q2 === z2 && (q2 = escape(z2)), w3 = w3.split(z2).join(q2); } } var K2 = w3.indexOf("#"); -1 !== K2 && (this.hash = w3.substr(K2), w3 = w3.slice(0, K2)); var G2 = w3.indexOf("?"); if (-1 !== G2 ? (this.search = w3.substr(G2), this.query = w3.substr(G2 + 1), t4 && (this.query = g2.parse(this.query)), w3 = w3.slice(0, G2)) : t4 && (this.search = "", this.query = {}), w3 && (this.pathname = w3), m2[A2] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) { D2 = this.pathname || ""; var V2 = this.search || ""; this.path = D2 + V2; } return this.href = this.format(), this; }, a2.prototype.format = function() { var e4 = this.auth || ""; e4 && (e4 = (e4 = encodeURIComponent(e4)).replace(/%3A/i, ":"), e4 += "@"); var t4 = this.protocol || "", r4 = this.pathname || "", n3 = this.hash || "", i3 = false, a3 = ""; this.host ? i3 = e4 + this.host : this.hostname && (i3 = e4 + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"), this.port && (i3 += ":" + this.port)), this.query && o2.isObject(this.query) && Object.keys(this.query).length && (a3 = g2.stringify(this.query)); var s3 = this.search || a3 && "?" + a3 || ""; return t4 && ":" !== t4.substr(-1) && (t4 += ":"), this.slashes || (!t4 || m2[t4]) && false !== i3 ? (i3 = "//" + (i3 || ""), r4 && "/" !== r4.charAt(0) && (r4 = "/" + r4)) : i3 || (i3 = ""), n3 && "#" !== n3.charAt(0) && (n3 = "#" + n3), s3 && "?" !== s3.charAt(0) && (s3 = "?" + s3), t4 + i3 + (r4 = r4.replace(/[?#]/g, function(e5) { return encodeURIComponent(e5); })) + (s3 = s3.replace("#", "%23")) + n3; }, a2.prototype.resolve = function(e4) { return this.resolveObject(w2(e4, false, true)).format(); }, a2.prototype.resolveObject = function(e4) { if (o2.isString(e4)) { var t4 = new a2(); t4.parse(e4, false, true), e4 = t4; } for (var r4 = new a2(), n3 = Object.keys(this), i3 = 0; i3 < n3.length; i3++) { var s3 = n3[i3]; r4[s3] = this[s3]; } if (r4.hash = e4.hash, "" === e4.href) return r4.href = r4.format(), r4; if (e4.slashes && !e4.protocol) { for (var u3 = Object.keys(e4), c3 = 0; c3 < u3.length; c3++) { var f3 = u3[c3]; "protocol" !== f3 && (r4[f3] = e4[f3]); } return m2[r4.protocol] && r4.hostname && !r4.pathname && (r4.path = r4.pathname = "/"), r4.href = r4.format(), r4; } if (e4.protocol && e4.protocol !== r4.protocol) { if (!m2[e4.protocol]) { for (var d3 = Object.keys(e4), l3 = 0; l3 < d3.length; l3++) { var h3 = d3[l3]; r4[h3] = e4[h3]; } return r4.href = r4.format(), r4; } if (r4.protocol = e4.protocol, e4.host || v2[e4.protocol]) r4.pathname = e4.pathname; else { for (var p3 = (e4.pathname || "").split("/"); p3.length && !(e4.host = p3.shift()); ) ; e4.host || (e4.host = ""), e4.hostname || (e4.hostname = ""), "" !== p3[0] && p3.unshift(""), p3.length < 2 && p3.unshift(""), r4.pathname = p3.join("/"); } if (r4.search = e4.search, r4.query = e4.query, r4.host = e4.host || "", r4.auth = e4.auth, r4.hostname = e4.hostname || e4.host, r4.port = e4.port, r4.pathname || r4.search) { var b3 = r4.pathname || "", y3 = r4.search || ""; r4.path = b3 + y3; } return r4.slashes = r4.slashes || e4.slashes, r4.href = r4.format(), r4; } var g3 = r4.pathname && "/" === r4.pathname.charAt(0), w3 = e4.host || e4.pathname && "/" === e4.pathname.charAt(0), k2 = w3 || g3 || r4.host && e4.pathname, _2 = k2, A2 = r4.pathname && r4.pathname.split("/") || [], E2 = (p3 = e4.pathname && e4.pathname.split("/") || [], r4.protocol && !m2[r4.protocol]); if (E2 && (r4.hostname = "", r4.port = null, r4.host && ("" === A2[0] ? A2[0] = r4.host : A2.unshift(r4.host)), r4.host = "", e4.protocol && (e4.hostname = null, e4.port = null, e4.host && ("" === p3[0] ? p3[0] = e4.host : p3.unshift(e4.host)), e4.host = null), k2 = k2 && ("" === p3[0] || "" === A2[0])), w3) r4.host = e4.host || "" === e4.host ? e4.host : r4.host, r4.hostname = e4.hostname || "" === e4.hostname ? e4.hostname : r4.hostname, r4.search = e4.search, r4.query = e4.query, A2 = p3; else if (p3.length) A2 || (A2 = []), A2.pop(), A2 = A2.concat(p3), r4.search = e4.search, r4.query = e4.query; else if (!o2.isNullOrUndefined(e4.search)) return E2 && (r4.hostname = r4.host = A2.shift(), (P2 = !!(r4.host && r4.host.indexOf("@") > 0) && r4.host.split("@")) && (r4.auth = P2.shift(), r4.host = r4.hostname = P2.shift())), r4.search = e4.search, r4.query = e4.query, o2.isNull(r4.pathname) && o2.isNull(r4.search) || (r4.path = (r4.pathname ? r4.pathname : "") + (r4.search ? r4.search : "")), r4.href = r4.format(), r4; if (!A2.length) return r4.pathname = null, r4.search ? r4.path = "/" + r4.search : r4.path = null, r4.href = r4.format(), r4; for (var S2 = A2.slice(-1)[0], x2 = (r4.host || e4.host || A2.length > 1) && ("." === S2 || ".." === S2) || "" === S2, B2 = 0, O2 = A2.length; O2 >= 0; O2--) "." === (S2 = A2[O2]) ? A2.splice(O2, 1) : ".." === S2 ? (A2.splice(O2, 1), B2++) : B2 && (A2.splice(O2, 1), B2--); if (!k2 && !_2) for (; B2--; B2) A2.unshift(".."); !k2 || "" === A2[0] || A2[0] && "/" === A2[0].charAt(0) || A2.unshift(""), x2 && "/" !== A2.join("/").substr(-1) && A2.push(""); var P2, I2 = "" === A2[0] || A2[0] && "/" === A2[0].charAt(0); return E2 && (r4.hostname = r4.host = I2 ? "" : A2.length ? A2.shift() : "", (P2 = !!(r4.host && r4.host.indexOf("@") > 0) && r4.host.split("@")) && (r4.auth = P2.shift(), r4.host = r4.hostname = P2.shift())), (k2 = k2 || r4.host && A2.length) && !I2 && A2.unshift(""), A2.length ? r4.pathname = A2.join("/") : (r4.pathname = null, r4.path = null), o2.isNull(r4.pathname) && o2.isNull(r4.search) || (r4.path = (r4.pathname ? r4.pathname : "") + (r4.search ? r4.search : "")), r4.auth = e4.auth || r4.auth, r4.slashes = r4.slashes || e4.slashes, r4.href = r4.format(), r4; }, a2.prototype.parseHost = function() { var e4 = this.host, t4 = u2.exec(e4); t4 && (":" !== (t4 = t4[0]) && (this.port = t4.substr(1)), e4 = e4.substr(0, e4.length - t4.length)), e4 && (this.hostname = e4); }; }, 95751: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)); e3.exports = { isString: function(e4) { return "string" == typeof e4; }, isObject: function(e4) { return "object" === (0, n2.default)(e4) && null !== e4; }, isNull: function(e4) { return null === e4; }, isNullOrUndefined: function(e4) { return null == e4; } }; }, 88632: (e3, t3) => { !function(e4) { var t4, r3, n2, i2 = String.fromCharCode; function o2(e5) { for (var t5, r4, n3 = [], i3 = 0, o3 = e5.length; i3 < o3; ) (t5 = e5.charCodeAt(i3++)) >= 55296 && t5 <= 56319 && i3 < o3 ? 56320 == (64512 & (r4 = e5.charCodeAt(i3++))) ? n3.push(((1023 & t5) << 10) + (1023 & r4) + 65536) : (n3.push(t5), i3--) : n3.push(t5); return n3; } function a2(e5) { if (e5 >= 55296 && e5 <= 57343) throw Error("Lone surrogate U+" + e5.toString(16).toUpperCase() + " is not a scalar value"); } function s2(e5, t5) { return i2(e5 >> t5 & 63 | 128); } function u2(e5) { if (0 == (4294967168 & e5)) return i2(e5); var t5 = ""; return 0 == (4294965248 & e5) ? t5 = i2(e5 >> 6 & 31 | 192) : 0 == (4294901760 & e5) ? (a2(e5), t5 = i2(e5 >> 12 & 15 | 224), t5 += s2(e5, 6)) : 0 == (4292870144 & e5) && (t5 = i2(e5 >> 18 & 7 | 240), t5 += s2(e5, 12), t5 += s2(e5, 6)), t5 + i2(63 & e5 | 128); } function c2() { if (n2 >= r3) throw Error("Invalid byte index"); var e5 = 255 & t4[n2]; if (n2++, 128 == (192 & e5)) return 63 & e5; throw Error("Invalid continuation byte"); } function f2() { var e5, i3; if (n2 > r3) throw Error("Invalid byte index"); if (n2 == r3) return false; if (e5 = 255 & t4[n2], n2++, 0 == (128 & e5)) return e5; if (192 == (224 & e5)) { if ((i3 = (31 & e5) << 6 | c2()) >= 128) return i3; throw Error("Invalid continuation byte"); } if (224 == (240 & e5)) { if ((i3 = (15 & e5) << 12 | c2() << 6 | c2()) >= 2048) return a2(i3), i3; throw Error("Invalid continuation byte"); } if (240 == (248 & e5) && (i3 = (7 & e5) << 18 | c2() << 12 | c2() << 6 | c2()) >= 65536 && i3 <= 1114111) return i3; throw Error("Invalid UTF-8 detected"); } e4.version = "3.0.0", e4.encode = function(e5) { for (var t5 = o2(e5), r4 = t5.length, n3 = -1, i3 = ""; ++n3 < r4; ) i3 += u2(t5[n3]); return i3; }, e4.decode = function(e5) { t4 = o2(e5), r3 = t4.length, n2 = 0; for (var a3, s3 = []; false !== (a3 = f2()); ) s3.push(a3); return function(e6) { for (var t5, r4 = e6.length, n3 = -1, o3 = ""; ++n3 < r4; ) (t5 = e6[n3]) > 65535 && (o3 += i2((t5 -= 65536) >>> 10 & 1023 | 55296), t5 = 56320 | 1023 & t5), o3 += i2(t5); return o3; }(s3); }; }(t3); }, 96219: (e3, t3, r3) => { function n2(e4) { try { if (!r3.g.localStorage) return false; } catch (e5) { return false; } var t4 = r3.g.localStorage[e4]; return null != t4 && "true" === String(t4).toLowerCase(); } e3.exports = function(e4, t4) { if (n2("noDeprecation")) return e4; var r4 = false; return function() { if (!r4) { if (n2("throwDeprecation")) throw new Error(t4); n2("traceDeprecation") ? console.trace(t4) : console.warn(t4), r4 = true; } return e4.apply(this, arguments); }; }; }, 16248: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)); e3.exports = function(e4) { return e4 && "object" === (0, n2.default)(e4) && "function" == typeof e4.copy && "function" == typeof e4.fill && "function" == typeof e4.readUInt8; }; }, 17092: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(69446), o2 = r3(14477), a2 = r3(72337), s2 = r3(28915); function u2(e4) { return e4.call.bind(e4); } var c2 = "undefined" != typeof BigInt, f2 = "undefined" != typeof Symbol, d2 = u2(Object.prototype.toString), l2 = u2(Number.prototype.valueOf), h2 = u2(String.prototype.valueOf), p2 = u2(Boolean.prototype.valueOf); if (c2) var b2 = u2(BigInt.prototype.valueOf); if (f2) var y2 = u2(Symbol.prototype.valueOf); function v2(e4, t4) { if ("object" !== (0, n2.default)(e4)) return false; try { return t4(e4), true; } catch (e5) { return false; } } function m2(e4) { return "[object Map]" === d2(e4); } function g2(e4) { return "[object Set]" === d2(e4); } function w2(e4) { return "[object WeakMap]" === d2(e4); } function k2(e4) { return "[object WeakSet]" === d2(e4); } function _2(e4) { return "[object ArrayBuffer]" === d2(e4); } function A2(e4) { return "undefined" != typeof ArrayBuffer && (_2.working ? _2(e4) : e4 instanceof ArrayBuffer); } function E2(e4) { return "[object DataView]" === d2(e4); } function S2(e4) { return "undefined" != typeof DataView && (E2.working ? E2(e4) : e4 instanceof DataView); } t3.isArgumentsObject = i2, t3.isGeneratorFunction = o2, t3.isTypedArray = s2, t3.isPromise = function(e4) { return "undefined" != typeof Promise && e4 instanceof Promise || null !== e4 && "object" === (0, n2.default)(e4) && "function" == typeof e4.then && "function" == typeof e4.catch; }, t3.isArrayBufferView = function(e4) { return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e4) : s2(e4) || S2(e4); }, t3.isUint8Array = function(e4) { return "Uint8Array" === a2(e4); }, t3.isUint8ClampedArray = function(e4) { return "Uint8ClampedArray" === a2(e4); }, t3.isUint16Array = function(e4) { return "Uint16Array" === a2(e4); }, t3.isUint32Array = function(e4) { return "Uint32Array" === a2(e4); }, t3.isInt8Array = function(e4) { return "Int8Array" === a2(e4); }, t3.isInt16Array = function(e4) { return "Int16Array" === a2(e4); }, t3.isInt32Array = function(e4) { return "Int32Array" === a2(e4); }, t3.isFloat32Array = function(e4) { return "Float32Array" === a2(e4); }, t3.isFloat64Array = function(e4) { return "Float64Array" === a2(e4); }, t3.isBigInt64Array = function(e4) { return "BigInt64Array" === a2(e4); }, t3.isBigUint64Array = function(e4) { return "BigUint64Array" === a2(e4); }, m2.working = "undefined" != typeof Map && m2(/* @__PURE__ */ new Map()), t3.isMap = function(e4) { return "undefined" != typeof Map && (m2.working ? m2(e4) : e4 instanceof Map); }, g2.working = "undefined" != typeof Set && g2(/* @__PURE__ */ new Set()), t3.isSet = function(e4) { return "undefined" != typeof Set && (g2.working ? g2(e4) : e4 instanceof Set); }, w2.working = "undefined" != typeof WeakMap && w2(/* @__PURE__ */ new WeakMap()), t3.isWeakMap = function(e4) { return "undefined" != typeof WeakMap && (w2.working ? w2(e4) : e4 instanceof WeakMap); }, k2.working = "undefined" != typeof WeakSet && k2(/* @__PURE__ */ new WeakSet()), t3.isWeakSet = function(e4) { return k2(e4); }, _2.working = "undefined" != typeof ArrayBuffer && _2(new ArrayBuffer()), t3.isArrayBuffer = A2, E2.working = "undefined" != typeof ArrayBuffer && "undefined" != typeof DataView && E2(new DataView(new ArrayBuffer(1), 0, 1)), t3.isDataView = S2; var x2 = "undefined" != typeof SharedArrayBuffer ? SharedArrayBuffer : void 0; function B2(e4) { return "[object SharedArrayBuffer]" === d2(e4); } function O2(e4) { return void 0 !== x2 && (void 0 === B2.working && (B2.working = B2(new x2())), B2.working ? B2(e4) : e4 instanceof x2); } function P2(e4) { return v2(e4, l2); } function I2(e4) { return v2(e4, h2); } function T2(e4) { return v2(e4, p2); } function C2(e4) { return c2 && v2(e4, b2); } function M2(e4) { return f2 && v2(e4, y2); } t3.isSharedArrayBuffer = O2, t3.isAsyncFunction = function(e4) { return "[object AsyncFunction]" === d2(e4); }, t3.isMapIterator = function(e4) { return "[object Map Iterator]" === d2(e4); }, t3.isSetIterator = function(e4) { return "[object Set Iterator]" === d2(e4); }, t3.isGeneratorObject = function(e4) { return "[object Generator]" === d2(e4); }, t3.isWebAssemblyCompiledModule = function(e4) { return "[object WebAssembly.Module]" === d2(e4); }, t3.isNumberObject = P2, t3.isStringObject = I2, t3.isBooleanObject = T2, t3.isBigIntObject = C2, t3.isSymbolObject = M2, t3.isBoxedPrimitive = function(e4) { return P2(e4) || I2(e4) || T2(e4) || C2(e4) || M2(e4); }, t3.isAnyArrayBuffer = function(e4) { return "undefined" != typeof Uint8Array && (A2(e4) || O2(e4)); }, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(e4) { Object.defineProperty(t3, e4, { enumerable: false, value: function() { throw new Error(e4 + " is not supported in userland"); } }); }); }, 45058: (e3, t3, r3) => { var n2 = r3(19142), i2 = r3(28847)(r3(3355)), o2 = Object.getOwnPropertyDescriptors || function(e4) { for (var t4 = Object.keys(e4), r4 = {}, n3 = 0; n3 < t4.length; n3++) r4[t4[n3]] = Object.getOwnPropertyDescriptor(e4, t4[n3]); return r4; }, a2 = /%[sdj%]/g; t3.format = function(e4) { if (!w2(e4)) { for (var t4 = [], r4 = 0; r4 < arguments.length; r4++) t4.push(f2(arguments[r4])); return t4.join(" "); } r4 = 1; for (var n3 = arguments, i3 = n3.length, o3 = String(e4).replace(a2, function(e5) { if ("%%" === e5) return "%"; if (r4 >= i3) return e5; switch (e5) { case "%s": return String(n3[r4++]); case "%d": return Number(n3[r4++]); case "%j": try { return JSON.stringify(n3[r4++]); } catch (e6) { return "[Circular]"; } default: return e5; } }), s3 = n3[r4]; r4 < i3; s3 = n3[++r4]) m2(s3) || !A2(s3) ? o3 += " " + s3 : o3 += " " + f2(s3); return o3; }, t3.deprecate = function(e4, r4) { if (void 0 !== n2 && true === n2.noDeprecation) return e4; if (void 0 === n2) return function() { return t3.deprecate(e4, r4).apply(this, arguments); }; var i3 = false; return function() { if (!i3) { if (n2.throwDeprecation) throw new Error(r4); n2.traceDeprecation ? console.trace(r4) : console.error(r4), i3 = true; } return e4.apply(this, arguments); }; }; var s2 = {}, u2 = /^$/; if (n2.env.NODE_DEBUG) { var c2 = n2.env.NODE_DEBUG; c2 = c2.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(), u2 = new RegExp("^" + c2 + "$", "i"); } function f2(e4, r4) { var n3 = { seen: [], stylize: l2 }; return arguments.length >= 3 && (n3.depth = arguments[2]), arguments.length >= 4 && (n3.colors = arguments[3]), v2(r4) ? n3.showHidden = r4 : r4 && t3._extend(n3, r4), k2(n3.showHidden) && (n3.showHidden = false), k2(n3.depth) && (n3.depth = 2), k2(n3.colors) && (n3.colors = false), k2(n3.customInspect) && (n3.customInspect = true), n3.colors && (n3.stylize = d2), h2(n3, e4, n3.depth); } function d2(e4, t4) { var r4 = f2.styles[t4]; return r4 ? "\x1B[" + f2.colors[r4][0] + "m" + e4 + "\x1B[" + f2.colors[r4][1] + "m" : e4; } function l2(e4, t4) { return e4; } function h2(e4, r4, n3) { if (e4.customInspect && r4 && x2(r4.inspect) && r4.inspect !== t3.inspect && (!r4.constructor || r4.constructor.prototype !== r4)) { var i3 = r4.inspect(n3, e4); return w2(i3) || (i3 = h2(e4, i3, n3)), i3; } var o3 = function(e5, t4) { if (k2(t4)) return e5.stylize("undefined", "undefined"); if (w2(t4)) { var r5 = "'" + JSON.stringify(t4).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; return e5.stylize(r5, "string"); } return g2(t4) ? e5.stylize("" + t4, "number") : v2(t4) ? e5.stylize("" + t4, "boolean") : m2(t4) ? e5.stylize("null", "null") : void 0; }(e4, r4); if (o3) return o3; var a3 = Object.keys(r4), s3 = function(e5) { var t4 = {}; return e5.forEach(function(e6, r5) { t4[e6] = true; }), t4; }(a3); if (e4.showHidden && (a3 = Object.getOwnPropertyNames(r4)), S2(r4) && (a3.indexOf("message") >= 0 || a3.indexOf("description") >= 0)) return p2(r4); if (0 === a3.length) { if (x2(r4)) { var u3 = r4.name ? ": " + r4.name : ""; return e4.stylize("[Function" + u3 + "]", "special"); } if (_2(r4)) return e4.stylize(RegExp.prototype.toString.call(r4), "regexp"); if (E2(r4)) return e4.stylize(Date.prototype.toString.call(r4), "date"); if (S2(r4)) return p2(r4); } var c3, f3 = "", d3 = false, l3 = ["{", "}"]; return y2(r4) && (d3 = true, l3 = ["[", "]"]), x2(r4) && (f3 = " [Function" + (r4.name ? ": " + r4.name : "") + "]"), _2(r4) && (f3 = " " + RegExp.prototype.toString.call(r4)), E2(r4) && (f3 = " " + Date.prototype.toUTCString.call(r4)), S2(r4) && (f3 = " " + p2(r4)), 0 !== a3.length || d3 && 0 != r4.length ? n3 < 0 ? _2(r4) ? e4.stylize(RegExp.prototype.toString.call(r4), "regexp") : e4.stylize("[Object]", "special") : (e4.seen.push(r4), c3 = d3 ? function(e5, t4, r5, n4, i4) { for (var o4 = [], a4 = 0, s4 = t4.length; a4 < s4; ++a4) I2(t4, String(a4)) ? o4.push(b2(e5, t4, r5, n4, String(a4), true)) : o4.push(""); return i4.forEach(function(i5) { i5.match(/^\d+$/) || o4.push(b2(e5, t4, r5, n4, i5, true)); }), o4; }(e4, r4, n3, s3, a3) : a3.map(function(t4) { return b2(e4, r4, n3, s3, t4, d3); }), e4.seen.pop(), function(e5, t4, r5) { return e5.reduce(function(e6, t5) { return t5.indexOf("\n"), e6 + t5.replace(/\u001b\[\d\d?m/g, "").length + 1; }, 0) > 60 ? r5[0] + ("" === t4 ? "" : t4 + "\n ") + " " + e5.join(",\n ") + " " + r5[1] : r5[0] + t4 + " " + e5.join(", ") + " " + r5[1]; }(c3, f3, l3)) : l3[0] + f3 + l3[1]; } function p2(e4) { return "[" + Error.prototype.toString.call(e4) + "]"; } function b2(e4, t4, r4, n3, i3, o3) { var a3, s3, u3; if ((u3 = Object.getOwnPropertyDescriptor(t4, i3) || { value: t4[i3] }).get ? s3 = u3.set ? e4.stylize("[Getter/Setter]", "special") : e4.stylize("[Getter]", "special") : u3.set && (s3 = e4.stylize("[Setter]", "special")), I2(n3, i3) || (a3 = "[" + i3 + "]"), s3 || (e4.seen.indexOf(u3.value) < 0 ? (s3 = m2(r4) ? h2(e4, u3.value, null) : h2(e4, u3.value, r4 - 1)).indexOf("\n") > -1 && (s3 = o3 ? s3.split("\n").map(function(e5) { return " " + e5; }).join("\n").slice(2) : "\n" + s3.split("\n").map(function(e5) { return " " + e5; }).join("\n")) : s3 = e4.stylize("[Circular]", "special")), k2(a3)) { if (o3 && i3.match(/^\d+$/)) return s3; (a3 = JSON.stringify("" + i3)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (a3 = a3.slice(1, -1), a3 = e4.stylize(a3, "name")) : (a3 = a3.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), a3 = e4.stylize(a3, "string")); } return a3 + ": " + s3; } function y2(e4) { return Array.isArray(e4); } function v2(e4) { return "boolean" == typeof e4; } function m2(e4) { return null === e4; } function g2(e4) { return "number" == typeof e4; } function w2(e4) { return "string" == typeof e4; } function k2(e4) { return void 0 === e4; } function _2(e4) { return A2(e4) && "[object RegExp]" === B2(e4); } function A2(e4) { return "object" === (0, i2.default)(e4) && null !== e4; } function E2(e4) { return A2(e4) && "[object Date]" === B2(e4); } function S2(e4) { return A2(e4) && ("[object Error]" === B2(e4) || e4 instanceof Error); } function x2(e4) { return "function" == typeof e4; } function B2(e4) { return Object.prototype.toString.call(e4); } function O2(e4) { return e4 < 10 ? "0" + e4.toString(10) : e4.toString(10); } t3.debuglog = function(e4) { if (e4 = e4.toUpperCase(), !s2[e4]) if (u2.test(e4)) { var r4 = n2.pid; s2[e4] = function() { var n3 = t3.format.apply(t3, arguments); console.error("%s %d: %s", e4, r4, n3); }; } else s2[e4] = function() { }; return s2[e4]; }, t3.inspect = f2, f2.colors = { bold: [1, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], white: [37, 39], grey: [90, 39], black: [30, 39], blue: [34, 39], cyan: [36, 39], green: [32, 39], magenta: [35, 39], red: [31, 39], yellow: [33, 39] }, f2.styles = { special: "cyan", number: "yellow", boolean: "yellow", undefined: "grey", null: "bold", string: "green", date: "magenta", regexp: "red" }, t3.types = r3(17092), t3.isArray = y2, t3.isBoolean = v2, t3.isNull = m2, t3.isNullOrUndefined = function(e4) { return null == e4; }, t3.isNumber = g2, t3.isString = w2, t3.isSymbol = function(e4) { return "symbol" === (0, i2.default)(e4); }, t3.isUndefined = k2, t3.isRegExp = _2, t3.types.isRegExp = _2, t3.isObject = A2, t3.isDate = E2, t3.types.isDate = E2, t3.isError = S2, t3.types.isNativeError = S2, t3.isFunction = x2, t3.isPrimitive = function(e4) { return null === e4 || "boolean" == typeof e4 || "number" == typeof e4 || "string" == typeof e4 || "symbol" === (0, i2.default)(e4) || void 0 === e4; }, t3.isBuffer = r3(16248); var P2 = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; function I2(e4, t4) { return Object.prototype.hasOwnProperty.call(e4, t4); } t3.log = function() { var e4, r4; console.log("%s - %s", (r4 = [O2((e4 = /* @__PURE__ */ new Date()).getHours()), O2(e4.getMinutes()), O2(e4.getSeconds())].join(":"), [e4.getDate(), P2[e4.getMonth()], r4].join(" ")), t3.format.apply(t3, arguments)); }, t3.inherits = r3(41736), t3._extend = function(e4, t4) { if (!t4 || !A2(t4)) return e4; for (var r4 = Object.keys(t4), n3 = r4.length; n3--; ) e4[r4[n3]] = t4[r4[n3]]; return e4; }; var T2 = "undefined" != typeof Symbol ? Symbol("util.promisify.custom") : void 0; function C2(e4, t4) { if (!e4) { var r4 = new Error("Promise was rejected with a falsy value"); r4.reason = e4, e4 = r4; } return t4(e4); } t3.promisify = function(e4) { if ("function" != typeof e4) throw new TypeError('The "original" argument must be of type Function'); if (T2 && e4[T2]) { var t4; if ("function" != typeof (t4 = e4[T2])) throw new TypeError('The "util.promisify.custom" argument must be of type Function'); return Object.defineProperty(t4, T2, { value: t4, enumerable: false, writable: false, configurable: true }), t4; } function t4() { for (var t5, r4, n3 = new Promise(function(e5, n4) { t5 = e5, r4 = n4; }), i3 = [], o3 = 0; o3 < arguments.length; o3++) i3.push(arguments[o3]); i3.push(function(e5, n4) { e5 ? r4(e5) : t5(n4); }); try { e4.apply(this, i3); } catch (e5) { r4(e5); } return n3; } return Object.setPrototypeOf(t4, Object.getPrototypeOf(e4)), T2 && Object.defineProperty(t4, T2, { value: t4, enumerable: false, writable: false, configurable: true }), Object.defineProperties(t4, o2(e4)); }, t3.promisify.custom = T2, t3.callbackify = function(e4) { if ("function" != typeof e4) throw new TypeError('The "original" argument must be of type Function'); function t4() { for (var t5 = [], r4 = 0; r4 < arguments.length; r4++) t5.push(arguments[r4]); var i3 = t5.pop(); if ("function" != typeof i3) throw new TypeError("The last argument must be of type Function"); var o3 = this, a3 = function() { return i3.apply(o3, arguments); }; e4.apply(this, t5).then(function(e5) { n2.nextTick(a3.bind(null, null, e5)); }, function(e5) { n2.nextTick(C2.bind(null, e5, a3)); }); } return Object.setPrototypeOf(t4, Object.getPrototypeOf(e4)), Object.defineProperties(t4, o2(e4)), t4; }; }, 22679: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), Object.defineProperty(t3, "NIL", { enumerable: true, get: function() { return s2.default; } }), Object.defineProperty(t3, "parse", { enumerable: true, get: function() { return d2.default; } }), Object.defineProperty(t3, "stringify", { enumerable: true, get: function() { return f2.default; } }), Object.defineProperty(t3, "v1", { enumerable: true, get: function() { return n2.default; } }), Object.defineProperty(t3, "v3", { enumerable: true, get: function() { return i2.default; } }), Object.defineProperty(t3, "v4", { enumerable: true, get: function() { return o2.default; } }), Object.defineProperty(t3, "v5", { enumerable: true, get: function() { return a2.default; } }), Object.defineProperty(t3, "validate", { enumerable: true, get: function() { return c2.default; } }), Object.defineProperty(t3, "version", { enumerable: true, get: function() { return u2.default; } }); var n2 = l2(r3(55999)), i2 = l2(r3(28231)), o2 = l2(r3(78647)), a2 = l2(r3(65025)), s2 = l2(r3(55996)), u2 = l2(r3(8928)), c2 = l2(r3(76163)), f2 = l2(r3(22982)), d2 = l2(r3(91729)); function l2(e4) { return e4 && e4.__esModule ? e4 : { default: e4 }; } }, 86792: (e3, t3) => { function r3(e4) { return 14 + (e4 + 64 >>> 9 << 4) + 1; } function n2(e4, t4) { var r4 = (65535 & e4) + (65535 & t4); return (e4 >> 16) + (t4 >> 16) + (r4 >> 16) << 16 | 65535 & r4; } function i2(e4, t4, r4, i3, o3, a3) { return n2((s3 = n2(n2(t4, e4), n2(i3, a3))) << (u3 = o3) | s3 >>> 32 - u3, r4); var s3, u3; } function o2(e4, t4, r4, n3, o3, a3, s3) { return i2(t4 & r4 | ~t4 & n3, e4, t4, o3, a3, s3); } function a2(e4, t4, r4, n3, o3, a3, s3) { return i2(t4 & n3 | r4 & ~n3, e4, t4, o3, a3, s3); } function s2(e4, t4, r4, n3, o3, a3, s3) { return i2(t4 ^ r4 ^ n3, e4, t4, o3, a3, s3); } function u2(e4, t4, r4, n3, o3, a3, s3) { return i2(r4 ^ (t4 | ~n3), e4, t4, o3, a3, s3); } Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0; t3.default = function(e4) { if ("string" == typeof e4) { var t4 = unescape(encodeURIComponent(e4)); e4 = new Uint8Array(t4.length); for (var i3 = 0; i3 < t4.length; ++i3) e4[i3] = t4.charCodeAt(i3); } return function(e5) { for (var t5 = [], r4 = 32 * e5.length, n3 = "0123456789abcdef", i4 = 0; i4 < r4; i4 += 8) { var o3 = e5[i4 >> 5] >>> i4 % 32 & 255, a3 = parseInt(n3.charAt(o3 >>> 4 & 15) + n3.charAt(15 & o3), 16); t5.push(a3); } return t5; }(function(e5, t5) { e5[t5 >> 5] |= 128 << t5 % 32, e5[r3(t5) - 1] = t5; for (var i4 = 1732584193, c2 = -271733879, f2 = -1732584194, d2 = 271733878, l2 = 0; l2 < e5.length; l2 += 16) { var h2 = i4, p2 = c2, b2 = f2, y2 = d2; i4 = o2(i4, c2, f2, d2, e5[l2], 7, -680876936), d2 = o2(d2, i4, c2, f2, e5[l2 + 1], 12, -389564586), f2 = o2(f2, d2, i4, c2, e5[l2 + 2], 17, 606105819), c2 = o2(c2, f2, d2, i4, e5[l2 + 3], 22, -1044525330), i4 = o2(i4, c2, f2, d2, e5[l2 + 4], 7, -176418897), d2 = o2(d2, i4, c2, f2, e5[l2 + 5], 12, 1200080426), f2 = o2(f2, d2, i4, c2, e5[l2 + 6], 17, -1473231341), c2 = o2(c2, f2, d2, i4, e5[l2 + 7], 22, -45705983), i4 = o2(i4, c2, f2, d2, e5[l2 + 8], 7, 1770035416), d2 = o2(d2, i4, c2, f2, e5[l2 + 9], 12, -1958414417), f2 = o2(f2, d2, i4, c2, e5[l2 + 10], 17, -42063), c2 = o2(c2, f2, d2, i4, e5[l2 + 11], 22, -1990404162), i4 = o2(i4, c2, f2, d2, e5[l2 + 12], 7, 1804603682), d2 = o2(d2, i4, c2, f2, e5[l2 + 13], 12, -40341101), f2 = o2(f2, d2, i4, c2, e5[l2 + 14], 17, -1502002290), i4 = a2(i4, c2 = o2(c2, f2, d2, i4, e5[l2 + 15], 22, 1236535329), f2, d2, e5[l2 + 1], 5, -165796510), d2 = a2(d2, i4, c2, f2, e5[l2 + 6], 9, -1069501632), f2 = a2(f2, d2, i4, c2, e5[l2 + 11], 14, 643717713), c2 = a2(c2, f2, d2, i4, e5[l2], 20, -373897302), i4 = a2(i4, c2, f2, d2, e5[l2 + 5], 5, -701558691), d2 = a2(d2, i4, c2, f2, e5[l2 + 10], 9, 38016083), f2 = a2(f2, d2, i4, c2, e5[l2 + 15], 14, -660478335), c2 = a2(c2, f2, d2, i4, e5[l2 + 4], 20, -405537848), i4 = a2(i4, c2, f2, d2, e5[l2 + 9], 5, 568446438), d2 = a2(d2, i4, c2, f2, e5[l2 + 14], 9, -1019803690), f2 = a2(f2, d2, i4, c2, e5[l2 + 3], 14, -187363961), c2 = a2(c2, f2, d2, i4, e5[l2 + 8], 20, 1163531501), i4 = a2(i4, c2, f2, d2, e5[l2 + 13], 5, -1444681467), d2 = a2(d2, i4, c2, f2, e5[l2 + 2], 9, -51403784), f2 = a2(f2, d2, i4, c2, e5[l2 + 7], 14, 1735328473), i4 = s2(i4, c2 = a2(c2, f2, d2, i4, e5[l2 + 12], 20, -1926607734), f2, d2, e5[l2 + 5], 4, -378558), d2 = s2(d2, i4, c2, f2, e5[l2 + 8], 11, -2022574463), f2 = s2(f2, d2, i4, c2, e5[l2 + 11], 16, 1839030562), c2 = s2(c2, f2, d2, i4, e5[l2 + 14], 23, -35309556), i4 = s2(i4, c2, f2, d2, e5[l2 + 1], 4, -1530992060), d2 = s2(d2, i4, c2, f2, e5[l2 + 4], 11, 1272893353), f2 = s2(f2, d2, i4, c2, e5[l2 + 7], 16, -155497632), c2 = s2(c2, f2, d2, i4, e5[l2 + 10], 23, -1094730640), i4 = s2(i4, c2, f2, d2, e5[l2 + 13], 4, 681279174), d2 = s2(d2, i4, c2, f2, e5[l2], 11, -358537222), f2 = s2(f2, d2, i4, c2, e5[l2 + 3], 16, -722521979), c2 = s2(c2, f2, d2, i4, e5[l2 + 6], 23, 76029189), i4 = s2(i4, c2, f2, d2, e5[l2 + 9], 4, -640364487), d2 = s2(d2, i4, c2, f2, e5[l2 + 12], 11, -421815835), f2 = s2(f2, d2, i4, c2, e5[l2 + 15], 16, 530742520), i4 = u2(i4, c2 = s2(c2, f2, d2, i4, e5[l2 + 2], 23, -995338651), f2, d2, e5[l2], 6, -198630844), d2 = u2(d2, i4, c2, f2, e5[l2 + 7], 10, 1126891415), f2 = u2(f2, d2, i4, c2, e5[l2 + 14], 15, -1416354905), c2 = u2(c2, f2, d2, i4, e5[l2 + 5], 21, -57434055), i4 = u2(i4, c2, f2, d2, e5[l2 + 12], 6, 1700485571), d2 = u2(d2, i4, c2, f2, e5[l2 + 3], 10, -1894986606), f2 = u2(f2, d2, i4, c2, e5[l2 + 10], 15, -1051523), c2 = u2(c2, f2, d2, i4, e5[l2 + 1], 21, -2054922799), i4 = u2(i4, c2, f2, d2, e5[l2 + 8], 6, 1873313359), d2 = u2(d2, i4, c2, f2, e5[l2 + 15], 10, -30611744), f2 = u2(f2, d2, i4, c2, e5[l2 + 6], 15, -1560198380), c2 = u2(c2, f2, d2, i4, e5[l2 + 13], 21, 1309151649), i4 = u2(i4, c2, f2, d2, e5[l2 + 4], 6, -145523070), d2 = u2(d2, i4, c2, f2, e5[l2 + 11], 10, -1120210379), f2 = u2(f2, d2, i4, c2, e5[l2 + 2], 15, 718787259), c2 = u2(c2, f2, d2, i4, e5[l2 + 9], 21, -343485551), i4 = n2(i4, h2), c2 = n2(c2, p2), f2 = n2(f2, b2), d2 = n2(d2, y2); } return [i4, c2, f2, d2]; }(function(e5) { if (0 === e5.length) return []; for (var t5 = 8 * e5.length, n3 = new Uint32Array(r3(t5)), i4 = 0; i4 < t5; i4 += 8) n3[i4 >> 5] |= (255 & e5[i4 / 8]) << i4 % 32; return n3; }(e4), 8 * e4.length)); }; }, 11788: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0; var r3 = { randomUUID: "undefined" != typeof crypto && crypto.randomUUID && crypto.randomUUID.bind(crypto) }; t3.default = r3; }, 55996: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0, t3.default = "00000000-0000-0000-0000-000000000000"; }, 91729: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0; var n2, i2 = (n2 = r3(76163)) && n2.__esModule ? n2 : { default: n2 }; t3.default = function(e4) { if (!(0, i2.default)(e4)) throw TypeError("Invalid UUID"); var t4, r4 = new Uint8Array(16); return r4[0] = (t4 = parseInt(e4.slice(0, 8), 16)) >>> 24, r4[1] = t4 >>> 16 & 255, r4[2] = t4 >>> 8 & 255, r4[3] = 255 & t4, r4[4] = (t4 = parseInt(e4.slice(9, 13), 16)) >>> 8, r4[5] = 255 & t4, r4[6] = (t4 = parseInt(e4.slice(14, 18), 16)) >>> 8, r4[7] = 255 & t4, r4[8] = (t4 = parseInt(e4.slice(19, 23), 16)) >>> 8, r4[9] = 255 & t4, r4[10] = (t4 = parseInt(e4.slice(24, 36), 16)) / 1099511627776 & 255, r4[11] = t4 / 4294967296 & 255, r4[12] = t4 >>> 24 & 255, r4[13] = t4 >>> 16 & 255, r4[14] = t4 >>> 8 & 255, r4[15] = 255 & t4, r4; }; }, 77300: (e3, t3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0, t3.default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; }, 14402: (e3, t3) => { var r3; Object.defineProperty(t3, "__esModule", { value: true }), t3.default = function() { if (!r3 && !(r3 = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto))) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); return r3(n2); }; var n2 = new Uint8Array(16); }, 42702: (e3, t3) => { function r3(e4, t4, r4, n3) { switch (e4) { case 0: return t4 & r4 ^ ~t4 & n3; case 1: case 3: return t4 ^ r4 ^ n3; case 2: return t4 & r4 ^ t4 & n3 ^ r4 & n3; } } function n2(e4, t4) { return e4 << t4 | e4 >>> 32 - t4; } Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0; t3.default = function(e4) { var t4 = [1518500249, 1859775393, 2400959708, 3395469782], i2 = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; if ("string" == typeof e4) { var o2 = unescape(encodeURIComponent(e4)); e4 = []; for (var a2 = 0; a2 < o2.length; ++a2) e4.push(o2.charCodeAt(a2)); } else Array.isArray(e4) || (e4 = Array.prototype.slice.call(e4)); e4.push(128); for (var s2 = e4.length / 4 + 2, u2 = Math.ceil(s2 / 16), c2 = new Array(u2), f2 = 0; f2 < u2; ++f2) { for (var d2 = new Uint32Array(16), l2 = 0; l2 < 16; ++l2) d2[l2] = e4[64 * f2 + 4 * l2] << 24 | e4[64 * f2 + 4 * l2 + 1] << 16 | e4[64 * f2 + 4 * l2 + 2] << 8 | e4[64 * f2 + 4 * l2 + 3]; c2[f2] = d2; } c2[u2 - 1][14] = 8 * (e4.length - 1) / Math.pow(2, 32), c2[u2 - 1][14] = Math.floor(c2[u2 - 1][14]), c2[u2 - 1][15] = 8 * (e4.length - 1) & 4294967295; for (var h2 = 0; h2 < u2; ++h2) { for (var p2 = new Uint32Array(80), b2 = 0; b2 < 16; ++b2) p2[b2] = c2[h2][b2]; for (var y2 = 16; y2 < 80; ++y2) p2[y2] = n2(p2[y2 - 3] ^ p2[y2 - 8] ^ p2[y2 - 14] ^ p2[y2 - 16], 1); for (var v2 = i2[0], m2 = i2[1], g2 = i2[2], w2 = i2[3], k2 = i2[4], _2 = 0; _2 < 80; ++_2) { var A2 = Math.floor(_2 / 20), E2 = n2(v2, 5) + r3(A2, m2, g2, w2) + k2 + t4[A2] + p2[_2] >>> 0; k2 = w2, w2 = g2, g2 = n2(m2, 30) >>> 0, m2 = v2, v2 = E2; } i2[0] = i2[0] + v2 >>> 0, i2[1] = i2[1] + m2 >>> 0, i2[2] = i2[2] + g2 >>> 0, i2[3] = i2[3] + w2 >>> 0, i2[4] = i2[4] + k2 >>> 0; } return [i2[0] >> 24 & 255, i2[0] >> 16 & 255, i2[0] >> 8 & 255, 255 & i2[0], i2[1] >> 24 & 255, i2[1] >> 16 & 255, i2[1] >> 8 & 255, 255 & i2[1], i2[2] >> 24 & 255, i2[2] >> 16 & 255, i2[2] >> 8 & 255, 255 & i2[2], i2[3] >> 24 & 255, i2[3] >> 16 & 255, i2[3] >> 8 & 255, 255 & i2[3], i2[4] >> 24 & 255, i2[4] >> 16 & 255, i2[4] >> 8 & 255, 255 & i2[4]]; }; }, 22982: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0, t3.unsafeStringify = s2; for (var n2, i2 = (n2 = r3(76163)) && n2.__esModule ? n2 : { default: n2 }, o2 = [], a2 = 0; a2 < 256; ++a2) o2.push((a2 + 256).toString(16).slice(1)); function s2(e4) { var t4 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; return o2[e4[t4 + 0]] + o2[e4[t4 + 1]] + o2[e4[t4 + 2]] + o2[e4[t4 + 3]] + "-" + o2[e4[t4 + 4]] + o2[e4[t4 + 5]] + "-" + o2[e4[t4 + 6]] + o2[e4[t4 + 7]] + "-" + o2[e4[t4 + 8]] + o2[e4[t4 + 9]] + "-" + o2[e4[t4 + 10]] + o2[e4[t4 + 11]] + o2[e4[t4 + 12]] + o2[e4[t4 + 13]] + o2[e4[t4 + 14]] + o2[e4[t4 + 15]]; } t3.default = function(e4) { var t4 = s2(e4, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0); if (!(0, i2.default)(t4)) throw TypeError("Stringified UUID is invalid"); return t4; }; }, 55999: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0; var n2, i2, o2, a2 = (n2 = r3(14402)) && n2.__esModule ? n2 : { default: n2 }, s2 = r3(22982), u2 = 0, c2 = 0; t3.default = function(e4, t4, r4) { var n3 = t4 && r4 || 0, f2 = t4 || new Array(16), d2 = (e4 = e4 || {}).node || i2, l2 = void 0 !== e4.clockseq ? e4.clockseq : o2; if (null == d2 || null == l2) { var h2 = e4.random || (e4.rng || a2.default)(); null == d2 && (d2 = i2 = [1 | h2[0], h2[1], h2[2], h2[3], h2[4], h2[5]]), null == l2 && (l2 = o2 = 16383 & (h2[6] << 8 | h2[7])); } var p2 = void 0 !== e4.msecs ? e4.msecs : Date.now(), b2 = void 0 !== e4.nsecs ? e4.nsecs : c2 + 1, y2 = p2 - u2 + (b2 - c2) / 1e4; if (y2 < 0 && void 0 === e4.clockseq && (l2 = l2 + 1 & 16383), (y2 < 0 || p2 > u2) && void 0 === e4.nsecs && (b2 = 0), b2 >= 1e4) throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); u2 = p2, c2 = b2, o2 = l2; var v2 = (1e4 * (268435455 & (p2 += 122192928e5)) + b2) % 4294967296; f2[n3++] = v2 >>> 24 & 255, f2[n3++] = v2 >>> 16 & 255, f2[n3++] = v2 >>> 8 & 255, f2[n3++] = 255 & v2; var m2 = p2 / 4294967296 * 1e4 & 268435455; f2[n3++] = m2 >>> 8 & 255, f2[n3++] = 255 & m2, f2[n3++] = m2 >>> 24 & 15 | 16, f2[n3++] = m2 >>> 16 & 255, f2[n3++] = l2 >>> 8 | 128, f2[n3++] = 255 & l2; for (var g2 = 0; g2 < 6; ++g2) f2[n3 + g2] = d2[g2]; return t4 || (0, s2.unsafeStringify)(f2); }; }, 28231: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0; var n2 = o2(r3(36125)), i2 = o2(r3(86792)); function o2(e4) { return e4 && e4.__esModule ? e4 : { default: e4 }; } var a2 = (0, n2.default)("v3", 48, i2.default); t3.default = a2; }, 36125: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.URL = t3.DNS = void 0, t3.default = function(e4, t4, r4) { function n3(e5, n4, a3, s3) { var u2; if ("string" == typeof e5 && (e5 = function(e6) { e6 = unescape(encodeURIComponent(e6)); for (var t5 = [], r5 = 0; r5 < e6.length; ++r5) t5.push(e6.charCodeAt(r5)); return t5; }(e5)), "string" == typeof n4 && (n4 = (0, o2.default)(n4)), 16 !== (null === (u2 = n4) || void 0 === u2 ? void 0 : u2.length)) throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); var c2 = new Uint8Array(16 + e5.length); if (c2.set(n4), c2.set(e5, n4.length), (c2 = r4(c2))[6] = 15 & c2[6] | t4, c2[8] = 63 & c2[8] | 128, a3) { s3 = s3 || 0; for (var f2 = 0; f2 < 16; ++f2) a3[s3 + f2] = c2[f2]; return a3; } return (0, i2.unsafeStringify)(c2); } try { n3.name = e4; } catch (e5) { } return n3.DNS = a2, n3.URL = s2, n3; }; var n2, i2 = r3(22982), o2 = (n2 = r3(91729)) && n2.__esModule ? n2 : { default: n2 }, a2 = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; t3.DNS = a2; var s2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; t3.URL = s2; }, 78647: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0; var n2 = a2(r3(11788)), i2 = a2(r3(14402)), o2 = r3(22982); function a2(e4) { return e4 && e4.__esModule ? e4 : { default: e4 }; } t3.default = function(e4, t4, r4) { if (n2.default.randomUUID && !t4 && !e4) return n2.default.randomUUID(); var a3 = (e4 = e4 || {}).random || (e4.rng || i2.default)(); if (a3[6] = 15 & a3[6] | 64, a3[8] = 63 & a3[8] | 128, t4) { r4 = r4 || 0; for (var s2 = 0; s2 < 16; ++s2) t4[r4 + s2] = a3[s2]; return t4; } return (0, o2.unsafeStringify)(a3); }; }, 65025: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0; var n2 = o2(r3(36125)), i2 = o2(r3(42702)); function o2(e4) { return e4 && e4.__esModule ? e4 : { default: e4 }; } var a2 = (0, n2.default)("v5", 80, i2.default); t3.default = a2; }, 76163: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0; var n2, i2 = (n2 = r3(77300)) && n2.__esModule ? n2 : { default: n2 }; t3.default = function(e4) { return "string" == typeof e4 && i2.default.test(e4); }; }, 8928: (e3, t3, r3) => { Object.defineProperty(t3, "__esModule", { value: true }), t3.default = void 0; var n2, i2 = (n2 = r3(76163)) && n2.__esModule ? n2 : { default: n2 }; t3.default = function(e4) { if (!(0, i2.default)(e4)) throw TypeError("Invalid UUID"); return parseInt(e4.slice(14, 15), 16); }; }, 38325: (e3) => { e3.exports = function e4(n2, i2) { var o2, a2 = 0, s2 = 0, u2 = i2 = i2 || 0, c2 = n2.length; do { if (u2 >= c2) throw e4.bytes = 0, new RangeError("Could not decode varint"); o2 = n2[u2++], a2 += s2 < 28 ? (o2 & r3) << s2 : (o2 & r3) * Math.pow(2, s2), s2 += 7; } while (o2 >= t3); return e4.bytes = u2 - i2, a2; }; var t3 = 128, r3 = 127; }, 92699: (e3) => { e3.exports = function e4(i2, o2, a2) { o2 = o2 || []; for (var s2 = a2 = a2 || 0; i2 >= n2; ) o2[a2++] = 255 & i2 | t3, i2 /= 128; for (; i2 & r3; ) o2[a2++] = 255 & i2 | t3, i2 >>>= 7; return o2[a2] = 0 | i2, e4.bytes = a2 - s2 + 1, o2; }; var t3 = 128, r3 = -128, n2 = Math.pow(2, 31); }, 26657: (e3, t3, r3) => { e3.exports = { encode: r3(92699), decode: r3(38325), encodingLength: r3(57490) }; }, 57490: (e3) => { var t3 = Math.pow(2, 7), r3 = Math.pow(2, 14), n2 = Math.pow(2, 21), i2 = Math.pow(2, 28), o2 = Math.pow(2, 35), a2 = Math.pow(2, 42), s2 = Math.pow(2, 49), u2 = Math.pow(2, 56), c2 = Math.pow(2, 63); e3.exports = function(e4) { return e4 < t3 ? 1 : e4 < r3 ? 2 : e4 < n2 ? 3 : e4 < i2 ? 4 : e4 < o2 ? 5 : e4 < a2 ? 6 : e4 < s2 ? 7 : e4 < u2 ? 8 : e4 < c2 ? 9 : 10; }; }, 1158: (e3, t3, r3) => { var n2, i2 = r3(28847)(r3(3355)); if ("object" === ("undefined" == typeof globalThis ? "undefined" : (0, i2.default)(globalThis))) n2 = globalThis; else try { n2 = r3(26464); } catch (e4) { } finally { if (n2 || "undefined" == typeof window || (n2 = window), !n2) throw new Error("Could not determine global this"); } var o2 = n2.WebSocket || n2.MozWebSocket, a2 = r3(75735); function s2(e4, t4) { return t4 ? new o2(e4, t4) : new o2(e4); } o2 && ["CONNECTING", "OPEN", "CLOSING", "CLOSED"].forEach(function(e4) { Object.defineProperty(s2, e4, { get: function() { return o2[e4]; } }); }), e3.exports = { w3cwebsocket: o2 ? s2 : null, version: a2 }; }, 75735: (e3, t3, r3) => { e3.exports = r3(19794).version; }, 72337: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(48184), o2 = r3(43604), a2 = r3(24373), s2 = r3(80593), u2 = r3(53820), c2 = s2("Object.prototype.toString"), f2 = r3(11191)(), d2 = "undefined" == typeof globalThis ? r3.g : globalThis, l2 = o2(), h2 = s2("String.prototype.slice"), p2 = Object.getPrototypeOf, b2 = s2("Array.prototype.indexOf", true) || function(e4, t4) { for (var r4 = 0; r4 < e4.length; r4 += 1) if (e4[r4] === t4) return r4; return -1; }, y2 = { __proto__: null }; i2(l2, f2 && u2 && p2 ? function(e4) { var t4 = new d2[e4](); if (Symbol.toStringTag in t4) { var r4 = p2(t4), n3 = u2(r4, Symbol.toStringTag); if (!n3) { var i3 = p2(r4); n3 = u2(i3, Symbol.toStringTag); } y2["$" + e4] = a2(n3.get); } } : function(e4) { var t4 = new d2[e4](), r4 = t4.slice || t4.set; r4 && (y2["$" + e4] = a2(r4)); }), e3.exports = function(e4) { if (!e4 || "object" !== (0, n2.default)(e4)) return false; if (!f2) { var t4 = h2(c2(e4), 8, -1); return b2(l2, t4) > -1 ? t4 : "Object" === t4 && function(e5) { var t5 = false; return i2(y2, function(r4, n3) { if (!t5) try { r4(e5), t5 = h2(n3, 1); } catch (e6) { } }), t5; }(e4); } return u2 ? function(e5) { var t5 = false; return i2(y2, function(r4, n3) { if (!t5) try { "$" + r4(e5) === n3 && (t5 = h2(n3, 1)); } catch (e6) { } }), t5; }(e4) : null; }; }, 31357: (e3, t3, r3) => { var n2 = r3(31296), i2 = r3(68419), o2 = r3(33103), a2 = r3(39122), s2 = r3(17321), u2 = "application/json", c2 = function() { }; e3.exports = function(e4, t4, r4) { if (!e4 || "string" != typeof e4) throw new TypeError("must specify a URL"); if ("function" == typeof t4 && (r4 = t4, t4 = {}), r4 && "function" != typeof r4) throw new TypeError("expected cb to be undefined or a function"); r4 = r4 || c2; var f2 = (t4 = t4 || {}).json ? "json" : "text", d2 = (t4 = o2({ responseType: f2 }, t4)).headers || {}, l2 = (t4.method || "GET").toUpperCase(), h2 = t4.query; return h2 && ("string" != typeof h2 && (h2 = n2.stringify(h2)), e4 = i2(e4, h2)), "json" === t4.responseType && a2(d2, "Accept", u2), t4.json && "GET" !== l2 && "HEAD" !== l2 && (a2(d2, "Content-Type", u2), t4.body = JSON.stringify(t4.body)), t4.method = l2, t4.url = e4, t4.headers = d2, delete t4.query, delete t4.json, s2(t4, r4); }; }, 39122: (e3) => { e3.exports = function(e4, t3, r3) { var n2 = t3.toLowerCase(); e4[t3] || e4[n2] || (e4[t3] = r3); }; }, 49800: (e3) => { e3.exports = function(e4, t3) { return t3 ? { statusCode: t3.statusCode, headers: t3.headers, method: e4.method, url: e4.url, rawRequest: t3.rawRequest ? t3.rawRequest : t3 } : null; }; }, 17321: (e3, t3, r3) => { var n2 = r3(30346), i2 = r3(49800), o2 = function() { }; e3.exports = function(e4, t4) { delete e4.uri; var r4 = false; "json" === e4.responseType && (e4.responseType = "text", r4 = true); var a2 = n2(e4, function(n3, a3, s3) { if (r4 && !n3) try { var u2 = a3.rawRequest.responseText; s3 = JSON.parse(u2); } catch (e5) { n3 = e5; } a3 = i2(e4, a3), t4(n3, n3 ? null : s3, a3), t4 = o2; }), s2 = a2.onabort; return a2.onabort = function() { var e5 = s2.apply(a2, Array.prototype.slice.call(arguments)); return t4(new Error("XHR Aborted")), t4 = o2, e5; }, a2; }; }, 30346: (e3, t3, r3) => { var n2 = r3(92948), i2 = r3(27277), o2 = r3(48209), a2 = r3(87705); function s2(e4, t4, r4) { var n3 = e4; return i2(t4) ? (r4 = t4, "string" == typeof e4 && (n3 = { uri: e4 })) : n3 = a2(t4, { uri: e4 }), n3.callback = r4, n3; } function u2(e4, t4, r4) { return c2(t4 = s2(e4, t4, r4)); } function c2(e4) { if (void 0 === e4.callback) throw new Error("callback argument missing"); var t4 = false, r4 = function(r5, n4, i4) { t4 || (t4 = true, e4.callback(r5, n4, i4)); }; function n3() { var e5 = void 0; if (e5 = f2.response ? f2.response : f2.responseText || function(e6) { try { if ("document" === e6.responseType) return e6.responseXML; var t5 = e6.responseXML && "parsererror" === e6.responseXML.documentElement.nodeName; if ("" === e6.responseType && !t5) return e6.responseXML; } catch (e7) { } return null; }(f2), v2) try { e5 = JSON.parse(e5); } catch (e6) { } return e5; } function i3(e5) { return clearTimeout(d2), e5 instanceof Error || (e5 = new Error("" + (e5 || "Unknown XMLHttpRequest Error"))), e5.statusCode = 0, r4(e5, m2); } function a3() { if (!c3) { var t5; clearTimeout(d2), t5 = e4.useXDR && void 0 === f2.status ? 200 : 1223 === f2.status ? 204 : f2.status; var i4 = m2, a4 = null; return 0 !== t5 ? (i4 = { body: n3(), statusCode: t5, method: h2, headers: {}, url: l2, rawRequest: f2 }, f2.getAllResponseHeaders && (i4.headers = o2(f2.getAllResponseHeaders()))) : a4 = new Error("Internal XMLHttpRequest Error"), r4(a4, i4, i4.body); } } var s3, c3, f2 = e4.xhr || null; f2 || (f2 = e4.cors || e4.useXDR ? new u2.XDomainRequest() : new u2.XMLHttpRequest()); var d2, l2 = f2.url = e4.uri || e4.url, h2 = f2.method = e4.method || "GET", p2 = e4.body || e4.data, b2 = f2.headers = e4.headers || {}, y2 = !!e4.sync, v2 = false, m2 = { body: void 0, headers: {}, statusCode: 0, method: h2, url: l2, rawRequest: f2 }; if ("json" in e4 && false !== e4.json && (v2 = true, b2.accept || b2.Accept || (b2.Accept = "application/json"), "GET" !== h2 && "HEAD" !== h2 && (b2["content-type"] || b2["Content-Type"] || (b2["Content-Type"] = "application/json"), p2 = JSON.stringify(true === e4.json ? p2 : e4.json))), f2.onreadystatechange = function() { 4 === f2.readyState && setTimeout(a3, 0); }, f2.onload = a3, f2.onerror = i3, f2.onprogress = function() { }, f2.onabort = function() { c3 = true; }, f2.ontimeout = i3, f2.open(h2, l2, !y2, e4.username, e4.password), y2 || (f2.withCredentials = !!e4.withCredentials), !y2 && e4.timeout > 0 && (d2 = setTimeout(function() { if (!c3) { c3 = true, f2.abort("timeout"); var e5 = new Error("XMLHttpRequest timeout"); e5.code = "ETIMEDOUT", i3(e5); } }, e4.timeout)), f2.setRequestHeader) for (s3 in b2) b2.hasOwnProperty(s3) && f2.setRequestHeader(s3, b2[s3]); else if (e4.headers && !function(e5) { for (var t5 in e5) if (e5.hasOwnProperty(t5)) return false; return true; }(e4.headers)) throw new Error("Headers cannot be set on an XDomainRequest object"); return "responseType" in e4 && (f2.responseType = e4.responseType), "beforeSend" in e4 && "function" == typeof e4.beforeSend && e4.beforeSend(f2), f2.send(p2 || null), f2; } e3.exports = u2, e3.exports.default = u2, u2.XMLHttpRequest = n2.XMLHttpRequest || function() { }, u2.XDomainRequest = "withCredentials" in new u2.XMLHttpRequest() ? u2.XMLHttpRequest : n2.XDomainRequest, function(e4, t4) { for (var r4 = 0; r4 < e4.length; r4++) t4(e4[r4]); }(["get", "put", "post", "patch", "head", "delete"], function(e4) { u2["delete" === e4 ? "del" : e4] = function(t4, r4, n3) { return (r4 = s2(t4, r4, n3)).method = e4.toUpperCase(), c2(r4); }; }); }, 87705: (e3) => { e3.exports = function() { for (var e4 = {}, r3 = 0; r3 < arguments.length; r3++) { var n2 = arguments[r3]; for (var i2 in n2) t3.call(n2, i2) && (e4[i2] = n2[i2]); } return e4; }; var t3 = Object.prototype.hasOwnProperty; }, 42463: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(26427), o2 = function e4(t4) { this.givenProvider = e4.givenProvider, t4 && t4._requestManager && (t4 = t4.currentProvider), "undefined" != typeof document && (this.pick = i2.pick), this.setProvider(t4); }; o2.givenProvider = null, "undefined" != typeof ethereum && ethereum.bzz && (o2.givenProvider = ethereum.bzz), o2.prototype.setProvider = function(e4) { if (e4 && "object" === (0, n2.default)(e4) && "string" == typeof e4.bzz && (e4 = e4.bzz), "string" != typeof e4) { this.currentProvider = null; var t4 = new Error("No provider set, please set one using bzz.setProvider()."); return this.download = this.upload = this.isAvailable = function() { throw t4; }, false; } return this.currentProvider = e4, this.download = i2.at(e4).download, this.upload = i2.at(e4).upload, this.isAvailable = i2.at(e4).isAvailable, true; }, e3.exports = o2; }, 94246: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)); e3.exports = { ErrorResponse: function(e4) { var t4 = e4 && e4.error && e4.error.message ? e4.error.message : JSON.stringify(e4), r4 = e4.error && e4.error.data ? e4.error.data : null, n3 = new Error("Returned error: " + t4); return n3.data = r4, n3; }, InvalidNumberOfParams: function(e4, t4, r4) { return new Error('Invalid number of parameters for "' + r4 + '". Got ' + e4 + " expected " + t4 + "!"); }, InvalidConnection: function(e4, t4) { return this.ConnectionError("CONNECTION ERROR: Couldn't connect to node " + e4 + ".", t4); }, InvalidProvider: function() { return new Error("Provider not set or invalid"); }, InvalidResponse: function(e4) { var t4 = e4 && e4.error && e4.error.message ? e4.error.message : "Invalid JSON RPC response: " + JSON.stringify(e4); return new Error(t4); }, ConnectionTimeout: function(e4) { return new Error("CONNECTION TIMEOUT: timeout of " + e4 + " ms achived"); }, ConnectionNotOpenError: function(e4) { return this.ConnectionError("connection not open on send()", e4); }, ConnectionCloseError: function(e4) { return "object" === (0, n2.default)(e4) && e4.code && e4.reason ? this.ConnectionError("CONNECTION ERROR: The connection got closed with the close code `" + e4.code + "` and the following reason string `" + e4.reason + "`", e4) : new Error("CONNECTION ERROR: The connection closed unexpectedly"); }, MaxAttemptsReachedOnReconnectingError: function() { return new Error("Maximum number of reconnect attempts reached!"); }, PendingRequestsOnReconnectingError: function() { return new Error("CONNECTION ERROR: Provider started to reconnect before the response got received!"); }, ConnectionError: function(e4, t4) { var r4 = new Error(e4); return t4 && (r4.code = t4.code, r4.reason = t4.reason, t4.description && (r4.description = t4.description)), r4; }, RevertInstructionError: function(e4, t4) { var r4 = new Error("Your request got reverted with the following reason string: " + e4); return r4.reason = e4, r4.signature = t4, r4; }, TransactionRevertInstructionError: function(e4, t4, r4) { var n3 = new Error("Transaction has been reverted by the EVM:\n" + JSON.stringify(r4, null, 2)); return n3.reason = e4, n3.signature = t4, n3.receipt = r4, n3; }, TransactionError: function(e4, t4) { var r4 = new Error(e4); return r4.receipt = t4, r4; }, NoContractAddressFoundError: function(e4) { return this.TransactionError("The transaction receipt didn't contain a contract address.", e4); }, ContractCodeNotStoredError: function(e4) { return this.TransactionError("The contract code couldn't be stored, please check your gas limit.", e4); }, TransactionRevertedWithoutReasonError: function(e4) { return this.TransactionError("Transaction has been reverted by the EVM:\n" + JSON.stringify(e4, null, 2), e4); }, TransactionOutOfGasError: function(e4) { return this.TransactionError("Transaction ran out of gas. Please provide more gas:\n" + JSON.stringify(e4, null, 2), e4); }, ResolverMethodMissingError: function(e4, t4) { return new Error("The resolver at " + e4 + 'does not implement requested method: "' + t4 + '".'); }, ContractMissingABIError: function() { return new Error("You must provide the json interface of the contract when instantiating a contract object."); }, ContractOnceRequiresCallbackError: function() { return new Error("Once requires a callback as the second parameter."); }, ContractEventDoesNotExistError: function(e4) { return new Error('Event "' + e4 + `" doesn't exist in this contract.`); }, ContractReservedEventError: function(e4) { return new Error('The event "' + e4 + `" is a reserved event name, you can't use it.`); }, ContractMissingDeployDataError: function() { return new Error('No "data" specified in neither the given options, nor the default options.'); }, ContractNoAddressDefinedError: function() { return new Error("This contract object doesn't have address set yet, please set an address first."); }, ContractNoFromAddressDefinedError: function() { return new Error('No "from" address specified in neither the given options, nor the default options.'); } }; }, 32084: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(90775)), o2 = n2(r3(3355)); function a2(e4, t4) { var r4 = Object.keys(e4); if (Object.getOwnPropertySymbols) { var n3 = Object.getOwnPropertySymbols(e4); t4 && (n3 = n3.filter(function(t5) { return Object.getOwnPropertyDescriptor(e4, t5).enumerable; })), r4.push.apply(r4, n3); } return r4; } function s2(e4) { for (var t4 = 1; t4 < arguments.length; t4++) { var r4 = null != arguments[t4] ? arguments[t4] : {}; t4 % 2 ? a2(Object(r4), true).forEach(function(t5) { (0, i2.default)(e4, t5, r4[t5]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(r4)) : a2(Object(r4)).forEach(function(t5) { Object.defineProperty(e4, t5, Object.getOwnPropertyDescriptor(r4, t5)); }); } return e4; } var u2 = r3(48161), c2 = r3(30006), f2 = function(e4) { return u2.toBN(e4).toString(10); }, d2 = function(e4) { if (void 0 !== e4) return function(e5) { return ["latest", "pending", "earliest", "finalized", "safe"].includes(e5); }(e4) ? e4 : "genesis" === e4 ? "0x0" : u2.isHexStrict(e4) ? "string" == typeof e4 ? e4.toLowerCase() : e4 : u2.numberToHex(e4); }, l2 = function(e4) { if (e4.to && (e4.to = b2(e4.to)), e4.data && e4.input) throw new Error(`You can't have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.`); if (!e4.data && e4.input && (e4.data = e4.input, delete e4.input), e4.data && !e4.data.startsWith("0x") && (e4.data = "0x" + e4.data), e4.data && !u2.isHex(e4.data)) throw new Error("The data field must be HEX encoded data."); return (e4.gas || e4.gasLimit) && (e4.gas = e4.gas || e4.gasLimit), (e4.maxPriorityFeePerGas || e4.maxFeePerGas) && delete e4.gasPrice, ["gasPrice", "gas", "value", "maxPriorityFeePerGas", "maxFeePerGas", "nonce", "type"].filter(function(t4) { return void 0 !== e4[t4]; }).forEach(function(t4) { e4[t4] = u2.numberToHex(e4[t4]); }), e4; }, h2 = function(e4, t4) { return t4 || (null !== e4.blockNumber && (e4.blockNumber = u2.hexToNumber(e4.blockNumber)), null !== e4.transactionIndex && (e4.transactionIndex = u2.hexToNumber(e4.transactionIndex)), e4.nonce = u2.hexToNumber(e4.nonce), e4.gas = u2.hexToNumber(e4.gas), e4.type && (e4.type = u2.hexToNumber(e4.type))), e4.gasPrice && (e4.gasPrice = f2(e4.gasPrice)), e4.maxFeePerGas && (e4.maxFeePerGas = f2(e4.maxFeePerGas)), e4.maxPriorityFeePerGas && (e4.maxPriorityFeePerGas = f2(e4.maxPriorityFeePerGas)), e4.value = f2(e4.value), e4.to && u2.isAddress(e4.to) ? e4.to = u2.toChecksumAddress(e4.to) : e4.to = null, e4.from && (e4.from = u2.toChecksumAddress(e4.from)), e4; }, p2 = function(e4) { if ("string" == typeof e4.blockHash && "string" == typeof e4.transactionHash && "string" == typeof e4.logIndex) { var t4 = u2.sha3(e4.blockHash.replace("0x", "") + e4.transactionHash.replace("0x", "") + e4.logIndex.replace("0x", "")); e4.id = "log_" + t4.replace("0x", "").slice(0, 8); } else e4.id || (e4.id = null); return null !== e4.blockNumber && (e4.blockNumber = u2.hexToNumber(e4.blockNumber)), null !== e4.transactionIndex && (e4.transactionIndex = u2.hexToNumber(e4.transactionIndex)), null !== e4.logIndex && (e4.logIndex = u2.hexToNumber(e4.logIndex)), e4.address && (e4.address = u2.toChecksumAddress(e4.address)), e4; }, b2 = function(e4) { var t4 = new c2(e4); if (t4.isValid() && t4.isDirect()) return t4.toAddress().toLowerCase(); if (u2.isAddress(e4)) return "0x" + e4.toLowerCase().replace("0x", ""); throw new Error("Provided address ".concat(e4, " is invalid, the capitalization checksum test failed, or it's an indirect IBAN address which can't be converted.")); }; e3.exports = { inputDefaultBlockNumberFormatter: function(e4) { return d2(this && null == e4 ? this.defaultBlock : e4); }, inputBlockNumberFormatter: d2, inputCallFormatter: function(e4) { var t4 = (e4 = l2(e4)).from || (this ? this.defaultAccount : null); return t4 && (e4.from = b2(t4)), e4; }, inputTransactionFormatter: function(e4) { if ("number" != typeof (e4 = l2(e4)).from && (!e4.from || "object" !== (0, o2.default)(e4.from))) { if (e4.from = e4.from || (this ? this.defaultAccount : null), !e4.from && "number" != typeof e4.from) throw new Error('The send transactions "from" field must be defined!'); e4.from = b2(e4.from); } return e4; }, inputAddressFormatter: b2, inputPostFormatter: function(e4) { return e4.ttl && (e4.ttl = u2.numberToHex(e4.ttl)), e4.workToProve && (e4.workToProve = u2.numberToHex(e4.workToProve)), e4.priority && (e4.priority = u2.numberToHex(e4.priority)), Array.isArray(e4.topics) || (e4.topics = e4.topics ? [e4.topics] : []), e4.topics = e4.topics.map(function(e5) { return 0 === e5.indexOf("0x") ? e5 : u2.fromUtf8(e5); }), e4; }, inputLogFormatter: function(e4) { var t4 = function(e5) { return null == e5 ? null : 0 === (e5 = String(e5)).indexOf("0x") ? e5 : u2.fromUtf8(e5); }; return void 0 === e4 && (e4 = {}), void 0 === e4.fromBlock && (e4 = s2(s2({}, e4), {}, { fromBlock: "latest" })), (e4.fromBlock || 0 === e4.fromBlock) && (e4.fromBlock = d2(e4.fromBlock)), (e4.toBlock || 0 === e4.toBlock) && (e4.toBlock = d2(e4.toBlock)), e4.topics = e4.topics || [], e4.topics = e4.topics.map(function(e5) { return Array.isArray(e5) ? e5.map(t4) : t4(e5); }), t4 = null, e4.address && (e4.address = Array.isArray(e4.address) ? e4.address.map(function(e5) { return b2(e5); }) : b2(e4.address)), e4; }, inputSignFormatter: function(e4) { return u2.isHexStrict(e4) ? e4 : u2.utf8ToHex(e4); }, inputStorageKeysFormatter: function(e4) { return e4.map(u2.numberToHex); }, outputProofFormatter: function(e4) { return e4.address = u2.toChecksumAddress(e4.address), e4.nonce = u2.hexToNumberString(e4.nonce), e4.balance = u2.hexToNumberString(e4.balance), e4; }, outputBigNumberFormatter: f2, outputTransactionFormatter: h2, outputTransactionReceiptFormatter: function(e4) { if ("object" !== (0, o2.default)(e4)) throw new Error("Received receipt is invalid: " + e4); return this.hexFormat || (null !== e4.blockNumber && (e4.blockNumber = u2.hexToNumber(e4.blockNumber)), null !== e4.transactionIndex && (e4.transactionIndex = u2.hexToNumber(e4.transactionIndex)), e4.cumulativeGasUsed = u2.hexToNumber(e4.cumulativeGasUsed), e4.gasUsed = u2.hexToNumber(e4.gasUsed), e4.effectiveGasPrice && (e4.effectiveGasPrice = u2.hexToNumber(e4.effectiveGasPrice))), Array.isArray(e4.logs) && (e4.logs = e4.logs.map(p2)), e4.contractAddress && (e4.contractAddress = u2.toChecksumAddress(e4.contractAddress)), void 0 !== e4.status && null !== e4.status && (e4.status = Boolean(parseInt(e4.status))), e4; }, outputBlockFormatter: function(e4, t4) { return t4 || (e4.gasLimit = u2.hexToNumber(e4.gasLimit), e4.gasUsed = u2.hexToNumber(e4.gasUsed), e4.size = u2.hexToNumber(e4.size), e4.timestamp = u2.hexToNumber(e4.timestamp), null !== e4.number && (e4.number = u2.hexToNumber(e4.number))), e4.difficulty && (e4.difficulty = f2(e4.difficulty)), e4.totalDifficulty && (e4.totalDifficulty = f2(e4.totalDifficulty)), Array.isArray(e4.transactions) && e4.transactions.forEach(function(e5) { if ("string" != typeof e5) return h2(e5, t4); }), e4.miner && (e4.miner = u2.toChecksumAddress(e4.miner)), e4.baseFeePerGas && (e4.baseFeePerGas = u2.hexToNumber(e4.baseFeePerGas)), e4; }, outputLogFormatter: p2, outputPostFormatter: function(e4) { return e4.expiry = u2.hexToNumber(e4.expiry), e4.sent = u2.hexToNumber(e4.sent), e4.ttl = u2.hexToNumber(e4.ttl), e4.workProved = u2.hexToNumber(e4.workProved), e4.topics || (e4.topics = []), e4.topics = e4.topics.map(function(e5) { return u2.toUtf8(e5); }), e4; }, outputSyncingFormatter: function(e4) { return e4.startingBlock = u2.hexToNumber(e4.startingBlock), e4.currentBlock = u2.hexToNumber(e4.currentBlock), e4.highestBlock = u2.hexToNumber(e4.highestBlock), e4.knownStates && (e4.knownStates = u2.hexToNumber(e4.knownStates), e4.pulledStates = u2.hexToNumber(e4.pulledStates)), e4; } }; }, 11314: (e3, t3, r3) => { var n2 = r3(94246), i2 = r3(32084); e3.exports = { errors: n2, formatters: i2 }; }, 53349: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(82247)), o2 = n2(r3(74519)), a2 = n2(r3(90775)), s2 = n2(r3(94571)), u2 = n2(r3(3355)); function c2(e4, t4) { var r4 = Object.keys(e4); if (Object.getOwnPropertySymbols) { var n3 = Object.getOwnPropertySymbols(e4); t4 && (n3 = n3.filter(function(t5) { return Object.getOwnPropertyDescriptor(e4, t5).enumerable; })), r4.push.apply(r4, n3); } return r4; } function f2(e4) { for (var t4 = 1; t4 < arguments.length; t4++) { var r4 = null != arguments[t4] ? arguments[t4] : {}; t4 % 2 ? c2(Object(r4), true).forEach(function(t5) { (0, a2.default)(e4, t5, r4[t5]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(r4)) : c2(Object(r4)).forEach(function(t5) { Object.defineProperty(e4, t5, Object.getOwnPropertyDescriptor(r4, t5)); }); } return e4; } var d2 = r3(11314).errors, l2 = r3(11314).formatters, h2 = r3(48161), p2 = r3(90282), b2 = r3(34178).subscriptions, y2 = r3(21936), v2 = function(e4) { if (!e4.call || !e4.name) throw new Error('When creating a method you need to provide at least the "name" and "call" property.'); this.name = e4.name, this.call = e4.call, this.params = e4.params || 0, this.inputFormatter = e4.inputFormatter, this.outputFormatter = e4.outputFormatter, this.transformPayload = e4.transformPayload, this.extraFormatters = e4.extraFormatters, this.abiCoder = e4.abiCoder, this.requestManager = e4.requestManager, this.accounts = e4.accounts, this.defaultBlock = e4.defaultBlock || "latest", this.defaultAccount = e4.defaultAccount || null, this.transactionBlockTimeout = e4.transactionBlockTimeout || 50, this.transactionConfirmationBlocks = e4.transactionConfirmationBlocks || 24, this.transactionPollingTimeout = e4.transactionPollingTimeout || 750, this.transactionPollingInterval = e4.transactionPollingInterval || 1e3, this.blockHeaderTimeout = e4.blockHeaderTimeout || 10, this.defaultCommon = e4.defaultCommon, this.defaultChain = e4.defaultChain, this.defaultHardfork = e4.defaultHardfork, this.handleRevert = e4.handleRevert; }; v2.prototype.setRequestManager = function(e4, t4) { this.requestManager = e4, t4 && (this.accounts = t4); }, v2.prototype.createFunction = function(e4, t4) { var r4 = this.buildCall(); return Object.defineProperty(r4, "call", { configurable: true, writable: true, value: this.call }), this.setRequestManager(e4 || this.requestManager, t4 || this.accounts), r4; }, v2.prototype.attachToObject = function(e4) { var t4 = this.buildCall(); Object.defineProperty(t4, "call", { configurable: true, writable: true, value: this.call }); var r4 = this.name.split("."); r4.length > 1 ? (e4[r4[0]] = e4[r4[0]] || {}, e4[r4[0]][r4[1]] = t4) : e4[r4[0]] = t4; }, v2.prototype.getCall = function(e4) { return "function" == typeof this.call ? this.call(e4) : this.call; }, v2.prototype.extractCallback = function(e4) { if ("function" == typeof e4[e4.length - 1]) return e4.pop(); }, v2.prototype.validateArgs = function(e4) { if (e4.length !== this.params) throw d2.InvalidNumberOfParams(e4.length, this.params, this.name); }, v2.prototype.formatInput = function(e4) { var t4 = this; return this.inputFormatter ? this.inputFormatter.map(function(r4, n3) { return r4 ? r4.call(t4, e4[n3]) : e4[n3]; }) : e4; }, v2.prototype.formatOutput = function(e4) { var t4 = this; return Array.isArray(e4) ? e4.map(function(e5) { return t4.outputFormatter && e5 ? t4.outputFormatter(e5, null == this ? void 0 : this.hexFormat) : e5; }) : this.outputFormatter && e4 ? this.outputFormatter(e4, null == this ? void 0 : this.hexFormat) : e4; }, v2.prototype.toPayload = function(e4) { var t4 = this.getCall(e4), r4 = this.extractCallback(e4), n3 = this.formatInput(e4); this.validateArgs(n3); var i3 = { method: t4, params: n3, callback: r4 }; return this.transformPayload && (i3 = this.transformPayload(i3)), i3; }, v2.prototype._confirmTransaction = function(e4, t4, r4) { var n3 = this, o3 = false, a3 = true, c3 = 0, f3 = 0, m3 = null, g2 = null, w2 = null, k2 = r4.params[0] && "object" === (0, u2.default)(r4.params[0]) && r4.params[0].gas ? r4.params[0].gas : null, _2 = !!r4.params[0] && "object" === (0, u2.default)(r4.params[0]) && r4.params[0].data && r4.params[0].from && !r4.params[0].to, A2 = _2 && r4.params[0].data.length > 2, E2 = [new v2({ name: "getBlockByNumber", call: "eth_getBlockByNumber", params: 2, inputFormatter: [l2.inputBlockNumberFormatter, function(e5) { return !!e5; }], outputFormatter: l2.outputBlockFormatter }), new v2({ name: "getTransactionReceipt", call: "eth_getTransactionReceipt", params: 1, inputFormatter: [null], outputFormatter: l2.outputTransactionReceiptFormatter }), new v2({ name: "getCode", call: "eth_getCode", params: 2, inputFormatter: [l2.inputAddressFormatter, l2.inputDefaultBlockNumberFormatter] }), new v2({ name: "getTransactionByHash", call: "eth_getTransactionByHash", params: 1, inputFormatter: [null], outputFormatter: l2.outputTransactionFormatter }), new b2({ name: "subscribe", type: "eth", subscriptions: { newBlockHeaders: { subscriptionName: "newHeads", params: 0, outputFormatter: l2.outputBlockFormatter } } })], S2 = {}; E2.forEach(function(e5) { e5.attachToObject(S2), e5.requestManager = n3.requestManager; }); var x2 = function(u3, b3, v3, E3, x3) { if (!v3) return x3 || (x3 = { unsubscribe: function() { clearInterval(m3), clearTimeout(g2); } }), (u3 ? p2.resolve(u3) : S2.getTransactionReceipt(t4)).catch(function(t5) { x3.unsubscribe(), o3 = true, h2._fireError({ message: "Failed to check for transaction receipt:", data: t5 }, e4.eventEmitter, e4.reject); }).then(function() { var t5 = (0, s2.default)(i2.default.mark(function t6(r5) { var o4, s3, c4; return i2.default.wrap(function(t7) { for (; ; ) switch (t7.prev = t7.next) { case 0: if (r5 && r5.blockHash) { t7.next = 2; break; } throw new Error("Receipt missing or blockHash null"); case 2: if (n3.extraFormatters && n3.extraFormatters.receiptFormatter && (r5 = n3.extraFormatters.receiptFormatter(r5)), !(e4.eventEmitter.listeners("confirmation").length > 0)) { t7.next = 28; break; } if (void 0 !== u3 && 0 === f3) { t7.next = 25; break; } return t7.next = 7, S2.getBlockByNumber("latest"); case 7: if (s3 = t7.sent, c4 = s3 ? s3.hash : null, !b3) { t7.next = 24; break; } if (!w2) { t7.next = 17; break; } return t7.next = 13, S2.getBlockByNumber(w2.number + 1); case 13: (o4 = t7.sent) && (w2 = o4, e4.eventEmitter.emit("confirmation", f3, r5, c4)), t7.next = 22; break; case 17: return t7.next = 19, S2.getBlockByNumber(r5.blockNumber); case 19: o4 = t7.sent, w2 = o4, e4.eventEmitter.emit("confirmation", f3, r5, c4); case 22: t7.next = 25; break; case 24: e4.eventEmitter.emit("confirmation", f3, r5, c4); case 25: (b3 && o4 || !b3) && f3++, a3 = false, f3 === n3.transactionConfirmationBlocks + 1 && (x3.unsubscribe(), e4.eventEmitter.removeAllListeners()); case 28: return t7.abrupt("return", r5); case 29: case "end": return t7.stop(); } }, t6); })); return function(e5) { return t5.apply(this, arguments); }; }()).then(function() { var t5 = (0, s2.default)(i2.default.mark(function t6(r5) { var s3; return i2.default.wrap(function(t7) { for (; ; ) switch (t7.prev = t7.next) { case 0: if (!_2 || o3) { t7.next = 19; break; } if (r5.contractAddress) { t7.next = 5; break; } return a3 && (x3.unsubscribe(), o3 = true), h2._fireError(d2.NoContractAddressFoundError(r5), e4.eventEmitter, e4.reject, null, r5), t7.abrupt("return"); case 5: return t7.prev = 5, t7.next = 8, S2.getCode(r5.contractAddress); case 8: s3 = t7.sent, t7.next = 13; break; case 11: t7.prev = 11, t7.t0 = t7.catch(5); case 13: if (s3) { t7.next = 15; break; } return t7.abrupt("return"); case 15: true === r5.status && A2 || s3.length > 2 ? (e4.eventEmitter.emit("receipt", r5), n3.extraFormatters && n3.extraFormatters.contractDeployFormatter ? e4.resolve(n3.extraFormatters.contractDeployFormatter(r5)) : e4.resolve(r5), a3 && e4.eventEmitter.removeAllListeners()) : h2._fireError(d2.ContractCodeNotStoredError(r5), e4.eventEmitter, e4.reject, null, r5), a3 && x3.unsubscribe(), o3 = true; case 19: return t7.abrupt("return", r5); case 20: case "end": return t7.stop(); } }, t6, null, [[5, 11]]); })); return function(e5) { return t5.apply(this, arguments); }; }()).then(function() { var t5 = (0, s2.default)(i2.default.mark(function t6(s3) { var u4, c4, f4, p3; return i2.default.wrap(function(t7) { for (; ; ) switch (t7.prev = t7.next) { case 0: if (_2 || o3) { t7.next = 35; break; } if (s3.outOfGas || k2 && k2 === s3.gasUsed || true !== s3.status && "0x1" !== s3.status && void 0 !== s3.status) { t7.next = 7; break; } e4.eventEmitter.emit("receipt", s3), e4.resolve(s3), a3 && e4.eventEmitter.removeAllListeners(), t7.next = 33; break; case 7: if (JSON.stringify(s3, null, 2), false !== s3.status && "0x0" !== s3.status) { t7.next = 32; break; } if (t7.prev = 9, u4 = null, !n3.handleRevert || "eth_sendTransaction" !== n3.call && "eth_sendRawTransaction" !== n3.call) { t7.next = 24; break; } return c4 = r4.params[0], "eth_sendRawTransaction" === n3.call && (f4 = r4.params[0], p3 = y2.parse(f4), c4 = l2.inputTransactionFormatter({ data: p3.data, to: p3.to, from: p3.from, gas: p3.gasLimit.toHexString(), gasPrice: p3.gasPrice ? p3.gasPrice.toHexString() : void 0, value: p3.value.toHexString() })), t7.next = 16, n3.getRevertReason(c4, s3.blockNumber); case 16: if (!(u4 = t7.sent)) { t7.next = 21; break; } h2._fireError(d2.TransactionRevertInstructionError(u4.reason, u4.signature, s3), e4.eventEmitter, e4.reject, null, s3), t7.next = 22; break; case 21: throw false; case 22: t7.next = 25; break; case 24: throw false; case 25: t7.next = 30; break; case 27: t7.prev = 27, t7.t0 = t7.catch(9), h2._fireError(d2.TransactionRevertedWithoutReasonError(s3), e4.eventEmitter, e4.reject, null, s3); case 30: t7.next = 33; break; case 32: h2._fireError(d2.TransactionOutOfGasError(s3), e4.eventEmitter, e4.reject, null, s3); case 33: a3 && x3.unsubscribe(), o3 = true; case 35: case "end": return t7.stop(); } }, t6, null, [[9, 27]]); })); return function(e5) { return t5.apply(this, arguments); }; }()).catch(function() { c3++, b3 ? c3 - 1 >= n3.transactionPollingTimeout && (x3.unsubscribe(), o3 = true, h2._fireError(d2.TransactionError("Transaction was not mined within " + n3.transactionPollingTimeout + " seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"), e4.eventEmitter, e4.reject)) : c3 - 1 >= n3.transactionBlockTimeout && (x3.unsubscribe(), o3 = true, h2._fireError(d2.TransactionError("Transaction was not mined within " + n3.transactionBlockTimeout + " blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"), e4.eventEmitter, e4.reject)); }); x3.unsubscribe(), o3 = true, h2._fireError({ message: "Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.", data: v3 }, e4.eventEmitter, e4.reject); }, B2 = (function(e5) { var t5 = false, r5 = function() { m3 = setInterval(x2.bind(null, e5, true), n3.transactionPollingInterval); }; if (!this.requestManager.provider.on) return r5(); S2.subscribe("newBlockHeaders", function(n4, i3, o4) { if (t5 = true, n4 || !i3) return r5(); x2(e5, false, n4, 0, o4); }), g2 = setTimeout(function() { t5 || r5(); }, 1e3 * this.blockHeaderTimeout); }).bind(this); S2.getTransactionReceipt(t4).then(function(t5) { t5 && t5.blockHash ? (e4.eventEmitter.listeners("confirmation").length > 0 && B2(t5), x2(t5, false)) : o3 || B2(); }).catch(function() { o3 || B2(); }); }; var m2 = function(e4, t4) { return "number" == typeof e4 ? t4.wallet[e4] : e4 && "object" === (0, u2.default)(e4) && e4.address && e4.privateKey ? e4 : t4.wallet[e4.toLowerCase()]; }; v2.prototype.buildCall = function() { var e4 = this, t4 = "eth_sendTransaction" === e4.call || "eth_sendRawTransaction" === e4.call, r4 = "eth_call" === e4.call, n3 = function() { var n4 = Array.prototype.slice.call(arguments), i3 = p2(!t4), a3 = e4.toPayload(n4); e4.hexFormat = false, "eth_getTransactionReceipt" !== e4.call && "eth_getTransactionByHash" !== e4.call && "getBlock" !== e4.name || (e4.hexFormat = a3.params.length < n4.length && "hex" === n4[n4.length - 1]); var s3 = function(n5, o3) { if (e4.handleRevert && r4 && e4.abiCoder) { var s4; if (!n5 && e4.isRevertReasonString(o3)) s4 = o3.substring(10); else if (n5 && n5.data) { var c4; s4 = "object" === (0, u2.default)(n5.data) ? (null !== (c4 = n5.data.originalError) && void 0 !== c4 ? c4 : n5.data).data.substring(10) : n5.data.substring(10); } if (s4) { var f3 = e4.abiCoder.decodeParameter("string", "0x" + s4), l4 = "Error(String)"; return void h2._fireError(d2.RevertInstructionError(f3, l4), i3.eventEmitter, i3.reject, a3.callback, { reason: f3, signature: l4 }); } } try { o3 = e4.formatOutput(o3); } catch (e5) { n5 = e5; } if (o3 instanceof Error && (n5 = o3), n5) return n5.error && (n5 = n5.error), h2._fireError(n5, i3.eventEmitter, i3.reject, a3.callback); a3.callback && a3.callback(null, o3), t4 ? (i3.eventEmitter.emit("transactionHash", o3), e4._confirmTransaction(i3, o3, a3)) : n5 || i3.resolve(o3); }, c3 = function(t5) { var r5 = f2(f2({}, a3), {}, { method: "eth_sendRawTransaction", params: [t5.rawTransaction] }); e4.requestManager.send(r5, s3); }, l3 = function(e5, t5) { var r5; if (t5 && t5.accounts && t5.accounts.wallet && t5.accounts.wallet.length) { if ("eth_sendTransaction" === e5.method) { var n5 = e5.params[0]; if ((r5 = m2(n5 && "object" === (0, u2.default)(n5) ? n5.from : null, t5.accounts)) && r5.privateKey) return delete (n5 = JSON.parse(JSON.stringify(n5))).from, t5.defaultChain && !n5.chain && (n5.chain = t5.defaultChain), t5.defaultHardfork && !n5.hardfork && (n5.hardfork = t5.defaultHardfork), t5.defaultCommon && !n5.common && (n5.common = t5.defaultCommon), void t5.accounts.signTransaction(n5, r5.privateKey).then(c3).catch(function(e6) { if ("function" == typeof i3.eventEmitter.listeners && i3.eventEmitter.listeners("error").length) { try { i3.eventEmitter.emit("error", e6); } catch (e7) { } i3.eventEmitter.removeAllListeners(), i3.eventEmitter.catch(function() { }); } i3.reject(e6); }); } else if ("eth_sign" === e5.method) { var o3 = e5.params[1]; if ((r5 = m2(e5.params[0], t5.accounts)) && r5.privateKey) { var a4 = t5.accounts.sign(o3, r5.privateKey); return e5.callback && e5.callback(null, a4.signature), void i3.resolve(a4.signature); } } } return t5.requestManager.send(e5, s3); }, b3 = t4 && !!a3.params[0] && "object" === (0, u2.default)(a3.params[0]); return b3 && "0x1" === a3.params[0].type && void 0 === a3.params[0].accessList && (a3.params[0].accessList = []), !b3 || void 0 !== a3.params[0].gasPrice || void 0 !== a3.params[0].maxPriorityFeePerGas && void 0 !== a3.params[0].maxFeePerGas ? (t4 && setTimeout(function() { i3.eventEmitter.emit("sending", a3); }, 0), l3(a3, e4)) : function(e5, t5) { return new Promise(function(r5, n5) { try { var i4 = new v2({ name: "getBlockByNumber", call: "eth_getBlockByNumber", params: 2, inputFormatter: [function(e6) { return e6 ? h2.toHex(e6) : "latest"; }, function() { return false; }] }).createFunction(e5.requestManager), a4 = new v2({ name: "getGasPrice", call: "eth_gasPrice", params: 0 }).createFunction(e5.requestManager); Promise.all([i4(), a4()]).then(function(e6) { var n6 = (0, o2.default)(e6, 2), i5 = n6[0], a5 = n6[1]; if (("0x2" === t5.type || void 0 === t5.type) && i5 && i5.baseFeePerGas) { var s4, u3; t5.gasPrice ? (s4 = t5.gasPrice, u3 = t5.gasPrice, delete t5.gasPrice) : (s4 = t5.maxPriorityFeePerGas || "0x9502F900", u3 = t5.maxFeePerGas || h2.toHex(h2.toBN(i5.baseFeePerGas).mul(h2.toBN(2)).add(h2.toBN(s4)))), r5({ maxFeePerGas: u3, maxPriorityFeePerGas: s4 }); } else { if (t5.maxPriorityFeePerGas || t5.maxFeePerGas) throw Error("Network doesn't support eip-1559"); r5({ gasPrice: a5 }); } }); } catch (e6) { n5(e6); } }); }(e4, a3.params[0]).then(function(r5) { void 0 !== r5.gasPrice ? a3.params[0].gasPrice = r5.gasPrice : void 0 !== r5.maxPriorityFeePerGas && void 0 !== r5.maxFeePerGas && (a3.params[0].maxPriorityFeePerGas = r5.maxPriorityFeePerGas, a3.params[0].maxFeePerGas = r5.maxFeePerGas), t4 && setTimeout(function() { i3.eventEmitter.emit("sending", a3); }, 0), l3(a3, e4); }), t4 && setTimeout(function() { i3.eventEmitter.emit("sent", a3); }, 0), i3.eventEmitter; }; return n3.method = e4, n3.request = this.request.bind(this), n3; }, v2.prototype.getRevertReason = function(e4, t4) { var r4 = this; return new Promise(function(n3, i3) { new v2({ name: "call", call: "eth_call", params: 2, abiCoder: r4.abiCoder, handleRevert: true }).createFunction(r4.requestManager)(e4, h2.numberToHex(t4)).then(function() { n3(false); }).catch(function(e5) { e5.reason ? n3({ reason: e5.reason, signature: e5.signature }) : i3(e5); }); }); }, v2.prototype.isRevertReasonString = function(e4) { return "string" == typeof e4 && (e4.length - 2) / 2 % 32 == 4 && "0x08c379a0" === e4.substring(0, 10); }, v2.prototype.request = function() { var e4 = this.toPayload(Array.prototype.slice.call(arguments)); return e4.format = this.formatOutput.bind(this), e4; }, e3.exports = v2; }, 90282: (e3, t3, r3) => { var n2 = r3(98008), i2 = function(e4) { var t4, r4, i3 = new Promise(function() { t4 = arguments[0], r4 = arguments[1]; }); if (e4) return { resolve: t4, reject: r4, eventEmitter: i3 }; var o2 = new n2(); return i3._events = o2._events, i3.emit = o2.emit, i3.on = o2.on, i3.once = o2.once, i3.off = o2.off, i3.listeners = o2.listeners, i3.addListener = o2.addListener, i3.removeListener = o2.removeListener, i3.removeAllListeners = o2.removeAllListeners, { resolve: t4, reject: r4, eventEmitter: i3 }; }; i2.resolve = function(e4) { var t4 = i2(true); return t4.resolve(e4), t4.eventEmitter; }, e3.exports = i2; }, 35229: (e3, t3, r3) => { var n2 = r3(48155), i2 = r3(11314).errors, o2 = function(e4) { this.requestManager = e4, this.requests = []; }; o2.prototype.add = function(e4) { this.requests.push(e4); }, o2.prototype.execute = function() { var e4 = this.requests, t4 = this._sortResponses.bind(this); this.requestManager.sendBatch(e4, function(r4, o3) { o3 = t4(o3), e4.map(function(e5, t5) { return o3[t5] || {}; }).forEach(function(t5, r5) { if (e4[r5].callback) { if (t5 && t5.error) return e4[r5].callback(i2.ErrorResponse(t5)); if (!n2.isValidResponse(t5)) return e4[r5].callback(i2.InvalidResponse(t5)); try { e4[r5].callback(null, e4[r5].format ? e4[r5].format(t5.result) : t5.result); } catch (t6) { e4[r5].callback(t6); } } }); }); }, o2.prototype._sortResponses = function(e4) { return (e4 || []).sort(function(e5, t4) { return e5.id - t4.id; }); }, e3.exports = o2; }, 99764: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = null, o2 = "object" === ("undefined" == typeof globalThis ? "undefined" : (0, n2.default)(globalThis)) ? globalThis : void 0; if (!o2) try { o2 = Function("return this")(); } catch (e4) { o2 = self; } void 0 !== o2.ethereum ? i2 = o2.ethereum : void 0 !== o2.web3 && o2.web3.currentProvider && (o2.web3.currentProvider.sendAsync && (o2.web3.currentProvider.send = o2.web3.currentProvider.sendAsync, delete o2.web3.currentProvider.sendAsync), !o2.web3.currentProvider.on && o2.web3.currentProvider.connection && "ipcProviderWrapper" === o2.web3.currentProvider.connection.constructor.name && (o2.web3.currentProvider.on = function(e4, t4) { if ("function" != typeof t4) throw new Error("The second parameter callback must be a function."); "data" === e4 ? this.connection.on("data", function(e5) { var r4 = ""; e5 = e5.toString(); try { r4 = JSON.parse(e5); } catch (r5) { return t4(new Error("Couldn't parse response data" + e5)); } r4.id || -1 === r4.method.indexOf("_subscription") || t4(null, r4); }) : this.connection.on(e4, t4); }), i2 = o2.web3.currentProvider), e3.exports = i2; }, 92033: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(45058).callbackify, o2 = r3(11314).errors, a2 = r3(48155), s2 = r3(35229), u2 = r3(99764), c2 = function e4(t4, r4) { this.provider = null, this.providers = e4.providers, this.setProvider(t4, r4), this.subscriptions = /* @__PURE__ */ new Map(); }; c2.givenProvider = u2, c2.providers = { WebsocketProvider: r3(77651), HttpProvider: r3(14565), IpcProvider: r3(52683) }, c2.prototype.setProvider = function(e4, t4) { var r4 = this; if (e4 && "string" == typeof e4 && this.providers) { if (/^http(s)?:\/\//i.test(e4)) e4 = new this.providers.HttpProvider(e4); else if (/^ws(s)?:\/\//i.test(e4)) e4 = new this.providers.WebsocketProvider(e4); else if (e4 && "object" === (0, n2.default)(t4) && "function" == typeof t4.connect) e4 = new this.providers.IpcProvider(e4, t4); else if (e4) throw new Error(`Can't autodetect provider for "` + e4 + '"'); } this.provider && this.provider.connected && this.clearSubscriptions(), this.provider = e4 || null, this.provider && this.provider.on && ("function" == typeof e4.request ? this.provider.on("message", function(e5) { if (e5 && "eth_subscription" === e5.type && e5.data) { var t5 = e5.data; t5.subscription && r4.subscriptions.has(t5.subscription) && r4.subscriptions.get(t5.subscription).callback(null, t5.result); } }) : this.provider.on("data", function(e5, t5) { (e5 = e5 || t5).method && e5.params && e5.params.subscription && r4.subscriptions.has(e5.params.subscription) && r4.subscriptions.get(e5.params.subscription).callback(null, e5.params.result); }), this.provider.on("connect", function() { r4.subscriptions.forEach(function(e5) { e5.subscription.resubscribe(); }); }), this.provider.on("error", function(e5) { r4.subscriptions.forEach(function(t5) { t5.callback(e5); }); }), this.provider.on("disconnect", function(e5) { r4._isCleanCloseEvent(e5) && !r4._isIpcCloseError(e5) || (r4.subscriptions.forEach(function(t5) { t5.callback(o2.ConnectionCloseError(e5)), r4.subscriptions.delete(t5.subscription.id); }), r4.provider && r4.provider.emit && r4.provider.emit("error", o2.ConnectionCloseError(e5))), r4.provider && r4.provider.emit && r4.provider.emit("end", e5); })); }, c2.prototype.send = function(e4, t4) { if (t4 = t4 || function() { }, !this.provider) return t4(o2.InvalidProvider()); var r4 = e4.method, n3 = e4.params, s3 = a2.toPayload(r4, n3), u3 = this._jsonrpcResultCallback(t4, s3); if (this.provider.request) i2(this.provider.request.bind(this.provider))({ method: r4, params: n3 }, t4); else if (this.provider.sendAsync) this.provider.sendAsync(s3, u3); else { if (!this.provider.send) throw new Error("Provider does not have a request or send method to use."); this.provider.send(s3, u3); } }, c2.prototype.sendBatch = function(e4, t4) { if (!this.provider) return t4(o2.InvalidProvider()); var r4 = a2.toBatchPayload(e4); this.provider[this.provider.sendAsync ? "sendAsync" : "send"](r4, function(e5, r5) { return e5 ? t4(e5) : Array.isArray(r5) ? void t4(null, r5) : t4(o2.InvalidResponse(r5)); }); }, c2.prototype.addSubscription = function(e4, t4) { if (!this.provider.on) throw new Error("The provider doesn't support subscriptions: " + this.provider.constructor.name); this.subscriptions.set(e4.id, { callback: t4, subscription: e4 }); }, c2.prototype.removeSubscription = function(e4, t4) { if (this.subscriptions.has(e4)) { var r4 = this.subscriptions.get(e4).subscription.options.type; return this.subscriptions.delete(e4), void this.send({ method: r4 + "_unsubscribe", params: [e4] }, t4); } "function" == typeof t4 && t4(null); }, c2.prototype.clearSubscriptions = function(e4) { try { var t4 = this; return this.subscriptions.size > 0 && this.subscriptions.forEach(function(r4, n3) { e4 && "syncing" === r4.name || t4.removeSubscription(n3); }), this.provider.reset && this.provider.reset(), true; } catch (e5) { throw new Error("Error while clearing subscriptions: ".concat(e5)); } }, c2.prototype._isCleanCloseEvent = function(e4) { return "object" === (0, n2.default)(e4) && ([1e3].includes(e4.code) || true === e4.wasClean); }, c2.prototype._isIpcCloseError = function(e4) { return "boolean" == typeof e4 && e4; }, c2.prototype._jsonrpcResultCallback = function(e4, t4) { return function(r4, n3) { return n3 && n3.id && t4.id !== n3.id ? e4(new Error("Wrong response id ".concat(n3.id, " (expected: ").concat(t4.id, ") in ").concat(JSON.stringify(t4)))) : r4 ? e4(r4) : n3 && n3.error ? e4(o2.ErrorResponse(n3)) : a2.isValidResponse(n3) ? void e4(null, n3.result) : e4(o2.InvalidResponse(n3)); }; }, e3.exports = { Manager: c2, BatchManager: s2 }; }, 48155: (e3) => { var t3 = { messageId: Math.floor(Math.random() * Number.MAX_SAFE_INTEGER), toPayload: function(e4, r3) { if (!e4) throw new Error('JSONRPC method should be specified for params: "' + JSON.stringify(r3) + '"!'); return t3.messageId === Number.MAX_SAFE_INTEGER ? t3.messageId = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER) : t3.messageId++, { jsonrpc: "2.0", id: t3.messageId, method: e4, params: r3 || [] }; }, isValidResponse: function(e4) { return Array.isArray(e4) ? e4.every(t4) : t4(e4); function t4(e5) { return !(!e5 || e5.error || "2.0" !== e5.jsonrpc || "number" != typeof e5.id && "string" != typeof e5.id || void 0 === e5.result); } }, toBatchPayload: function(e4) { return e4.map(function(e5) { return t3.toPayload(e5.method, e5.params); }); } }; e3.exports = t3; }, 34178: (e3, t3, r3) => { var n2 = r3(42929), i2 = function(e4) { this.name = e4.name, this.type = e4.type, this.subscriptions = e4.subscriptions || {}, this.requestManager = null; }; i2.prototype.setRequestManager = function(e4) { this.requestManager = e4; }, i2.prototype.attachToObject = function(e4) { var t4 = this.buildCall(), r4 = this.name.split("."); r4.length > 1 ? (e4[r4[0]] = e4[r4[0]] || {}, e4[r4[0]][r4[1]] = t4) : e4[r4[0]] = t4; }, i2.prototype.buildCall = function() { var e4 = this; return function() { e4.subscriptions[arguments[0]] || console.warn("Subscription " + JSON.stringify(arguments[0]) + " doesn't exist. Subscribing anyway."); var t4 = new n2({ subscription: e4.subscriptions[arguments[0]] || {}, requestManager: e4.requestManager, type: e4.type }); return t4.subscribe.apply(t4, arguments); }; }, e3.exports = { subscriptions: i2, subscription: n2 }; }, 42929: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(11314).errors, o2 = r3(98008), a2 = r3(11314).formatters; function s2(e4) { return e4; } function u2(e4) { o2.call(this), this.id = null, this.callback = s2, this.arguments = null, this.lastBlock = null, this.options = { subscription: e4.subscription, type: e4.type, requestManager: e4.requestManager }; } u2.prototype = Object.create(o2.prototype), u2.prototype.constructor = u2, u2.prototype._extractCallback = function(e4) { if ("function" == typeof e4[e4.length - 1]) return e4.pop(); }, u2.prototype._validateArgs = function(e4) { var t4 = this.options.subscription; if (t4 || (t4 = {}), t4.params || (t4.params = 0), e4.length !== t4.params) throw i2.InvalidNumberOfParams(e4.length, t4.params, t4.subscriptionName); }, u2.prototype._formatInput = function(e4) { var t4 = this.options.subscription; return t4 && t4.inputFormatter ? t4.inputFormatter.map(function(t5, r4) { return t5 ? t5(e4[r4]) : e4[r4]; }) : e4; }, u2.prototype._formatOutput = function(e4) { var t4 = this.options.subscription; return t4 && t4.outputFormatter && e4 ? t4.outputFormatter(e4) : e4; }, u2.prototype._toPayload = function(e4) { var t4 = []; if (this.callback = this._extractCallback(e4) || s2, this.subscriptionMethod || (this.subscriptionMethod = e4.shift(), this.options.subscription.subscriptionName && (this.subscriptionMethod = this.options.subscription.subscriptionName)), this.arguments || (this.arguments = this._formatInput(e4), this._validateArgs(this.arguments), e4 = []), t4.push(this.subscriptionMethod), t4 = t4.concat(this.arguments), e4.length) throw new Error("Only a callback is allowed as parameter on an already instantiated subscription."); return { method: this.options.type + "_subscribe", params: t4 }; }, u2.prototype.unsubscribe = function(e4) { this.options.requestManager.removeSubscription(this.id, e4), this.id = null, this.lastBlock = null, this.removeAllListeners(); }, u2.prototype.subscribe = function() { var e4 = this, t4 = Array.prototype.slice.call(arguments), r4 = this._toPayload(t4); if (!r4) return this; if (!this.options.requestManager.provider) return setTimeout(function() { var t5 = new Error("No provider set."); e4.callback(t5, null, e4), e4.emit("error", t5); }, 0), this; if (!this.options.requestManager.provider.on) return setTimeout(function() { var t5 = new Error("The current provider doesn't support subscriptions: " + e4.options.requestManager.provider.constructor.name); e4.callback(t5, null, e4), e4.emit("error", t5); }, 0), this; if (this.lastBlock && this.options.params && "object" === (0, n2.default)(this.options.params) && (r4.params[1] = this.options.params, r4.params[1].fromBlock = a2.inputBlockNumberFormatter(this.lastBlock + 1)), this.id && this.unsubscribe(), this.options.params = r4.params[1], "logs" === r4.params[0] && r4.params[1] && "object" === (0, n2.default)(r4.params[1]) && r4.params[1].hasOwnProperty("fromBlock") && isFinite(r4.params[1].fromBlock)) { var i3 = Object.assign({}, r4.params[1]); this.options.requestManager.send({ method: "eth_getLogs", params: [i3] }, function(t5, r5) { t5 ? setTimeout(function() { e4.callback(t5, null, e4), e4.emit("error", t5); }, 0) : r5.forEach(function(t6) { var r6 = e4._formatOutput(t6); e4.callback(null, r6, e4), e4.emit("data", r6); }); }); } return "object" === (0, n2.default)(r4.params[1]) && delete r4.params[1].fromBlock, this.options.requestManager.send(r4, function(t5, i4) { !t5 && i4 ? (e4.id = i4, e4.method = r4.params[0], e4.options.requestManager.addSubscription(e4, function(t6, r5) { t6 ? (e4.callback(t6, false, e4), e4.emit("error", t6)) : (Array.isArray(r5) || (r5 = [r5]), r5.forEach(function(t7) { var r6 = e4._formatOutput(t7); if (e4.lastBlock = r6 && "object" === (0, n2.default)(r6) ? r6.blockNumber : null, "function" == typeof e4.options.subscription.subscriptionHandler) return e4.options.subscription.subscriptionHandler.call(e4, r6); e4.emit("data", r6), e4.callback(null, r6, e4); })); }), e4.emit("connected", i4)) : setTimeout(function() { e4.callback(t5, false, e4), e4.emit("error", t5); }, 0); }), this; }, u2.prototype.resubscribe = function() { this.options.requestManager.removeSubscription(this.id), this.id = null, this.subscribe(this.callback); }, e3.exports = u2; }, 1949: (e3, t3, r3) => { var n2 = r3(11314).formatters, i2 = r3(53349), o2 = r3(48161); e3.exports = function(e4) { var t4 = function(t5) { var r4; return t5.property ? (e4[t5.property] || (e4[t5.property] = {}), r4 = e4[t5.property]) : r4 = e4, t5.methods && t5.methods.forEach(function(t6) { t6 instanceof i2 || (t6 = new i2(t6)), t6.attachToObject(r4), t6.setRequestManager(e4._requestManager); }), e4; }; return t4.formatters = n2, t4.utils = o2, t4.Method = i2, t4; }; }, 80606: (e3, t3, r3) => { var n2 = r3(92033), i2 = r3(1949); e3.exports = { packageInit: function(e4, t4) { if (t4 = Array.prototype.slice.call(t4), !e4) throw new Error('You need to instantiate using the "new" keyword.'); Object.defineProperty(e4, "currentProvider", { get: function() { return e4._provider; }, set: function(t5) { return e4.setProvider(t5); }, enumerable: true, configurable: true }), t4[0] && t4[0]._requestManager ? e4._requestManager = t4[0]._requestManager : e4._requestManager = new n2.Manager(t4[0], t4[1]), e4.givenProvider = n2.Manager.givenProvider, e4.providers = n2.Manager.providers, e4._provider = e4._requestManager.provider, e4.setProvider || (e4.setProvider = function(t5, r4) { return e4._requestManager.setProvider(t5, r4), e4._provider = e4._requestManager.provider, true; }), e4.setRequestManager = function(t5) { e4._requestManager = t5, e4._provider = t5.provider; }, e4.BatchRequest = n2.BatchManager.bind(null, e4._requestManager), e4.extend = i2(e4); }, addProviders: function(e4) { e4.givenProvider = n2.Manager.givenProvider, e4.providers = n2.Manager.providers; } }; }, 79901: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(29033).Buffer, o2 = r3(48161), a2 = r3(62914).RQ, s2 = r3(62914)._R, u2 = new a2(function(e4, t4) { return !e4.match(/^u?int/) || Array.isArray(t4) || t4 && "object" === (0, n2.default)(t4) && "BN" === t4.constructor.name ? t4 : t4.toString(); }); function c2() { } var f2 = function() { }; f2.prototype.encodeFunctionSignature = function(e4) { return ("function" == typeof e4 || "object" === (0, n2.default)(e4) && e4) && (e4 = o2._jsonInterfaceMethodToString(e4)), o2.sha3(e4).slice(0, 10); }, f2.prototype.encodeEventSignature = function(e4) { return ("function" == typeof e4 || "object" === (0, n2.default)(e4) && e4) && (e4 = o2._jsonInterfaceMethodToString(e4)), o2.sha3(e4); }, f2.prototype.encodeParameter = function(e4, t4) { return this.encodeParameters([e4], [t4]); }, f2.prototype.encodeParameters = function(e4, t4) { var r4 = this; return e4 = r4.mapTypes(e4), t4 = t4.map(function(t5, i3) { var o3 = e4[i3]; return "object" === (0, n2.default)(o3) && o3.type && (o3 = o3.type), t5 = r4.formatParam(o3, t5), "string" == typeof o3 && o3.includes("tuple") && function e5(t6, n3) { if ("array" === t6.name) { if (!t6.type.match(/\[(\d+)\]/)) return n3.map(function(r5) { return e5(u2._getCoder(s2.from(t6.type.replace("[]", ""))), r5); }); var i4 = parseInt(t6.type.match(/\[(\d+)\]/)[1]); if (n3.length !== i4) throw new Error("Array length does not matches with the given input"); return n3.map(function(r5) { return e5(u2._getCoder(s2.from(t6.type.replace(/\[\d+\]/, ""))), r5); }); } t6.coders.forEach(function(t7, i5) { "tuple" === t7.name ? e5(t7, n3[i5]) : n3[i5] = r4.formatParam(t7.name, n3[i5]); }); }(u2._getCoder(s2.from(o3)), t5), t5; }), u2.encode(e4, t4); }, f2.prototype.mapTypes = function(e4) { var t4 = this, r4 = []; return e4.forEach(function(e5) { if ("object" === (0, n2.default)(e5) && "function" === e5.type && (e5 = Object.assign({}, e5, { type: "bytes24" })), t4.isSimplifiedStructFormat(e5)) { var i3 = Object.keys(e5)[0]; r4.push(Object.assign(t4.mapStructNameAndType(i3), { components: t4.mapStructToCoderFormat(e5[i3]) })); } else r4.push(e5); }), r4; }, f2.prototype.isSimplifiedStructFormat = function(e4) { return "object" === (0, n2.default)(e4) && void 0 === e4.components && void 0 === e4.name; }, f2.prototype.mapStructNameAndType = function(e4) { var t4 = "tuple"; return e4.indexOf("[]") > -1 && (t4 = "tuple[]", e4 = e4.slice(0, -2)), { type: t4, name: e4 }; }, f2.prototype.mapStructToCoderFormat = function(e4) { var t4 = this, r4 = []; return Object.keys(e4).forEach(function(i3) { "object" !== (0, n2.default)(e4[i3]) ? r4.push({ name: i3, type: e4[i3] }) : r4.push(Object.assign(t4.mapStructNameAndType(i3), { components: t4.mapStructToCoderFormat(e4[i3]) })); }), r4; }, f2.prototype.formatParam = function(e4, t4) { var r4 = this, n3 = new RegExp(/^bytes([0-9]*)$/), a3 = new RegExp(/^bytes([0-9]*)\[\]$/), s3 = new RegExp(/^(u?int)([0-9]*)$/), u3 = new RegExp(/^(u?int)([0-9]*)\[\]$/); if (o2.isBN(t4) || o2.isBigNumber(t4)) return t4.toString(10); if (e4.match(a3) || e4.match(u3)) return t4.map(function(t5) { return r4.formatParam(e4.replace("[]", ""), t5); }); var c3 = e4.match(s3); if (c3) { var f3 = parseInt(c3[2] || "256"); f3 / 8 < t4.length && (t4 = t4.startsWith("-") ? "-".concat(o2.leftPad(t4.substring(1), f3)) : o2.leftPad(t4, f3)); } if (c3 = e4.match(n3)) { i2.isBuffer(t4) && (t4 = o2.toHex(t4)); var d3 = parseInt(c3[1]); if (d3) { var l2 = 2 * d3; "0x" === t4.substring(0, 2) && (l2 += 2), t4.length < l2 && (t4 = o2.rightPad(t4, 2 * d3)); } t4.length % 2 == 1 && (t4 = "0x0" + t4.substring(2)); } return t4; }, f2.prototype.encodeFunctionCall = function(e4, t4) { return this.encodeFunctionSignature(e4) + this.encodeParameters(e4.inputs, t4).replace("0x", ""); }, f2.prototype.decodeParameter = function(e4, t4) { return this.decodeParameters([e4], t4)[0]; }, f2.prototype.decodeParameters = function(e4, t4) { return this.decodeParametersWith(e4, t4, false); }, f2.prototype.decodeParametersWith = function(e4, t4, r4) { if (e4.length > 0 && (!t4 || "0x" === t4 || "0X" === t4)) throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced."); var i3 = u2.decode(this.mapTypes(e4), "0x" + t4.replace(/0x/i, ""), r4), o3 = new c2(); return o3.__length__ = 0, e4.forEach(function(e5, t5) { var r5 = i3[o3.__length__], a3 = "object" === (0, n2.default)(e5) && e5.type && "string" === e5.type; r5 = "0x" !== r5 || a3 || "string" == typeof e5 && "string" === e5 ? r5 : null, o3[t5] = r5, ("function" == typeof e5 || e5 && "object" === (0, n2.default)(e5)) && e5.name && (o3[e5.name] = r5), o3.__length__++; }), o3; }, f2.prototype.decodeLog = function(e4, t4, r4) { var n3 = this; r4 = Array.isArray(r4) ? r4 : [r4], t4 = t4 || ""; var i3 = [], o3 = [], a3 = 0; e4.forEach(function(e5, t5) { e5.indexed ? (o3[t5] = ["bool", "int", "uint", "address", "fixed", "ufixed"].find(function(t6) { return -1 !== e5.type.indexOf(t6); }) ? n3.decodeParameter(e5.type, r4[a3]) : r4[a3], a3++) : i3[t5] = e5; }); var s3 = t4, u3 = s3 ? this.decodeParametersWith(i3, s3, true) : [], f3 = new c2(); return f3.__length__ = 0, e4.forEach(function(e5, t5) { f3[t5] = "string" === e5.type ? "" : null, void 0 !== u3[t5] && (f3[t5] = u3[t5]), void 0 !== o3[t5] && (f3[t5] = o3[t5]), e5.name && (f3[e5.name] = f3[t5]), f3.__length__++; }), f3; }; var d2 = new f2(); e3.exports = d2; }, 99819: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(28847), o2 = i2(r3(93106)), a2 = i2(r3(3355)), s2 = i2(r3(90775)), u2 = i2(r3(74519)); function c2(e4, t4) { var r4 = Object.keys(e4); if (Object.getOwnPropertySymbols) { var n3 = Object.getOwnPropertySymbols(e4); t4 && (n3 = n3.filter(function(t5) { return Object.getOwnPropertyDescriptor(e4, t5).enumerable; })), r4.push.apply(r4, n3); } return r4; } function f2(e4) { for (var t4 = 1; t4 < arguments.length; t4++) { var r4 = null != arguments[t4] ? arguments[t4] : {}; t4 % 2 ? c2(Object(r4), true).forEach(function(t5) { (0, s2.default)(e4, t5, r4[t5]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(r4)) : c2(Object(r4)).forEach(function(t5) { Object.defineProperty(e4, t5, Object.getOwnPropertyDescriptor(r4, t5)); }); } return e4; } function d2(e4, t4) { (null == t4 || t4 > e4.length) && (t4 = e4.length); for (var r4 = 0, n3 = new Array(t4); r4 < t4; r4++) n3[r4] = e4[r4]; return n3; } var l2 = r3(80606), h2 = r3(53349), p2 = r3(53058), b2 = r3(24293), y2 = r3(67799), v2 = r3(22679), m2 = r3(48161), g2 = r3(11314), w2 = r3(42339).TransactionFactory, k2 = r3(3863).default, _2 = r3(3863).Hardfork, A2 = r3(65907), E2 = function(e4) { return null == e4; }, S2 = function(e4) { return null != e4; }, x2 = function() { var e4 = this; l2.packageInit(this, arguments), delete this.BatchRequest, delete this.extend; var t4 = [new h2({ name: "getNetworkId", call: "net_version", params: 0, outputFormatter: parseInt }), new h2({ name: "getChainId", call: "eth_chainId", params: 0, outputFormatter: m2.hexToNumber }), new h2({ name: "getGasPrice", call: "eth_gasPrice", params: 0 }), new h2({ name: "getTransactionCount", call: "eth_getTransactionCount", params: 2, inputFormatter: [function(e5) { if (m2.isAddress(e5)) return e5; throw new Error("Address " + e5 + ' is not a valid address to get the "transactionCount".'); }, function() { return "latest"; }] }), new h2({ name: "getBlockByNumber", call: "eth_getBlockByNumber", params: 2, inputFormatter: [function(e5) { return e5 ? m2.toHex(e5) : "latest"; }, function() { return false; }] })]; this._ethereumCall = {}, t4.forEach(function(t5) { t5.attachToObject(e4._ethereumCall), t5.setRequestManager(e4._requestManager); }), this.wallet = new O2(this); }; function B2(e4, t4) { return new Promise(function(r4, n3) { try { (void 0 === t4.type || t4.type < "0x2") && void 0 !== t4.gasPrice ? r4({ gasPrice: t4.gasPrice }) : "0x2" === t4.type && t4.maxFeePerGas && t4.maxPriorityFeePerGas ? r4({ maxFeePerGas: t4.maxFeePerGas, maxPriorityFeePerGas: t4.maxPriorityFeePerGas }) : Promise.all([e4._ethereumCall.getBlockByNumber(), e4._ethereumCall.getGasPrice()]).then(function(e5) { var n4 = (0, u2.default)(e5, 2), i3 = n4[0], o3 = n4[1]; if ("0x2" === t4.type && i3 && i3.baseFeePerGas) { var a3, s3; t4.gasPrice ? (a3 = t4.gasPrice, s3 = t4.gasPrice, delete t4.gasPrice) : (a3 = t4.maxPriorityFeePerGas || "0x9502F900", s3 = t4.maxFeePerGas || m2.toHex(m2.toBN(i3.baseFeePerGas).mul(m2.toBN(2)).add(m2.toBN(a3)))), r4({ maxFeePerGas: s3, maxPriorityFeePerGas: a3 }); } else { if (t4.maxPriorityFeePerGas || t4.maxFeePerGas) throw Error("Network doesn't support eip-1559"); r4({ gasPrice: o3 }); } }).catch(function(e5) { n3(e5); }); } catch (e5) { n3(e5); } }); } function O2(e4) { this._accounts = e4, this.length = 0, this.defaultKeyName = "web3js_wallet"; } x2.prototype._addAccountFunctions = function(e4) { var t4 = this; return e4.signTransaction = function(r4, n3) { return t4.signTransaction(r4, e4.privateKey, n3); }, e4.sign = function(r4) { return t4.sign(r4, e4.privateKey); }, e4.encrypt = function(r4, n3) { return t4.encrypt(e4.privateKey, r4, n3); }, e4; }, x2.prototype.create = function(e4) { return this._addAccountFunctions(p2.create(e4 || m2.randomHex(32))); }, x2.prototype.privateKeyToAccount = function(e4, t4) { if (e4.startsWith("0x") || (e4 = "0x" + e4), !t4 && 66 !== e4.length) throw new Error("Private key must be 32 bytes long"); return this._addAccountFunctions(p2.fromPrivate(e4)); }, x2.prototype.signTransaction = function(e4, t4, r4) { var i3 = this, o3 = false, a3 = {}, s3 = !(!e4 || !(e4.chain && e4.hardfork || e4.common)); if (r4 = r4 || function() { }, !e4) return o3 = new Error("No transaction object given!"), r4(o3), Promise.reject(o3); if (S2(e4.common) && E2(e4.common.customChain)) return o3 = new Error("If tx.common is provided it must have tx.common.customChain"), r4(o3), Promise.reject(o3); if (S2(e4.common) && E2(e4.common.customChain.chainId)) return o3 = new Error("If tx.common is provided it must have tx.common.customChain and tx.common.customChain.chainId"), r4(o3), Promise.reject(o3); if (S2(e4.common) && S2(e4.common.customChain.chainId) && S2(e4.chainId) && e4.chainId !== e4.common.customChain.chainId) return o3 = new Error("Chain Id doesnt match in tx.chainId tx.common.customChain.chainId"), r4(o3), Promise.reject(o3); function c3(e5) { var i4 = function(e6) { if (e6.common && e6.chain && e6.hardfork) return new Error("Please provide the @ethereumjs/common object or the chain and hardfork property but not all together."); if (e6.chain && !e6.hardfork || e6.hardfork && !e6.chain) return new Error('When specifying chain and hardfork, both values must be defined. Received "chain": ' + e6.chain + ', "hardfork": ' + e6.hardfork); if (!(e6.gas || e6.gasLimit || e6.maxPriorityFeePerGas || e6.maxFeePerGas)) return new Error('"gas" is missing'); if (e6.gas && e6.gasPrice) { if (e6.gas < 0 || e6.gasPrice < 0) return new Error("Gas or gasPrice is lower than 0"); } else if (e6.maxPriorityFeePerGas < 0 || e6.maxFeePerGas < 0) return new Error("maxPriorityFeePerGas or maxFeePerGas is lower than 0"); return e6.nonce < 0 || e6.chainId < 0 ? new Error("Nonce or chainId is lower than 0") : void 0; }(e5); if (i4) return r4(i4), Promise.reject(i4); try { var o4 = g2.formatters.inputCallFormatter(Object.assign({}, e5)); o4.data = o4.data || "0x", o4.value = o4.value || "0x", o4.gasLimit = o4.gasLimit || o4.gas, "0x1" === o4.type && void 0 === o4.accessList && (o4.accessList = []), s3 ? (o4.common && (a3.common = k2.forCustomChain(o4.common.baseChain || "mainnet", { name: o4.common.customChain.name || "custom-network", networkId: o4.common.customChain.networkId, chainId: o4.common.customChain.chainId }, o4.common.hardfork || _2.London), delete o4.common), o4.chain && (a3.chain = o4.chain, delete o4.chain), o4.hardfork && (a3.hardfork = o4.hardfork, delete o4.hardfork)) : (a3.common = k2.forCustomChain("mainnet", { name: "custom-network", networkId: o4.networkId, chainId: o4.chainId }, o4.hardfork || _2.London), delete o4.networkId), t4.startsWith("0x") && (t4 = t4.substring(2)); var u3 = w2.fromTxData(o4, a3).sign(n2.from(t4, "hex")), c4 = u3.validate(true); if (c4.length > 0) { var f3, l3 = "Signer Error: ", h3 = function(e6, t5) { var r5 = "undefined" != typeof Symbol && e6[Symbol.iterator] || e6["@@iterator"]; if (!r5) { if (Array.isArray(e6) || (r5 = function(e7, t6) { if (e7) { if ("string" == typeof e7) return d2(e7, t6); var r6 = Object.prototype.toString.call(e7).slice(8, -1); return "Object" === r6 && e7.constructor && (r6 = e7.constructor.name), "Map" === r6 || "Set" === r6 ? Array.from(e7) : "Arguments" === r6 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r6) ? d2(e7, t6) : void 0; } }(e6)) || t5 && e6 && "number" == typeof e6.length) { r5 && (e6 = r5); var n3 = 0, i5 = function() { }; return { s: i5, n: function() { return n3 >= e6.length ? { done: true } : { done: false, value: e6[n3++] }; }, e: function(e7) { throw e7; }, f: i5 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o5, a4 = true, s4 = false; return { s: function() { r5 = r5.call(e6); }, n: function() { var e7 = r5.next(); return a4 = e7.done, e7; }, e: function(e7) { s4 = true, o5 = e7; }, f: function() { try { a4 || null == r5.return || r5.return(); } finally { if (s4) throw o5; } } }; }(c4); try { for (h3.s(); !(f3 = h3.n()).done; ) { var p3 = f3.value; l3 += "".concat(l3, " ").concat(p3, "."); } } catch (e6) { h3.e(e6); } finally { h3.f(); } throw new Error(l3); } var b3 = "0x" + u3.serialize().toString("hex"), y3 = m2.keccak256(b3), v3 = { messageHash: "0x" + n2.from(u3.getMessageToSign(true)).toString("hex"), v: "0x" + u3.v.toString("hex"), r: "0x" + u3.r.toString("hex"), s: "0x" + u3.s.toString("hex"), rawTransaction: b3, transactionHash: y3 }; return r4(null, v3), v3; } catch (e6) { return r4(e6), Promise.reject(e6); } } return e4.type = function(e5) { var t5, r5 = void 0 !== e5.maxFeePerGas || void 0 !== e5.maxPriorityFeePerGas; if (void 0 !== e5.type ? t5 = m2.toHex(e5.type) : void 0 === e5.type && r5 && (t5 = "0x2"), void 0 !== e5.gasPrice && ("0x2" === t5 || r5)) throw Error("eip-1559 transactions don't support gasPrice"); if (("0x1" === t5 || "0x0" === t5) && r5) throw Error("pre-eip-1559 transaction don't support maxFeePerGas/maxPriorityFeePerGas"); return r5 || e5.common && e5.common.hardfork && e5.common.hardfork.toLowerCase() === _2.London || e5.hardfork && e5.hardfork.toLowerCase() === _2.London ? t5 = "0x2" : (e5.accessList || e5.common && e5.common.hardfork && e5.common.hardfork.toLowerCase() === _2.Berlin || e5.hardfork && e5.hardfork.toLowerCase() === _2.Berlin) && (t5 = "0x1"), t5; }(e4), void 0 !== e4.nonce && void 0 !== e4.chainId && (void 0 !== e4.gasPrice || void 0 !== e4.maxFeePerGas && void 0 !== e4.maxPriorityFeePerGas) && s3 ? Promise.resolve(c3(e4)) : Promise.all([E2(e4.common) || E2(e4.common.customChain.chainId) ? E2(e4.chainId) ? i3._ethereumCall.getChainId() : e4.chainId : void 0, E2(e4.nonce) ? i3._ethereumCall.getTransactionCount(i3.privateKeyToAccount(t4).address) : e4.nonce, E2(s3) ? i3._ethereumCall.getNetworkId() : 1, B2(i3, e4)]).then(function(t5) { var r5 = (0, u2.default)(t5, 4), n3 = r5[0], i4 = r5[1], o4 = r5[2], a4 = r5[3]; if (E2(n3) && E2(e4.common) && E2(e4.common.customChain.chainId) || E2(i4) || E2(o4) || E2(a4)) throw new Error(`One of the values "chainId", "networkId", "gasPrice", or "nonce" couldn't be fetched: ` + JSON.stringify(t5)); return c3(f2(f2(f2({}, e4), E2(e4.common) || E2(e4.common.customChain.chainId) ? { chainId: n3 } : {}), {}, { nonce: i4, networkId: o4 }, a4)); }); }, x2.prototype.recoverTransaction = function(e4) { var t4 = n2.from(e4.slice(2), "hex"), r4 = w2.fromSerializedData(t4); return m2.toChecksumAddress(r4.getSenderAddress().toString("hex")); }, x2.prototype.hashMessage = function(e4) { var t4 = m2.isHexStrict(e4) ? e4 : m2.utf8ToHex(e4), r4 = m2.hexToBytes(t4), i3 = n2.from(r4), o3 = "Ethereum Signed Message:\n" + r4.length, a3 = n2.from(o3), s3 = n2.concat([a3, i3]); return A2.bufferToHex(m2.keccak256(s3)); }, x2.prototype.sign = function(e4, t4) { if (t4.startsWith("0x") || (t4 = "0x" + t4), 66 !== t4.length) throw new Error("Private key must be 32 bytes long"); var r4 = this.hashMessage(e4), n3 = p2.sign(r4, t4), i3 = p2.decodeSignature(n3); return { message: e4, messageHash: r4, v: i3[0], r: i3[1], s: i3[2], signature: n3 }; }, x2.prototype.recover = function(e4, t4, r4) { var n3 = [].slice.apply(arguments); return e4 && "object" === (0, a2.default)(e4) ? this.recover(e4.messageHash, p2.encodeSignature([e4.v, e4.r, e4.s]), true) : (r4 || (e4 = this.hashMessage(e4)), n3.length >= 4 ? (r4 = "boolean" == typeof (r4 = n3.slice(-1)[0]) && !!r4, this.recover(e4, p2.encodeSignature(n3.slice(1, 4)), r4)) : p2.recover(e4, t4)); }, x2.prototype.decrypt = function(e4, t4, r4) { if ("string" != typeof t4) throw new Error("No password given."); var i3, s3, u3 = e4 && "object" === (0, a2.default)(e4) ? e4 : JSON.parse(r4 ? e4.toLowerCase() : e4); if (3 !== u3.version) throw new Error("Not a valid V3 wallet"); if ("scrypt" === u3.crypto.kdf) s3 = u3.crypto.kdfparams, i3 = y2.syncScrypt(n2.from(t4), n2.from(s3.salt, "hex"), s3.n, s3.r, s3.p, s3.dklen); else { if ("pbkdf2" !== u3.crypto.kdf) throw new Error("Unsupported key derivation scheme"); if ("hmac-sha256" !== (s3 = u3.crypto.kdfparams).prf) throw new Error("Unsupported parameters to PBKDF2"); i3 = b2.pbkdf2Sync(n2.from(t4), n2.from(s3.salt, "hex"), s3.c, s3.dklen, "sha256"); } var c3 = n2.from(u3.crypto.ciphertext, "hex"); if (m2.sha3(n2.from([].concat((0, o2.default)(i3.slice(16, 32)), (0, o2.default)(c3)))).replace("0x", "") !== u3.crypto.mac) throw new Error("Key derivation failed - possibly wrong password"); var f3 = b2.createDecipheriv(u3.crypto.cipher, i3.slice(0, 16), n2.from(u3.crypto.cipherparams.iv, "hex")), d3 = "0x" + n2.from([].concat((0, o2.default)(f3.update(c3)), (0, o2.default)(f3.final()))).toString("hex"); return this.privateKeyToAccount(d3, true); }, x2.prototype.encrypt = function(e4, t4, r4) { var i3, a3 = this.privateKeyToAccount(e4, true), s3 = (r4 = r4 || {}).salt || b2.randomBytes(32), u3 = r4.iv || b2.randomBytes(16), c3 = r4.kdf || "scrypt", f3 = { dklen: r4.dklen || 32, salt: s3.toString("hex") }; if ("pbkdf2" === c3) f3.c = r4.c || 262144, f3.prf = "hmac-sha256", i3 = b2.pbkdf2Sync(n2.from(t4), n2.from(f3.salt, "hex"), f3.c, f3.dklen, "sha256"); else { if ("scrypt" !== c3) throw new Error("Unsupported kdf"); f3.n = r4.n || 8192, f3.r = r4.r || 8, f3.p = r4.p || 1, i3 = y2.syncScrypt(n2.from(t4), n2.from(f3.salt, "hex"), f3.n, f3.r, f3.p, f3.dklen); } var d3 = b2.createCipheriv(r4.cipher || "aes-128-ctr", i3.slice(0, 16), u3); if (!d3) throw new Error("Unsupported cipher"); var l3 = n2.from([].concat((0, o2.default)(d3.update(n2.from(a3.privateKey.replace("0x", ""), "hex"))), (0, o2.default)(d3.final()))), h3 = m2.sha3(n2.from([].concat((0, o2.default)(i3.slice(16, 32)), (0, o2.default)(l3)))).replace("0x", ""); return { version: 3, id: v2.v4({ random: r4.uuid || b2.randomBytes(16) }), address: a3.address.toLowerCase().replace("0x", ""), crypto: { ciphertext: l3.toString("hex"), cipherparams: { iv: u3.toString("hex") }, cipher: r4.cipher || "aes-128-ctr", kdf: c3, kdfparams: f3, mac: h3.toString("hex") } }; }, O2.prototype._findSafeIndex = function(e4) { return e4 = e4 || 0, this.hasOwnProperty(e4) ? this._findSafeIndex(e4 + 1) : e4; }, O2.prototype._currentIndexes = function() { return Object.keys(this).map(function(e4) { return parseInt(e4); }).filter(function(e4) { return e4 < 9e20; }); }, O2.prototype.create = function(e4, t4) { for (var r4 = 0; r4 < e4; ++r4) this.add(this._accounts.create(t4).privateKey); return this; }, O2.prototype.add = function(e4) { return "string" == typeof e4 && (e4 = this._accounts.privateKeyToAccount(e4)), this[e4.address] ? this[e4.address] : ((e4 = this._accounts.privateKeyToAccount(e4.privateKey)).index = this._findSafeIndex(), this[e4.index] = e4, this[e4.address] = e4, this[e4.address.toLowerCase()] = e4, this.length++, e4); }, O2.prototype.remove = function(e4) { var t4 = this[e4]; return !(!t4 || !t4.address || (this[t4.address].privateKey = null, delete this[t4.address], this[t4.address.toLowerCase()] && (this[t4.address.toLowerCase()].privateKey = null, delete this[t4.address.toLowerCase()]), this[t4.index].privateKey = null, delete this[t4.index], this.length--, 0)); }, O2.prototype.clear = function() { var e4 = this; return this._currentIndexes().forEach(function(t4) { e4.remove(t4); }), this; }, O2.prototype.encrypt = function(e4, t4) { var r4 = this; return this._currentIndexes().map(function(n3) { return r4[n3].encrypt(e4, t4); }); }, O2.prototype.decrypt = function(e4, t4) { var r4 = this; return e4.forEach(function(e5) { var n3 = r4._accounts.decrypt(e5, t4); if (!n3) throw new Error("Couldn't decrypt accounts. Password wrong?"); r4.add(n3); }), this; }, O2.prototype.save = function(e4, t4) { return localStorage.setItem(t4 || this.defaultKeyName, JSON.stringify(this.encrypt(e4))), true; }, O2.prototype.load = function(e4, t4) { var r4 = localStorage.getItem(t4 || this.defaultKeyName); if (r4) try { r4 = JSON.parse(r4); } catch (e5) { } return this.decrypt(r4 || [], e4); }, function(e4) { var t4; try { t4 = self.localStorage; var r4 = "__storage_test__"; return t4.setItem(r4, r4), t4.removeItem(r4), true; } catch (e5) { return e5 && (22 === e5.code || 1014 === e5.code || "QuotaExceededError" === e5.name || "NS_ERROR_DOM_QUOTA_REACHED" === e5.name) && t4 && 0 !== t4.length; } }() || (delete O2.prototype.save, delete O2.prototype.load), e3.exports = x2; }, 58164: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(93106)), o2 = n2(r3(90775)), a2 = n2(r3(3355)); function s2(e4, t4) { (null == t4 || t4 > e4.length) && (t4 = e4.length); for (var r4 = 0, n3 = new Array(t4); r4 < t4; r4++) n3[r4] = e4[r4]; return n3; } function u2(e4, t4) { var r4 = Object.keys(e4); if (Object.getOwnPropertySymbols) { var n3 = Object.getOwnPropertySymbols(e4); t4 && (n3 = n3.filter(function(t5) { return Object.getOwnPropertyDescriptor(e4, t5).enumerable; })), r4.push.apply(r4, n3); } return r4; } function c2(e4) { for (var t4 = 1; t4 < arguments.length; t4++) { var r4 = null != arguments[t4] ? arguments[t4] : {}; t4 % 2 ? u2(Object(r4), true).forEach(function(t5) { (0, o2.default)(e4, t5, r4[t5]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e4, Object.getOwnPropertyDescriptors(r4)) : u2(Object(r4)).forEach(function(t5) { Object.defineProperty(e4, t5, Object.getOwnPropertyDescriptor(r4, t5)); }); } return e4; } var f2 = r3(80606), d2 = r3(53349), l2 = r3(48161), h2 = r3(34178).subscription, p2 = r3(11314).formatters, b2 = r3(11314).errors, y2 = r3(90282), v2 = r3(79901), m2 = function e4(t4, r4, n3) { var i3 = this, o3 = Array.prototype.slice.call(arguments); if (!(this instanceof e4)) throw new Error('Please use the "new" keyword to instantiate a web3.eth.Contract() object!'); if (this.setProvider = function() { f2.packageInit(i3, arguments), i3.clearSubscriptions = i3._requestManager.clearSubscriptions; }, f2.packageInit(this, [this.constructor]), this.clearSubscriptions = this._requestManager.clearSubscriptions, !t4 || !Array.isArray(t4)) throw b2.ContractMissingABIError(); this.options = {}; var s3 = o3[o3.length - 1]; s3 && "object" === (0, a2.default)(s3) && !Array.isArray(s3) && (n3 = s3, this.options = c2(c2({}, this.options), this._getOrSetDefaultOptions(n3)), r4 && "object" === (0, a2.default)(r4) && (r4 = null)), Object.defineProperty(this.options, "address", { set: function(e5) { e5 && (i3._address = l2.toChecksumAddress(p2.inputAddressFormatter(e5))); }, get: function() { return i3._address; }, enumerable: true }), Object.defineProperty(this.options, "jsonInterface", { set: function(e5) { return i3.methods = {}, i3.events = {}, i3._jsonInterface = e5.map(function(e6) { var t5, r5; if (e6.constant = "view" === e6.stateMutability || "pure" === e6.stateMutability || e6.constant, e6.payable = "payable" === e6.stateMutability || e6.payable, e6.name && (r5 = l2._jsonInterfaceMethodToString(e6)), "function" === e6.type) { if (e6.signature = v2.encodeFunctionSignature(r5), t5 = i3._createTxObject.bind({ method: e6, parent: i3 }), i3.methods[e6.name]) { var n4 = i3._createTxObject.bind({ method: e6, parent: i3, nextMethod: i3.methods[e6.name] }); i3.methods[e6.name] = n4; } else i3.methods[e6.name] = t5; i3.methods[e6.signature] = t5, i3.methods[r5] = t5; } else if ("event" === e6.type) { e6.signature = v2.encodeEventSignature(r5); var o4 = i3._on.bind(i3, e6.signature); i3.events[e6.name] && "bound " !== i3.events[e6.name].name || (i3.events[e6.name] = o4), i3.events[e6.signature] = o4, i3.events[r5] = o4; } return e6; }), i3.events.allEvents = i3._on.bind(i3, "allevents"), i3._jsonInterface; }, get: function() { return i3._jsonInterface; }, enumerable: true }); var u3 = this.constructor.defaultAccount, d3 = this.constructor.defaultBlock || "latest"; Object.defineProperty(this, "handleRevert", { get: function() { return false === i3.options.handleRevert || true === i3.options.handleRevert ? i3.options.handleRevert : this.constructor.handleRevert; }, set: function(e5) { i3.options.handleRevert = e5; }, enumerable: true }), Object.defineProperty(this, "defaultCommon", { get: function() { return i3.options.common || this.constructor.defaultCommon; }, set: function(e5) { i3.options.common = e5; }, enumerable: true }), Object.defineProperty(this, "defaultHardfork", { get: function() { return i3.options.hardfork || this.constructor.defaultHardfork; }, set: function(e5) { i3.options.hardfork = e5; }, enumerable: true }), Object.defineProperty(this, "defaultChain", { get: function() { return i3.options.chain || this.constructor.defaultChain; }, set: function(e5) { i3.options.chain = e5; }, enumerable: true }), Object.defineProperty(this, "transactionPollingTimeout", { get: function() { return 0 === i3.options.transactionPollingTimeout ? i3.options.transactionPollingTimeout : i3.options.transactionPollingTimeout || this.constructor.transactionPollingTimeout; }, set: function(e5) { i3.options.transactionPollingTimeout = e5; }, enumerable: true }), Object.defineProperty(this, "transactionPollingInterval", { get: function() { return 0 === i3.options.transactionPollingInterval ? i3.options.transactionPollingInterval : i3.options.transactionPollingInterval || this.constructor.transactionPollingInterval; }, set: function(e5) { i3.options.transactionPollingInterval = e5; }, enumerable: true }), Object.defineProperty(this, "transactionConfirmationBlocks", { get: function() { return 0 === i3.options.transactionConfirmationBlocks ? i3.options.transactionConfirmationBlocks : i3.options.transactionConfirmationBlocks || this.constructor.transactionConfirmationBlocks; }, set: function(e5) { i3.options.transactionConfirmationBlocks = e5; }, enumerable: true }), Object.defineProperty(this, "transactionBlockTimeout", { get: function() { return 0 === i3.options.transactionBlockTimeout ? i3.options.transactionBlockTimeout : i3.options.transactionBlockTimeout || this.constructor.transactionBlockTimeout; }, set: function(e5) { i3.options.transactionBlockTimeout = e5; }, enumerable: true }), Object.defineProperty(this, "blockHeaderTimeout", { get: function() { return 0 === i3.options.blockHeaderTimeout ? i3.options.blockHeaderTimeout : i3.options.blockHeaderTimeout || this.constructor.blockHeaderTimeout; }, set: function(e5) { i3.options.blockHeaderTimeout = e5; }, enumerable: true }), Object.defineProperty(this, "defaultAccount", { get: function() { return u3; }, set: function(e5) { return e5 && (u3 = l2.toChecksumAddress(p2.inputAddressFormatter(e5))), e5; }, enumerable: true }), Object.defineProperty(this, "defaultBlock", { get: function() { return d3; }, set: function(e5) { return d3 = e5, e5; }, enumerable: true }), this.methods = {}, this.events = {}, this._address = null, this._jsonInterface = [], this.options.address = r4, this.options.jsonInterface = t4; }; m2.setProvider = function(e4, t4) { f2.packageInit(this, [e4]), this._ethAccounts = t4; }, m2.prototype._getCallback = function(e4) { if (e4 && e4[e4.length - 1] && "function" == typeof e4[e4.length - 1]) return e4.pop(); }, m2.prototype._checkListener = function(e4, t4) { if (t4 === e4) throw b2.ContractReservedEventError(e4); }, m2.prototype._getOrSetDefaultOptions = function(e4) { var t4 = c2({}, e4), r4 = t4.gasPrice ? String(t4.gasPrice) : null, n3 = t4.from ? l2.toChecksumAddress(p2.inputAddressFormatter(t4.from)) : null; return t4.data = t4.data || this.options.data, t4.from = n3 || this.options.from, t4.gasPrice = r4 || this.options.gasPrice, t4.gas = t4.gas || t4.gasLimit || this.options.gas, delete t4.gasLimit, t4; }, m2.prototype._encodeEventABI = function(e4, t4) { var r4 = (t4 = t4 || {}).filter || {}, n3 = {}; ["fromBlock", "toBlock"].filter(function(e5) { return void 0 !== t4[e5]; }).forEach(function(e5) { n3[e5] = p2.inputBlockNumberFormatter(t4[e5]); }); var o3 = []; if (t4.topics && Array.isArray(t4.topics)) o3 = (0, i2.default)(t4.topics); else if (o3 = [], e4 && !e4.anonymous && "ALLEVENTS" !== e4.name && o3.push(e4.signature || v2.encodeEventSignature(l2.jsonInterfaceMethodToString(e4))), "ALLEVENTS" !== e4.name && e4.inputs) { var a3, u3 = function(e5, t5) { var r5 = "undefined" != typeof Symbol && e5[Symbol.iterator] || e5["@@iterator"]; if (!r5) { if (Array.isArray(e5) || (r5 = function(e6, t6) { if (e6) { if ("string" == typeof e6) return s2(e6, t6); var r6 = Object.prototype.toString.call(e6).slice(8, -1); return "Object" === r6 && e6.constructor && (r6 = e6.constructor.name), "Map" === r6 || "Set" === r6 ? Array.from(e6) : "Arguments" === r6 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r6) ? s2(e6, t6) : void 0; } }(e5)) || t5 && e5 && "number" == typeof e5.length) { r5 && (e5 = r5); var n4 = 0, i3 = function() { }; return { s: i3, n: function() { return n4 >= e5.length ? { done: true } : { done: false, value: e5[n4++] }; }, e: function(e6) { throw e6; }, f: i3 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o4, a4 = true, u4 = false; return { s: function() { r5 = r5.call(e5); }, n: function() { var e6 = r5.next(); return a4 = e6.done, e6; }, e: function(e6) { u4 = true, o4 = e6; }, f: function() { try { a4 || null == r5.return || r5.return(); } finally { if (u4) throw o4; } } }; }(e4.inputs); try { var c3 = function() { var e5 = a3.value; if (!e5.indexed) return "continue"; var t5 = r4[e5.name]; if (!t5) return o3.push(null), "continue"; Array.isArray(t5) ? o3.push(t5.map(function(t6) { return v2.encodeParameter(e5.type, t6); })) : o3.push(v2.encodeParameter(e5.type, t5)); }; for (u3.s(); !(a3 = u3.n()).done; ) c3(); } catch (e5) { u3.e(e5); } finally { u3.f(); } } return o3.length && (n3.topics = o3), this.options.address && (n3.address = this.options.address.toLowerCase()), n3; }, m2.prototype._decodeEventABI = function(e4) { var t4 = this; e4.data = e4.data || "", e4.topics = e4.topics || []; var r4 = p2.outputLogFormatter(e4); if ("ALLEVENTS" === t4.name && (t4 = t4.jsonInterface.find(function(t5) { return t5.signature === e4.topics[0]; }) || { anonymous: true }), t4.inputs = t4.inputs || [], !t4.anonymous) { var n3 = 0; t4.inputs.forEach(function(e5) { return e5.indexed ? n3++ : null; }), n3 > 0 && e4.topics.length !== n3 + 1 && (t4 = { anonymous: true, inputs: [] }); } var i3 = t4.anonymous ? e4.topics : e4.topics.slice(1); return r4.returnValues = v2.decodeLog(t4.inputs, e4.data, i3), delete r4.returnValues.__length__, r4.event = t4.name, r4.signature = t4.anonymous || !e4.topics[0] ? null : e4.topics[0], r4.raw = { data: r4.data, topics: r4.topics }, delete r4.data, delete r4.topics, r4; }, m2.prototype._encodeMethodABI = function() { var e4 = this._method.signature, t4 = this.arguments || [], r4 = false, n3 = this._parent.options.jsonInterface.filter(function(t5) { return "constructor" === e4 && t5.type === e4 || (t5.signature === e4 || t5.signature === e4.replace("0x", "") || t5.name === e4) && "function" === t5.type; }).map(function(e5) { var n4 = Array.isArray(e5.inputs) ? e5.inputs.length : 0; if (n4 !== t4.length) throw new Error("The number of arguments is not matching the methods required number. You need to pass " + n4 + " arguments."); return "function" === e5.type && (r4 = e5.signature), Array.isArray(e5.inputs) ? e5.inputs : []; }).map(function(e5) { return v2.encodeParameters(e5, t4).replace("0x", ""); })[0] || ""; if ("constructor" === e4) { if (!this._deployData) throw new Error("The contract has no contract data option set. This is necessary to append the constructor parameters."); return this._deployData.startsWith("0x") || (this._deployData = "0x" + this._deployData), this._deployData + n3; } var i3 = r4 ? r4 + n3 : n3; if (!i3) throw new Error(`Couldn't find a matching contract method named "` + this._method.name + '".'); return i3; }, m2.prototype._decodeMethodReturn = function(e4, t4) { if (!t4) return null; t4 = t4.length >= 2 ? t4.slice(2) : t4; var r4 = v2.decodeParameters(e4, t4); return 1 === r4.__length__ ? r4[0] : (delete r4.__length__, r4); }, m2.prototype.deploy = function(e4, t4) { if ((e4 = e4 || {}).arguments = e4.arguments || [], !(e4 = this._getOrSetDefaultOptions(e4)).data) { if ("function" == typeof t4) return t4(b2.ContractMissingDeployDataError()); throw b2.ContractMissingDeployDataError(); } var r4 = this.options.jsonInterface.find(function(e5) { return "constructor" === e5.type; }) || {}; return r4.signature = "constructor", this._createTxObject.apply({ method: r4, parent: this, deployData: e4.data, _ethAccounts: this.constructor._ethAccounts }, e4.arguments); }, m2.prototype._generateEventOptions = function() { var e4 = Array.prototype.slice.call(arguments), t4 = this._getCallback(e4), r4 = "object" === (!!e4[e4.length - 1] && (0, a2.default)(e4[e4.length - 1])) ? e4.pop() : {}, n3 = "string" == typeof e4[0] ? e4[0] : "allevents", i3 = "allevents" === n3.toLowerCase() ? { name: "ALLEVENTS", jsonInterface: this.options.jsonInterface } : this.options.jsonInterface.find(function(e5) { return "event" === e5.type && (e5.name === n3 || e5.signature === "0x" + n3.replace("0x", "")); }); if (!i3) throw b2.ContractEventDoesNotExistError(n3); if (!l2.isAddress(this.options.address)) throw b2.ContractNoAddressDefinedError(); return { params: this._encodeEventABI(i3, r4), event: i3, filter: r4.filter || {}, callback: t4 }; }, m2.prototype.clone = function() { return new this.constructor(this.options.jsonInterface, this.options.address, this.options); }, m2.prototype.once = function(e4, t4, r4) { var n3 = Array.prototype.slice.call(arguments); if (!(r4 = this._getCallback(n3))) throw b2.ContractOnceRequiresCallbackError(); t4 && delete t4.fromBlock, this._on(e4, t4, function(e5, t5, n4) { n4.unsubscribe(), "function" == typeof r4 && r4(e5, t5, n4); }); }, m2.prototype._on = function() { var e4 = this._generateEventOptions.apply(this, arguments); e4.params && e4.params.toBlock && (delete e4.params.toBlock, console.warn("Invalid option: toBlock. Use getPastEvents for specific range.")), this._checkListener("newListener", e4.event.name), this._checkListener("removeListener", e4.event.name); var t4 = new h2({ subscription: { params: 1, inputFormatter: [p2.inputLogFormatter], outputFormatter: this._decodeEventABI.bind(e4.event), subscriptionHandler: function(e5) { e5.removed ? this.emit("changed", e5) : this.emit("data", e5), "function" == typeof this.callback && this.callback(null, e5, this); } }, type: "eth", requestManager: this._requestManager }); return t4.subscribe("logs", e4.params, e4.callback || function() { }), t4; }; var g2 = function(e4, t4) { if (e4.event && "ALLEVENTS" === e4.event.name && Array.isArray(t4)) { var r4 = e4.filter || {}, n3 = Object.keys(r4); return n3.length > 0 ? t4.filter(function(e5) { return "string" == typeof e5 || n3.every(function(t5) { return Array.isArray(r4[t5]) ? r4[t5].some(function(r5) { return String(e5.returnValues[t5]).toUpperCase() === String(r5).toUpperCase(); }) : String(e5.returnValues[t5]).toUpperCase() === String(r4[t5]).toUpperCase(); }); }) : t4; } return t4; }; m2.prototype.getPastEvents = function() { var e4 = this._generateEventOptions.apply(this, arguments), t4 = new d2({ name: "getPastLogs", call: "eth_getLogs", params: 1, inputFormatter: [p2.inputLogFormatter], outputFormatter: this._decodeEventABI.bind(e4.event) }); t4.setRequestManager(this._requestManager); var r4 = t4.buildCall(); return t4 = null, r4(e4.params, function(t5, r5) { "function" == typeof e4.callback && e4.callback(t5, g2(e4, r5)); }).then(g2.bind(this, e4)); }, m2.prototype._createTxObject = function() { var e4 = Array.prototype.slice.call(arguments), t4 = {}; if ("function" === this.method.type && (t4.call = this.parent._executeMethod.bind(t4, "call"), t4.call.request = this.parent._executeMethod.bind(t4, "call", true)), t4.send = this.parent._executeMethod.bind(t4, "send"), t4.send.request = this.parent._executeMethod.bind(t4, "send", true), t4.encodeABI = this.parent._encodeMethodABI.bind(t4), t4.estimateGas = this.parent._executeMethod.bind(t4, "estimate"), t4.createAccessList = this.parent._executeMethod.bind(t4, "createAccessList"), e4 && this.method.inputs && e4.length !== this.method.inputs.length) { if (this.nextMethod) return this.nextMethod.apply(null, e4); throw b2.InvalidNumberOfParams(e4.length, this.method.inputs.length, this.method.name); } return t4.arguments = e4 || [], t4._method = this.method, t4._parent = this.parent, t4._ethAccounts = this.parent.constructor._ethAccounts || this._ethAccounts, this.deployData && (t4._deployData = this.deployData), t4; }, m2.prototype._processExecuteArguments = function(e4, t4) { var r4 = {}; if (r4.type = e4.shift(), r4.callback = this._parent._getCallback(e4), "call" !== r4.type || true === e4[e4.length - 1] || "string" != typeof e4[e4.length - 1] && !isFinite(e4[e4.length - 1]) || (r4.defaultBlock = e4.pop()), r4.options = "object" === (!!e4[e4.length - 1] && (0, a2.default)(e4[e4.length - 1])) ? e4.pop() : {}, r4.generateRequest = true === e4[e4.length - 1] && e4.pop(), r4.options = this._parent._getOrSetDefaultOptions(r4.options), r4.options.data = this.encodeABI(), !this._deployData && !l2.isAddress(this._parent.options.address)) throw b2.ContractNoAddressDefinedError(); return this._deployData || (r4.options.to = this._parent.options.address), r4.options.data ? r4 : l2._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."), t4.eventEmitter, t4.reject, r4.callback); }, m2.prototype._executeMethod = function() { var e4 = this, t4 = this._parent._processExecuteArguments.call(this, Array.prototype.slice.call(arguments), r4), r4 = y2("send" !== t4.type), n3 = e4.constructor._ethAccounts || e4._ethAccounts; if (t4.generateRequest) { var i3 = { params: [p2.inputCallFormatter.call(this._parent, t4.options)], callback: t4.callback }; return "call" === t4.type ? (i3.params.push(p2.inputDefaultBlockNumberFormatter.call(this._parent, t4.defaultBlock)), i3.method = "eth_call", i3.format = this._parent._decodeMethodReturn.bind(null, this._method.outputs)) : i3.method = "eth_sendTransaction", i3; } switch (t4.type) { case "createAccessList": return l2.isAddress(t4.options.from) ? new d2({ name: "createAccessList", call: "eth_createAccessList", params: 2, inputFormatter: [p2.inputTransactionFormatter, p2.inputDefaultBlockNumberFormatter], requestManager: e4._parent._requestManager, accounts: n3, defaultAccount: e4._parent.defaultAccount, defaultBlock: e4._parent.defaultBlock }).createFunction()(t4.options, t4.callback) : l2._fireError(b2.ContractNoFromAddressDefinedError(), r4.eventEmitter, r4.reject, t4.callback); case "estimate": return new d2({ name: "estimateGas", call: "eth_estimateGas", params: 1, inputFormatter: [p2.inputCallFormatter], outputFormatter: l2.hexToNumber, requestManager: e4._parent._requestManager, accounts: n3, defaultAccount: e4._parent.defaultAccount, defaultBlock: e4._parent.defaultBlock }).createFunction()(t4.options, t4.callback); case "call": return new d2({ name: "call", call: "eth_call", params: 2, inputFormatter: [p2.inputCallFormatter, p2.inputDefaultBlockNumberFormatter], outputFormatter: function(t5) { return e4._parent._decodeMethodReturn(e4._method.outputs, t5); }, requestManager: e4._parent._requestManager, accounts: n3, defaultAccount: e4._parent.defaultAccount, defaultBlock: e4._parent.defaultBlock, handleRevert: e4._parent.handleRevert, abiCoder: v2 }).createFunction()(t4.options, t4.defaultBlock, t4.callback); case "send": if (!l2.isAddress(t4.options.from)) return l2._fireError(b2.ContractNoFromAddressDefinedError(), r4.eventEmitter, r4.reject, t4.callback); if ("boolean" == typeof this._method.payable && !this._method.payable && t4.options.value && t4.options.value > 0) return l2._fireError(new Error("Can not send value to non-payable contract method or constructor"), r4.eventEmitter, r4.reject, t4.callback); var o3 = { receiptFormatter: function(t5) { if (Array.isArray(t5.logs)) { var r5 = t5.logs.map(function(t6) { return e4._parent._decodeEventABI.call({ name: "ALLEVENTS", jsonInterface: e4._parent.options.jsonInterface }, t6); }); t5.events = {}; var n4 = 0; r5.forEach(function(e5) { e5.event ? t5.events[e5.event] ? Array.isArray(t5.events[e5.event]) ? t5.events[e5.event].push(e5) : t5.events[e5.event] = [t5.events[e5.event], e5] : t5.events[e5.event] = e5 : (t5.events[n4] = e5, n4++); }), delete t5.logs; } return t5; }, contractDeployFormatter: function(t5) { var r5 = e4._parent.clone(); return r5.options.address = t5.contractAddress, r5; } }; return new d2({ name: "sendTransaction", call: "eth_sendTransaction", params: 1, inputFormatter: [p2.inputTransactionFormatter], requestManager: e4._parent._requestManager, accounts: e4.constructor._ethAccounts || e4._ethAccounts, defaultAccount: e4._parent.defaultAccount, defaultBlock: e4._parent.defaultBlock, transactionBlockTimeout: e4._parent.transactionBlockTimeout, transactionConfirmationBlocks: e4._parent.transactionConfirmationBlocks, transactionPollingTimeout: e4._parent.transactionPollingTimeout, transactionPollingInterval: e4._parent.transactionPollingInterval, defaultCommon: e4._parent.defaultCommon, defaultChain: e4._parent.defaultChain, defaultHardfork: e4._parent.defaultHardfork, handleRevert: e4._parent.handleRevert, extraFormatters: o3, abiCoder: v2 }).createFunction()(t4.options, t4.callback); default: throw new Error('Method "' + t4.type + '" not implemented.'); } }, e3.exports = m2; }, 46764: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(82247)), o2 = n2(r3(94571)), a2 = r3(55160), s2 = r3(11314).formatters, u2 = r3(48161), c2 = r3(11841), f2 = r3(62867), d2 = r3(22689); function l2(e4) { this.eth = e4; var t4 = null; this._detectedAddress = null, this._lastSyncCheck = null, Object.defineProperty(this, "registry", { get: function() { return new c2(this); }, enumerable: true }), Object.defineProperty(this, "resolverMethodHandler", { get: function() { return new f2(this.registry); }, enumerable: true }), Object.defineProperty(this, "registryAddress", { get: function() { return t4; }, set: function(e5) { t4 = null !== e5 ? s2.inputAddressFormatter(e5) : e5; }, enumerable: true }); } l2.prototype.supportsInterface = function(e4, t4, r4) { return this.getResolver(e4).then(function(e5) { return u2.isHexStrict(t4) || (t4 = u2.sha3(t4).slice(0, 10)), e5.methods.supportsInterface(t4).call(r4); }).catch(function(e5) { if ("function" != typeof r4) throw e5; r4(e5, null); }); }, l2.prototype.resolver = function(e4, t4) { return this.registry.resolver(e4, t4); }, l2.prototype.getResolver = function(e4, t4) { return this.registry.getResolver(e4, t4); }, l2.prototype.setResolver = function(e4, t4, r4, n3) { return this.registry.setResolver(e4, t4, r4, n3); }, l2.prototype.setRecord = function(e4, t4, r4, n3, i3, o3) { return this.registry.setRecord(e4, t4, r4, n3, i3, o3); }, l2.prototype.setSubnodeRecord = function(e4, t4, r4, n3, i3, o3, a3) { return this.registry.setSubnodeRecord(e4, t4, r4, n3, i3, o3, a3); }, l2.prototype.setApprovalForAll = function(e4, t4, r4, n3) { return this.registry.setApprovalForAll(e4, t4, r4, n3); }, l2.prototype.isApprovedForAll = function(e4, t4, r4) { return this.registry.isApprovedForAll(e4, t4, r4); }, l2.prototype.recordExists = function(e4, t4) { return this.registry.recordExists(e4, t4); }, l2.prototype.setSubnodeOwner = function(e4, t4, r4, n3, i3) { return this.registry.setSubnodeOwner(e4, t4, r4, n3, i3); }, l2.prototype.getTTL = function(e4, t4) { return this.registry.getTTL(e4, t4); }, l2.prototype.setTTL = function(e4, t4, r4, n3) { return this.registry.setTTL(e4, t4, r4, n3); }, l2.prototype.getOwner = function(e4, t4) { return this.registry.getOwner(e4, t4); }, l2.prototype.setOwner = function(e4, t4, r4, n3) { return this.registry.setOwner(e4, t4, r4, n3); }, l2.prototype.getAddress = function(e4, t4) { return this.resolverMethodHandler.method(e4, "addr", []).call(t4); }, l2.prototype.setAddress = function(e4, t4, r4, n3) { return this.resolverMethodHandler.method(e4, "setAddr", [t4]).send(r4, n3); }, l2.prototype.getPubkey = function(e4, t4) { return this.resolverMethodHandler.method(e4, "pubkey", [], null, t4).call(t4); }, l2.prototype.setPubkey = function(e4, t4, r4, n3, i3) { return this.resolverMethodHandler.method(e4, "setPubkey", [t4, r4]).send(n3, i3); }, l2.prototype.getContent = function(e4, t4) { return this.resolverMethodHandler.method(e4, "content", []).call(t4); }, l2.prototype.setContent = function(e4, t4, r4, n3) { return this.resolverMethodHandler.method(e4, "setContent", [t4]).send(r4, n3); }, l2.prototype.getContenthash = function(e4, t4) { return this.resolverMethodHandler.method(e4, "contenthash", [], d2.decode).call(t4); }, l2.prototype.setContenthash = function(e4, t4, r4, n3) { var i3; try { i3 = d2.encode(t4); } catch (e5) { var o3 = new Error("Could not encode " + t4 + ". See docs for supported hash protocols."); if ("function" == typeof n3) return void n3(o3, null); throw o3; } return this.resolverMethodHandler.method(e4, "setContenthash", [i3]).send(r4, n3); }, l2.prototype.getMultihash = function(e4, t4) { return this.resolverMethodHandler.method(e4, "multihash", []).call(t4); }, l2.prototype.setMultihash = function(e4, t4, r4, n3) { return this.resolverMethodHandler.method(e4, "multihash", [t4]).send(r4, n3); }, l2.prototype.checkNetwork = (0, o2.default)(i2.default.mark(function e4() { var t4, r4, n3, o3, s3; return i2.default.wrap(function(e5) { for (; ; ) switch (e5.prev = e5.next) { case 0: if (t4 = /* @__PURE__ */ new Date() / 1e3, this._lastSyncCheck && !(t4 - this._lastSyncCheck > 3600)) { e5.next = 9; break; } return e5.next = 4, this.eth.getBlock("latest"); case 4: if (r4 = e5.sent, !((n3 = t4 - r4.timestamp) > 3600)) { e5.next = 8; break; } throw new Error("Network not synced; last block was " + n3 + " seconds ago"); case 8: this._lastSyncCheck = t4; case 9: if (!this.registryAddress) { e5.next = 11; break; } return e5.abrupt("return", this.registryAddress); case 11: if (this._detectedAddress) { e5.next = 20; break; } return e5.next = 14, this.eth.net.getNetworkType(); case 14: if (o3 = e5.sent, void 0 !== (s3 = a2.addresses[o3])) { e5.next = 18; break; } throw new Error("ENS is not supported on network " + o3); case 18: return this._detectedAddress = s3, e5.abrupt("return", this._detectedAddress); case 20: return e5.abrupt("return", this._detectedAddress); case 21: case "end": return e5.stop(); } }, e4, this); })), e3.exports = l2; }, 55160: (e3) => { e3.exports = { addresses: { main: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", ropsten: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", rinkeby: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", goerli: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" }, interfaceIds: { addr: "0x3b3b57de", setAddr: "0x3b3b57de", pubkey: "0xc8690233", setPubkey: "0xc8690233", contenthash: "0xbc1c58d1", setContenthash: "0xbc1c58d1", content: "0xd8389dc5", setContent: "0xd8389dc5" } }; }, 11841: (e3, t3, r3) => { var n2 = r3(58164), i2 = r3(21006), o2 = r3(90282), a2 = r3(11314).formatters, s2 = r3(48161), u2 = r3(43205), c2 = r3(48384); function f2(e4) { var t4 = this; this.ens = e4, this.contract = e4.checkNetwork().then(function(e5) { var r4 = new n2(u2, e5); return r4.setProvider(t4.ens.eth.currentProvider), r4; }); } f2.prototype.owner = function(e4, t4) { return console.warn('Deprecated: Please use the "getOwner" method instead of "owner".'), this.getOwner(e4, t4); }, f2.prototype.getOwner = function(e4, t4) { var r4 = new o2(true); return this.contract.then(function(t5) { return t5.methods.owner(i2.hash(e4)).call(); }).then(function(e5) { "function" != typeof t4 ? r4.resolve(e5) : t4(e5, e5); }).catch(function(e5) { "function" != typeof t4 ? r4.reject(e5) : t4(e5, null); }), r4.eventEmitter; }, f2.prototype.setOwner = function(e4, t4, r4, n3) { var s3 = new o2(true); return this.contract.then(function(n4) { return n4.methods.setOwner(i2.hash(e4), a2.inputAddressFormatter(t4)).send(r4); }).then(function(e5) { "function" != typeof n3 ? s3.resolve(e5) : n3(e5, e5); }).catch(function(e5) { "function" != typeof n3 ? s3.reject(e5) : n3(e5, null); }), s3.eventEmitter; }, f2.prototype.getTTL = function(e4, t4) { var r4 = new o2(true); return this.contract.then(function(t5) { return t5.methods.ttl(i2.hash(e4)).call(); }).then(function(e5) { "function" != typeof t4 ? r4.resolve(e5) : t4(e5, e5); }).catch(function(e5) { "function" != typeof t4 ? r4.reject(e5) : t4(e5, null); }), r4.eventEmitter; }, f2.prototype.setTTL = function(e4, t4, r4, n3) { var a3 = new o2(true); return this.contract.then(function(n4) { return n4.methods.setTTL(i2.hash(e4), t4).send(r4); }).then(function(e5) { "function" != typeof n3 ? a3.resolve(e5) : n3(e5, e5); }).catch(function(e5) { "function" != typeof n3 ? a3.reject(e5) : n3(e5, null); }), a3.eventEmitter; }, f2.prototype.setSubnodeOwner = function(e4, t4, r4, n3, u3) { var c3 = new o2(true); return s2.isHexStrict(t4) || (t4 = s2.sha3(t4)), this.contract.then(function(o3) { return o3.methods.setSubnodeOwner(i2.hash(e4), t4, a2.inputAddressFormatter(r4)).send(n3); }).then(function(e5) { "function" != typeof u3 ? c3.resolve(e5) : u3(e5, e5); }).catch(function(e5) { "function" != typeof u3 ? c3.reject(e5) : u3(e5, null); }), c3.eventEmitter; }, f2.prototype.setRecord = function(e4, t4, r4, n3, s3, u3) { var c3 = new o2(true); return this.contract.then(function(o3) { return o3.methods.setRecord(i2.hash(e4), a2.inputAddressFormatter(t4), a2.inputAddressFormatter(r4), n3).send(s3); }).then(function(e5) { "function" != typeof u3 ? c3.resolve(e5) : u3(e5, e5); }).catch(function(e5) { "function" != typeof u3 ? c3.reject(e5) : u3(e5, null); }), c3.eventEmitter; }, f2.prototype.setSubnodeRecord = function(e4, t4, r4, n3, u3, c3, f3) { var d2 = new o2(true); return s2.isHexStrict(t4) || (t4 = s2.sha3(t4)), this.contract.then(function(o3) { return o3.methods.setSubnodeRecord(i2.hash(e4), t4, a2.inputAddressFormatter(r4), a2.inputAddressFormatter(n3), u3).send(c3); }).then(function(e5) { "function" != typeof f3 ? d2.resolve(e5) : f3(e5, e5); }).catch(function(e5) { "function" != typeof f3 ? d2.reject(e5) : f3(e5, null); }), d2.eventEmitter; }, f2.prototype.setApprovalForAll = function(e4, t4, r4, n3) { var i3 = new o2(true); return this.contract.then(function(n4) { return n4.methods.setApprovalForAll(a2.inputAddressFormatter(e4), t4).send(r4); }).then(function(e5) { "function" != typeof n3 ? i3.resolve(e5) : n3(e5, e5); }).catch(function(e5) { "function" != typeof n3 ? i3.reject(e5) : n3(e5, null); }), i3.eventEmitter; }, f2.prototype.isApprovedForAll = function(e4, t4, r4) { var n3 = new o2(true); return this.contract.then(function(r5) { return r5.methods.isApprovedForAll(a2.inputAddressFormatter(e4), a2.inputAddressFormatter(t4)).call(); }).then(function(e5) { "function" != typeof r4 ? n3.resolve(e5) : r4(e5, e5); }).catch(function(e5) { "function" != typeof r4 ? n3.reject(e5) : r4(e5, null); }), n3.eventEmitter; }, f2.prototype.recordExists = function(e4, t4) { var r4 = new o2(true); return this.contract.then(function(t5) { return t5.methods.recordExists(i2.hash(e4)).call(); }).then(function(e5) { "function" != typeof t4 ? r4.resolve(e5) : t4(e5, e5); }).catch(function(e5) { "function" != typeof t4 ? r4.reject(e5) : t4(e5, null); }), r4.eventEmitter; }, f2.prototype.resolver = function(e4, t4) { return console.warn('Deprecated: Please use the "getResolver" method instead of "resolver".'), this.getResolver(e4, t4); }, f2.prototype.getResolver = function(e4, t4) { var r4 = this; return this.contract.then(function(t5) { return t5.methods.resolver(i2.hash(e4)).call(); }).then(function(e5) { var i3 = new n2(c2, e5); if (i3.setProvider(r4.ens.eth.currentProvider), "function" != typeof t4) return i3; t4(i3, i3); }).catch(function(e5) { if ("function" != typeof t4) throw e5; t4(e5, null); }); }, f2.prototype.setResolver = function(e4, t4, r4, n3) { var s3 = new o2(true); return this.contract.then(function(n4) { return n4.methods.setResolver(i2.hash(e4), a2.inputAddressFormatter(t4)).send(r4); }).then(function(e5) { "function" != typeof n3 ? s3.resolve(e5) : n3(e5, e5); }).catch(function(e5) { "function" != typeof n3 ? s3.reject(e5) : n3(e5, null); }), s3.eventEmitter; }, e3.exports = f2; }, 30715: (e3, t3, r3) => { var n2 = r3(46764); e3.exports = n2; }, 62867: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(82247)), o2 = n2(r3(94571)), a2 = r3(90282), s2 = r3(21006), u2 = r3(11314).errors, c2 = r3(55160).interfaceIds; function f2(e4) { this.registry = e4; } f2.prototype.method = function(e4, t4, r4, n3, i3) { return { call: this.call.bind({ ensName: e4, methodName: t4, methodArguments: r4, callback: i3, parent: this, outputFormatter: n3 }), send: this.send.bind({ ensName: e4, methodName: t4, methodArguments: r4, callback: i3, parent: this }) }; }, f2.prototype.call = function(e4) { var t4 = this, r4 = new a2(), n3 = this.parent.prepareArguments(this.ensName, this.methodArguments), s3 = this.outputFormatter || null; return this.parent.registry.getResolver(this.ensName).then(function() { var a3 = (0, o2.default)(i2.default.mark(function o3(a4) { return i2.default.wrap(function(i3) { for (; ; ) switch (i3.prev = i3.next) { case 0: return i3.next = 2, t4.parent.checkInterfaceSupport(a4, t4.methodName); case 2: t4.parent.handleCall(r4, a4.methods[t4.methodName], n3, s3, e4); case 3: case "end": return i3.stop(); } }, o3); })); return function(e5) { return a3.apply(this, arguments); }; }()).catch(function(t5) { "function" != typeof e4 ? r4.reject(t5) : e4(t5, null); }), r4.eventEmitter; }, f2.prototype.send = function(e4, t4) { var r4 = this, n3 = new a2(), s3 = this.parent.prepareArguments(this.ensName, this.methodArguments); return this.parent.registry.getResolver(this.ensName).then(function() { var a3 = (0, o2.default)(i2.default.mark(function o3(a4) { return i2.default.wrap(function(i3) { for (; ; ) switch (i3.prev = i3.next) { case 0: return i3.next = 2, r4.parent.checkInterfaceSupport(a4, r4.methodName); case 2: r4.parent.handleSend(n3, a4.methods[r4.methodName], s3, e4, t4); case 3: case "end": return i3.stop(); } }, o3); })); return function(e5) { return a3.apply(this, arguments); }; }()).catch(function(e5) { "function" != typeof t4 ? n3.reject(e5) : t4(e5, null); }), n3.eventEmitter; }, f2.prototype.handleCall = function(e4, t4, r4, n3, i3) { return t4.apply(this, r4).call().then(function(t5) { n3 && (t5 = n3(t5)), "function" != typeof i3 ? e4.resolve(t5) : i3(t5, t5); }).catch(function(t5) { "function" != typeof i3 ? e4.reject(t5) : i3(t5, null); }), e4; }, f2.prototype.handleSend = function(e4, t4, r4, n3, i3) { return t4.apply(this, r4).send(n3).on("sending", function() { e4.eventEmitter.emit("sending"); }).on("sent", function() { e4.eventEmitter.emit("sent"); }).on("transactionHash", function(t5) { e4.eventEmitter.emit("transactionHash", t5); }).on("confirmation", function(t5, r5) { e4.eventEmitter.emit("confirmation", t5, r5); }).on("receipt", function(t5) { e4.eventEmitter.emit("receipt", t5), e4.resolve(t5), "function" == typeof i3 && i3(t5, t5); }).on("error", function(t5) { e4.eventEmitter.emit("error", t5), "function" != typeof i3 ? e4.reject(t5) : i3(t5, null); }), e4; }, f2.prototype.prepareArguments = function(e4, t4) { var r4 = s2.hash(e4); return t4.length > 0 ? (t4.unshift(r4), t4) : [r4]; }, f2.prototype.checkInterfaceSupport = function() { var e4 = (0, o2.default)(i2.default.mark(function e5(t4, r4) { var n3; return i2.default.wrap(function(e6) { for (; ; ) switch (e6.prev = e6.next) { case 0: if (c2[r4]) { e6.next = 2; break; } return e6.abrupt("return"); case 2: return n3 = false, e6.prev = 3, e6.next = 6, t4.methods.supportsInterface(c2[r4]).call(); case 6: n3 = e6.sent, e6.next = 12; break; case 9: e6.prev = 9, e6.t0 = e6.catch(3), console.warn('Could not verify interface of resolver contract at "' + t4.options.address + '". '); case 12: if (n3) { e6.next = 14; break; } throw u2.ResolverMethodMissingError(t4.options.address, r4); case 14: case "end": return e6.stop(); } }, e5, null, [[3, 9]]); })); return function(t4, r4) { return e4.apply(this, arguments); }; }(), e3.exports = f2; }, 22689: (e3, t3, r3) => { var n2 = r3(94308); e3.exports = { decode: function(e4) { var t4 = null, r4 = null, i2 = null; if (e4 && e4.error) return { protocolType: null, decoded: e4.error }; if (e4) try { t4 = n2.decode(e4); var o2 = n2.getCodec(e4); "ipfs-ns" === o2 ? r4 = "ipfs" : "swarm-ns" === o2 ? r4 = "bzz" : "onion" === o2 ? r4 = "onion" : "onion3" === o2 ? r4 = "onion3" : t4 = e4; } catch (e5) { i2 = e5.message; } return { protocolType: r4, decoded: t4, error: i2 }; }, encode: function(e4) { var t4, r4, i2 = false; if (e4) { var o2 = e4.match(/^(ipfs|bzz|onion|onion3):\/\/(.*)/) || e4.match(/\/(ipfs)\/(.*)/); o2 && (r4 = o2[1], t4 = o2[2]); try { if ("ipfs" === r4) t4.length >= 4 && (i2 = "0x" + n2.fromIpfs(t4)); else if ("bzz" === r4) t4.length >= 4 && (i2 = "0x" + n2.fromSwarm(t4)); else if ("onion" === r4) 16 === t4.length && (i2 = "0x" + n2.encode("onion", t4)); else { if ("onion3" !== r4) throw new Error("Could not encode content hash: unsupported content type"); 56 === t4.length && (i2 = "0x" + n2.encode("onion3", t4)); } } catch (e5) { throw e5; } } return i2; } }; }, 43205: (e3) => { e3.exports = [{ constant: true, inputs: [{ name: "node", type: "bytes32" }], name: "resolver", outputs: [{ name: "", type: "address" }], payable: false, type: "function" }, { constant: true, inputs: [{ name: "node", type: "bytes32" }], name: "owner", outputs: [{ name: "", type: "address" }], payable: false, type: "function" }, { constant: false, inputs: [{ name: "node", type: "bytes32" }, { name: "label", type: "bytes32" }, { name: "owner", type: "address" }], name: "setSubnodeOwner", outputs: [], payable: false, type: "function" }, { constant: false, inputs: [{ name: "node", type: "bytes32" }, { name: "ttl", type: "uint64" }], name: "setTTL", outputs: [], payable: false, type: "function" }, { constant: true, inputs: [{ name: "node", type: "bytes32" }], name: "ttl", outputs: [{ name: "", type: "uint64" }], payable: false, type: "function" }, { constant: false, inputs: [{ name: "node", type: "bytes32" }, { name: "resolver", type: "address" }], name: "setResolver", outputs: [], payable: false, type: "function" }, { constant: false, inputs: [{ name: "node", type: "bytes32" }, { name: "owner", type: "address" }], name: "setOwner", outputs: [], payable: false, type: "function" }, { anonymous: false, inputs: [{ indexed: true, name: "node", type: "bytes32" }, { indexed: false, name: "owner", type: "address" }], name: "Transfer", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "node", type: "bytes32" }, { indexed: true, name: "label", type: "bytes32" }, { indexed: false, name: "owner", type: "address" }], name: "NewOwner", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "node", type: "bytes32" }, { indexed: false, name: "resolver", type: "address" }], name: "NewResolver", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "node", type: "bytes32" }, { indexed: false, name: "ttl", type: "uint64" }], name: "NewTTL", type: "event" }, { constant: false, inputs: [{ internalType: "bytes32", name: "node", type: "bytes32" }, { internalType: "address", name: "owner", type: "address" }, { internalType: "address", name: "resolver", type: "address" }, { internalType: "uint64", name: "ttl", type: "uint64" }], name: "setRecord", outputs: [], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: false, inputs: [{ internalType: "address", name: "operator", type: "address" }, { internalType: "bool", name: "approved", type: "bool" }], name: "setApprovalForAll", outputs: [], payable: false, stateMutability: "nonpayable", type: "function" }, { anonymous: false, inputs: [{ indexed: true, internalType: "address", name: "owner", type: "address" }, { indexed: true, internalType: "address", name: "operator", type: "address" }, { indexed: false, internalType: "bool", name: "approved", type: "bool" }], name: "ApprovalForAll", type: "event" }, { constant: true, inputs: [{ internalType: "address", name: "owner", type: "address" }, { internalType: "address", name: "operator", type: "address" }], name: "isApprovedForAll", outputs: [{ internalType: "bool", name: "", type: "bool" }], payable: false, stateMutability: "view", type: "function" }, { constant: true, inputs: [{ internalType: "bytes32", name: "node", type: "bytes32" }], name: "recordExists", outputs: [{ internalType: "bool", name: "", type: "bool" }], payable: false, stateMutability: "view", type: "function" }, { constant: false, inputs: [{ internalType: "bytes32", name: "node", type: "bytes32" }, { internalType: "bytes32", name: "label", type: "bytes32" }, { internalType: "address", name: "owner", type: "address" }, { internalType: "address", name: "resolver", type: "address" }, { internalType: "uint64", name: "ttl", type: "uint64" }], name: "setSubnodeRecord", outputs: [], payable: false, stateMutability: "nonpayable", type: "function" }]; }, 48384: (e3) => { e3.exports = [{ constant: true, inputs: [{ name: "interfaceID", type: "bytes4" }], name: "supportsInterface", outputs: [{ name: "", type: "bool" }], payable: false, type: "function" }, { constant: true, inputs: [{ name: "node", type: "bytes32" }, { name: "contentTypes", type: "uint256" }], name: "ABI", outputs: [{ name: "contentType", type: "uint256" }, { name: "data", type: "bytes" }], payable: false, type: "function" }, { constant: false, inputs: [{ name: "node", type: "bytes32" }, { name: "hash", type: "bytes" }], name: "setMultihash", outputs: [], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: true, inputs: [{ name: "node", type: "bytes32" }], name: "multihash", outputs: [{ name: "", type: "bytes" }], payable: false, stateMutability: "view", type: "function" }, { constant: false, inputs: [{ name: "node", type: "bytes32" }, { name: "x", type: "bytes32" }, { name: "y", type: "bytes32" }], name: "setPubkey", outputs: [], payable: false, type: "function" }, { constant: true, inputs: [{ name: "node", type: "bytes32" }], name: "content", outputs: [{ name: "ret", type: "bytes32" }], payable: false, type: "function" }, { constant: true, inputs: [{ name: "node", type: "bytes32" }], name: "addr", outputs: [{ name: "ret", type: "address" }], payable: false, type: "function" }, { constant: false, inputs: [{ name: "node", type: "bytes32" }, { name: "contentType", type: "uint256" }, { name: "data", type: "bytes" }], name: "setABI", outputs: [], payable: false, type: "function" }, { constant: true, inputs: [{ name: "node", type: "bytes32" }], name: "name", outputs: [{ name: "ret", type: "string" }], payable: false, type: "function" }, { constant: false, inputs: [{ name: "node", type: "bytes32" }, { name: "name", type: "string" }], name: "setName", outputs: [], payable: false, type: "function" }, { constant: false, inputs: [{ name: "node", type: "bytes32" }, { name: "hash", type: "bytes32" }], name: "setContent", outputs: [], payable: false, type: "function" }, { constant: true, inputs: [{ name: "node", type: "bytes32" }], name: "pubkey", outputs: [{ name: "x", type: "bytes32" }, { name: "y", type: "bytes32" }], payable: false, type: "function" }, { constant: false, inputs: [{ name: "node", type: "bytes32" }, { name: "addr", type: "address" }], name: "setAddr", outputs: [], payable: false, type: "function" }, { inputs: [{ name: "ensAddr", type: "address" }], payable: false, type: "constructor" }, { anonymous: false, inputs: [{ indexed: true, name: "node", type: "bytes32" }, { indexed: false, name: "a", type: "address" }], name: "AddrChanged", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "node", type: "bytes32" }, { indexed: false, name: "hash", type: "bytes32" }], name: "ContentChanged", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "node", type: "bytes32" }, { indexed: false, name: "name", type: "string" }], name: "NameChanged", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "node", type: "bytes32" }, { indexed: true, name: "contentType", type: "uint256" }], name: "ABIChanged", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "node", type: "bytes32" }, { indexed: false, name: "x", type: "bytes32" }, { indexed: false, name: "y", type: "bytes32" }], name: "PubkeyChanged", type: "event" }, { anonymous: false, inputs: [{ indexed: true, name: "node", type: "bytes32" }, { indexed: false, name: "hash", type: "bytes" }], name: "ContenthashChanged", type: "event" }, { constant: true, inputs: [{ name: "node", type: "bytes32" }], name: "contenthash", outputs: [{ name: "", type: "bytes" }], payable: false, stateMutability: "view", type: "function" }, { constant: false, inputs: [{ name: "node", type: "bytes32" }, { name: "hash", type: "bytes" }], name: "setContenthash", outputs: [], payable: false, stateMutability: "nonpayable", type: "function" }]; }, 30006: (e3, t3, r3) => { var n2 = r3(28847), i2 = n2(r3(69721)), o2 = n2(r3(58985)), a2 = r3(48161), s2 = r3(31734), u2 = function(e4) { var t4 = "A".charCodeAt(0), r4 = "Z".charCodeAt(0); return (e4 = (e4 = e4.toUpperCase()).slice(4) + e4.slice(0, 4)).split("").map(function(e5) { var n3 = e5.charCodeAt(0); return n3 >= t4 && n3 <= r4 ? n3 - t4 + 10 : e5; }).join(""); }, c2 = function(e4) { for (var t4, r4 = e4; r4.length > 2; ) t4 = r4.slice(0, 9), r4 = parseInt(t4, 10) % 97 + r4.slice(t4.length); return parseInt(r4, 10) % 97; }, f2 = function() { function e4(t4) { (0, i2.default)(this, e4), this._iban = t4; } return (0, o2.default)(e4, [{ key: "isValid", value: function() { return /^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban) && 1 === c2(u2(this._iban)); } }, { key: "isDirect", value: function() { return 34 === this._iban.length || 35 === this._iban.length; } }, { key: "isIndirect", value: function() { return 20 === this._iban.length; } }, { key: "checksum", value: function() { return this._iban.slice(2, 4); } }, { key: "institution", value: function() { return this.isIndirect() ? this._iban.slice(7, 11) : ""; } }, { key: "client", value: function() { return this.isIndirect() ? this._iban.slice(11) : ""; } }, { key: "toAddress", value: function() { if (this.isDirect()) { var e5 = this._iban.slice(4), t4 = new s2(e5, 36); return a2.toChecksumAddress(t4.toString(16, 20)); } return ""; } }, { key: "toString", value: function() { return this._iban; } }], [{ key: "toAddress", value: function(t4) { if (!(t4 = new e4(t4)).isDirect()) throw new Error("IBAN is indirect and can't be converted"); return t4.toAddress(); } }, { key: "toIban", value: function(t4) { return e4.fromAddress(t4).toString(); } }, { key: "fromAddress", value: function(t4) { if (!a2.isAddress(t4)) throw new Error("Provided address is not a valid address: " + t4); t4 = t4.replace("0x", "").replace("0X", ""); var r4 = function(e5, t5) { for (var r5 = e5; r5.length < 30; ) r5 = "0" + r5; return r5; }(new s2(t4, 16).toString(36)); return e4.fromBban(r4.toUpperCase()); } }, { key: "fromBban", value: function(t4) { return new e4("XE" + ("0" + (98 - c2(u2("XE00" + t4)))).slice(-2) + t4); } }, { key: "createIndirect", value: function(t4) { return e4.fromBban("ETH" + t4.institution + t4.identifier); } }, { key: "isValid", value: function(t4) { return new e4(t4).isValid(); } }]), e4; }(); e3.exports = f2; }, 96306: (e3, t3, r3) => { var n2 = r3(80606), i2 = r3(53349), o2 = r3(48161), a2 = r3(473), s2 = r3(11314).formatters, u2 = function() { var e4 = this; n2.packageInit(this, arguments), this.net = new a2(this); var t4 = null, r4 = "latest"; Object.defineProperty(this, "defaultAccount", { get: function() { return t4; }, set: function(e5) { return e5 && (t4 = o2.toChecksumAddress(s2.inputAddressFormatter(e5))), u3.forEach(function(e6) { e6.defaultAccount = t4; }), e5; }, enumerable: true }), Object.defineProperty(this, "defaultBlock", { get: function() { return r4; }, set: function(e5) { return r4 = e5, u3.forEach(function(e6) { e6.defaultBlock = r4; }), e5; }, enumerable: true }); var u3 = [new i2({ name: "getAccounts", call: "personal_listAccounts", params: 0, outputFormatter: o2.toChecksumAddress }), new i2({ name: "newAccount", call: "personal_newAccount", params: 1, inputFormatter: [null], outputFormatter: o2.toChecksumAddress }), new i2({ name: "unlockAccount", call: "personal_unlockAccount", params: 3, inputFormatter: [s2.inputAddressFormatter, null, null] }), new i2({ name: "lockAccount", call: "personal_lockAccount", params: 1, inputFormatter: [s2.inputAddressFormatter] }), new i2({ name: "importRawKey", call: "personal_importRawKey", params: 2 }), new i2({ name: "sendTransaction", call: "personal_sendTransaction", params: 2, inputFormatter: [s2.inputTransactionFormatter, null] }), new i2({ name: "signTransaction", call: "personal_signTransaction", params: 2, inputFormatter: [s2.inputTransactionFormatter, null] }), new i2({ name: "sign", call: "personal_sign", params: 3, inputFormatter: [s2.inputSignFormatter, s2.inputAddressFormatter, null] }), new i2({ name: "ecRecover", call: "personal_ecRecover", params: 2, inputFormatter: [s2.inputSignFormatter, null] })]; u3.forEach(function(t5) { t5.attachToObject(e4), t5.setRequestManager(e4._requestManager), t5.defaultBlock = e4.defaultBlock, t5.defaultAccount = e4.defaultAccount; }); }; n2.addProviders(u2), e3.exports = u2; }, 28130: (e3) => { e3.exports = function(e4) { var t3, r3 = this; return this.net.getId().then(function(e5) { return t3 = e5, r3.getBlock(0); }).then(function(r4) { var n2 = "private"; return "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3" === r4.hash && 1 === t3 && (n2 = "main"), "0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d" === r4.hash && 3 === t3 && (n2 = "ropsten"), "0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177" === r4.hash && 4 === t3 && (n2 = "rinkeby"), "0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a" === r4.hash && 5 === t3 && (n2 = "goerli"), "0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9" === r4.hash && 42 === t3 && (n2 = "kovan"), "function" == typeof e4 && e4(null, n2), n2; }).catch(function(t4) { if ("function" != typeof e4) throw t4; e4(t4); }); }; }, 66748: (e3, t3, r3) => { var n2 = r3(80606), i2 = r3(11314), o2 = r3(34178).subscriptions, a2 = r3(53349), s2 = r3(48161), u2 = r3(473), c2 = r3(30715), f2 = r3(96306), d2 = r3(58164), l2 = r3(30006), h2 = r3(99819), p2 = r3(79901), b2 = r3(28130), y2 = i2.formatters, v2 = function(e4) { return "string" == typeof e4[0] && 0 === e4[0].indexOf("0x") ? "eth_getBlockByHash" : "eth_getBlockByNumber"; }, m2 = function(e4) { return "string" == typeof e4[0] && 0 === e4[0].indexOf("0x") ? "eth_getTransactionByBlockHashAndIndex" : "eth_getTransactionByBlockNumberAndIndex"; }, g2 = function(e4) { return "string" == typeof e4[0] && 0 === e4[0].indexOf("0x") ? "eth_getUncleByBlockHashAndIndex" : "eth_getUncleByBlockNumberAndIndex"; }, w2 = function(e4) { return "string" == typeof e4[0] && 0 === e4[0].indexOf("0x") ? "eth_getBlockTransactionCountByHash" : "eth_getBlockTransactionCountByNumber"; }, k2 = function(e4) { return "string" == typeof e4[0] && 0 === e4[0].indexOf("0x") ? "eth_getUncleCountByBlockHash" : "eth_getUncleCountByBlockNumber"; }, _2 = function() { var e4 = this; n2.packageInit(this, arguments); var t4 = this.setRequestManager; this.setRequestManager = function(r5) { return t4(r5), e4.net.setRequestManager(r5), e4.personal.setRequestManager(r5), e4.accounts.setRequestManager(r5), e4.Contract._requestManager = e4._requestManager, e4.Contract.currentProvider = e4._provider, true; }; var r4 = this.setProvider; this.setProvider = function() { r4.apply(e4, arguments), e4.setRequestManager(e4._requestManager), e4.ens._detectedAddress = null, e4.ens._lastSyncCheck = null; }; var i3, _3, A2, E2 = false, S2 = null, x2 = "latest", B2 = 50, O2 = 24, P2 = 750, I2 = 1e3, T2 = 10, C2 = 100; Object.defineProperty(this, "handleRevert", { get: function() { return E2; }, set: function(t5) { E2 = t5, e4.Contract.handleRevert = E2, U2.forEach(function(e5) { e5.handleRevert = E2; }); }, enumerable: true }), Object.defineProperty(this, "defaultCommon", { get: function() { return A2; }, set: function(t5) { A2 = t5, e4.Contract.defaultCommon = A2, U2.forEach(function(e5) { e5.defaultCommon = A2; }); }, enumerable: true }), Object.defineProperty(this, "defaultHardfork", { get: function() { return _3; }, set: function(t5) { _3 = t5, e4.Contract.defaultHardfork = _3, U2.forEach(function(e5) { e5.defaultHardfork = _3; }); }, enumerable: true }), Object.defineProperty(this, "defaultChain", { get: function() { return i3; }, set: function(t5) { i3 = t5, e4.Contract.defaultChain = i3, U2.forEach(function(e5) { e5.defaultChain = i3; }); }, enumerable: true }), Object.defineProperty(this, "transactionPollingTimeout", { get: function() { return P2; }, set: function(t5) { P2 = t5, e4.Contract.transactionPollingTimeout = P2, U2.forEach(function(e5) { e5.transactionPollingTimeout = P2; }); }, enumerable: true }), Object.defineProperty(this, "transactionPollingInterval", { get: function() { return I2; }, set: function(t5) { I2 = t5, e4.Contract.transactionPollingInterval = I2, U2.forEach(function(e5) { e5.transactionPollingInterval = I2; }); }, enumerable: true }), Object.defineProperty(this, "transactionConfirmationBlocks", { get: function() { return O2; }, set: function(t5) { O2 = t5, e4.Contract.transactionConfirmationBlocks = O2, U2.forEach(function(e5) { e5.transactionConfirmationBlocks = O2; }); }, enumerable: true }), Object.defineProperty(this, "transactionBlockTimeout", { get: function() { return B2; }, set: function(t5) { B2 = t5, e4.Contract.transactionBlockTimeout = B2, U2.forEach(function(e5) { e5.transactionBlockTimeout = B2; }); }, enumerable: true }), Object.defineProperty(this, "blockHeaderTimeout", { get: function() { return T2; }, set: function(t5) { T2 = t5, e4.Contract.blockHeaderTimeout = T2, U2.forEach(function(e5) { e5.blockHeaderTimeout = T2; }); }, enumerable: true }), Object.defineProperty(this, "defaultAccount", { get: function() { return S2; }, set: function(t5) { return t5 && (S2 = s2.toChecksumAddress(y2.inputAddressFormatter(t5))), e4.Contract.defaultAccount = S2, e4.personal.defaultAccount = S2, U2.forEach(function(e5) { e5.defaultAccount = S2; }), t5; }, enumerable: true }), Object.defineProperty(this, "defaultBlock", { get: function() { return x2; }, set: function(t5) { return x2 = t5, e4.Contract.defaultBlock = x2, e4.personal.defaultBlock = x2, U2.forEach(function(e5) { e5.defaultBlock = x2; }), t5; }, enumerable: true }), Object.defineProperty(this, "maxListenersWarningThreshold", { get: function() { return C2; }, set: function(t5) { e4.currentProvider && e4.currentProvider.setMaxListeners && (C2 = t5, e4.currentProvider.setMaxListeners(t5)); }, enumerable: true }), this.clearSubscriptions = e4._requestManager.clearSubscriptions.bind(e4._requestManager), this.removeSubscriptionById = e4._requestManager.removeSubscription.bind(e4._requestManager), this.net = new u2(this), this.net.getNetworkType = b2.bind(this), this.accounts = new h2(this), this.personal = new f2(this), this.personal.defaultAccount = this.defaultAccount, this.maxListenersWarningThreshold = C2; var M2 = this, R2 = function() { d2.apply(this, arguments); var e5 = this, t5 = M2.setProvider; M2.setProvider = function() { t5.apply(M2, arguments), n2.packageInit(e5, [M2]); }; }; R2.setProvider = function() { d2.setProvider.apply(this, arguments); }, (R2.prototype = Object.create(d2.prototype)).constructor = R2, this.Contract = R2, this.Contract.defaultAccount = this.defaultAccount, this.Contract.defaultBlock = this.defaultBlock, this.Contract.transactionBlockTimeout = this.transactionBlockTimeout, this.Contract.transactionConfirmationBlocks = this.transactionConfirmationBlocks, this.Contract.transactionPollingTimeout = this.transactionPollingTimeout, this.Contract.transactionPollingInterval = this.transactionPollingInterval, this.Contract.blockHeaderTimeout = this.blockHeaderTimeout, this.Contract.handleRevert = this.handleRevert, this.Contract._requestManager = this._requestManager, this.Contract._ethAccounts = this.accounts, this.Contract.currentProvider = this._requestManager.provider, this.Iban = l2, this.abi = p2, this.ens = new c2(this); var U2 = [new a2({ name: "getNodeInfo", call: "web3_clientVersion" }), new a2({ name: "getProtocolVersion", call: "eth_protocolVersion", params: 0 }), new a2({ name: "getCoinbase", call: "eth_coinbase", params: 0 }), new a2({ name: "isMining", call: "eth_mining", params: 0 }), new a2({ name: "getHashrate", call: "eth_hashrate", params: 0, outputFormatter: s2.hexToNumber }), new a2({ name: "isSyncing", call: "eth_syncing", params: 0, outputFormatter: y2.outputSyncingFormatter }), new a2({ name: "getGasPrice", call: "eth_gasPrice", params: 0, outputFormatter: y2.outputBigNumberFormatter }), new a2({ name: "getFeeHistory", call: "eth_feeHistory", params: 3, inputFormatter: [s2.numberToHex, y2.inputBlockNumberFormatter, null] }), new a2({ name: "getAccounts", call: "eth_accounts", params: 0, outputFormatter: s2.toChecksumAddress }), new a2({ name: "getBlockNumber", call: "eth_blockNumber", params: 0, outputFormatter: s2.hexToNumber }), new a2({ name: "getBalance", call: "eth_getBalance", params: 2, inputFormatter: [y2.inputAddressFormatter, y2.inputDefaultBlockNumberFormatter], outputFormatter: y2.outputBigNumberFormatter }), new a2({ name: "getStorageAt", call: "eth_getStorageAt", params: 3, inputFormatter: [y2.inputAddressFormatter, s2.numberToHex, y2.inputDefaultBlockNumberFormatter] }), new a2({ name: "getCode", call: "eth_getCode", params: 2, inputFormatter: [y2.inputAddressFormatter, y2.inputDefaultBlockNumberFormatter] }), new a2({ name: "getBlock", call: v2, params: 2, inputFormatter: [y2.inputBlockNumberFormatter, function(e5) { return !!e5; }], outputFormatter: y2.outputBlockFormatter }), new a2({ name: "getUncle", call: g2, params: 2, inputFormatter: [y2.inputBlockNumberFormatter, s2.numberToHex], outputFormatter: y2.outputBlockFormatter }), new a2({ name: "getBlockTransactionCount", call: w2, params: 1, inputFormatter: [y2.inputBlockNumberFormatter], outputFormatter: s2.hexToNumber }), new a2({ name: "getBlockUncleCount", call: k2, params: 1, inputFormatter: [y2.inputBlockNumberFormatter], outputFormatter: s2.hexToNumber }), new a2({ name: "getTransaction", call: "eth_getTransactionByHash", params: 1, inputFormatter: [null], outputFormatter: y2.outputTransactionFormatter }), new a2({ name: "getTransactionFromBlock", call: m2, params: 2, inputFormatter: [y2.inputBlockNumberFormatter, s2.numberToHex], outputFormatter: y2.outputTransactionFormatter }), new a2({ name: "getTransactionReceipt", call: "eth_getTransactionReceipt", params: 1, inputFormatter: [null], outputFormatter: y2.outputTransactionReceiptFormatter }), new a2({ name: "getTransactionCount", call: "eth_getTransactionCount", params: 2, inputFormatter: [y2.inputAddressFormatter, y2.inputDefaultBlockNumberFormatter], outputFormatter: s2.hexToNumber }), new a2({ name: "sendSignedTransaction", call: "eth_sendRawTransaction", params: 1, inputFormatter: [null], abiCoder: p2 }), new a2({ name: "signTransaction", call: "eth_signTransaction", params: 1, inputFormatter: [y2.inputTransactionFormatter] }), new a2({ name: "sendTransaction", call: "eth_sendTransaction", params: 1, inputFormatter: [y2.inputTransactionFormatter], abiCoder: p2 }), new a2({ name: "sign", call: "eth_sign", params: 2, inputFormatter: [y2.inputSignFormatter, y2.inputAddressFormatter], transformPayload: function(e5) { return e5.params.reverse(), e5; } }), new a2({ name: "call", call: "eth_call", params: 2, inputFormatter: [y2.inputCallFormatter, y2.inputDefaultBlockNumberFormatter], abiCoder: p2 }), new a2({ name: "estimateGas", call: "eth_estimateGas", params: 1, inputFormatter: [y2.inputCallFormatter], outputFormatter: s2.hexToNumber }), new a2({ name: "submitWork", call: "eth_submitWork", params: 3 }), new a2({ name: "getWork", call: "eth_getWork", params: 0 }), new a2({ name: "getPastLogs", call: "eth_getLogs", params: 1, inputFormatter: [y2.inputLogFormatter], outputFormatter: y2.outputLogFormatter }), new a2({ name: "getChainId", call: "eth_chainId", params: 0, outputFormatter: s2.hexToNumber }), new a2({ name: "requestAccounts", call: "eth_requestAccounts", params: 0, outputFormatter: s2.toChecksumAddress }), new a2({ name: "getProof", call: "eth_getProof", params: 3, inputFormatter: [y2.inputAddressFormatter, y2.inputStorageKeysFormatter, y2.inputDefaultBlockNumberFormatter], outputFormatter: y2.outputProofFormatter }), new a2({ name: "getPendingTransactions", call: "eth_pendingTransactions", params: 0, outputFormatter: y2.outputTransactionFormatter }), new a2({ name: "createAccessList", call: "eth_createAccessList", params: 2, inputFormatter: [y2.inputTransactionFormatter, y2.inputDefaultBlockNumberFormatter] }), new o2({ name: "subscribe", type: "eth", subscriptions: { newBlockHeaders: { subscriptionName: "newHeads", params: 0, outputFormatter: y2.outputBlockFormatter }, pendingTransactions: { subscriptionName: "newPendingTransactions", params: 0 }, logs: { params: 1, inputFormatter: [y2.inputLogFormatter], outputFormatter: y2.outputLogFormatter, subscriptionHandler: function(e5) { e5.removed ? this.emit("changed", e5) : this.emit("data", e5), "function" == typeof this.callback && this.callback(null, e5, this); } }, syncing: { params: 0, outputFormatter: y2.outputSyncingFormatter, subscriptionHandler: function(e5) { var t5 = this; true !== this._isSyncing ? (this._isSyncing = true, this.emit("changed", t5._isSyncing), "function" == typeof this.callback && this.callback(null, t5._isSyncing, this), setTimeout(function() { t5.emit("data", e5), "function" == typeof t5.callback && t5.callback(null, e5, t5); }, 0)) : (this.emit("data", e5), "function" == typeof t5.callback && this.callback(null, e5, this), clearTimeout(this._isSyncingTimeout), this._isSyncingTimeout = setTimeout(function() { e5.currentBlock > e5.highestBlock - 200 && (t5._isSyncing = false, t5.emit("changed", t5._isSyncing), "function" == typeof t5.callback && t5.callback(null, t5._isSyncing, t5)); }, 500)); } } } })]; U2.forEach(function(t5) { t5.attachToObject(e4), t5.setRequestManager(e4._requestManager, e4.accounts), t5.defaultBlock = e4.defaultBlock, t5.defaultAccount = e4.defaultAccount, t5.transactionBlockTimeout = e4.transactionBlockTimeout, t5.transactionConfirmationBlocks = e4.transactionConfirmationBlocks, t5.transactionPollingTimeout = e4.transactionPollingTimeout, t5.transactionPollingInterval = e4.transactionPollingInterval, t5.handleRevert = e4.handleRevert; }); }; n2.addProviders(_2), e3.exports = _2; }, 473: (e3, t3, r3) => { var n2 = r3(80606), i2 = r3(53349), o2 = r3(48161), a2 = function() { var e4 = this; n2.packageInit(this, arguments), [new i2({ name: "getId", call: "net_version", params: 0, outputFormatter: parseInt }), new i2({ name: "isListening", call: "net_listening", params: 0 }), new i2({ name: "getPeerCount", call: "net_peerCount", params: 0, outputFormatter: o2.hexToNumber })].forEach(function(t4) { t4.attachToObject(e4), t4.setRequestManager(e4._requestManager); }); }; n2.addProviders(a2), e3.exports = a2; }, 14565: (e3, t3, r3) => { var n2 = r3(11314).errors, i2 = r3(33768), o2 = r3(29519), a2 = r3(90912); r3(54258).polyfill(), void 0 === r3.g || r3.g.AbortController || r3(53368); var s2 = function(e4, t4) { t4 = t4 || {}, this.withCredentials = t4.withCredentials, this.timeout = t4.timeout || 0, this.headers = t4.headers, this.agent = t4.agent, this.forceGlobalFetch = t4.forceGlobalFetch || false, this.connected = false; var r4 = false !== t4.keepAlive; this.host = e4 || "http://localhost:8545", this.agent || ("https" === this.host.substring(0, 5) ? this.httpsAgent = new a2.Agent({ keepAlive: r4 }) : this.httpAgent = new o2.Agent({ keepAlive: r4 })); }; s2.prototype.send = function(e4, t4) { var r4, o3 = { method: "POST", body: JSON.stringify(e4) }, a3 = {}, s3 = this.forceGlobalFetch ? globalThis.fetch : i2; if ("undefined" != typeof AbortController ? r4 = new AbortController() : "undefined" != typeof window && void 0 !== window.AbortController && (r4 = new window.AbortController()), void 0 !== r4 && (o3.signal = r4.signal), "undefined" == typeof XMLHttpRequest) { var u2 = { httpsAgent: this.httpsAgent, httpAgent: this.httpAgent }; this.agent && (u2.httpsAgent = this.agent.https, u2.httpAgent = this.agent.http), "https" === this.host.substring(0, 5) ? o3.agent = u2.httpsAgent : o3.agent = u2.httpAgent; } this.headers && this.headers.forEach(function(e5) { a3[e5.name] = e5.value; }), a3["Content-Type"] || (a3["Content-Type"] = "application/json"), this.withCredentials ? o3.credentials = "include" : o3.credentials = "omit", o3.headers = a3, this.timeout > 0 && void 0 !== r4 && (this.timeoutId = setTimeout(function() { r4.abort(); }, this.timeout)), s3(this.host, o3).then((function(e5) { void 0 !== this.timeoutId && clearTimeout(this.timeoutId), e5.json().then(function(e6) { t4(null, e6); }, function() { e5.text().then(function(e6) { t4(n2.InvalidResponse(e6)); }, function() { t4(n2.InvalidResponse("")); }); }); }).bind(this), (function(e5) { void 0 !== this.timeoutId && clearTimeout(this.timeoutId), "AbortError" !== e5.name ? t4(n2.InvalidConnection(this.host, e5)) : t4(n2.ConnectionTimeout(this.timeout)); }).bind(this)); }, s2.prototype.disconnect = function() { }, s2.prototype.supportsSubscriptions = function() { return false; }, e3.exports = s2; }, 52683: (e3, t3, r3) => { var n2 = r3(11314).errors, i2 = r3(83150), o2 = function(e4, t4) { var r4 = this; this.responseCallbacks = {}, this.notificationCallbacks = [], this.path = e4, this.connected = false, this.connection = t4.connect({ path: this.path }), this.addDefaultEvents(); var n3 = function(e5) { var t5 = null; Array.isArray(e5) ? e5.forEach(function(e6) { r4.responseCallbacks[e6.id] && (t5 = e6.id); }) : t5 = e5.id, t5 || -1 === e5.method.indexOf("_subscription") ? r4.responseCallbacks[t5] && (r4.responseCallbacks[t5](null, e5), delete r4.responseCallbacks[t5]) : r4.notificationCallbacks.forEach(function(t6) { "function" == typeof t6 && t6(e5); }); }; "Socket" === t4.constructor.name ? i2(this.connection).done(n3) : this.connection.on("data", function(e5) { r4._parseResponse(e5.toString()).forEach(n3); }); }; o2.prototype.addDefaultEvents = function() { var e4 = this; this.connection.on("connect", function() { e4.connected = true; }), this.connection.on("close", function() { e4.connected = false; }), this.connection.on("error", function() { e4._timeout(); }), this.connection.on("end", function() { e4._timeout(); }), this.connection.on("timeout", function() { e4._timeout(); }); }, o2.prototype._parseResponse = function(e4) { var t4 = this, r4 = []; return e4.replace(/\}[\n\r]?\{/g, "}|--|{").replace(/\}\][\n\r]?\[\{/g, "}]|--|[{").replace(/\}[\n\r]?\[\{/g, "}|--|[{").replace(/\}\][\n\r]?\{/g, "}]|--|{").split("|--|").forEach(function(e5) { t4.lastChunk && (e5 = t4.lastChunk + e5); var i3 = null; try { i3 = JSON.parse(e5); } catch (r5) { return t4.lastChunk = e5, clearTimeout(t4.lastChunkTimeout), void (t4.lastChunkTimeout = setTimeout(function() { throw t4._timeout(), n2.InvalidResponse(e5); }, 15e3)); } clearTimeout(t4.lastChunkTimeout), t4.lastChunk = null, i3 && r4.push(i3); }), r4; }, o2.prototype._addResponseCallback = function(e4, t4) { var r4 = e4.id || e4[0].id, n3 = e4.method || e4[0].method; this.responseCallbacks[r4] = t4, this.responseCallbacks[r4].method = n3; }, o2.prototype._timeout = function() { for (var e4 in this.responseCallbacks) this.responseCallbacks.hasOwnProperty(e4) && (this.responseCallbacks[e4](n2.InvalidConnection("on IPC")), delete this.responseCallbacks[e4]); }, o2.prototype.reconnect = function() { this.connection.connect({ path: this.path }); }, o2.prototype.send = function(e4, t4) { this.connection.writable || this.connection.connect({ path: this.path }), this.connection.write(JSON.stringify(e4)), this._addResponseCallback(e4, t4); }, o2.prototype.on = function(e4, t4) { if ("function" != typeof t4) throw new Error("The second parameter callback must be a function."); "data" === e4 ? this.notificationCallbacks.push(t4) : this.connection.on(e4, t4); }, o2.prototype.once = function(e4, t4) { if ("function" != typeof t4) throw new Error("The second parameter callback must be a function."); this.connection.once(e4, t4); }, o2.prototype.removeListener = function(e4, t4) { var r4 = this; "data" === e4 ? this.notificationCallbacks.forEach(function(e5, n3) { e5 === t4 && r4.notificationCallbacks.splice(n3, 1); }) : this.connection.removeListener(e4, t4); }, o2.prototype.removeAllListeners = function(e4) { "data" === e4 ? this.notificationCallbacks = [] : this.connection.removeAllListeners(e4); }, o2.prototype.reset = function() { this._timeout(), this.notificationCallbacks = [], this.connection.removeAllListeners("error"), this.connection.removeAllListeners("end"), this.connection.removeAllListeners("timeout"), this.addDefaultEvents(); }, o2.prototype.supportsSubscriptions = function() { return true; }, e3.exports = o2; }, 40360: (e3, t3, r3) => { var n2 = r3(19142), i2 = r3(29033).Buffer, o2 = r3(28847)(r3(3355)), a2 = "[object process]" === Object.prototype.toString.call(void 0 !== n2 ? n2 : 0), s2 = "undefined" != typeof navigator && "ReactNative" === navigator.product, u2 = null, c2 = null; if (a2 || s2) { u2 = function(e4) { return i2.from(e4).toString("base64"); }; var f2 = r3(51143); if (f2.URL) { var d2 = f2.URL; c2 = function(e4) { return new d2(e4); }; } else c2 = r3(51143).parse; } else u2 = btoa.bind("object" === ("undefined" == typeof globalThis ? "undefined" : (0, o2.default)(globalThis)) ? globalThis : self), c2 = function(e4) { return new URL(e4); }; e3.exports = { parseURL: c2, btoa: u2 }; }, 77651: (e3, t3, r3) => { var n2 = r3(98008), i2 = r3(40360), o2 = r3(11314).errors, a2 = r3(1158).w3cwebsocket, s2 = function(e4, t4) { n2.call(this), t4 = t4 || {}, this.url = e4, this._customTimeout = t4.timeout || 15e3, this.headers = t4.headers || {}, this.protocol = t4.protocol || void 0, this.reconnectOptions = Object.assign({ auto: false, delay: 5e3, maxAttempts: false, onTimeout: false }, t4.reconnect), this.clientConfig = t4.clientConfig || void 0, this.requestOptions = t4.requestOptions || void 0, this.DATA = "data", this.CLOSE = "close", this.ERROR = "error", this.CONNECT = "connect", this.RECONNECT = "reconnect", this.connection = null, this.requestQueue = /* @__PURE__ */ new Map(), this.responseQueue = /* @__PURE__ */ new Map(), this.reconnectAttempts = 0, this.reconnecting = false, this.connectFailedDescription = null; var r4 = i2.parseURL(e4); r4.username && r4.password && (this.headers.authorization = "Basic " + i2.btoa(r4.username + ":" + r4.password)), r4.auth && (this.headers.authorization = "Basic " + i2.btoa(r4.auth)), Object.defineProperty(this, "connected", { get: function() { return this.connection && this.connection.readyState === this.connection.OPEN; }, enumerable: true }), this.connect(); }; (s2.prototype = Object.create(n2.prototype)).constructor = s2, s2.prototype.connect = function() { this.connection = new a2(this.url, this.protocol, void 0, this.headers, this.requestOptions, this.clientConfig), this._addSocketListeners(); }, s2.prototype._onMessage = function(e4) { var t4 = this; this._parseResponse("string" == typeof e4.data ? e4.data : "").forEach(function(e5) { if (e5.method && -1 !== e5.method.indexOf("_subscription")) t4.emit(t4.DATA, e5); else { var r4 = e5.id; Array.isArray(e5) && (r4 = e5[0].id), t4.responseQueue.has(r4) && (void 0 !== t4.responseQueue.get(r4).callback && t4.responseQueue.get(r4).callback(false, e5), t4.responseQueue.delete(r4)); } }); }, s2.prototype._onConnect = function() { if (this.emit(this.CONNECT), this.reconnectAttempts = 0, this.reconnecting = false, this.requestQueue.size > 0) { var e4 = this; this.requestQueue.forEach(function(t4, r4) { e4.send(t4.payload, t4.callback), e4.requestQueue.delete(r4); }); } }, s2.prototype._onConnectFailed = function(e4) { this.connectFailedDescription = e4.toString().split("\n")[0]; var t4 = this; this.connectFailedDescription && (e4.description = this.connectFailedDescription, this.connectFailedDescription = null), e4.code = 1006, e4.reason = "connection failed", !this.reconnectOptions.auto || [1e3, 1001].includes(e4.code) && false !== e4.wasClean ? (this.emit(this.ERROR, e4), this.requestQueue.size > 0 && this.requestQueue.forEach(function(r4, n3) { r4.callback(o2.ConnectionNotOpenError(e4)), t4.requestQueue.delete(n3); }), this.responseQueue.size > 0 && this.responseQueue.forEach(function(r4, n3) { r4.callback(o2.InvalidConnection("on WS", e4)), t4.responseQueue.delete(n3); }), this.connection._connection && this.connection._connection.removeAllListeners(), this.connection._client.removeAllListeners(), this.connection._readyState = 3, this.emit(this.CLOSE, e4)) : this.reconnect(); }, s2.prototype._onClose = function(e4) { var t4 = this; !this.reconnectOptions.auto || [1e3, 1001].includes(e4.code) && false !== e4.wasClean ? (this.emit(this.CLOSE, e4), this.requestQueue.size > 0 && this.requestQueue.forEach(function(r4, n3) { r4.callback(o2.ConnectionNotOpenError(e4)), t4.requestQueue.delete(n3); }), this.responseQueue.size > 0 && this.responseQueue.forEach(function(r4, n3) { r4.callback(o2.InvalidConnection("on WS", e4)), t4.responseQueue.delete(n3); }), this._removeSocketListeners(), this.removeAllListeners()) : this.reconnect(); }, s2.prototype._addSocketListeners = function() { this.connection.addEventListener("message", this._onMessage.bind(this)), this.connection.addEventListener("open", this._onConnect.bind(this)), this.connection.addEventListener("close", this._onClose.bind(this)), this.connection._client && (this.connection._client.removeAllListeners("connectFailed"), this.connection._client.on("connectFailed", this._onConnectFailed.bind(this))); }, s2.prototype._removeSocketListeners = function() { this.connection.removeEventListener("message", this._onMessage), this.connection.removeEventListener("open", this._onConnect), this.connection.removeEventListener("close", this._onClose), this.connection._connection && this.connection._client.removeListener("connectFailed", this._onConnectFailed); }, s2.prototype._parseResponse = function(e4) { var t4 = this, r4 = []; return e4.replace(/\}[\n\r]?\{/g, "}|--|{").replace(/\}\][\n\r]?\[\{/g, "}]|--|[{").replace(/\}[\n\r]?\[\{/g, "}|--|[{").replace(/\}\][\n\r]?\{/g, "}]|--|{").split("|--|").forEach(function(e5) { t4.lastChunk && (e5 = t4.lastChunk + e5); var n3 = null; try { n3 = JSON.parse(e5); } catch (r5) { return t4.lastChunk = e5, clearTimeout(t4.lastChunkTimeout), void (t4.lastChunkTimeout = setTimeout(function() { t4.reconnectOptions.auto && t4.reconnectOptions.onTimeout ? t4.reconnect() : (t4.emit(t4.ERROR, o2.ConnectionTimeout(t4._customTimeout)), t4.requestQueue.size > 0 && t4.requestQueue.forEach(function(e6, r6) { e6.callback(o2.ConnectionTimeout(t4._customTimeout)), t4.requestQueue.delete(r6); })); }, t4._customTimeout)); } clearTimeout(t4.lastChunkTimeout), t4.lastChunk = null, n3 && r4.push(n3); }), r4; }, s2.prototype.send = function(e4, t4) { var r4 = e4.id, n3 = { payload: e4, callback: t4 }; if (Array.isArray(e4) && (r4 = e4[0].id), this.connection.readyState === this.connection.CONNECTING || this.reconnecting) this.requestQueue.set(r4, n3); else { if (this.connection.readyState !== this.connection.OPEN) return this.requestQueue.delete(r4), this.emit(this.ERROR, o2.ConnectionNotOpenError()), void n3.callback(o2.ConnectionNotOpenError()); this.responseQueue.set(r4, n3), this.requestQueue.delete(r4); try { this.connection.send(JSON.stringify(n3.payload)); } catch (e5) { n3.callback(e5), this.responseQueue.delete(r4); } } }, s2.prototype.reset = function() { this.responseQueue.clear(), this.requestQueue.clear(), this.removeAllListeners(), this._removeSocketListeners(), this._addSocketListeners(); }, s2.prototype.disconnect = function(e4, t4) { this._removeSocketListeners(), this.connection.close(e4 || 1e3, t4); }, s2.prototype.supportsSubscriptions = function() { return true; }, s2.prototype.reconnect = function() { var e4 = this; this.reconnecting = true, this.responseQueue.size > 0 && this.responseQueue.forEach(function(t4, r4) { try { e4.responseQueue.delete(r4), t4.callback(o2.PendingRequestsOnReconnectingError()); } catch (e5) { console.error("Error encountered in reconnect: ", e5); } }), !this.reconnectOptions.maxAttempts || this.reconnectAttempts < this.reconnectOptions.maxAttempts ? setTimeout(function() { e4.reconnectAttempts++, e4._removeSocketListeners(), e4.emit(e4.RECONNECT, e4.reconnectAttempts), e4.connect(); }, this.reconnectOptions.delay) : (this.emit(this.ERROR, o2.MaxAttemptsReachedOnReconnectingError()), this.reconnecting = false, this.requestQueue.size > 0 && this.requestQueue.forEach(function(t4, r4) { t4.callback(o2.MaxAttemptsReachedOnReconnectingError()), e4.requestQueue.delete(r4); })); }, e3.exports = s2; }, 92565: (e3, t3, r3) => { var n2 = r3(80606), i2 = r3(34178).subscriptions, o2 = r3(53349), a2 = r3(473), s2 = function() { var e4 = this; n2.packageInit(this, arguments); var t4 = this.setRequestManager; this.setRequestManager = function(r5) { return t4(r5), e4.net.setRequestManager(r5), true; }; var r4 = this.setProvider; this.setProvider = function() { r4.apply(e4, arguments), e4.setRequestManager(e4._requestManager); }, this.net = new a2(this), [new i2({ name: "subscribe", type: "shh", subscriptions: { messages: { params: 1 } } }), new o2({ name: "getVersion", call: "shh_version", params: 0 }), new o2({ name: "getInfo", call: "shh_info", params: 0 }), new o2({ name: "setMaxMessageSize", call: "shh_setMaxMessageSize", params: 1 }), new o2({ name: "setMinPoW", call: "shh_setMinPoW", params: 1 }), new o2({ name: "markTrustedPeer", call: "shh_markTrustedPeer", params: 1 }), new o2({ name: "newKeyPair", call: "shh_newKeyPair", params: 0 }), new o2({ name: "addPrivateKey", call: "shh_addPrivateKey", params: 1 }), new o2({ name: "deleteKeyPair", call: "shh_deleteKeyPair", params: 1 }), new o2({ name: "hasKeyPair", call: "shh_hasKeyPair", params: 1 }), new o2({ name: "getPublicKey", call: "shh_getPublicKey", params: 1 }), new o2({ name: "getPrivateKey", call: "shh_getPrivateKey", params: 1 }), new o2({ name: "newSymKey", call: "shh_newSymKey", params: 0 }), new o2({ name: "addSymKey", call: "shh_addSymKey", params: 1 }), new o2({ name: "generateSymKeyFromPassword", call: "shh_generateSymKeyFromPassword", params: 1 }), new o2({ name: "hasSymKey", call: "shh_hasSymKey", params: 1 }), new o2({ name: "getSymKey", call: "shh_getSymKey", params: 1 }), new o2({ name: "deleteSymKey", call: "shh_deleteSymKey", params: 1 }), new o2({ name: "newMessageFilter", call: "shh_newMessageFilter", params: 1 }), new o2({ name: "getFilterMessages", call: "shh_getFilterMessages", params: 1 }), new o2({ name: "deleteMessageFilter", call: "shh_deleteMessageFilter", params: 1 }), new o2({ name: "post", call: "shh_post", params: 1, inputFormatter: [null] }), new o2({ name: "unsubscribe", call: "shh_unsubscribe", params: 1 })].forEach(function(t5) { t5.attachToObject(e4), t5.setRequestManager(e4._requestManager); }); }; s2.prototype.clearSubscriptions = function() { this._requestManager.clearSubscriptions(); }, n2.addProviders(s2), e3.exports = s2; }, 48161: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(17130), o2 = r3(90323), a2 = r3(747), s2 = r3(75010), u2 = r3(31734), c2 = function e4(t4, r4) { var i3 = []; return r4.forEach(function(r5) { if ("object" === (0, n2.default)(r5.components)) { if ("tuple" !== r5.type.substring(0, 5)) throw new Error("components found but type is not tuple; report on GitHub"); var o3 = "", a3 = r5.type.indexOf("["); a3 >= 0 && (o3 = r5.type.substring(a3)); var s3 = e4(t4, r5.components); Array.isArray(s3) && t4 ? i3.push("tuple(" + s3.join(",") + ")" + o3) : t4 ? i3.push("(" + s3 + ")") : i3.push("(" + s3.join(",") + ")" + o3); } else i3.push(r5.type); }), i3; }, f2 = function(e4) { if (!o2.isHexStrict(e4)) throw new Error("The parameter must be a valid HEX string."); var t4 = "", r4 = 0, n3 = e4.length; for ("0x" === e4.substring(0, 2) && (r4 = 2); r4 < n3; r4 += 2) { var i3 = parseInt(e4.slice(r4, r4 + 2), 16); t4 += String.fromCharCode(i3); } return t4; }, d2 = function(e4) { if (!e4) return "0x00"; for (var t4 = "", r4 = 0; r4 < e4.length; r4++) { var n3 = e4.charCodeAt(r4).toString(16); t4 += n3.length < 2 ? "0" + n3 : n3; } return "0x" + t4; }, l2 = function(e4) { if (e4 = e4 ? e4.toLowerCase() : "ether", !i2.unitMap[e4]) throw new Error('This unit "' + e4 + `" doesn't exist, please use the one of the following units` + JSON.stringify(i2.unitMap, null, 2)); return e4; }; e3.exports = { _fireError: function(e4, t4, r4, i3, o3) { return !e4 || "object" !== (0, n2.default)(e4) || e4 instanceof Error || !e4.data || ((e4.data && "object" === (0, n2.default)(e4.data) || Array.isArray(e4.data)) && (e4.data = JSON.stringify(e4.data, null, 2)), e4 = e4.message + "\n" + e4.data), "string" == typeof e4 && (e4 = new Error(e4)), "function" == typeof i3 && i3(e4, o3), "function" == typeof r4 && ((t4 && "function" == typeof t4.listeners && t4.listeners("error").length || "function" == typeof i3) && t4.catch(function() { }), setTimeout(function() { r4(e4); }, 1)), t4 && "function" == typeof t4.emit && setTimeout(function() { t4.emit("error", e4, o3), t4.removeAllListeners(); }, 1), t4; }, _jsonInterfaceMethodToString: function(e4) { return e4 && "object" === (0, n2.default)(e4) && e4.name && -1 !== e4.name.indexOf("(") ? e4.name : e4.name + "(" + c2(false, e4.inputs).join(",") + ")"; }, _flattenTypes: c2, randomHex: function(e4) { return "0x" + s2(e4).toString("hex"); }, BN: o2.BN, isBN: o2.isBN, isBigNumber: o2.isBigNumber, isHex: o2.isHex, isHexStrict: o2.isHexStrict, sha3: o2.sha3, sha3Raw: o2.sha3Raw, keccak256: o2.sha3, soliditySha3: a2.soliditySha3, soliditySha3Raw: a2.soliditySha3Raw, encodePacked: a2.encodePacked, isAddress: o2.isAddress, checkAddressChecksum: o2.checkAddressChecksum, toChecksumAddress: function(e4) { if (void 0 === e4) return ""; if (!/^(0x)?[0-9a-f]{40}$/i.test(e4)) throw new Error('Given address "' + e4 + '" is not a valid Ethereum address.'); e4 = e4.toLowerCase().replace(/^0x/i, ""); for (var t4 = o2.sha3(e4).replace(/^0x/i, ""), r4 = "0x", n3 = 0; n3 < e4.length; n3++) parseInt(t4[n3], 16) > 7 ? r4 += e4[n3].toUpperCase() : r4 += e4[n3]; return r4; }, toHex: o2.toHex, toBN: o2.toBN, bytesToHex: o2.bytesToHex, hexToBytes: o2.hexToBytes, hexToNumberString: o2.hexToNumberString, hexToNumber: o2.hexToNumber, toDecimal: o2.hexToNumber, numberToHex: o2.numberToHex, fromDecimal: o2.numberToHex, hexToUtf8: o2.hexToUtf8, hexToString: o2.hexToUtf8, toUtf8: o2.hexToUtf8, stripHexPrefix: o2.stripHexPrefix, utf8ToHex: o2.utf8ToHex, stringToHex: o2.utf8ToHex, fromUtf8: o2.utf8ToHex, hexToAscii: f2, toAscii: f2, asciiToHex: d2, fromAscii: d2, unitMap: i2.unitMap, toWei: function(e4, t4) { if (t4 = l2(t4), !o2.isBN(e4) && "string" != typeof e4) throw new Error("Please pass numbers as strings or BN objects to avoid precision errors."); return o2.isBN(e4) ? i2.toWei(e4, t4) : i2.toWei(e4, t4).toString(10); }, fromWei: function(e4, t4) { if (t4 = l2(t4), !o2.isBN(e4) && "string" != typeof e4) throw new Error("Please pass numbers as strings or BN objects to avoid precision errors."); return o2.isBN(e4) ? i2.fromWei(e4, t4) : i2.fromWei(e4, t4).toString(10); }, padLeft: o2.leftPad, leftPad: o2.leftPad, padRight: o2.rightPad, rightPad: o2.rightPad, toTwosComplement: o2.toTwosComplement, isBloom: o2.isBloom, isUserEthereumAddressInBloom: o2.isUserEthereumAddressInBloom, isContractAddressInBloom: o2.isContractAddressInBloom, isTopic: o2.isTopic, isTopicInBloom: o2.isTopicInBloom, isInBloom: o2.isInBloom, compareBlockNumbers: function(e4, t4) { if (e4 === t4) return 0; if ("genesis" !== e4 && "earliest" !== e4 && 0 !== e4 || "genesis" !== t4 && "earliest" !== t4 && 0 !== t4) { if ("genesis" === e4 || "earliest" === e4 || 0 === e4) return -1; if ("genesis" === t4 || "earliest" === t4 || 0 === t4) return 1; if ("latest" === e4 || "finalized" === e4) return "pending" === t4 ? -1 : 1; if ("latest" === t4 || "finalized" === t4) return "pending" === e4 ? 1 : -1; if ("pending" === e4) return 1; if ("pending" === t4) return -1; if ("safe" === e4 || "safe" === t4) return; var r4 = new u2(e4), n3 = new u2(t4); return r4.lt(n3) ? -1 : r4.eq(n3) ? 0 : 1; } return 0; }, toNumber: o2.toNumber }; }, 747: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(31734), o2 = r3(90323), a2 = function(e4) { var t4 = (0, n2.default)(e4); if ("string" === t4) return o2.isHexStrict(e4) ? new i2(e4.replace(/0x/i, ""), 16) : new i2(e4, 10); if ("number" === t4) return new i2(e4); if (o2.isBigNumber(e4)) return new i2(e4.toString(10)); if (o2.isBN(e4)) return e4; throw new Error(e4 + " is not a number"); }, s2 = function(e4, t4, r4) { var n3, s3; if ("bytes" === (e4 = function(e5) { return e5.startsWith("int[") ? "int256" + e5.slice(3) : "int" === e5 ? "int256" : e5.startsWith("uint[") ? "uint256" + e5.slice(4) : "uint" === e5 ? "uint256" : e5.startsWith("fixed[") ? "fixed128x128" + e5.slice(5) : "fixed" === e5 ? "fixed128x128" : e5.startsWith("ufixed[") ? "ufixed128x128" + e5.slice(6) : "ufixed" === e5 ? "ufixed128x128" : e5; }(e4))) { if (t4.replace(/^0x/i, "").length % 2 != 0) throw new Error("Invalid bytes characters " + t4.length); return t4; } if ("string" === e4) return o2.utf8ToHex(t4); if ("bool" === e4) return t4 ? "01" : "00"; if (e4.startsWith("address")) { if (n3 = r4 ? 64 : 40, !o2.isAddress(t4)) throw new Error(t4 + " is not a valid address, or the checksum is invalid."); return o2.leftPad(t4.toLowerCase(), n3); } if (n3 = function(e5) { var t5 = /^\D+(\d+).*$/.exec(e5); return t5 ? parseInt(t5[1], 10) : null; }(e4), e4.startsWith("bytes")) { if (!n3) throw new Error("bytes[] not yet supported in solidity"); if (r4 && (n3 = 32), n3 < 1 || n3 > 32 || n3 < t4.replace(/^0x/i, "").length / 2) throw new Error("Invalid bytes" + n3 + " for " + t4); return o2.rightPad(t4, 2 * n3); } if (e4.startsWith("uint")) { if (n3 % 8 || n3 < 8 || n3 > 256) throw new Error("Invalid uint" + n3 + " size"); if ((s3 = a2(t4)).bitLength() > n3) throw new Error("Supplied uint exceeds width: " + n3 + " vs " + s3.bitLength()); if (s3.lt(new i2(0))) throw new Error("Supplied uint " + s3.toString() + " is negative"); return n3 ? o2.leftPad(s3.toString("hex"), n3 / 8 * 2) : s3; } if (e4.startsWith("int")) { if (n3 % 8 || n3 < 8 || n3 > 256) throw new Error("Invalid int" + n3 + " size"); if ((s3 = a2(t4)).bitLength() > n3) throw new Error("Supplied int exceeds width: " + n3 + " vs " + s3.bitLength()); return s3.lt(new i2(0)) ? s3.toTwos(n3).toString("hex") : n3 ? o2.leftPad(s3.toString("hex"), n3 / 8 * 2) : s3; } throw new Error("Unsupported or invalid type: " + e4); }, u2 = function(e4) { if (Array.isArray(e4)) throw new Error("Autodetection of array types is not supported."); var t4, r4, a3 = ""; if (e4 && "object" === (0, n2.default)(e4) && (e4.hasOwnProperty("v") || e4.hasOwnProperty("t") || e4.hasOwnProperty("value") || e4.hasOwnProperty("type")) ? (t4 = e4.hasOwnProperty("t") ? e4.t : e4.type, a3 = e4.hasOwnProperty("v") ? e4.v : e4.value) : (t4 = o2.toHex(e4, true), a3 = o2.toHex(e4), t4.startsWith("int") || t4.startsWith("uint") || (t4 = "bytes")), !t4.startsWith("int") && !t4.startsWith("uint") || "string" != typeof a3 || /^(-)?0x/i.test(a3) || (a3 = new i2(a3)), Array.isArray(a3)) { if (r4 = function(e5) { var t5 = /^\D+\d*\[(\d+)\]$/.exec(e5); return t5 ? parseInt(t5[1], 10) : null; }(t4), r4 && a3.length !== r4) throw new Error(t4 + " is not matching the given array " + JSON.stringify(a3)); r4 = a3.length; } return Array.isArray(a3) ? a3.map(function(e5) { return s2(t4, e5, r4).toString("hex").replace("0x", ""); }).join("") : s2(t4, a3, r4).toString("hex").replace("0x", ""); }; e3.exports = { soliditySha3: function() { var e4 = Array.prototype.slice.call(arguments).map(u2); return o2.sha3("0x" + e4.join("")); }, soliditySha3Raw: function() { return o2.sha3Raw("0x" + Array.prototype.slice.call(arguments).map(u2).join("")); }, encodePacked: function() { return "0x" + Array.prototype.slice.call(arguments).map(u2).join("").toLowerCase(); } }; }, 90323: (e3, t3, r3) => { var n2 = r3(29033).Buffer, i2 = r3(28847), o2 = i2(r3(74519)), a2 = i2(r3(3355)), s2 = r3(31734), u2 = r3(77277), c2 = r3(88632), f2 = r3(65907), d2 = r3(19313), l2 = r3(1243).keccak256, h2 = function(e4) { return s2.isBN(e4); }, p2 = function(e4) { return e4 && e4.constructor && "BigNumber" === e4.constructor.name; }, b2 = function(e4) { try { return u2.apply(null, arguments); } catch (t4) { throw new Error(t4 + ' Given value: "' + e4 + '"'); } }, y2 = function(e4) { return !!/^(0x)?[0-9a-f]{40}$/i.test(e4) && (!(!/^(0x|0X)?[0-9a-f]{40}$/.test(e4) && !/^(0x|0X)?[0-9A-F]{40}$/.test(e4)) || v2(e4)); }, v2 = function(e4) { e4 = e4.replace(/^0x/i, ""); for (var t4 = S2(e4.toLowerCase()).replace(/^0x/i, ""), r4 = 0; r4 < 40; r4++) if (parseInt(t4[r4], 16) > 7 && e4[r4].toUpperCase() !== e4[r4] || parseInt(t4[r4], 16) <= 7 && e4[r4].toLowerCase() !== e4[r4]) return false; return true; }, m2 = function(e4) { var t4 = ""; e4 = (e4 = (e4 = (e4 = (e4 = c2.encode(e4)).replace(/^(?:\u0000)*/, "")).split("").reverse().join("")).replace(/^(?:\u0000)*/, "")).split("").reverse().join(""); for (var r4 = 0; r4 < e4.length; r4++) { var n3 = e4.charCodeAt(r4).toString(16); t4 += n3.length < 2 ? "0" + n3 : n3; } return "0x" + t4; }, g2 = function(e4) { var t4 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; if (!e4) return e4; if ("string" == typeof e4 && !_2(e4)) throw new Error('Given value "' + e4 + '" is not a valid hex string.'); var r4 = b2(e4); return t4 && (r4 > Number.MAX_SAFE_INTEGER || r4 < Number.MIN_SAFE_INTEGER) ? BigInt(r4) : r4.toNumber(); }, w2 = function(e4) { if (null == e4) return e4; if (!isFinite(e4) && !_2(e4)) throw new Error('Given input "' + e4 + '" is not a number.'); var t4 = b2(e4), r4 = t4.toString(16); return t4.lt(new s2(0)) ? "-0x" + r4.slice(1) : "0x" + r4; }, k2 = function(e4, t4) { if (y2(e4)) return t4 ? "address" : "0x" + e4.toLowerCase().replace(/^0x/i, ""); if ("boolean" == typeof e4) return t4 ? "bool" : e4 ? "0x01" : "0x00"; if (n2.isBuffer(e4)) return "0x" + e4.toString("hex"); if ("object" === (0, a2.default)(e4) && e4 && !p2(e4) && !h2(e4)) return t4 ? "string" : m2(JSON.stringify(e4)); if ("string" == typeof e4) { if (0 === e4.indexOf("-0x") || 0 === e4.indexOf("-0X")) return t4 ? "int256" : w2(e4); if (0 === e4.indexOf("0x") || 0 === e4.indexOf("0X")) return t4 ? "bytes" : e4; if (!isFinite(e4)) return t4 ? "string" : m2(e4); } return t4 ? e4 < 0 ? "int256" : "uint256" : w2(e4); }, _2 = function(e4) { return ("string" == typeof e4 || "number" == typeof e4) && /^(-)?0x[0-9a-f]*$/i.test(e4); }, A2 = function(e4) { return ("string" == typeof e4 || "number" == typeof e4) && /^(-0x|0x)?[0-9a-f]*$/i.test(e4); }, E2 = "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", S2 = function(e4) { h2(e4) && (e4 = e4.toString()), _2(e4) && /^0x/i.test(e4.toString()) ? e4 = f2.toBuffer(e4) : "string" == typeof e4 && (e4 = n2.from(e4, "utf-8")); var t4 = f2.bufferToHex(l2(e4)); return t4 === E2 ? null : t4; }; S2._Hash = l2; var x2 = function(e4) { if ("string" == typeof e4 && e4.includes("0x")) { var t4 = e4.toLocaleLowerCase().startsWith("-") ? ["-", e4.slice(3)] : ["", e4.slice(2)], r4 = (0, o2.default)(t4, 2), n3 = r4[0], i3 = r4[1]; return new s2(n3 + i3, 16); } return new s2(e4); }; Object.setPrototypeOf(x2, s2), Object.setPrototypeOf(x2.prototype, s2.prototype), e3.exports = { BN: x2, isBN: h2, isBigNumber: p2, toBN: b2, isAddress: y2, isBloom: function(e4) { return d2.isBloom(e4); }, isUserEthereumAddressInBloom: function(e4, t4) { return d2.isUserEthereumAddressInBloom(e4, t4); }, isContractAddressInBloom: function(e4, t4) { return d2.isContractAddressInBloom(e4, t4); }, isTopic: function(e4) { return d2.isTopic(e4); }, isTopicInBloom: function(e4, t4) { return d2.isTopicInBloom(e4, t4); }, isInBloom: function(e4, t4) { return d2.isInBloom(e4, t4); }, checkAddressChecksum: v2, utf8ToHex: m2, hexToUtf8: function(e4) { if (!_2(e4)) throw new Error('The parameter "' + e4 + '" must be a valid HEX string.'); for (var t4 = "", r4 = 0, n3 = (e4 = (e4 = (e4 = (e4 = (e4 = e4.replace(/^0x/i, "")).replace(/^(?:00)*/, "")).split("").reverse().join("")).replace(/^(?:00)*/, "")).split("").reverse().join("")).length, i3 = 0; i3 < n3; i3 += 2) r4 = parseInt(e4.slice(i3, i3 + 2), 16), t4 += String.fromCharCode(r4); return c2.decode(t4); }, hexToNumber: g2, hexToNumberString: function(e4) { if (!e4) return e4; if ("string" == typeof e4 && !_2(e4)) throw new Error('Given value "' + e4 + '" is not a valid hex string.'); return b2(e4).toString(10); }, numberToHex: w2, toHex: k2, hexToBytes: function(e4) { if (e4 = e4.toString(16), !_2(e4)) throw new Error('Given value "' + e4 + '" is not a valid hex string.'); e4 = e4.replace(/^0x/i, ""); for (var t4 = [], r4 = 0; r4 < e4.length; r4 += 2) t4.push(parseInt(e4.slice(r4, r4 + 2), 16)); return t4; }, bytesToHex: function(e4) { for (var t4 = [], r4 = 0; r4 < e4.length; r4++) t4.push((e4[r4] >>> 4).toString(16)), t4.push((15 & e4[r4]).toString(16)); return "0x" + t4.join(""); }, isHex: A2, isHexStrict: _2, stripHexPrefix: function(e4) { return 0 !== e4 && A2(e4) ? e4.replace(/^(-)?0x/i, "$1") : e4; }, leftPad: function(e4, t4, r4) { var n3 = /^0x/i.test(e4) || "number" == typeof e4, i3 = t4 - (e4 = e4.toString(16).replace(/^0x/i, "")).length + 1 >= 0 ? t4 - e4.length + 1 : 0; return (n3 ? "0x" : "") + new Array(i3).join(r4 || "0") + e4; }, rightPad: function(e4, t4, r4) { var n3 = /^0x/i.test(e4) || "number" == typeof e4, i3 = t4 - (e4 = e4.toString(16).replace(/^0x/i, "")).length + 1 >= 0 ? t4 - e4.length + 1 : 0; return (n3 ? "0x" : "") + e4 + new Array(i3).join(r4 || "0"); }, toTwosComplement: function(e4) { return "0x" + b2(e4).toTwos(256).toString(16, 64); }, sha3: S2, sha3Raw: function(e4) { return null === (e4 = S2(e4)) ? E2 : e4; }, toNumber: function(e4) { var t4 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; return "number" == typeof e4 ? e4 : g2(k2(e4), t4); } }; }, 17001: (e3, t3, r3) => { var n2 = r3(78920).i8, i2 = r3(80606), o2 = r3(66748), a2 = r3(473), s2 = r3(96306), u2 = r3(92565), c2 = r3(42463), f2 = r3(48161), d2 = function() { var e4 = this; i2.packageInit(this, arguments), this.version = n2, this.utils = f2, this.eth = new o2(this), this.shh = new u2(this), this.bzz = new c2(this); var t4 = this.setProvider; this.setProvider = function(r4, n3) { return t4.apply(e4, arguments), e4.eth.setRequestManager(e4._requestManager), e4.shh.setRequestManager(e4._requestManager), e4.bzz.setProvider(r4), true; }; }; d2.version = n2, d2.utils = f2, d2.modules = { Eth: o2, Net: a2, Personal: s2, Shh: u2, Bzz: c2 }, i2.addProviders(d2), e3.exports = d2; }, 89214: () => { }, 52361: () => { }, 94616: () => { }, 38768: (e3) => { e3.exports = function(e4, t3) { (null == t3 || t3 > e4.length) && (t3 = e4.length); for (var r3 = 0, n2 = new Array(t3); r3 < t3; r3++) n2[r3] = e4[r3]; return n2; }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 12338: (e3) => { e3.exports = function(e4) { if (Array.isArray(e4)) return e4; }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 77907: (e3, t3, r3) => { var n2 = r3(38768); e3.exports = function(e4) { if (Array.isArray(e4)) return n2(e4); }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 58975: (e3) => { e3.exports = function(e4) { if (void 0 === e4) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e4; }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 94571: (e3) => { function t3(e4, t4, r3, n2, i2, o2, a2) { try { var s2 = e4[o2](a2), u2 = s2.value; } catch (e5) { return void r3(e5); } s2.done ? t4(u2) : Promise.resolve(u2).then(n2, i2); } e3.exports = function(e4) { return function() { var r3 = this, n2 = arguments; return new Promise(function(i2, o2) { var a2 = e4.apply(r3, n2); function s2(e5) { t3(a2, i2, o2, s2, u2, "next", e5); } function u2(e5) { t3(a2, i2, o2, s2, u2, "throw", e5); } s2(void 0); }); }; }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 69721: (e3) => { e3.exports = function(e4, t3) { if (!(e4 instanceof t3)) throw new TypeError("Cannot call a class as a function"); }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 14727: (e3, t3, r3) => { var n2 = r3(38746), i2 = r3(36923); function o2(t4, r4, a2) { return i2() ? (e3.exports = o2 = Reflect.construct.bind(), e3.exports.__esModule = true, e3.exports.default = e3.exports) : (e3.exports = o2 = function(e4, t5, r5) { var i3 = [null]; i3.push.apply(i3, t5); var o3 = new (Function.bind.apply(e4, i3))(); return r5 && n2(o3, r5.prototype), o3; }, e3.exports.__esModule = true, e3.exports.default = e3.exports), o2.apply(null, arguments); } e3.exports = o2, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 58985: (e3, t3, r3) => { var n2 = r3(32310); function i2(e4, t4) { for (var r4 = 0; r4 < t4.length; r4++) { var i3 = t4[r4]; i3.enumerable = i3.enumerable || false, i3.configurable = true, "value" in i3 && (i3.writable = true), Object.defineProperty(e4, n2(i3.key), i3); } } e3.exports = function(e4, t4, r4) { return t4 && i2(e4.prototype, t4), r4 && i2(e4, r4), Object.defineProperty(e4, "prototype", { writable: false }), e4; }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 90775: (e3, t3, r3) => { var n2 = r3(32310); e3.exports = function(e4, t4, r4) { return (t4 = n2(t4)) in e4 ? Object.defineProperty(e4, t4, { value: r4, enumerable: true, configurable: true, writable: true }) : e4[t4] = r4, e4; }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 119: (e3, t3, r3) => { var n2 = r3(47460); function i2() { return "undefined" != typeof Reflect && Reflect.get ? (e3.exports = i2 = Reflect.get.bind(), e3.exports.__esModule = true, e3.exports.default = e3.exports) : (e3.exports = i2 = function(e4, t4, r4) { var i3 = n2(e4, t4); if (i3) { var o2 = Object.getOwnPropertyDescriptor(i3, t4); return o2.get ? o2.get.call(arguments.length < 3 ? e4 : r4) : o2.value; } }, e3.exports.__esModule = true, e3.exports.default = e3.exports), i2.apply(this, arguments); } e3.exports = i2, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 21949: (e3) => { function t3(r3) { return e3.exports = t3 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e4) { return e4.__proto__ || Object.getPrototypeOf(e4); }, e3.exports.__esModule = true, e3.exports.default = e3.exports, t3(r3); } e3.exports = t3, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 15163: (e3, t3, r3) => { var n2 = r3(38746); e3.exports = function(e4, t4) { if ("function" != typeof t4 && null !== t4) throw new TypeError("Super expression must either be null or a function"); e4.prototype = Object.create(t4 && t4.prototype, { constructor: { value: e4, writable: true, configurable: true } }), Object.defineProperty(e4, "prototype", { writable: false }), t4 && n2(e4, t4); }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 28847: (e3) => { e3.exports = function(e4) { return e4 && e4.__esModule ? e4 : { default: e4 }; }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 78958: (e3) => { e3.exports = function(e4) { return -1 !== Function.toString.call(e4).indexOf("[native code]"); }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 36923: (e3) => { e3.exports = function() { if ("undefined" == typeof Reflect || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if ("function" == typeof Proxy) return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch (e4) { return false; } }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 41642: (e3) => { e3.exports = function(e4) { if ("undefined" != typeof Symbol && null != e4[Symbol.iterator] || null != e4["@@iterator"]) return Array.from(e4); }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 91436: (e3) => { e3.exports = function(e4, t3) { var r3 = null == e4 ? null : "undefined" != typeof Symbol && e4[Symbol.iterator] || e4["@@iterator"]; if (null != r3) { var n2, i2, o2, a2, s2 = [], u2 = true, c2 = false; try { if (o2 = (r3 = r3.call(e4)).next, 0 === t3) { if (Object(r3) !== r3) return; u2 = false; } else for (; !(u2 = (n2 = o2.call(r3)).done) && (s2.push(n2.value), s2.length !== t3); u2 = true) ; } catch (e5) { c2 = true, i2 = e5; } finally { try { if (!u2 && null != r3.return && (a2 = r3.return(), Object(a2) !== a2)) return; } finally { if (c2) throw i2; } } return s2; } }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 82966: (e3) => { e3.exports = function() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 22344: (e3) => { e3.exports = function() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 34650: (e3, t3, r3) => { var n2 = r3(3355).default, i2 = r3(58975); e3.exports = function(e4, t4) { if (t4 && ("object" === n2(t4) || "function" == typeof t4)) return t4; if (void 0 !== t4) throw new TypeError("Derived constructors may only return object or undefined"); return i2(e4); }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 82028: (e3, t3, r3) => { var n2 = r3(3355).default; function i2() { e3.exports = i2 = function() { return t4; }, e3.exports.__esModule = true, e3.exports.default = e3.exports; var t4 = {}, r4 = Object.prototype, o2 = r4.hasOwnProperty, a2 = Object.defineProperty || function(e4, t5, r5) { e4[t5] = r5.value; }, s2 = "function" == typeof Symbol ? Symbol : {}, u2 = s2.iterator || "@@iterator", c2 = s2.asyncIterator || "@@asyncIterator", f2 = s2.toStringTag || "@@toStringTag"; function d2(e4, t5, r5) { return Object.defineProperty(e4, t5, { value: r5, enumerable: true, configurable: true, writable: true }), e4[t5]; } try { d2({}, ""); } catch (e4) { d2 = function(e5, t5, r5) { return e5[t5] = r5; }; } function l2(e4, t5, r5, n3) { var i3 = t5 && t5.prototype instanceof b2 ? t5 : b2, o3 = Object.create(i3.prototype), s3 = new O2(n3 || []); return a2(o3, "_invoke", { value: E2(e4, r5, s3) }), o3; } function h2(e4, t5, r5) { try { return { type: "normal", arg: e4.call(t5, r5) }; } catch (e5) { return { type: "throw", arg: e5 }; } } t4.wrap = l2; var p2 = {}; function b2() { } function y2() { } function v2() { } var m2 = {}; d2(m2, u2, function() { return this; }); var g2 = Object.getPrototypeOf, w2 = g2 && g2(g2(P2([]))); w2 && w2 !== r4 && o2.call(w2, u2) && (m2 = w2); var k2 = v2.prototype = b2.prototype = Object.create(m2); function _2(e4) { ["next", "throw", "return"].forEach(function(t5) { d2(e4, t5, function(e5) { return this._invoke(t5, e5); }); }); } function A2(e4, t5) { function r5(i4, a3, s3, u3) { var c3 = h2(e4[i4], e4, a3); if ("throw" !== c3.type) { var f3 = c3.arg, d3 = f3.value; return d3 && "object" == n2(d3) && o2.call(d3, "__await") ? t5.resolve(d3.__await).then(function(e5) { r5("next", e5, s3, u3); }, function(e5) { r5("throw", e5, s3, u3); }) : t5.resolve(d3).then(function(e5) { f3.value = e5, s3(f3); }, function(e5) { return r5("throw", e5, s3, u3); }); } u3(c3.arg); } var i3; a2(this, "_invoke", { value: function(e5, n3) { function o3() { return new t5(function(t6, i4) { r5(e5, n3, t6, i4); }); } return i3 = i3 ? i3.then(o3, o3) : o3(); } }); } function E2(e4, t5, r5) { var n3 = "suspendedStart"; return function(i3, o3) { if ("executing" === n3) throw new Error("Generator is already running"); if ("completed" === n3) { if ("throw" === i3) throw o3; return { value: void 0, done: true }; } for (r5.method = i3, r5.arg = o3; ; ) { var a3 = r5.delegate; if (a3) { var s3 = S2(a3, r5); if (s3) { if (s3 === p2) continue; return s3; } } if ("next" === r5.method) r5.sent = r5._sent = r5.arg; else if ("throw" === r5.method) { if ("suspendedStart" === n3) throw n3 = "completed", r5.arg; r5.dispatchException(r5.arg); } else "return" === r5.method && r5.abrupt("return", r5.arg); n3 = "executing"; var u3 = h2(e4, t5, r5); if ("normal" === u3.type) { if (n3 = r5.done ? "completed" : "suspendedYield", u3.arg === p2) continue; return { value: u3.arg, done: r5.done }; } "throw" === u3.type && (n3 = "completed", r5.method = "throw", r5.arg = u3.arg); } }; } function S2(e4, t5) { var r5 = t5.method, n3 = e4.iterator[r5]; if (void 0 === n3) return t5.delegate = null, "throw" === r5 && e4.iterator.return && (t5.method = "return", t5.arg = void 0, S2(e4, t5), "throw" === t5.method) || "return" !== r5 && (t5.method = "throw", t5.arg = new TypeError("The iterator does not provide a '" + r5 + "' method")), p2; var i3 = h2(n3, e4.iterator, t5.arg); if ("throw" === i3.type) return t5.method = "throw", t5.arg = i3.arg, t5.delegate = null, p2; var o3 = i3.arg; return o3 ? o3.done ? (t5[e4.resultName] = o3.value, t5.next = e4.nextLoc, "return" !== t5.method && (t5.method = "next", t5.arg = void 0), t5.delegate = null, p2) : o3 : (t5.method = "throw", t5.arg = new TypeError("iterator result is not an object"), t5.delegate = null, p2); } function x2(e4) { var t5 = { tryLoc: e4[0] }; 1 in e4 && (t5.catchLoc = e4[1]), 2 in e4 && (t5.finallyLoc = e4[2], t5.afterLoc = e4[3]), this.tryEntries.push(t5); } function B2(e4) { var t5 = e4.completion || {}; t5.type = "normal", delete t5.arg, e4.completion = t5; } function O2(e4) { this.tryEntries = [{ tryLoc: "root" }], e4.forEach(x2, this), this.reset(true); } function P2(e4) { if (e4) { var t5 = e4[u2]; if (t5) return t5.call(e4); if ("function" == typeof e4.next) return e4; if (!isNaN(e4.length)) { var r5 = -1, n3 = function t6() { for (; ++r5 < e4.length; ) if (o2.call(e4, r5)) return t6.value = e4[r5], t6.done = false, t6; return t6.value = void 0, t6.done = true, t6; }; return n3.next = n3; } } return { next: I2 }; } function I2() { return { value: void 0, done: true }; } return y2.prototype = v2, a2(k2, "constructor", { value: v2, configurable: true }), a2(v2, "constructor", { value: y2, configurable: true }), y2.displayName = d2(v2, f2, "GeneratorFunction"), t4.isGeneratorFunction = function(e4) { var t5 = "function" == typeof e4 && e4.constructor; return !!t5 && (t5 === y2 || "GeneratorFunction" === (t5.displayName || t5.name)); }, t4.mark = function(e4) { return Object.setPrototypeOf ? Object.setPrototypeOf(e4, v2) : (e4.__proto__ = v2, d2(e4, f2, "GeneratorFunction")), e4.prototype = Object.create(k2), e4; }, t4.awrap = function(e4) { return { __await: e4 }; }, _2(A2.prototype), d2(A2.prototype, c2, function() { return this; }), t4.AsyncIterator = A2, t4.async = function(e4, r5, n3, i3, o3) { void 0 === o3 && (o3 = Promise); var a3 = new A2(l2(e4, r5, n3, i3), o3); return t4.isGeneratorFunction(r5) ? a3 : a3.next().then(function(e5) { return e5.done ? e5.value : a3.next(); }); }, _2(k2), d2(k2, f2, "Generator"), d2(k2, u2, function() { return this; }), d2(k2, "toString", function() { return "[object Generator]"; }), t4.keys = function(e4) { var t5 = Object(e4), r5 = []; for (var n3 in t5) r5.push(n3); return r5.reverse(), function e5() { for (; r5.length; ) { var n4 = r5.pop(); if (n4 in t5) return e5.value = n4, e5.done = false, e5; } return e5.done = true, e5; }; }, t4.values = P2, O2.prototype = { constructor: O2, reset: function(e4) { if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(B2), !e4) for (var t5 in this) "t" === t5.charAt(0) && o2.call(this, t5) && !isNaN(+t5.slice(1)) && (this[t5] = void 0); }, stop: function() { this.done = true; var e4 = this.tryEntries[0].completion; if ("throw" === e4.type) throw e4.arg; return this.rval; }, dispatchException: function(e4) { if (this.done) throw e4; var t5 = this; function r5(r6, n4) { return a3.type = "throw", a3.arg = e4, t5.next = r6, n4 && (t5.method = "next", t5.arg = void 0), !!n4; } for (var n3 = this.tryEntries.length - 1; n3 >= 0; --n3) { var i3 = this.tryEntries[n3], a3 = i3.completion; if ("root" === i3.tryLoc) return r5("end"); if (i3.tryLoc <= this.prev) { var s3 = o2.call(i3, "catchLoc"), u3 = o2.call(i3, "finallyLoc"); if (s3 && u3) { if (this.prev < i3.catchLoc) return r5(i3.catchLoc, true); if (this.prev < i3.finallyLoc) return r5(i3.finallyLoc); } else if (s3) { if (this.prev < i3.catchLoc) return r5(i3.catchLoc, true); } else { if (!u3) throw new Error("try statement without catch or finally"); if (this.prev < i3.finallyLoc) return r5(i3.finallyLoc); } } } }, abrupt: function(e4, t5) { for (var r5 = this.tryEntries.length - 1; r5 >= 0; --r5) { var n3 = this.tryEntries[r5]; if (n3.tryLoc <= this.prev && o2.call(n3, "finallyLoc") && this.prev < n3.finallyLoc) { var i3 = n3; break; } } i3 && ("break" === e4 || "continue" === e4) && i3.tryLoc <= t5 && t5 <= i3.finallyLoc && (i3 = null); var a3 = i3 ? i3.completion : {}; return a3.type = e4, a3.arg = t5, i3 ? (this.method = "next", this.next = i3.finallyLoc, p2) : this.complete(a3); }, complete: function(e4, t5) { if ("throw" === e4.type) throw e4.arg; return "break" === e4.type || "continue" === e4.type ? this.next = e4.arg : "return" === e4.type ? (this.rval = this.arg = e4.arg, this.method = "return", this.next = "end") : "normal" === e4.type && t5 && (this.next = t5), p2; }, finish: function(e4) { for (var t5 = this.tryEntries.length - 1; t5 >= 0; --t5) { var r5 = this.tryEntries[t5]; if (r5.finallyLoc === e4) return this.complete(r5.completion, r5.afterLoc), B2(r5), p2; } }, catch: function(e4) { for (var t5 = this.tryEntries.length - 1; t5 >= 0; --t5) { var r5 = this.tryEntries[t5]; if (r5.tryLoc === e4) { var n3 = r5.completion; if ("throw" === n3.type) { var i3 = n3.arg; B2(r5); } return i3; } } throw new Error("illegal catch attempt"); }, delegateYield: function(e4, t5, r5) { return this.delegate = { iterator: P2(e4), resultName: t5, nextLoc: r5 }, "next" === this.method && (this.arg = void 0), p2; } }, t4; } e3.exports = i2, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 38746: (e3) => { function t3(r3, n2) { return e3.exports = t3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e4, t4) { return e4.__proto__ = t4, e4; }, e3.exports.__esModule = true, e3.exports.default = e3.exports, t3(r3, n2); } e3.exports = t3, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 74519: (e3, t3, r3) => { var n2 = r3(12338), i2 = r3(91436), o2 = r3(46906), a2 = r3(82966); e3.exports = function(e4, t4) { return n2(e4) || i2(e4, t4) || o2(e4, t4) || a2(); }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 47460: (e3, t3, r3) => { var n2 = r3(21949); e3.exports = function(e4, t4) { for (; !Object.prototype.hasOwnProperty.call(e4, t4) && null !== (e4 = n2(e4)); ) ; return e4; }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 93106: (e3, t3, r3) => { var n2 = r3(77907), i2 = r3(41642), o2 = r3(46906), a2 = r3(22344); e3.exports = function(e4) { return n2(e4) || i2(e4) || o2(e4) || a2(); }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 79662: (e3, t3, r3) => { var n2 = r3(3355).default; e3.exports = function(e4, t4) { if ("object" !== n2(e4) || null === e4) return e4; var r4 = e4[Symbol.toPrimitive]; if (void 0 !== r4) { var i2 = r4.call(e4, t4 || "default"); if ("object" !== n2(i2)) return i2; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === t4 ? String : Number)(e4); }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 32310: (e3, t3, r3) => { var n2 = r3(3355).default, i2 = r3(79662); e3.exports = function(e4) { var t4 = i2(e4, "string"); return "symbol" === n2(t4) ? t4 : String(t4); }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 3355: (e3) => { function t3(r3) { return e3.exports = t3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e4) { return typeof e4; } : function(e4) { return e4 && "function" == typeof Symbol && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4; }, e3.exports.__esModule = true, e3.exports.default = e3.exports, t3(r3); } e3.exports = t3, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 46906: (e3, t3, r3) => { var n2 = r3(38768); e3.exports = function(e4, t4) { if (e4) { if ("string" == typeof e4) return n2(e4, t4); var r4 = Object.prototype.toString.call(e4).slice(8, -1); return "Object" === r4 && e4.constructor && (r4 = e4.constructor.name), "Map" === r4 || "Set" === r4 ? Array.from(e4) : "Arguments" === r4 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r4) ? n2(e4, t4) : void 0; } }, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 22940: (e3, t3, r3) => { var n2 = r3(21949), i2 = r3(38746), o2 = r3(78958), a2 = r3(14727); function s2(t4) { var r4 = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0; return e3.exports = s2 = function(e4) { if (null === e4 || !o2(e4)) return e4; if ("function" != typeof e4) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r4) { if (r4.has(e4)) return r4.get(e4); r4.set(e4, t5); } function t5() { return a2(e4, arguments, n2(this).constructor); } return t5.prototype = Object.create(e4.prototype, { constructor: { value: t5, enumerable: false, writable: true, configurable: true } }), i2(t5, e4); }, e3.exports.__esModule = true, e3.exports.default = e3.exports, s2(t4); } e3.exports = s2, e3.exports.__esModule = true, e3.exports.default = e3.exports; }, 82247: (e3, t3, r3) => { var n2 = r3(28847)(r3(3355)), i2 = r3(82028)(); e3.exports = i2; try { regeneratorRuntime = i2; } catch (e4) { "object" === ("undefined" == typeof globalThis ? "undefined" : (0, n2.default)(globalThis)) ? globalThis.regeneratorRuntime = i2 : Function("r", "regeneratorRuntime = r")(i2); } }, 43604: (e3, t3, r3) => { var n2 = ["BigInt64Array", "BigUint64Array", "Float32Array", "Float64Array", "Int16Array", "Int32Array", "Int8Array", "Uint16Array", "Uint32Array", "Uint8Array", "Uint8ClampedArray"], i2 = "undefined" == typeof globalThis ? r3.g : globalThis; e3.exports = function() { for (var e4 = [], t4 = 0; t4 < n2.length; t4++) "function" == typeof i2[n2[t4]] && (e4[e4.length] = n2[t4]); return e4; }; }, 17687: (e3) => { e3.exports = JSON.parse('{"name":"goerli","chainId":5,"networkId":5,"defaultHardfork":"istanbul","consensus":{"type":"poa","algorithm":"clique","clique":{"period":15,"epoch":30000}},"comment":"Cross-client PoA test network","url":"https://github.com/goerli/testnet","genesis":{"hash":"0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a","timestamp":"0x5c51a607","gasLimit":10485760,"difficulty":1,"nonce":"0x0000000000000000","extraData":"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","stateRoot":"0x5d6cded585e73c4e322c30c2f782a336316f17dd85a4863b9d838d2d4b8b3008"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0xa3f5ab08"},{"name":"homestead","block":0,"forkHash":"0xa3f5ab08"},{"name":"tangerineWhistle","block":0,"forkHash":"0xa3f5ab08"},{"name":"spuriousDragon","block":0,"forkHash":"0xa3f5ab08"},{"name":"byzantium","block":0,"forkHash":"0xa3f5ab08"},{"name":"constantinople","block":0,"forkHash":"0xa3f5ab08"},{"name":"petersburg","block":0,"forkHash":"0xa3f5ab08"},{"name":"istanbul","block":1561651,"forkHash":"0xc25efa5c"},{"name":"berlin","block":4460644,"forkHash":"0x757a1c47"},{"name":"london","block":5062605,"forkHash":"0xb8c6299d"},{"name":"merge","block":null,"forkHash":null},{"name":"shanghai","block":null,"forkHash":null}],"bootstrapNodes":[{"ip":"51.141.78.53","port":30303,"id":"011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a","location":"","comment":"Upstream bootnode 1"},{"ip":"13.93.54.137","port":30303,"id":"176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b","location":"","comment":"Upstream bootnode 2"},{"ip":"94.237.54.114","port":30313,"id":"46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291","location":"","comment":"Upstream bootnode 3"},{"ip":"18.218.250.66","port":30313,"id":"b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949","location":"","comment":"Upstream bootnode 4"},{"ip":"3.11.147.67","port":30303,"id":"a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91","location":"","comment":"Ethereum Foundation bootnode"},{"ip":"51.15.116.226","port":30303,"id":"a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd","location":"","comment":"Goerli Initiative bootnode"},{"ip":"51.15.119.157","port":30303,"id":"807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33","location":"","comment":"Goerli Initiative bootnode"},{"ip":"51.15.119.157","port":40303,"id":"a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd","location":"","comment":"Goerli Initiative bootnode"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]}'); }, 37098: (e3) => { e3.exports = JSON.parse('{"name":"kovan","chainId":42,"networkId":42,"defaultHardfork":"istanbul","consensus":{"type":"poa","algorithm":"aura","aura":{}},"comment":"Parity PoA test network","url":"https://kovan-testnet.github.io/website/","genesis":{"hash":"0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9","timestamp":null,"gasLimit":6000000,"difficulty":131072,"nonce":"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","extraData":"0x","stateRoot":"0x2480155b48a1cea17d67dbfdfaafe821c1d19cdd478c5358e8ec56dec24502b2"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0x010ffe56"},{"name":"homestead","block":0,"forkHash":"0x010ffe56"},{"name":"tangerineWhistle","block":0,"forkHash":"0x010ffe56"},{"name":"spuriousDragon","block":0,"forkHash":"0x010ffe56"},{"name":"byzantium","block":5067000,"forkHash":"0x7f83c620"},{"name":"constantinople","block":9200000,"forkHash":"0xa94e3dc4"},{"name":"petersburg","block":10255201,"forkHash":"0x186874aa"},{"name":"istanbul","block":14111141,"forkHash":"0x7f6599a6"},{"name":"berlin","block":24770900,"forkHash":"0x1a0f10d9"},{"name":"london","block":26741100,"forkHash":"0x1ed20b71"},{"name":"merge","block":null,"forkHash":null},{"name":"shanghai","block":null,"forkHash":null}],"bootstrapNodes":[{"ip":"116.203.116.241","port":30303,"id":"16898006ba2cd4fa8bf9a3dfe32684c178fa861df144bfc21fe800dc4838a03e342056951fa9fd533dcb0be1219e306106442ff2cf1f7e9f8faa5f2fc1a3aa45","location":"","comment":"1"},{"ip":"3.217.96.11","port":30303,"id":"2909846f78c37510cc0e306f185323b83bb2209e5ff4fdd279d93c60e3f365e3c6e62ad1d2133ff11f9fd6d23ad9c3dad73bb974d53a22f7d1ac5b7dea79d0b0","location":"","comment":"2"},{"ip":"108.61.170.124","port":30303,"id":"740e1c8ea64e71762c71a463a04e2046070a0c9394fcab5891d41301dc473c0cff00ebab5a9bc87fbcb610ab98ac18225ff897bc8b7b38def5975d5ceb0a7d7c","location":"","comment":"3"},{"ip":"157.230.31.163","port":30303,"id":"2909846f78c37510cc0e306f185323b83bb2209e5ff4fdd279d93c60e3f365e3c6e62ad1d2133ff11f9fd6d23ad9c3dad73bb974d53a22f7d1ac5b7dea79d0b0","location":"","comment":"4"}]}'); }, 87295: (e3) => { e3.exports = JSON.parse('{"name":"mainnet","chainId":1,"networkId":1,"defaultHardfork":"istanbul","consensus":{"type":"pow","algorithm":"ethash","ethash":{}},"comment":"The Ethereum main chain","url":"https://ethstats.net/","genesis":{"hash":"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3","timestamp":null,"gasLimit":5000,"difficulty":17179869184,"nonce":"0x0000000000000042","extraData":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa","stateRoot":"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0xfc64ec04"},{"name":"homestead","block":1150000,"forkHash":"0x97c2c34c"},{"name":"dao","block":1920000,"forkHash":"0x91d1f948"},{"name":"tangerineWhistle","block":2463000,"forkHash":"0x7a64da13"},{"name":"spuriousDragon","block":2675000,"forkHash":"0x3edd5b10"},{"name":"byzantium","block":4370000,"forkHash":"0xa00bc324"},{"name":"constantinople","block":7280000,"forkHash":"0x668db0af"},{"name":"petersburg","block":7280000,"forkHash":"0x668db0af"},{"name":"istanbul","block":9069000,"forkHash":"0x879d6e30"},{"name":"muirGlacier","block":9200000,"forkHash":"0xe029e991"},{"name":"berlin","block":12244000,"forkHash":"0x0eb440f6"},{"name":"london","block":12965000,"forkHash":"0xb715077d"},{"name":"arrowGlacier","block":13773000,"forkHash":"0x20c327fc"},{"name":"grayGlacier","block":15050000,"forkHash":"0xf0afd0e3"},{"name":"mergeForkIdTransition","block":null,"forkHash":null},{"name":"merge","block":null,"forkHash":null},{"name":"shanghai","block":null,"forkHash":null}],"bootstrapNodes":[{"ip":"18.138.108.67","port":30303,"id":"d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666","location":"ap-southeast-1-001","comment":"bootnode-aws-ap-southeast-1-001"},{"ip":"3.209.45.79","port":30303,"id":"22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de","location":"us-east-1-001","comment":"bootnode-aws-us-east-1-001"},{"ip":"34.255.23.113","port":30303,"id":"ca6de62fce278f96aea6ec5a2daadb877e51651247cb96ee310a318def462913b653963c155a0ef6c7d50048bba6e6cea881130857413d9f50a621546b590758","location":"eu-west-1-001","comment":"bootnode-aws-eu-west-1-001"},{"ip":"35.158.244.151","port":30303,"id":"279944d8dcd428dffaa7436f25ca0ca43ae19e7bcf94a8fb7d1641651f92d121e972ac2e8f381414b80cc8e5555811c2ec6e1a99bb009b3f53c4c69923e11bd8","location":"eu-central-1-001","comment":"bootnode-aws-eu-central-1-001"},{"ip":"52.187.207.27","port":30303,"id":"8499da03c47d637b20eee24eec3c356c9a2e6148d6fe25ca195c7949ab8ec2c03e3556126b0d7ed644675e78c4318b08691b7b57de10e5f0d40d05b09238fa0a","location":"australiaeast-001","comment":"bootnode-azure-australiaeast-001"},{"ip":"191.234.162.198","port":30303,"id":"103858bdb88756c71f15e9b5e09b56dc1be52f0a5021d46301dbbfb7e130029cc9d0d6f73f693bc29b665770fff7da4d34f3c6379fe12721b5d7a0bcb5ca1fc1","location":"brazilsouth-001","comment":"bootnode-azure-brazilsouth-001"},{"ip":"52.231.165.108","port":30303,"id":"715171f50508aba88aecd1250af392a45a330af91d7b90701c436b618c86aaa1589c9184561907bebbb56439b8f8787bc01f49a7c77276c58c1b09822d75e8e8","location":"koreasouth-001","comment":"bootnode-azure-koreasouth-001"},{"ip":"104.42.217.25","port":30303,"id":"5d6d7cd20d6da4bb83a1d28cadb5d409b64edf314c0335df658c1a54e32c7c4a7ab7823d57c39b6a757556e68ff1df17c748b698544a55cb488b52479a92b60f","location":"westus-001","comment":"bootnode-azure-westus-001"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]}'); }, 40439: (e3) => { e3.exports = JSON.parse('{"name":"rinkeby","chainId":4,"networkId":4,"defaultHardfork":"istanbul","consensus":{"type":"poa","algorithm":"clique","clique":{"period":15,"epoch":30000}},"comment":"PoA test network","url":"https://www.rinkeby.io","genesis":{"hash":"0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177","timestamp":"0x58ee40ba","gasLimit":4700000,"difficulty":1,"nonce":"0x0000000000000000","extraData":"0x52657370656374206d7920617574686f7269746168207e452e436172746d616e42eb768f2244c8811c63729a21a3569731535f067ffc57839b00206d1ad20c69a1981b489f772031b279182d99e65703f0076e4812653aab85fca0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","stateRoot":"0x53580584816f617295ea26c0e17641e0120cab2f0a8ffb53a866fd53aa8e8c2d"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0x3b8e0691"},{"name":"homestead","block":1,"forkHash":"0x60949295"},{"name":"tangerineWhistle","block":2,"forkHash":"0x8bde40dd"},{"name":"spuriousDragon","block":3,"forkHash":"0xcb3a64bb"},{"name":"byzantium","block":1035301,"forkHash":"0x8d748b57"},{"name":"constantinople","block":3660663,"forkHash":"0xe49cab14"},{"name":"petersburg","block":4321234,"forkHash":"0xafec6b27"},{"name":"istanbul","block":5435345,"forkHash":"0xcbdb8838"},{"name":"berlin","block":8290928,"forkHash":"0x6910c8bd"},{"name":"london","block":8897988,"forkHash":"0x8e29f2f3"},{"name":"merge","block":null,"forkHash":null},{"name":"shanghai","block":null,"forkHash":null}],"bootstrapNodes":[{"ip":"52.169.42.101","port":30303,"id":"a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf","location":"","comment":"IE"},{"ip":"52.3.158.184","port":30303,"id":"343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8","location":"","comment":"INFURA"},{"ip":"159.89.28.211","port":30303,"id":"b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6","location":"","comment":"AKASHA"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.rinkeby.ethdisco.net"]}'); }, 31227: (e3) => { e3.exports = JSON.parse('{"name":"ropsten","chainId":3,"networkId":3,"defaultHardfork":"istanbul","consensus":{"type":"pow","algorithm":"ethash","ethash":{}},"comment":"PoW test network","url":"https://github.com/ethereum/ropsten","genesis":{"hash":"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d","timestamp":null,"gasLimit":16777216,"difficulty":1048576,"nonce":"0x0000000000000042","extraData":"0x3535353535353535353535353535353535353535353535353535353535353535","stateRoot":"0x217b0bbcfb72e2d57e28f33cb361b9983513177755dc3f33ce3e7022ed62b77b"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0x30c7ddbc"},{"name":"homestead","block":0,"forkHash":"0x30c7ddbc"},{"name":"tangerineWhistle","block":0,"forkHash":"0x30c7ddbc"},{"name":"spuriousDragon","block":10,"forkHash":"0x63760190"},{"name":"byzantium","block":1700000,"forkHash":"0x3ea159c7"},{"name":"constantinople","block":4230000,"forkHash":"0x97b544f3"},{"name":"petersburg","block":4939394,"forkHash":"0xd6e2149b"},{"name":"istanbul","block":6485846,"forkHash":"0x4bc66396"},{"name":"muirGlacier","block":7117117,"forkHash":"0x6727ef90"},{"name":"berlin","block":9812189,"forkHash":"0xa157d377"},{"name":"london","block":10499401,"forkHash":"0x7119b6b3"},{"name":"merge","block":null,"forkHash":null},{"name":"shanghai","block":null,"forkHash":null}],"bootstrapNodes":[{"ip":"52.176.7.10","port":30303,"id":"30b7ab30a01c124a6cceca36863ece12c4f5fa68e3ba9b0b51407ccc002eeed3b3102d20a88f1c1d3c3154e2449317b8ef95090e77b312d5cc39354f86d5d606","location":"","comment":"US-Azure geth"},{"ip":"52.176.100.77","port":30303,"id":"865a63255b3bb68023b6bffd5095118fcc13e79dcf014fe4e47e065c350c7cc72af2e53eff895f11ba1bbb6a2b33271c1116ee870f266618eadfc2e78aa7349c","location":"","comment":"US-Azure parity"},{"ip":"52.232.243.152","port":30303,"id":"6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f","location":"","comment":"Parity"},{"ip":"192.81.208.223","port":30303,"id":"94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09","location":"","comment":"@gpip"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.ropsten.ethdisco.net"]}'); }, 49422: (e3) => { e3.exports = JSON.parse('{"name":"sepolia","chainId":11155111,"networkId":11155111,"defaultHardfork":"istanbul","consensus":{"type":"pow","algorithm":"ethash","ethash":{}},"comment":"PoW test network to replace Ropsten","url":"https://github.com/ethereum/go-ethereum/pull/23730","genesis":{"hash":"0x25a5cc106eea7138acab33231d7160d69cb777ee0c2c553fcddf5138993e6dd9","timestamp":"0x6159af19","gasLimit":30000000,"difficulty":131072,"nonce":"0x0000000000000000","extraData":"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521","stateRoot":"0x5eb6e371a698b8d68f665192350ffcecbbbf322916f4b51bd79bb6887da3f494"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0xfe3366e7"},{"name":"homestead","block":0,"forkHash":"0xfe3366e7"},{"name":"tangerineWhistle","block":0,"forkHash":"0xfe3366e7"},{"name":"spuriousDragon","block":0,"forkHash":"0xfe3366e7"},{"name":"byzantium","block":0,"forkHash":"0xfe3366e7"},{"name":"constantinople","block":0,"forkHash":"0xfe3366e7"},{"name":"petersburg","block":0,"forkHash":"0xfe3366e7"},{"name":"istanbul","block":0,"forkHash":"0xfe3366e7"},{"name":"muirGlacier","block":0,"forkHash":"0xfe3366e7"},{"name":"berlin","block":0,"forkHash":"0xfe3366e7"},{"name":"london","block":0,"forkHash":"0xfe3366e7"},{"name":"merge","block":null,"forkHash":null},{"name":"shanghai","block":null,"forkHash":null}],"bootstrapNodes":[{"ip":"18.168.182.86","port":30303,"id":"9246d00bc8fd1742e5ad2428b80fc4dc45d786283e05ef6edbd9002cbc335d40998444732fbe921cb88e1d2c73d1b1de53bae6a2237996e9bfe14f871baf7066","location":"","comment":"geth"},{"ip":"52.14.151.177","port":30303,"id":"ec66ddcf1a974950bd4c782789a7e04f8aa7110a72569b6e65fcd51e937e74eed303b1ea734e4d19cfaec9fbff9b6ee65bf31dcb50ba79acce9dd63a6aca61c7","location":"","comment":"besu"}],"dnsNetworks":[]}'); }, 96561: (e3) => { e3.exports = JSON.parse('{"name":"EIP-1153","number":1153,"comment":"Transient Storage","url":"https://eips.ethereum.org/EIPS/eip-1153","status":"Review","minimumHardfork":"chainstart","requiredEIPs":[],"gasConfig":{},"gasPrices":{"tstore":{"v":100,"d":"Base fee of the TSTORE opcode"},"tload":{"v":100,"d":"Base fee of the TLOAD opcode"}},"vm":{},"pow":{}}'); }, 77523: (e3) => { e3.exports = JSON.parse('{"name":"EIP-1559","number":1559,"comment":"Fee market change for ETH 1.0 chain","url":"https://eips.ethereum.org/EIPS/eip-1559","status":"Final","minimumHardfork":"berlin","requiredEIPs":[2930],"gasConfig":{"baseFeeMaxChangeDenominator":{"v":8,"d":"Maximum base fee change denominator"},"elasticityMultiplier":{"v":2,"d":"Maximum block gas target elasticity"},"initialBaseFee":{"v":1000000000,"d":"Initial base fee on first EIP1559 block"}},"gasPrices":{},"vm":{},"pow":{}}'); }, 83339: (e3) => { e3.exports = JSON.parse('{"name":"EIP-2315","number":2315,"comment":"Simple subroutines for the EVM","url":"https://eips.ethereum.org/EIPS/eip-2315","status":"Draft","minimumHardfork":"istanbul","gasConfig":{},"gasPrices":{"beginsub":{"v":2,"d":"Base fee of the BEGINSUB opcode"},"returnsub":{"v":5,"d":"Base fee of the RETURNSUB opcode"},"jumpsub":{"v":10,"d":"Base fee of the JUMPSUB opcode"}},"vm":{},"pow":{}}'); }, 26769: (e3) => { e3.exports = JSON.parse('{"name":"EIP-2537","number":2537,"comment":"BLS12-381 precompiles","url":"https://eips.ethereum.org/EIPS/eip-2537","status":"Draft","minimumHardfork":"chainstart","gasConfig":{},"gasPrices":{"Bls12381G1AddGas":{"v":600,"d":"Gas cost of a single BLS12-381 G1 addition precompile-call"},"Bls12381G1MulGas":{"v":12000,"d":"Gas cost of a single BLS12-381 G1 multiplication precompile-call"},"Bls12381G2AddGas":{"v":4500,"d":"Gas cost of a single BLS12-381 G2 addition precompile-call"},"Bls12381G2MulGas":{"v":55000,"d":"Gas cost of a single BLS12-381 G2 multiplication precompile-call"},"Bls12381PairingBaseGas":{"v":115000,"d":"Base gas cost of BLS12-381 pairing check"},"Bls12381PairingPerPairGas":{"v":23000,"d":"Per-pair gas cost of BLS12-381 pairing check"},"Bls12381MapG1Gas":{"v":5500,"d":"Gas cost of BLS12-381 map field element to G1"},"Bls12381MapG2Gas":{"v":110000,"d":"Gas cost of BLS12-381 map field element to G2"},"Bls12381MultiExpGasDiscount":{"v":[[1,1200],[2,888],[3,764],[4,641],[5,594],[6,547],[7,500],[8,453],[9,438],[10,423],[11,408],[12,394],[13,379],[14,364],[15,349],[16,334],[17,330],[18,326],[19,322],[20,318],[21,314],[22,310],[23,306],[24,302],[25,298],[26,294],[27,289],[28,285],[29,281],[30,277],[31,273],[32,269],[33,268],[34,266],[35,265],[36,263],[37,262],[38,260],[39,259],[40,257],[41,256],[42,254],[43,253],[44,251],[45,250],[46,248],[47,247],[48,245],[49,244],[50,242],[51,241],[52,239],[53,238],[54,236],[55,235],[56,233],[57,232],[58,231],[59,229],[60,228],[61,226],[62,225],[63,223],[64,222],[65,221],[66,220],[67,219],[68,219],[69,218],[70,217],[71,216],[72,216],[73,215],[74,214],[75,213],[76,213],[77,212],[78,211],[79,211],[80,210],[81,209],[82,208],[83,208],[84,207],[85,206],[86,205],[87,205],[88,204],[89,203],[90,202],[91,202],[92,201],[93,200],[94,199],[95,199],[96,198],[97,197],[98,196],[99,196],[100,195],[101,194],[102,193],[103,193],[104,192],[105,191],[106,191],[107,190],[108,189],[109,188],[110,188],[111,187],[112,186],[113,185],[114,185],[115,184],[116,183],[117,182],[118,182],[119,181],[120,180],[121,179],[122,179],[123,178],[124,177],[125,176],[126,176],[127,175],[128,174]],"d":"Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair"}},"vm":{},"pow":{}}'); }, 17897: (e3) => { e3.exports = JSON.parse('{"name":"EIP-2565","number":2565,"comment":"ModExp gas cost","url":"https://eips.ethereum.org/EIPS/eip-2565","status":"Final","minimumHardfork":"byzantium","gasConfig":{},"gasPrices":{"modexpGquaddivisor":{"v":3,"d":"Gquaddivisor from modexp precompile for gas calculation"}},"vm":{},"pow":{}}'); }, 62170: (e3) => { e3.exports = JSON.parse('{"name":"EIP-2718","comment":"Typed Transaction Envelope","url":"https://eips.ethereum.org/EIPS/eip-2718","status":"Final","minimumHardfork":"chainstart","gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}'); }, 88436: (e3) => { e3.exports = JSON.parse(`{"name":"EIP-2929","comment":"Gas cost increases for state access opcodes","url":"https://eips.ethereum.org/EIPS/eip-2929","status":"Final","minimumHardfork":"chainstart","gasConfig":{},"gasPrices":{"coldsload":{"v":2100,"d":"Gas cost of the first read of storage from a given location (per transaction)"},"coldaccountaccess":{"v":2600,"d":"Gas cost of the first read of a given address (per transaction)"},"warmstorageread":{"v":100,"d":"Gas cost of reading storage locations which have already loaded 'cold'"},"sstoreCleanGasEIP2200":{"v":2900,"d":"Once per SSTORE operation from clean non-zero to something else"},"sstoreNoopGasEIP2200":{"v":100,"d":"Once per SSTORE operation if the value doesn't change"},"sstoreDirtyGasEIP2200":{"v":100,"d":"Once per SSTORE operation if a dirty value is changed"},"sstoreInitRefundEIP2200":{"v":19900,"d":"Once per SSTORE operation for resetting to the original zero value"},"sstoreCleanRefundEIP2200":{"v":4900,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"call":{"v":0,"d":"Base fee of the CALL opcode"},"callcode":{"v":0,"d":"Base fee of the CALLCODE opcode"},"delegatecall":{"v":0,"d":"Base fee of the DELEGATECALL opcode"},"staticcall":{"v":0,"d":"Base fee of the STATICCALL opcode"},"balance":{"v":0,"d":"Base fee of the BALANCE opcode"},"extcodesize":{"v":0,"d":"Base fee of the EXTCODESIZE opcode"},"extcodecopy":{"v":0,"d":"Base fee of the EXTCODECOPY opcode"},"extcodehash":{"v":0,"d":"Base fee of the EXTCODEHASH opcode"},"sload":{"v":0,"d":"Base fee of the SLOAD opcode"},"sstore":{"v":0,"d":"Base fee of the SSTORE opcode"}},"vm":{},"pow":{}}`); }, 96213: (e3) => { e3.exports = JSON.parse('{"name":"EIP-2930","comment":"Optional access lists","url":"https://eips.ethereum.org/EIPS/eip-2930","status":"Final","minimumHardfork":"istanbul","requiredEIPs":[2718,2929],"gasConfig":{},"gasPrices":{"accessListStorageKeyCost":{"v":1900,"d":"Gas cost per storage key in an Access List transaction"},"accessListAddressCost":{"v":2400,"d":"Gas cost per storage key in an Access List transaction"}},"vm":{},"pow":{}}'); }, 25491: (e3) => { e3.exports = JSON.parse('{"name":"EIP-3198","number":3198,"comment":"BASEFEE opcode","url":"https://eips.ethereum.org/EIPS/eip-3198","status":"Final","minimumHardfork":"london","gasConfig":{},"gasPrices":{"basefee":{"v":2,"d":"Gas cost of the BASEFEE opcode"}},"vm":{},"pow":{}}'); }, 20070: (e3) => { e3.exports = JSON.parse('{"name":"EIP-3529","comment":"Reduction in refunds","url":"https://eips.ethereum.org/EIPS/eip-3529","status":"Final","minimumHardfork":"berlin","requiredEIPs":[2929],"gasConfig":{"maxRefundQuotient":{"v":5,"d":"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},"gasPrices":{"selfdestructRefund":{"v":0,"d":"Refunded following a selfdestruct operation"},"sstoreClearRefundEIP2200":{"v":4800,"d":"Once per SSTORE operation for clearing an originally existing storage slot"}},"vm":{},"pow":{}}'); }, 52256: (e3) => { e3.exports = JSON.parse('{"name":"EIP-3540","number":3540,"comment":"EVM Object Format (EOF) v1","url":"https://eips.ethereum.org/EIPS/eip-3540","status":"Review","minimumHardfork":"london","requiredEIPs":[3541],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}'); }, 21871: (e3) => { e3.exports = JSON.parse('{"name":"EIP-3541","comment":"Reject new contracts starting with the 0xEF byte","url":"https://eips.ethereum.org/EIPS/eip-3541","status":"Final","minimumHardfork":"berlin","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}'); }, 47225: (e3) => { e3.exports = JSON.parse('{"name":"EIP-3554","comment":"Reduction in refunds","url":"Difficulty Bomb Delay to December 1st 2021","status":"Final","minimumHardfork":"muirGlacier","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":9500000,"d":"the amount of blocks to delay the difficulty bomb with"}}}'); }, 3968: (e3) => { e3.exports = JSON.parse('{"name":"EIP-3607","number":3607,"comment":"Reject transactions from senders with deployed code","url":"https://eips.ethereum.org/EIPS/eip-3607","status":"Final","minimumHardfork":"chainstart","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}'); }, 29496: (e3) => { e3.exports = JSON.parse('{"name":"EIP-3651","number":3198,"comment":"Warm COINBASE","url":"https://eips.ethereum.org/EIPS/eip-3651","status":"Review","minimumHardfork":"london","requiredEIPs":[2929],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}'); }, 74290: (e3) => { e3.exports = JSON.parse('{"name":"EIP-3670","number":3670,"comment":"EOF - Code Validation","url":"https://eips.ethereum.org/EIPS/eip-3670","status":"Review","minimumHardfork":"london","requiredEIPs":[3540],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}'); }, 98571: (e3) => { e3.exports = JSON.parse('{"name":"EIP-3675","number":3675,"comment":"Upgrade consensus to Proof-of-Stake","url":"https://eips.ethereum.org/EIPS/eip-3675","status":"Review","minimumHardfork":"london","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}'); }, 64551: (e3) => { e3.exports = JSON.parse('{"name":"EIP-3855","number":3855,"comment":"PUSH0 instruction","url":"https://eips.ethereum.org/EIPS/eip-3855","status":"Review","minimumHardfork":"chainstart","requiredEIPs":[],"gasConfig":{},"gasPrices":{"push0":{"v":2,"d":"Base fee of the PUSH0 opcode"}},"vm":{},"pow":{}}'); }, 94300: (e3) => { e3.exports = JSON.parse('{"name":"EIP-3860","number":3860,"comment":"Limit and meter initcode","url":"https://eips.ethereum.org/EIPS/eip-3860","status":"Review","minimumHardfork":"spuriousDragon","requiredEIPs":[],"gasConfig":{},"gasPrices":{"initCodeWordCost":{"v":2,"d":"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},"vm":{"maxInitCodeSize":{"v":49152,"d":"Maximum length of initialization code when creating a contract"}},"pow":{}}'); }, 74818: (e3) => { e3.exports = JSON.parse('{"name":"EIP-4345","number":4345,"comment":"Difficulty Bomb Delay to June 2022","url":"https://eips.ethereum.org/EIPS/eip-4345","status":"Final","minimumHardfork":"london","gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":10700000,"d":"the amount of blocks to delay the difficulty bomb with"}}}'); }, 68372: (e3) => { e3.exports = JSON.parse('{"name":"EIP-4399","number":4399,"comment":"Supplant DIFFICULTY opcode with PREVRANDAO","url":"https://eips.ethereum.org/EIPS/eip-4399","status":"Review","minimumHardfork":"london","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}'); }, 4759: (e3) => { e3.exports = JSON.parse('{"name":"EIP-5133","number":5133,"comment":"Delaying Difficulty Bomb to mid-September 2022","url":"https://eips.ethereum.org/EIPS/eip-5133","status":"Draft","minimumHardfork":"grayGlacier","gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":11400000,"d":"the amount of blocks to delay the difficulty bomb with"}}}'); }, 51971: (e3) => { e3.exports = JSON.parse('{"name":"arrowGlacier","comment":"HF to delay the difficulty bomb","url":"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md","status":"Final","eips":[4345],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}'); }, 20015: (e3) => { e3.exports = JSON.parse('{"name":"berlin","comment":"HF targeted for July 2020 following the Muir Glacier HF","url":"https://eips.ethereum.org/EIPS/eip-2070","status":"Final","eips":[2565,2929,2718,2930]}'); }, 26985: (e3) => { e3.exports = JSON.parse('{"name":"byzantium","comment":"Hardfork with new precompiles, instructions and other protocol changes","url":"https://eips.ethereum.org/EIPS/eip-609","status":"Final","gasConfig":{},"gasPrices":{"modexpGquaddivisor":{"v":20,"d":"Gquaddivisor from modexp precompile for gas calculation"},"ecAdd":{"v":500,"d":"Gas costs for curve addition precompile"},"ecMul":{"v":40000,"d":"Gas costs for curve multiplication precompile"},"ecPairing":{"v":100000,"d":"Base gas costs for curve pairing precompile"},"ecPairingWord":{"v":80000,"d":"Gas costs regarding curve pairing precompile input length"},"revert":{"v":0,"d":"Base fee of the REVERT opcode"},"staticcall":{"v":700,"d":"Base fee of the STATICCALL opcode"},"returndatasize":{"v":2,"d":"Base fee of the RETURNDATASIZE opcode"},"returndatacopy":{"v":3,"d":"Base fee of the RETURNDATACOPY opcode"}},"vm":{},"pow":{"minerReward":{"v":"3000000000000000000","d":"the amount a miner get rewarded for mining a block"},"difficultyBombDelay":{"v":3000000,"d":"the amount of blocks to delay the difficulty bomb with"}}}'); }, 60114: (e3) => { e3.exports = JSON.parse(`{"name":"chainstart","comment":"Start of the Ethereum main chain","url":"","status":"","gasConfig":{"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be"},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations"},"maxRefundQuotient":{"v":2,"d":"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},"gasPrices":{"base":{"v":2,"d":"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},"tierStep":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them"},"exp":{"v":10,"d":"Base fee of the EXP opcode"},"expByte":{"v":10,"d":"Times ceil(log256(exponent)) for the EXP instruction"},"sha3":{"v":30,"d":"Base fee of the SHA3 opcode"},"sha3Word":{"v":6,"d":"Once per word of the SHA3 operation's data"},"sload":{"v":50,"d":"Base fee of the SLOAD opcode"},"sstoreSet":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero"},"sstoreReset":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero"},"sstoreRefund":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero"},"jumpdest":{"v":1,"d":"Base fee of the JUMPDEST opcode"},"log":{"v":375,"d":"Base fee of the LOG opcode"},"logData":{"v":8,"d":"Per byte in a LOG* operation's data"},"logTopic":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},"create":{"v":32000,"d":"Base fee of the CREATE opcode"},"call":{"v":40,"d":"Base fee of the CALL opcode"},"callStipend":{"v":2300,"d":"Free gas given at beginning of call"},"callValueTransfer":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero"},"callNewAccount":{"v":25000,"d":"Paid for CALL when the destination address didn't exist prior"},"selfdestructRefund":{"v":24000,"d":"Refunded following a selfdestruct operation"},"memory":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation"},"createData":{"v":200,"d":""},"tx":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions"},"txCreation":{"v":32000,"d":"The cost of creating a contract via tx"},"txDataZero":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},"txDataNonZero":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},"copy":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},"ecRecover":{"v":3000,"d":""},"sha256":{"v":60,"d":""},"sha256Word":{"v":12,"d":""},"ripemd160":{"v":600,"d":""},"ripemd160Word":{"v":120,"d":""},"identity":{"v":15,"d":""},"identityWord":{"v":3,"d":""},"stop":{"v":0,"d":"Base fee of the STOP opcode"},"add":{"v":3,"d":"Base fee of the ADD opcode"},"mul":{"v":5,"d":"Base fee of the MUL opcode"},"sub":{"v":3,"d":"Base fee of the SUB opcode"},"div":{"v":5,"d":"Base fee of the DIV opcode"},"sdiv":{"v":5,"d":"Base fee of the SDIV opcode"},"mod":{"v":5,"d":"Base fee of the MOD opcode"},"smod":{"v":5,"d":"Base fee of the SMOD opcode"},"addmod":{"v":8,"d":"Base fee of the ADDMOD opcode"},"mulmod":{"v":8,"d":"Base fee of the MULMOD opcode"},"signextend":{"v":5,"d":"Base fee of the SIGNEXTEND opcode"},"lt":{"v":3,"d":"Base fee of the LT opcode"},"gt":{"v":3,"d":"Base fee of the GT opcode"},"slt":{"v":3,"d":"Base fee of the SLT opcode"},"sgt":{"v":3,"d":"Base fee of the SGT opcode"},"eq":{"v":3,"d":"Base fee of the EQ opcode"},"iszero":{"v":3,"d":"Base fee of the ISZERO opcode"},"and":{"v":3,"d":"Base fee of the AND opcode"},"or":{"v":3,"d":"Base fee of the OR opcode"},"xor":{"v":3,"d":"Base fee of the XOR opcode"},"not":{"v":3,"d":"Base fee of the NOT opcode"},"byte":{"v":3,"d":"Base fee of the BYTE opcode"},"address":{"v":2,"d":"Base fee of the ADDRESS opcode"},"balance":{"v":20,"d":"Base fee of the BALANCE opcode"},"origin":{"v":2,"d":"Base fee of the ORIGIN opcode"},"caller":{"v":2,"d":"Base fee of the CALLER opcode"},"callvalue":{"v":2,"d":"Base fee of the CALLVALUE opcode"},"calldataload":{"v":3,"d":"Base fee of the CALLDATALOAD opcode"},"calldatasize":{"v":2,"d":"Base fee of the CALLDATASIZE opcode"},"calldatacopy":{"v":3,"d":"Base fee of the CALLDATACOPY opcode"},"codesize":{"v":2,"d":"Base fee of the CODESIZE opcode"},"codecopy":{"v":3,"d":"Base fee of the CODECOPY opcode"},"gasprice":{"v":2,"d":"Base fee of the GASPRICE opcode"},"extcodesize":{"v":20,"d":"Base fee of the EXTCODESIZE opcode"},"extcodecopy":{"v":20,"d":"Base fee of the EXTCODECOPY opcode"},"blockhash":{"v":20,"d":"Base fee of the BLOCKHASH opcode"},"coinbase":{"v":2,"d":"Base fee of the COINBASE opcode"},"timestamp":{"v":2,"d":"Base fee of the TIMESTAMP opcode"},"number":{"v":2,"d":"Base fee of the NUMBER opcode"},"difficulty":{"v":2,"d":"Base fee of the DIFFICULTY opcode"},"gaslimit":{"v":2,"d":"Base fee of the GASLIMIT opcode"},"pop":{"v":2,"d":"Base fee of the POP opcode"},"mload":{"v":3,"d":"Base fee of the MLOAD opcode"},"mstore":{"v":3,"d":"Base fee of the MSTORE opcode"},"mstore8":{"v":3,"d":"Base fee of the MSTORE8 opcode"},"sstore":{"v":0,"d":"Base fee of the SSTORE opcode"},"jump":{"v":8,"d":"Base fee of the JUMP opcode"},"jumpi":{"v":10,"d":"Base fee of the JUMPI opcode"},"pc":{"v":2,"d":"Base fee of the PC opcode"},"msize":{"v":2,"d":"Base fee of the MSIZE opcode"},"gas":{"v":2,"d":"Base fee of the GAS opcode"},"push":{"v":3,"d":"Base fee of the PUSH opcode"},"dup":{"v":3,"d":"Base fee of the DUP opcode"},"swap":{"v":3,"d":"Base fee of the SWAP opcode"},"callcode":{"v":40,"d":"Base fee of the CALLCODE opcode"},"return":{"v":0,"d":"Base fee of the RETURN opcode"},"invalid":{"v":0,"d":"Base fee of the INVALID opcode"},"selfdestruct":{"v":0,"d":"Base fee of the SELFDESTRUCT opcode"}},"vm":{"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed"},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack"},"maxExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis"}},"pow":{"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be"},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations"},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"minerReward":{"v":"5000000000000000000","d":"the amount a miner get rewarded for mining a block"},"difficultyBombDelay":{"v":0,"d":"the amount of blocks to delay the difficulty bomb with"}}}`); }, 35993: (e3) => { e3.exports = JSON.parse(`{"name":"constantinople","comment":"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)","url":"https://eips.ethereum.org/EIPS/eip-1013","status":"Final","gasConfig":{},"gasPrices":{"netSstoreNoopGas":{"v":200,"d":"Once per SSTORE operation if the value doesn't change"},"netSstoreInitGas":{"v":20000,"d":"Once per SSTORE operation from clean zero"},"netSstoreCleanGas":{"v":5000,"d":"Once per SSTORE operation from clean non-zero"},"netSstoreDirtyGas":{"v":200,"d":"Once per SSTORE operation from dirty"},"netSstoreClearRefund":{"v":15000,"d":"Once per SSTORE operation for clearing an originally existing storage slot"},"netSstoreResetRefund":{"v":4800,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"netSstoreResetClearRefund":{"v":19800,"d":"Once per SSTORE operation for resetting to the original zero value"},"shl":{"v":3,"d":"Base fee of the SHL opcode"},"shr":{"v":3,"d":"Base fee of the SHR opcode"},"sar":{"v":3,"d":"Base fee of the SAR opcode"},"extcodehash":{"v":400,"d":"Base fee of the EXTCODEHASH opcode"},"create2":{"v":32000,"d":"Base fee of the CREATE2 opcode"}},"vm":{},"pow":{"minerReward":{"v":"2000000000000000000","d":"The amount a miner gets rewarded for mining a block"},"difficultyBombDelay":{"v":5000000,"d":"the amount of blocks to delay the difficulty bomb with"}}}`); }, 7197: (e3) => { e3.exports = JSON.parse('{"name":"dao","comment":"DAO rescue hardfork","url":"https://eips.ethereum.org/EIPS/eip-779","status":"Final","gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}'); }, 31088: (e3) => { e3.exports = JSON.parse('{"name":"grayGlacier","comment":"Delaying the difficulty bomb to Mid September 2022","url":"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md","status":"Draft","eips":[5133],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}'); }, 62800: (e3) => { e3.exports = JSON.parse('{"name":"homestead","comment":"Homestead hardfork with protocol and network changes","url":"https://eips.ethereum.org/EIPS/eip-606","status":"Final","gasConfig":{},"gasPrices":{"delegatecall":{"v":40,"d":"Base fee of the DELEGATECALL opcode"}},"vm":{},"pow":{}}'); }, 83166: (e3) => { e3.exports = JSON.parse(`{"name":"istanbul","comment":"HF targeted for December 2019 following the Constantinople/Petersburg HF","url":"https://eips.ethereum.org/EIPS/eip-1679","status":"Final","gasConfig":{},"gasPrices":{"blake2Round":{"v":1,"d":"Gas cost per round for the Blake2 F precompile"},"ecAdd":{"v":150,"d":"Gas costs for curve addition precompile"},"ecMul":{"v":6000,"d":"Gas costs for curve multiplication precompile"},"ecPairing":{"v":45000,"d":"Base gas costs for curve pairing precompile"},"ecPairingWord":{"v":34000,"d":"Gas costs regarding curve pairing precompile input length"},"txDataNonZero":{"v":16,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},"sstoreSentryGasEIP2200":{"v":2300,"d":"Minimum gas required to be present for an SSTORE call, not consumed"},"sstoreNoopGasEIP2200":{"v":800,"d":"Once per SSTORE operation if the value doesn't change"},"sstoreDirtyGasEIP2200":{"v":800,"d":"Once per SSTORE operation if a dirty value is changed"},"sstoreInitGasEIP2200":{"v":20000,"d":"Once per SSTORE operation from clean zero to non-zero"},"sstoreInitRefundEIP2200":{"v":19200,"d":"Once per SSTORE operation for resetting to the original zero value"},"sstoreCleanGasEIP2200":{"v":5000,"d":"Once per SSTORE operation from clean non-zero to something else"},"sstoreCleanRefundEIP2200":{"v":4200,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"sstoreClearRefundEIP2200":{"v":15000,"d":"Once per SSTORE operation for clearing an originally existing storage slot"},"balance":{"v":700,"d":"Base fee of the BALANCE opcode"},"extcodehash":{"v":700,"d":"Base fee of the EXTCODEHASH opcode"},"chainid":{"v":2,"d":"Base fee of the CHAINID opcode"},"selfbalance":{"v":5,"d":"Base fee of the SELFBALANCE opcode"},"sload":{"v":800,"d":"Base fee of the SLOAD opcode"}},"vm":{},"pow":{}}`); }, 61250: (e3) => { e3.exports = JSON.parse('{"name":"london","comment":"HF targeted for July 2021 following the Berlin fork","url":"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md","status":"Final","eips":[1559,3198,3529,3541]}'); }, 88648: (e3) => { e3.exports = JSON.parse('{"name":"merge","comment":"Hardfork to upgrade the consensus mechanism to Proof-of-Stake","url":"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md","status":"Draft","consensus":{"type":"pos","algorithm":"casper","casper":{}},"eips":[3675,4399]}'); }, 49347: (e3) => { e3.exports = JSON.parse('{"name":"mergeForkIdTransition","comment":"Pre-merge hardfork to fork off non-upgraded clients","url":"https://eips.ethereum.org/EIPS/eip-3675","status":"Draft","eips":[]}'); }, 42946: (e3) => { e3.exports = JSON.parse('{"name":"muirGlacier","comment":"HF to delay the difficulty bomb","url":"https://eips.ethereum.org/EIPS/eip-2384","status":"Final","gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":9000000,"d":"the amount of blocks to delay the difficulty bomb with"}}}'); }, 4064: (e3) => { e3.exports = JSON.parse('{"name":"petersburg","comment":"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople","url":"https://eips.ethereum.org/EIPS/eip-1716","status":"Final","gasConfig":{},"gasPrices":{"netSstoreNoopGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreInitGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreCleanGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreDirtyGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreClearRefund":{"v":null,"d":"Removed along EIP-1283"},"netSstoreResetRefund":{"v":null,"d":"Removed along EIP-1283"},"netSstoreResetClearRefund":{"v":null,"d":"Removed along EIP-1283"}},"vm":{},"pow":{}}'); }, 5553: (e3) => { e3.exports = JSON.parse('{"name":"shanghai","comment":"Next feature hardfork after the merge hardfork","url":"https://github.com/ethereum/pm/issues/356","status":"Pre-Draft","eips":[]}'); }, 90716: (e3) => { e3.exports = JSON.parse('{"name":"spuriousDragon","comment":"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit","url":"https://eips.ethereum.org/EIPS/eip-607","status":"Final","gasConfig":{},"gasPrices":{"expByte":{"v":50,"d":"Times ceil(log256(exponent)) for the EXP instruction"}},"vm":{"maxCodeSize":{"v":24576,"d":"Maximum length of contract code"}},"pow":{}}'); }, 22302: (e3) => { e3.exports = JSON.parse('{"name":"tangerineWhistle","comment":"Hardfork with gas cost changes for IO-heavy operations","url":"https://eips.ethereum.org/EIPS/eip-608","status":"Final","gasConfig":{},"gasPrices":{"sload":{"v":200,"d":"Once per SLOAD operation"},"call":{"v":700,"d":"Once per CALL operation & message call transaction"},"extcodesize":{"v":700,"d":"Base fee of the EXTCODESIZE opcode"},"extcodecopy":{"v":700,"d":"Base fee of the EXTCODECOPY opcode"},"balance":{"v":400,"d":"Base fee of the BALANCE opcode"},"delegatecall":{"v":700,"d":"Base fee of the DELEGATECALL opcode"},"callcode":{"v":700,"d":"Base fee of the CALLCODE opcode"},"selfdestruct":{"v":5000,"d":"Base fee of the SELFDESTRUCT opcode"}},"vm":{},"pow":{}}'); }, 44946: (e3) => { e3.exports = JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}'); }, 75207: (e3) => { e3.exports = JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}'); }, 1308: (e3) => { e3.exports = JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}'); }, 83630: (e3) => { e3.exports = JSON.parse('{"identity":0,"ip4":4,"tcp":6,"sha1":17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"blake3":30,"dccp":33,"murmur3-128":34,"murmur3-32":35,"ip6":41,"ip6zone":42,"path":47,"multicodec":48,"multihash":49,"multiaddr":50,"multibase":51,"dns":53,"dns4":54,"dns6":55,"dnsaddr":56,"protobuf":80,"cbor":81,"raw":85,"dbl-sha2-256":86,"rlp":96,"bencode":99,"dag-pb":112,"dag-cbor":113,"libp2p-key":114,"git-raw":120,"torrent-info":123,"torrent-file":124,"leofcoin-block":129,"leofcoin-tx":130,"leofcoin-pr":131,"sctp":132,"dag-jose":133,"dag-cose":134,"eth-block":144,"eth-block-list":145,"eth-tx-trie":146,"eth-tx":147,"eth-tx-receipt-trie":148,"eth-tx-receipt":149,"eth-state-trie":150,"eth-account-snapshot":151,"eth-storage-trie":152,"bitcoin-block":176,"bitcoin-tx":177,"bitcoin-witness-commitment":178,"zcash-block":192,"zcash-tx":193,"stellar-block":208,"stellar-tx":209,"md4":212,"md5":213,"bmt":214,"decred-block":224,"decred-tx":225,"ipld-ns":226,"ipfs-ns":227,"swarm-ns":228,"ipns-ns":229,"zeronet":230,"secp256k1-pub":231,"bls12_381-g1-pub":234,"bls12_381-g2-pub":235,"x25519-pub":236,"ed25519-pub":237,"dash-block":240,"dash-tx":241,"swarm-manifest":250,"swarm-feed":251,"udp":273,"p2p-webrtc-star":275,"p2p-webrtc-direct":276,"p2p-stardust":277,"p2p-circuit":290,"dag-json":297,"udt":301,"utp":302,"unix":400,"p2p":421,"ipfs":421,"https":443,"onion":444,"onion3":445,"garlic64":446,"garlic32":447,"tls":448,"quic":460,"ws":477,"wss":478,"p2p-websocket-star":479,"http":480,"json":512,"messagepack":513,"libp2p-peer-record":769,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,"x11":4352,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46000,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082,"zeroxcert-imprint-256":52753,"fil-commitment-unsealed":61697,"fil-commitment-sealed":61698,"holochain-adr-v0":8417572,"holochain-adr-v1":8483108,"holochain-key-v0":9728292,"holochain-key-v1":9793828,"holochain-sig-v0":10645796,"holochain-sig-v1":10711332}'); }, 29799: (e3) => { e3.exports = JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}'); }, 18597: (e3) => { e3.exports = { i8: "6.5.4" }; }, 24070: (e3) => { e3.exports = JSON.parse('{"identity":0,"ip4":4,"tcp":6,"sha1":17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"dccp":33,"murmur3-128":34,"murmur3-32":35,"ip6":41,"ip6zone":42,"path":47,"multicodec":48,"multihash":49,"multiaddr":50,"multibase":51,"dns":53,"dns4":54,"dns6":55,"dnsaddr":56,"protobuf":80,"cbor":81,"raw":85,"dbl-sha2-256":86,"rlp":96,"bencode":99,"dag-pb":112,"dag-cbor":113,"libp2p-key":114,"git-raw":120,"torrent-info":123,"torrent-file":124,"leofcoin-block":129,"leofcoin-tx":130,"leofcoin-pr":131,"sctp":132,"eth-block":144,"eth-block-list":145,"eth-tx-trie":146,"eth-tx":147,"eth-tx-receipt-trie":148,"eth-tx-receipt":149,"eth-state-trie":150,"eth-account-snapshot":151,"eth-storage-trie":152,"bitcoin-block":176,"bitcoin-tx":177,"zcash-block":192,"zcash-tx":193,"stellar-block":208,"stellar-tx":209,"md4":212,"md5":213,"bmt":214,"decred-block":224,"decred-tx":225,"ipld-ns":226,"ipfs-ns":227,"swarm-ns":228,"ipns-ns":229,"zeronet":230,"ed25519-pub":237,"dash-block":240,"dash-tx":241,"swarm-manifest":250,"swarm-feed":251,"udp":273,"p2p-webrtc-star":275,"p2p-webrtc-direct":276,"p2p-stardust":277,"p2p-circuit":290,"dag-json":297,"udt":301,"utp":302,"unix":400,"p2p":421,"ipfs":421,"https":443,"onion":444,"onion3":445,"garlic64":446,"garlic32":447,"tls":448,"quic":460,"ws":477,"wss":478,"p2p-websocket-star":479,"http":480,"json":512,"messagepack":513,"x11":4352,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46000,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"holochain-adr-v0":8417572,"holochain-adr-v1":8483108,"holochain-key-v0":9728292,"holochain-key-v1":9793828,"holochain-sig-v0":10645796,"holochain-sig-v1":10711332}'); }, 22562: (e3) => { e3.exports = JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}'); }, 19794: (e3) => { e3.exports = { version: "1.0.34" }; }, 78920: (e3) => { e3.exports = { i8: "1.10.4" }; } }, t2 = {}; function r2(n2) { var i2 = t2[n2]; if (void 0 !== i2) return i2.exports; var o2 = t2[n2] = { id: n2, loaded: false, exports: {} }; return e2[n2](o2, o2.exports, r2), o2.loaded = true, o2.exports; } return r2.amdO = {}, r2.g = function() { if ("object" == typeof globalThis) return globalThis; try { return this || new Function("return this")(); } catch (e3) { if ("object" == typeof window) return window; } }(), r2.nmd = (e3) => (e3.paths = [], e3.children || (e3.children = []), e3), r2(17001); })()); })(web3_min); var web3_minExports = web3_min.exports; const Web3 = /* @__PURE__ */ getDefaultExportFromCjs(web3_minExports); function defineChain(chain, config2 = {}) { const { fees = chain.fees, formatters = chain.formatters, serializers = chain.serializers } = config2; return { ...chain, fees, formatters, serializers }; } const version$2 = "1.21.3"; const getContractAddress = (address) => address; const getUrl = (url) => url; const getVersion = () => `viem@${version$2}`; class BaseError extends Error { constructor(shortMessage, args = {}) { var _a2; super(); Object.defineProperty(this, "details", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "docsPath", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "metaMessages", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "shortMessage", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ViemError" }); Object.defineProperty(this, "version", { enumerable: true, configurable: true, writable: true, value: getVersion() }); const details = args.cause instanceof BaseError ? args.cause.details : ((_a2 = args.cause) == null ? void 0 : _a2.message) ? args.cause.message : args.details; const docsPath2 = args.cause instanceof BaseError ? args.cause.docsPath || args.docsPath : args.docsPath; this.message = [ shortMessage || "An error occurred.", "", ...args.metaMessages ? [...args.metaMessages, ""] : [], ...docsPath2 ? [ `Docs: https://viem.sh${docsPath2}.html${args.docsSlug ? `#${args.docsSlug}` : ""}` ] : [], ...details ? [`Details: ${details}`] : [], `Version: ${this.version}` ].join("\n"); if (args.cause) this.cause = args.cause; this.details = details; this.docsPath = docsPath2; this.metaMessages = args.metaMessages; this.shortMessage = shortMessage; } walk(fn2) { return walk(this, fn2); } } function walk(err, fn2) { if (fn2 == null ? void 0 : fn2(err)) return err; if (err && typeof err === "object" && "cause" in err) return walk(err.cause, fn2); return fn2 ? null : err; } class IntegerOutOfRangeError extends BaseError { constructor({ max: max2, min: min2, signed: signed2, size: size2, value }) { super(`Number "${value}" is not in safe ${size2 ? `${size2 * 8}-bit ${signed2 ? "signed" : "unsigned"} ` : ""}integer range ${max2 ? `(${min2} to ${max2})` : `(above ${min2})`}`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "IntegerOutOfRangeError" }); } } class InvalidHexBooleanError extends BaseError { constructor(hex2) { super(`Hex value "${hex2}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "InvalidHexBooleanError" }); } } class SizeOverflowError extends BaseError { constructor({ givenSize, maxSize }) { super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "SizeOverflowError" }); } } function isHex(value, { strict = true } = {}) { if (!value) return false; if (typeof value !== "string") return false; return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x"); } function size$2(value) { if (isHex(value, { strict: false })) return Math.ceil((value.length - 2) / 2); return value.length; } function trim(hexOrBytes, { dir = "left" } = {}) { let data2 = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes; let sliceLength = 0; for (let i2 = 0; i2 < data2.length - 1; i2++) { if (data2[dir === "left" ? i2 : data2.length - i2 - 1].toString() === "0") sliceLength++; else break; } data2 = dir === "left" ? data2.slice(sliceLength) : data2.slice(0, data2.length - sliceLength); if (typeof hexOrBytes === "string") { if (data2.length === 1 && dir === "right") data2 = `${data2}0`; return `0x${data2.length % 2 === 1 ? `0${data2}` : data2}`; } return data2; } class SliceOffsetOutOfBoundsError extends BaseError { constructor({ offset, position, size: size2 }) { super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size2}).`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "SliceOffsetOutOfBoundsError" }); } } class SizeExceedsPaddingSizeError extends BaseError { constructor({ size: size2, targetSize, type: type2 }) { super(`${type2.charAt(0).toUpperCase()}${type2.slice(1).toLowerCase()} size (${size2}) exceeds padding size (${targetSize}).`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "SizeExceedsPaddingSizeError" }); } } function pad(hexOrBytes, { dir, size: size2 = 32 } = {}) { if (typeof hexOrBytes === "string") return padHex(hexOrBytes, { dir, size: size2 }); return padBytes(hexOrBytes, { dir, size: size2 }); } function padHex(hex_, { dir, size: size2 = 32 } = {}) { if (size2 === null) return hex_; const hex2 = hex_.replace("0x", ""); if (hex2.length > size2 * 2) throw new SizeExceedsPaddingSizeError({ size: Math.ceil(hex2.length / 2), targetSize: size2, type: "hex" }); return `0x${hex2[dir === "right" ? "padEnd" : "padStart"](size2 * 2, "0")}`; } function padBytes(bytes2, { dir, size: size2 = 32 } = {}) { if (size2 === null) return bytes2; if (bytes2.length > size2) throw new SizeExceedsPaddingSizeError({ size: bytes2.length, targetSize: size2, type: "bytes" }); const paddedBytes = new Uint8Array(size2); for (let i2 = 0; i2 < size2; i2++) { const padEnd = dir === "right"; paddedBytes[padEnd ? i2 : size2 - i2 - 1] = bytes2[padEnd ? i2 : bytes2.length - i2 - 1]; } return paddedBytes; } const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i2) => i2.toString(16).padStart(2, "0")); function toHex(value, opts = {}) { if (typeof value === "number" || typeof value === "bigint") return numberToHex$1(value, opts); if (typeof value === "string") { return stringToHex(value, opts); } if (typeof value === "boolean") return boolToHex(value, opts); return bytesToHex$1(value, opts); } function boolToHex(value, opts = {}) { const hex2 = `0x${Number(value)}`; if (typeof opts.size === "number") { assertSize(hex2, { size: opts.size }); return pad(hex2, { size: opts.size }); } return hex2; } function bytesToHex$1(value, opts = {}) { let string2 = ""; for (let i2 = 0; i2 < value.length; i2++) { string2 += hexes[value[i2]]; } const hex2 = `0x${string2}`; if (typeof opts.size === "number") { assertSize(hex2, { size: opts.size }); return pad(hex2, { dir: "right", size: opts.size }); } return hex2; } function numberToHex$1(value_, opts = {}) { const { signed: signed2, size: size2 } = opts; const value = BigInt(value_); let maxValue; if (size2) { if (signed2) maxValue = (1n << BigInt(size2) * 8n - 1n) - 1n; else maxValue = 2n ** (BigInt(size2) * 8n) - 1n; } else if (typeof value_ === "number") { maxValue = BigInt(Number.MAX_SAFE_INTEGER); } const minValue = typeof maxValue === "bigint" && signed2 ? -maxValue - 1n : 0; if (maxValue && value > maxValue || value < minValue) { const suffix = typeof value_ === "bigint" ? "n" : ""; throw new IntegerOutOfRangeError({ max: maxValue ? `${maxValue}${suffix}` : void 0, min: `${minValue}${suffix}`, signed: signed2, size: size2, value: `${value_}${suffix}` }); } const hex2 = `0x${(signed2 && value < 0 ? (1n << BigInt(size2 * 8)) + BigInt(value) : value).toString(16)}`; if (size2) return pad(hex2, { size: size2 }); return hex2; } const encoder$1 = /* @__PURE__ */ new TextEncoder(); function stringToHex(value_, opts = {}) { const value = encoder$1.encode(value_); return bytesToHex$1(value, opts); } const encoder = /* @__PURE__ */ new TextEncoder(); function toBytes$1(value, opts = {}) { if (typeof value === "number" || typeof value === "bigint") return numberToBytes$1(value, opts); if (typeof value === "boolean") return boolToBytes(value, opts); if (isHex(value)) return hexToBytes$1(value, opts); return stringToBytes$1(value, opts); } function boolToBytes(value, opts = {}) { const bytes2 = new Uint8Array(1); bytes2[0] = Number(value); if (typeof opts.size === "number") { assertSize(bytes2, { size: opts.size }); return pad(bytes2, { size: opts.size }); } return bytes2; } const charCodeMap = { zero: 48, nine: 57, A: 65, F: 70, a: 97, f: 102 }; function charCodeToBase16(char) { if (char >= charCodeMap.zero && char <= charCodeMap.nine) return char - charCodeMap.zero; if (char >= charCodeMap.A && char <= charCodeMap.F) return char - (charCodeMap.A - 10); if (char >= charCodeMap.a && char <= charCodeMap.f) return char - (charCodeMap.a - 10); return void 0; } function hexToBytes$1(hex_, opts = {}) { let hex2 = hex_; if (opts.size) { assertSize(hex2, { size: opts.size }); hex2 = pad(hex2, { dir: "right", size: opts.size }); } let hexString = hex2.slice(2); if (hexString.length % 2) hexString = `0${hexString}`; const length = hexString.length / 2; const bytes2 = new Uint8Array(length); for (let index2 = 0, j2 = 0; index2 < length; index2++) { const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j2++)); const nibbleRight = charCodeToBase16(hexString.charCodeAt(j2++)); if (nibbleLeft === void 0 || nibbleRight === void 0) { throw new BaseError(`Invalid byte sequence ("${hexString[j2 - 2]}${hexString[j2 - 1]}" in "${hexString}").`); } bytes2[index2] = nibbleLeft * 16 + nibbleRight; } return bytes2; } function numberToBytes$1(value, opts) { const hex2 = numberToHex$1(value, opts); return hexToBytes$1(hex2); } function stringToBytes$1(value, opts = {}) { const bytes2 = encoder.encode(value); if (typeof opts.size === "number") { assertSize(bytes2, { size: opts.size }); return pad(bytes2, { dir: "right", size: opts.size }); } return bytes2; } function assertSize(hexOrBytes, { size: size2 }) { if (size$2(hexOrBytes) > size2) throw new SizeOverflowError({ givenSize: size$2(hexOrBytes), maxSize: size2 }); } function hexToBigInt$1(hex2, opts = {}) { const { signed: signed2 } = opts; if (opts.size) assertSize(hex2, { size: opts.size }); const value = BigInt(hex2); if (!signed2) return value; const size2 = (hex2.length - 2) / 2; const max2 = (1n << BigInt(size2) * 8n - 1n) - 1n; if (value <= max2) return value; return value - BigInt(`0x${"f".padStart(size2 * 2, "f")}`) - 1n; } function hexToBool(hex_, opts = {}) { let hex2 = hex_; if (opts.size) { assertSize(hex2, { size: opts.size }); hex2 = trim(hex2); } if (trim(hex2) === "0x00") return false; if (trim(hex2) === "0x01") return true; throw new InvalidHexBooleanError(hex2); } function hexToNumber$1(hex2, opts = {}) { return Number(hexToBigInt$1(hex2, opts)); } function hexToString(hex2, opts = {}) { let bytes2 = hexToBytes$1(hex2); if (opts.size) { assertSize(bytes2, { size: opts.size }); bytes2 = trim(bytes2, { dir: "right" }); } return new TextDecoder().decode(bytes2); } const transactionType = { "0x0": "legacy", "0x1": "eip2930", "0x2": "eip1559" }; function formatTransaction(transaction) { const transaction_ = { ...transaction, blockHash: transaction.blockHash ? transaction.blockHash : null, blockNumber: transaction.blockNumber ? BigInt(transaction.blockNumber) : null, chainId: transaction.chainId ? hexToNumber$1(transaction.chainId) : void 0, gas: transaction.gas ? BigInt(transaction.gas) : void 0, gasPrice: transaction.gasPrice ? BigInt(transaction.gasPrice) : void 0, maxFeePerGas: transaction.maxFeePerGas ? BigInt(transaction.maxFeePerGas) : void 0, maxPriorityFeePerGas: transaction.maxPriorityFeePerGas ? BigInt(transaction.maxPriorityFeePerGas) : void 0, nonce: transaction.nonce ? hexToNumber$1(transaction.nonce) : void 0, to: transaction.to ? transaction.to : null, transactionIndex: transaction.transactionIndex ? Number(transaction.transactionIndex) : null, type: transaction.type ? transactionType[transaction.type] : void 0, typeHex: transaction.type ? transaction.type : void 0, value: transaction.value ? BigInt(transaction.value) : void 0, v: transaction.v ? BigInt(transaction.v) : void 0 }; transaction_.yParity = (() => { if (transaction.yParity) return Number(transaction.yParity); if (typeof transaction_.v === "bigint") { if (transaction_.v === 0n || transaction_.v === 27n) return 0; if (transaction_.v === 1n || transaction_.v === 28n) return 1; if (transaction_.v >= 35n) return transaction_.v % 2n === 0n ? 1 : 0; } return void 0; })(); if (transaction_.type === "legacy") { delete transaction_.accessList; delete transaction_.maxFeePerGas; delete transaction_.maxPriorityFeePerGas; delete transaction_.yParity; } if (transaction_.type === "eip2930") { delete transaction_.maxFeePerGas; delete transaction_.maxPriorityFeePerGas; } return transaction_; } function formatBlock(block) { var _a2; const transactions = (_a2 = block.transactions) == null ? void 0 : _a2.map((transaction) => { if (typeof transaction === "string") return transaction; return formatTransaction(transaction); }); return { ...block, baseFeePerGas: block.baseFeePerGas ? BigInt(block.baseFeePerGas) : null, difficulty: block.difficulty ? BigInt(block.difficulty) : void 0, gasLimit: block.gasLimit ? BigInt(block.gasLimit) : void 0, gasUsed: block.gasUsed ? BigInt(block.gasUsed) : void 0, hash: block.hash ? block.hash : null, logsBloom: block.logsBloom ? block.logsBloom : null, nonce: block.nonce ? block.nonce : null, number: block.number ? BigInt(block.number) : null, size: block.size ? BigInt(block.size) : void 0, timestamp: block.timestamp ? BigInt(block.timestamp) : void 0, transactions, totalDifficulty: block.totalDifficulty ? BigInt(block.totalDifficulty) : null }; } function formatLog(log2, { args, eventName } = {}) { return { ...log2, blockHash: log2.blockHash ? log2.blockHash : null, blockNumber: log2.blockNumber ? BigInt(log2.blockNumber) : null, logIndex: log2.logIndex ? Number(log2.logIndex) : null, transactionHash: log2.transactionHash ? log2.transactionHash : null, transactionIndex: log2.transactionIndex ? Number(log2.transactionIndex) : null, ...eventName ? { args, eventName } : {} }; } const statuses = { "0x0": "reverted", "0x1": "success" }; function formatTransactionReceipt(transactionReceipt) { return { ...transactionReceipt, blockNumber: transactionReceipt.blockNumber ? BigInt(transactionReceipt.blockNumber) : null, contractAddress: transactionReceipt.contractAddress ? transactionReceipt.contractAddress : null, cumulativeGasUsed: transactionReceipt.cumulativeGasUsed ? BigInt(transactionReceipt.cumulativeGasUsed) : null, effectiveGasPrice: transactionReceipt.effectiveGasPrice ? BigInt(transactionReceipt.effectiveGasPrice) : null, gasUsed: transactionReceipt.gasUsed ? BigInt(transactionReceipt.gasUsed) : null, logs: transactionReceipt.logs ? transactionReceipt.logs.map((log2) => formatLog(log2)) : null, to: transactionReceipt.to ? transactionReceipt.to : null, transactionIndex: transactionReceipt.transactionIndex ? hexToNumber$1(transactionReceipt.transactionIndex) : null, status: transactionReceipt.status ? statuses[transactionReceipt.status] : null, type: transactionReceipt.type ? transactionType[transactionReceipt.type] || transactionReceipt.type : null }; } const bsc = /* @__PURE__ */ defineChain({ id: 56, name: "BNB Smart Chain", network: "bsc", nativeCurrency: { decimals: 18, name: "BNB", symbol: "BNB" }, rpcUrls: { default: { http: ["https://rpc.ankr.com/bsc"] }, public: { http: ["https://rpc.ankr.com/bsc"] } }, blockExplorers: { etherscan: { name: "BscScan", url: "https://bscscan.com" }, default: { name: "BscScan", url: "https://bscscan.com" } }, contracts: { multicall3: { address: "0xca11bde05977b3631167028862be2a173976ca11", blockCreated: 15921452 } } }); const rpcTransactionType = { legacy: "0x0", eip2930: "0x1", eip1559: "0x2" }; function formatTransactionRequest(transactionRequest) { return { ...transactionRequest, gas: typeof transactionRequest.gas !== "undefined" ? numberToHex$1(transactionRequest.gas) : void 0, gasPrice: typeof transactionRequest.gasPrice !== "undefined" ? numberToHex$1(transactionRequest.gasPrice) : void 0, maxFeePerGas: typeof transactionRequest.maxFeePerGas !== "undefined" ? numberToHex$1(transactionRequest.maxFeePerGas) : void 0, maxPriorityFeePerGas: typeof transactionRequest.maxPriorityFeePerGas !== "undefined" ? numberToHex$1(transactionRequest.maxPriorityFeePerGas) : void 0, nonce: typeof transactionRequest.nonce !== "undefined" ? numberToHex$1(transactionRequest.nonce) : void 0, type: typeof transactionRequest.type !== "undefined" ? rpcTransactionType[transactionRequest.type] : void 0, value: typeof transactionRequest.value !== "undefined" ? numberToHex$1(transactionRequest.value) : void 0 }; } class InvalidAddressError extends BaseError { constructor({ address }) { super(`Address "${address}" is invalid.`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "InvalidAddressError" }); } } class ChainDoesNotSupportContract extends BaseError { constructor({ blockNumber, chain, contract }) { super(`Chain "${chain.name}" does not support contract "${contract.name}".`, { metaMessages: [ "This could be due to any of the following:", ...blockNumber && contract.blockCreated && contract.blockCreated > blockNumber ? [ `- The contract "${contract.name}" was not deployed until block ${contract.blockCreated} (current block ${blockNumber}).` ] : [ `- The chain does not have the contract "${contract.name}" configured.` ] ] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ChainDoesNotSupportContract" }); } } class ChainMismatchError extends BaseError { constructor({ chain, currentChainId }) { super(`The current chain of the wallet (id: ${currentChainId}) does not match the target chain for the transaction (id: ${chain.id} – ${chain.name}).`, { metaMessages: [ `Current Chain ID: ${currentChainId}`, `Expected Chain ID: ${chain.id} – ${chain.name}` ] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ChainMismatchError" }); } } class ChainNotFoundError extends BaseError { 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("\n")); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ChainNotFoundError" }); } } class ClientChainNotConfiguredError extends BaseError { constructor() { super("No chain was provided to the Client."); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ClientChainNotConfiguredError" }); } } const etherUnits = { gwei: 9, wei: 18 }; const gweiUnits = { ether: -9, wei: 9 }; const weiUnits = { ether: -18, gwei: -9 }; function formatUnits(value, decimals) { let display = value.toString(); const negative = display.startsWith("-"); if (negative) display = display.slice(1); display = display.padStart(decimals, "0"); let [integer2, fraction] = [ display.slice(0, display.length - decimals), display.slice(display.length - decimals) ]; fraction = fraction.replace(/(0+)$/, ""); return `${negative ? "-" : ""}${integer2 || "0"}${fraction ? `.${fraction}` : ""}`; } function formatGwei(wei, unit = "wei") { return formatUnits(wei, gweiUnits[unit]); } class ExecutionRevertedError extends BaseError { constructor({ cause, message } = {}) { var _a2; const reason = (_a2 = message == null ? void 0 : message.replace("execution reverted: ", "")) == null ? void 0 : _a2.replace("execution reverted", ""); super(`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`, { cause }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ExecutionRevertedError" }); } } Object.defineProperty(ExecutionRevertedError, "code", { enumerable: true, configurable: true, writable: true, value: 3 }); Object.defineProperty(ExecutionRevertedError, "nodeMessage", { enumerable: true, configurable: true, writable: true, value: /execution reverted/ }); class FeeCapTooHighError extends BaseError { constructor({ cause, maxFeePerGas } = {}) { super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, { cause }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "FeeCapTooHigh" }); } } Object.defineProperty(FeeCapTooHighError, "nodeMessage", { enumerable: true, configurable: true, writable: true, value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/ }); class FeeCapTooLowError extends BaseError { constructor({ cause, maxFeePerGas } = {}) { super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ""} gwei) cannot be lower than the block base fee.`, { cause }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "FeeCapTooLow" }); } } Object.defineProperty(FeeCapTooLowError, "nodeMessage", { enumerable: true, configurable: true, writable: true, value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/ }); class NonceTooHighError extends BaseError { constructor({ cause, nonce } = {}) { super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is higher than the next one expected.`, { cause }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "NonceTooHighError" }); } } Object.defineProperty(NonceTooHighError, "nodeMessage", { enumerable: true, configurable: true, writable: true, value: /nonce too high/ }); class NonceTooLowError extends BaseError { constructor({ cause, nonce } = {}) { super([ `Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is lower than the current nonce of the account.`, "Try increasing the nonce or find the latest nonce with `getTransactionCount`." ].join("\n"), { cause }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "NonceTooLowError" }); } } Object.defineProperty(NonceTooLowError, "nodeMessage", { enumerable: true, configurable: true, writable: true, value: /nonce too low|transaction already imported|already known/ }); class NonceMaxValueError extends BaseError { constructor({ cause, nonce } = {}) { super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}exceeds the maximum allowed nonce.`, { cause }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "NonceMaxValueError" }); } } Object.defineProperty(NonceMaxValueError, "nodeMessage", { enumerable: true, configurable: true, writable: true, value: /nonce has max value/ }); class InsufficientFundsError extends BaseError { constructor({ cause } = {}) { super([ "The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account." ].join("\n"), { cause, 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." ] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "InsufficientFundsError" }); } } Object.defineProperty(InsufficientFundsError, "nodeMessage", { enumerable: true, configurable: true, writable: true, value: /insufficient funds/ }); class IntrinsicGasTooHighError extends BaseError { constructor({ cause, gas } = {}) { super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction exceeds the limit allowed for the block.`, { cause }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "IntrinsicGasTooHighError" }); } } Object.defineProperty(IntrinsicGasTooHighError, "nodeMessage", { enumerable: true, configurable: true, writable: true, value: /intrinsic gas too high|gas limit reached/ }); class IntrinsicGasTooLowError extends BaseError { constructor({ cause, gas } = {}) { super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction is too low.`, { cause }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "IntrinsicGasTooLowError" }); } } Object.defineProperty(IntrinsicGasTooLowError, "nodeMessage", { enumerable: true, configurable: true, writable: true, value: /intrinsic gas too low/ }); class TransactionTypeNotSupportedError extends BaseError { constructor({ cause }) { super("The transaction type is not supported for this chain.", { cause }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "TransactionTypeNotSupportedError" }); } } Object.defineProperty(TransactionTypeNotSupportedError, "nodeMessage", { enumerable: true, configurable: true, writable: true, value: /transaction type not valid/ }); class TipAboveFeeCapError extends BaseError { constructor({ cause, maxPriorityFeePerGas, maxFeePerGas } = {}) { super([ `The provided tip (\`maxPriorityFeePerGas\`${maxPriorityFeePerGas ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}).` ].join("\n"), { cause }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "TipAboveFeeCapError" }); } } Object.defineProperty(TipAboveFeeCapError, "nodeMessage", { enumerable: true, configurable: true, writable: true, value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/ }); class UnknownNodeError extends BaseError { constructor({ cause }) { super(`An error occurred while executing: ${cause == null ? void 0 : cause.shortMessage}`, { cause }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "UnknownNodeError" }); } } const addressRegex = /^0x[a-fA-F0-9]{40}$/; function isAddress(address) { return addressRegex.test(address); } function concat$1(values) { if (typeof values[0] === "string") return concatHex(values); return concatBytes$1(values); } function concatBytes$1(values) { let length = 0; for (const arr2 of values) { length += arr2.length; } const result = new Uint8Array(length); let offset = 0; for (const arr2 of values) { result.set(arr2, offset); offset += arr2.length; } return result; } function concatHex(values) { return `0x${values.reduce((acc, x2) => acc + x2.replace("0x", ""), "")}`; } function execTyped(regex2, string2) { const match = regex2.exec(string2); return match == null ? void 0 : match.groups; } const tupleRegex = /^tuple(?(\[(\d*)\])*)$/; function formatAbiParameter(abiParameter) { let type2 = abiParameter.type; if (tupleRegex.test(abiParameter.type) && "components" in abiParameter) { type2 = "("; const length = abiParameter.components.length; for (let i2 = 0; i2 < length; i2++) { const component = abiParameter.components[i2]; type2 += formatAbiParameter(component); if (i2 < length - 1) type2 += ", "; } const result = execTyped(tupleRegex, abiParameter.type); type2 += `)${(result == null ? void 0 : result.array) ?? ""}`; return formatAbiParameter({ ...abiParameter, type: type2 }); } if ("indexed" in abiParameter && abiParameter.indexed) type2 = `${type2} indexed`; if (abiParameter.name) return `${type2} ${abiParameter.name}`; return type2; } function formatAbiParameters(abiParameters) { let params = ""; const length = abiParameters.length; for (let i2 = 0; i2 < length; i2++) { const abiParameter = abiParameters[i2]; params += formatAbiParameter(abiParameter); if (i2 !== length - 1) params += ", "; } return params; } function formatAbiItem$1(abiItem) { if (abiItem.type === "function") return `function ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability && abiItem.stateMutability !== "nonpayable" ? ` ${abiItem.stateMutability}` : ""}${abiItem.outputs.length ? ` returns (${formatAbiParameters(abiItem.outputs)})` : ""}`; else if (abiItem.type === "event") return `event ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`; else if (abiItem.type === "error") return `error ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`; else if (abiItem.type === "constructor") return `constructor(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability === "payable" ? " payable" : ""}`; else if (abiItem.type === "fallback") return "fallback()"; return "receive() external payable"; } function getAction(client, action, name2) { return (params) => { var _a2; return ((_a2 = client[action.name || name2]) == null ? void 0 : _a2.call(client, params)) ?? action(client, params); }; } function formatAbiItem(abiItem, { includeName = false } = {}) { if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error") throw new InvalidDefinitionTypeError(abiItem.type); return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`; } function formatAbiParams(params, { includeName = false } = {}) { if (!params) return ""; return params.map((param) => formatAbiParam(param, { includeName })).join(includeName ? ", " : ","); } function formatAbiParam(param, { includeName }) { if (param.type.startsWith("tuple")) { return `(${formatAbiParams(param.components, { includeName })})${param.type.slice("tuple".length)}`; } return param.type + (includeName && param.name ? ` ${param.name}` : ""); } class AbiConstructorNotFoundError extends BaseError { constructor({ docsPath: docsPath2 }) { 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("\n"), { docsPath: docsPath2 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiConstructorNotFoundError" }); } } class AbiConstructorParamsNotFoundError extends BaseError { constructor({ docsPath: docsPath2 }) { 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("\n"), { docsPath: docsPath2 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiConstructorParamsNotFoundError" }); } } class AbiDecodingDataSizeTooSmallError extends BaseError { constructor({ data: data2, params, size: size2 }) { super([`Data size of ${size2} bytes is too small for given parameters.`].join("\n"), { metaMessages: [ `Params: (${formatAbiParams(params, { includeName: true })})`, `Data: ${data2} (${size2} bytes)` ] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiDecodingDataSizeTooSmallError" }); Object.defineProperty(this, "data", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "params", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "size", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.data = data2; this.params = params; this.size = size2; } } class AbiDecodingZeroDataError extends BaseError { constructor() { super('Cannot decode zero data ("0x") with ABI parameters.'); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiDecodingZeroDataError" }); } } class AbiEncodingArrayLengthMismatchError extends BaseError { constructor({ expectedLength, givenLength, type: type2 }) { super([ `ABI encoding array length mismatch for type ${type2}.`, `Expected length: ${expectedLength}`, `Given length: ${givenLength}` ].join("\n")); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiEncodingArrayLengthMismatchError" }); } } class AbiEncodingBytesSizeMismatchError extends BaseError { constructor({ expectedSize, value }) { super(`Size of bytes "${value}" (bytes${size$2(value)}) does not match expected size (bytes${expectedSize}).`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiEncodingBytesSizeMismatchError" }); } } class AbiEncodingLengthMismatchError extends BaseError { constructor({ expectedLength, givenLength }) { super([ "ABI encoding params/values length mismatch.", `Expected length (params): ${expectedLength}`, `Given length (values): ${givenLength}` ].join("\n")); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiEncodingLengthMismatchError" }); } } class AbiErrorSignatureNotFoundError extends BaseError { constructor(signature, { docsPath: docsPath2 }) { super([ `Encoded error signature "${signature}" 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=${signature}.` ].join("\n"), { docsPath: docsPath2 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiErrorSignatureNotFoundError" }); Object.defineProperty(this, "signature", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.signature = signature; } } class AbiEventSignatureEmptyTopicsError extends BaseError { constructor({ docsPath: docsPath2 }) { super("Cannot extract event signature from empty topics.", { docsPath: docsPath2 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiEventSignatureEmptyTopicsError" }); } } class AbiEventSignatureNotFoundError extends BaseError { constructor(signature, { docsPath: docsPath2 }) { super([ `Encoded event signature "${signature}" not found on ABI.`, "Make sure you are using the correct ABI and that the event exists on it.", `You can look up the signature here: https://openchain.xyz/signatures?query=${signature}.` ].join("\n"), { docsPath: docsPath2 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiEventSignatureNotFoundError" }); } } class AbiEventNotFoundError extends BaseError { constructor(eventName, { docsPath: docsPath2 } = {}) { super([ `Event ${eventName ? `"${eventName}" ` : ""}not found on ABI.`, "Make sure you are using the correct ABI and that the event exists on it." ].join("\n"), { docsPath: docsPath2 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiEventNotFoundError" }); } } class AbiFunctionNotFoundError extends BaseError { constructor(functionName, { docsPath: docsPath2 } = {}) { super([ `Function ${functionName ? `"${functionName}" ` : ""}not found on ABI.`, "Make sure you are using the correct ABI and that the function exists on it." ].join("\n"), { docsPath: docsPath2 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiFunctionNotFoundError" }); } } class AbiFunctionOutputsNotFoundError extends BaseError { constructor(functionName, { docsPath: docsPath2 }) { super([ `Function "${functionName}" 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("\n"), { docsPath: docsPath2 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiFunctionOutputsNotFoundError" }); } } class AbiItemAmbiguityError extends BaseError { constructor(x2, y2) { super("Found ambiguous types in overloaded ABI items.", { metaMessages: [ `\`${x2.type}\` in \`${formatAbiItem(x2.abiItem)}\`, and`, `\`${y2.type}\` in \`${formatAbiItem(y2.abiItem)}\``, "", "These types encode differently and cannot be distinguished at runtime.", "Remove one of the ambiguous items in the ABI." ] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AbiItemAmbiguityError" }); } } class BytesSizeMismatchError extends BaseError { constructor({ expectedSize, givenSize }) { super(`Expected bytes${expectedSize}, got bytes${givenSize}.`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "BytesSizeMismatchError" }); } } class DecodeLogDataMismatch extends BaseError { constructor({ abiItem, data: data2, params, size: size2 }) { super([ `Data size of ${size2} bytes is too small for non-indexed event parameters.` ].join("\n"), { metaMessages: [ `Params: (${formatAbiParams(params, { includeName: true })})`, `Data: ${data2} (${size2} bytes)` ] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "DecodeLogDataMismatch" }); Object.defineProperty(this, "abiItem", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "data", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "params", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "size", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.abiItem = abiItem; this.data = data2; this.params = params; this.size = size2; } } class DecodeLogTopicsMismatch extends BaseError { constructor({ abiItem, param }) { super([ `Expected a topic for indexed event parameter${param.name ? ` "${param.name}"` : ""} on event "${formatAbiItem(abiItem, { includeName: true })}".` ].join("\n")); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "DecodeLogTopicsMismatch" }); Object.defineProperty(this, "abiItem", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.abiItem = abiItem; } } class InvalidAbiEncodingTypeError extends BaseError { constructor(type2, { docsPath: docsPath2 }) { super([ `Type "${type2}" is not a valid encoding type.`, "Please provide a valid ABI type." ].join("\n"), { docsPath: docsPath2 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "InvalidAbiEncodingType" }); } } class InvalidAbiDecodingTypeError extends BaseError { constructor(type2, { docsPath: docsPath2 }) { super([ `Type "${type2}" is not a valid decoding type.`, "Please provide a valid ABI type." ].join("\n"), { docsPath: docsPath2 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "InvalidAbiDecodingType" }); } } class InvalidArrayError extends BaseError { constructor(value) { super([`Value "${value}" is not a valid array.`].join("\n")); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "InvalidArrayError" }); } } class InvalidDefinitionTypeError extends BaseError { constructor(type2) { super([ `"${type2}" is not a valid definition type.`, 'Valid types: "function", "event", "error"' ].join("\n")); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "InvalidDefinitionTypeError" }); } } class FilterTypeNotSupportedError extends BaseError { constructor(type2) { super(`Filter type "${type2}" is not supported.`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "FilterTypeNotSupportedError" }); } } function normalizeSignature(signature) { let active = true; let current = ""; let level = 0; let result = ""; let valid2 = false; for (let i2 = 0; i2 < signature.length; i2++) { const char = signature[i2]; if (["(", ")", ","].includes(char)) active = true; if (char === "(") level++; if (char === ")") level--; if (!active) continue; if (level === 0) { if (char === " " && ["event", "function", ""].includes(result)) result = ""; else { result += char; if (char === ")") { valid2 = true; break; } } continue; } if (char === " ") { if (signature[i2 - 1] !== "," && current !== "," && current !== ",(") { current = ""; active = false; } continue; } result += char; current += char; } if (!valid2) throw new BaseError("Unable to normalize signature."); return result; } const getFunctionSignature = (fn_) => { const fn2 = (() => { if (typeof fn_ === "string") return fn_; return formatAbiItem$1(fn_); })(); return normalizeSignature(fn2); }; const getEventSignature = (fn2) => { return getFunctionSignature(fn2); }; function number$2(n2) { if (!Number.isSafeInteger(n2) || n2 < 0) throw new Error(`Wrong positive integer: ${n2}`); } function bytes$1(b2, ...lengths) { if (!(b2 instanceof Uint8Array)) throw new Error("Expected Uint8Array"); if (lengths.length > 0 && !lengths.includes(b2.length)) throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b2.length}`); } function exists(instance2, checkFinished = true) { if (instance2.destroyed) throw new Error("Hash instance has been destroyed"); if (checkFinished && instance2.finished) throw new Error("Hash#digest() has already been called"); } function output(out, instance2) { bytes$1(out); const min2 = instance2.outputLen; if (out.length < min2) { throw new Error(`digestInto() expects output buffer of length at least ${min2}`); } } const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); const _32n = /* @__PURE__ */ BigInt(32); function fromBig(n2, le2 = false) { if (le2) return { h: Number(n2 & U32_MASK64), l: Number(n2 >> _32n & U32_MASK64) }; return { h: Number(n2 >> _32n & U32_MASK64) | 0, l: Number(n2 & U32_MASK64) | 0 }; } function split$1(lst, le2 = false) { let Ah = new Uint32Array(lst.length); let Al = new Uint32Array(lst.length); for (let i2 = 0; i2 < lst.length; i2++) { const { h: h2, l: l2 } = fromBig(lst[i2], le2); [Ah[i2], Al[i2]] = [h2, l2]; } return [Ah, Al]; } const rotlSH = (h2, l2, s2) => h2 << s2 | l2 >>> 32 - s2; const rotlSL = (h2, l2, s2) => l2 << s2 | h2 >>> 32 - s2; const rotlBH = (h2, l2, s2) => l2 << s2 - 32 | h2 >>> 64 - s2; const rotlBL = (h2, l2, s2) => h2 << s2 - 32 | l2 >>> 64 - s2; /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ const u8a = (a2) => a2 instanceof Uint8Array; const u32 = (arr2) => new Uint32Array(arr2.buffer, arr2.byteOffset, Math.floor(arr2.byteLength / 4)); const isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; if (!isLE) throw new Error("Non little-endian hardware is not supported"); function utf8ToBytes(str) { if (typeof str !== "string") throw new Error(`utf8ToBytes expected string, got ${typeof str}`); return new Uint8Array(new TextEncoder().encode(str)); } function toBytes(data2) { if (typeof data2 === "string") data2 = utf8ToBytes(data2); if (!u8a(data2)) throw new Error(`expected Uint8Array, got ${typeof data2}`); return data2; } let Hash$7 = class Hash { // Safe version that clones internal state clone() { return this._cloneInto(); } }; function wrapConstructor(hashCons) { const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); const tmp = hashCons(); hashC.outputLen = tmp.outputLen; hashC.blockLen = tmp.blockLen; hashC.create = () => hashCons(); return hashC; } const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; const _0n = /* @__PURE__ */ BigInt(0); const _1n = /* @__PURE__ */ BigInt(1); const _2n = /* @__PURE__ */ BigInt(2); const _7n = /* @__PURE__ */ BigInt(7); const _256n = /* @__PURE__ */ BigInt(256); const _0x71n = /* @__PURE__ */ BigInt(113); for (let round = 0, R2 = _1n, x2 = 1, y2 = 0; round < 24; round++) { [x2, y2] = [y2, (2 * x2 + 3 * y2) % 5]; SHA3_PI.push(2 * (5 * y2 + x2)); SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64); let t2 = _0n; for (let j2 = 0; j2 < 7; j2++) { R2 = (R2 << _1n ^ (R2 >> _7n) * _0x71n) % _256n; if (R2 & _2n) t2 ^= _1n << (_1n << /* @__PURE__ */ BigInt(j2)) - _1n; } _SHA3_IOTA.push(t2); } const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split$1(_SHA3_IOTA, true); const rotlH = (h2, l2, s2) => s2 > 32 ? rotlBH(h2, l2, s2) : rotlSH(h2, l2, s2); const rotlL = (h2, l2, s2) => s2 > 32 ? rotlBL(h2, l2, s2) : rotlSL(h2, l2, s2); function keccakP(s2, rounds = 24) { const B2 = new Uint32Array(5 * 2); for (let round = 24 - rounds; round < 24; round++) { for (let x2 = 0; x2 < 10; x2++) B2[x2] = s2[x2] ^ s2[x2 + 10] ^ s2[x2 + 20] ^ s2[x2 + 30] ^ s2[x2 + 40]; for (let x2 = 0; x2 < 10; x2 += 2) { const idx1 = (x2 + 8) % 10; const idx0 = (x2 + 2) % 10; const B0 = B2[idx0]; const B1 = B2[idx0 + 1]; const Th = rotlH(B0, B1, 1) ^ B2[idx1]; const Tl = rotlL(B0, B1, 1) ^ B2[idx1 + 1]; for (let y2 = 0; y2 < 50; y2 += 10) { s2[x2 + y2] ^= Th; s2[x2 + y2 + 1] ^= Tl; } } let curH = s2[2]; let curL = s2[3]; for (let t2 = 0; t2 < 24; t2++) { const shift = SHA3_ROTL[t2]; const Th = rotlH(curH, curL, shift); const Tl = rotlL(curH, curL, shift); const PI = SHA3_PI[t2]; curH = s2[PI]; curL = s2[PI + 1]; s2[PI] = Th; s2[PI + 1] = Tl; } for (let y2 = 0; y2 < 50; y2 += 10) { for (let x2 = 0; x2 < 10; x2++) B2[x2] = s2[y2 + x2]; for (let x2 = 0; x2 < 10; x2++) s2[y2 + x2] ^= ~B2[(x2 + 2) % 10] & B2[(x2 + 4) % 10]; } s2[0] ^= SHA3_IOTA_H[round]; s2[1] ^= SHA3_IOTA_L[round]; } B2.fill(0); } let Keccak$1 = class Keccak2 extends Hash$7 { // NOTE: we accept arguments in bytes instead of bits here. constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { super(); this.blockLen = blockLen; this.suffix = suffix; this.outputLen = outputLen; this.enableXOF = enableXOF; this.rounds = rounds; this.pos = 0; this.posOut = 0; this.finished = false; this.destroyed = false; number$2(outputLen); if (0 >= this.blockLen || this.blockLen >= 200) throw new Error("Sha3 supports only keccak-f1600 function"); this.state = new Uint8Array(200); this.state32 = u32(this.state); } keccak() { keccakP(this.state32, this.rounds); this.posOut = 0; this.pos = 0; } update(data2) { exists(this); const { blockLen, state: state2 } = this; data2 = toBytes(data2); const len2 = data2.length; for (let pos = 0; pos < len2; ) { const take = Math.min(blockLen - this.pos, len2 - pos); for (let i2 = 0; i2 < take; i2++) state2[this.pos++] ^= data2[pos++]; if (this.pos === blockLen) this.keccak(); } return this; } finish() { if (this.finished) return; this.finished = true; const { state: state2, suffix, pos, blockLen } = this; state2[pos] ^= suffix; if ((suffix & 128) !== 0 && pos === blockLen - 1) this.keccak(); state2[blockLen - 1] ^= 128; this.keccak(); } writeInto(out) { exists(this, false); bytes$1(out); this.finish(); const bufferOut = this.state; const { blockLen } = this; for (let pos = 0, len2 = out.length; pos < len2; ) { if (this.posOut >= blockLen) this.keccak(); const take = Math.min(blockLen - this.posOut, len2 - pos); out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); this.posOut += take; pos += take; } return out; } xofInto(out) { if (!this.enableXOF) throw new Error("XOF is not possible for this instance"); return this.writeInto(out); } xof(bytes2) { number$2(bytes2); return this.xofInto(new Uint8Array(bytes2)); } digestInto(out) { output(out, this); if (this.finished) throw new Error("digest() was already called"); this.writeInto(out); this.destroy(); return out; } digest() { return this.digestInto(new Uint8Array(this.outputLen)); } destroy() { this.destroyed = true; this.state.fill(0); } _cloneInto(to2) { const { blockLen, suffix, outputLen, rounds, enableXOF } = this; to2 || (to2 = new Keccak2(blockLen, suffix, outputLen, enableXOF, rounds)); to2.state32.set(this.state32); to2.pos = this.pos; to2.posOut = this.posOut; to2.finished = this.finished; to2.rounds = rounds; to2.suffix = suffix; to2.outputLen = outputLen; to2.enableXOF = enableXOF; to2.destroyed = this.destroyed; return to2; } }; const gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak$1(blockLen, suffix, outputLen)); const keccak_256 = /* @__PURE__ */ gen(1, 136, 256 / 8); function keccak256(value, to_) { const to2 = to_ || "hex"; const bytes2 = keccak_256(isHex(value, { strict: false }) ? toBytes$1(value) : value); if (to2 === "bytes") return bytes2; return toHex(bytes2); } const hash$3 = (value) => keccak256(toBytes$1(value)); const getEventSelector = (fn2) => hash$3(getEventSignature(fn2)); function slice(value, start, end, { strict } = {}) { if (isHex(value, { strict: false })) return sliceHex(value, start, end, { strict }); return sliceBytes(value, start, end, { strict }); } function assertStartOffset(value, start) { if (typeof start === "number" && start > 0 && start > size$2(value) - 1) throw new SliceOffsetOutOfBoundsError({ offset: start, position: "start", size: size$2(value) }); } function assertEndOffset(value, start, end) { if (typeof start === "number" && typeof end === "number" && size$2(value) !== end - start) { throw new SliceOffsetOutOfBoundsError({ offset: end, position: "end", size: size$2(value) }); } } function sliceBytes(value_, start, end, { strict } = {}) { assertStartOffset(value_, start); const value = value_.slice(start, end); if (strict) assertEndOffset(value, start, end); return value; } function sliceHex(value_, start, end, { strict } = {}) { assertStartOffset(value_, start); const value = `0x${value_.replace("0x", "").slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`; if (strict) assertEndOffset(value, start, end); return value; } function encodeAbiParameters(params, values) { if (params.length !== values.length) throw new AbiEncodingLengthMismatchError({ expectedLength: params.length, givenLength: values.length }); const preparedParams = prepareParams({ params, values }); const data2 = encodeParams(preparedParams); if (data2.length === 0) return "0x"; return data2; } function prepareParams({ params, values }) { const preparedParams = []; for (let i2 = 0; i2 < params.length; i2++) { preparedParams.push(prepareParam({ param: params[i2], value: values[i2] })); } return preparedParams; } function prepareParam({ param, value }) { const arrayComponents = getArrayComponents(param.type); if (arrayComponents) { const [length, type2] = arrayComponents; return encodeArray(value, { length, param: { ...param, type: type2 } }); } if (param.type === "tuple") { return encodeTuple(value, { param }); } if (param.type === "address") { return encodeAddress(value); } if (param.type === "bool") { return encodeBool(value); } if (param.type.startsWith("uint") || param.type.startsWith("int")) { const signed2 = param.type.startsWith("int"); return encodeNumber(value, { signed: signed2 }); } if (param.type.startsWith("bytes")) { return encodeBytes(value, { param }); } if (param.type === "string") { return encodeString(value); } throw new InvalidAbiEncodingTypeError(param.type, { docsPath: "/docs/contract/encodeAbiParameters" }); } function encodeParams(preparedParams) { let staticSize = 0; for (let i2 = 0; i2 < preparedParams.length; i2++) { const { dynamic: dynamic2, encoded } = preparedParams[i2]; if (dynamic2) staticSize += 32; else staticSize += size$2(encoded); } const staticParams = []; const dynamicParams = []; let dynamicSize = 0; for (let i2 = 0; i2 < preparedParams.length; i2++) { const { dynamic: dynamic2, encoded } = preparedParams[i2]; if (dynamic2) { staticParams.push(numberToHex$1(staticSize + dynamicSize, { size: 32 })); dynamicParams.push(encoded); dynamicSize += size$2(encoded); } else { staticParams.push(encoded); } } return concat$1([...staticParams, ...dynamicParams]); } function encodeAddress(value) { if (!isAddress(value)) throw new InvalidAddressError({ address: value }); return { dynamic: false, encoded: padHex(value.toLowerCase()) }; } function encodeArray(value, { length, param }) { const dynamic2 = length === null; if (!Array.isArray(value)) throw new InvalidArrayError(value); if (!dynamic2 && value.length !== length) throw new AbiEncodingArrayLengthMismatchError({ expectedLength: length, givenLength: value.length, type: `${param.type}[${length}]` }); let dynamicChild = false; const preparedParams = []; for (let i2 = 0; i2 < value.length; i2++) { const preparedParam = prepareParam({ param, value: value[i2] }); if (preparedParam.dynamic) dynamicChild = true; preparedParams.push(preparedParam); } if (dynamic2 || dynamicChild) { const data2 = encodeParams(preparedParams); if (dynamic2) { const length2 = numberToHex$1(preparedParams.length, { size: 32 }); return { dynamic: true, encoded: preparedParams.length > 0 ? concat$1([length2, data2]) : length2 }; } if (dynamicChild) return { dynamic: true, encoded: data2 }; } return { dynamic: false, encoded: concat$1(preparedParams.map(({ encoded }) => encoded)) }; } function encodeBytes(value, { param }) { const [, paramSize] = param.type.split("bytes"); const bytesSize = size$2(value); if (!paramSize) { let value_ = value; if (bytesSize % 32 !== 0) value_ = padHex(value_, { dir: "right", size: Math.ceil((value.length - 2) / 2 / 32) * 32 }); return { dynamic: true, encoded: concat$1([padHex(numberToHex$1(bytesSize, { size: 32 })), value_]) }; } if (bytesSize !== parseInt(paramSize)) throw new AbiEncodingBytesSizeMismatchError({ expectedSize: parseInt(paramSize), value }); return { dynamic: false, encoded: padHex(value, { dir: "right" }) }; } function encodeBool(value) { return { dynamic: false, encoded: padHex(boolToHex(value)) }; } function encodeNumber(value, { signed: signed2 }) { return { dynamic: false, encoded: numberToHex$1(value, { size: 32, signed: signed2 }) }; } function encodeString(value) { const hexValue = stringToHex(value); const partsLength = Math.ceil(size$2(hexValue) / 32); const parts = []; for (let i2 = 0; i2 < partsLength; i2++) { parts.push(padHex(slice(hexValue, i2 * 32, (i2 + 1) * 32), { dir: "right" })); } return { dynamic: true, encoded: concat$1([ padHex(numberToHex$1(size$2(hexValue), { size: 32 })), ...parts ]) }; } function encodeTuple(value, { param }) { let dynamic2 = false; const preparedParams = []; for (let i2 = 0; i2 < param.components.length; i2++) { const param_ = param.components[i2]; const index2 = Array.isArray(value) ? i2 : param_.name; const preparedParam = prepareParam({ param: param_, value: value[index2] }); preparedParams.push(preparedParam); if (preparedParam.dynamic) dynamic2 = true; } return { dynamic: dynamic2, encoded: dynamic2 ? encodeParams(preparedParams) : concat$1(preparedParams.map(({ encoded }) => encoded)) }; } function getArrayComponents(type2) { const matches = type2.match(/^(.*)\[(\d+)?\]$/); return matches ? ( // Return `null` if the array is dynamic. [matches[2] ? Number(matches[2]) : null, matches[1]] ) : void 0; } const hash$2 = (value) => keccak256(toBytes$1(value)); const getFunctionSelector = (fn2) => slice(hash$2(getFunctionSignature(fn2)), 0, 4); function getAbiItem({ abi: abi2, args = [], name: name2 }) { const isSelector = isHex(name2, { strict: false }); const abiItems = abi2.filter((abiItem) => { if (isSelector) { if (abiItem.type === "function") return getFunctionSelector(abiItem) === name2; if (abiItem.type === "event") return getEventSelector(abiItem) === name2; return false; } return "name" in abiItem && abiItem.name === name2; }); if (abiItems.length === 0) return void 0; if (abiItems.length === 1) return abiItems[0]; let matchedAbiItem = void 0; for (const abiItem of abiItems) { if (!("inputs" in abiItem)) continue; if (!args || args.length === 0) { if (!abiItem.inputs || abiItem.inputs.length === 0) return abiItem; continue; } if (!abiItem.inputs) continue; if (abiItem.inputs.length === 0) continue; if (abiItem.inputs.length !== args.length) continue; const matched = args.every((arg, index2) => { const abiParameter = "inputs" in abiItem && abiItem.inputs[index2]; if (!abiParameter) return false; return isArgOfType(arg, abiParameter); }); if (matched) { if (matchedAbiItem && "inputs" in matchedAbiItem && matchedAbiItem.inputs) { const ambiguousTypes = getAmbiguousTypes(abiItem.inputs, matchedAbiItem.inputs, args); if (ambiguousTypes) throw new AbiItemAmbiguityError({ abiItem, type: ambiguousTypes[0] }, { abiItem: matchedAbiItem, type: ambiguousTypes[1] }); } matchedAbiItem = abiItem; } } if (matchedAbiItem) return matchedAbiItem; return abiItems[0]; } function isArgOfType(arg, abiParameter) { const argType = typeof arg; const abiParameterType = abiParameter.type; switch (abiParameterType) { case "address": return isAddress(arg); case "bool": return argType === "boolean"; case "function": return argType === "string"; case "string": return argType === "string"; default: { if (abiParameterType === "tuple" && "components" in abiParameter) return Object.values(abiParameter.components).every((component, index2) => { return isArgOfType(Object.values(arg)[index2], component); }); if (/^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(abiParameterType)) return argType === "number" || argType === "bigint"; if (/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(abiParameterType)) return argType === "string" || arg instanceof Uint8Array; if (/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(abiParameterType)) { return Array.isArray(arg) && arg.every((x2) => isArgOfType(x2, { ...abiParameter, // Pop off `[]` or `[M]` from end of type type: abiParameterType.replace(/(\[[0-9]{0,}\])$/, "") })); } return false; } } } function getAmbiguousTypes(sourceParameters, targetParameters, args) { for (const parameterIndex in sourceParameters) { const sourceParameter = sourceParameters[parameterIndex]; const targetParameter = targetParameters[parameterIndex]; if (sourceParameter.type === "tuple" && targetParameter.type === "tuple" && "components" in sourceParameter && "components" in targetParameter) return getAmbiguousTypes(sourceParameter.components, targetParameter.components, args[parameterIndex]); const types2 = [sourceParameter.type, targetParameter.type]; const ambiguous = (() => { if (types2.includes("address") && types2.includes("bytes20")) return true; if (types2.includes("address") && types2.includes("string")) return isAddress(args[parameterIndex]); if (types2.includes("address") && types2.includes("bytes")) return isAddress(args[parameterIndex]); return false; })(); if (ambiguous) return types2; } return; } function encodeEventTopics({ abi: abi2, eventName, args }) { var _a2; let abiItem = abi2[0]; if (eventName) { abiItem = getAbiItem({ abi: abi2, args, name: eventName }); if (!abiItem) throw new AbiEventNotFoundError(eventName, { docsPath: "/docs/contract/encodeEventTopics" }); } if (abiItem.type !== "event") throw new AbiEventNotFoundError(void 0, { docsPath: "/docs/contract/encodeEventTopics" }); const definition = formatAbiItem(abiItem); const signature = getEventSelector(definition); let topics = []; if (args && "inputs" in abiItem) { const indexedInputs = (_a2 = abiItem.inputs) == null ? void 0 : _a2.filter((param) => "indexed" in param && param.indexed); const args_ = Array.isArray(args) ? args : Object.values(args).length > 0 ? (indexedInputs == null ? void 0 : indexedInputs.map((x2) => args[x2.name])) ?? [] : []; if (args_.length > 0) { topics = (indexedInputs == null ? void 0 : indexedInputs.map((param, i2) => Array.isArray(args_[i2]) ? args_[i2].map((_2, j2) => encodeArg({ param, value: args_[i2][j2] })) : args_[i2] ? encodeArg({ param, value: args_[i2] }) : null)) ?? []; } } return [signature, ...topics]; } function encodeArg({ param, value }) { if (param.type === "string" || param.type === "bytes") return keccak256(toBytes$1(value)); if (param.type === "tuple" || param.type.match(/^(.*)\[(\d+)?\]$/)) throw new FilterTypeNotSupportedError(param.type); return encodeAbiParameters([param], [value]); } function createFilterRequestScope(client, { method }) { var _a2, _b2; const requestMap = {}; if (client.transport.type === "fallback") (_b2 = (_a2 = client.transport).onResponse) == null ? void 0 : _b2.call(_a2, ({ method: method_, response: id2, status, transport }) => { if (status === "success" && method === method_) requestMap[id2] = transport.request; }); return (id2) => requestMap[id2] || client.request; } async function createContractEventFilter(client, { address, abi: abi2, args, eventName, fromBlock, strict, toBlock }) { const getRequest = createFilterRequestScope(client, { method: "eth_newFilter" }); const topics = eventName ? encodeEventTopics({ abi: abi2, args, eventName }) : void 0; const id2 = await client.request({ method: "eth_newFilter", params: [ { address, fromBlock: typeof fromBlock === "bigint" ? numberToHex$1(fromBlock) : fromBlock, toBlock: typeof toBlock === "bigint" ? numberToHex$1(toBlock) : toBlock, topics } ] }); return { abi: abi2, args, eventName, id: id2, request: getRequest(id2), strict, type: "event" }; } function parseAccount(account) { if (typeof account === "string") return { address: account, type: "json-rpc" }; return account; } function encodeFunctionData({ abi: abi2, args, functionName }) { let abiItem = abi2[0]; if (functionName) { abiItem = getAbiItem({ abi: abi2, args, name: functionName }); if (!abiItem) throw new AbiFunctionNotFoundError(functionName, { docsPath: "/docs/contract/encodeFunctionData" }); } if (abiItem.type !== "function") throw new AbiFunctionNotFoundError(void 0, { docsPath: "/docs/contract/encodeFunctionData" }); const definition = formatAbiItem(abiItem); const signature = getFunctionSelector(definition); const data2 = "inputs" in abiItem && abiItem.inputs ? encodeAbiParameters(abiItem.inputs, args ?? []) : void 0; return concatHex([signature, data2 ?? "0x"]); } const panicReasons = { 1: "An `assert` condition failed.", 17: "Arithmic 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." }; const solidityError = { inputs: [ { name: "message", type: "string" } ], name: "Error", type: "error" }; const solidityPanic = { inputs: [ { name: "reason", type: "uint256" } ], name: "Panic", type: "error" }; function checksumAddress(address_, chainId) { const hexAddress = chainId ? `${chainId}${address_.toLowerCase()}` : address_.substring(2).toLowerCase(); const hash2 = keccak256(stringToBytes$1(hexAddress), "bytes"); const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split(""); for (let i2 = 0; i2 < 40; i2 += 2) { if (hash2[i2 >> 1] >> 4 >= 8 && address[i2]) { address[i2] = address[i2].toUpperCase(); } if ((hash2[i2 >> 1] & 15) >= 8 && address[i2 + 1]) { address[i2 + 1] = address[i2 + 1].toUpperCase(); } } return `0x${address.join("")}`; } function getAddress(address, chainId) { if (!isAddress(address)) throw new InvalidAddressError({ address }); return checksumAddress(address, chainId); } function decodeAbiParameters(params, data2) { if (data2 === "0x" && params.length > 0) throw new AbiDecodingZeroDataError(); if (size$2(data2) && size$2(data2) < 32) throw new AbiDecodingDataSizeTooSmallError({ data: data2, params, size: size$2(data2) }); return decodeParams({ data: data2, params }); } function decodeParams({ data: data2, params }) { const decodedValues = []; let position = 0; for (let i2 = 0; i2 < params.length; i2++) { if (position >= size$2(data2)) throw new AbiDecodingDataSizeTooSmallError({ data: data2, params, size: size$2(data2) }); const param = params[i2]; const { consumed, value } = decodeParam({ data: data2, param, position }); decodedValues.push(value); position += consumed; } return decodedValues; } function decodeParam({ data: data2, param, position }) { const arrayComponents = getArrayComponents(param.type); if (arrayComponents) { const [length, type2] = arrayComponents; return decodeArray(data2, { length, param: { ...param, type: type2 }, position }); } if (param.type === "tuple") { return decodeTuple(data2, { param, position }); } if (param.type === "string") { return decodeString(data2, { position }); } if (param.type.startsWith("bytes")) { return decodeBytes(data2, { param, position }); } const value = slice(data2, position, position + 32, { strict: true }); if (param.type.startsWith("uint") || param.type.startsWith("int")) { return decodeNumber(value, { param }); } if (param.type === "address") { return decodeAddress(value); } if (param.type === "bool") { return decodeBool(value); } throw new InvalidAbiDecodingTypeError(param.type, { docsPath: "/docs/contract/decodeAbiParameters" }); } function decodeAddress(value) { return { consumed: 32, value: checksumAddress(slice(value, -20)) }; } function decodeArray(data2, { param, length, position }) { if (!length) { const offset = hexToNumber$1(slice(data2, position, position + 32, { strict: true })); const length2 = hexToNumber$1(slice(data2, offset, offset + 32, { strict: true })); let consumed2 = 0; const value2 = []; for (let i2 = 0; i2 < length2; ++i2) { const decodedChild = decodeParam({ data: slice(data2, offset + 32), param, position: consumed2 }); consumed2 += decodedChild.consumed; value2.push(decodedChild.value); } return { value: value2, consumed: 32 }; } if (hasDynamicChild(param)) { const arrayComponents = getArrayComponents(param.type); const dynamicChild = !(arrayComponents == null ? void 0 : arrayComponents[0]); let consumed2 = 0; const value2 = []; for (let i2 = 0; i2 < length; ++i2) { const offset = hexToNumber$1(slice(data2, position, position + 32, { strict: true })); const decodedChild = decodeParam({ data: slice(data2, offset), param, position: dynamicChild ? consumed2 : i2 * 32 }); consumed2 += decodedChild.consumed; value2.push(decodedChild.value); } return { value: value2, consumed: 32 }; } let consumed = 0; const value = []; for (let i2 = 0; i2 < length; ++i2) { const decodedChild = decodeParam({ data: data2, param, position: position + consumed }); consumed += decodedChild.consumed; value.push(decodedChild.value); } return { value, consumed }; } function decodeBool(value) { return { consumed: 32, value: hexToBool(value) }; } function decodeBytes(data2, { param, position }) { const [_2, size2] = param.type.split("bytes"); if (!size2) { const offset = hexToNumber$1(slice(data2, position, position + 32, { strict: true })); const length = hexToNumber$1(slice(data2, offset, offset + 32, { strict: true })); if (length === 0) return { consumed: 32, value: "0x" }; const value2 = slice(data2, offset + 32, offset + 32 + length, { strict: true }); return { consumed: 32, value: value2 }; } const value = slice(data2, position, position + parseInt(size2), { strict: true }); return { consumed: 32, value }; } function decodeNumber(value, { param }) { const signed2 = param.type.startsWith("int"); const size2 = parseInt(param.type.split("int")[1] || "256"); return { consumed: 32, value: size2 > 48 ? hexToBigInt$1(value, { signed: signed2 }) : hexToNumber$1(value, { signed: signed2 }) }; } function decodeString(data2, { position }) { const offset = hexToNumber$1(slice(data2, position, position + 32, { strict: true })); const length = hexToNumber$1(slice(data2, offset, offset + 32, { strict: true })); if (length === 0) return { consumed: 32, value: "" }; const value = hexToString(trim(slice(data2, offset + 32, offset + 32 + length, { strict: true }))); return { consumed: 32, value }; } function decodeTuple(data2, { param, position }) { const hasUnnamedChild = param.components.length === 0 || param.components.some(({ name: name2 }) => !name2); const value = hasUnnamedChild ? [] : {}; let consumed = 0; if (hasDynamicChild(param)) { const offset = hexToNumber$1(slice(data2, position, position + 32, { strict: true })); for (let i2 = 0; i2 < param.components.length; ++i2) { const component = param.components[i2]; const decodedChild = decodeParam({ data: slice(data2, offset), param: component, position: consumed }); consumed += decodedChild.consumed; value[hasUnnamedChild ? i2 : component == null ? void 0 : component.name] = decodedChild.value; } return { consumed: 32, value }; } for (let i2 = 0; i2 < param.components.length; ++i2) { const component = param.components[i2]; const decodedChild = decodeParam({ data: data2, param: component, position: position + consumed }); consumed += decodedChild.consumed; value[hasUnnamedChild ? i2 : component == null ? void 0 : component.name] = decodedChild.value; } return { consumed, value }; } function hasDynamicChild(param) { var _a2; const { type: type2 } = param; if (type2 === "string") return true; if (type2 === "bytes") return true; if (type2.endsWith("[]")) return true; if (type2 === "tuple") return (_a2 = param.components) == null ? void 0 : _a2.some(hasDynamicChild); const arrayComponents = getArrayComponents(param.type); if (arrayComponents && hasDynamicChild({ ...param, type: arrayComponents[1] })) return true; return false; } function decodeErrorResult({ abi: abi2, data: data2 }) { const signature = slice(data2, 0, 4); if (signature === "0x") throw new AbiDecodingZeroDataError(); const abi_ = [...abi2 || [], solidityError, solidityPanic]; const abiItem = abi_.find((x2) => x2.type === "error" && signature === getFunctionSelector(formatAbiItem(x2))); if (!abiItem) throw new AbiErrorSignatureNotFoundError(signature, { docsPath: "/docs/contract/decodeErrorResult" }); return { abiItem, args: "inputs" in abiItem && abiItem.inputs && abiItem.inputs.length > 0 ? decodeAbiParameters(abiItem.inputs, slice(data2, 4)) : void 0, errorName: abiItem.name }; } const stringify$2 = (value, replacer, space) => JSON.stringify(value, (key, value_) => { const value2 = typeof value_ === "bigint" ? value_.toString() : value_; return typeof replacer === "function" ? replacer(key, value2) : value2; }, space); function formatAbiItemWithArgs({ abiItem, args, includeFunctionName = true, includeName = false }) { if (!("name" in abiItem)) return; if (!("inputs" in abiItem)) return; if (!abiItem.inputs) return; return `${includeFunctionName ? abiItem.name : ""}(${abiItem.inputs.map((input, i2) => `${includeName && input.name ? `${input.name}: ` : ""}${typeof args[i2] === "object" ? stringify$2(args[i2]) : args[i2]}`).join(", ")})`; } function formatEther(wei, unit = "wei") { return formatUnits(wei, etherUnits[unit]); } function prettyPrint(args) { const entries2 = Object.entries(args).map(([key, value]) => { if (value === void 0 || value === false) return null; return [key, value]; }).filter(Boolean); const maxLength = entries2.reduce((acc, [key]) => Math.max(acc, key.length), 0); return entries2.map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`).join("\n"); } class FeeConflictError extends BaseError { constructor() { super([ "Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.", "Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others." ].join("\n")); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "FeeConflictError" }); } } class InvalidSerializableTransactionError extends BaseError { constructor({ transaction }) { super("Cannot infer a transaction type from provided transaction.", { metaMessages: [ "Provided Transaction:", "{", prettyPrint(transaction), "}", "", "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", "- a Legacy Transaction with `gasPrice`" ] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "InvalidSerializableTransactionError" }); } } class TransactionExecutionError extends BaseError { constructor(cause, { account, docsPath: docsPath2, chain, data: data2, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to: to2, value }) { var _a2; const prettyArgs = prettyPrint({ chain: chain && `${chain == null ? void 0 : chain.name} (id: ${chain == null ? void 0 : chain.id})`, from: account == null ? void 0 : account.address, to: to2, value: typeof value !== "undefined" && `${formatEther(value)} ${((_a2 = chain == null ? void 0 : chain.nativeCurrency) == null ? void 0 : _a2.symbol) || "ETH"}`, data: data2, gas, gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`, maxFeePerGas: typeof maxFeePerGas !== "undefined" && `${formatGwei(maxFeePerGas)} gwei`, maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== "undefined" && `${formatGwei(maxPriorityFeePerGas)} gwei`, nonce }); super(cause.shortMessage, { cause, docsPath: docsPath2, metaMessages: [ ...cause.metaMessages ? [...cause.metaMessages, " "] : [], "Request Arguments:", prettyArgs ].filter(Boolean) }); Object.defineProperty(this, "cause", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "TransactionExecutionError" }); this.cause = cause; } } class TransactionNotFoundError extends BaseError { constructor({ blockHash, blockNumber, blockTag, hash: hash2, index: index2 }) { let identifier = "Transaction"; if (blockTag && index2 !== void 0) identifier = `Transaction at block time "${blockTag}" at index "${index2}"`; if (blockHash && index2 !== void 0) identifier = `Transaction at block hash "${blockHash}" at index "${index2}"`; if (blockNumber && index2 !== void 0) identifier = `Transaction at block number "${blockNumber}" at index "${index2}"`; if (hash2) identifier = `Transaction with hash "${hash2}"`; super(`${identifier} could not be found.`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "TransactionNotFoundError" }); } } class TransactionReceiptNotFoundError extends BaseError { constructor({ hash: hash2 }) { super(`Transaction receipt with hash "${hash2}" could not be found. The Transaction may not be processed on a block yet.`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "TransactionReceiptNotFoundError" }); } } class WaitForTransactionReceiptTimeoutError extends BaseError { constructor({ hash: hash2 }) { super(`Timed out while waiting for transaction with hash "${hash2}" to be confirmed.`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "WaitForTransactionReceiptTimeoutError" }); } } class CallExecutionError extends BaseError { constructor(cause, { account: account_, docsPath: docsPath2, chain, data: data2, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to: to2, value }) { var _a2; const account = account_ ? parseAccount(account_) : void 0; const prettyArgs = prettyPrint({ from: account == null ? void 0 : account.address, to: to2, value: typeof value !== "undefined" && `${formatEther(value)} ${((_a2 = chain == null ? void 0 : chain.nativeCurrency) == null ? void 0 : _a2.symbol) || "ETH"}`, data: data2, gas, gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`, maxFeePerGas: typeof maxFeePerGas !== "undefined" && `${formatGwei(maxFeePerGas)} gwei`, maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== "undefined" && `${formatGwei(maxPriorityFeePerGas)} gwei`, nonce }); super(cause.shortMessage, { cause, docsPath: docsPath2, metaMessages: [ ...cause.metaMessages ? [...cause.metaMessages, " "] : [], "Raw Call Arguments:", prettyArgs ].filter(Boolean) }); Object.defineProperty(this, "cause", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "CallExecutionError" }); this.cause = cause; } } class ContractFunctionExecutionError extends BaseError { constructor(cause, { abi: abi2, args, contractAddress, docsPath: docsPath2, functionName, sender }) { const abiItem = getAbiItem({ abi: abi2, args, name: functionName }); const formattedArgs = abiItem ? formatAbiItemWithArgs({ abiItem, args, includeFunctionName: false, includeName: false }) : void 0; const functionWithParams = abiItem ? formatAbiItem(abiItem, { includeName: true }) : void 0; const prettyArgs = prettyPrint({ address: contractAddress && getContractAddress(contractAddress), function: functionWithParams, args: formattedArgs && formattedArgs !== "()" && `${[...Array((functionName == null ? void 0 : functionName.length) ?? 0).keys()].map(() => " ").join("")}${formattedArgs}`, sender }); super(cause.shortMessage || `An unknown error occurred while executing the contract function "${functionName}".`, { cause, docsPath: docsPath2, metaMessages: [ ...cause.metaMessages ? [...cause.metaMessages, " "] : [], "Contract Call:", prettyArgs ].filter(Boolean) }); Object.defineProperty(this, "abi", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "args", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "cause", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "contractAddress", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "formattedArgs", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "functionName", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "sender", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ContractFunctionExecutionError" }); this.abi = abi2; this.args = args; this.cause = cause; this.contractAddress = contractAddress; this.functionName = functionName; this.sender = sender; } } class ContractFunctionRevertedError extends BaseError { constructor({ abi: abi2, data: data2, functionName, message }) { let cause; let decodedData = void 0; let metaMessages; let reason; if (data2 && data2 !== "0x") { try { decodedData = decodeErrorResult({ abi: abi2, data: data2 }); const { abiItem, errorName, args: errorArgs } = decodedData; if (errorName === "Error") { reason = errorArgs[0]; } else if (errorName === "Panic") { const [firstArg] = errorArgs; reason = panicReasons[firstArg]; } else { const errorWithParams = abiItem ? formatAbiItem(abiItem, { includeName: true }) : void 0; const formattedArgs = abiItem && errorArgs ? formatAbiItemWithArgs({ abiItem, args: errorArgs, includeFunctionName: false, includeName: false }) : void 0; metaMessages = [ errorWithParams ? `Error: ${errorWithParams}` : "", formattedArgs && formattedArgs !== "()" ? ` ${[...Array((errorName == null ? void 0 : errorName.length) ?? 0).keys()].map(() => " ").join("")}${formattedArgs}` : "" ]; } } catch (err) { cause = err; } } else if (message) reason = message; let signature; if (cause instanceof AbiErrorSignatureNotFoundError) { signature = cause.signature; metaMessages = [ `Unable to decode signature "${signature}" 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=${signature}.` ]; } super(reason && reason !== "execution reverted" || signature ? [ `The contract function "${functionName}" reverted with the following ${signature ? "signature" : "reason"}:`, reason || signature ].join("\n") : `The contract function "${functionName}" reverted.`, { cause, metaMessages }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ContractFunctionRevertedError" }); Object.defineProperty(this, "data", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "reason", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "signature", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.data = decodedData; this.reason = reason; this.signature = signature; } } class ContractFunctionZeroDataError extends BaseError { constructor({ functionName }) { super(`The contract function "${functionName}" returned no data ("0x").`, { metaMessages: [ "This could be due to any of the following:", ` - The contract does not have the function "${functionName}",`, " - The parameters passed to the contract function may be invalid, or", " - The address is not a contract." ] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ContractFunctionZeroDataError" }); } } class RawContractError extends BaseError { constructor({ data: data2, message }) { super(message || ""); Object.defineProperty(this, "code", { enumerable: true, configurable: true, writable: true, value: 3 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "RawContractError" }); Object.defineProperty(this, "data", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.data = data2; } } class HttpRequestError extends BaseError { constructor({ body, details, headers, status, url }) { super("HTTP request failed.", { details, metaMessages: [ status && `Status: ${status}`, `URL: ${getUrl(url)}`, body && `Request body: ${stringify$2(body)}` ].filter(Boolean) }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "HttpRequestError" }); Object.defineProperty(this, "body", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "headers", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "status", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "url", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.body = body; this.headers = headers; this.status = status; this.url = url; } } class WebSocketRequestError extends BaseError { constructor({ body, details, url }) { super("WebSocket request failed.", { details, metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify$2(body)}`] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "WebSocketRequestError" }); } } class RpcRequestError extends BaseError { constructor({ body, error: error2, url }) { super("RPC Request failed.", { cause: error2, details: error2.message, metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify$2(body)}`] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "RpcRequestError" }); Object.defineProperty(this, "code", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.code = error2.code; } } class TimeoutError extends BaseError { constructor({ body, url }) { super("The request took too long to respond.", { details: "The request timed out.", metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify$2(body)}`] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "TimeoutError" }); } } const unknownErrorCode = -1; class RpcError extends BaseError { constructor(cause, { code: code2, docsPath: docsPath2, metaMessages, shortMessage }) { super(shortMessage, { cause, docsPath: docsPath2, metaMessages: metaMessages || (cause == null ? void 0 : cause.metaMessages) }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "RpcError" }); Object.defineProperty(this, "code", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.name = cause.name; this.code = cause instanceof RpcRequestError ? cause.code : code2 ?? unknownErrorCode; } } class ProviderRpcError extends RpcError { constructor(cause, options) { super(cause, options); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ProviderRpcError" }); Object.defineProperty(this, "data", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.data = options.data; } } class ParseRpcError extends RpcError { constructor(cause) { super(cause, { code: ParseRpcError.code, shortMessage: "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ParseRpcError" }); } } Object.defineProperty(ParseRpcError, "code", { enumerable: true, configurable: true, writable: true, value: -32700 }); class InvalidRequestRpcError extends RpcError { constructor(cause) { super(cause, { code: InvalidRequestRpcError.code, shortMessage: "JSON is not a valid request object." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "InvalidRequestRpcError" }); } } Object.defineProperty(InvalidRequestRpcError, "code", { enumerable: true, configurable: true, writable: true, value: -32600 }); class MethodNotFoundRpcError extends RpcError { constructor(cause) { super(cause, { code: MethodNotFoundRpcError.code, shortMessage: "The method does not exist / is not available." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "MethodNotFoundRpcError" }); } } Object.defineProperty(MethodNotFoundRpcError, "code", { enumerable: true, configurable: true, writable: true, value: -32601 }); class InvalidParamsRpcError extends RpcError { constructor(cause) { super(cause, { code: InvalidParamsRpcError.code, shortMessage: [ "Invalid parameters were provided to the RPC method.", "Double check you have provided the correct parameters." ].join("\n") }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "InvalidParamsRpcError" }); } } Object.defineProperty(InvalidParamsRpcError, "code", { enumerable: true, configurable: true, writable: true, value: -32602 }); class InternalRpcError extends RpcError { constructor(cause) { super(cause, { code: InternalRpcError.code, shortMessage: "An internal error was received." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "InternalRpcError" }); } } Object.defineProperty(InternalRpcError, "code", { enumerable: true, configurable: true, writable: true, value: -32603 }); class InvalidInputRpcError extends RpcError { constructor(cause) { super(cause, { code: InvalidInputRpcError.code, shortMessage: [ "Missing or invalid parameters.", "Double check you have provided the correct parameters." ].join("\n") }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "InvalidInputRpcError" }); } } Object.defineProperty(InvalidInputRpcError, "code", { enumerable: true, configurable: true, writable: true, value: -32e3 }); class ResourceNotFoundRpcError extends RpcError { constructor(cause) { super(cause, { code: ResourceNotFoundRpcError.code, shortMessage: "Requested resource not found." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ResourceNotFoundRpcError" }); } } Object.defineProperty(ResourceNotFoundRpcError, "code", { enumerable: true, configurable: true, writable: true, value: -32001 }); class ResourceUnavailableRpcError extends RpcError { constructor(cause) { super(cause, { code: ResourceUnavailableRpcError.code, shortMessage: "Requested resource not available." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ResourceUnavailableRpcError" }); } } Object.defineProperty(ResourceUnavailableRpcError, "code", { enumerable: true, configurable: true, writable: true, value: -32002 }); class TransactionRejectedRpcError extends RpcError { constructor(cause) { super(cause, { code: TransactionRejectedRpcError.code, shortMessage: "Transaction creation failed." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "TransactionRejectedRpcError" }); } } Object.defineProperty(TransactionRejectedRpcError, "code", { enumerable: true, configurable: true, writable: true, value: -32003 }); class MethodNotSupportedRpcError extends RpcError { constructor(cause) { super(cause, { code: MethodNotSupportedRpcError.code, shortMessage: "Method is not implemented." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "MethodNotSupportedRpcError" }); } } Object.defineProperty(MethodNotSupportedRpcError, "code", { enumerable: true, configurable: true, writable: true, value: -32004 }); class LimitExceededRpcError extends RpcError { constructor(cause) { super(cause, { code: LimitExceededRpcError.code, shortMessage: "Request exceeds defined limit." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "LimitExceededRpcError" }); } } Object.defineProperty(LimitExceededRpcError, "code", { enumerable: true, configurable: true, writable: true, value: -32005 }); class JsonRpcVersionUnsupportedError extends RpcError { constructor(cause) { super(cause, { code: JsonRpcVersionUnsupportedError.code, shortMessage: "Version of JSON-RPC protocol is not supported." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "JsonRpcVersionUnsupportedError" }); } } Object.defineProperty(JsonRpcVersionUnsupportedError, "code", { enumerable: true, configurable: true, writable: true, value: -32006 }); class UserRejectedRequestError extends ProviderRpcError { constructor(cause) { super(cause, { code: UserRejectedRequestError.code, shortMessage: "User rejected the request." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "UserRejectedRequestError" }); } } Object.defineProperty(UserRejectedRequestError, "code", { enumerable: true, configurable: true, writable: true, value: 4001 }); class UnauthorizedProviderError extends ProviderRpcError { constructor(cause) { super(cause, { code: UnauthorizedProviderError.code, shortMessage: "The requested method and/or account has not been authorized by the user." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "UnauthorizedProviderError" }); } } Object.defineProperty(UnauthorizedProviderError, "code", { enumerable: true, configurable: true, writable: true, value: 4100 }); class UnsupportedProviderMethodError extends ProviderRpcError { constructor(cause) { super(cause, { code: UnsupportedProviderMethodError.code, shortMessage: "The Provider does not support the requested method." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "UnsupportedProviderMethodError" }); } } Object.defineProperty(UnsupportedProviderMethodError, "code", { enumerable: true, configurable: true, writable: true, value: 4200 }); class ProviderDisconnectedError extends ProviderRpcError { constructor(cause) { super(cause, { code: ProviderDisconnectedError.code, shortMessage: "The Provider is disconnected from all chains." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ProviderDisconnectedError" }); } } Object.defineProperty(ProviderDisconnectedError, "code", { enumerable: true, configurable: true, writable: true, value: 4900 }); class ChainDisconnectedError extends ProviderRpcError { constructor(cause) { super(cause, { code: ChainDisconnectedError.code, shortMessage: "The Provider is not connected to the requested chain." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "ChainDisconnectedError" }); } } Object.defineProperty(ChainDisconnectedError, "code", { enumerable: true, configurable: true, writable: true, value: 4901 }); class SwitchChainError extends ProviderRpcError { constructor(cause) { super(cause, { code: SwitchChainError.code, shortMessage: "An error occurred when attempting to switch chain." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "SwitchChainError" }); } } Object.defineProperty(SwitchChainError, "code", { enumerable: true, configurable: true, writable: true, value: 4902 }); class UnknownRpcError extends RpcError { constructor(cause) { super(cause, { shortMessage: "An unknown RPC error occurred." }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "UnknownRpcError" }); } } const EXECUTION_REVERTED_ERROR_CODE = 3; function getContractError(err, { abi: abi2, address, args, docsPath: docsPath2, functionName, sender }) { const { code: code2, data: data2, message, shortMessage } = err instanceof RawContractError ? err : err instanceof BaseError ? err.walk((err2) => "data" in err2) || err.walk() : {}; const cause = (() => { if (err instanceof AbiDecodingZeroDataError) return new ContractFunctionZeroDataError({ functionName }); if ([EXECUTION_REVERTED_ERROR_CODE, InternalRpcError.code].includes(code2) && (data2 || message || shortMessage)) { return new ContractFunctionRevertedError({ abi: abi2, data: typeof data2 === "object" ? data2.data : data2, functionName, message: shortMessage ?? message }); } return err; })(); return new ContractFunctionExecutionError(cause, { abi: abi2, args, contractAddress: address, docsPath: docsPath2, functionName, sender }); } class AccountNotFoundError extends BaseError { constructor({ docsPath: docsPath2 } = {}) { 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 WalletClient." ].join("\n"), { docsPath: docsPath2, docsSlug: "account" }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AccountNotFoundError" }); } } class EstimateGasExecutionError extends BaseError { constructor(cause, { account, docsPath: docsPath2, chain, data: data2, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to: to2, value }) { var _a2; const prettyArgs = prettyPrint({ from: account == null ? void 0 : account.address, to: to2, value: typeof value !== "undefined" && `${formatEther(value)} ${((_a2 = chain == null ? void 0 : chain.nativeCurrency) == null ? void 0 : _a2.symbol) || "ETH"}`, data: data2, gas, gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`, maxFeePerGas: typeof maxFeePerGas !== "undefined" && `${formatGwei(maxFeePerGas)} gwei`, maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== "undefined" && `${formatGwei(maxPriorityFeePerGas)} gwei`, nonce }); super(cause.shortMessage, { cause, docsPath: docsPath2, metaMessages: [ ...cause.metaMessages ? [...cause.metaMessages, " "] : [], "Estimate Gas Arguments:", prettyArgs ].filter(Boolean) }); Object.defineProperty(this, "cause", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "EstimateGasExecutionError" }); this.cause = cause; } } function getNodeError(err, args) { const message = (err.details || "").toLowerCase(); const executionRevertedError = err.walk((e2) => e2.code === ExecutionRevertedError.code); if (executionRevertedError instanceof BaseError) { return new ExecutionRevertedError({ cause: err, message: executionRevertedError.details }); } if (ExecutionRevertedError.nodeMessage.test(message)) return new ExecutionRevertedError({ cause: err, message: err.details }); if (FeeCapTooHighError.nodeMessage.test(message)) return new FeeCapTooHighError({ cause: err, maxFeePerGas: args == null ? void 0 : args.maxFeePerGas }); if (FeeCapTooLowError.nodeMessage.test(message)) return new FeeCapTooLowError({ cause: err, maxFeePerGas: args == null ? void 0 : args.maxFeePerGas }); if (NonceTooHighError.nodeMessage.test(message)) return new NonceTooHighError({ cause: err, nonce: args == null ? void 0 : args.nonce }); if (NonceTooLowError.nodeMessage.test(message)) return new NonceTooLowError({ cause: err, nonce: args == null ? void 0 : args.nonce }); if (NonceMaxValueError.nodeMessage.test(message)) return new NonceMaxValueError({ cause: err, nonce: args == null ? void 0 : args.nonce }); if (InsufficientFundsError.nodeMessage.test(message)) return new InsufficientFundsError({ cause: err }); if (IntrinsicGasTooHighError.nodeMessage.test(message)) return new IntrinsicGasTooHighError({ cause: err, gas: args == null ? void 0 : args.gas }); if (IntrinsicGasTooLowError.nodeMessage.test(message)) return new IntrinsicGasTooLowError({ cause: err, gas: args == null ? void 0 : args.gas }); if (TransactionTypeNotSupportedError.nodeMessage.test(message)) return new TransactionTypeNotSupportedError({ cause: err }); if (TipAboveFeeCapError.nodeMessage.test(message)) return new TipAboveFeeCapError({ cause: err, maxFeePerGas: args == null ? void 0 : args.maxFeePerGas, maxPriorityFeePerGas: args == null ? void 0 : args.maxPriorityFeePerGas }); return new UnknownNodeError({ cause: err }); } function getEstimateGasError(err, { docsPath: docsPath2, ...args }) { const cause = (() => { const cause2 = getNodeError(err, args); if (cause2 instanceof UnknownNodeError) return err; return cause2; })(); return new EstimateGasExecutionError(cause, { docsPath: docsPath2, ...args }); } function extract(value_, { format: format2 }) { if (!format2) return {}; const value = {}; function extract_(formatted2) { const keys2 = Object.keys(formatted2); for (const key of keys2) { if (key in value_) value[key] = value_[key]; if (formatted2[key] && typeof formatted2[key] === "object" && !Array.isArray(formatted2[key])) extract_(formatted2[key]); } } const formatted = format2(value_ || {}); extract_(formatted); return value; } function assertRequest(args) { const { account: account_, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to: to2 } = args; const account = account_ ? parseAccount(account_) : void 0; if (account && !isAddress(account.address)) throw new InvalidAddressError({ address: account.address }); if (to2 && !isAddress(to2)) throw new InvalidAddressError({ address: to2 }); if (typeof gasPrice !== "undefined" && (typeof maxFeePerGas !== "undefined" || typeof maxPriorityFeePerGas !== "undefined")) throw new FeeConflictError(); if (maxFeePerGas && maxFeePerGas > 2n ** 256n - 1n) throw new FeeCapTooHighError({ maxFeePerGas }); if (maxPriorityFeePerGas && maxFeePerGas && maxPriorityFeePerGas > maxFeePerGas) throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas }); } class BaseFeeScalarError extends BaseError { constructor() { super("`baseFeeMultiplier` must be greater than 1."); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "BaseFeeScalarError" }); } } class Eip1559FeesNotSupportedError extends BaseError { constructor() { super("Chain does not support EIP-1559 fees."); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "Eip1559FeesNotSupportedError" }); } } class MaxFeePerGasTooLowError extends BaseError { constructor({ maxPriorityFeePerGas }) { super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${formatGwei(maxPriorityFeePerGas)} gwei).`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "MaxFeePerGasTooLowError" }); } } class BlockNotFoundError extends BaseError { constructor({ blockHash, blockNumber }) { let identifier = "Block"; if (blockHash) identifier = `Block at hash "${blockHash}"`; if (blockNumber) identifier = `Block at number "${blockNumber}"`; super(`${identifier} could not be found.`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "BlockNotFoundError" }); } } async function getBlock(client, { blockHash, blockNumber, blockTag: blockTag_, includeTransactions: includeTransactions_ } = {}) { var _a2, _b2, _c2; const blockTag = blockTag_ ?? "latest"; const includeTransactions = includeTransactions_ ?? false; const blockNumberHex = blockNumber !== void 0 ? numberToHex$1(blockNumber) : void 0; let block = null; if (blockHash) { block = await client.request({ method: "eth_getBlockByHash", params: [blockHash, includeTransactions] }); } else { block = await client.request({ method: "eth_getBlockByNumber", params: [blockNumberHex || blockTag, includeTransactions] }); } if (!block) throw new BlockNotFoundError({ blockHash, blockNumber }); const format2 = ((_c2 = (_b2 = (_a2 = client.chain) == null ? void 0 : _a2.formatters) == null ? void 0 : _b2.block) == null ? void 0 : _c2.format) || formatBlock; return format2(block); } async function getGasPrice(client) { const gasPrice = await client.request({ method: "eth_gasPrice" }); return BigInt(gasPrice); } async function estimateMaxPriorityFeePerGas(client, args) { return internal_estimateMaxPriorityFeePerGas(client, args); } async function internal_estimateMaxPriorityFeePerGas(client, args) { var _a2, _b2, _c2; const { block: block_, chain = client.chain, request } = args || {}; if (typeof ((_a2 = chain == null ? void 0 : chain.fees) == null ? void 0 : _a2.defaultPriorityFee) === "function") { const block = block_ || await getAction(client, getBlock, "getBlock")({}); return chain.fees.defaultPriorityFee({ block, client, request }); } if (typeof ((_b2 = chain == null ? void 0 : chain.fees) == null ? void 0 : _b2.defaultPriorityFee) !== "undefined") return (_c2 = chain == null ? void 0 : chain.fees) == null ? void 0 : _c2.defaultPriorityFee; try { const maxPriorityFeePerGasHex = await client.request({ method: "eth_maxPriorityFeePerGas" }); return hexToBigInt$1(maxPriorityFeePerGasHex); } catch { const [block, gasPrice] = await Promise.all([ block_ ? Promise.resolve(block_) : getAction(client, getBlock, "getBlock")({}), getAction(client, getGasPrice, "getGasPrice")({}) ]); if (typeof block.baseFeePerGas !== "bigint") throw new Eip1559FeesNotSupportedError(); const maxPriorityFeePerGas = gasPrice - block.baseFeePerGas; if (maxPriorityFeePerGas < 0n) return 0n; return maxPriorityFeePerGas; } } async function estimateFeesPerGas(client, args) { return internal_estimateFeesPerGas(client, args); } async function internal_estimateFeesPerGas(client, args) { var _a2, _b2; const { block: block_, chain = client.chain, request, type: type2 = "eip1559" } = args || {}; const baseFeeMultiplier = await (async () => { var _a3, _b3; if (typeof ((_a3 = chain == null ? void 0 : chain.fees) == null ? void 0 : _a3.baseFeeMultiplier) === "function") return chain.fees.baseFeeMultiplier({ block: block_, client, request }); return ((_b3 = chain == null ? void 0 : chain.fees) == null ? void 0 : _b3.baseFeeMultiplier) ?? 1.2; })(); if (baseFeeMultiplier < 1) throw new BaseFeeScalarError(); const decimals = ((_a2 = baseFeeMultiplier.toString().split(".")[1]) == null ? void 0 : _a2.length) ?? 0; const denominator = 10 ** decimals; const multiply = (base3) => base3 * BigInt(Math.ceil(baseFeeMultiplier * denominator)) / BigInt(denominator); const block = block_ ? block_ : await getAction(client, getBlock, "getBlock")({}); if (typeof ((_b2 = chain == null ? void 0 : chain.fees) == null ? void 0 : _b2.estimateFeesPerGas) === "function") return chain.fees.estimateFeesPerGas({ block: block_, client, multiply, request, type: type2 }); if (type2 === "eip1559") { if (typeof block.baseFeePerGas !== "bigint") throw new Eip1559FeesNotSupportedError(); const maxPriorityFeePerGas = (request == null ? void 0 : request.maxPriorityFeePerGas) ? request.maxPriorityFeePerGas : await internal_estimateMaxPriorityFeePerGas(client, { block, chain, request }); const baseFeePerGas = multiply(block.baseFeePerGas); const maxFeePerGas = (request == null ? void 0 : request.maxFeePerGas) ?? baseFeePerGas + maxPriorityFeePerGas; return { maxFeePerGas, maxPriorityFeePerGas }; } const gasPrice = (request == null ? void 0 : request.gasPrice) ?? multiply(await getAction(client, getGasPrice, "getGasPrice")({})); return { gasPrice }; } async function getTransactionCount(client, { address, blockTag = "latest", blockNumber }) { const count = await client.request({ method: "eth_getTransactionCount", params: [address, blockNumber ? numberToHex$1(blockNumber) : blockTag] }); return hexToNumber$1(count); } function getTransactionType(transaction) { if (transaction.type) return transaction.type; if (typeof transaction.maxFeePerGas !== "undefined" || typeof transaction.maxPriorityFeePerGas !== "undefined") return "eip1559"; if (typeof transaction.gasPrice !== "undefined") { if (typeof transaction.accessList !== "undefined") return "eip2930"; return "legacy"; } throw new InvalidSerializableTransactionError({ transaction }); } async function prepareTransactionRequest(client, args) { const { account: account_ = client.account, chain, gas, nonce, type: type2 } = args; if (!account_) throw new AccountNotFoundError(); const account = parseAccount(account_); const block = await getAction(client, getBlock, "getBlock")({ blockTag: "latest" }); const request = { ...args, from: account.address }; if (typeof nonce === "undefined") request.nonce = await getAction(client, getTransactionCount, "getTransactionCount")({ address: account.address, blockTag: "pending" }); if (typeof type2 === "undefined") { try { request.type = getTransactionType(request); } catch { request.type = typeof block.baseFeePerGas === "bigint" ? "eip1559" : "legacy"; } } if (request.type === "eip1559") { const { maxFeePerGas, maxPriorityFeePerGas } = await internal_estimateFeesPerGas(client, { block, chain, request }); if (typeof args.maxPriorityFeePerGas === "undefined" && args.maxFeePerGas && args.maxFeePerGas < maxPriorityFeePerGas) throw new MaxFeePerGasTooLowError({ maxPriorityFeePerGas }); request.maxPriorityFeePerGas = maxPriorityFeePerGas; request.maxFeePerGas = maxFeePerGas; } else { if (typeof args.maxFeePerGas !== "undefined" || typeof args.maxPriorityFeePerGas !== "undefined") throw new Eip1559FeesNotSupportedError(); const { gasPrice: gasPrice_ } = await internal_estimateFeesPerGas(client, { block, chain, request, type: "legacy" }); request.gasPrice = gasPrice_; } if (typeof gas === "undefined") request.gas = await getAction(client, estimateGas, "estimateGas")({ ...request, account: { address: account.address, type: "json-rpc" } }); assertRequest(request); return request; } async function estimateGas(client, args) { var _a2, _b2, _c2; const account_ = args.account ?? client.account; if (!account_) throw new AccountNotFoundError({ docsPath: "/docs/actions/public/estimateGas" }); const account = parseAccount(account_); try { const { accessList, blockNumber, blockTag, data: data2, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to: to2, value, ...rest } = account.type === "local" ? await prepareTransactionRequest(client, args) : args; const blockNumberHex = blockNumber ? numberToHex$1(blockNumber) : void 0; const block = blockNumberHex || blockTag; assertRequest(args); const chainFormat = (_c2 = (_b2 = (_a2 = client.chain) == null ? void 0 : _a2.formatters) == null ? void 0 : _b2.transactionRequest) == null ? void 0 : _c2.format; const format2 = chainFormat || formatTransactionRequest; const request = format2({ // Pick out extra data that might exist on the chain's transaction request type. ...extract(rest, { format: chainFormat }), from: account.address, accessList, data: data2, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to: to2, value }); const balance = await client.request({ method: "eth_estimateGas", params: block ? [request, block] : [request] }); return BigInt(balance); } catch (err) { throw getEstimateGasError(err, { ...args, account, chain: client.chain }); } } async function estimateContractGas(client, { abi: abi2, address, args, functionName, ...request }) { const data2 = encodeFunctionData({ abi: abi2, args, functionName }); try { const gas = await getAction(client, estimateGas, "estimateGas")({ data: data2, to: address, ...request }); return gas; } catch (err) { const account = request.account ? parseAccount(request.account) : void 0; throw getContractError(err, { abi: abi2, address, args, docsPath: "/docs/contract/estimateContractGas", functionName, sender: account == null ? void 0 : account.address }); } } const docsPath$2 = "/docs/contract/decodeEventLog"; function decodeEventLog({ abi: abi2, data: data2, strict: strict_, topics }) { const strict = strict_ ?? true; const [signature, ...argTopics] = topics; if (!signature) throw new AbiEventSignatureEmptyTopicsError({ docsPath: docsPath$2 }); const abiItem = abi2.find((x2) => x2.type === "event" && signature === getEventSelector(formatAbiItem(x2))); if (!(abiItem && "name" in abiItem) || abiItem.type !== "event") throw new AbiEventSignatureNotFoundError(signature, { docsPath: docsPath$2 }); const { name: name2, inputs } = abiItem; const isUnnamed = inputs == null ? void 0 : inputs.some((x2) => !("name" in x2 && x2.name)); let args = isUnnamed ? [] : {}; const indexedInputs = inputs.filter((x2) => "indexed" in x2 && x2.indexed); for (let i2 = 0; i2 < indexedInputs.length; i2++) { const param = indexedInputs[i2]; const topic = argTopics[i2]; if (!topic) throw new DecodeLogTopicsMismatch({ abiItem, param }); args[param.name || i2] = decodeTopic({ param, value: topic }); } const nonIndexedInputs = inputs.filter((x2) => !("indexed" in x2 && x2.indexed)); if (nonIndexedInputs.length > 0) { if (data2 && data2 !== "0x") { try { const decodedData = decodeAbiParameters(nonIndexedInputs, data2); if (decodedData) { if (isUnnamed) args = [...args, ...decodedData]; else { for (let i2 = 0; i2 < nonIndexedInputs.length; i2++) { args[nonIndexedInputs[i2].name] = decodedData[i2]; } } } } catch (err) { if (strict) { if (err instanceof AbiDecodingDataSizeTooSmallError) throw new DecodeLogDataMismatch({ abiItem, data: err.data, params: err.params, size: err.size }); throw err; } } } else if (strict) { throw new DecodeLogDataMismatch({ abiItem, data: "0x", params: nonIndexedInputs, size: 0 }); } } return { eventName: name2, args: Object.values(args).length > 0 ? args : void 0 }; } function decodeTopic({ param, value }) { if (param.type === "string" || param.type === "bytes" || param.type === "tuple" || param.type.match(/^(.*)\[(\d+)?\]$/)) return value; const decodedArg = decodeAbiParameters([param], value) || []; return decodedArg[0]; } async function getLogs(client, { address, blockHash, fromBlock, toBlock, event, events: events_, args, strict: strict_ } = {}) { const strict = strict_ ?? false; const events2 = events_ ?? (event ? [event] : void 0); let topics = []; if (events2) { topics = [ events2.flatMap((event2) => encodeEventTopics({ abi: [event2], eventName: event2.name, args })) ]; if (event) topics = topics[0]; } let logs; if (blockHash) { logs = await client.request({ method: "eth_getLogs", params: [{ address, topics, blockHash }] }); } else { logs = await client.request({ method: "eth_getLogs", params: [ { address, topics, fromBlock: typeof fromBlock === "bigint" ? numberToHex$1(fromBlock) : fromBlock, toBlock: typeof toBlock === "bigint" ? numberToHex$1(toBlock) : toBlock } ] }); } return logs.map((log2) => { var _a2; try { const { eventName, args: args2 } = events2 ? decodeEventLog({ abi: events2, data: log2.data, topics: log2.topics, strict }) : { eventName: void 0, args: void 0 }; return formatLog(log2, { args: args2, eventName }); } catch (err) { let eventName; let isUnnamed; if (err instanceof DecodeLogDataMismatch || err instanceof DecodeLogTopicsMismatch) { if (strict) return; eventName = err.abiItem.name; isUnnamed = (_a2 = err.abiItem.inputs) == null ? void 0 : _a2.some((x2) => !("name" in x2 && x2.name)); } return formatLog(log2, { args: isUnnamed ? [] : {}, eventName }); } }).filter(Boolean); } async function getContractEvents(client, { abi: abi2, address, args, blockHash, eventName, fromBlock, toBlock, strict }) { const event = eventName ? getAbiItem({ abi: abi2, name: eventName }) : void 0; const events2 = !event ? abi2.filter((x2) => x2.type === "event") : void 0; return getAction(client, getLogs, "getLogs")({ address, args, blockHash, event, events: events2, fromBlock, toBlock, strict }); } const docsPath$1 = "/docs/contract/decodeFunctionResult"; function decodeFunctionResult({ abi: abi2, args, functionName, data: data2 }) { let abiItem = abi2[0]; if (functionName) { abiItem = getAbiItem({ abi: abi2, args, name: functionName }); if (!abiItem) throw new AbiFunctionNotFoundError(functionName, { docsPath: docsPath$1 }); } if (abiItem.type !== "function") throw new AbiFunctionNotFoundError(void 0, { docsPath: docsPath$1 }); if (!abiItem.outputs) throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath: docsPath$1 }); const values = decodeAbiParameters(abiItem.outputs, data2); if (values && values.length > 1) return values; if (values && values.length === 1) return values[0]; return void 0; } const multicall3Abi = [ { 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" } ]; const universalResolverErrors = [ { inputs: [], name: "ResolverNotFound", type: "error" }, { inputs: [], name: "ResolverWildcardNotSupported", type: "error" } ]; const universalResolverResolveAbi = [ ...universalResolverErrors, { name: "resolve", type: "function", stateMutability: "view", inputs: [ { name: "name", type: "bytes" }, { name: "data", type: "bytes" } ], outputs: [ { name: "", type: "bytes" }, { name: "address", type: "address" } ] } ]; const universalResolverReverseAbi = [ ...universalResolverErrors, { 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" } ] } ]; const textResolverAbi = [ { name: "text", type: "function", stateMutability: "view", inputs: [ { name: "name", type: "bytes32" }, { name: "key", type: "string" } ], outputs: [{ name: "", type: "string" }] } ]; const addressResolverAbi = [ { 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" }] } ]; const universalSignatureValidatorAbi = [ { inputs: [ { internalType: "address", name: "_signer", type: "address" }, { internalType: "bytes32", name: "_hash", type: "bytes32" }, { internalType: "bytes", name: "_signature", type: "bytes" } ], stateMutability: "nonpayable", type: "constructor" } ]; const aggregate3Signature = "0x82ad56cb"; function getChainContractAddress({ blockNumber, chain, contract: name2 }) { var _a2; const contract = (_a2 = chain == null ? void 0 : chain.contracts) == null ? void 0 : _a2[name2]; if (!contract) throw new ChainDoesNotSupportContract({ chain, contract: { name: name2 } }); if (blockNumber && contract.blockCreated && contract.blockCreated > blockNumber) throw new ChainDoesNotSupportContract({ blockNumber, chain, contract: { name: name2, blockCreated: contract.blockCreated } }); return contract.address; } function getCallError(err, { docsPath: docsPath2, ...args }) { const cause = (() => { const cause2 = getNodeError(err, args); if (cause2 instanceof UnknownNodeError) return err; return cause2; })(); return new CallExecutionError(cause, { docsPath: docsPath2, ...args }); } const schedulerCache = /* @__PURE__ */ new Map(); function createBatchScheduler({ fn: fn2, id: id2, shouldSplitBatch, wait: wait2 = 0, sort: sort2 }) { const exec = async () => { const scheduler = getScheduler(); flush(); const args = scheduler.map(({ args: args2 }) => args2); if (args.length === 0) return; fn2(args).then((data2) => { var _a2; if (sort2 && Array.isArray(data2)) data2.sort(sort2); for (let i2 = 0; i2 < scheduler.length; i2++) { const { pendingPromise } = scheduler[i2]; (_a2 = pendingPromise.resolve) == null ? void 0 : _a2.call(pendingPromise, [data2[i2], data2]); } }).catch((err) => { var _a2; for (let i2 = 0; i2 < scheduler.length; i2++) { const { pendingPromise } = scheduler[i2]; (_a2 = pendingPromise.reject) == null ? void 0 : _a2.call(pendingPromise, err); } }); }; const flush = () => schedulerCache.delete(id2); const getBatchedArgs = () => getScheduler().map(({ args }) => args); const getScheduler = () => schedulerCache.get(id2) || []; const setScheduler = (item) => schedulerCache.set(id2, [...getScheduler(), item]); return { flush, async schedule(args) { const pendingPromise = {}; const promise = new Promise((resolve, reject) => { pendingPromise.resolve = resolve; pendingPromise.reject = reject; }); const split2 = shouldSplitBatch == null ? void 0 : shouldSplitBatch([...getBatchedArgs(), args]); if (split2) exec(); const hasActiveScheduler = getScheduler().length > 0; if (hasActiveScheduler) { setScheduler({ args, pendingPromise }); return promise; } setScheduler({ args, pendingPromise }); setTimeout(exec, wait2); return promise; } }; } async function call$1(client, args) { var _a2, _b2, _c2, _d; const { account: account_ = client.account, batch = Boolean((_a2 = client.batch) == null ? void 0 : _a2.multicall), blockNumber, blockTag = "latest", accessList, data: data2, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to: to2, value, ...rest } = args; const account = account_ ? parseAccount(account_) : void 0; try { assertRequest(args); const blockNumberHex = blockNumber ? numberToHex$1(blockNumber) : void 0; const block = blockNumberHex || blockTag; const chainFormat = (_d = (_c2 = (_b2 = client.chain) == null ? void 0 : _b2.formatters) == null ? void 0 : _c2.transactionRequest) == null ? void 0 : _d.format; const format2 = chainFormat || formatTransactionRequest; const request = format2({ // Pick out extra data that might exist on the chain's transaction request type. ...extract(rest, { format: chainFormat }), from: account == null ? void 0 : account.address, accessList, data: data2, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to: to2, value }); if (batch && shouldPerformMulticall({ request })) { try { return await scheduleMulticall(client, { ...request, blockNumber, blockTag }); } catch (err) { if (!(err instanceof ClientChainNotConfiguredError) && !(err instanceof ChainDoesNotSupportContract)) throw err; } } const response = await client.request({ method: "eth_call", params: block ? [request, block] : [request] }); if (response === "0x") return { data: void 0 }; return { data: response }; } catch (err) { const data3 = getRevertErrorData(err); const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await Promise.resolve().then(() => ccip); if ((data3 == null ? void 0 : data3.slice(0, 10)) === offchainLookupSignature2 && to2) { return { data: await offchainLookup2(client, { data: data3, to: to2 }) }; } throw getCallError(err, { ...args, account, chain: client.chain }); } } function shouldPerformMulticall({ request }) { const { data: data2, to: to2, ...request_ } = request; if (!data2) return false; if (data2.startsWith(aggregate3Signature)) return false; if (!to2) return false; if (Object.values(request_).filter((x2) => typeof x2 !== "undefined").length > 0) return false; return true; } async function scheduleMulticall(client, args) { var _a2; const { batchSize = 1024, wait: wait2 = 0 } = typeof ((_a2 = client.batch) == null ? void 0 : _a2.multicall) === "object" ? client.batch.multicall : {}; const { blockNumber, blockTag = "latest", data: data2, multicallAddress: multicallAddress_, to: to2 } = args; let multicallAddress = multicallAddress_; if (!multicallAddress) { if (!client.chain) throw new ClientChainNotConfiguredError(); multicallAddress = getChainContractAddress({ blockNumber, chain: client.chain, contract: "multicall3" }); } const blockNumberHex = blockNumber ? numberToHex$1(blockNumber) : void 0; const block = blockNumberHex || blockTag; const { schedule } = createBatchScheduler({ id: `${client.uid}.${block}`, wait: wait2, shouldSplitBatch(args2) { const size2 = args2.reduce((size3, { data: data3 }) => size3 + (data3.length - 2), 0); return size2 > batchSize * 2; }, fn: async (requests) => { const calls = requests.map((request) => ({ allowFailure: true, callData: request.data, target: request.to })); const calldata = encodeFunctionData({ abi: multicall3Abi, args: [calls], functionName: "aggregate3" }); const data3 = await client.request({ method: "eth_call", params: [ { data: calldata, to: multicallAddress }, block ] }); return decodeFunctionResult({ abi: multicall3Abi, args: [calls], functionName: "aggregate3", data: data3 || "0x" }); } }); const [{ returnData, success }] = await schedule({ data: data2, to: to2 }); if (!success) throw new RawContractError({ data: returnData }); if (returnData === "0x") return { data: void 0 }; return { data: returnData }; } function getRevertErrorData(err) { if (!(err instanceof BaseError)) return void 0; const error2 = err.walk(); return typeof error2.data === "object" ? error2.data.data : error2.data; } async function readContract$1(client, { abi: abi2, address, args, functionName, ...callRequest }) { const calldata = encodeFunctionData({ abi: abi2, args, functionName }); try { const { data: data2 } = await getAction(client, call$1, "call")({ data: calldata, to: address, ...callRequest }); return decodeFunctionResult({ abi: abi2, args, functionName, data: data2 || "0x" }); } catch (err) { throw getContractError(err, { abi: abi2, address, args, docsPath: "/docs/contract/readContract", functionName }); } } async function simulateContract(client, { abi: abi2, address, args, dataSuffix, functionName, ...callRequest }) { const account = callRequest.account ? parseAccount(callRequest.account) : void 0; const calldata = encodeFunctionData({ abi: abi2, args, functionName }); try { const { data: data2 } = await getAction(client, call$1, "call")({ batch: false, data: `${calldata}${dataSuffix ? dataSuffix.replace("0x", "") : ""}`, to: address, ...callRequest }); const result = decodeFunctionResult({ abi: abi2, args, functionName, data: data2 || "0x" }); return { result, request: { abi: abi2, address, args, dataSuffix, functionName, ...callRequest } }; } catch (err) { throw getContractError(err, { abi: abi2, address, args, docsPath: "/docs/contract/simulateContract", functionName, sender: account == null ? void 0 : account.address }); } } const listenersCache = /* @__PURE__ */ new Map(); const cleanupCache = /* @__PURE__ */ new Map(); let callbackCount = 0; function observe(observerId, callbacks, fn2) { const callbackId = ++callbackCount; const getListeners = () => listenersCache.get(observerId) || []; const unsubscribe = () => { const listeners2 = getListeners(); listenersCache.set(observerId, listeners2.filter((cb) => cb.id !== callbackId)); }; const unwatch = () => { const cleanup2 = cleanupCache.get(observerId); if (getListeners().length === 1 && cleanup2) cleanup2(); unsubscribe(); }; const listeners = getListeners(); listenersCache.set(observerId, [ ...listeners, { id: callbackId, fns: callbacks } ]); if (listeners && listeners.length > 0) return unwatch; const emit = {}; for (const key in callbacks) { emit[key] = (...args) => { var _a2, _b2; const listeners2 = getListeners(); if (listeners2.length === 0) return; for (const listener of listeners2) (_b2 = (_a2 = listener.fns)[key]) == null ? void 0 : _b2.call(_a2, ...args); }; } const cleanup = fn2(emit); if (typeof cleanup === "function") cleanupCache.set(observerId, cleanup); return unwatch; } async function wait(time2) { return new Promise((res) => setTimeout(res, time2)); } function poll(fn2, { emitOnBegin, initialWaitTime, interval }) { let active = true; const unwatch = () => active = false; const watch2 = async () => { let data2 = void 0; if (emitOnBegin) data2 = await fn2({ unpoll: unwatch }); const initialWait = await (initialWaitTime == null ? void 0 : initialWaitTime(data2)) ?? interval; await wait(initialWait); const poll2 = async () => { if (!active) return; await fn2({ unpoll: unwatch }); await wait(interval); poll2(); }; poll2(); }; watch2(); return unwatch; } const promiseCache = /* @__PURE__ */ new Map(); const responseCache = /* @__PURE__ */ new Map(); function getCache(cacheKey2) { const buildCache = (cacheKey3, cache) => ({ clear: () => cache.delete(cacheKey3), get: () => cache.get(cacheKey3), set: (data2) => cache.set(cacheKey3, data2) }); const promise = buildCache(cacheKey2, promiseCache); const response = buildCache(cacheKey2, responseCache); return { clear: () => { promise.clear(); response.clear(); }, promise, response }; } async function withCache(fn2, { cacheKey: cacheKey2, cacheTime = Infinity }) { const cache = getCache(cacheKey2); const response = cache.response.get(); if (response && cacheTime > 0) { const age = (/* @__PURE__ */ new Date()).getTime() - response.created.getTime(); if (age < cacheTime) return response.data; } let promise = cache.promise.get(); if (!promise) { promise = fn2(); cache.promise.set(promise); } try { const data2 = await promise; cache.response.set({ created: /* @__PURE__ */ new Date(), data: data2 }); return data2; } finally { cache.promise.clear(); } } const cacheKey = (id2) => `blockNumber.${id2}`; async function getBlockNumber(client, { cacheTime = client.cacheTime, maxAge } = {}) { const blockNumberHex = await withCache(() => client.request({ method: "eth_blockNumber" }), { cacheKey: cacheKey(client.uid), cacheTime: maxAge ?? cacheTime }); return BigInt(blockNumberHex); } async function getFilterChanges(_client2, { filter }) { const strict = "strict" in filter && filter.strict; const logs = await filter.request({ method: "eth_getFilterChanges", params: [filter.id] }); return logs.map((log2) => { var _a2; if (typeof log2 === "string") return log2; try { const { eventName, args } = "abi" in filter && filter.abi ? decodeEventLog({ abi: filter.abi, data: log2.data, topics: log2.topics, strict }) : { eventName: void 0, args: void 0 }; return formatLog(log2, { args, eventName }); } catch (err) { let eventName; let isUnnamed; if (err instanceof DecodeLogDataMismatch || err instanceof DecodeLogTopicsMismatch) { if ("strict" in filter && filter.strict) return; eventName = err.abiItem.name; isUnnamed = (_a2 = err.abiItem.inputs) == null ? void 0 : _a2.some((x2) => !("name" in x2 && x2.name)); } return formatLog(log2, { args: isUnnamed ? [] : {}, eventName }); } }).filter(Boolean); } async function uninstallFilter(_client2, { filter }) { return filter.request({ method: "eth_uninstallFilter", params: [filter.id] }); } function watchContractEvent(client, { abi: abi2, address, args, batch = true, eventName, onError, onLogs, poll: poll_, pollingInterval = client.pollingInterval, strict: strict_ }) { const enablePolling = typeof poll_ !== "undefined" ? poll_ : client.transport.type !== "webSocket"; const pollContractEvent = () => { const observerId = stringify$2([ "watchContractEvent", address, args, batch, client.uid, eventName, pollingInterval ]); const strict = strict_ ?? false; return observe(observerId, { onLogs, onError }, (emit) => { let previousBlockNumber; let filter; let initialized = false; const unwatch = poll(async () => { var _a2; if (!initialized) { try { filter = await getAction(client, createContractEventFilter, "createContractEventFilter")({ abi: abi2, address, args, eventName, strict }); } catch { } initialized = true; return; } try { let logs; if (filter) { logs = await getAction(client, getFilterChanges, "getFilterChanges")({ filter }); } else { const blockNumber = await getAction(client, getBlockNumber, "getBlockNumber")({}); if (previousBlockNumber && previousBlockNumber !== blockNumber) { logs = await getAction(client, getContractEvents, "getContractEvents")({ abi: abi2, address, args, eventName, fromBlock: previousBlockNumber + 1n, toBlock: blockNumber, strict }); } else { logs = []; } previousBlockNumber = blockNumber; } if (logs.length === 0) return; if (batch) emit.onLogs(logs); else for (const log2 of logs) emit.onLogs([log2]); } catch (err) { if (filter && err instanceof InvalidInputRpcError) initialized = false; (_a2 = emit.onError) == null ? void 0 : _a2.call(emit, err); } }, { emitOnBegin: true, interval: pollingInterval }); return async () => { if (filter) await getAction(client, uninstallFilter, "uninstallFilter")({ filter }); unwatch(); }; }); }; const subscribeContractEvent = () => { let active = true; let unsubscribe = () => active = false; (async () => { try { const topics = eventName ? encodeEventTopics({ abi: abi2, eventName, args }) : []; const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({ params: ["logs", { address, topics }], onData(data2) { var _a2; if (!active) return; const log2 = data2.result; try { const { eventName: eventName2, args: args2 } = decodeEventLog({ abi: abi2, data: log2.data, topics: log2.topics, strict: strict_ }); const formatted = formatLog(log2, { args: args2, eventName: eventName2 }); onLogs([formatted]); } catch (err) { let eventName2; let isUnnamed; if (err instanceof DecodeLogDataMismatch || err instanceof DecodeLogTopicsMismatch) { if (strict_) return; eventName2 = err.abiItem.name; isUnnamed = (_a2 = err.abiItem.inputs) == null ? void 0 : _a2.some((x2) => !("name" in x2 && x2.name)); } const formatted = formatLog(log2, { args: isUnnamed ? [] : {}, eventName: eventName2 }); onLogs([formatted]); } }, onError(error2) { onError == null ? void 0 : onError(error2); } }); unsubscribe = unsubscribe_; if (!active) unsubscribe(); } catch (err) { onError == null ? void 0 : onError(err); } })(); return unsubscribe; }; return enablePolling ? pollContractEvent() : subscribeContractEvent(); } function assertCurrentChain({ chain, currentChainId }) { if (!chain) throw new ChainNotFoundError(); if (currentChainId !== chain.id) throw new ChainMismatchError({ chain, currentChainId }); } function getTransactionError(err, { docsPath: docsPath2, ...args }) { const cause = (() => { const cause2 = getNodeError(err, args); if (cause2 instanceof UnknownNodeError) return err; return cause2; })(); return new TransactionExecutionError(cause, { docsPath: docsPath2, ...args }); } async function getChainId(client) { const chainIdHex = await client.request({ method: "eth_chainId" }); return hexToNumber$1(chainIdHex); } async function sendRawTransaction(client, { serializedTransaction }) { return client.request({ method: "eth_sendRawTransaction", params: [serializedTransaction] }); } async function sendTransaction(client, args) { var _a2, _b2, _c2, _d; const { account: account_ = client.account, chain = client.chain, accessList, data: data2, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to: to2, value, ...rest } = args; if (!account_) throw new AccountNotFoundError({ docsPath: "/docs/actions/wallet/sendTransaction" }); const account = parseAccount(account_); try { assertRequest(args); let chainId; if (chain !== null) { chainId = await getAction(client, getChainId, "getChainId")({}); assertCurrentChain({ currentChainId: chainId, chain }); } if (account.type === "local") { const request2 = await getAction(client, prepareTransactionRequest, "prepareTransactionRequest")({ account, accessList, chain, data: data2, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to: to2, value, ...rest }); if (!chainId) chainId = await getAction(client, getChainId, "getChainId")({}); const serializer = (_a2 = chain == null ? void 0 : chain.serializers) == null ? void 0 : _a2.transaction; const serializedTransaction = await account.signTransaction({ ...request2, chainId }, { serializer }); return await getAction(client, sendRawTransaction, "sendRawTransaction")({ serializedTransaction }); } const chainFormat = (_d = (_c2 = (_b2 = client.chain) == null ? void 0 : _b2.formatters) == null ? void 0 : _c2.transactionRequest) == null ? void 0 : _d.format; const format2 = chainFormat || formatTransactionRequest; const request = format2({ // Pick out extra data that might exist on the chain's transaction request type. ...extract(rest, { format: chainFormat }), accessList, data: data2, from: account.address, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to: to2, value }); return await client.request({ method: "eth_sendTransaction", params: [request] }); } catch (err) { throw getTransactionError(err, { ...args, account, chain: args.chain || void 0 }); } } async function writeContract(client, { abi: abi2, address, args, dataSuffix, functionName, ...request }) { const data2 = encodeFunctionData({ abi: abi2, args, functionName }); const hash2 = await getAction(client, sendTransaction, "sendTransaction")({ data: `${data2}${dataSuffix ? dataSuffix.replace("0x", "") : ""}`, to: address, ...request }); return hash2; } async function addChain(client, { chain }) { const { id: id2, name: name2, nativeCurrency, rpcUrls, blockExplorers } = chain; await client.request({ method: "wallet_addEthereumChain", params: [ { chainId: numberToHex$1(id2), chainName: name2, nativeCurrency, rpcUrls: rpcUrls.default.http, blockExplorerUrls: blockExplorers ? Object.values(blockExplorers).map(({ url }) => url) : void 0 } ] }); } const size$1 = 256; let index$7 = size$1; let buffer$1; function uid(length = 11) { if (!buffer$1 || index$7 + length > size$1 * 2) { buffer$1 = ""; index$7 = 0; for (let i2 = 0; i2 < size$1; i2++) { buffer$1 += (256 + Math.random() * 256 | 0).toString(16).substring(1); } } return buffer$1.substring(index$7, index$7++ + length); } function createClient(parameters) { const { batch, cacheTime = parameters.pollingInterval ?? 4e3, key = "base", name: name2 = "Base Client", pollingInterval = 4e3, type: type2 = "base" } = parameters; const chain = parameters.chain; const account = parameters.account ? parseAccount(parameters.account) : void 0; const { config: config2, request, value } = parameters.transport({ chain, pollingInterval }); const transport = { ...config2, ...value }; const client = { account, batch, cacheTime, chain, key, name: name2, pollingInterval, request, transport, type: type2, uid: uid() }; function extend2(base3) { return (extendFn) => { const extended = extendFn(base3); for (const key2 in client) delete extended[key2]; const combined = { ...base3, ...extended }; return Object.assign(combined, { extend: extend2(combined) }); }; } return Object.assign(client, { extend: extend2(client) }); } function withRetry(fn2, { delay: delay_ = 100, retryCount = 2, shouldRetry = () => true } = {}) { return new Promise((resolve, reject) => { const attemptRetry = async ({ count = 0 } = {}) => { const retry = async ({ error: error2 }) => { const delay2 = typeof delay_ === "function" ? delay_({ count, error: error2 }) : delay_; if (delay2) await wait(delay2); attemptRetry({ count: count + 1 }); }; try { const data2 = await fn2(); resolve(data2); } catch (err) { if (count < retryCount && await shouldRetry({ count, error: err })) return retry({ error: err }); reject(err); } }; attemptRetry(); }); } const isDeterministicError = (error2) => { if ("code" in error2) return error2.code !== -1 && error2.code !== -32004 && error2.code !== -32005 && error2.code !== -32042 && error2.code !== -32603; if (error2 instanceof HttpRequestError && error2.status) return error2.status !== 403 && error2.status !== 408 && error2.status !== 413 && error2.status !== 429 && error2.status !== 500 && error2.status !== 502 && error2.status !== 503 && error2.status !== 504; return false; }; function buildRequest(request, { retryDelay = 150, retryCount = 3 } = {}) { return async (args) => withRetry(async () => { try { return await request(args); } catch (err_) { const err = err_; switch (err.code) { case ParseRpcError.code: throw new ParseRpcError(err); case InvalidRequestRpcError.code: throw new InvalidRequestRpcError(err); case MethodNotFoundRpcError.code: throw new MethodNotFoundRpcError(err); case InvalidParamsRpcError.code: throw new InvalidParamsRpcError(err); case InternalRpcError.code: throw new InternalRpcError(err); case InvalidInputRpcError.code: throw new InvalidInputRpcError(err); case ResourceNotFoundRpcError.code: throw new ResourceNotFoundRpcError(err); case ResourceUnavailableRpcError.code: throw new ResourceUnavailableRpcError(err); case TransactionRejectedRpcError.code: throw new TransactionRejectedRpcError(err); case MethodNotSupportedRpcError.code: throw new MethodNotSupportedRpcError(err); case LimitExceededRpcError.code: throw new LimitExceededRpcError(err); case JsonRpcVersionUnsupportedError.code: throw new JsonRpcVersionUnsupportedError(err); case UserRejectedRequestError.code: throw new UserRejectedRequestError(err); case UnauthorizedProviderError.code: throw new UnauthorizedProviderError(err); case UnsupportedProviderMethodError.code: throw new UnsupportedProviderMethodError(err); case ProviderDisconnectedError.code: throw new ProviderDisconnectedError(err); case ChainDisconnectedError.code: throw new ChainDisconnectedError(err); case SwitchChainError.code: throw new SwitchChainError(err); case 5e3: throw new UserRejectedRequestError(err); default: if (err_ instanceof BaseError) throw err_; throw new UnknownRpcError(err); } } }, { delay: ({ count, error: error2 }) => { var _a2; if (error2 && error2 instanceof HttpRequestError) { const retryAfter = (_a2 = error2 == null ? void 0 : error2.headers) == null ? void 0 : _a2.get("Retry-After"); if (retryAfter == null ? void 0 : retryAfter.match(/\d/)) return parseInt(retryAfter) * 1e3; } return ~~(1 << count) * retryDelay; }, retryCount, shouldRetry: ({ error: error2 }) => !isDeterministicError(error2) }); } function createTransport({ key, name: name2, request, retryCount = 3, retryDelay = 150, timeout: timeout2, type: type2 }, value) { return { config: { key, name: name2, request, retryCount, retryDelay, timeout: timeout2, type: type2 }, request: buildRequest(request, { retryCount, retryDelay }), value }; } function custom$1(provider, config2 = {}) { const { key = "custom", name: name2 = "Custom Provider", retryDelay } = config2; return ({ retryCount: defaultRetryCount }) => createTransport({ key, name: name2, request: provider.request.bind(provider), retryCount: config2.retryCount ?? defaultRetryCount, retryDelay, type: "custom" }); } function fallback(transports_, config2 = {}) { const { key = "fallback", name: name2 = "Fallback", rank = false, retryCount, retryDelay } = config2; return ({ chain, pollingInterval = 4e3, timeout: timeout2 }) => { let transports = transports_; let onResponse = () => { }; const transport = createTransport({ key, name: name2, async request({ method, params }) { const fetch2 = async (i2 = 0) => { const transport2 = transports[i2]({ chain, retryCount: 0, timeout: timeout2 }); try { const response = await transport2.request({ method, params }); onResponse({ method, params, response, transport: transport2, status: "success" }); return response; } catch (err) { onResponse({ error: err, method, params, transport: transport2, status: "error" }); if (isDeterministicError(err)) throw err; if (i2 === transports.length - 1) throw err; return fetch2(i2 + 1); } }; return fetch2(); }, retryCount, retryDelay, type: "fallback" }, { onResponse: (fn2) => onResponse = fn2, transports: transports.map((fn2) => fn2({ chain, retryCount: 0 })) }); if (rank) { const rankOptions = typeof rank === "object" ? rank : {}; rankTransports({ chain, interval: rankOptions.interval ?? pollingInterval, onTransports: (transports_2) => transports = transports_2, sampleCount: rankOptions.sampleCount, timeout: rankOptions.timeout, transports, weights: rankOptions.weights }); } return transport; }; } function rankTransports({ chain, interval = 4e3, onTransports, sampleCount = 10, timeout: timeout2 = 1e3, transports, weights = {} }) { const { stability: stabilityWeight = 0.7, latency: latencyWeight = 0.3 } = weights; const samples = []; const rankTransports_ = async () => { const sample = await Promise.all(transports.map(async (transport) => { const transport_ = transport({ chain, retryCount: 0, timeout: timeout2 }); const start = Date.now(); let end; let success; try { await transport_.request({ method: "net_listening" }); success = 1; } catch { success = 0; } finally { end = Date.now(); } const latency = end - start; return { latency, success }; })); samples.push(sample); if (samples.length > sampleCount) samples.shift(); const maxLatency = Math.max(...samples.map((sample2) => Math.max(...sample2.map(({ latency }) => latency)))); const scores = transports.map((_2, i2) => { const latencies = samples.map((sample2) => sample2[i2].latency); const meanLatency = latencies.reduce((acc, latency) => acc + latency, 0) / latencies.length; const latencyScore = 1 - meanLatency / maxLatency; const successes = samples.map((sample2) => sample2[i2].success); const stabilityScore = successes.reduce((acc, success) => acc + success, 0) / successes.length; if (stabilityScore === 0) return [0, i2]; return [ latencyWeight * latencyScore + stabilityWeight * stabilityScore, i2 ]; }).sort((a2, b2) => b2[0] - a2[0]); onTransports(scores.map(([, i2]) => transports[i2])); await wait(interval); rankTransports_(); }; rankTransports_(); } class UrlRequiredError extends BaseError { constructor() { super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.", { docsPath: "/docs/clients/intro" }); } } function getNativeWebSocket() { if (typeof WebSocket !== "undefined") return WebSocket; if (typeof global.WebSocket !== "undefined") return global.WebSocket; if (typeof window.WebSocket !== "undefined") return window.WebSocket; if (typeof self.WebSocket !== "undefined") return self.WebSocket; throw new Error("`WebSocket` is not supported in this environment"); } const WebSocket$1 = getNativeWebSocket(); function withTimeout$2(fn2, { errorInstance = new Error("timed out"), timeout: timeout2, signal }) { return new Promise((resolve, reject) => { (async () => { let timeoutId; try { const controller = new AbortController(); if (timeout2 > 0) { timeoutId = setTimeout(() => { if (signal) { controller.abort(); } else { reject(errorInstance); } }, timeout2); } resolve(await fn2({ signal: controller == null ? void 0 : controller.signal })); } catch (err) { if (err.name === "AbortError") reject(errorInstance); reject(err); } finally { clearTimeout(timeoutId); } })(); }); } let id = 0; async function http$1(url, { body, fetchOptions = {}, timeout: timeout2 = 1e4 }) { var _a2; const { headers, method, signal: signal_ } = fetchOptions; try { const response = await withTimeout$2(async ({ signal }) => { const response2 = await fetch(url, { ...fetchOptions, body: Array.isArray(body) ? stringify$2(body.map((body2) => ({ jsonrpc: "2.0", id: body2.id ?? id++, ...body2 }))) : stringify$2({ jsonrpc: "2.0", id: body.id ?? id++, ...body }), headers: { ...headers, "Content-Type": "application/json" }, method: method || "POST", signal: signal_ || (timeout2 > 0 ? signal : void 0) }); return response2; }, { errorInstance: new TimeoutError({ body, url }), timeout: timeout2, signal: true }); let data2; if ((_a2 = response.headers.get("Content-Type")) == null ? void 0 : _a2.startsWith("application/json")) { data2 = await response.json(); } else { data2 = await response.text(); } if (!response.ok) { throw new HttpRequestError({ body, details: stringify$2(data2.error) || response.statusText, headers: response.headers, status: response.status, url }); } return data2; } catch (err) { if (err instanceof HttpRequestError) throw err; if (err instanceof TimeoutError) throw err; throw new HttpRequestError({ body, details: err.message, url }); } } const socketsCache = /* @__PURE__ */ new Map(); async function getSocket(url) { let socket = socketsCache.get(url); if (socket) return socket; const { schedule } = createBatchScheduler({ id: url, fn: async () => { const webSocket2 = new WebSocket$1(url); const requests = /* @__PURE__ */ new Map(); const subscriptions = /* @__PURE__ */ new Map(); const onMessage = ({ data: data2 }) => { const message = JSON.parse(data2); const isSubscription = message.method === "eth_subscription"; const id2 = isSubscription ? message.params.subscription : message.id; const cache = isSubscription ? subscriptions : requests; const callback = cache.get(id2); if (callback) callback({ data: data2 }); if (!isSubscription) cache.delete(id2); }; const onClose = () => { socketsCache.delete(url); webSocket2.removeEventListener("close", onClose); webSocket2.removeEventListener("message", onMessage); }; webSocket2.addEventListener("close", onClose); webSocket2.addEventListener("message", onMessage); if (webSocket2.readyState === WebSocket$1.CONNECTING) { await new Promise((resolve, reject) => { if (!webSocket2) return; webSocket2.onopen = resolve; webSocket2.onerror = reject; }); } socket = Object.assign(webSocket2, { requests, subscriptions }); socketsCache.set(url, socket); return [socket]; } }); const [_2, [socket_]] = await schedule(); return socket_; } function webSocket$1(socket, { body, onResponse }) { if (socket.readyState === socket.CLOSED || socket.readyState === socket.CLOSING) throw new WebSocketRequestError({ body, url: socket.url, details: "Socket is closed." }); const id_ = id++; const callback = ({ data: data2 }) => { var _a2; const message = JSON.parse(data2); if (typeof message.id === "number" && id_ !== message.id) return; onResponse == null ? void 0 : onResponse(message); if (body.method === "eth_subscribe" && typeof message.result === "string") { socket.subscriptions.set(message.result, callback); } if (body.method === "eth_unsubscribe") { socket.subscriptions.delete((_a2 = body.params) == null ? void 0 : _a2[0]); } }; socket.requests.set(id_, callback); socket.send(JSON.stringify({ jsonrpc: "2.0", ...body, id: id_ })); return socket; } async function webSocketAsync(socket, { body, timeout: timeout2 = 1e4 }) { return withTimeout$2(() => new Promise((onResponse) => rpc.webSocket(socket, { body, onResponse })), { errorInstance: new TimeoutError({ body, url: socket.url }), timeout: timeout2 }); } const rpc = { http: http$1, webSocket: webSocket$1, webSocketAsync }; function http(url, config2 = {}) { const { batch, fetchOptions, key = "http", name: name2 = "HTTP JSON-RPC", retryDelay } = config2; return ({ chain, retryCount: retryCount_, timeout: timeout_ }) => { const { batchSize = 1e3, wait: wait2 = 0 } = typeof batch === "object" ? batch : {}; const retryCount = config2.retryCount ?? retryCount_; const timeout2 = timeout_ ?? config2.timeout ?? 1e4; const url_ = url || (chain == null ? void 0 : chain.rpcUrls.default.http[0]); if (!url_) throw new UrlRequiredError(); return createTransport({ key, name: name2, async request({ method, params }) { const body = { method, params }; const { schedule } = createBatchScheduler({ id: `${url}`, wait: wait2, shouldSplitBatch(requests) { return requests.length > batchSize; }, fn: (body2) => rpc.http(url_, { body: body2, fetchOptions, timeout: timeout2 }), sort: (a2, b2) => a2.id - b2.id }); const fn2 = async (body2) => batch ? schedule(body2) : [await rpc.http(url_, { body: body2, fetchOptions, timeout: timeout2 })]; const [{ error: error2, result }] = await fn2(body); if (error2) throw new RpcRequestError({ body, error: error2, url: url_ }); return result; }, retryCount, retryDelay, timeout: timeout2, type: "http" }, { fetchOptions, url }); }; } function isNullUniversalResolverError(err, callType) { var _a2, _b2, _c2; if (!(err instanceof BaseError)) return false; const cause = err.walk((e2) => e2 instanceof ContractFunctionRevertedError); if (!(cause instanceof ContractFunctionRevertedError)) return false; if (((_a2 = cause.data) == null ? void 0 : _a2.errorName) === "ResolverNotFound") return true; if (((_b2 = cause.data) == null ? void 0 : _b2.errorName) === "ResolverWildcardNotSupported") return true; if ((_c2 = cause.reason) == null ? void 0 : _c2.includes("Wildcard on non-extended resolvers is not supported")) return true; if (callType === "reverse" && cause.reason === panicReasons[50]) return true; return false; } function encodedLabelToLabelhash(label) { if (label.length !== 66) return null; if (label.indexOf("[") !== 0) return null; if (label.indexOf("]") !== 65) return null; const hash2 = `0x${label.slice(1, 65)}`; if (!isHex(hash2)) return null; return hash2; } function namehash(name2) { let result = new Uint8Array(32).fill(0); if (!name2) return bytesToHex$1(result); const labels = name2.split("."); for (let i2 = labels.length - 1; i2 >= 0; i2 -= 1) { const hashFromEncodedLabel = encodedLabelToLabelhash(labels[i2]); const hashed = hashFromEncodedLabel ? toBytes$1(hashFromEncodedLabel) : keccak256(stringToBytes$1(labels[i2]), "bytes"); result = keccak256(concat$1([result, hashed]), "bytes"); } return bytesToHex$1(result); } function encodeLabelhash(hash2) { return `[${hash2.slice(2)}]`; } function labelhash(label) { const result = new Uint8Array(32).fill(0); if (!label) return bytesToHex$1(result); return encodedLabelToLabelhash(label) || keccak256(stringToBytes$1(label)); } function packetToBytes(packet) { const value = packet.replace(/^\.|\.$/gm, ""); if (value.length === 0) return new Uint8Array(1); const bytes2 = new Uint8Array(stringToBytes$1(value).byteLength + 2); let offset = 0; const list = value.split("."); for (let i2 = 0; i2 < list.length; i2++) { let encoded = stringToBytes$1(list[i2]); if (encoded.byteLength > 255) encoded = stringToBytes$1(encodeLabelhash(labelhash(list[i2]))); bytes2[offset] = encoded.length; bytes2.set(encoded, offset + 1); offset += encoded.length + 1; } if (bytes2.byteLength !== offset + 1) return bytes2.slice(0, offset + 1); return bytes2; } async function getEnsAddress(client, { blockNumber, blockTag, coinType, name: name2, universalResolverAddress: universalResolverAddress_ }) { let universalResolverAddress = universalResolverAddress_; if (!universalResolverAddress) { if (!client.chain) throw new Error("client chain not configured. universalResolverAddress is required."); universalResolverAddress = getChainContractAddress({ blockNumber, chain: client.chain, contract: "ensUniversalResolver" }); } try { const functionData = encodeFunctionData({ abi: addressResolverAbi, functionName: "addr", ...coinType != null ? { args: [namehash(name2), BigInt(coinType)] } : { args: [namehash(name2)] } }); const res = await getAction(client, readContract$1, "readContract")({ address: universalResolverAddress, abi: universalResolverResolveAbi, functionName: "resolve", args: [toHex(packetToBytes(name2)), functionData], blockNumber, blockTag }); if (res[0] === "0x") return null; const address = decodeFunctionResult({ abi: addressResolverAbi, args: coinType != null ? [namehash(name2), BigInt(coinType)] : void 0, functionName: "addr", data: res[0] }); if (address === "0x") return null; if (trim(address) === "0x00") return null; return address; } catch (err) { if (isNullUniversalResolverError(err, "resolve")) return null; throw err; } } class EnsAvatarInvalidMetadataError extends BaseError { constructor({ data: data2 }) { 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(data2)}` ] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "EnsAvatarInvalidMetadataError" }); } } class EnsAvatarInvalidNftUriError extends BaseError { constructor({ reason }) { super(`ENS NFT avatar URI is invalid. ${reason}`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "EnsAvatarInvalidNftUriError" }); } } class EnsAvatarUriResolutionError extends BaseError { constructor({ uri }) { super(`Unable to resolve ENS avatar URI "${uri}". The URI may be malformed, invalid, or does not respond with a valid image.`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "EnsAvatarUriResolutionError" }); } } class EnsAvatarUnsupportedNamespaceError extends BaseError { constructor({ namespace }) { super(`ENS NFT avatar namespace "${namespace}" is not supported. Must be "erc721" or "erc1155".`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "EnsAvatarUnsupportedNamespaceError" }); } } const networkRegex = /(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/; const ipfsHashRegex = /^(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,})(\/(?[\w\-.]+))?(?\/.*)?$/; const base64Regex = /^data:([a-zA-Z\-/+]*);base64,([^"].*)/; const dataURIRegex = /^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/; async function isImageUri(uri) { try { const res = await fetch(uri, { method: "HEAD" }); if (res.status === 200) { const contentType = res.headers.get("content-type"); return contentType == null ? void 0 : contentType.startsWith("image/"); } return false; } catch (error2) { if (typeof error2 === "object" && typeof error2.response !== "undefined") { return false; } if (!globalThis.hasOwnProperty("Image")) return false; return new Promise((resolve) => { const img = new Image(); img.onload = () => { resolve(true); }; img.onerror = () => { resolve(false); }; img.src = uri; }); } } function getGateway(custom2, defaultGateway) { if (!custom2) return defaultGateway; if (custom2.endsWith("/")) return custom2.slice(0, -1); return custom2; } function resolveAvatarUri({ uri, gatewayUrls }) { const isEncoded = base64Regex.test(uri); if (isEncoded) return { uri, isOnChain: true, isEncoded }; const ipfsGateway = getGateway(gatewayUrls == null ? void 0 : gatewayUrls.ipfs, "https://ipfs.io"); const arweaveGateway = getGateway(gatewayUrls == null ? void 0 : gatewayUrls.arweave, "https://arweave.net"); const networkRegexMatch = uri.match(networkRegex); const { protocol, subpath, target, subtarget = "" } = (networkRegexMatch == null ? void 0 : networkRegexMatch.groups) || {}; const isIPNS = protocol === "ipns:/" || subpath === "ipns/"; const isIPFS = protocol === "ipfs:/" || subpath === "ipfs/" || ipfsHashRegex.test(uri); if (uri.startsWith("http") && !isIPNS && !isIPFS) { let replacedUri = uri; if (gatewayUrls == null ? void 0 : gatewayUrls.arweave) replacedUri = uri.replace(/https:\/\/arweave.net/g, gatewayUrls == null ? void 0 : gatewayUrls.arweave); return { uri: replacedUri, isOnChain: false, isEncoded: false }; } if ((isIPNS || isIPFS) && target) { return { uri: `${ipfsGateway}/${isIPNS ? "ipns" : "ipfs"}/${target}${subtarget}`, isOnChain: false, isEncoded: false }; } if (protocol === "ar:/" && target) { return { uri: `${arweaveGateway}/${target}${subtarget || ""}`, isOnChain: false, isEncoded: false }; } let parsedUri = uri.replace(dataURIRegex, ""); if (parsedUri.startsWith(" res2.json()); const image = await parseAvatarUri({ gatewayUrls, uri: getJsonImage(res) }); return image; } catch { throw new EnsAvatarUriResolutionError({ uri }); } } async function parseAvatarUri({ gatewayUrls, uri }) { const { uri: resolvedURI, isOnChain } = resolveAvatarUri({ uri, gatewayUrls }); if (isOnChain) return resolvedURI; const isImage = await isImageUri(resolvedURI); if (isImage) return resolvedURI; throw new EnsAvatarUriResolutionError({ uri }); } function parseNftUri(uri_) { let uri = uri_; if (uri.startsWith("did:nft:")) { uri = uri.replace("did:nft:", "").replace(/_/g, "/"); } const [reference, asset_namespace, tokenID] = uri.split("/"); const [eip_namespace, chainID] = reference.split(":"); const [erc_namespace, contractAddress] = asset_namespace.split(":"); if (!eip_namespace || eip_namespace.toLowerCase() !== "eip155") throw new EnsAvatarInvalidNftUriError({ reason: "Only EIP-155 supported" }); if (!chainID) throw new EnsAvatarInvalidNftUriError({ reason: "Chain ID not found" }); if (!contractAddress) throw new EnsAvatarInvalidNftUriError({ reason: "Contract address not found" }); if (!tokenID) throw new EnsAvatarInvalidNftUriError({ reason: "Token ID not found" }); if (!erc_namespace) throw new EnsAvatarInvalidNftUriError({ reason: "ERC namespace not found" }); return { chainID: parseInt(chainID), namespace: erc_namespace.toLowerCase(), contractAddress, tokenID }; } async function getNftTokenUri(client, { nft }) { if (nft.namespace === "erc721") { return readContract$1(client, { address: nft.contractAddress, abi: [ { name: "tokenURI", type: "function", stateMutability: "view", inputs: [{ name: "tokenId", type: "uint256" }], outputs: [{ name: "", type: "string" }] } ], functionName: "tokenURI", args: [BigInt(nft.tokenID)] }); } if (nft.namespace === "erc1155") { return readContract$1(client, { address: nft.contractAddress, abi: [ { name: "uri", type: "function", stateMutability: "view", inputs: [{ name: "_id", type: "uint256" }], outputs: [{ name: "", type: "string" }] } ], functionName: "uri", args: [BigInt(nft.tokenID)] }); } throw new EnsAvatarUnsupportedNamespaceError({ namespace: nft.namespace }); } async function parseAvatarRecord(client, { gatewayUrls, record: record2 }) { if (/eip155:/i.test(record2)) return parseNftAvatarUri(client, { gatewayUrls, record: record2 }); return parseAvatarUri({ uri: record2, gatewayUrls }); } async function parseNftAvatarUri(client, { gatewayUrls, record: record2 }) { const nft = parseNftUri(record2); const nftUri = await getNftTokenUri(client, { nft }); const { uri: resolvedNftUri, isOnChain, isEncoded } = resolveAvatarUri({ uri: nftUri, gatewayUrls }); if (isOnChain && (resolvedNftUri.includes("data:application/json;base64,") || resolvedNftUri.startsWith("{"))) { const encodedJson = isEncoded ? ( // if it is encoded, decode it atob(resolvedNftUri.replace("data:application/json;base64,", "")) ) : ( // if it isn't encoded assume it is a JSON string, but it could be anything (it will error if it is) resolvedNftUri ); const decoded = JSON.parse(encodedJson); return parseAvatarUri({ uri: getJsonImage(decoded), gatewayUrls }); } let uriTokenId = nft.tokenID; if (nft.namespace === "erc1155") uriTokenId = uriTokenId.replace("0x", "").padStart(64, "0"); return getMetadataAvatarUri({ gatewayUrls, uri: resolvedNftUri.replace(/(?:0x)?{id}/, uriTokenId) }); } async function getEnsText(client, { blockNumber, blockTag, name: name2, key, universalResolverAddress: universalResolverAddress_ }) { let universalResolverAddress = universalResolverAddress_; if (!universalResolverAddress) { if (!client.chain) throw new Error("client chain not configured. universalResolverAddress is required."); universalResolverAddress = getChainContractAddress({ blockNumber, chain: client.chain, contract: "ensUniversalResolver" }); } try { const res = await getAction(client, readContract$1, "readContract")({ address: universalResolverAddress, abi: universalResolverResolveAbi, functionName: "resolve", args: [ toHex(packetToBytes(name2)), encodeFunctionData({ abi: textResolverAbi, functionName: "text", args: [namehash(name2), key] }) ], blockNumber, blockTag }); if (res[0] === "0x") return null; const record2 = decodeFunctionResult({ abi: textResolverAbi, functionName: "text", data: res[0] }); return record2 === "" ? null : record2; } catch (err) { if (isNullUniversalResolverError(err, "resolve")) return null; throw err; } } async function getEnsAvatar(client, { blockNumber, blockTag, gatewayUrls, name: name2, universalResolverAddress }) { const record2 = await getAction(client, getEnsText, "getEnsText")({ blockNumber, blockTag, key: "avatar", name: name2, universalResolverAddress }); if (!record2) return null; try { return await parseAvatarRecord(client, { record: record2, gatewayUrls }); } catch { return null; } } async function getEnsName(client, { address, blockNumber, blockTag, universalResolverAddress: universalResolverAddress_ }) { let universalResolverAddress = universalResolverAddress_; if (!universalResolverAddress) { if (!client.chain) throw new Error("client chain not configured. universalResolverAddress is required."); universalResolverAddress = getChainContractAddress({ blockNumber, chain: client.chain, contract: "ensUniversalResolver" }); } const reverseNode = `${address.toLowerCase().substring(2)}.addr.reverse`; try { const [name2, resolvedAddress] = await getAction(client, readContract$1, "readContract")({ address: universalResolverAddress, abi: universalResolverReverseAbi, functionName: "reverse", args: [toHex(packetToBytes(reverseNode))], blockNumber, blockTag }); if (address.toLowerCase() !== resolvedAddress.toLowerCase()) return null; return name2; } catch (err) { if (isNullUniversalResolverError(err, "reverse")) return null; throw err; } } async function getEnsResolver(client, { blockNumber, blockTag, name: name2, universalResolverAddress: universalResolverAddress_ }) { let universalResolverAddress = universalResolverAddress_; if (!universalResolverAddress) { if (!client.chain) throw new Error("client chain not configured. universalResolverAddress is required."); universalResolverAddress = getChainContractAddress({ blockNumber, chain: client.chain, contract: "ensUniversalResolver" }); } const [resolverAddress] = await getAction(client, readContract$1, "readContract")({ address: universalResolverAddress, abi: [ { inputs: [{ type: "bytes" }], name: "findResolver", outputs: [{ type: "address" }, { type: "bytes32" }], stateMutability: "view", type: "function" } ], functionName: "findResolver", args: [toHex(packetToBytes(name2))], blockNumber, blockTag }); return resolverAddress; } async function createBlockFilter(client) { const getRequest = createFilterRequestScope(client, { method: "eth_newBlockFilter" }); const id2 = await client.request({ method: "eth_newBlockFilter" }); return { id: id2, request: getRequest(id2), type: "block" }; } async function createEventFilter(client, { address, args, event, events: events_, fromBlock, strict, toBlock } = {}) { const events2 = events_ ?? (event ? [event] : void 0); const getRequest = createFilterRequestScope(client, { method: "eth_newFilter" }); let topics = []; if (events2) { topics = [ events2.flatMap((event2) => encodeEventTopics({ abi: [event2], eventName: event2.name, args })) ]; if (event) topics = topics[0]; } const id2 = await client.request({ method: "eth_newFilter", params: [ { address, fromBlock: typeof fromBlock === "bigint" ? numberToHex$1(fromBlock) : fromBlock, toBlock: typeof toBlock === "bigint" ? numberToHex$1(toBlock) : toBlock, ...topics.length ? { topics } : {} } ] }); return { abi: events2, args, eventName: event ? event.name : void 0, fromBlock, id: id2, request: getRequest(id2), strict, toBlock, type: "event" }; } async function createPendingTransactionFilter(client) { const getRequest = createFilterRequestScope(client, { method: "eth_newPendingTransactionFilter" }); const id2 = await client.request({ method: "eth_newPendingTransactionFilter" }); return { id: id2, request: getRequest(id2), type: "transaction" }; } async function getBalance(client, { address, blockNumber, blockTag = "latest" }) { const blockNumberHex = blockNumber ? numberToHex$1(blockNumber) : void 0; const balance = await client.request({ method: "eth_getBalance", params: [address, blockNumberHex || blockTag] }); return BigInt(balance); } async function getBlockTransactionCount(client, { blockHash, blockNumber, blockTag = "latest" } = {}) { const blockNumberHex = blockNumber !== void 0 ? numberToHex$1(blockNumber) : void 0; let count; if (blockHash) { count = await client.request({ method: "eth_getBlockTransactionCountByHash", params: [blockHash] }); } else { count = await client.request({ method: "eth_getBlockTransactionCountByNumber", params: [blockNumberHex || blockTag] }); } return hexToNumber$1(count); } async function getBytecode(client, { address, blockNumber, blockTag = "latest" }) { const blockNumberHex = blockNumber !== void 0 ? numberToHex$1(blockNumber) : void 0; const hex2 = await client.request({ method: "eth_getCode", params: [address, blockNumberHex || blockTag] }); if (hex2 === "0x") return void 0; return hex2; } function formatFeeHistory(feeHistory) { var _a2; return { baseFeePerGas: feeHistory.baseFeePerGas.map((value) => BigInt(value)), gasUsedRatio: feeHistory.gasUsedRatio, oldestBlock: BigInt(feeHistory.oldestBlock), reward: (_a2 = feeHistory.reward) == null ? void 0 : _a2.map((reward) => reward.map((value) => BigInt(value))) }; } async function getFeeHistory(client, { blockCount, blockNumber, blockTag = "latest", rewardPercentiles }) { const blockNumberHex = blockNumber ? numberToHex$1(blockNumber) : void 0; const feeHistory = await client.request({ method: "eth_feeHistory", params: [ numberToHex$1(blockCount), blockNumberHex || blockTag, rewardPercentiles ] }); return formatFeeHistory(feeHistory); } async function getFilterLogs(_client2, { filter }) { const strict = filter.strict ?? false; const logs = await filter.request({ method: "eth_getFilterLogs", params: [filter.id] }); return logs.map((log2) => { var _a2; try { const { eventName, args } = "abi" in filter && filter.abi ? decodeEventLog({ abi: filter.abi, data: log2.data, topics: log2.topics, strict }) : { eventName: void 0, args: void 0 }; return formatLog(log2, { args, eventName }); } catch (err) { let eventName; let isUnnamed; if (err instanceof DecodeLogDataMismatch || err instanceof DecodeLogTopicsMismatch) { if ("strict" in filter && filter.strict) return; eventName = err.abiItem.name; isUnnamed = (_a2 = err.abiItem.inputs) == null ? void 0 : _a2.some((x2) => !("name" in x2 && x2.name)); } return formatLog(log2, { args: isUnnamed ? [] : {}, eventName }); } }).filter(Boolean); } class OffchainLookupError extends BaseError { constructor({ callbackSelector, cause, data: data2, extraData, sender, urls }) { var _a2; super(cause.shortMessage || "An error occurred while fetching for an offchain result.", { cause, metaMessages: [ ...cause.metaMessages || [], ((_a2 = cause.metaMessages) == null ? void 0 : _a2.length) ? "" : [], "Offchain Gateway Call:", urls && [ " Gateway URL(s):", ...urls.map((url) => ` ${getUrl(url)}`) ], ` Sender: ${sender}`, ` Data: ${data2}`, ` Callback selector: ${callbackSelector}`, ` Extra data: ${extraData}` ].flat() }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "OffchainLookupError" }); } } class OffchainLookupResponseMalformedError extends BaseError { constructor({ result, url }) { super("Offchain gateway response is malformed. Response data must be a hex value.", { metaMessages: [ `Gateway URL: ${getUrl(url)}`, `Response: ${stringify$2(result)}` ] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "OffchainLookupResponseMalformedError" }); } } class OffchainLookupSenderMismatchError extends BaseError { constructor({ sender, to: to2 }) { super("Reverted sender address does not match target contract address (`to`).", { metaMessages: [ `Contract address: ${to2}`, `OffchainLookup sender address: ${sender}` ] }); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "OffchainLookupSenderMismatchError" }); } } function isAddressEqual(a2, b2) { if (!isAddress(a2)) throw new InvalidAddressError({ address: a2 }); if (!isAddress(b2)) throw new InvalidAddressError({ address: b2 }); return a2.toLowerCase() === b2.toLowerCase(); } const offchainLookupSignature = "0x556f1830"; const offchainLookupAbiItem = { 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 offchainLookup(client, { blockNumber, blockTag, data: data2, to: to2 }) { const { args } = decodeErrorResult({ data: data2, abi: [offchainLookupAbiItem] }); const [sender, urls, callData, callbackSelector, extraData] = args; try { if (!isAddressEqual(to2, sender)) throw new OffchainLookupSenderMismatchError({ sender, to: to2 }); const result = await ccipFetch({ data: callData, sender, urls }); const { data: data_ } = await call$1(client, { blockNumber, blockTag, data: concat$1([ callbackSelector, encodeAbiParameters([{ type: "bytes" }, { type: "bytes" }], [result, extraData]) ]), to: to2 }); return data_; } catch (err) { throw new OffchainLookupError({ callbackSelector, cause: err, data: data2, extraData, sender, urls }); } } async function ccipFetch({ data: data2, sender, urls }) { var _a2; let error2 = new Error("An unknown error occurred."); for (let i2 = 0; i2 < urls.length; i2++) { const url = urls[i2]; const method = url.includes("{data}") ? "GET" : "POST"; const body = method === "POST" ? { data: data2, sender } : void 0; try { const response = await fetch(url.replace("{sender}", sender).replace("{data}", data2), { body: JSON.stringify(body), method }); let result; if ((_a2 = response.headers.get("Content-Type")) == null ? void 0 : _a2.startsWith("application/json")) { result = (await response.json()).data; } else { result = await response.text(); } if (!response.ok) { error2 = new HttpRequestError({ body, details: (result == null ? void 0 : result.error) ? stringify$2(result.error) : response.statusText, headers: response.headers, status: response.status, url }); continue; } if (!isHex(result)) { error2 = new OffchainLookupResponseMalformedError({ result, url }); continue; } return result; } catch (err) { error2 = new HttpRequestError({ body, details: err.message, url }); } } throw error2; } const ccip = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, ccipFetch, offchainLookup, offchainLookupAbiItem, offchainLookupSignature }, Symbol.toStringTag, { value: "Module" })); const bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/; const integerRegex = /^(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 hashTypedData({ domain: domain_, message, primaryType, types: types_ }) { const domain = typeof domain_ === "undefined" ? {} : domain_; const types2 = { EIP712Domain: getTypesForEIP712Domain({ domain }), ...types_ }; validateTypedData({ domain, message, primaryType, types: types2 }); const parts = ["0x1901"]; if (domain) parts.push(hashDomain({ domain, types: types2 })); if (primaryType !== "EIP712Domain") { parts.push(hashStruct({ data: message, primaryType, types: types2 })); } return keccak256(concat$1(parts)); } function hashDomain({ domain, types: types2 }) { return hashStruct({ data: domain, primaryType: "EIP712Domain", types: types2 }); } function hashStruct({ data: data2, primaryType, types: types2 }) { const encoded = encodeData$1({ data: data2, primaryType, types: types2 }); return keccak256(encoded); } function encodeData$1({ data: data2, primaryType, types: types2 }) { const encodedTypes = [{ type: "bytes32" }]; const encodedValues = [hashType({ primaryType, types: types2 })]; for (const field of types2[primaryType]) { const [type2, value] = encodeField({ types: types2, name: field.name, type: field.type, value: data2[field.name] }); encodedTypes.push(type2); encodedValues.push(value); } return encodeAbiParameters(encodedTypes, encodedValues); } function hashType({ primaryType, types: types2 }) { const encodedHashType = toHex(encodeType({ primaryType, types: types2 })); return keccak256(encodedHashType); } function encodeType({ primaryType, types: types2 }) { let result = ""; const unsortedDeps = findTypeDependencies({ primaryType, types: types2 }); unsortedDeps.delete(primaryType); const deps = [primaryType, ...Array.from(unsortedDeps).sort()]; for (const type2 of deps) { result += `${type2}(${types2[type2].map(({ name: name2, type: t2 }) => `${t2} ${name2}`).join(",")})`; } return result; } function findTypeDependencies({ primaryType: primaryType_, types: types2 }, results2 = /* @__PURE__ */ new Set()) { const match = primaryType_.match(/^\w*/u); const primaryType = match == null ? void 0 : match[0]; if (results2.has(primaryType) || types2[primaryType] === void 0) { return results2; } results2.add(primaryType); for (const field of types2[primaryType]) { findTypeDependencies({ primaryType: field.type, types: types2 }, results2); } return results2; } function encodeField({ types: types2, name: name2, type: type2, value }) { if (types2[type2] !== void 0) { return [ { type: "bytes32" }, keccak256(encodeData$1({ data: value, primaryType: type2, types: types2 })) ]; } if (type2 === "bytes") { const prepend = value.length % 2 ? "0" : ""; value = `0x${prepend + value.slice(2)}`; return [{ type: "bytes32" }, keccak256(value)]; } if (type2 === "string") return [{ type: "bytes32" }, keccak256(toHex(value))]; if (type2.lastIndexOf("]") === type2.length - 1) { const parsedType = type2.slice(0, type2.lastIndexOf("[")); const typeValuePairs = value.map((item) => encodeField({ name: name2, type: parsedType, types: types2, value: item })); return [ { type: "bytes32" }, keccak256(encodeAbiParameters(typeValuePairs.map(([t2]) => t2), typeValuePairs.map(([, v2]) => v2))) ]; } return [{ type: type2 }, value]; } function validateTypedData({ domain, message, primaryType, types: types_ }) { const types2 = types_; const validateData = (struct2, value_) => { for (const param of struct2) { const { name: name2, type: type_ } = param; const type2 = type_; const value = value_[name2]; const integerMatch = type2.match(integerRegex); if (integerMatch && (typeof value === "number" || typeof value === "bigint")) { const [_type, base3, size_] = integerMatch; numberToHex$1(value, { signed: base3 === "int", size: parseInt(size_) / 8 }); } if (type2 === "address" && typeof value === "string" && !isAddress(value)) throw new InvalidAddressError({ address: value }); const bytesMatch = type2.match(bytesRegex); if (bytesMatch) { const [_type, size_] = bytesMatch; if (size_ && size$2(value) !== parseInt(size_)) throw new BytesSizeMismatchError({ expectedSize: parseInt(size_), givenSize: size$2(value) }); } const struct3 = types2[type2]; if (struct3) validateData(struct3, value); } }; if (types2.EIP712Domain && domain) validateData(types2.EIP712Domain, domain); if (primaryType !== "EIP712Domain") { const type2 = types2[primaryType]; validateData(type2, message); } } function getTypesForEIP712Domain({ domain }) { return [ typeof (domain == null ? void 0 : domain.name) === "string" && { name: "name", type: "string" }, (domain == null ? void 0 : domain.version) && { name: "version", type: "string" }, typeof (domain == null ? void 0 : domain.chainId) === "number" && { name: "chainId", type: "uint256" }, (domain == null ? void 0 : domain.verifyingContract) && { name: "verifyingContract", type: "address" }, (domain == null ? void 0 : domain.salt) && { name: "salt", type: "bytes32" } ].filter(Boolean); } const docsPath = "/docs/contract/encodeDeployData"; function encodeDeployData({ abi: abi2, args, bytecode }) { if (!args || args.length === 0) return bytecode; const description = abi2.find((x2) => "type" in x2 && x2.type === "constructor"); if (!description) throw new AbiConstructorNotFoundError({ docsPath }); if (!("inputs" in description)) throw new AbiConstructorParamsNotFoundError({ docsPath }); if (!description.inputs || description.inputs.length === 0) throw new AbiConstructorParamsNotFoundError({ docsPath }); const data2 = encodeAbiParameters(description.inputs, args); return concatHex([bytecode, data2]); } const presignMessagePrefix = "Ethereum Signed Message:\n"; function hashMessage(message, to_) { const messageBytes = (() => { if (typeof message === "string") return stringToBytes$1(message); if (message.raw instanceof Uint8Array) return message.raw; return toBytes$1(message.raw); })(); const prefixBytes = stringToBytes$1(`${presignMessagePrefix}${messageBytes.length}`); return keccak256(concat$1([prefixBytes, messageBytes]), to_); } function formatStorageProof(storageProof) { return storageProof.map((proof) => ({ ...proof, value: BigInt(proof.value) })); } function formatProof(proof) { return { ...proof, balance: proof.balance ? BigInt(proof.balance) : void 0, nonce: proof.nonce ? hexToNumber$1(proof.nonce) : void 0, storageProof: proof.storageProof ? formatStorageProof(proof.storageProof) : void 0 }; } async function getProof(client, { address, blockNumber, blockTag: blockTag_, storageKeys }) { const blockTag = blockTag_ ?? "latest"; const blockNumberHex = blockNumber !== void 0 ? numberToHex$1(blockNumber) : void 0; const proof = await client.request({ method: "eth_getProof", params: [address, storageKeys, blockNumberHex || blockTag] }); return formatProof(proof); } async function getStorageAt(client, { address, blockNumber, blockTag = "latest", slot }) { const blockNumberHex = blockNumber !== void 0 ? numberToHex$1(blockNumber) : void 0; const data2 = await client.request({ method: "eth_getStorageAt", params: [address, slot, blockNumberHex || blockTag] }); return data2; } async function getTransaction(client, { blockHash, blockNumber, blockTag: blockTag_, hash: hash2, index: index2 }) { var _a2, _b2, _c2; const blockTag = blockTag_ || "latest"; const blockNumberHex = blockNumber !== void 0 ? numberToHex$1(blockNumber) : void 0; let transaction = null; if (hash2) { transaction = await client.request({ method: "eth_getTransactionByHash", params: [hash2] }); } else if (blockHash) { transaction = await client.request({ method: "eth_getTransactionByBlockHashAndIndex", params: [blockHash, numberToHex$1(index2)] }); } else if (blockNumberHex || blockTag) { transaction = await client.request({ method: "eth_getTransactionByBlockNumberAndIndex", params: [blockNumberHex || blockTag, numberToHex$1(index2)] }); } if (!transaction) throw new TransactionNotFoundError({ blockHash, blockNumber, blockTag, hash: hash2, index: index2 }); const format2 = ((_c2 = (_b2 = (_a2 = client.chain) == null ? void 0 : _a2.formatters) == null ? void 0 : _b2.transaction) == null ? void 0 : _c2.format) || formatTransaction; return format2(transaction); } async function getTransactionConfirmations(client, { hash: hash2, transactionReceipt }) { const [blockNumber, transaction] = await Promise.all([ getAction(client, getBlockNumber, "getBlockNumber")({}), hash2 ? getAction(client, getTransaction, "getBlockNumber")({ hash: hash2 }) : void 0 ]); const transactionBlockNumber = (transactionReceipt == null ? void 0 : transactionReceipt.blockNumber) || (transaction == null ? void 0 : transaction.blockNumber); if (!transactionBlockNumber) return 0n; return blockNumber - transactionBlockNumber + 1n; } async function getTransactionReceipt(client, { hash: hash2 }) { var _a2, _b2, _c2; const receipt = await client.request({ method: "eth_getTransactionReceipt", params: [hash2] }); if (!receipt) throw new TransactionReceiptNotFoundError({ hash: hash2 }); const format2 = ((_c2 = (_b2 = (_a2 = client.chain) == null ? void 0 : _a2.formatters) == null ? void 0 : _b2.transactionReceipt) == null ? void 0 : _c2.format) || formatTransactionReceipt; return format2(receipt); } async function multicall$1(client, args) { var _a2; const { allowFailure = true, batchSize: batchSize_, blockNumber, blockTag, contracts, multicallAddress: multicallAddress_ } = args; const batchSize = batchSize_ ?? (typeof ((_a2 = client.batch) == null ? void 0 : _a2.multicall) === "object" && client.batch.multicall.batchSize || 1024); let multicallAddress = multicallAddress_; if (!multicallAddress) { if (!client.chain) throw new Error("client chain not configured. multicallAddress is required."); multicallAddress = getChainContractAddress({ blockNumber, chain: client.chain, contract: "multicall3" }); } const chunkedCalls = [[]]; let currentChunk = 0; let currentChunkSize = 0; for (let i2 = 0; i2 < contracts.length; i2++) { const { abi: abi2, address, args: args2, functionName } = contracts[i2]; try { const callData = encodeFunctionData({ abi: abi2, args: args2, functionName }); currentChunkSize += (callData.length - 2) / 2; if ( // Check if batching is enabled. batchSize > 0 && // Check if the current size of the batch exceeds the size limit. currentChunkSize > batchSize && // Check if the current chunk is not already empty. chunkedCalls[currentChunk].length > 0 ) { currentChunk++; currentChunkSize = (callData.length - 2) / 2; chunkedCalls[currentChunk] = []; } chunkedCalls[currentChunk] = [ ...chunkedCalls[currentChunk], { allowFailure: true, callData, target: address } ]; } catch (err) { const error2 = getContractError(err, { abi: abi2, address, args: args2, docsPath: "/docs/contract/multicall", functionName }); if (!allowFailure) throw error2; chunkedCalls[currentChunk] = [ ...chunkedCalls[currentChunk], { allowFailure: true, callData: "0x", target: address } ]; } } const aggregate3Results = await Promise.allSettled(chunkedCalls.map((calls) => getAction(client, readContract$1, "readContract")({ abi: multicall3Abi, address: multicallAddress, args: [calls], blockNumber, blockTag, functionName: "aggregate3" }))); const results2 = []; for (let i2 = 0; i2 < aggregate3Results.length; i2++) { const result = aggregate3Results[i2]; if (result.status === "rejected") { if (!allowFailure) throw result.reason; for (let j2 = 0; j2 < chunkedCalls[i2].length; j2++) { results2.push({ status: "failure", error: result.reason, result: void 0 }); } continue; } const aggregate3Result = result.value; for (let j2 = 0; j2 < aggregate3Result.length; j2++) { const { returnData, success } = aggregate3Result[j2]; const { callData } = chunkedCalls[i2][j2]; const { abi: abi2, address, functionName, args: args2 } = contracts[results2.length]; try { if (callData === "0x") throw new AbiDecodingZeroDataError(); if (!success) throw new RawContractError({ data: returnData }); const result2 = decodeFunctionResult({ abi: abi2, args: args2, data: returnData, functionName }); results2.push(allowFailure ? { result: result2, status: "success" } : result2); } catch (err) { const error2 = getContractError(err, { abi: abi2, address, args: args2, docsPath: "/docs/contract/multicall", functionName }); if (!allowFailure) throw error2; results2.push({ error: error2, result: void 0, status: "failure" }); } } } if (results2.length !== contracts.length) throw new BaseError("multicall results mismatch"); return results2; } const universalSignatureValidatorByteCode = "0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572"; /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ BigInt(0); BigInt(1); BigInt(2); function equalBytes(b1, b2) { if (b1.length !== b2.length) return false; for (let i2 = 0; i2 < b1.length; i2++) if (b1[i2] !== b2[i2]) return false; return true; } function isBytesEqual(a_, b_) { const a2 = isHex(a_) ? toBytes$1(a_) : a_; const b2 = isHex(b_) ? toBytes$1(b_) : b_; return equalBytes(a2, b2); } async function verifyHash(client, { address, hash: hash2, signature, ...callRequest }) { const signatureHex = isHex(signature) ? signature : toHex(signature); try { const { data: data2 } = await getAction(client, call$1, "call")({ data: encodeDeployData({ abi: universalSignatureValidatorAbi, args: [address, hash2, signatureHex], bytecode: universalSignatureValidatorByteCode }), ...callRequest }); return isBytesEqual(data2 ?? "0x0", "0x1"); } catch (error2) { if (error2 instanceof CallExecutionError) { return false; } throw error2; } } async function verifyMessage(client, { address, message, signature, ...callRequest }) { const hash2 = hashMessage(message); return verifyHash(client, { address, hash: hash2, signature, ...callRequest }); } async function verifyTypedData(client, { address, signature, message, primaryType, types: types2, domain, ...callRequest }) { const hash2 = hashTypedData({ message, primaryType, types: types2, domain }); return verifyHash(client, { address, hash: hash2, signature, ...callRequest }); } function watchBlockNumber(client, { emitOnBegin = false, emitMissed = false, onBlockNumber, onError, poll: poll_, pollingInterval = client.pollingInterval }) { const enablePolling = typeof poll_ !== "undefined" ? poll_ : client.transport.type !== "webSocket"; let prevBlockNumber; const pollBlockNumber = () => { const observerId = stringify$2([ "watchBlockNumber", client.uid, emitOnBegin, emitMissed, pollingInterval ]); return observe(observerId, { onBlockNumber, onError }, (emit) => poll(async () => { var _a2; try { const blockNumber = await getAction(client, getBlockNumber, "getBlockNumber")({ cacheTime: 0 }); if (prevBlockNumber) { if (blockNumber === prevBlockNumber) return; if (blockNumber - prevBlockNumber > 1 && emitMissed) { for (let i2 = prevBlockNumber + 1n; i2 < blockNumber; i2++) { emit.onBlockNumber(i2, prevBlockNumber); prevBlockNumber = i2; } } } if (!prevBlockNumber || blockNumber > prevBlockNumber) { emit.onBlockNumber(blockNumber, prevBlockNumber); prevBlockNumber = blockNumber; } } catch (err) { (_a2 = emit.onError) == null ? void 0 : _a2.call(emit, err); } }, { emitOnBegin, interval: pollingInterval })); }; const subscribeBlockNumber = () => { let active = true; let unsubscribe = () => active = false; (async () => { try { const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({ params: ["newHeads"], onData(data2) { var _a2; if (!active) return; const blockNumber = hexToBigInt$1((_a2 = data2.result) == null ? void 0 : _a2.number); onBlockNumber(blockNumber, prevBlockNumber); prevBlockNumber = blockNumber; }, onError(error2) { onError == null ? void 0 : onError(error2); } }); unsubscribe = unsubscribe_; if (!active) unsubscribe(); } catch (err) { onError == null ? void 0 : onError(err); } })(); return unsubscribe; }; return enablePolling ? pollBlockNumber() : subscribeBlockNumber(); } async function waitForTransactionReceipt(client, { confirmations = 1, hash: hash2, onReplaced, pollingInterval = client.pollingInterval, timeout: timeout2 }) { const observerId = stringify$2(["waitForTransactionReceipt", client.uid, hash2]); let transaction; let replacedTransaction; let receipt; let retrying = false; return new Promise((resolve, reject) => { if (timeout2) setTimeout(() => reject(new WaitForTransactionReceiptTimeoutError({ hash: hash2 })), timeout2); const _unobserve = observe(observerId, { onReplaced, resolve, reject }, (emit) => { const _unwatch = getAction(client, watchBlockNumber, "watchBlockNumber")({ emitMissed: true, emitOnBegin: true, poll: true, pollingInterval, async onBlockNumber(blockNumber_) { if (retrying) return; let blockNumber = blockNumber_; const done2 = (fn2) => { _unwatch(); fn2(); _unobserve(); }; try { if (receipt) { if (confirmations > 1 && (!receipt.blockNumber || blockNumber - receipt.blockNumber + 1n < confirmations)) return; done2(() => emit.resolve(receipt)); return; } if (!transaction) { retrying = true; await withRetry(async () => { transaction = await getAction(client, getTransaction, "getTransaction")({ hash: hash2 }); if (transaction.blockNumber) blockNumber = transaction.blockNumber; }, { // exponential backoff delay: ({ count }) => ~~(1 << count) * 200, retryCount: 6 }); retrying = false; } receipt = await getAction(client, getTransactionReceipt, "getTransactionReceipt")({ hash: hash2 }); if (confirmations > 1 && (!receipt.blockNumber || blockNumber - receipt.blockNumber + 1n < confirmations)) return; done2(() => emit.resolve(receipt)); } catch (err) { if (transaction && (err instanceof TransactionNotFoundError || err instanceof TransactionReceiptNotFoundError)) { try { replacedTransaction = transaction; retrying = true; const block = await withRetry(() => getAction(client, getBlock, "getBlock")({ blockNumber, includeTransactions: true }), { // exponential backoff delay: ({ count }) => ~~(1 << count) * 200, retryCount: 6, shouldRetry: ({ error: error2 }) => error2 instanceof BlockNotFoundError }); retrying = false; const replacementTransaction = block.transactions.find(({ from: from2, nonce }) => from2 === replacedTransaction.from && nonce === replacedTransaction.nonce); if (!replacementTransaction) return; receipt = await getAction(client, getTransactionReceipt, "getTransactionReceipt")({ hash: replacementTransaction.hash }); if (confirmations > 1 && (!receipt.blockNumber || blockNumber - receipt.blockNumber + 1n < confirmations)) return; let reason = "replaced"; if (replacementTransaction.to === replacedTransaction.to && replacementTransaction.value === replacedTransaction.value) { reason = "repriced"; } else if (replacementTransaction.from === replacementTransaction.to && replacementTransaction.value === 0n) { reason = "cancelled"; } done2(() => { var _a2; (_a2 = emit.onReplaced) == null ? void 0 : _a2.call(emit, { reason, replacedTransaction, transaction: replacementTransaction, transactionReceipt: receipt }); emit.resolve(receipt); }); } catch (err_) { done2(() => emit.reject(err_)); } } else { done2(() => emit.reject(err)); } } } }); }); }); } function watchBlocks(client, { blockTag = "latest", emitMissed = false, emitOnBegin = false, onBlock, onError, includeTransactions: includeTransactions_, poll: poll_, pollingInterval = client.pollingInterval }) { const enablePolling = typeof poll_ !== "undefined" ? poll_ : client.transport.type !== "webSocket"; const includeTransactions = includeTransactions_ ?? false; let prevBlock; const pollBlocks = () => { const observerId = stringify$2([ "watchBlocks", client.uid, emitMissed, emitOnBegin, includeTransactions, pollingInterval ]); return observe(observerId, { onBlock, onError }, (emit) => poll(async () => { var _a2; try { const block = await getAction(client, getBlock, "getBlock")({ blockTag, includeTransactions }); if (block.number && (prevBlock == null ? void 0 : prevBlock.number)) { if (block.number === prevBlock.number) return; if (block.number - prevBlock.number > 1 && emitMissed) { for (let i2 = (prevBlock == null ? void 0 : prevBlock.number) + 1n; i2 < block.number; i2++) { const block2 = await getAction(client, getBlock, "getBlock")({ blockNumber: i2, includeTransactions }); emit.onBlock(block2, prevBlock); prevBlock = block2; } } } if ( // If no previous block exists, emit. !(prevBlock == null ? void 0 : prevBlock.number) || // If the block tag is "pending" with no block number, emit. blockTag === "pending" && !(block == null ? void 0 : block.number) || // If the next block number is greater than the previous block number, emit. // We don't want to emit blocks in the past. block.number && block.number > prevBlock.number ) { emit.onBlock(block, prevBlock); prevBlock = block; } } catch (err) { (_a2 = emit.onError) == null ? void 0 : _a2.call(emit, err); } }, { emitOnBegin, interval: pollingInterval })); }; const subscribeBlocks = () => { let active = true; let unsubscribe = () => active = false; (async () => { try { const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({ params: ["newHeads"], onData(data2) { var _a2, _b2, _c2; if (!active) return; const format2 = ((_c2 = (_b2 = (_a2 = client.chain) == null ? void 0 : _a2.formatters) == null ? void 0 : _b2.block) == null ? void 0 : _c2.format) || formatBlock; const block = format2(data2.result); onBlock(block, prevBlock); prevBlock = block; }, onError(error2) { onError == null ? void 0 : onError(error2); } }); unsubscribe = unsubscribe_; if (!active) unsubscribe(); } catch (err) { onError == null ? void 0 : onError(err); } })(); return unsubscribe; }; return enablePolling ? pollBlocks() : subscribeBlocks(); } function watchEvent(client, { address, args, batch = true, event, events: events2, onError, onLogs, poll: poll_, pollingInterval = client.pollingInterval, strict: strict_ }) { const enablePolling = typeof poll_ !== "undefined" ? poll_ : client.transport.type !== "webSocket"; const strict = strict_ ?? false; const pollEvent = () => { const observerId = stringify$2([ "watchEvent", address, args, batch, client.uid, event, pollingInterval ]); return observe(observerId, { onLogs, onError }, (emit) => { let previousBlockNumber; let filter; let initialized = false; const unwatch = poll(async () => { var _a2; if (!initialized) { try { filter = await getAction(client, createEventFilter, "createEventFilter")({ address, args, event, events: events2, strict }); } catch { } initialized = true; return; } try { let logs; if (filter) { logs = await getAction(client, getFilterChanges, "getFilterChanges")({ filter }); } else { const blockNumber = await getAction(client, getBlockNumber, "getBlockNumber")({}); if (previousBlockNumber && previousBlockNumber !== blockNumber) { logs = await getAction(client, getLogs, "getLogs")({ address, args, event, events: events2, fromBlock: previousBlockNumber + 1n, toBlock: blockNumber }); } else { logs = []; } previousBlockNumber = blockNumber; } if (logs.length === 0) return; if (batch) emit.onLogs(logs); else for (const log2 of logs) emit.onLogs([log2]); } catch (err) { if (filter && err instanceof InvalidInputRpcError) initialized = false; (_a2 = emit.onError) == null ? void 0 : _a2.call(emit, err); } }, { emitOnBegin: true, interval: pollingInterval }); return async () => { if (filter) await getAction(client, uninstallFilter, "uninstallFilter")({ filter }); unwatch(); }; }); }; const subscribeEvent = () => { let active = true; let unsubscribe = () => active = false; (async () => { try { const events_ = events2 ?? (event ? [event] : void 0); let topics = []; if (events_) { topics = [ events_.flatMap((event2) => encodeEventTopics({ abi: [event2], eventName: event2.name, args })) ]; if (event) topics = topics[0]; } const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({ params: ["logs", { address, topics }], onData(data2) { var _a2; if (!active) return; const log2 = data2.result; try { const { eventName, args: args2 } = decodeEventLog({ abi: events_, data: log2.data, topics: log2.topics, strict }); const formatted = formatLog(log2, { args: args2, eventName }); onLogs([formatted]); } catch (err) { let eventName; let isUnnamed; if (err instanceof DecodeLogDataMismatch || err instanceof DecodeLogTopicsMismatch) { if (strict_) return; eventName = err.abiItem.name; isUnnamed = (_a2 = err.abiItem.inputs) == null ? void 0 : _a2.some((x2) => !("name" in x2 && x2.name)); } const formatted = formatLog(log2, { args: isUnnamed ? [] : {}, eventName }); onLogs([formatted]); } }, onError(error2) { onError == null ? void 0 : onError(error2); } }); unsubscribe = unsubscribe_; if (!active) unsubscribe(); } catch (err) { onError == null ? void 0 : onError(err); } })(); return unsubscribe; }; return enablePolling ? pollEvent() : subscribeEvent(); } function watchPendingTransactions(client, { batch = true, onError, onTransactions, poll: poll_, pollingInterval = client.pollingInterval }) { const enablePolling = typeof poll_ !== "undefined" ? poll_ : client.transport.type !== "webSocket"; const pollPendingTransactions = () => { const observerId = stringify$2([ "watchPendingTransactions", client.uid, batch, pollingInterval ]); return observe(observerId, { onTransactions, onError }, (emit) => { let filter; const unwatch = poll(async () => { var _a2; try { if (!filter) { try { filter = await getAction(client, createPendingTransactionFilter, "createPendingTransactionFilter")({}); return; } catch (err) { unwatch(); throw err; } } const hashes = await getAction(client, getFilterChanges, "getFilterChanges")({ filter }); if (hashes.length === 0) return; if (batch) emit.onTransactions(hashes); else for (const hash2 of hashes) emit.onTransactions([hash2]); } catch (err) { (_a2 = emit.onError) == null ? void 0 : _a2.call(emit, err); } }, { emitOnBegin: true, interval: pollingInterval }); return async () => { if (filter) await getAction(client, uninstallFilter, "uninstallFilter")({ filter }); unwatch(); }; }); }; const subscribePendingTransactions = () => { let active = true; let unsubscribe = () => active = false; (async () => { try { const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({ params: ["newPendingTransactions"], onData(data2) { if (!active) return; const transaction = data2.result; onTransactions([transaction]); }, onError(error2) { onError == null ? void 0 : onError(error2); } }); unsubscribe = unsubscribe_; if (!active) unsubscribe(); } catch (err) { onError == null ? void 0 : onError(err); } })(); return unsubscribe; }; return enablePolling ? pollPendingTransactions() : subscribePendingTransactions(); } function publicActions(client) { return { call: (args) => call$1(client, args), createBlockFilter: () => createBlockFilter(client), createContractEventFilter: (args) => createContractEventFilter(client, args), createEventFilter: (args) => createEventFilter(client, args), createPendingTransactionFilter: () => createPendingTransactionFilter(client), estimateContractGas: (args) => estimateContractGas(client, args), estimateGas: (args) => estimateGas(client, args), getBalance: (args) => getBalance(client, args), getBlock: (args) => getBlock(client, args), getBlockNumber: (args) => getBlockNumber(client, args), getBlockTransactionCount: (args) => getBlockTransactionCount(client, args), getBytecode: (args) => getBytecode(client, args), getChainId: () => getChainId(client), getContractEvents: (args) => getContractEvents(client, args), getEnsAddress: (args) => getEnsAddress(client, args), getEnsAvatar: (args) => getEnsAvatar(client, args), getEnsName: (args) => getEnsName(client, args), getEnsResolver: (args) => getEnsResolver(client, args), getEnsText: (args) => getEnsText(client, args), getFeeHistory: (args) => getFeeHistory(client, args), estimateFeesPerGas: (args) => estimateFeesPerGas(client, args), getFilterChanges: (args) => getFilterChanges(client, args), getFilterLogs: (args) => getFilterLogs(client, args), getGasPrice: () => getGasPrice(client), getLogs: (args) => getLogs(client, args), getProof: (args) => getProof(client, args), estimateMaxPriorityFeePerGas: (args) => estimateMaxPriorityFeePerGas(client, args), getStorageAt: (args) => getStorageAt(client, args), getTransaction: (args) => getTransaction(client, args), getTransactionConfirmations: (args) => getTransactionConfirmations(client, args), getTransactionCount: (args) => getTransactionCount(client, args), getTransactionReceipt: (args) => getTransactionReceipt(client, args), multicall: (args) => multicall$1(client, args), prepareTransactionRequest: (args) => prepareTransactionRequest(client, args), readContract: (args) => readContract$1(client, args), sendRawTransaction: (args) => sendRawTransaction(client, args), simulateContract: (args) => simulateContract(client, args), verifyMessage: (args) => verifyMessage(client, args), verifyTypedData: (args) => verifyTypedData(client, args), uninstallFilter: (args) => uninstallFilter(client, args), waitForTransactionReceipt: (args) => waitForTransactionReceipt(client, args), watchBlocks: (args) => watchBlocks(client, args), watchBlockNumber: (args) => watchBlockNumber(client, args), watchContractEvent: (args) => watchContractEvent(client, args), watchEvent: (args) => watchEvent(client, args), watchPendingTransactions: (args) => watchPendingTransactions(client, args) }; } function createPublicClient(parameters) { const { key = "public", name: name2 = "Public Client" } = parameters; const client = createClient({ ...parameters, key, name: name2, type: "publicClient" }); return client.extend(publicActions); } function deployContract(walletClient, { abi: abi2, args, bytecode, ...request }) { const calldata = encodeDeployData({ abi: abi2, args, bytecode }); return sendTransaction(walletClient, { ...request, data: calldata }); } async function getAddresses(client) { var _a2; if (((_a2 = client.account) == null ? void 0 : _a2.type) === "local") return [client.account.address]; const addresses = await client.request({ method: "eth_accounts" }); return addresses.map((address) => checksumAddress(address)); } async function getPermissions(client) { const permissions = await client.request({ method: "wallet_getPermissions" }); return permissions; } async function requestAddresses(client) { const addresses = await client.request({ method: "eth_requestAccounts" }); return addresses.map((address) => getAddress(address)); } async function requestPermissions(client, permissions) { return client.request({ method: "wallet_requestPermissions", params: [permissions] }); } async function signMessage$1(client, { account: account_ = client.account, message }) { if (!account_) throw new AccountNotFoundError({ docsPath: "/docs/actions/wallet/signMessage" }); const account = parseAccount(account_); if (account.type === "local") return account.signMessage({ message }); const message_ = (() => { if (typeof message === "string") return stringToHex(message); if (message.raw instanceof Uint8Array) return toHex(message.raw); return message.raw; })(); return client.request({ method: "personal_sign", params: [message_, account.address] }); } async function signTransaction(client, args) { var _a2, _b2, _c2, _d; const { account: account_ = client.account, chain = client.chain, ...transaction } = args; if (!account_) throw new AccountNotFoundError({ docsPath: "/docs/actions/wallet/signTransaction" }); const account = parseAccount(account_); assertRequest({ account, ...args }); const chainId = await getAction(client, getChainId, "getChainId")({}); if (chain !== null) assertCurrentChain({ currentChainId: chainId, chain }); const formatters = (chain == null ? void 0 : chain.formatters) || ((_a2 = client.chain) == null ? void 0 : _a2.formatters); const format2 = ((_b2 = formatters == null ? void 0 : formatters.transactionRequest) == null ? void 0 : _b2.format) || formatTransactionRequest; if (account.type === "local") return account.signTransaction({ ...transaction, chainId }, { serializer: (_d = (_c2 = client.chain) == null ? void 0 : _c2.serializers) == null ? void 0 : _d.transaction }); return await client.request({ method: "eth_signTransaction", params: [ { ...format2(transaction), chainId: numberToHex$1(chainId), from: account.address } ] }); } async function signTypedData(client, { account: account_ = client.account, domain, message, primaryType, types: types_ }) { if (!account_) throw new AccountNotFoundError({ docsPath: "/docs/actions/wallet/signTypedData" }); const account = parseAccount(account_); const types2 = { EIP712Domain: getTypesForEIP712Domain({ domain }), ...types_ }; validateTypedData({ domain, message, primaryType, types: types2 }); if (account.type === "local") return account.signTypedData({ domain, primaryType, types: types2, message }); const typedData = stringify$2({ domain: domain ?? {}, primaryType, types: types2, message }, (_2, value) => isHex(value) ? value.toLowerCase() : value); return client.request({ method: "eth_signTypedData_v4", params: [account.address, typedData] }); } async function switchChain(client, { id: id2 }) { await client.request({ method: "wallet_switchEthereumChain", params: [ { chainId: numberToHex$1(id2) } ] }); } async function watchAsset(client, params) { const added = await client.request({ method: "wallet_watchAsset", params }); return added; } function walletActions(client) { return { addChain: (args) => addChain(client, args), deployContract: (args) => deployContract(client, args), getAddresses: () => getAddresses(client), getChainId: () => getChainId(client), getPermissions: () => getPermissions(client), prepareTransactionRequest: (args) => prepareTransactionRequest(client, args), requestAddresses: () => requestAddresses(client), requestPermissions: (args) => requestPermissions(client, args), sendRawTransaction: (args) => sendRawTransaction(client, args), sendTransaction: (args) => sendTransaction(client, args), signMessage: (args) => signMessage$1(client, args), signTransaction: (args) => signTransaction(client, args), signTypedData: (args) => signTypedData(client, args), switchChain: (args) => switchChain(client, args), watchAsset: (args) => watchAsset(client, args), writeContract: (args) => writeContract(client, args) }; } function createWalletClient(parameters) { const { key = "wallet", name: name2 = "Wallet Client", transport } = parameters; const client = createClient({ ...parameters, key, name: name2, transport: (opts) => transport({ ...opts, retryCount: 0 }), type: "walletClient" }); return client.extend(walletActions); } function webSocket(url, config2 = {}) { const { key = "webSocket", name: name2 = "WebSocket JSON-RPC", retryDelay } = config2; return ({ chain, retryCount: retryCount_, timeout: timeout_ }) => { var _a2; const retryCount = config2.retryCount ?? retryCount_; const timeout2 = timeout_ ?? config2.timeout ?? 1e4; const url_ = url || ((_a2 = chain == null ? void 0 : chain.rpcUrls.default.webSocket) == null ? void 0 : _a2[0]); if (!url_) throw new UrlRequiredError(); return createTransport({ key, name: name2, async request({ method, params }) { const body = { method, params }; const socket = await getSocket(url_); const { error: error2, result } = await rpc.webSocketAsync(socket, { body, timeout: timeout2 }); if (error2) throw new RpcRequestError({ body, error: error2, url: url_ }); return result; }, retryCount, retryDelay, timeout: timeout2, type: "webSocket" }, { getSocket() { return getSocket(url_); }, async subscribe({ params, onData, onError }) { const socket = await getSocket(url_); const { result: subscriptionId } = await new Promise((resolve, reject) => rpc.webSocket(socket, { body: { method: "eth_subscribe", params }, onResponse(response) { if (response.error) { reject(response.error); onError == null ? void 0 : onError(response.error); return; } if (typeof response.id === "number") { resolve(response); return; } if (response.method !== "eth_subscription") return; onData(response.params); } })); return { subscriptionId, async unsubscribe() { return new Promise((resolve) => rpc.webSocket(socket, { body: { method: "eth_unsubscribe", params: [subscriptionId] }, onResponse: resolve })); } }; } }); }; } const goerli = /* @__PURE__ */ defineChain({ id: 5, network: "goerli", name: "Goerli", nativeCurrency: { name: "Goerli Ether", symbol: "ETH", decimals: 18 }, rpcUrls: { alchemy: { http: ["https://eth-goerli.g.alchemy.com/v2"], webSocket: ["wss://eth-goerli.g.alchemy.com/v2"] }, infura: { http: ["https://goerli.infura.io/v3"], webSocket: ["wss://goerli.infura.io/ws/v3"] }, default: { http: ["https://rpc.ankr.com/eth_goerli"] }, public: { http: ["https://rpc.ankr.com/eth_goerli"] } }, blockExplorers: { etherscan: { name: "Etherscan", url: "https://goerli.etherscan.io" }, default: { name: "Etherscan", url: "https://goerli.etherscan.io" } }, contracts: { ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" }, ensUniversalResolver: { address: "0x56522D00C410a43BFfDF00a9A569489297385790", blockCreated: 8765204 }, multicall3: { address: "0xca11bde05977b3631167028862be2a173976ca11", blockCreated: 6507670 } }, testnet: true }); const mainnet = /* @__PURE__ */ defineChain({ id: 1, network: "homestead", name: "Ethereum", nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, rpcUrls: { alchemy: { http: ["https://eth-mainnet.g.alchemy.com/v2"], webSocket: ["wss://eth-mainnet.g.alchemy.com/v2"] }, infura: { http: ["https://mainnet.infura.io/v3"], webSocket: ["wss://mainnet.infura.io/ws/v3"] }, default: { http: ["https://cloudflare-eth.com"] }, public: { http: ["https://cloudflare-eth.com"] } }, blockExplorers: { etherscan: { name: "Etherscan", url: "https://etherscan.io" }, default: { name: "Etherscan", url: "https://etherscan.io" } }, contracts: { ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" }, ensUniversalResolver: { address: "0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62", blockCreated: 16966585 }, multicall3: { address: "0xca11bde05977b3631167028862be2a173976ca11", blockCreated: 14353601 } } }); var ChainNotConfiguredForConnectorError = class extends Error { constructor({ chainId, connectorId }) { super(`Chain "${chainId}" not configured for connector "${connectorId}".`); this.name = "ChainNotConfiguredForConnectorError"; } }; var ConnectorNotFoundError = class extends Error { constructor() { super(...arguments); this.name = "ConnectorNotFoundError"; this.message = "Connector not found"; } }; function normalizeChainId(chainId) { if (typeof chainId === "string") return Number.parseInt( chainId, chainId.trim().substring(0, 2) === "0x" ? 16 : 10 ); if (typeof chainId === "bigint") return Number(chainId); return chainId; } var eventemitter3$1 = { exports: {} }; (function(module2) { var has = Object.prototype.hasOwnProperty, prefix = "~"; function Events() { } if (Object.create) { Events.prototype = /* @__PURE__ */ Object.create(null); if (!new Events().__proto__) prefix = false; } function EE(fn2, context, once2) { this.fn = fn2; this.context = context; this.once = once2 || false; } function addListener(emitter, event, fn2, context, once2) { if (typeof fn2 !== "function") { throw new TypeError("The listener must be a function"); } var listener = new EE(fn2, context || emitter, once2), evt = prefix ? prefix + event : event; if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); else emitter._events[evt] = [emitter._events[evt], listener]; return emitter; } function clearEvent(emitter, evt) { if (--emitter._eventsCount === 0) emitter._events = new Events(); else delete emitter._events[evt]; } function EventEmitter2() { this._events = new Events(); this._eventsCount = 0; } EventEmitter2.prototype.eventNames = function eventNames() { var names = [], events2, name2; if (this._eventsCount === 0) return names; for (name2 in events2 = this._events) { if (has.call(events2, name2)) names.push(prefix ? name2.slice(1) : name2); } if (Object.getOwnPropertySymbols) { return names.concat(Object.getOwnPropertySymbols(events2)); } return names; }; EventEmitter2.prototype.listeners = function listeners(event) { var evt = prefix ? prefix + event : event, handlers = this._events[evt]; if (!handlers) return []; if (handlers.fn) return [handlers.fn]; for (var i2 = 0, l2 = handlers.length, ee2 = new Array(l2); i2 < l2; i2++) { ee2[i2] = handlers[i2].fn; } return ee2; }; EventEmitter2.prototype.listenerCount = function listenerCount2(event) { var evt = prefix ? prefix + event : event, listeners = this._events[evt]; if (!listeners) return 0; if (listeners.fn) return 1; return listeners.length; }; EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return false; var listeners = this._events[evt], len2 = arguments.length, args, i2; if (listeners.fn) { if (listeners.once) this.removeListener(event, listeners.fn, void 0, true); switch (len2) { case 1: return listeners.fn.call(listeners.context), true; case 2: return listeners.fn.call(listeners.context, a1), true; case 3: return listeners.fn.call(listeners.context, a1, a2), true; case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } for (i2 = 1, args = new Array(len2 - 1); i2 < len2; i2++) { args[i2 - 1] = arguments[i2]; } listeners.fn.apply(listeners.context, args); } else { var length = listeners.length, j2; for (i2 = 0; i2 < length; i2++) { if (listeners[i2].once) this.removeListener(event, listeners[i2].fn, void 0, true); switch (len2) { case 1: listeners[i2].fn.call(listeners[i2].context); break; case 2: listeners[i2].fn.call(listeners[i2].context, a1); break; case 3: listeners[i2].fn.call(listeners[i2].context, a1, a2); break; case 4: listeners[i2].fn.call(listeners[i2].context, a1, a2, a3); break; default: if (!args) for (j2 = 1, args = new Array(len2 - 1); j2 < len2; j2++) { args[j2 - 1] = arguments[j2]; } listeners[i2].fn.apply(listeners[i2].context, args); } } } return true; }; EventEmitter2.prototype.on = function on2(event, fn2, context) { return addListener(this, event, fn2, context, false); }; EventEmitter2.prototype.once = function once2(event, fn2, context) { return addListener(this, event, fn2, context, true); }; EventEmitter2.prototype.removeListener = function removeListener(event, fn2, context, once2) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return this; if (!fn2) { clearEvent(this, evt); return this; } var listeners = this._events[evt]; if (listeners.fn) { if (listeners.fn === fn2 && (!once2 || listeners.once) && (!context || listeners.context === context)) { clearEvent(this, evt); } } else { for (var i2 = 0, events2 = [], length = listeners.length; i2 < length; i2++) { if (listeners[i2].fn !== fn2 || once2 && !listeners[i2].once || context && listeners[i2].context !== context) { events2.push(listeners[i2]); } } if (events2.length) this._events[evt] = events2.length === 1 ? events2[0] : events2; else clearEvent(this, evt); } return this; }; EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) { var evt; if (event) { evt = prefix ? prefix + event : event; if (this._events[evt]) clearEvent(this, evt); } else { this._events = new Events(); this._eventsCount = 0; } return this; }; EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener; EventEmitter2.prototype.addListener = EventEmitter2.prototype.on; EventEmitter2.prefixed = prefix; EventEmitter2.EventEmitter = EventEmitter2; { module2.exports = EventEmitter2; } })(eventemitter3$1); var eventemitter3Exports$1 = eventemitter3$1.exports; const EventEmitter$1 = /* @__PURE__ */ getDefaultExportFromCjs(eventemitter3Exports$1); var __accessCheck$1 = (obj, member, msg) => { if (!member.has(obj)) throw TypeError("Cannot " + msg); }; var __privateGet$1 = (obj, member, getter) => { __accessCheck$1(obj, member, "read from private field"); return getter ? getter.call(obj) : member.get(obj); }; var __privateAdd$1 = (obj, member, value) => { if (member.has(obj)) throw TypeError("Cannot add the same private member more than once"); member instanceof WeakSet ? member.add(obj) : member.set(obj, value); }; var __privateSet$1 = (obj, member, value, setter) => { __accessCheck$1(obj, member, "write to private field"); setter ? setter.call(obj, value) : member.set(obj, value); return value; }; var __privateMethod$1 = (obj, member, method) => { __accessCheck$1(obj, member, "access private method"); return method; }; var Connector = class extends EventEmitter$1 { constructor({ chains: chains2 = [mainnet, goerli], options }) { super(); this.chains = chains2; this.options = options; } getBlockExplorerUrls(chain) { const { default: blockExplorer, ...blockExplorers } = chain.blockExplorers ?? {}; if (blockExplorer) return [ blockExplorer.url, ...Object.values(blockExplorers).map((x2) => x2.url) ]; } isChainUnsupported(chainId) { return !this.chains.some((x2) => x2.id === chainId); } setStorage(storage) { this.storage = storage; } }; function getInjectedName(ethereum2) { var _a2; if (!ethereum2) return "Injected"; const getName = (provider) => { if (provider.isApexWallet) return "Apex Wallet"; if (provider.isAvalanche) return "Core Wallet"; if (provider.isBackpack) return "Backpack"; if (provider.isBifrost) return "Bifrost Wallet"; if (provider.isBitKeep) return "BitKeep"; if (provider.isBitski) return "Bitski"; if (provider.isBlockWallet) return "BlockWallet"; if (provider.isBraveWallet) return "Brave Wallet"; if (provider.isCoin98) return "Coin98 Wallet"; if (provider.isCoinbaseWallet) return "Coinbase Wallet"; if (provider.isDawn) return "Dawn Wallet"; if (provider.isDefiant) return "Defiant"; if (provider.isDesig) return "Desig Wallet"; if (provider.isEnkrypt) return "Enkrypt"; if (provider.isExodus) return "Exodus"; if (provider.isFordefi) return "Fordefi"; if (provider.isFrame) return "Frame"; if (provider.isFrontier) return "Frontier Wallet"; if (provider.isGamestop) return "GameStop Wallet"; if (provider.isHaqqWallet) return "HAQQ Wallet"; if (provider.isHyperPay) return "HyperPay Wallet"; if (provider.isImToken) return "ImToken"; if (provider.isHaloWallet) return "Halo Wallet"; if (provider.isKuCoinWallet) return "KuCoin Wallet"; if (provider.isMathWallet) return "MathWallet"; if (provider.isNovaWallet) return "Nova Wallet"; if (provider.isOkxWallet || provider.isOKExWallet) return "OKX Wallet"; if (provider.isOktoWallet) return "Okto Wallet"; if (provider.isOneInchIOSWallet || provider.isOneInchAndroidWallet) return "1inch Wallet"; if (provider.isOneKey) return "OneKey Wallet"; if (provider.isOpera) return "Opera"; if (provider.isPhantom) return "Phantom"; if (provider.isPortal) return "Ripio Portal"; if (provider.isRabby) return "Rabby Wallet"; if (provider.isRainbow) return "Rainbow"; if (provider.isSafePal) return "SafePal Wallet"; if (provider.isStatus) return "Status"; if (provider.isSubWallet) return "SubWallet"; if (provider.isTalisman) return "Talisman"; if (provider.isTally) return "Taho"; if (provider.isTokenPocket) return "TokenPocket"; if (provider.isTokenary) return "Tokenary"; if (provider.isTrust || provider.isTrustWallet) return "Trust Wallet"; if (provider.isTTWallet) return "TTWallet"; if (provider.isXDEFI) return "XDEFI Wallet"; if (provider.isZeal) return "Zeal"; if (provider.isZerion) return "Zerion"; if (provider.isMetaMask) return "MetaMask"; }; if ((_a2 = ethereum2.providers) == null ? void 0 : _a2.length) { const nameSet = /* @__PURE__ */ new Set(); let unknownCount = 1; for (const provider of ethereum2.providers) { let name2 = getName(provider); if (!name2) { name2 = `Unknown Wallet #${unknownCount}`; unknownCount += 1; } nameSet.add(name2); } const names = [...nameSet]; if (names.length) return names; return names[0] ?? "Injected"; } return getName(ethereum2) ?? "Injected"; } var _provider$2; var InjectedConnector = class extends Connector { constructor({ chains: chains2, options: options_ } = {}) { const options = { shimDisconnect: true, getProvider() { if (typeof window === "undefined") return; const ethereum2 = window.ethereum; if ((ethereum2 == null ? void 0 : ethereum2.providers) && ethereum2.providers.length > 0) return ethereum2.providers[0]; return ethereum2; }, ...options_ }; super({ chains: chains2, options }); this.id = "injected"; __privateAdd$1(this, _provider$2, void 0); this.shimDisconnectKey = `${this.id}.shimDisconnect`; this.onAccountsChanged = (accounts) => { if (accounts.length === 0) this.emit("disconnect"); else this.emit("change", { account: getAddress(accounts[0]) }); }; this.onChainChanged = (chainId) => { const id2 = normalizeChainId(chainId); const unsupported = this.isChainUnsupported(id2); this.emit("change", { chain: { id: id2, unsupported } }); }; this.onDisconnect = async (error2) => { var _a2; if (error2.code === 1013) { const provider2 = await this.getProvider(); if (provider2) { const isAuthorized = await this.getAccount(); if (isAuthorized) return; } } this.emit("disconnect"); if (this.options.shimDisconnect) (_a2 = this.storage) == null ? void 0 : _a2.removeItem(this.shimDisconnectKey); }; const provider = options.getProvider(); if (typeof options.name === "string") this.name = options.name; else if (provider) { const detectedName = getInjectedName(provider); if (options.name) this.name = options.name(detectedName); else { if (typeof detectedName === "string") this.name = detectedName; else this.name = detectedName[0]; } } else this.name = "Injected"; this.ready = !!provider; } async connect({ chainId } = {}) { var _a2; try { const provider = await this.getProvider(); if (!provider) throw new ConnectorNotFoundError(); if (provider.on) { provider.on("accountsChanged", this.onAccountsChanged); provider.on("chainChanged", this.onChainChanged); provider.on("disconnect", this.onDisconnect); } this.emit("message", { type: "connecting" }); const accounts = await provider.request({ method: "eth_requestAccounts" }); const account = getAddress(accounts[0]); let id2 = await this.getChainId(); let unsupported = this.isChainUnsupported(id2); if (chainId && id2 !== chainId) { const chain = await this.switchChain(chainId); id2 = chain.id; unsupported = this.isChainUnsupported(id2); } if (this.options.shimDisconnect) (_a2 = this.storage) == null ? void 0 : _a2.setItem(this.shimDisconnectKey, true); return { account, chain: { id: id2, unsupported } }; } catch (error2) { if (this.isUserRejectedRequestError(error2)) throw new UserRejectedRequestError(error2); if (error2.code === -32002) throw new ResourceUnavailableRpcError(error2); throw error2; } } async disconnect() { var _a2; const provider = await this.getProvider(); if (!(provider == null ? void 0 : provider.removeListener)) return; provider.removeListener("accountsChanged", this.onAccountsChanged); provider.removeListener("chainChanged", this.onChainChanged); provider.removeListener("disconnect", this.onDisconnect); if (this.options.shimDisconnect) (_a2 = this.storage) == null ? void 0 : _a2.removeItem(this.shimDisconnectKey); } async getAccount() { const provider = await this.getProvider(); if (!provider) throw new ConnectorNotFoundError(); const accounts = await provider.request({ method: "eth_accounts" }); return getAddress(accounts[0]); } async getChainId() { const provider = await this.getProvider(); if (!provider) throw new ConnectorNotFoundError(); return provider.request({ method: "eth_chainId" }).then(normalizeChainId); } async getProvider() { const provider = this.options.getProvider(); if (provider) __privateSet$1(this, _provider$2, provider); return __privateGet$1(this, _provider$2); } async getWalletClient({ chainId } = {}) { const [provider, account] = await Promise.all([ this.getProvider(), this.getAccount() ]); const chain = this.chains.find((x2) => x2.id === chainId); if (!provider) throw new Error("provider is required."); return createWalletClient({ account, chain, transport: custom$1(provider) }); } async isAuthorized() { var _a2; try { if (this.options.shimDisconnect && !((_a2 = this.storage) == null ? void 0 : _a2.getItem(this.shimDisconnectKey))) return false; const provider = await this.getProvider(); if (!provider) throw new ConnectorNotFoundError(); const account = await this.getAccount(); return !!account; } catch { return false; } } async switchChain(chainId) { var _a2, _b2, _c2; const provider = await this.getProvider(); if (!provider) throw new ConnectorNotFoundError(); const id2 = numberToHex$1(chainId); try { await Promise.all([ provider.request({ method: "wallet_switchEthereumChain", params: [{ chainId: id2 }] }), new Promise( (res) => this.on("change", ({ chain }) => { if ((chain == null ? void 0 : chain.id) === chainId) res(); }) ) ]); return this.chains.find((x2) => x2.id === chainId) ?? { id: chainId, name: `Chain ${id2}`, network: `${id2}`, nativeCurrency: { name: "Ether", decimals: 18, symbol: "ETH" }, rpcUrls: { default: { http: [""] }, public: { http: [""] } } }; } catch (error2) { const chain = this.chains.find((x2) => x2.id === chainId); if (!chain) throw new ChainNotConfiguredForConnectorError({ chainId, connectorId: this.id }); if (error2.code === 4902 || ((_b2 = (_a2 = error2 == null ? void 0 : error2.data) == null ? void 0 : _a2.originalError) == null ? void 0 : _b2.code) === 4902) { try { await provider.request({ method: "wallet_addEthereumChain", params: [ { chainId: id2, chainName: chain.name, nativeCurrency: chain.nativeCurrency, rpcUrls: [((_c2 = chain.rpcUrls.public) == null ? void 0 : _c2.http[0]) ?? ""], blockExplorerUrls: this.getBlockExplorerUrls(chain) } ] }); const currentChainId = await this.getChainId(); if (currentChainId !== chainId) throw new UserRejectedRequestError( new Error("User rejected switch after adding network.") ); return chain; } catch (error22) { throw new UserRejectedRequestError(error22); } } if (this.isUserRejectedRequestError(error2)) throw new UserRejectedRequestError(error2); throw new SwitchChainError(error2); } } async watchAsset({ address, decimals = 18, image, symbol }) { const provider = await this.getProvider(); if (!provider) throw new ConnectorNotFoundError(); return provider.request({ method: "wallet_watchAsset", params: { type: "ERC20", options: { address, decimals, image, symbol } } }); } isUserRejectedRequestError(error2) { return error2.code === 4001; } }; _provider$2 = /* @__PURE__ */ new WeakMap(); var __accessCheck = (obj, member, msg) => { if (!member.has(obj)) throw TypeError("Cannot " + msg); }; var __privateGet = (obj, member, getter) => { __accessCheck(obj, member, "read from private field"); return getter ? getter.call(obj) : member.get(obj); }; var __privateAdd = (obj, member, value) => { if (member.has(obj)) throw TypeError("Cannot add the same private member more than once"); member instanceof WeakSet ? member.add(obj) : member.set(obj, value); }; var __privateSet = (obj, member, value, setter) => { __accessCheck(obj, member, "write to private field"); setter ? setter.call(obj, value) : member.set(obj, value); return value; }; var __privateMethod = (obj, member, method) => { __accessCheck(obj, member, "access private method"); return method; }; const subscribeWithSelectorImpl = (fn2) => (set2, get2, api2) => { const origSubscribe = api2.subscribe; api2.subscribe = (selector, optListener, options) => { let listener = selector; if (optListener) { const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is; let currentSlice = selector(api2.getState()); listener = (state2) => { const nextSlice = selector(state2); if (!equalityFn(currentSlice, nextSlice)) { const previousSlice = currentSlice; optListener(currentSlice = nextSlice, previousSlice); } }; if (options == null ? void 0 : options.fireImmediately) { optListener(currentSlice, currentSlice); } } return origSubscribe(listener); }; const initialState = fn2(set2, get2, api2); return initialState; }; const subscribeWithSelector = subscribeWithSelectorImpl; function createJSONStorage(getStorage, options) { let storage; try { storage = getStorage(); } catch (e2) { return; } const persistStorage = { getItem: (name2) => { var _a2; const parse2 = (str2) => { if (str2 === null) { return null; } return JSON.parse(str2, options == null ? void 0 : options.reviver); }; const str = (_a2 = storage.getItem(name2)) != null ? _a2 : null; if (str instanceof Promise) { return str.then(parse2); } return parse2(str); }, setItem: (name2, newValue) => storage.setItem( name2, JSON.stringify(newValue, options == null ? void 0 : options.replacer) ), removeItem: (name2) => storage.removeItem(name2) }; return persistStorage; } const toThenable = (fn2) => (input) => { try { const result = fn2(input); if (result instanceof Promise) { return result; } return { then(onFulfilled) { return toThenable(onFulfilled)(result); }, catch(_onRejected) { return this; } }; } catch (e2) { return { then(_onFulfilled) { return this; }, catch(onRejected) { return toThenable(onRejected)(e2); } }; } }; const oldImpl = (config2, baseOptions) => (set2, get2, api2) => { let options = { getStorage: () => localStorage, serialize: JSON.stringify, deserialize: JSON.parse, partialize: (state2) => state2, version: 0, merge: (persistedState, currentState) => ({ ...currentState, ...persistedState }), ...baseOptions }; let hasHydrated = false; const hydrationListeners = /* @__PURE__ */ new Set(); const finishHydrationListeners = /* @__PURE__ */ new Set(); let storage; try { storage = options.getStorage(); } catch (e2) { } if (!storage) { return config2( (...args) => { console.warn( `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.` ); set2(...args); }, get2, api2 ); } const thenableSerialize = toThenable(options.serialize); const setItem = () => { const state2 = options.partialize({ ...get2() }); let errorInSync; const thenable = thenableSerialize({ state: state2, version: options.version }).then( (serializedValue) => storage.setItem(options.name, serializedValue) ).catch((e2) => { errorInSync = e2; }); if (errorInSync) { throw errorInSync; } return thenable; }; const savedSetState = api2.setState; api2.setState = (state2, replace) => { savedSetState(state2, replace); void setItem(); }; const configResult = config2( (...args) => { set2(...args); void setItem(); }, get2, api2 ); let stateFromStorage; const hydrate = () => { var _a2; if (!storage) return; hasHydrated = false; hydrationListeners.forEach((cb) => cb(get2())); const postRehydrationCallback = ((_a2 = options.onRehydrateStorage) == null ? void 0 : _a2.call(options, get2())) || void 0; return toThenable(storage.getItem.bind(storage))(options.name).then((storageValue) => { if (storageValue) { return options.deserialize(storageValue); } }).then((deserializedStorageValue) => { if (deserializedStorageValue) { if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) { if (options.migrate) { return options.migrate( deserializedStorageValue.state, deserializedStorageValue.version ); } console.error( `State loaded from storage couldn't be migrated since no migrate function was provided` ); } else { return deserializedStorageValue.state; } } }).then((migratedState) => { var _a22; stateFromStorage = options.merge( migratedState, (_a22 = get2()) != null ? _a22 : configResult ); set2(stateFromStorage, true); return setItem(); }).then(() => { postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0); hasHydrated = true; finishHydrationListeners.forEach((cb) => cb(stateFromStorage)); }).catch((e2) => { postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e2); }); }; api2.persist = { setOptions: (newOptions) => { options = { ...options, ...newOptions }; if (newOptions.getStorage) { storage = newOptions.getStorage(); } }, clearStorage: () => { storage == null ? void 0 : storage.removeItem(options.name); }, getOptions: () => options, rehydrate: () => hydrate(), hasHydrated: () => hasHydrated, onHydrate: (cb) => { hydrationListeners.add(cb); return () => { hydrationListeners.delete(cb); }; }, onFinishHydration: (cb) => { finishHydrationListeners.add(cb); return () => { finishHydrationListeners.delete(cb); }; } }; hydrate(); return stateFromStorage || configResult; }; const newImpl = (config2, baseOptions) => (set2, get2, api2) => { let options = { storage: createJSONStorage(() => localStorage), partialize: (state2) => state2, version: 0, merge: (persistedState, currentState) => ({ ...currentState, ...persistedState }), ...baseOptions }; let hasHydrated = false; const hydrationListeners = /* @__PURE__ */ new Set(); const finishHydrationListeners = /* @__PURE__ */ new Set(); let storage = options.storage; if (!storage) { return config2( (...args) => { console.warn( `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.` ); set2(...args); }, get2, api2 ); } const setItem = () => { const state2 = options.partialize({ ...get2() }); return storage.setItem(options.name, { state: state2, version: options.version }); }; const savedSetState = api2.setState; api2.setState = (state2, replace) => { savedSetState(state2, replace); void setItem(); }; const configResult = config2( (...args) => { set2(...args); void setItem(); }, get2, api2 ); api2.getInitialState = () => configResult; let stateFromStorage; const hydrate = () => { var _a2, _b2; if (!storage) return; hasHydrated = false; hydrationListeners.forEach((cb) => { var _a22; return cb((_a22 = get2()) != null ? _a22 : configResult); }); const postRehydrationCallback = ((_b2 = options.onRehydrateStorage) == null ? void 0 : _b2.call(options, (_a2 = get2()) != null ? _a2 : configResult)) || void 0; return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => { if (deserializedStorageValue) { if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) { if (options.migrate) { return options.migrate( deserializedStorageValue.state, deserializedStorageValue.version ); } console.error( `State loaded from storage couldn't be migrated since no migrate function was provided` ); } else { return deserializedStorageValue.state; } } }).then((migratedState) => { var _a22; stateFromStorage = options.merge( migratedState, (_a22 = get2()) != null ? _a22 : configResult ); set2(stateFromStorage, true); return setItem(); }).then(() => { postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0); stateFromStorage = get2(); hasHydrated = true; finishHydrationListeners.forEach((cb) => cb(stateFromStorage)); }).catch((e2) => { postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e2); }); }; api2.persist = { setOptions: (newOptions) => { options = { ...options, ...newOptions }; if (newOptions.storage) { storage = newOptions.storage; } }, clearStorage: () => { storage == null ? void 0 : storage.removeItem(options.name); }, getOptions: () => options, rehydrate: () => hydrate(), hasHydrated: () => hasHydrated, onHydrate: (cb) => { hydrationListeners.add(cb); return () => { hydrationListeners.delete(cb); }; }, onFinishHydration: (cb) => { finishHydrationListeners.add(cb); return () => { finishHydrationListeners.delete(cb); }; } }; if (!options.skipHydration) { hydrate(); } return stateFromStorage || configResult; }; const persistImpl = (config2, baseOptions) => { if ("getStorage" in baseOptions || "serialize" in baseOptions || "deserialize" in baseOptions) { if (({ "VITE_TERMS_OF_SERVICE_LINK": "https://elephant.money/terms.html", "VITE_PRIVACY_POLICY_LINK": "https://elephant.money/privacy.html", "VITE_APPLICATION_ID": "b0cff6026f93d0adda95a835f59a957d", "VITE_ERC20_TOKEN": "0xE283D0e3B8c102BAdF5E8166B73E02D96d92F688", "BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": false } ? "production" : void 0) !== "production") { console.warn( "[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead." ); } return oldImpl(config2, baseOptions); } return newImpl(config2, baseOptions); }; const persist = persistImpl; const createStoreImpl = (createState) => { let state2; const listeners = /* @__PURE__ */ new Set(); const setState = (partial2, replace) => { const nextState = typeof partial2 === "function" ? partial2(state2) : partial2; if (!Object.is(nextState, state2)) { const previousState = state2; state2 = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state2, nextState); listeners.forEach((listener) => listener(state2, previousState)); } }; const getState = () => state2; const getInitialState = () => initialState; const subscribe2 = (listener) => { listeners.add(listener); return () => listeners.delete(listener); }; const destroy2 = () => { if (({ "VITE_TERMS_OF_SERVICE_LINK": "https://elephant.money/terms.html", "VITE_PRIVACY_POLICY_LINK": "https://elephant.money/privacy.html", "VITE_APPLICATION_ID": "b0cff6026f93d0adda95a835f59a957d", "VITE_ERC20_TOKEN": "0xE283D0e3B8c102BAdF5E8166B73E02D96d92F688", "BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": false } ? "production" : void 0) !== "production") { console.warn( "[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected." ); } listeners.clear(); }; const api2 = { setState, getState, getInitialState, subscribe: subscribe2, destroy: destroy2 }; const initialState = state2 = createState(setState, getState, api2); return api2; }; const createStore$1 = (createState) => createState ? createStoreImpl(createState) : createStoreImpl; function shallow$1(objA, objB) { if (Object.is(objA, objB)) { return true; } if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { return false; } if (objA instanceof Map && objB instanceof Map) { if (objA.size !== objB.size) return false; for (const [key, value] of objA) { if (!Object.is(value, objB.get(key))) { return false; } } return true; } if (objA instanceof Set && objB instanceof Set) { if (objA.size !== objB.size) return false; for (const value of objA) { if (!objB.has(value)) { return false; } } return true; } const keysA = Object.keys(objA); if (keysA.length !== Object.keys(objB).length) { return false; } for (const keyA of keysA) { if (!Object.prototype.hasOwnProperty.call(objB, keyA) || !Object.is(objA[keyA], objB[keyA])) { return false; } } return true; } function configureChains(defaultChains, providers, { batch = { multicall: { wait: 32 } }, pollingInterval = 4e3, rank, retryCount, retryDelay, stallTimeout } = {}) { if (!defaultChains.length) throw new Error("must have at least one chain"); let chains2 = []; const httpUrls = {}; const wsUrls = {}; for (const chain of defaultChains) { let configExists = false; for (const provider of providers) { const apiConfig = provider(chain); if (!apiConfig) continue; configExists = true; if (!chains2.some(({ id: id2 }) => id2 === chain.id)) { chains2 = [...chains2, apiConfig.chain]; } httpUrls[chain.id] = [ ...httpUrls[chain.id] || [], ...apiConfig.rpcUrls.http ]; if (apiConfig.rpcUrls.webSocket) { wsUrls[chain.id] = [ ...wsUrls[chain.id] || [], ...apiConfig.rpcUrls.webSocket ]; } } if (!configExists) { throw new Error( [ `Could not find valid provider configuration for chain "${chain.name}". `, "You may need to add `jsonRpcProvider` to `configureChains` with the chain's RPC URLs.", "Read more: https://wagmi.sh/core/providers/jsonRpc" ].join("\n") ); } } return { chains: chains2, publicClient: ({ chainId }) => { const activeChain = chains2.find((x2) => x2.id === chainId) ?? defaultChains[0]; const chainHttpUrls = httpUrls[activeChain.id]; if (!chainHttpUrls || !chainHttpUrls[0]) throw new Error(`No providers configured for chain "${activeChain.id}"`); const publicClient = createPublicClient({ batch, chain: activeChain, transport: fallback( chainHttpUrls.map((url) => http(url, { timeout: stallTimeout })), { rank, retryCount, retryDelay } ), pollingInterval }); return Object.assign(publicClient, { chains: chains2 }); }, webSocketPublicClient: ({ chainId }) => { const activeChain = chains2.find((x2) => x2.id === chainId) ?? defaultChains[0]; const chainWsUrls = wsUrls[activeChain.id]; if (!chainWsUrls || !chainWsUrls[0]) return void 0; const publicClient = createPublicClient({ batch, chain: activeChain, transport: fallback( chainWsUrls.map((url) => webSocket(url, { timeout: stallTimeout })), { rank, retryCount, retryDelay } ), pollingInterval }); return Object.assign(publicClient, { chains: chains2 }); } }; } var ChainNotConfiguredError = class extends Error { constructor({ chainId, connectorId }) { super( `Chain "${chainId}" not configured${connectorId ? ` for connector "${connectorId}"` : ""}.` ); this.name = "ChainNotConfigured"; } }; var ConnectorAlreadyConnectedError = class extends Error { constructor() { super(...arguments); this.name = "ConnectorAlreadyConnectedError"; this.message = "Connector already connected"; } }; var ConfigChainsNotFound = class extends Error { constructor() { super(...arguments); this.name = "ConfigChainsNotFound"; this.message = "No chains were found on the wagmi config. Some functions that require a chain may not work."; } }; var SwitchChainNotSupportedError = class extends Error { constructor({ connector }) { super(`"${connector.name}" does not support programmatic chain switching.`); this.name = "SwitchChainNotSupportedError"; } }; var findAndReplace = (cacheRef, { find, replace }) => { if (cacheRef && find(cacheRef)) { return replace(cacheRef); } if (typeof cacheRef !== "object") { return cacheRef; } if (Array.isArray(cacheRef)) { return cacheRef.map((item) => findAndReplace(item, { find, replace })); } if (cacheRef instanceof Object) { return Object.entries(cacheRef).reduce( (curr, [key, value]) => ({ ...curr, [key]: findAndReplace(value, { find, replace }) }), {} ); } return cacheRef; }; function deserialize(cachedString) { const cache = JSON.parse(cachedString); const deserializedCacheWithBigInts = findAndReplace(cache, { find: (data2) => typeof data2 === "string" && data2.startsWith("#bigint."), replace: (data2) => BigInt(data2.replace("#bigint.", "")) }); return deserializedCacheWithBigInts; } function getUnit(unit) { if (typeof unit === "number") return unit; if (unit === "wei") return 0; return Math.abs(weiUnits[unit]); } function getReferenceKey(keys2, cutoff) { return keys2.slice(0, cutoff).join(".") || "."; } function getCutoff(array2, value) { const { length } = array2; for (let index2 = 0; index2 < length; ++index2) { if (array2[index2] === value) { return index2 + 1; } } return 0; } function createReplacer(replacer, circularReplacer) { const hasReplacer = typeof replacer === "function"; const hasCircularReplacer = typeof circularReplacer === "function"; const cache = []; const keys2 = []; return function replace(key, value) { if (typeof value === "object") { if (cache.length) { const thisCutoff = getCutoff(cache, this); if (thisCutoff === 0) { cache[cache.length] = this; } else { cache.splice(thisCutoff); keys2.splice(thisCutoff); } keys2[keys2.length] = key; const valueCutoff = getCutoff(cache, value); if (valueCutoff !== 0) { return hasCircularReplacer ? circularReplacer.call( this, key, value, getReferenceKey(keys2, valueCutoff) ) : `[ref=${getReferenceKey(keys2, valueCutoff)}]`; } } else { cache[0] = value; keys2[0] = key; } } return hasReplacer ? replacer.call(this, key, value) : value; }; } function serialize$1(value, replacer, indent, circularReplacer) { return JSON.stringify( value, createReplacer((key, value_) => { const value2 = typeof value_ === "bigint" ? `#bigint.${value_.toString()}` : value_; return (replacer == null ? void 0 : replacer(key, value2)) || value2; }, circularReplacer), indent ?? void 0 ); } var noopStorage = { getItem: (_key) => "", setItem: (_key, _value) => null, removeItem: (_key) => null }; function createStorage$1({ deserialize: deserialize2 = deserialize, key: prefix = "wagmi", serialize: serialize2 = serialize$1, storage }) { return { ...storage, getItem: (key, defaultState = null) => { const value = storage.getItem(`${prefix}.${key}`); try { return value ? deserialize2(value) : defaultState; } catch (error2) { console.warn(error2); return defaultState; } }, setItem: (key, value) => { if (value === null) { storage.removeItem(`${prefix}.${key}`); } else { try { storage.setItem(`${prefix}.${key}`, serialize2(value)); } catch (err) { console.error(err); } } }, removeItem: (key) => storage.removeItem(`${prefix}.${key}`) }; } var storeKey = "store"; var _isAutoConnecting, _lastUsedConnector, _addEffects, addEffects_fn; var Config = class { constructor({ autoConnect = false, connectors = [new InjectedConnector()], publicClient, storage = createStorage$1({ storage: typeof window !== "undefined" ? window.localStorage : noopStorage }), logger = { warn: console.warn }, webSocketPublicClient }) { var _a2, _b2; __privateAdd(this, _addEffects); this.publicClients = /* @__PURE__ */ new Map(); this.webSocketPublicClients = /* @__PURE__ */ new Map(); __privateAdd(this, _isAutoConnecting, void 0); __privateAdd(this, _lastUsedConnector, void 0); this.args = { autoConnect, connectors, logger, publicClient, storage, webSocketPublicClient }; let status = "disconnected"; let chainId; if (autoConnect) { try { const rawState = storage.getItem(storeKey); const data2 = (_a2 = rawState == null ? void 0 : rawState.state) == null ? void 0 : _a2.data; status = (data2 == null ? void 0 : data2.account) ? "reconnecting" : "connecting"; chainId = (_b2 = data2 == null ? void 0 : data2.chain) == null ? void 0 : _b2.id; } catch (_error) { } } const connectors_ = typeof connectors === "function" ? connectors() : connectors; connectors_.forEach((connector) => connector.setStorage(storage)); this.store = createStore$1( subscribeWithSelector( persist( () => ({ connectors: connectors_, publicClient: this.getPublicClient({ chainId }), status, webSocketPublicClient: this.getWebSocketPublicClient({ chainId }) }), { name: storeKey, storage, partialize: (state2) => { var _a3, _b3; return { ...autoConnect && { data: { account: (_a3 = state2 == null ? void 0 : state2.data) == null ? void 0 : _a3.account, chain: (_b3 = state2 == null ? void 0 : state2.data) == null ? void 0 : _b3.chain } }, chains: state2 == null ? void 0 : state2.chains }; }, version: 2 } ) ) ); this.storage = storage; __privateSet(this, _lastUsedConnector, storage == null ? void 0 : storage.getItem("wallet")); __privateMethod(this, _addEffects, addEffects_fn).call(this); if (autoConnect && typeof window !== "undefined") setTimeout(async () => await this.autoConnect(), 0); } get chains() { return this.store.getState().chains; } get connectors() { return this.store.getState().connectors; } get connector() { return this.store.getState().connector; } get data() { return this.store.getState().data; } get error() { return this.store.getState().error; } get lastUsedChainId() { var _a2, _b2; return (_b2 = (_a2 = this.data) == null ? void 0 : _a2.chain) == null ? void 0 : _b2.id; } get publicClient() { return this.store.getState().publicClient; } get status() { return this.store.getState().status; } get subscribe() { return this.store.subscribe; } get webSocketPublicClient() { return this.store.getState().webSocketPublicClient; } setState(updater) { const newState = typeof updater === "function" ? updater(this.store.getState()) : updater; this.store.setState(newState, true); } clearState() { this.setState((x2) => ({ ...x2, chains: void 0, connector: void 0, data: void 0, error: void 0, status: "disconnected" })); } async destroy() { var _a2, _b2; if (this.connector) await ((_b2 = (_a2 = this.connector).disconnect) == null ? void 0 : _b2.call(_a2)); __privateSet(this, _isAutoConnecting, false); this.clearState(); this.store.destroy(); } async autoConnect() { if (__privateGet(this, _isAutoConnecting)) return; __privateSet(this, _isAutoConnecting, true); this.setState((x2) => { var _a2; return { ...x2, status: ((_a2 = x2.data) == null ? void 0 : _a2.account) ? "reconnecting" : "connecting" }; }); const sorted = __privateGet(this, _lastUsedConnector) ? [...this.connectors].sort( (x2) => x2.id === __privateGet(this, _lastUsedConnector) ? -1 : 1 ) : this.connectors; let connected = false; for (const connector of sorted) { if (!connector.ready || !connector.isAuthorized) continue; const isAuthorized = await connector.isAuthorized(); if (!isAuthorized) continue; const data2 = await connector.connect(); this.setState((x2) => ({ ...x2, connector, chains: connector == null ? void 0 : connector.chains, data: data2, status: "connected" })); connected = true; break; } if (!connected) this.setState((x2) => ({ ...x2, data: void 0, status: "disconnected" })); __privateSet(this, _isAutoConnecting, false); return this.data; } setConnectors(connectors) { this.args = { ...this.args, connectors }; const connectors_ = typeof connectors === "function" ? connectors() : connectors; connectors_.forEach((connector) => connector.setStorage(this.args.storage)); this.setState((x2) => ({ ...x2, connectors: connectors_ })); } getPublicClient({ chainId } = {}) { let publicClient_ = this.publicClients.get(-1); if (publicClient_ && (publicClient_ == null ? void 0 : publicClient_.chain.id) === chainId) return publicClient_; publicClient_ = this.publicClients.get(chainId ?? -1); if (publicClient_) return publicClient_; const { publicClient } = this.args; publicClient_ = typeof publicClient === "function" ? publicClient({ chainId }) : publicClient; this.publicClients.set(chainId ?? -1, publicClient_); return publicClient_; } setPublicClient(publicClient) { var _a2, _b2; const chainId = (_b2 = (_a2 = this.data) == null ? void 0 : _a2.chain) == null ? void 0 : _b2.id; this.args = { ...this.args, publicClient }; this.publicClients.clear(); this.setState((x2) => ({ ...x2, publicClient: this.getPublicClient({ chainId }) })); } getWebSocketPublicClient({ chainId } = {}) { let webSocketPublicClient_ = this.webSocketPublicClients.get(-1); if (webSocketPublicClient_ && (webSocketPublicClient_ == null ? void 0 : webSocketPublicClient_.chain.id) === chainId) return webSocketPublicClient_; webSocketPublicClient_ = this.webSocketPublicClients.get(chainId ?? -1); if (webSocketPublicClient_) return webSocketPublicClient_; const { webSocketPublicClient } = this.args; webSocketPublicClient_ = typeof webSocketPublicClient === "function" ? webSocketPublicClient({ chainId }) : webSocketPublicClient; if (webSocketPublicClient_) this.webSocketPublicClients.set(chainId ?? -1, webSocketPublicClient_); return webSocketPublicClient_; } setWebSocketPublicClient(webSocketPublicClient) { var _a2, _b2; const chainId = (_b2 = (_a2 = this.data) == null ? void 0 : _a2.chain) == null ? void 0 : _b2.id; this.args = { ...this.args, webSocketPublicClient }; this.webSocketPublicClients.clear(); this.setState((x2) => ({ ...x2, webSocketPublicClient: this.getWebSocketPublicClient({ chainId }) })); } setLastUsedConnector(lastUsedConnector = null) { var _a2; (_a2 = this.storage) == null ? void 0 : _a2.setItem("wallet", lastUsedConnector); } }; _isAutoConnecting = /* @__PURE__ */ new WeakMap(); _lastUsedConnector = /* @__PURE__ */ new WeakMap(); _addEffects = /* @__PURE__ */ new WeakSet(); addEffects_fn = function() { const onChange = (data2) => { this.setState((x2) => ({ ...x2, data: { ...x2.data, ...data2 } })); }; const onDisconnect = () => { this.clearState(); }; const onError = (error2) => { this.setState((x2) => ({ ...x2, error: error2 })); }; this.store.subscribe( ({ connector }) => connector, (connector, prevConnector) => { var _a2, _b2, _c2, _d, _e2, _f; (_a2 = prevConnector == null ? void 0 : prevConnector.off) == null ? void 0 : _a2.call(prevConnector, "change", onChange); (_b2 = prevConnector == null ? void 0 : prevConnector.off) == null ? void 0 : _b2.call(prevConnector, "disconnect", onDisconnect); (_c2 = prevConnector == null ? void 0 : prevConnector.off) == null ? void 0 : _c2.call(prevConnector, "error", onError); if (!connector) return; (_d = connector.on) == null ? void 0 : _d.call(connector, "change", onChange); (_e2 = connector.on) == null ? void 0 : _e2.call(connector, "disconnect", onDisconnect); (_f = connector.on) == null ? void 0 : _f.call(connector, "error", onError); } ); const { publicClient, webSocketPublicClient } = this.args; const subscribePublicClient = typeof publicClient === "function"; const subscribeWebSocketPublicClient = typeof webSocketPublicClient === "function"; if (subscribePublicClient || subscribeWebSocketPublicClient) this.store.subscribe( ({ data: data2 }) => { var _a2; return (_a2 = data2 == null ? void 0 : data2.chain) == null ? void 0 : _a2.id; }, (chainId) => { this.setState((x2) => ({ ...x2, publicClient: this.getPublicClient({ chainId }), webSocketPublicClient: this.getWebSocketPublicClient({ chainId }) })); } ); }; var config$1; function createConfig(args) { const config_ = new Config(args); config$1 = config_; return config_; } function getConfig() { if (!config$1) { throw new Error( "No wagmi config found. Ensure you have set up a config: https://wagmi.sh/react/config" ); } return config$1; } async function connect({ chainId, connector }) { const config2 = getConfig(); const activeConnector = config2.connector; if (activeConnector && connector.id === activeConnector.id) throw new ConnectorAlreadyConnectedError(); try { config2.setState((x2) => ({ ...x2, status: "connecting" })); const data2 = await connector.connect({ chainId }); config2.setLastUsedConnector(connector.id); config2.setState((x2) => ({ ...x2, connector, chains: connector == null ? void 0 : connector.chains, data: data2, status: "connected" })); config2.storage.setItem("connected", true); return { ...data2, connector }; } catch (err) { config2.setState((x2) => { return { ...x2, status: x2.connector ? "connected" : "disconnected" }; }); throw err; } } async function disconnect() { const config2 = getConfig(); if (config2.connector) await config2.connector.disconnect(); config2.clearState(); config2.storage.removeItem("connected"); } var erc20ABI = [ { type: "event", name: "Approval", inputs: [ { indexed: true, name: "owner", type: "address" }, { indexed: true, name: "spender", type: "address" }, { indexed: false, name: "value", type: "uint256" } ] }, { type: "event", name: "Transfer", inputs: [ { indexed: true, name: "from", type: "address" }, { indexed: true, name: "to", type: "address" }, { indexed: false, name: "value", type: "uint256" } ] }, { type: "function", name: "allowance", stateMutability: "view", inputs: [ { name: "owner", type: "address" }, { name: "spender", type: "address" } ], outputs: [ { name: "", type: "uint256" } ] }, { type: "function", name: "approve", stateMutability: "nonpayable", inputs: [ { name: "spender", type: "address" }, { name: "amount", type: "uint256" } ], outputs: [ { name: "", type: "bool" } ] }, { type: "function", name: "balanceOf", stateMutability: "view", inputs: [ { name: "account", type: "address" } ], outputs: [ { name: "", type: "uint256" } ] }, { type: "function", name: "decimals", stateMutability: "view", inputs: [], outputs: [ { name: "", type: "uint8" } ] }, { type: "function", name: "name", stateMutability: "view", inputs: [], outputs: [ { name: "", type: "string" } ] }, { type: "function", name: "symbol", stateMutability: "view", inputs: [], outputs: [ { name: "", type: "string" } ] }, { type: "function", name: "totalSupply", stateMutability: "view", inputs: [], outputs: [ { name: "", type: "uint256" } ] }, { type: "function", name: "transfer", stateMutability: "nonpayable", inputs: [ { name: "recipient", type: "address" }, { name: "amount", type: "uint256" } ], outputs: [ { name: "", type: "bool" } ] }, { type: "function", name: "transferFrom", stateMutability: "nonpayable", inputs: [ { name: "sender", type: "address" }, { name: "recipient", type: "address" }, { name: "amount", type: "uint256" } ], outputs: [ { name: "", type: "bool" } ] } ]; var erc20ABI_bytes32 = [ { type: "event", name: "Approval", inputs: [ { indexed: true, name: "owner", type: "address" }, { indexed: true, name: "spender", type: "address" }, { indexed: false, name: "value", type: "uint256" } ] }, { type: "event", name: "Transfer", inputs: [ { indexed: true, name: "from", type: "address" }, { indexed: true, name: "to", type: "address" }, { indexed: false, name: "value", type: "uint256" } ] }, { type: "function", name: "allowance", stateMutability: "view", inputs: [ { name: "owner", type: "address" }, { name: "spender", type: "address" } ], outputs: [ { name: "", type: "uint256" } ] }, { type: "function", name: "approve", stateMutability: "nonpayable", inputs: [ { name: "spender", type: "address" }, { name: "amount", type: "uint256" } ], outputs: [ { name: "", type: "bool" } ] }, { type: "function", name: "balanceOf", stateMutability: "view", inputs: [ { name: "account", type: "address" } ], outputs: [ { name: "", type: "uint256" } ] }, { type: "function", name: "decimals", stateMutability: "view", inputs: [], outputs: [ { name: "", type: "uint8" } ] }, { type: "function", name: "name", stateMutability: "view", inputs: [], outputs: [ { name: "", type: "bytes32" } ] }, { type: "function", name: "symbol", stateMutability: "view", inputs: [], outputs: [ { name: "", type: "bytes32" } ] }, { type: "function", name: "totalSupply", stateMutability: "view", inputs: [], outputs: [ { name: "", type: "uint256" } ] }, { type: "function", name: "transfer", stateMutability: "nonpayable", inputs: [ { name: "recipient", type: "address" }, { name: "amount", type: "uint256" } ], outputs: [ { name: "", type: "bool" } ] }, { type: "function", name: "transferFrom", stateMutability: "nonpayable", inputs: [ { name: "sender", type: "address" }, { name: "recipient", type: "address" }, { name: "amount", type: "uint256" } ], outputs: [ { name: "", type: "bool" } ] } ]; function getPublicClient({ chainId } = {}) { const config2 = getConfig(); if (chainId) return config2.getPublicClient({ chainId }) || config2.publicClient; return config2.publicClient; } async function getWalletClient({ chainId } = {}) { var _a2, _b2; const config2 = getConfig(); const walletClient = await ((_b2 = (_a2 = config2.connector) == null ? void 0 : _a2.getWalletClient) == null ? void 0 : _b2.call(_a2, { chainId })) || null; return walletClient; } async function multicall({ chainId, contracts, blockNumber, blockTag, ...args }) { const publicClient = getPublicClient({ chainId }); if (!publicClient.chains) throw new ConfigChainsNotFound(); if (chainId && publicClient.chain.id !== chainId) throw new ChainNotConfiguredError({ chainId }); return publicClient.multicall({ allowFailure: args.allowFailure ?? true, blockNumber, blockTag, contracts }); } async function readContract({ address, account, chainId, abi: abi2, args, functionName, blockNumber, blockTag }) { const publicClient = getPublicClient({ chainId }); return publicClient.readContract({ abi: abi2, address, account, functionName, args, blockNumber, blockTag }); } async function readContracts({ contracts, blockNumber, blockTag, ...args }) { const { allowFailure = true } = args; try { const publicClient = getPublicClient(); const contractsByChainId = contracts.reduce((contracts2, contract, index2) => { const chainId = contract.chainId ?? publicClient.chain.id; return { ...contracts2, [chainId]: [...contracts2[chainId] || [], { contract, index: index2 }] }; }, {}); const promises = () => Object.entries(contractsByChainId).map( ([chainId, contracts2]) => multicall({ allowFailure, chainId: parseInt(chainId), contracts: contracts2.map( ({ contract }) => contract ), blockNumber, blockTag }) ); const multicallResults = (await Promise.all(promises())).flat(); const resultIndexes = Object.values(contractsByChainId).flatMap( (contracts2) => contracts2.map(({ index: index2 }) => index2) ); return multicallResults.reduce((results2, result, index2) => { if (results2) results2[resultIndexes[index2]] = result; return results2; }, []); } catch (err) { if (err instanceof ContractFunctionExecutionError) throw err; const promises = () => contracts.map( (contract) => readContract({ ...contract, blockNumber, blockTag }) ); if (allowFailure) return (await Promise.allSettled(promises())).map((result) => { if (result.status === "fulfilled") return { result: result.value, status: "success" }; return { error: result.reason, result: void 0, status: "failure" }; }); return await Promise.all(promises()); } } async function fetchBalance({ address, chainId, formatUnits: unit, token: token2 }) { const config2 = getConfig(); const publicClient = getPublicClient({ chainId }); if (token2) { const fetchContractBalance = async ({ abi: abi2 }) => { const erc20Config = { abi: abi2, address: token2, chainId }; const [value2, decimals, symbol] = await readContracts({ allowFailure: false, contracts: [ { ...erc20Config, functionName: "balanceOf", args: [address] }, { ...erc20Config, functionName: "decimals" }, { ...erc20Config, functionName: "symbol" } ] }); return { decimals, formatted: formatUnits(value2 ?? "0", getUnit(unit ?? decimals)), symbol, value: value2 }; }; try { return await fetchContractBalance({ abi: erc20ABI }); } catch (err) { if (err instanceof ContractFunctionExecutionError) { const { symbol, ...rest } = await fetchContractBalance({ abi: erc20ABI_bytes32 }); return { symbol: hexToString(trim(symbol, { dir: "right" })), ...rest }; } throw err; } } const chains2 = [ ...config2.publicClient.chains || [], ...config2.chains ?? [] ]; const value = await publicClient.getBalance({ address }); const chain = chains2.find((x2) => x2.id === publicClient.chain.id); return { decimals: (chain == null ? void 0 : chain.nativeCurrency.decimals) ?? 18, formatted: formatUnits(value ?? "0", getUnit(unit ?? 18)), symbol: (chain == null ? void 0 : chain.nativeCurrency.symbol) ?? "ETH", value }; } function getAccount() { const { data: data2, connector, status } = getConfig(); switch (status) { case "connected": return { address: data2 == null ? void 0 : data2.account, connector, isConnected: true, isConnecting: false, isDisconnected: false, isReconnecting: false, status }; case "reconnecting": return { address: data2 == null ? void 0 : data2.account, connector, isConnected: !!(data2 == null ? void 0 : data2.account), isConnecting: false, isDisconnected: false, isReconnecting: true, status }; case "connecting": return { address: data2 == null ? void 0 : data2.account, connector, isConnected: false, isConnecting: true, isDisconnected: false, isReconnecting: false, status }; case "disconnected": return { address: void 0, connector: void 0, isConnected: false, isConnecting: false, isDisconnected: true, isReconnecting: false, status }; } } function getNetwork() { var _a2, _b2, _c2, _d; const config2 = getConfig(); const chainId = (_b2 = (_a2 = config2.data) == null ? void 0 : _a2.chain) == null ? void 0 : _b2.id; const activeChains = config2.chains ?? []; const activeChain = [ ...((_c2 = config2.publicClient) == null ? void 0 : _c2.chains) || [], ...activeChains ].find((x2) => x2.id === chainId) ?? { id: chainId, name: `Chain ${chainId}`, network: `${chainId}`, nativeCurrency: { name: "Ether", decimals: 18, symbol: "ETH" }, rpcUrls: { default: { http: [""] }, public: { http: [""] } } }; return { chain: chainId ? { ...activeChain, ...(_d = config2.data) == null ? void 0 : _d.chain, id: chainId } : void 0, chains: activeChains }; } async function signMessage(args) { const walletClient = await getWalletClient(); if (!walletClient) throw new ConnectorNotFoundError(); return await walletClient.signMessage({ message: args.message }); } async function switchNetwork({ chainId }) { const { connector } = getConfig(); if (!connector) throw new ConnectorNotFoundError(); if (!connector.switchChain) throw new SwitchChainNotSupportedError({ connector }); return connector.switchChain(chainId); } function watchAccount(callback, { selector = (x2) => x2 } = {}) { const config2 = getConfig(); const handleChange = () => callback(getAccount()); const unsubscribe = config2.subscribe( ({ data: data2, connector, status }) => selector({ address: data2 == null ? void 0 : data2.account, connector, status }), handleChange, { equalityFn: shallow$1 } ); return unsubscribe; } function watchNetwork(callback, { selector = (x2) => x2 } = {}) { const config2 = getConfig(); const handleChange = () => callback(getNetwork()); const unsubscribe = config2.subscribe( ({ data: data2, chains: chains2 }) => { var _a2; return selector({ chainId: (_a2 = data2 == null ? void 0 : data2.chain) == null ? void 0 : _a2.id, chains: chains2 }); }, handleChange, { equalityFn: shallow$1 } ); return unsubscribe; } async function fetchEnsAvatar({ name: name2, chainId }) { const { normalize: normalize2 } = await Promise.resolve().then(() => index$4); const publicClient = getPublicClient({ chainId }); const avatar = await publicClient.getEnsAvatar({ name: normalize2(name2) }); return avatar; } async function fetchEnsName({ address, chainId }) { const publicClient = getPublicClient({ chainId }); return publicClient.getEnsName({ address: getAddress(address) }); } const t$e = Symbol(); const s$e = Object.getPrototypeOf, c$h = /* @__PURE__ */ new WeakMap(), l$c = (e2) => e2 && (c$h.has(e2) ? c$h.get(e2) : s$e(e2) === Object.prototype || s$e(e2) === Array.prototype), y$c = (e2) => l$c(e2) && e2[t$e] || null, h$h = (e2, t2 = true) => { c$h.set(e2, t2); }; const isObject$1 = (x2) => typeof x2 === "object" && x2 !== null; const proxyStateMap = /* @__PURE__ */ new WeakMap(); const refSet = /* @__PURE__ */ new WeakSet(); const buildProxyFunction = (objectIs = Object.is, newProxy = (target, handler) => new Proxy(target, handler), canProxy = (x2) => isObject$1(x2) && !refSet.has(x2) && (Array.isArray(x2) || !(Symbol.iterator in x2)) && !(x2 instanceof WeakMap) && !(x2 instanceof WeakSet) && !(x2 instanceof Error) && !(x2 instanceof Number) && !(x2 instanceof Date) && !(x2 instanceof String) && !(x2 instanceof RegExp) && !(x2 instanceof ArrayBuffer), defaultHandlePromise = (promise) => { switch (promise.status) { case "fulfilled": return promise.value; case "rejected": throw promise.reason; default: throw promise; } }, snapCache = /* @__PURE__ */ new WeakMap(), createSnapshot = (target, version2, handlePromise = defaultHandlePromise) => { const cache = snapCache.get(target); if ((cache == null ? void 0 : cache[0]) === version2) { return cache[1]; } const snap = Array.isArray(target) ? [] : Object.create(Object.getPrototypeOf(target)); h$h(snap, true); snapCache.set(target, [version2, snap]); Reflect.ownKeys(target).forEach((key) => { if (Object.getOwnPropertyDescriptor(snap, key)) { return; } const value = Reflect.get(target, key); const desc = { value, enumerable: true, // This is intentional to avoid copying with proxy-compare. // It's still non-writable, so it avoids assigning a value. configurable: true }; if (refSet.has(value)) { h$h(value, false); } else if (value instanceof Promise) { delete desc.value; desc.get = () => handlePromise(value); } else if (proxyStateMap.has(value)) { const [target2, ensureVersion] = proxyStateMap.get( value ); desc.value = createSnapshot( target2, ensureVersion(), handlePromise ); } Object.defineProperty(snap, key, desc); }); return Object.preventExtensions(snap); }, proxyCache = /* @__PURE__ */ new WeakMap(), versionHolder = [1, 1], proxyFunction = (initialObject) => { if (!isObject$1(initialObject)) { throw new Error("object required"); } const found = proxyCache.get(initialObject); if (found) { return found; } let version2 = versionHolder[0]; const listeners = /* @__PURE__ */ new Set(); const notifyUpdate = (op, nextVersion = ++versionHolder[0]) => { if (version2 !== nextVersion) { version2 = nextVersion; listeners.forEach((listener) => listener(op, nextVersion)); } }; let checkVersion = versionHolder[1]; const ensureVersion = (nextCheckVersion = ++versionHolder[1]) => { if (checkVersion !== nextCheckVersion && !listeners.size) { checkVersion = nextCheckVersion; propProxyStates.forEach(([propProxyState]) => { const propVersion = propProxyState[1](nextCheckVersion); if (propVersion > version2) { version2 = propVersion; } }); } return version2; }; const createPropListener = (prop) => (op, nextVersion) => { const newOp = [...op]; newOp[1] = [prop, ...newOp[1]]; notifyUpdate(newOp, nextVersion); }; const propProxyStates = /* @__PURE__ */ new Map(); const addPropListener = (prop, propProxyState) => { if (({ "VITE_TERMS_OF_SERVICE_LINK": "https://elephant.money/terms.html", "VITE_PRIVACY_POLICY_LINK": "https://elephant.money/privacy.html", "VITE_APPLICATION_ID": "b0cff6026f93d0adda95a835f59a957d", "VITE_ERC20_TOKEN": "0xE283D0e3B8c102BAdF5E8166B73E02D96d92F688", "BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": false } ? "production" : void 0) !== "production" && propProxyStates.has(prop)) { throw new Error("prop listener already exists"); } if (listeners.size) { const remove = propProxyState[3](createPropListener(prop)); propProxyStates.set(prop, [propProxyState, remove]); } else { propProxyStates.set(prop, [propProxyState]); } }; const removePropListener = (prop) => { var _a2; const entry = propProxyStates.get(prop); if (entry) { propProxyStates.delete(prop); (_a2 = entry[1]) == null ? void 0 : _a2.call(entry); } }; const addListener = (listener) => { listeners.add(listener); if (listeners.size === 1) { propProxyStates.forEach(([propProxyState, prevRemove], prop) => { if (({ "VITE_TERMS_OF_SERVICE_LINK": "https://elephant.money/terms.html", "VITE_PRIVACY_POLICY_LINK": "https://elephant.money/privacy.html", "VITE_APPLICATION_ID": "b0cff6026f93d0adda95a835f59a957d", "VITE_ERC20_TOKEN": "0xE283D0e3B8c102BAdF5E8166B73E02D96d92F688", "BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": false } ? "production" : void 0) !== "production" && prevRemove) { throw new Error("remove already exists"); } const remove = propProxyState[3](createPropListener(prop)); propProxyStates.set(prop, [propProxyState, remove]); }); } const removeListener = () => { listeners.delete(listener); if (listeners.size === 0) { propProxyStates.forEach(([propProxyState, remove], prop) => { if (remove) { remove(); propProxyStates.set(prop, [propProxyState]); } }); } }; return removeListener; }; const baseObject = Array.isArray(initialObject) ? [] : Object.create(Object.getPrototypeOf(initialObject)); const handler = { deleteProperty(target, prop) { const prevValue = Reflect.get(target, prop); removePropListener(prop); const deleted = Reflect.deleteProperty(target, prop); if (deleted) { notifyUpdate(["delete", [prop], prevValue]); } return deleted; }, set(target, prop, value, receiver) { const hasPrevValue = Reflect.has(target, prop); const prevValue = Reflect.get(target, prop, receiver); if (hasPrevValue && (objectIs(prevValue, value) || proxyCache.has(value) && objectIs(prevValue, proxyCache.get(value)))) { return true; } removePropListener(prop); if (isObject$1(value)) { value = y$c(value) || value; } let nextValue = value; if (value instanceof Promise) { value.then((v2) => { value.status = "fulfilled"; value.value = v2; notifyUpdate(["resolve", [prop], v2]); }).catch((e2) => { value.status = "rejected"; value.reason = e2; notifyUpdate(["reject", [prop], e2]); }); } else { if (!proxyStateMap.has(value) && canProxy(value)) { nextValue = proxyFunction(value); } const childProxyState = !refSet.has(nextValue) && proxyStateMap.get(nextValue); if (childProxyState) { addPropListener(prop, childProxyState); } } Reflect.set(target, prop, nextValue, receiver); notifyUpdate(["set", [prop], value, prevValue]); return true; } }; const proxyObject = newProxy(baseObject, handler); proxyCache.set(initialObject, proxyObject); const proxyState = [ baseObject, ensureVersion, createSnapshot, addListener ]; proxyStateMap.set(proxyObject, proxyState); Reflect.ownKeys(initialObject).forEach((key) => { const desc = Object.getOwnPropertyDescriptor( initialObject, key ); if ("value" in desc) { proxyObject[key] = initialObject[key]; delete desc.value; delete desc.writable; } Object.defineProperty(baseObject, key, desc); }); return proxyObject; }) => [ // public functions proxyFunction, // shared state proxyStateMap, refSet, // internal things objectIs, newProxy, canProxy, defaultHandlePromise, snapCache, createSnapshot, proxyCache, versionHolder ]; const [defaultProxyFunction] = buildProxyFunction(); function proxy(initialObject = {}) { return defaultProxyFunction(initialObject); } function subscribe(proxyObject, callback, notifyInSync) { const proxyState = proxyStateMap.get(proxyObject); if (({ "VITE_TERMS_OF_SERVICE_LINK": "https://elephant.money/terms.html", "VITE_PRIVACY_POLICY_LINK": "https://elephant.money/privacy.html", "VITE_APPLICATION_ID": "b0cff6026f93d0adda95a835f59a957d", "VITE_ERC20_TOKEN": "0xE283D0e3B8c102BAdF5E8166B73E02D96d92F688", "BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": false } ? "production" : void 0) !== "production" && !proxyState) { console.warn("Please use proxy object"); } let promise; const ops = []; const addListener = proxyState[3]; let isListenerActive = false; const listener = (op) => { ops.push(op); if (notifyInSync) { callback(ops.splice(0)); return; } if (!promise) { promise = Promise.resolve().then(() => { promise = void 0; if (isListenerActive) { callback(ops.splice(0)); } }); } }; const removeListener = addListener(listener); isListenerActive = true; return () => { isListenerActive = false; removeListener(); }; } function snapshot(proxyObject, handlePromise) { const proxyState = proxyStateMap.get(proxyObject); if (({ "VITE_TERMS_OF_SERVICE_LINK": "https://elephant.money/terms.html", "VITE_PRIVACY_POLICY_LINK": "https://elephant.money/privacy.html", "VITE_APPLICATION_ID": "b0cff6026f93d0adda95a835f59a957d", "VITE_ERC20_TOKEN": "0xE283D0e3B8c102BAdF5E8166B73E02D96d92F688", "BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": false } ? "production" : void 0) !== "production" && !proxyState) { console.warn("Please use proxy object"); } const [target, ensureVersion, createSnapshot] = proxyState; return createSnapshot(target, ensureVersion(), handlePromise); } function ref(obj) { refSet.add(obj); return obj; } function subscribeKey(proxyObject, key, callback, notifyInSync) { let prevValue = proxyObject[key]; return subscribe( proxyObject, () => { const nextValue = proxyObject[key]; if (!Object.is(prevValue, nextValue)) { callback(prevValue = nextValue); } }, notifyInSync ); } const SECURE_SITE = "https://secure.web3modal.com"; const ConstantsUtil$1 = { FOUR_MINUTES_MS: 24e4, TEN_SEC_MS: 1e4, ONE_SEC_MS: 1e3, SECURE_SITE, SECURE_SITE_DASHBOARD: `${SECURE_SITE}/dashboard`, SECURE_SITE_FAVICON: `${SECURE_SITE}/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" ], CONNECTOR_RDNS_MAP: { coinbaseWallet: "com.coinbase.wallet" } }; const CoreHelperUtil = { isMobile() { if (typeof window !== "undefined") { return Boolean(window.matchMedia("(pointer:coarse)").matches || /Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)); } return false; }, isAndroid() { const ua = window.navigator.userAgent.toLowerCase(); return CoreHelperUtil.isMobile() && ua.includes("android"); }, isIos() { const ua = window.navigator.userAgent.toLowerCase(); return CoreHelperUtil.isMobile() && (ua.includes("iphone") || ua.includes("ipad")); }, isClient() { return typeof window !== "undefined"; }, isPairingExpired(expiry) { return expiry ? expiry - Date.now() <= ConstantsUtil$1.TEN_SEC_MS : true; }, isAllowedRetry(lastRetry) { return Date.now() - lastRetry >= ConstantsUtil$1.ONE_SEC_MS; }, copyToClopboard(text) { navigator.clipboard.writeText(text); }, getPairingExpiry() { return Date.now() + ConstantsUtil$1.FOUR_MINUTES_MS; }, getPlainAddress(caipAddress) { return caipAddress.split(":")[2]; }, async wait(milliseconds) { return new Promise((resolve) => { setTimeout(resolve, milliseconds); }); }, debounce(func2, timeout2 = 500) { let timer = void 0; return (...args) => { function next() { func2(...args); } if (timer) { clearTimeout(timer); } timer = setTimeout(next, timeout2); }; }, isHttpUrl(url) { return url.startsWith("http://") || url.startsWith("https://"); }, formatNativeUrl(appUrl, wcUri) { if (CoreHelperUtil.isHttpUrl(appUrl)) { return this.formatUniversalUrl(appUrl, wcUri); } let safeAppUrl = appUrl; if (!safeAppUrl.includes("://")) { safeAppUrl = appUrl.replaceAll("/", "").replaceAll(":", ""); safeAppUrl = `${safeAppUrl}://`; } if (!safeAppUrl.endsWith("/")) { safeAppUrl = `${safeAppUrl}/`; } const encodedWcUrl = encodeURIComponent(wcUri); return { redirect: `${safeAppUrl}wc?uri=${encodedWcUrl}`, href: safeAppUrl }; }, formatUniversalUrl(appUrl, wcUri) { if (!CoreHelperUtil.isHttpUrl(appUrl)) { return this.formatNativeUrl(appUrl, wcUri); } let safeAppUrl = appUrl; if (!safeAppUrl.endsWith("/")) { safeAppUrl = `${safeAppUrl}/`; } const encodedWcUrl = encodeURIComponent(wcUri); return { redirect: `${safeAppUrl}wc?uri=${encodedWcUrl}`, href: safeAppUrl }; }, openHref(href, target) { window.open(href, target, "noreferrer noopener"); }, async preloadImage(src2) { const imagePromise = new Promise((resolve, reject) => { const image = new Image(); image.onload = resolve; image.onerror = reject; image.crossOrigin = "anonymous"; image.src = src2; }); return Promise.race([imagePromise, CoreHelperUtil.wait(2e3)]); }, formatBalance(balance, symbol) { var _a2; let formattedBalance = void 0; if (balance === "0") { formattedBalance = "0.000"; } else if (typeof balance === "string") { const number2 = Number(balance); if (number2) { formattedBalance = (_a2 = number2.toString().match(/^-?\d+(?:\.\d{0,3})?/u)) == null ? void 0 : _a2[0]; } } return formattedBalance ? `${formattedBalance} ${symbol}` : `0.000 ${symbol}`; }, isRestrictedRegion() { try { const { timeZone } = new Intl.DateTimeFormat().resolvedOptions(); const capTimeZone = timeZone.toUpperCase(); return ConstantsUtil$1.RESTRICTED_TIMEZONES.includes(capTimeZone); } catch { return false; } }, getApiUrl() { return CoreHelperUtil.isRestrictedRegion() ? "https://api.web3modal.org" : "https://api.web3modal.com"; }, getBlockchainApiUrl() { return CoreHelperUtil.isRestrictedRegion() ? "https://rpc.walletconnect.org" : "https://rpc.walletconnect.com"; }, getAnalyticsUrl() { return CoreHelperUtil.isRestrictedRegion() ? "https://pulse.walletconnect.org" : "https://pulse.walletconnect.com"; }, getUUID() { if (crypto == null ? void 0 : crypto.randomUUID) { return crypto.randomUUID(); } return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu, (c2) => { const r2 = Math.random() * 16 | 0; const v2 = c2 === "x" ? r2 : r2 & 3 | 8; return v2.toString(16); }); }, parseError(error2) { var _a2, _b2; if (typeof error2 === "string") { return error2; } else if (typeof ((_b2 = (_a2 = error2 == null ? void 0 : error2.issues) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.message) === "string") { return error2.issues[0].message; } else if (error2 instanceof Error) { return error2.message; } return "Unknown error"; } }; const state$f = proxy({ isConnected: false }); const AccountController = { state: state$f, subscribe(callback) { return subscribe(state$f, () => callback(state$f)); }, subscribeKey(key, callback) { return subscribeKey(state$f, key, callback); }, setIsConnected(isConnected) { state$f.isConnected = isConnected; }, setCaipAddress(caipAddress) { state$f.caipAddress = caipAddress; state$f.address = caipAddress ? CoreHelperUtil.getPlainAddress(caipAddress) : void 0; }, setBalance(balance, balanceSymbol) { state$f.balance = balance; state$f.balanceSymbol = balanceSymbol; }, setProfileName(profileName) { state$f.profileName = profileName; }, setProfileImage(profileImage) { state$f.profileImage = profileImage; }, setAddressExplorerUrl(explorerUrl) { state$f.addressExplorerUrl = explorerUrl; }, resetAccount() { state$f.isConnected = false; state$f.caipAddress = void 0; state$f.address = void 0; state$f.balance = void 0; state$f.balanceSymbol = void 0; state$f.profileName = void 0; state$f.profileImage = void 0; state$f.addressExplorerUrl = void 0; } }; class FetchUtil { constructor({ baseUrl: baseUrl2 }) { this.baseUrl = baseUrl2; } async get({ headers, ...args }) { const url = this.createUrl(args); const response = await fetch(url, { method: "GET", headers }); return response.json(); } async getBlob({ headers, ...args }) { const url = this.createUrl(args); const response = await fetch(url, { method: "GET", headers }); return response.blob(); } async post({ body, headers, ...args }) { const url = this.createUrl(args); const response = await fetch(url, { method: "POST", headers, body: body ? JSON.stringify(body) : void 0 }); return response.json(); } async put({ body, headers, ...args }) { const url = this.createUrl(args); const response = await fetch(url, { method: "PUT", headers, body: body ? JSON.stringify(body) : void 0 }); return response.json(); } async delete({ body, headers, ...args }) { const url = this.createUrl(args); const response = await fetch(url, { method: "DELETE", headers, body: body ? JSON.stringify(body) : void 0 }); return response.json(); } createUrl({ path, params }) { const url = new URL(path, this.baseUrl); if (params) { Object.entries(params).forEach(([key, value]) => { if (value) { url.searchParams.append(key, value); } }); } return url; } } const WC_DEEPLINK = "WALLETCONNECT_DEEPLINK_CHOICE"; const W3M_RECENT = "@w3m/recent"; const W3M_CONNECTED_WALLET_IMAGE_URL = "@w3m/connected_wallet_image_url"; const W3M_CONNECTED_CONNECTOR = "@w3m/connected_connector"; const StorageUtil = { setWalletConnectDeepLink({ href, name: name2 }) { try { localStorage.setItem(WC_DEEPLINK, JSON.stringify({ href, name: name2 })); } catch { console.info("Unable to set WalletConnect deep link"); } }, getWalletConnectDeepLink() { try { const deepLink = localStorage.getItem(WC_DEEPLINK); if (deepLink) { return JSON.parse(deepLink); } } catch { console.info("Unable to get WalletConnect deep link"); } return void 0; }, deleteWalletConnectDeepLink() { try { localStorage.removeItem(WC_DEEPLINK); } catch { console.info("Unable to delete WalletConnect deep link"); } }, setWeb3ModalRecent(wallet2) { try { const recentWallets = StorageUtil.getRecentWallets(); const exists2 = recentWallets.find((w2) => w2.id === wallet2.id); if (!exists2) { recentWallets.unshift(wallet2); if (recentWallets.length > 2) { recentWallets.pop(); } localStorage.setItem(W3M_RECENT, JSON.stringify(recentWallets)); } } catch { console.info("Unable to set Web3Modal recent"); } }, getRecentWallets() { try { const recent = localStorage.getItem(W3M_RECENT); return recent ? JSON.parse(recent) : []; } catch { console.info("Unable to get Web3Modal recent"); } return []; }, setConnectedWalletImageUrl(imageUrl) { try { localStorage.setItem(W3M_CONNECTED_WALLET_IMAGE_URL, imageUrl); } catch { console.info("Unable to set Connected Wallet Image Url"); } }, getConnectedWalletImageUrl() { try { return localStorage.getItem(W3M_CONNECTED_WALLET_IMAGE_URL); } catch { console.info("Unable to set Connected Wallet Image Url"); } return void 0; }, setConnectedConnector(connectorType) { try { localStorage.setItem(W3M_CONNECTED_CONNECTOR, connectorType); } catch { console.info("Unable to set Connected Connector"); } }, getConnectedConnector() { try { return localStorage.getItem(W3M_CONNECTED_CONNECTOR); } catch { console.info("Unable to get Connected Connector"); } return void 0; } }; const state$e = proxy({ walletImages: {}, networkImages: {}, connectorImages: {}, tokenImages: {} }); const AssetController = { state: state$e, subscribeNetworkImages(callback) { return subscribe(state$e.networkImages, () => callback(state$e.networkImages)); }, subscribeKey(key, callback) { return subscribeKey(state$e, key, callback); }, setWalletImage(key, value) { state$e.walletImages[key] = value; }, setNetworkImage(key, value) { state$e.networkImages[key] = value; }, setConnectorImage(key, value) { state$e.connectorImages[key] = value; }, setTokenImage(key, value) { state$e.tokenImages[key] = value; } }; const state$d = proxy({ projectId: "", sdkType: "w3m", sdkVersion: "html-wagmi-undefined" }); const OptionsController = { state: state$d, subscribeKey(key, callback) { return subscribeKey(state$d, key, callback); }, setProjectId(projectId2) { state$d.projectId = projectId2; }, setIncludeWalletIds(includeWalletIds) { state$d.includeWalletIds = includeWalletIds; }, setExcludeWalletIds(excludeWalletIds) { state$d.excludeWalletIds = excludeWalletIds; }, setFeaturedWalletIds(featuredWalletIds) { state$d.featuredWalletIds = featuredWalletIds; }, setTokens(tokens) { state$d.tokens = tokens; }, setTermsConditionsUrl(termsConditionsUrl) { state$d.termsConditionsUrl = termsConditionsUrl; }, setPrivacyPolicyUrl(privacyPolicyUrl) { state$d.privacyPolicyUrl = privacyPolicyUrl; }, setCustomWallets(customWallets) { state$d.customWallets = customWallets; }, setEnableAnalytics(enableAnalytics) { state$d.enableAnalytics = enableAnalytics; }, setSdkVersion(sdkVersion) { state$d.sdkVersion = sdkVersion; }, setMetadata(metadata2) { state$d.metadata = metadata2; } }; const state$c = proxy({ connectors: [] }); const ConnectorController = { state: state$c, subscribeKey(key, callback) { return subscribeKey(state$c, key, callback); }, setConnectors(connectors) { state$c.connectors = connectors.map((c2) => ref(c2)); }, addConnector(connector) { var _a2, _b2; state$c.connectors.push(ref(connector)); if (connector.id === "w3mEmail") { const emailConnector = connector; const optionsState = snapshot(OptionsController.state); (_b2 = (_a2 = emailConnector == null ? void 0 : emailConnector.provider) == null ? void 0 : _a2.syncDappData) == null ? void 0 : _b2.call(_a2, { metadata: optionsState.metadata, sdkVersion: optionsState.sdkVersion, projectId: optionsState.projectId }); } }, getEmailConnector() { return state$c.connectors.find((c2) => c2.type === "EMAIL"); }, getAnnouncedConnectorRdns() { return state$c.connectors.filter((c2) => c2.type === "ANNOUNCED").map((c2) => { var _a2; return (_a2 = c2.info) == null ? void 0 : _a2.rdns; }); }, getConnectors() { return state$c.connectors; } }; const state$b = proxy({ open: false, selectedNetworkId: void 0 }); const PublicStateController = { state: state$b, subscribe(callback) { return subscribe(state$b, () => callback(state$b)); }, set(newState) { Object.assign(state$b, { ...state$b, ...newState }); } }; const state$a = proxy({ supportsAllNetworks: true, isDefaultCaipNetwork: false }); const NetworkController = { state: state$a, subscribeKey(key, callback) { return subscribeKey(state$a, key, callback); }, _getClient() { if (!state$a._client) { throw new Error("NetworkController client not set"); } return state$a._client; }, setClient(client) { state$a._client = ref(client); }, setCaipNetwork(caipNetwork) { state$a.caipNetwork = caipNetwork; PublicStateController.set({ selectedNetworkId: caipNetwork == null ? void 0 : caipNetwork.id }); }, setDefaultCaipNetwork(caipNetwork) { state$a.caipNetwork = caipNetwork; PublicStateController.set({ selectedNetworkId: caipNetwork == null ? void 0 : caipNetwork.id }); state$a.isDefaultCaipNetwork = true; }, setRequestedCaipNetworks(requestedNetworks) { state$a.requestedCaipNetworks = requestedNetworks; }, async getApprovedCaipNetworksData() { const data2 = await this._getClient().getApprovedCaipNetworksData(); state$a.supportsAllNetworks = data2.supportsAllNetworks; state$a.approvedCaipNetworkIds = data2.approvedCaipNetworkIds; }, async switchActiveNetwork(network) { await this._getClient().switchCaipNetwork(network); state$a.caipNetwork = network; }, resetNetwork() { if (!state$a.isDefaultCaipNetwork) { state$a.caipNetwork = void 0; } state$a.approvedCaipNetworkIds = void 0; state$a.supportsAllNetworks = true; } }; const baseUrl$2 = CoreHelperUtil.getApiUrl(); const api$3 = new FetchUtil({ baseUrl: baseUrl$2 }); const entries = "40"; const recommendedEntries = "4"; const state$9 = proxy({ page: 1, count: 0, featured: [], recommended: [], wallets: [], search: [] }); const ApiController = { state: state$9, subscribeKey(key, callback) { return subscribeKey(state$9, key, callback); }, _getApiHeaders() { const { projectId: projectId2, sdkType, sdkVersion } = OptionsController.state; return { "x-project-id": projectId2, "x-sdk-type": sdkType, "x-sdk-version": sdkVersion }; }, async _fetchWalletImage(imageId) { const imageUrl = `${api$3.baseUrl}/getWalletImage/${imageId}`; const blob = await api$3.getBlob({ path: imageUrl, headers: ApiController._getApiHeaders() }); AssetController.setWalletImage(imageId, URL.createObjectURL(blob)); }, async _fetchNetworkImage(imageId) { const imageUrl = `${api$3.baseUrl}/public/getAssetImage/${imageId}`; const blob = await api$3.getBlob({ path: imageUrl, headers: ApiController._getApiHeaders() }); AssetController.setNetworkImage(imageId, URL.createObjectURL(blob)); }, async _fetchConnectorImage(imageId) { const imageUrl = `${api$3.baseUrl}/public/getAssetImage/${imageId}`; const blob = await api$3.getBlob({ path: imageUrl, headers: ApiController._getApiHeaders() }); AssetController.setConnectorImage(imageId, URL.createObjectURL(blob)); }, async fetchNetworkImages() { const { requestedCaipNetworks } = NetworkController.state; const ids = requestedCaipNetworks == null ? void 0 : requestedCaipNetworks.map(({ imageId }) => imageId).filter(Boolean); if (ids) { await Promise.allSettled(ids.map((id2) => ApiController._fetchNetworkImage(id2))); } }, async fetchConnectorImages() { const { connectors } = ConnectorController.state; const ids = connectors.map(({ imageId }) => imageId).filter(Boolean); await Promise.allSettled(ids.map((id2) => ApiController._fetchConnectorImage(id2))); }, async fetchFeaturedWallets() { const { featuredWalletIds } = OptionsController.state; if (featuredWalletIds == null ? void 0 : featuredWalletIds.length) { const { data: data2 } = await api$3.get({ path: "/getWallets", headers: ApiController._getApiHeaders(), params: { page: "1", entries: (featuredWalletIds == null ? void 0 : featuredWalletIds.length) ? String(featuredWalletIds.length) : recommendedEntries, include: featuredWalletIds == null ? void 0 : featuredWalletIds.join(",") } }); data2.sort((a2, b2) => featuredWalletIds.indexOf(a2.id) - featuredWalletIds.indexOf(b2.id)); const images = data2.map((d2) => d2.image_id).filter(Boolean); await Promise.allSettled(images.map((id2) => ApiController._fetchWalletImage(id2))); state$9.featured = data2; } }, async fetchRecommendedWallets() { const { includeWalletIds, excludeWalletIds, featuredWalletIds } = OptionsController.state; const exclude = [...excludeWalletIds ?? [], ...featuredWalletIds ?? []].filter(Boolean); const { data: data2, count } = await api$3.get({ path: "/getWallets", headers: ApiController._getApiHeaders(), params: { page: "1", entries: recommendedEntries, include: includeWalletIds == null ? void 0 : includeWalletIds.join(","), exclude: exclude == null ? void 0 : exclude.join(",") } }); const recent = StorageUtil.getRecentWallets(); const recommendedImages = data2.map((d2) => d2.image_id).filter(Boolean); const recentImages = recent.map((r2) => r2.image_id).filter(Boolean); await Promise.allSettled([...recommendedImages, ...recentImages].map((id2) => ApiController._fetchWalletImage(id2))); state$9.recommended = data2; state$9.count = count ?? 0; }, async fetchWallets({ page }) { const { includeWalletIds, excludeWalletIds, featuredWalletIds } = OptionsController.state; const exclude = [ ...state$9.recommended.map(({ id: id2 }) => id2), ...excludeWalletIds ?? [], ...featuredWalletIds ?? [] ].filter(Boolean); const { data: data2, count } = await api$3.get({ path: "/getWallets", headers: ApiController._getApiHeaders(), params: { page: String(page), entries, include: includeWalletIds == null ? void 0 : includeWalletIds.join(","), exclude: exclude.join(",") } }); const images = data2.map((w2) => w2.image_id).filter(Boolean); await Promise.allSettled([ ...images.map((id2) => ApiController._fetchWalletImage(id2)), CoreHelperUtil.wait(300) ]); state$9.wallets = [...state$9.wallets, ...data2]; state$9.count = count > state$9.count ? count : state$9.count; state$9.page = page; }, async searchWallet({ search }) { const { includeWalletIds, excludeWalletIds } = OptionsController.state; state$9.search = []; const { data: data2 } = await api$3.get({ path: "/getWallets", headers: ApiController._getApiHeaders(), params: { page: "1", entries: "100", search, include: includeWalletIds == null ? void 0 : includeWalletIds.join(","), exclude: excludeWalletIds == null ? void 0 : excludeWalletIds.join(",") } }); const images = data2.map((w2) => w2.image_id).filter(Boolean); await Promise.allSettled([ ...images.map((id2) => ApiController._fetchWalletImage(id2)), CoreHelperUtil.wait(300) ]); state$9.search = data2; }, prefetch() { state$9.prefetchPromise = Promise.race([ Promise.allSettled([ ApiController.fetchFeaturedWallets(), ApiController.fetchRecommendedWallets(), ApiController.fetchNetworkImages(), ApiController.fetchConnectorImages() ]), CoreHelperUtil.wait(3e3) ]); } }; const baseUrl$1 = CoreHelperUtil.getAnalyticsUrl(); const api$2 = new FetchUtil({ baseUrl: baseUrl$1 }); const excluded = ["MODAL_CREATED"]; const state$8 = proxy({ timestamp: Date.now(), data: { type: "track", event: "MODAL_CREATED" } }); const EventsController = { state: state$8, subscribe(callback) { return subscribe(state$8, () => callback(state$8)); }, _getApiHeaders() { const { projectId: projectId2, sdkType, sdkVersion } = OptionsController.state; return { "x-project-id": projectId2, "x-sdk-type": sdkType, "x-sdk-version": sdkVersion }; }, async _sendAnalyticsEvent(payload) { try { if (excluded.includes(payload.data.event) || typeof window === "undefined") { return; } await api$2.post({ path: "/e", headers: EventsController._getApiHeaders(), body: { eventId: CoreHelperUtil.getUUID(), url: window.location.href, domain: window.location.hostname, timestamp: payload.timestamp, props: payload.data } }); } catch { } }, sendEvent(data2) { state$8.timestamp = Date.now(); state$8.data = data2; if (OptionsController.state.enableAnalytics) { EventsController._sendAnalyticsEvent(state$8); } } }; const state$7 = proxy({ view: "Connect", history: ["Connect"] }); const RouterController = { state: state$7, subscribeKey(key, callback) { return subscribeKey(state$7, key, callback); }, push(view, data2) { if (view !== state$7.view) { state$7.view = view; state$7.history.push(view); state$7.data = data2; } }, reset(view) { state$7.view = view; state$7.history = [view]; }, replace(view, data2) { if (state$7.history.length > 1 && state$7.history.at(-1) !== view) { state$7.view = view; state$7.history[state$7.history.length - 1] = view; state$7.data = data2; } }, goBack() { if (state$7.history.length > 1) { state$7.history.pop(); const [last] = state$7.history.slice(-1); if (last) { state$7.view = last; } } }, goBackToIndex(historyIndex) { if (state$7.history.length > 1) { state$7.history = state$7.history.slice(0, historyIndex + 1); const [last] = state$7.history.slice(-1); if (last) { state$7.view = last; } } } }; const state$6 = proxy({ loading: false, open: false }); const ModalController = { state: state$6, subscribe(callback) { return subscribe(state$6, () => callback(state$6)); }, subscribeKey(key, callback) { return subscribeKey(state$6, key, callback); }, async open(options) { await ApiController.state.prefetchPromise; if (options == null ? void 0 : options.view) { RouterController.reset(options.view); } else if (AccountController.state.isConnected) { RouterController.reset("Account"); } else { RouterController.reset("Connect"); } state$6.open = true; PublicStateController.set({ open: true }); EventsController.sendEvent({ type: "track", event: "MODAL_OPEN" }); }, close() { state$6.open = false; PublicStateController.set({ open: false }); EventsController.sendEvent({ type: "track", event: "MODAL_CLOSE" }); }, setLoading(loading) { state$6.loading = loading; } }; const baseUrl = CoreHelperUtil.getBlockchainApiUrl(); const api$1 = new FetchUtil({ baseUrl }); const BlockchainApiController = { fetchIdentity({ caipChainId, address }) { return api$1.get({ path: `/v1/identity/${address}`, params: { chainId: caipChainId, projectId: OptionsController.state.projectId } }); }, fetchTransactions({ account, projectId: projectId2, cursor }) { const queryParams = cursor ? { cursor } : {}; return api$1.get({ path: `/v1/account/${account}/history?projectId=${projectId2}`, params: queryParams }); } }; const state$5 = proxy({ message: "", variant: "success", open: false }); const SnackController = { state: state$5, subscribeKey(key, callback) { return subscribeKey(state$5, key, callback); }, showSuccess(message) { state$5.message = message; state$5.variant = "success"; state$5.open = true; }, showError(message) { const errorMessage = CoreHelperUtil.parseError(message); state$5.message = errorMessage; state$5.variant = "error"; state$5.open = true; }, hide() { state$5.open = false; } }; const state$4 = proxy({ transactions: [], transactionsByYear: {}, loading: false, empty: false, next: void 0 }); const TransactionsController = { state: state$4, subscribe(callback) { return subscribe(state$4, () => callback(state$4)); }, async fetchTransactions(accountAddress) { const { projectId: projectId2 } = OptionsController.state; if (!projectId2 || !accountAddress) { throw new Error("Transactions can't be fetched without a projectId and an accountAddress"); } state$4.loading = true; try { const response = await BlockchainApiController.fetchTransactions({ account: accountAddress, projectId: projectId2, cursor: state$4.next }); const nonSpamTransactions = this.filterSpamTransactions(response.data); const filteredTransactions = [...state$4.transactions, ...nonSpamTransactions]; state$4.loading = false; state$4.transactions = filteredTransactions; state$4.transactionsByYear = this.groupTransactionsByYear(state$4.transactionsByYear, nonSpamTransactions); state$4.empty = filteredTransactions.length === 0; state$4.next = response.next ? response.next : void 0; } catch (error2) { EventsController.sendEvent({ type: "track", event: "ERROR_FETCH_TRANSACTIONS", properties: { address: accountAddress, projectId: projectId2, cursor: state$4.next } }); SnackController.showError("Failed to fetch transactions"); state$4.loading = false; state$4.empty = true; } }, groupTransactionsByYear(transactionsMap = {}, transactions = []) { const grouped = transactionsMap; transactions.forEach((transaction) => { var _a2; const year = new Date(transaction.metadata.minedAt).getFullYear(); if (!grouped[year]) { grouped[year] = []; } (_a2 = grouped[year]) == null ? void 0 : _a2.push(transaction); }); return grouped; }, filterSpamTransactions(transactions) { return transactions.filter((transaction) => { const isAllSpam = transaction.transfers.every((transfer) => { var _a2; return ((_a2 = transfer.nft_info) == null ? void 0 : _a2.flags.is_spam) === true; }); return !isAllSpam; }); }, resetTransactions() { state$4.transactions = []; state$4.transactionsByYear = {}; state$4.loading = false; state$4.empty = false; state$4.next = void 0; } }; const state$3 = proxy({ wcError: false, buffering: false }); const ConnectionController = { state: state$3, subscribeKey(key, callback) { return subscribeKey(state$3, key, callback); }, _getClient() { if (!state$3._client) { throw new Error("ConnectionController client not set"); } return state$3._client; }, setClient(client) { state$3._client = ref(client); }, connectWalletConnect() { state$3.wcPromise = this._getClient().connectWalletConnect((uri) => { state$3.wcUri = uri; state$3.wcPairingExpiry = CoreHelperUtil.getPairingExpiry(); }); }, async connectExternal(options) { var _a2, _b2; await ((_b2 = (_a2 = this._getClient()).connectExternal) == null ? void 0 : _b2.call(_a2, options)); StorageUtil.setConnectedConnector(options.type); }, async signMessage(message) { return this._getClient().signMessage(message); }, checkInstalled(ids) { var _a2, _b2; return (_b2 = (_a2 = this._getClient()).checkInstalled) == null ? void 0 : _b2.call(_a2, ids); }, resetWcConnection() { state$3.wcUri = void 0; state$3.wcPairingExpiry = void 0; state$3.wcPromise = void 0; state$3.wcLinking = void 0; state$3.recentWallet = void 0; TransactionsController.resetTransactions(); StorageUtil.deleteWalletConnectDeepLink(); }, setWcLinking(wcLinking) { state$3.wcLinking = wcLinking; }, setWcError(wcError) { state$3.wcError = wcError; state$3.buffering = false; }, setRecentWallet(wallet2) { state$3.recentWallet = wallet2; }, setBuffering(buffering) { state$3.buffering = buffering; }, async disconnect() { await this._getClient().disconnect(); this.resetWcConnection(); } }; const state$2 = proxy({ status: "uninitialized", isSiweEnabled: false }); const SIWEController = { state: state$2, subscribeKey(key, callback) { return subscribeKey(state$2, key, callback); }, subscribe(callback) { return subscribe(state$2, () => callback(state$2)); }, _getClient() { if (!state$2._client) { throw new Error("SIWEController client not set"); } return state$2._client; }, async getNonce() { const client = this._getClient(); const nonce = await client.getNonce(); this.setNonce(nonce); return nonce; }, async getSession() { const client = this._getClient(); const session = await client.getSession(); if (session) { this.setSession(session); this.setStatus("success"); } return session; }, createMessage(args) { const client = this._getClient(); const message = client.createMessage(args); this.setMessage(message); return message; }, async verifyMessage(args) { const client = this._getClient(); const isValid2 = await client.verifyMessage(args); return isValid2; }, async signIn() { const client = this._getClient(); const session = await client.signIn(); return session; }, async signOut() { var _a2; const client = this._getClient(); await client.signOut(); this.setStatus("ready"); (_a2 = client.onSignOut) == null ? void 0 : _a2.call(client); }, onSignIn(args) { var _a2; const client = this._getClient(); (_a2 = client.onSignIn) == null ? void 0 : _a2.call(client, args); }, onSignOut() { var _a2; const client = this._getClient(); (_a2 = client.onSignOut) == null ? void 0 : _a2.call(client); }, setSIWEClient(client) { state$2._client = ref(client); state$2.status = "ready"; state$2.isSiweEnabled = client.options.enabled; }, setNonce(nonce) { state$2.nonce = nonce; }, setStatus(status) { state$2.status = status; }, setMessage(message) { state$2.message = message; }, setSession(session) { state$2.session = session; } }; const state$1 = proxy({ themeMode: "dark", themeVariables: {} }); const ThemeController = { state: state$1, subscribe(callback) { return subscribe(state$1, () => callback(state$1)); }, setThemeMode(themeMode) { state$1.themeMode = themeMode; }, setThemeVariables(themeVariables) { state$1.themeVariables = { ...state$1.themeVariables, ...themeVariables }; }, getSnapshot() { return snapshot(state$1); } }; const AssetUtil = { getWalletImage(wallet2) { if (wallet2 == null ? void 0 : wallet2.image_url) { return wallet2 == null ? void 0 : wallet2.image_url; } if (wallet2 == null ? void 0 : wallet2.image_id) { return AssetController.state.walletImages[wallet2.image_id]; } return void 0; }, getNetworkImage(network) { if (network == null ? void 0 : network.imageUrl) { return network == null ? void 0 : network.imageUrl; } if (network == null ? void 0 : network.imageId) { return AssetController.state.networkImages[network.imageId]; } return void 0; }, getConnectorImage(connector) { if (connector == null ? void 0 : connector.imageUrl) { return connector.imageUrl; } if (connector == null ? void 0 : connector.imageId) { return AssetController.state.connectorImages[connector.imageId]; } return void 0; } }; const RouterUtil = { goBackOrCloseModal() { if (RouterController.state.history.length > 1) { RouterController.goBack(); } else { ModalController.close(); } }, navigateAfterNetworkSwitch() { const { history } = RouterController.state; const networkSelectIndex = history.findIndex((name2) => name2 === "Networks"); if (networkSelectIndex >= 1) { RouterController.goBackToIndex(networkSelectIndex - 1); } else { ModalController.close(); } } }; /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t$d = globalThis, e$j = t$d.ShadowRoot && (void 0 === t$d.ShadyCSS || t$d.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$d = Symbol(), o$m = /* @__PURE__ */ new WeakMap(); let n$l = class n { constructor(t2, e2, o2) { if (this._$cssResult$ = true, o2 !== s$d) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); this.cssText = t2, this.t = e2; } get styleSheet() { let t2 = this.o; const s2 = this.t; if (e$j && void 0 === t2) { const e2 = void 0 !== s2 && 1 === s2.length; e2 && (t2 = o$m.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && o$m.set(s2, t2)); } return t2; } toString() { return this.cssText; } }; const r$l = (t2) => new n$l("string" == typeof t2 ? t2 : t2 + "", void 0, s$d), i$g = (t2, ...e2) => { const o2 = 1 === t2.length ? t2[0] : e2.reduce((e3, s2, o3) => e3 + ((t3) => { if (true === t3._$cssResult$) return t3.cssText; if ("number" == typeof t3) return t3; throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); })(s2) + t2[o3 + 1], t2[0]); return new n$l(o2, t2, s$d); }, S$c = (s2, o2) => { if (e$j) s2.adoptedStyleSheets = o2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); else for (const e2 of o2) { const o3 = document.createElement("style"), n2 = t$d.litNonce; void 0 !== n2 && o3.setAttribute("nonce", n2), o3.textContent = e2.cssText, s2.appendChild(o3); } }, c$g = e$j ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { let e2 = ""; for (const s2 of t3.cssRules) e2 += s2.cssText; return r$l(e2); })(t2) : t2; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const { is: i$f, defineProperty: e$i, getOwnPropertyDescriptor: r$k, getOwnPropertyNames: h$g, getOwnPropertySymbols: o$l, getPrototypeOf: n$k } = Object, a$a = globalThis, c$f = a$a.trustedTypes, l$b = c$f ? c$f.emptyScript : "", p$c = a$a.reactiveElementPolyfillSupport, d$b = (t2, s2) => t2, u$9 = { toAttribute(t2, s2) { switch (s2) { case Boolean: t2 = t2 ? l$b : null; break; case Object: case Array: t2 = null == t2 ? t2 : JSON.stringify(t2); } return t2; }, fromAttribute(t2, s2) { let i2 = t2; switch (s2) { case Boolean: i2 = null !== t2; break; case Number: i2 = null === t2 ? null : Number(t2); break; case Object: case Array: try { i2 = JSON.parse(t2); } catch (t3) { i2 = null; } } return i2; } }, f$e = (t2, s2) => !i$f(t2, s2), y$b = { attribute: true, type: String, converter: u$9, reflect: false, hasChanged: f$e }; Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), a$a.litPropertyMetadata ?? (a$a.litPropertyMetadata = /* @__PURE__ */ new WeakMap()); let b$9 = class b extends HTMLElement { static addInitializer(t2) { this._$Ei(), (this.l ?? (this.l = [])).push(t2); } static get observedAttributes() { return this.finalize(), this._$Eh && [...this._$Eh.keys()]; } static createProperty(t2, s2 = y$b) { if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { const i2 = Symbol(), r2 = this.getPropertyDescriptor(t2, i2, s2); void 0 !== r2 && e$i(this.prototype, t2, r2); } } static getPropertyDescriptor(t2, s2, i2) { const { get: e2, set: h2 } = r$k(this.prototype, t2) ?? { get() { return this[s2]; }, set(t3) { this[s2] = t3; } }; return { get() { return e2 == null ? void 0 : e2.call(this); }, set(s3) { const r2 = e2 == null ? void 0 : e2.call(this); h2.call(this, s3), this.requestUpdate(t2, r2, i2); }, configurable: true, enumerable: true }; } static getPropertyOptions(t2) { return this.elementProperties.get(t2) ?? y$b; } static _$Ei() { if (this.hasOwnProperty(d$b("elementProperties"))) return; const t2 = n$k(this); t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); } static finalize() { if (this.hasOwnProperty(d$b("finalized"))) return; if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$b("properties"))) { const t3 = this.properties, s2 = [...h$g(t3), ...o$l(t3)]; for (const i2 of s2) this.createProperty(i2, t3[i2]); } const t2 = this[Symbol.metadata]; if (null !== t2) { const s2 = litPropertyMetadata.get(t2); if (void 0 !== s2) for (const [t3, i2] of s2) this.elementProperties.set(t3, i2); } this._$Eh = /* @__PURE__ */ new Map(); for (const [t3, s2] of this.elementProperties) { const i2 = this._$Eu(t3, s2); void 0 !== i2 && this._$Eh.set(i2, t3); } this.elementStyles = this.finalizeStyles(this.styles); } static finalizeStyles(s2) { const i2 = []; if (Array.isArray(s2)) { const e2 = new Set(s2.flat(1 / 0).reverse()); for (const s3 of e2) i2.unshift(c$g(s3)); } else void 0 !== s2 && i2.push(c$g(s2)); return i2; } static _$Eu(t2, s2) { const i2 = s2.attribute; return false === i2 ? void 0 : "string" == typeof i2 ? i2 : "string" == typeof t2 ? t2.toLowerCase() : void 0; } constructor() { super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); } _$Ev() { var _a2; this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (_a2 = this.constructor.l) == null ? void 0 : _a2.forEach((t2) => t2(this)); } addController(t2) { var _a2; (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t2), void 0 !== this.renderRoot && this.isConnected && ((_a2 = t2.hostConnected) == null ? void 0 : _a2.call(t2)); } removeController(t2) { var _a2; (_a2 = this._$EO) == null ? void 0 : _a2.delete(t2); } _$E_() { const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; for (const i2 of s2.keys()) this.hasOwnProperty(i2) && (t2.set(i2, this[i2]), delete this[i2]); t2.size > 0 && (this._$Ep = t2); } createRenderRoot() { const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); return S$c(t2, this.constructor.elementStyles), t2; } connectedCallback() { var _a2; this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), (_a2 = this._$EO) == null ? void 0 : _a2.forEach((t2) => { var _a3; return (_a3 = t2.hostConnected) == null ? void 0 : _a3.call(t2); }); } enableUpdating(t2) { } disconnectedCallback() { var _a2; (_a2 = this._$EO) == null ? void 0 : _a2.forEach((t2) => { var _a3; return (_a3 = t2.hostDisconnected) == null ? void 0 : _a3.call(t2); }); } attributeChangedCallback(t2, s2, i2) { this._$AK(t2, i2); } _$EC(t2, s2) { var _a2; const i2 = this.constructor.elementProperties.get(t2), e2 = this.constructor._$Eu(t2, i2); if (void 0 !== e2 && true === i2.reflect) { const r2 = (void 0 !== ((_a2 = i2.converter) == null ? void 0 : _a2.toAttribute) ? i2.converter : u$9).toAttribute(s2, i2.type); this._$Em = t2, null == r2 ? this.removeAttribute(e2) : this.setAttribute(e2, r2), this._$Em = null; } } _$AK(t2, s2) { var _a2; const i2 = this.constructor, e2 = i2._$Eh.get(t2); if (void 0 !== e2 && this._$Em !== e2) { const t3 = i2.getPropertyOptions(e2), r2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== ((_a2 = t3.converter) == null ? void 0 : _a2.fromAttribute) ? t3.converter : u$9; this._$Em = e2, this[e2] = r2.fromAttribute(s2, t3.type), this._$Em = null; } } requestUpdate(t2, s2, i2) { if (void 0 !== t2) { if (i2 ?? (i2 = this.constructor.getPropertyOptions(t2)), !(i2.hasChanged ?? f$e)(this[t2], s2)) return; this.P(t2, s2, i2); } false === this.isUpdatePending && (this._$ES = this._$ET()); } P(t2, s2, i2) { this._$AL.has(t2) || this._$AL.set(t2, s2), true === i2.reflect && this._$Em !== t2 && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t2); } async _$ET() { this.isUpdatePending = true; try { await this._$ES; } catch (t3) { Promise.reject(t3); } const t2 = this.scheduleUpdate(); return null != t2 && await t2, !this.isUpdatePending; } scheduleUpdate() { return this.performUpdate(); } performUpdate() { var _a2; if (!this.isUpdatePending) return; if (!this.hasUpdated) { if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) { for (const [t4, s3] of this._$Ep) this[t4] = s3; this._$Ep = void 0; } const t3 = this.constructor.elementProperties; if (t3.size > 0) for (const [s3, i2] of t3) true !== i2.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i2); } let t2 = false; const s2 = this._$AL; try { t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), (_a2 = this._$EO) == null ? void 0 : _a2.forEach((t3) => { var _a3; return (_a3 = t3.hostUpdate) == null ? void 0 : _a3.call(t3); }), this.update(s2)) : this._$EU(); } catch (s3) { throw t2 = false, this._$EU(), s3; } t2 && this._$AE(s2); } willUpdate(t2) { } _$AE(t2) { var _a2; (_a2 = this._$EO) == null ? void 0 : _a2.forEach((t3) => { var _a3; return (_a3 = t3.hostUpdated) == null ? void 0 : _a3.call(t3); }), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); } _$EU() { this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; } get updateComplete() { return this.getUpdateComplete(); } getUpdateComplete() { return this._$ES; } shouldUpdate(t2) { return true; } update(t2) { this._$Ej && (this._$Ej = this._$Ej.forEach((t3) => this._$EC(t3, this[t3]))), this._$EU(); } updated(t2) { } firstUpdated(t2) { } }; b$9.elementStyles = [], b$9.shadowRootOptions = { mode: "open" }, b$9[d$b("elementProperties")] = /* @__PURE__ */ new Map(), b$9[d$b("finalized")] = /* @__PURE__ */ new Map(), p$c == null ? void 0 : p$c({ ReactiveElement: b$9 }), (a$a.reactiveElementVersions ?? (a$a.reactiveElementVersions = [])).push("2.0.4"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t$c = globalThis, i$e = t$c.trustedTypes, s$c = i$e ? i$e.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, e$h = "$lit$", h$f = `lit$${Math.random().toFixed(9).slice(2)}$`, o$k = "?" + h$f, n$j = `<${o$k}>`, r$j = document, l$a = () => r$j.createComment(""), c$e = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, a$9 = Array.isArray, u$8 = (t2) => a$9(t2) || "function" == typeof (t2 == null ? void 0 : t2[Symbol.iterator]), d$a = "[ \n\f\r]", f$d = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v$a = /-->/g, _$a = />/g, m$7 = RegExp(`>|${d$a}(?:([^\\s"'>=/]+)(${d$a}*=${d$a}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"), p$b = /'/g, g$b = /"/g, $$7 = /^(?:script|style|textarea|title)$/i, y$a = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), x$6 = y$a(1), b$8 = y$a(2), w$b = Symbol.for("lit-noChange"), T$9 = Symbol.for("lit-nothing"), A$7 = /* @__PURE__ */ new WeakMap(), E$9 = r$j.createTreeWalker(r$j, 129); function C$7(t2, i2) { if (!Array.isArray(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); return void 0 !== s$c ? s$c.createHTML(i2) : i2; } const P$7 = (t2, i2) => { const s2 = t2.length - 1, o2 = []; let r2, l2 = 2 === i2 ? "" : "", c2 = f$d; for (let i3 = 0; i3 < s2; i3++) { const s3 = t2[i3]; let a2, u2, d2 = -1, y2 = 0; for (; y2 < s3.length && (c2.lastIndex = y2, u2 = c2.exec(s3), null !== u2); ) y2 = c2.lastIndex, c2 === f$d ? "!--" === u2[1] ? c2 = v$a : void 0 !== u2[1] ? c2 = _$a : void 0 !== u2[2] ? ($$7.test(u2[2]) && (r2 = RegExp("" === u2[0] ? (c2 = r2 ?? f$d, d2 = -1) : void 0 === u2[1] ? d2 = -2 : (d2 = c2.lastIndex - u2[2].length, a2 = u2[1], c2 = void 0 === u2[3] ? m$7 : '"' === u2[3] ? g$b : p$b) : c2 === g$b || c2 === p$b ? c2 = m$7 : c2 === v$a || c2 === _$a ? c2 = f$d : (c2 = m$7, r2 = void 0); const x2 = c2 === m$7 && t2[i3 + 1].startsWith("/>") ? " " : ""; l2 += c2 === f$d ? s3 + n$j : d2 >= 0 ? (o2.push(a2), s3.slice(0, d2) + e$h + s3.slice(d2) + h$f + x2) : s3 + h$f + (-2 === d2 ? i3 : x2); } return [C$7(t2, l2 + (t2[s2] || "") + (2 === i2 ? "" : "")), o2]; }; let V$8 = class V2 { constructor({ strings: t2, _$litType$: s2 }, n2) { let r2; this.parts = []; let c2 = 0, a2 = 0; const u2 = t2.length - 1, d2 = this.parts, [f2, v2] = P$7(t2, s2); if (this.el = V2.createElement(f2, n2), E$9.currentNode = this.el.content, 2 === s2) { const t3 = this.el.content.firstChild; t3.replaceWith(...t3.childNodes); } for (; null !== (r2 = E$9.nextNode()) && d2.length < u2; ) { if (1 === r2.nodeType) { if (r2.hasAttributes()) for (const t3 of r2.getAttributeNames()) if (t3.endsWith(e$h)) { const i2 = v2[a2++], s3 = r2.getAttribute(t3).split(h$f), e2 = /([.?@])?(.*)/.exec(i2); d2.push({ type: 1, index: c2, name: e2[2], strings: s3, ctor: "." === e2[1] ? k$8 : "?" === e2[1] ? H$6 : "@" === e2[1] ? I$5 : R$5 }), r2.removeAttribute(t3); } else t3.startsWith(h$f) && (d2.push({ type: 6, index: c2 }), r2.removeAttribute(t3)); if ($$7.test(r2.tagName)) { const t3 = r2.textContent.split(h$f), s3 = t3.length - 1; if (s3 > 0) { r2.textContent = i$e ? i$e.emptyScript : ""; for (let i2 = 0; i2 < s3; i2++) r2.append(t3[i2], l$a()), E$9.nextNode(), d2.push({ type: 2, index: ++c2 }); r2.append(t3[s3], l$a()); } } } else if (8 === r2.nodeType) if (r2.data === o$k) d2.push({ type: 2, index: c2 }); else { let t3 = -1; for (; -1 !== (t3 = r2.data.indexOf(h$f, t3 + 1)); ) d2.push({ type: 7, index: c2 }), t3 += h$f.length - 1; } c2++; } } static createElement(t2, i2) { const s2 = r$j.createElement("template"); return s2.innerHTML = t2, s2; } }; function N$7(t2, i2, s2 = t2, e2) { var _a2, _b2; if (i2 === w$b) return i2; let h2 = void 0 !== e2 ? (_a2 = s2._$Co) == null ? void 0 : _a2[e2] : s2._$Cl; const o2 = c$e(i2) ? void 0 : i2._$litDirective$; return (h2 == null ? void 0 : h2.constructor) !== o2 && ((_b2 = h2 == null ? void 0 : h2._$AO) == null ? void 0 : _b2.call(h2, false), void 0 === o2 ? h2 = void 0 : (h2 = new o2(t2), h2._$AT(t2, s2, e2)), void 0 !== e2 ? (s2._$Co ?? (s2._$Co = []))[e2] = h2 : s2._$Cl = h2), void 0 !== h2 && (i2 = N$7(t2, h2._$AS(t2, i2.values), h2, e2)), i2; } let S$b = class S { constructor(t2, i2) { this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2; } get parentNode() { return this._$AM.parentNode; } get _$AU() { return this._$AM._$AU; } u(t2) { const { el: { content: i2 }, parts: s2 } = this._$AD, e2 = ((t2 == null ? void 0 : t2.creationScope) ?? r$j).importNode(i2, true); E$9.currentNode = e2; let h2 = E$9.nextNode(), o2 = 0, n2 = 0, l2 = s2[0]; for (; void 0 !== l2; ) { if (o2 === l2.index) { let i3; 2 === l2.type ? i3 = new M$6(h2, h2.nextSibling, this, t2) : 1 === l2.type ? i3 = new l2.ctor(h2, l2.name, l2.strings, this, t2) : 6 === l2.type && (i3 = new L$8(h2, this, t2)), this._$AV.push(i3), l2 = s2[++n2]; } o2 !== (l2 == null ? void 0 : l2.index) && (h2 = E$9.nextNode(), o2++); } return E$9.currentNode = r$j, e2; } p(t2) { let i2 = 0; for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i2), i2 += s2.strings.length - 2) : s2._$AI(t2[i2])), i2++; } }; let M$6 = class M2 { get _$AU() { var _a2; return ((_a2 = this._$AM) == null ? void 0 : _a2._$AU) ?? this._$Cv; } constructor(t2, i2, s2, e2) { this.type = 2, this._$AH = T$9, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$Cv = (e2 == null ? void 0 : e2.isConnected) ?? true; } get parentNode() { let t2 = this._$AA.parentNode; const i2 = this._$AM; return void 0 !== i2 && 11 === (t2 == null ? void 0 : t2.nodeType) && (t2 = i2.parentNode), t2; } get startNode() { return this._$AA; } get endNode() { return this._$AB; } _$AI(t2, i2 = this) { t2 = N$7(this, t2, i2), c$e(t2) ? t2 === T$9 || null == t2 || "" === t2 ? (this._$AH !== T$9 && this._$AR(), this._$AH = T$9) : t2 !== this._$AH && t2 !== w$b && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : u$8(t2) ? this.k(t2) : this._(t2); } S(t2) { return this._$AA.parentNode.insertBefore(t2, this._$AB); } T(t2) { this._$AH !== t2 && (this._$AR(), this._$AH = this.S(t2)); } _(t2) { this._$AH !== T$9 && c$e(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(r$j.createTextNode(t2)), this._$AH = t2; } $(t2) { var _a2; const { values: i2, _$litType$: s2 } = t2, e2 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = V$8.createElement(C$7(s2.h, s2.h[0]), this.options)), s2); if (((_a2 = this._$AH) == null ? void 0 : _a2._$AD) === e2) this._$AH.p(i2); else { const t3 = new S$b(e2, this), s3 = t3.u(this.options); t3.p(i2), this.T(s3), this._$AH = t3; } } _$AC(t2) { let i2 = A$7.get(t2.strings); return void 0 === i2 && A$7.set(t2.strings, i2 = new V$8(t2)), i2; } k(t2) { a$9(this._$AH) || (this._$AH = [], this._$AR()); const i2 = this._$AH; let s2, e2 = 0; for (const h2 of t2) e2 === i2.length ? i2.push(s2 = new M2(this.S(l$a()), this.S(l$a()), this, this.options)) : s2 = i2[e2], s2._$AI(h2), e2++; e2 < i2.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i2.length = e2); } _$AR(t2 = this._$AA.nextSibling, i2) { var _a2; for ((_a2 = this._$AP) == null ? void 0 : _a2.call(this, false, true, i2); t2 && t2 !== this._$AB; ) { const i3 = t2.nextSibling; t2.remove(), t2 = i3; } } setConnected(t2) { var _a2; void 0 === this._$AM && (this._$Cv = t2, (_a2 = this._$AP) == null ? void 0 : _a2.call(this, t2)); } }; let R$5 = class R { get tagName() { return this.element.tagName; } get _$AU() { return this._$AM._$AU; } constructor(t2, i2, s2, e2, h2) { this.type = 1, this._$AH = T$9, this._$AN = void 0, this.element = t2, this.name = i2, this._$AM = e2, this.options = h2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = T$9; } _$AI(t2, i2 = this, s2, e2) { const h2 = this.strings; let o2 = false; if (void 0 === h2) t2 = N$7(this, t2, i2, 0), o2 = !c$e(t2) || t2 !== this._$AH && t2 !== w$b, o2 && (this._$AH = t2); else { const e3 = t2; let n2, r2; for (t2 = h2[0], n2 = 0; n2 < h2.length - 1; n2++) r2 = N$7(this, e3[s2 + n2], i2, n2), r2 === w$b && (r2 = this._$AH[n2]), o2 || (o2 = !c$e(r2) || r2 !== this._$AH[n2]), r2 === T$9 ? t2 = T$9 : t2 !== T$9 && (t2 += (r2 ?? "") + h2[n2 + 1]), this._$AH[n2] = r2; } o2 && !e2 && this.j(t2); } j(t2) { t2 === T$9 ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); } }; let k$8 = class k extends R$5 { constructor() { super(...arguments), this.type = 3; } j(t2) { this.element[this.name] = t2 === T$9 ? void 0 : t2; } }; let H$6 = class H extends R$5 { constructor() { super(...arguments), this.type = 4; } j(t2) { this.element.toggleAttribute(this.name, !!t2 && t2 !== T$9); } }; let I$5 = class I extends R$5 { constructor(t2, i2, s2, e2, h2) { super(t2, i2, s2, e2, h2), this.type = 5; } _$AI(t2, i2 = this) { if ((t2 = N$7(this, t2, i2, 0) ?? T$9) === w$b) return; const s2 = this._$AH, e2 = t2 === T$9 && s2 !== T$9 || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h2 = t2 !== T$9 && (s2 === T$9 || e2); e2 && this.element.removeEventListener(this.name, this, s2), h2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; } handleEvent(t2) { var _a2; "function" == typeof this._$AH ? this._$AH.call(((_a2 = this.options) == null ? void 0 : _a2.host) ?? this.element, t2) : this._$AH.handleEvent(t2); } }; let L$8 = class L { constructor(t2, i2, s2) { this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i2, this.options = s2; } get _$AU() { return this._$AM._$AU; } _$AI(t2) { N$7(this, t2); } }; const Z$6 = t$c.litHtmlPolyfillSupport; Z$6 == null ? void 0 : Z$6(V$8, M$6), (t$c.litHtmlVersions ?? (t$c.litHtmlVersions = [])).push("3.1.3"); const j$9 = (t2, i2, s2) => { const e2 = (s2 == null ? void 0 : s2.renderBefore) ?? i2; let h2 = e2._$litPart$; if (void 0 === h2) { const t3 = (s2 == null ? void 0 : s2.renderBefore) ?? null; e2._$litPart$ = h2 = new M$6(i2.insertBefore(l$a(), t3), t3, void 0, s2 ?? {}); } return h2._$AI(t2), h2; }; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ let s$b = class s extends b$9 { constructor() { super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; } createRenderRoot() { var _a2; const t2 = super.createRenderRoot(); return (_a2 = this.renderOptions).renderBefore ?? (_a2.renderBefore = t2.firstChild), t2; } update(t2) { const i2 = this.render(); this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = j$9(i2, this.renderRoot, this.renderOptions); } connectedCallback() { var _a2; super.connectedCallback(), (_a2 = this._$Do) == null ? void 0 : _a2.setConnected(true); } disconnectedCallback() { var _a2; super.disconnectedCallback(), (_a2 = this._$Do) == null ? void 0 : _a2.setConnected(false); } render() { return w$b; } }; s$b._$litElement$ = true, s$b["finalized"] = true, (_a = globalThis.litElementHydrateSupport) == null ? void 0 : _a.call(globalThis, { LitElement: s$b }); const r$i = globalThis.litElementPolyfillSupport; r$i == null ? void 0 : r$i({ LitElement: s$b }); (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.5"); let themeTag = void 0; let darkModeTag = void 0; let lightModeTag = void 0; function initializeTheming(themeVariables, themeMode) { themeTag = document.createElement("style"); darkModeTag = document.createElement("style"); lightModeTag = document.createElement("style"); themeTag.textContent = createRootStyles(themeVariables).core.cssText; darkModeTag.textContent = createRootStyles(themeVariables).dark.cssText; lightModeTag.textContent = createRootStyles(themeVariables).light.cssText; document.head.appendChild(themeTag); document.head.appendChild(darkModeTag); document.head.appendChild(lightModeTag); setColorTheme(themeMode); } function setColorTheme(themeMode) { if (darkModeTag && lightModeTag) { if (themeMode === "light") { darkModeTag.removeAttribute("media"); lightModeTag.media = "enabled"; } else { lightModeTag.removeAttribute("media"); darkModeTag.media = "enabled"; } } } function setThemeVariables(themeVariables) { if (themeTag && darkModeTag && lightModeTag) { themeTag.textContent = createRootStyles(themeVariables).core.cssText; darkModeTag.textContent = createRootStyles(themeVariables).dark.cssText; lightModeTag.textContent = createRootStyles(themeVariables).light.cssText; } } function createRootStyles(themeVariables) { return { core: i$g` @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); :root { --w3m-color-mix-strength: ${r$l((themeVariables == null ? void 0 : themeVariables["--w3m-color-mix-strength"]) ? `${themeVariables["--w3m-color-mix-strength"]}%` : "0%")}; --w3m-font-family: ${r$l((themeVariables == null ? void 0 : themeVariables["--w3m-font-family"]) || "Inter, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;")}; --w3m-font-size-master: ${r$l((themeVariables == null ? void 0 : themeVariables["--w3m-font-size-master"]) || "10px")}; --w3m-border-radius-master: ${r$l((themeVariables == null ? void 0 : themeVariables["--w3m-border-radius-master"]) || "4px")}; --w3m-z-index: ${r$l((themeVariables == null ? void 0 : themeVariables["--w3m-z-index"]) || 100)}; --wui-font-family: var(--w3m-font-family); --wui-font-size-micro: var(--w3m-font-size-master); --wui-font-size-tiny: calc(var(--w3m-font-size-master) * 1.2); --wui-font-size-small: calc(var(--w3m-font-size-master) * 1.4); --wui-font-size-paragraph: calc(var(--w3m-font-size-master) * 1.6); --wui-font-size-large: calc(var(--w3m-font-size-master) * 2); --wui-border-radius-5xs: var(--w3m-border-radius-master); --wui-border-radius-4xs: calc(var(--w3m-border-radius-master) * 1.5); --wui-border-radius-3xs: calc(var(--w3m-border-radius-master) * 2); --wui-border-radius-xxs: calc(var(--w3m-border-radius-master) * 3); --wui-border-radius-xs: calc(var(--w3m-border-radius-master) * 4); --wui-border-radius-s: calc(var(--w3m-border-radius-master) * 5); --wui-border-radius-m: calc(var(--w3m-border-radius-master) * 7); --wui-border-radius-l: calc(var(--w3m-border-radius-master) * 9); --wui-border-radius-3xl: calc(var(--w3m-border-radius-master) * 20); --wui-font-weight-light: 400; --wui-font-weight-regular: 500; --wui-font-weight-medium: 600; --wui-font-weight-bold: 700; --wui-letter-spacing-large: -0.8px; --wui-letter-spacing-paragraph: -0.64px; --wui-letter-spacing-small: -0.56px; --wui-letter-spacing-tiny: -0.48px; --wui-letter-spacing-micro: -0.2px; --wui-spacing-0: 0px; --wui-spacing-4xs: 2px; --wui-spacing-3xs: 4px; --wui-spacing-xxs: 6px; --wui-spacing-2xs: 7px; --wui-spacing-xs: 8px; --wui-spacing-1xs: 10px; --wui-spacing-s: 12px; --wui-spacing-m: 14px; --wui-spacing-l: 16px; --wui-spacing-2l: 18px; --wui-spacing-xl: 20px; --wui-spacing-xxl: 24px; --wui-spacing-2xl: 32px; --wui-spacing-3xl: 40px; --wui-spacing-4xl: 90px; --wui-icon-box-size-xxs: 14px; --wui-icon-box-size-xs: 20px; --wui-icon-box-size-sm: 24px; --wui-icon-box-size-md: 32px; --wui-icon-box-size-lg: 40px; --wui-icon-box-size-xl: 64px; --wui-icon-size-inherit: inherit; --wui-icon-size-xxs: 10px; --wui-icon-size-xs: 12px; --wui-icon-size-sm: 14px; --wui-icon-size-md: 16px; --wui-icon-size-mdl: 18px; --wui-icon-size-lg: 20px; --wui-icon-size-xl: 24px; --wui-wallet-image-size-inherit: inherit; --wui-wallet-image-size-sm: 40px; --wui-wallet-image-size-md: 56px; --wui-wallet-image-size-lg: 80px; --wui-box-size-md: 100px; --wui-box-size-lg: 120px; --wui-ease-out-power-2: cubic-bezier(0, 0, 0.22, 1); --wui-ease-out-power-1: cubic-bezier(0, 0, 0.55, 1); --wui-ease-in-power-3: cubic-bezier(0.66, 0, 1, 1); --wui-ease-in-power-2: cubic-bezier(0.45, 0, 1, 1); --wui-ease-in-power-1: cubic-bezier(0.3, 0, 1, 1); --wui-ease-inout-power-1: cubic-bezier(0.45, 0, 0.55, 1); --wui-duration-lg: 200ms; --wui-duration-md: 125ms; --wui-duration-sm: 75ms; --wui-path-network: 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' ); --wui-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' ); --wui-color-inherit: inherit; --wui-color-inverse-100: #fff; --wui-color-inverse-000: #000; --wui-cover: rgba(20, 20, 20, 0.8); --wui-color-modal-bg: var(--wui-color-modal-bg-base); --wui-color-blue-100: var(--wui-color-blue-base-100); --wui-color-accent-100: var(--wui-color-accent-base-100); --wui-color-accent-090: var(--wui-color-accent-base-090); --wui-color-accent-080: var(--wui-color-accent-base-080); --wui-accent-glass-090: var(--wui-accent-glass-base-090); --wui-accent-glass-080: var(--wui-accent-glass-base-080); --wui-accent-glass-020: var(--wui-accent-glass-base-020); --wui-accent-glass-015: var(--wui-accent-glass-base-015); --wui-accent-glass-010: var(--wui-accent-glass-base-010); --wui-accent-glass-005: var(--wui-accent-glass-base-005); --wui-accent-glass-002: var(--wui-accent-glass-base-002); --wui-color-fg-100: var(--wui-color-fg-base-100); --wui-color-fg-125: var(--wui-color-fg-base-125); --wui-color-fg-150: var(--wui-color-fg-base-150); --wui-color-fg-175: var(--wui-color-fg-base-175); --wui-color-fg-200: var(--wui-color-fg-base-200); --wui-color-fg-225: var(--wui-color-fg-base-225); --wui-color-fg-250: var(--wui-color-fg-base-250); --wui-color-fg-275: var(--wui-color-fg-base-275); --wui-color-fg-300: var(--wui-color-fg-base-300); --wui-color-bg-100: var(--wui-color-bg-base-100); --wui-color-bg-125: var(--wui-color-bg-base-125); --wui-color-bg-150: var(--wui-color-bg-base-150); --wui-color-bg-175: var(--wui-color-bg-base-175); --wui-color-bg-200: var(--wui-color-bg-base-200); --wui-color-bg-225: var(--wui-color-bg-base-225); --wui-color-bg-250: var(--wui-color-bg-base-250); --wui-color-bg-275: var(--wui-color-bg-base-275); --wui-color-bg-300: var(--wui-color-bg-base-300); --wui-color-success-100: var(--wui-color-success-base-100); --wui-color-error-100: var(--wui-color-error-base-100); --wui-icon-box-bg-error-100: var(--wui-icon-box-bg-error-base-100); --wui-icon-box-bg-blue-100: var(--wui-icon-box-bg-blue-base-100); --wui-icon-box-bg-success-100: var(--wui-icon-box-bg-success-base-100); --wui-icon-box-bg-inverse-100: var(--wui-icon-box-bg-inverse-base-100); --wui-all-wallets-bg-100: var(--wui-all-wallets-bg-base-100); --wui-avatar-border: var(--wui-avatar-border-base); --wui-thumbnail-border: var(--wui-thumbnail-border-base); --wui-box-shadow-blue: rgba(71, 161, 255, 0.16); } @supports (background: color-mix(in srgb, white 50%, black)) { :root { --wui-color-modal-bg: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-modal-bg-base) ); --wui-box-shadow-blue: color-mix(in srgb, var(--wui-color-accent-100) 16%, transparent); --wui-color-accent-090: color-mix( in srgb, var(--wui-color-accent-base-100) 90%, var(--w3m-default) ); --wui-color-accent-080: color-mix( in srgb, var(--wui-color-accent-base-100) 80%, var(--w3m-default) ); --wui-color-accent-090: color-mix( in srgb, var(--wui-color-accent-base-100) 90%, transparent ); --wui-color-accent-080: color-mix( in srgb, var(--wui-color-accent-base-100) 80%, transparent ); --wui-accent-glass-090: color-mix( in srgb, var(--wui-color-accent-base-100) 90%, transparent ); --wui-accent-glass-080: color-mix( in srgb, var(--wui-color-accent-base-100) 80%, transparent ); --wui-accent-glass-020: color-mix( in srgb, var(--wui-color-accent-base-100) 20%, transparent ); --wui-accent-glass-015: color-mix( in srgb, var(--wui-color-accent-base-100) 15%, transparent ); --wui-accent-glass-010: color-mix( in srgb, var(--wui-color-accent-base-100) 10%, transparent ); --wui-accent-glass-005: color-mix( in srgb, var(--wui-color-accent-base-100) 5%, transparent ); --wui-color-accent-002: color-mix( in srgb, var(--wui-color-accent-base-100) 2%, transparent ); --wui-color-fg-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-base-100) ); --wui-color-fg-125: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-base-125) ); --wui-color-fg-150: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-base-150) ); --wui-color-fg-175: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-base-175) ); --wui-color-fg-200: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-base-200) ); --wui-color-fg-225: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-base-225) ); --wui-color-fg-250: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-base-250) ); --wui-color-fg-275: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-base-275) ); --wui-color-fg-300: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-fg-base-300) ); --wui-color-bg-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-base-100) ); --wui-color-bg-125: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-base-125) ); --wui-color-bg-150: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-base-150) ); --wui-color-bg-175: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-base-175) ); --wui-color-bg-200: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-base-200) ); --wui-color-bg-225: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-base-225) ); --wui-color-bg-250: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-base-250) ); --wui-color-bg-275: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-base-275) ); --wui-color-bg-300: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-bg-base-300) ); --wui-color-success-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-success-base-100) ); --wui-color-error-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-color-error-base-100) ); --wui-icon-box-bg-error-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-icon-box-bg-error-base-100) ); --wui-icon-box-bg-accent-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-icon-box-bg-blue-base-100) ); --wui-icon-box-bg-success-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-icon-box-bg-success-base-100) ); --wui-icon-box-bg-inverse-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-icon-box-bg-inverse-base-100) ); --wui-all-wallets-bg-100: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-all-wallets-bg-base-100) ); --wui-avatar-border: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-avatar-border-base) ); --wui-thumbnail-border: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--wui-thumbnail-border-base) ); } } `, light: i$g` :root { --w3m-color-mix: ${r$l((themeVariables == null ? void 0 : themeVariables["--w3m-color-mix"]) || "#fff")}; --w3m-accent: ${r$l((themeVariables == null ? void 0 : themeVariables["--w3m-accent"]) || "#47a1ff")}; --w3m-default: #fff; --wui-color-modal-bg-base: #191a1a; --wui-color-blue-base-100: #47a1ff; --wui-color-accent-base-100: var(--w3m-accent); --wui-color-accent-base-090: #59aaff; --wui-color-accent-base-080: #6cb4ff; --wui-accent-glass-base-090: rgba(71, 161, 255, 0.9); --wui-accent-glass-base-080: rgba(71, 161, 255, 0.8); --wui-accent-glass-base-020: rgba(71, 161, 255, 0.2); --wui-accent-glass-base-015: rgba(71, 161, 255, 0.15); --wui-accent-glass-base-010: rgba(71, 161, 255, 0.1); --wui-accent-glass-base-005: rgba(71, 161, 255, 0.05); --wui-accent-glass-base-002: rgba(71, 161, 255, 0.02); --wui-color-fg-base-100: #e4e7e7; --wui-color-fg-base-125: #d0d5d5; --wui-color-fg-base-150: #a8b1b1; --wui-color-fg-base-175: #a8b0b0; --wui-color-fg-base-200: #949e9e; --wui-color-fg-base-225: #868f8f; --wui-color-fg-base-250: #788080; --wui-color-fg-base-275: #788181; --wui-color-fg-base-300: #6e7777; --wui-color-bg-base-100: #141414; --wui-color-bg-base-125: #191a1a; --wui-color-bg-base-150: #1e1f1f; --wui-color-bg-base-175: #222525; --wui-color-bg-base-200: #272a2a; --wui-color-bg-base-225: #2c3030; --wui-color-bg-base-250: #313535; --wui-color-bg-base-275: #363b3b; --wui-color-bg-base-300: #3b4040; --wui-color-success-base-100: #26d962; --wui-color-error-base-100: #f25a67; --wui-success-glass-001: rgba(38, 217, 98, 0.01); --wui-success-glass-002: rgba(38, 217, 98, 0.02); --wui-success-glass-005: rgba(38, 217, 98, 0.05); --wui-success-glass-010: rgba(38, 217, 98, 0.1); --wui-success-glass-015: rgba(38, 217, 98, 0.15); --wui-success-glass-020: rgba(38, 217, 98, 0.2); --wui-success-glass-025: rgba(38, 217, 98, 0.25); --wui-success-glass-030: rgba(38, 217, 98, 0.3); --wui-success-glass-060: rgba(38, 217, 98, 0.6); --wui-success-glass-080: rgba(38, 217, 98, 0.8); --wui-icon-box-bg-error-base-100: #3c2426; --wui-icon-box-bg-blue-base-100: #20303f; --wui-icon-box-bg-success-base-100: var(--wui-success-glass-015); --wui-icon-box-bg-inverse-base-100: #243240; --wui-all-wallets-bg-base-100: #222b35; --wui-avatar-border-base: #252525; --wui-thumbnail-border-base: #252525; --wui-gray-glass-001: rgba(255, 255, 255, 0.01); --wui-gray-glass-002: rgba(255, 255, 255, 0.02); --wui-gray-glass-005: rgba(255, 255, 255, 0.05); --wui-gray-glass-010: rgba(255, 255, 255, 0.1); --wui-gray-glass-015: rgba(255, 255, 255, 0.15); --wui-gray-glass-020: rgba(255, 255, 255, 0.2); --wui-gray-glass-025: rgba(255, 255, 255, 0.25); --wui-gray-glass-030: rgba(255, 255, 255, 0.3); --wui-gray-glass-060: rgba(255, 255, 255, 0.6); --wui-gray-glass-080: rgba(255, 255, 255, 0.8); } `, dark: i$g` :root { --w3m-color-mix: ${r$l((themeVariables == null ? void 0 : themeVariables["--w3m-color-mix"]) || "#000")}; --w3m-accent: ${r$l((themeVariables == null ? void 0 : themeVariables["--w3m-accent"]) || "#3396ff")}; --w3m-default: #000; --wui-color-modal-bg-base: #fff; --wui-color-blue-base-100: #3396ff; --wui-color-accent-base-100: var(--w3m-accent); --wui-color-accent-base-090: #2d7dd2; --wui-color-accent-base-080: #2978cc; --wui-accent-glass-base-090: rgba(51, 150, 255, 0.9); --wui-accent-glass-base-080: rgba(51, 150, 255, 0.8); --wui-accent-glass-base-020: rgba(51, 150, 255, 0.2); --wui-accent-glass-base-015: rgba(51, 150, 255, 0.15); --wui-accent-glass-base-010: rgba(51, 150, 255, 0.1); --wui-accent-glass-base-005: rgba(51, 150, 255, 0.05); --wui-accent-glass-base-002: rgba(51, 150, 255, 0.02); --wui-color-fg-base-100: #141414; --wui-color-fg-base-125: #2d3131; --wui-color-fg-base-150: #474d4d; --wui-color-fg-base-175: #636d6d; --wui-color-fg-base-200: #798686; --wui-color-fg-base-225: #828f8f; --wui-color-fg-base-250: #8b9797; --wui-color-fg-base-275: #95a0a0; --wui-color-fg-base-300: #9ea9a9; --wui-color-bg-base-100: #ffffff; --wui-color-bg-base-125: #f5fafa; --wui-color-bg-base-150: #f3f8f8; --wui-color-bg-base-175: #eef4f4; --wui-color-bg-base-200: #eaf1f1; --wui-color-bg-base-225: #e5eded; --wui-color-bg-base-250: #e1e9e9; --wui-color-bg-base-275: #dce7e7; --wui-color-bg-base-300: #d8e3e3; --wui-color-success-base-100: #26b562; --wui-color-error-base-100: #f05142; --wui-success-glass-001: rgba(38, 181, 98, 0.01); --wui-success-glass-002: rgba(38, 181, 98, 0.02); --wui-success-glass-005: rgba(38, 181, 98, 0.05); --wui-success-glass-010: rgba(38, 181, 98, 0.1); --wui-success-glass-015: rgba(38, 181, 98, 0.15); --wui-success-glass-020: rgba(38, 181, 98, 0.2); --wui-success-glass-025: rgba(38, 181, 98, 0.25); --wui-success-glass-030: rgba(38, 181, 98, 0.3); --wui-success-glass-060: rgba(38, 181, 98, 0.6); --wui-success-glass-080: rgba(38, 181, 98, 0.8); --wui-icon-box-bg-error-base-100: #f4dfdd; --wui-icon-box-bg-blue-base-100: #d9ecfb; --wui-icon-box-bg-success-base-100: #daf0e4; --wui-icon-box-bg-inverse-base-100: #dcecfc; --wui-all-wallets-bg-base-100: #e8f1fa; --wui-avatar-border-base: #f3f4f4; --wui-thumbnail-border-base: #eaefef; --wui-gray-glass-001: rgba(0, 0, 0, 0.01); --wui-gray-glass-002: rgba(0, 0, 0, 0.02); --wui-gray-glass-005: rgba(0, 0, 0, 0.05); --wui-gray-glass-010: rgba(0, 0, 0, 0.1); --wui-gray-glass-015: rgba(0, 0, 0, 0.15); --wui-gray-glass-020: rgba(0, 0, 0, 0.2); --wui-gray-glass-025: rgba(0, 0, 0, 0.25); --wui-gray-glass-030: rgba(0, 0, 0, 0.3); --wui-gray-glass-060: rgba(0, 0, 0, 0.6); --wui-gray-glass-080: rgba(0, 0, 0, 0.8); } ` }; } const resetStyles = i$g` *, *::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(--wui-font-family); backface-visibility: hidden; } `; const elementStyles = i$g` button, a { cursor: pointer; display: flex; justify-content: center; align-items: center; position: relative; transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg); outline: none; border: 1px solid transparent; column-gap: var(--wui-spacing-3xs); background-color: transparent; text-decoration: none; } @media (hover: hover) and (pointer: fine) { button:hover:enabled { background-color: var(--wui-gray-glass-005); } button:active:enabled { transition: all var(--wui-ease-out-power-2) var(--wui-duration-sm); background-color: var(--wui-gray-glass-010); } button[data-variant='fill']:hover:enabled { background-color: var(--wui-color-accent-090); } button[data-variant='accentBg']:hover:enabled { background: var(--wui-accent-glass-015); } button[data-variant='accentBg']:active:enabled { background: var(--wui-accent-glass-020); } } button:disabled { cursor: not-allowed; background-color: var(--wui-gray-glass-005); } button[data-variant='shade']:disabled, button[data-variant='accent']:disabled, button[data-variant='accentBg']:disabled { background-color: var(--wui-gray-glass-010); color: var(--wui-gray-glass-015); filter: grayscale(1); } button:disabled > wui-wallet-image, button:disabled > wui-all-wallets-image, button:disabled > wui-network-image, button:disabled > wui-image, button:disabled > wui-icon-box, button:disabled > wui-transaction-visual, button:disabled > wui-logo { filter: grayscale(1); } button:focus-visible, a:focus-visible { border: 1px solid var(--wui-color-accent-100); background-color: var(--wui-gray-glass-005); -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); } button[data-variant='fill']:focus-visible { background-color: var(--wui-color-accent-090); } button[data-variant='fill'] { color: var(--wui-color-inverse-100); background-color: var(--wui-color-accent-100); } button[data-variant='fill']:disabled { color: var(--wui-gray-glass-015); background-color: var(--wui-gray-glass-015); } button[data-variant='fill']:disabled > wui-icon { color: var(--wui-gray-glass-015); } button[data-variant='shade'] { color: var(--wui-color-fg-200); } button[data-variant='accent'], button[data-variant='accentBg'] { color: var(--wui-color-accent-100); } button[data-variant='accentBg'] { background: var(--wui-accent-glass-010); border: 1px solid var(--wui-accent-glass-010); } button[data-variant='fullWidth'] { width: 100%; border-radius: var(--wui-border-radius-xs); height: 56px; border: none; background-color: var(--wui-gray-glass-002); color: var(--wui-color-fg-200); gap: var(--wui-spacing-xs); } button:active:enabled { background-color: var(--wui-gray-glass-010); } button[data-variant='fill']:active:enabled { background-color: var(--wui-color-accent-080); border: 1px solid var(--wui-gray-glass-010); } input { border: none; outline: none; appearance: none; } `; const colorStyles = i$g` .wui-color-inherit { color: var(--wui-color-inherit); } .wui-color-accent-100 { color: var(--wui-color-accent-100); } .wui-color-error-100 { color: var(--wui-color-error-100); } .wui-color-success-100 { color: var(--wui-color-success-100); } .wui-color-inverse-100 { color: var(--wui-color-inverse-100); } .wui-color-inverse-000 { color: var(--wui-color-inverse-000); } .wui-color-fg-100 { color: var(--wui-color-fg-100); } .wui-color-fg-200 { color: var(--wui-color-fg-200); } .wui-color-fg-300 { color: var(--wui-color-fg-300); } .wui-bg-color-inherit { background-color: var(--wui-color-inherit); } .wui-bg-color-blue-100 { background-color: var(--wui-color-accent-100); } .wui-bg-color-error-100 { background-color: var(--wui-color-error-100); } .wui-bg-color-success-100 { background-color: var(--wui-color-success-100); } .wui-bg-color-inverse-100 { background-color: var(--wui-color-inverse-100); } .wui-bg-color-inverse-000 { background-color: var(--wui-color-inverse-000); } .wui-bg-color-fg-100 { background-color: var(--wui-color-fg-100); } .wui-bg-color-fg-200 { background-color: var(--wui-color-fg-200); } .wui-bg-color-fg-300 { background-color: var(--wui-color-fg-300); } `; function standardCustomElement(tagName, descriptor) { const { kind, elements } = descriptor; return { kind, elements, finisher(clazz) { if (!customElements.get(tagName)) { customElements.define(tagName, clazz); } } }; } function legacyCustomElement(tagName, clazz) { if (!customElements.get(tagName)) { customElements.define(tagName, clazz); } return clazz; } function customElement(tagName) { return function create2(classOrDescriptor) { return typeof classOrDescriptor === "function" ? legacyCustomElement(tagName, classOrDescriptor) : standardCustomElement(tagName, classOrDescriptor); }; } const styles$19 = i$g` :host { display: block; border-radius: clamp(0px, var(--wui-border-radius-l), 44px); border: 1px solid var(--wui-gray-glass-005); background-color: var(--wui-color-modal-bg); overflow: hidden; } `; var __decorate$1t = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiCard = class WuiCard extends s$b { render() { return x$6``; } }; WuiCard.styles = [resetStyles, styles$19]; WuiCard = __decorate$1t([ customElement("wui-card") ], WuiCard); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const o$j = { attribute: true, type: String, converter: u$9, reflect: false, hasChanged: f$e }, r$h = (t2 = o$j, e2, r2) => { const { kind: n2, metadata: i2 } = r2; let s2 = globalThis.litPropertyMetadata.get(i2); if (void 0 === s2 && globalThis.litPropertyMetadata.set(i2, s2 = /* @__PURE__ */ new Map()), s2.set(r2.name, t2), "accessor" === n2) { const { name: o2 } = r2; return { set(r3) { const n3 = e2.get.call(this); e2.set.call(this, r3), this.requestUpdate(o2, n3, t2); }, init(e3) { return void 0 !== e3 && this.P(o2, void 0, t2), e3; } }; } if ("setter" === n2) { const { name: o2 } = r2; return function(r3) { const n3 = this[o2]; e2.call(this, r3), this.requestUpdate(o2, n3, t2); }; } throw Error("Unsupported decorator location: " + n2); }; function n$i(t2) { return (e2, o2) => "object" == typeof o2 ? r$h(t2, e2, o2) : ((t3, e3, o3) => { const r2 = e3.hasOwnProperty(o3); return e3.constructor.createProperty(o3, r2 ? { ...t3, wrapped: true } : t3), r2 ? Object.getOwnPropertyDescriptor(e3, o3) : void 0; })(t2, e2, o2); } /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ function r$g(r2) { return n$i({ ...r2, state: true, attribute: false }); } const styles$18 = i$g` :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; } `; const allWalletsSvg = b$8` `; const appStoreSvg = b$8` `; const appleSvg = b$8` `; const arrowBottomSvg = b$8` `; const arrowLeftSvg = b$8` `; const arrowRightSvg = b$8` `; const arrowTopSvg = b$8` `; const browserSvg$1 = b$8` `; const checkmarkSvg = b$8` `; const chevronBottomSvg = b$8` `; const chevronLeftSvg = b$8` `; const chevronRightSvg = b$8` `; const chevronTopSvg = b$8` `; const chromeStoreSvg = b$8` `; const clockSvg = b$8` `; const closeSvg = b$8` `; const coinPlaceholderSvg = b$8` `; const compassSvg = b$8` `; const copySvg = b$8` `; const cursorSvg = b$8` `; const desktopSvg = b$8` `; const disconnectSvg = b$8` `; const discordSvg = b$8` `; const etherscanSvg = b$8` `; const extensionSvg = b$8` `; const externalLinkSvg = b$8` `; const facebookSvg = b$8` `; const filtersSvg = b$8` `; const githubSvg = b$8` `; const googleSvg = b$8` `; const helpCircleSvg = b$8` `; const infoCircleSvg = b$8` `; const mailSvg = b$8` `; const mobileSvg = b$8` `; const networkPlaceholderSvg = b$8` `; const nftPlaceholderSvg = b$8` `; const offSvg = b$8` `; const playStoreSvg = b$8` `; const qrCodeIcon = b$8` `; const refreshSvg = b$8` `; const searchSvg = b$8` `; const swapHorizontalSvg = b$8` `; const swapHorizontalBoldSvg = b$8` `; const swapVerticalSvg = b$8` `; const telegramSvg = b$8` `; const twitchSvg = b$8` `; const twitterSvg = b$8` `; const twitterIconSvg = b$8` `; const verifySvg = b$8` `; const verifyFilledSvg = b$8` `; const walletPlaceholderSvg = b$8` `; const walletSvg = b$8` `; const walletConnectSvg = b$8` `; const warningCircleSvg = b$8` `; const alphaSvg = b$8` `; var __decorate$1s = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const svgOptions$1 = { allWallets: allWalletsSvg, alpha: alphaSvg, appStore: appStoreSvg, chromeStore: chromeStoreSvg, apple: appleSvg, arrowBottom: arrowBottomSvg, arrowLeft: arrowLeftSvg, arrowRight: arrowRightSvg, arrowTop: arrowTopSvg, browser: browserSvg$1, checkmark: checkmarkSvg, chevronBottom: chevronBottomSvg, chevronLeft: chevronLeftSvg, chevronRight: chevronRightSvg, chevronTop: chevronTopSvg, clock: clockSvg, close: closeSvg, compass: compassSvg, coinPlaceholder: coinPlaceholderSvg, copy: copySvg, cursor: cursorSvg, desktop: desktopSvg, disconnect: disconnectSvg, discord: discordSvg, etherscan: etherscanSvg, extension: extensionSvg, externalLink: externalLinkSvg, facebook: facebookSvg, filters: filtersSvg, github: githubSvg, google: googleSvg, helpCircle: helpCircleSvg, infoCircle: infoCircleSvg, mail: mailSvg, mobile: mobileSvg, networkPlaceholder: networkPlaceholderSvg, nftPlaceholder: nftPlaceholderSvg, off: offSvg, playStore: playStoreSvg, qrCode: qrCodeIcon, refresh: refreshSvg, search: searchSvg, swapHorizontal: swapHorizontalSvg, swapHorizontalBold: swapHorizontalBoldSvg, swapVertical: swapVerticalSvg, telegram: telegramSvg, twitch: twitchSvg, twitter: twitterSvg, twitterIcon: twitterIconSvg, verify: verifySvg, verifyFilled: verifyFilledSvg, wallet: walletSvg, walletConnect: walletConnectSvg, walletPlaceholder: walletPlaceholderSvg, warningCircle: warningCircleSvg }; let WuiIcon = class WuiIcon extends s$b { constructor() { super(...arguments); this.size = "md"; this.name = "copy"; this.color = "fg-300"; } render() { this.style.cssText = ` --local-color: ${`var(--wui-color-${this.color});`} --local-width: ${`var(--wui-icon-size-${this.size});`} `; return x$6`${svgOptions$1[this.name]}`; } }; WuiIcon.styles = [resetStyles, colorStyles, styles$18]; __decorate$1s([ n$i() ], WuiIcon.prototype, "size", void 0); __decorate$1s([ n$i() ], WuiIcon.prototype, "name", void 0); __decorate$1s([ n$i() ], WuiIcon.prototype, "color", void 0); WuiIcon = __decorate$1s([ customElement("wui-icon") ], WuiIcon); const styles$17 = i$g` :host { display: block; width: 100%; height: 100%; } img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center center; border-radius: inherit; } `; var __decorate$1r = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiImage = class WuiImage extends s$b { constructor() { super(...arguments); this.src = "./path/to/image.jpg"; this.alt = "Image"; } render() { return x$6`${this.alt}`; } }; WuiImage.styles = [resetStyles, colorStyles, styles$17]; __decorate$1r([ n$i() ], WuiImage.prototype, "src", void 0); __decorate$1r([ n$i() ], WuiImage.prototype, "alt", void 0); WuiImage = __decorate$1r([ customElement("wui-image") ], WuiImage); const styles$16 = i$g` :host { display: block; width: var(--wui-box-size-lg); height: var(--wui-box-size-lg); } svg { width: var(--wui-box-size-lg); height: var(--wui-box-size-lg); fill: none; stroke: transparent; stroke-linecap: round; transition: all var(--wui-ease-in-power-3) var(--wui-duration-lg); } use { stroke: var(--wui-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 __decorate$1q = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiLoadingHexagon = class WuiLoadingHexagon extends s$b { render() { return x$6` `; } }; WuiLoadingHexagon.styles = [resetStyles, styles$16]; WuiLoadingHexagon = __decorate$1q([ customElement("wui-loading-hexagon") ], WuiLoadingHexagon); const styles$15 = i$g` :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; transition: all var(--wui-ease-in-power-3) var(--wui-duration-lg); } 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 __decorate$1p = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiLoadingSpinner = class WuiLoadingSpinner extends s$b { constructor() { super(...arguments); this.color = "accent-100"; this.size = "lg"; } render() { this.style.cssText = `--local-color: var(--wui-color-${this.color});`; this.dataset["size"] = this.size; return x$6` `; } }; WuiLoadingSpinner.styles = [resetStyles, styles$15]; __decorate$1p([ n$i() ], WuiLoadingSpinner.prototype, "color", void 0); __decorate$1p([ n$i() ], WuiLoadingSpinner.prototype, "size", void 0); WuiLoadingSpinner = __decorate$1p([ customElement("wui-loading-spinner") ], WuiLoadingSpinner); const styles$14 = i$g` :host { display: block; width: var(--wui-box-size-md); height: var(--wui-box-size-md); } svg { width: var(--wui-box-size-md); height: var(--wui-box-size-md); transition: all var(--wui-ease-in-power-3) var(--wui-duration-lg); } rect { fill: none; stroke: var(--wui-color-accent-100); stroke-width: 4px; stroke-linecap: round; animation: dash 1s linear infinite; } @keyframes dash { to { stroke-dashoffset: 0px; } } `; var __decorate$1o = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiLoadingThumbnail = class WuiLoadingThumbnail extends s$b { constructor() { super(...arguments); this.radius = 36; } render() { return this.svgLoaderTemplate(); } svgLoaderTemplate() { const radius = this.radius > 50 ? 50 : this.radius; const standardValue = 36; const radiusFactor = standardValue - radius; const dashArrayStart = 116 + radiusFactor; const dashArrayEnd = 245 + radiusFactor; const dashOffset = 360 + radiusFactor * 1.75; return x$6` `; } }; WuiLoadingThumbnail.styles = [resetStyles, styles$14]; __decorate$1o([ n$i({ type: Number }) ], WuiLoadingThumbnail.prototype, "radius", void 0); WuiLoadingThumbnail = __decorate$1o([ customElement("wui-loading-thumbnail") ], WuiLoadingThumbnail); const styles$13 = i$g` :host { display: block; box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); background: linear-gradient( 120deg, var(--wui-color-bg-200) 5%, var(--wui-color-bg-200) 48%, var(--wui-color-bg-300) 55%, var(--wui-color-bg-300) 60%, var(--wui-color-bg-300) calc(60% + 10px), var(--wui-color-bg-200) calc(60% + 12px), var(--wui-color-bg-200) 100% ); background-size: 250%; animation: shimmer 3s linear infinite reverse; } @keyframes shimmer { from { background-position: -250% 0; } to { background-position: 250% 0; } } `; var __decorate$1n = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiShimmer = class WuiShimmer extends s$b { constructor() { super(...arguments); this.width = ""; this.height = ""; this.borderRadius = "m"; } render() { this.style.cssText = ` width: ${this.width}; height: ${this.height}; border-radius: ${`clamp(0px,var(--wui-border-radius-${this.borderRadius}), 40px)`}; `; return x$6``; } }; WuiShimmer.styles = [styles$13]; __decorate$1n([ n$i() ], WuiShimmer.prototype, "width", void 0); __decorate$1n([ n$i() ], WuiShimmer.prototype, "height", void 0); __decorate$1n([ n$i() ], WuiShimmer.prototype, "borderRadius", void 0); WuiShimmer = __decorate$1n([ customElement("wui-shimmer") ], WuiShimmer); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t$b = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, e$g = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 }); let i$d = class i { constructor(t2) { } get _$AU() { return this._$AM._$AU; } _$AT(t2, e2, i2) { this._$Ct = t2, this._$AM = e2, this._$Ci = i2; } _$AS(t2, e2) { return this.update(t2, e2); } update(t2, e2) { return this.render(...e2); } }; /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const e$f = e$g(class extends i$d { constructor(t2) { var _a2; if (super(t2), t2.type !== t$b.ATTRIBUTE || "class" !== t2.name || ((_a2 = t2.strings) == null ? void 0 : _a2.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute."); } render(t2) { return " " + Object.keys(t2).filter((s2) => t2[s2]).join(" ") + " "; } update(s2, [i2]) { var _a2, _b2; if (void 0 === this.st) { this.st = /* @__PURE__ */ new Set(), void 0 !== s2.strings && (this.nt = new Set(s2.strings.join(" ").split(/\s/).filter((t2) => "" !== t2))); for (const t2 in i2) i2[t2] && !((_a2 = this.nt) == null ? void 0 : _a2.has(t2)) && this.st.add(t2); return this.render(i2); } const r2 = s2.element.classList; for (const t2 of this.st) t2 in i2 || (r2.remove(t2), this.st.delete(t2)); for (const t2 in i2) { const s3 = !!i2[t2]; s3 === this.st.has(t2) || ((_b2 = this.nt) == null ? void 0 : _b2.has(t2)) || (s3 ? (r2.add(t2), this.st.add(t2)) : (r2.remove(t2), this.st.delete(t2))); } return w$b; } }); const styles$12 = i$g` :host { display: flex !important; } slot { display: inline-block; font-style: normal; font-family: var(--wui-font-family); font-feature-settings: 'tnum' on, 'lnum' on, 'case' on; line-height: 130%; font-weight: var(--wui-font-weight-regular); overflow: inherit; text-overflow: inherit; text-align: var(--local-align); color: var(--local-color); } .wui-font-large-500, .wui-font-large-600, .wui-font-large-700 { font-size: var(--wui-font-size-large); letter-spacing: var(--wui-letter-spacing-large); } .wui-font-paragraph-500, .wui-font-paragraph-600, .wui-font-paragraph-700 { font-size: var(--wui-font-size-paragraph); letter-spacing: var(--wui-letter-spacing-paragraph); } .wui-font-small-400, .wui-font-small-500, .wui-font-small-600 { font-size: var(--wui-font-size-small); letter-spacing: var(--wui-letter-spacing-small); } .wui-font-tiny-500, .wui-font-tiny-600 { font-size: var(--wui-font-size-tiny); letter-spacing: var(--wui-letter-spacing-tiny); } .wui-font-micro-700, .wui-font-micro-600 { font-size: var(--wui-font-size-micro); letter-spacing: var(--wui-letter-spacing-micro); text-transform: uppercase; } .wui-font-small-400, .wui-font-paragraph-400 { font-weight: var(--wui-font-weight-light); } .wui-font-large-700, .wui-font-paragraph-700, .wui-font-micro-700 { font-weight: var(--wui-font-weight-bold); } .wui-font-large-600, .wui-font-paragraph-600, .wui-font-small-600, .wui-font-tiny-600, .wui-font-micro-600 { font-weight: var(--wui-font-weight-medium); } `; var __decorate$1m = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiText = class WuiText extends s$b { constructor() { super(...arguments); this.variant = "paragraph-500"; this.color = "fg-300"; this.align = "left"; } render() { const classes2 = { [`wui-font-${this.variant}`]: true, [`wui-color-${this.color}`]: true }; this.style.cssText = ` --local-align: ${this.align}; --local-color: var(--wui-color-${this.color}); `; return x$6``; } }; WuiText.styles = [resetStyles, styles$12]; __decorate$1m([ n$i() ], WuiText.prototype, "variant", void 0); __decorate$1m([ n$i() ], WuiText.prototype, "color", void 0); __decorate$1m([ n$i() ], WuiText.prototype, "align", void 0); WuiText = __decorate$1m([ customElement("wui-text") ], WuiText); const browserSvg = b$8` `; const daoSvg = b$8` `; const defiSvg = b$8` `; const defiAltSvg = b$8` `; const ethSvg = b$8` `; const layersSvg = b$8` `; const lockSvg = b$8` `; const loginSvg = b$8` `; const networkSvg$1 = b$8` `; const nftSvg = b$8` `; const nounSvg = b$8` `; const profileSvg = b$8` `; const systemSvg = b$8` `; const styles$11 = i$g` :host { display: block; width: 55px; height: 55px; } `; var __decorate$1l = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const svgOptions = { browser: browserSvg, dao: daoSvg, defi: defiSvg, defiAlt: defiAltSvg, eth: ethSvg, layers: layersSvg, lock: lockSvg, login: loginSvg, network: networkSvg$1, nft: nftSvg, noun: nounSvg, profile: profileSvg, system: systemSvg }; let WuiVisual = class WuiVisual extends s$b { constructor() { super(...arguments); this.name = "browser"; } render() { return x$6`${svgOptions[this.name]}`; } }; WuiVisual.styles = [resetStyles, styles$11]; __decorate$1l([ n$i() ], WuiVisual.prototype, "name", void 0); WuiVisual = __decorate$1l([ customElement("wui-visual") ], WuiVisual); /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const o$i = (o2) => o2 ?? T$9; const UiHelperUtil = { getSpacingStyles(spacing, index2) { if (Array.isArray(spacing)) { return spacing[index2] ? `var(--wui-spacing-${spacing[index2]})` : void 0; } else if (typeof spacing === "string") { return `var(--wui-spacing-${spacing})`; } return void 0; }, getFormattedDate(date2) { return new Intl.DateTimeFormat("en-US", { month: "short", day: "numeric" }).format(date2); }, getHostName(url) { const newUrl = new URL(url); return newUrl.hostname; }, getTruncateString({ string: string2, charsStart, charsEnd, truncate }) { if (string2.length <= charsStart + charsEnd) { return string2; } if (truncate === "end") { return `${string2.substring(0, charsStart)}...`; } else if (truncate === "start") { return `...${string2.substring(string2.length - charsEnd)}`; } return `${string2.substring(0, Math.floor(charsStart))}...${string2.substring(string2.length - Math.floor(charsEnd))}`; }, generateAvatarColors(address) { const hash2 = address.toLowerCase().replace(/^0x/iu, ""); const baseColor = hash2.substring(0, 6); const rgbColor = this.hexToRgb(baseColor); const masterBorderRadius = getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"); const radius = Number(masterBorderRadius == null ? void 0 : masterBorderRadius.replace("px", "")); const edge = 100 - 3 * radius; const gradientCircle = `${edge}% ${edge}% at 65% 40%`; const colors = []; for (let i2 = 0; i2 < 5; i2 += 1) { const tintedColor = this.tintColor(rgbColor, 0.15 * i2); colors.push(`rgb(${tintedColor[0]}, ${tintedColor[1]}, ${tintedColor[2]})`); } return ` --local-color-1: ${colors[0]}; --local-color-2: ${colors[1]}; --local-color-3: ${colors[2]}; --local-color-4: ${colors[3]}; --local-color-5: ${colors[4]}; --local-radial-circle: ${gradientCircle} `; }, hexToRgb(hex2) { const bigint2 = parseInt(hex2, 16); const r2 = bigint2 >> 16 & 255; const g2 = bigint2 >> 8 & 255; const b2 = bigint2 & 255; return [r2, g2, b2]; }, tintColor(rgb, tint) { const [r2, g2, b2] = rgb; const tintedR = Math.round(r2 + (255 - r2) * tint); const tintedG = Math.round(g2 + (255 - g2) * tint); const tintedB = Math.round(b2 + (255 - b2) * tint); return [tintedR, tintedG, tintedB]; }, isNumber(character) { const regex2 = { number: /^[0-9]+$/u }; return regex2.number.test(character); }, getColorTheme(theme) { if (theme) { return theme; } else if (typeof window !== "undefined" && window.matchMedia) { if (window.matchMedia("(prefers-color-scheme: dark)").matches) { return "dark"; } return "light"; } return "dark"; } }; const styles$10 = i$g` :host { display: flex; width: inherit; height: inherit; } `; var __decorate$1k = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiFlex = class WuiFlex extends s$b { render() { 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(--wui-spacing-${this.columnGap})`}; row-gap: ${this.rowGap && `var(--wui-spacing-${this.rowGap})`}; gap: ${this.gap && `var(--wui-spacing-${this.gap})`}; padding-top: ${this.padding && UiHelperUtil.getSpacingStyles(this.padding, 0)}; padding-right: ${this.padding && UiHelperUtil.getSpacingStyles(this.padding, 1)}; padding-bottom: ${this.padding && UiHelperUtil.getSpacingStyles(this.padding, 2)}; padding-left: ${this.padding && UiHelperUtil.getSpacingStyles(this.padding, 3)}; margin-top: ${this.margin && UiHelperUtil.getSpacingStyles(this.margin, 0)}; margin-right: ${this.margin && UiHelperUtil.getSpacingStyles(this.margin, 1)}; margin-bottom: ${this.margin && UiHelperUtil.getSpacingStyles(this.margin, 2)}; margin-left: ${this.margin && UiHelperUtil.getSpacingStyles(this.margin, 3)}; `; return x$6``; } }; WuiFlex.styles = [resetStyles, styles$10]; __decorate$1k([ n$i() ], WuiFlex.prototype, "flexDirection", void 0); __decorate$1k([ n$i() ], WuiFlex.prototype, "flexWrap", void 0); __decorate$1k([ n$i() ], WuiFlex.prototype, "flexBasis", void 0); __decorate$1k([ n$i() ], WuiFlex.prototype, "flexGrow", void 0); __decorate$1k([ n$i() ], WuiFlex.prototype, "flexShrink", void 0); __decorate$1k([ n$i() ], WuiFlex.prototype, "alignItems", void 0); __decorate$1k([ n$i() ], WuiFlex.prototype, "justifyContent", void 0); __decorate$1k([ n$i() ], WuiFlex.prototype, "columnGap", void 0); __decorate$1k([ n$i() ], WuiFlex.prototype, "rowGap", void 0); __decorate$1k([ n$i() ], WuiFlex.prototype, "gap", void 0); __decorate$1k([ n$i() ], WuiFlex.prototype, "padding", void 0); __decorate$1k([ n$i() ], WuiFlex.prototype, "margin", void 0); WuiFlex = __decorate$1k([ customElement("wui-flex") ], WuiFlex); const styles$$ = i$g` :host { display: block; width: var(--wui-icon-box-size-xl); height: var(--wui-icon-box-size-xl); border-radius: var(--wui-border-radius-3xl); box-shadow: 0 0 0 8px var(--wui-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(--w3m-color-mix) var(--w3m-color-mix-strength), var(--local-color-1) ); --mixed-local-color-2: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--local-color-2) ); --mixed-local-color-3: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--local-color-3) ); --mixed-local-color-4: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--local-color-4) ); --mixed-local-color-5: color-mix( in srgb, var(--w3m-color-mix) var(--w3m-color-mix-strength), var(--local-color-5) ); } } :host([data-variant='generated']) { box-shadow: 0 0 0 8px var(--wui-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(--wui-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 __decorate$1j = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiAvatar = class WuiAvatar extends s$b { constructor() { super(...arguments); this.imageSrc = void 0; this.alt = void 0; this.address = void 0; } render() { return x$6`${this.visualTemplate()}`; } visualTemplate() { if (this.imageSrc) { this.dataset["variant"] = "image"; return x$6``; } else if (this.address) { this.dataset["variant"] = "generated"; const cssColors = UiHelperUtil.generateAvatarColors(this.address); this.style.cssText = cssColors; return null; } this.dataset["variant"] = "default"; return null; } }; WuiAvatar.styles = [resetStyles, styles$$]; __decorate$1j([ n$i() ], WuiAvatar.prototype, "imageSrc", void 0); __decorate$1j([ n$i() ], WuiAvatar.prototype, "alt", void 0); __decorate$1j([ n$i() ], WuiAvatar.prototype, "address", void 0); WuiAvatar = __decorate$1j([ customElement("wui-avatar") ], WuiAvatar); const styles$_ = i$g` :host { display: inline-flex; justify-content: center; align-items: center; position: relative; overflow: hidden; background-color: var(--wui-gray-glass-020); border-radius: var(--local-border-radius); box-shadow: 0 0 0 1px var(--local-border); 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 __decorate$1i = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiIconBox = class WuiIconBox extends s$b { constructor() { super(...arguments); this.size = "md"; this.backgroundColor = "accent-100"; this.iconColor = "accent-100"; this.background = "transparent"; this.border = false; this.borderColor = "wui-color-bg-125"; this.icon = "copy"; } render() { const iconSize = this.iconSize || this.size; const isLg = this.size === "lg"; const isXl = this.size === "xl"; const bgMix = isLg ? "12%" : "16%"; const borderRadius = isLg ? "xxs" : isXl ? "s" : "3xl"; const isGray = this.background === "gray"; const isOpaque = this.background === "opaque"; const isColorChange = this.backgroundColor === "accent-100" && isOpaque || this.backgroundColor === "success-100" && isOpaque || this.backgroundColor === "error-100" && isOpaque || this.backgroundColor === "inverse-100" && isOpaque; let bgValueVariable = `var(--wui-color-${this.backgroundColor})`; if (isColorChange) { bgValueVariable = `var(--wui-icon-box-bg-${this.backgroundColor})`; } else if (isGray) { bgValueVariable = `var(--wui-gray-${this.backgroundColor})`; } this.style.cssText = ` --local-bg-value: ${bgValueVariable}; --local-bg-mix: ${isColorChange || isGray ? `100%` : bgMix}; --local-border-radius: var(--wui-border-radius-${borderRadius}); --local-size: var(--wui-icon-box-size-${this.size}); --local-border: ${this.borderColor === "wui-color-bg-125" ? `2px` : `1px`} solid ${this.border ? `var(--${this.borderColor})` : `transparent`} `; return x$6` `; } }; WuiIconBox.styles = [resetStyles, elementStyles, styles$_]; __decorate$1i([ n$i() ], WuiIconBox.prototype, "size", void 0); __decorate$1i([ n$i() ], WuiIconBox.prototype, "backgroundColor", void 0); __decorate$1i([ n$i() ], WuiIconBox.prototype, "iconColor", void 0); __decorate$1i([ n$i() ], WuiIconBox.prototype, "iconSize", void 0); __decorate$1i([ n$i() ], WuiIconBox.prototype, "background", void 0); __decorate$1i([ n$i({ type: Boolean }) ], WuiIconBox.prototype, "border", void 0); __decorate$1i([ n$i() ], WuiIconBox.prototype, "borderColor", void 0); __decorate$1i([ n$i() ], WuiIconBox.prototype, "icon", void 0); WuiIconBox = __decorate$1i([ customElement("wui-icon-box") ], WuiIconBox); const styles$Z = i$g` :host { display: block; } button { border-radius: var(--wui-border-radius-3xl); background: var(--wui-gray-glass-002); display: flex; gap: var(--wui-spacing-xs); padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) var(--wui-spacing-3xs) var(--wui-spacing-xs); border: 1px solid var(--wui-gray-glass-005); } button:disabled { background: var(--wui-gray-glass-015); } button:disabled > wui-text { color: var(--wui-gray-glass-015); } button:disabled > wui-flex > wui-text { color: var(--wui-gray-glass-015); } button:disabled > wui-image, button:disabled > wui-icon-box, button:disabled > wui-flex > wui-avatar { filter: grayscale(1); } button:has(wui-image) { padding: var(--wui-spacing-3xs) var(--wui-spacing-3xs) var(--wui-spacing-3xs) var(--wui-spacing-xs); } wui-text { color: var(--wui-color-fg-100); } wui-flex > wui-text { color: var(--wui-color-fg-200); transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg); } wui-image, wui-icon-box { border-radius: var(--wui-border-radius-3xl); width: 24px; height: 24px; box-shadow: 0 0 0 2px var(--wui-gray-glass-005); } wui-flex { border-radius: var(--wui-border-radius-3xl); border: 1px solid var(--wui-gray-glass-005); background: var(--wui-gray-glass-005); padding: 4px var(--wui-spacing-m) 4px var(--wui-spacing-xxs); } button.local-no-balance { border-radius: 0px; border: none; background: transparent; } wui-avatar { width: 20px; height: 20px; box-shadow: 0 0 0 2px var(--wui-accent-glass-010); } @media (max-width: 500px) { button { gap: 0px; padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) !important; height: 32px; } wui-image, wui-icon-box, button > wui-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 > wui-flex > wui-text { color: var(--wui-color-fg-175); } button:active:enabled > wui-flex > wui-text { color: var(--wui-color-fg-175); } } `; var __decorate$1h = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiAccountButton = class WuiAccountButton extends s$b { constructor() { super(...arguments); this.networkSrc = void 0; this.avatarSrc = void 0; this.balance = void 0; this.disabled = false; this.isProfileName = false; this.address = ""; this.charsStart = 4; this.charsEnd = 6; } render() { return x$6` `; } balanceTemplate() { if (this.balance) { const networkElement = this.networkSrc ? x$6`` : x$6` `; return x$6` ${networkElement} ${this.balance} `; } return null; } }; WuiAccountButton.styles = [resetStyles, elementStyles, styles$Z]; __decorate$1h([ n$i() ], WuiAccountButton.prototype, "networkSrc", void 0); __decorate$1h([ n$i() ], WuiAccountButton.prototype, "avatarSrc", void 0); __decorate$1h([ n$i() ], WuiAccountButton.prototype, "balance", void 0); __decorate$1h([ n$i({ type: Boolean }) ], WuiAccountButton.prototype, "disabled", void 0); __decorate$1h([ n$i({ type: Boolean }) ], WuiAccountButton.prototype, "isProfileName", void 0); __decorate$1h([ n$i() ], WuiAccountButton.prototype, "address", void 0); __decorate$1h([ n$i() ], WuiAccountButton.prototype, "charsStart", void 0); __decorate$1h([ n$i() ], WuiAccountButton.prototype, "charsEnd", void 0); WuiAccountButton = __decorate$1h([ customElement("wui-account-button") ], WuiAccountButton); const styles$Y = i$g` :host { position: relative; background-color: var(--wui-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 > wui-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(--wui-gray-glass-010); pointer-events: none; } :host([name='Extension'])::after { border: 1px solid var(--wui-accent-glass-010); } :host([data-wallet-icon='allWallets']) { background-color: var(--wui-all-wallets-bg-100); } :host([data-wallet-icon='allWallets'])::after { border: 1px solid var(--wui-accent-glass-010); } wui-icon[data-parent-size='inherit'] { width: 75%; height: 75%; align-items: center; } wui-icon[data-parent-size='sm'] { width: 18px; height: 18px; } wui-icon[data-parent-size='md'] { width: 24px; height: 24px; } wui-icon[data-parent-size='lg'] { width: 42px; height: 42px; } wui-icon[data-parent-size='full'] { width: 100%; height: 100%; } :host > wui-icon-box { position: absolute; overflow: hidden; right: -1px; bottom: -2px; z-index: 1; border: 2px solid var(--wui-color-bg-base-150, #1e1f1f); padding: 1px; } `; var __decorate$1g = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiWalletImage = class WuiWalletImage extends s$b { constructor() { super(...arguments); this.size = "md"; this.name = ""; this.installed = false; this.badgeSize = "xs"; } render() { let borderRadius = "xxs"; if (this.size === "lg") { borderRadius = "m"; } else if (this.size === "md") { borderRadius = "xs"; } else { borderRadius = "xxs"; } this.style.cssText = ` --local-border-radius: var(--wui-border-radius-${borderRadius}); --local-size: var(--wui-wallet-image-size-${this.size}); `; if (this.walletIcon) { this.dataset["walletIcon"] = this.walletIcon; } return x$6` ${this.templateVisual()} `; } templateVisual() { if (this.imageSrc) { return x$6``; } else if (this.walletIcon) { return x$6``; } return x$6``; } }; WuiWalletImage.styles = [resetStyles, styles$Y]; __decorate$1g([ n$i() ], WuiWalletImage.prototype, "size", void 0); __decorate$1g([ n$i() ], WuiWalletImage.prototype, "name", void 0); __decorate$1g([ n$i() ], WuiWalletImage.prototype, "imageSrc", void 0); __decorate$1g([ n$i() ], WuiWalletImage.prototype, "walletIcon", void 0); __decorate$1g([ n$i({ type: Boolean }) ], WuiWalletImage.prototype, "installed", void 0); __decorate$1g([ n$i() ], WuiWalletImage.prototype, "badgeSize", void 0); WuiWalletImage = __decorate$1g([ customElement("wui-wallet-image") ], WuiWalletImage); const styles$X = i$g` :host { position: relative; border-radius: var(--wui-border-radius-xxs); width: 40px; height: 40px; overflow: hidden; background: var(--wui-gray-glass-002); display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: var(--wui-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(--wui-gray-glass-010); pointer-events: none; } :host > wui-wallet-image { width: 14px; height: 14px; border-radius: var(--wui-border-radius-5xs); } :host > wui-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 __decorate$1f = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const TOTAL_IMAGES = 4; let WuiAllWalletsImage = class WuiAllWalletsImage extends s$b { constructor() { super(...arguments); this.walletImages = []; } render() { const isPlaceholders = this.walletImages.length < TOTAL_IMAGES; return x$6`${this.walletImages.slice(0, TOTAL_IMAGES).map(({ src: src2, walletName }) => x$6` `)} ${isPlaceholders ? [...Array(TOTAL_IMAGES - this.walletImages.length)].map(() => x$6` `) : null} `; } }; WuiAllWalletsImage.styles = [resetStyles, styles$X]; __decorate$1f([ n$i({ type: Array }) ], WuiAllWalletsImage.prototype, "walletImages", void 0); WuiAllWalletsImage = __decorate$1f([ customElement("wui-all-wallets-image") ], WuiAllWalletsImage); const styles$W = i$g` :host { width: var(--local-width); position: relative; } button { border: 1px solid var(--wui-gray-glass-010); border-radius: var(--wui-border-radius-m); width: var(--local-width); } button:disabled { border: 1px solid var(--wui-gray-glass-010); } button[data-size='sm'] { padding: var(--wui-spacing-xxs) var(--wui-spacing-s); } button[data-size='sm'][data-icon-left='true'] { padding: var(--wui-spacing-xxs) var(--wui-spacing-s) var(--wui-spacing-xxs) var(--wui-spacing-xs); } button[data-size='sm'][data-icon-right='true'] { padding: var(--wui-spacing-xxs) var(--wui-spacing-xs) var(--wui-spacing-xxs) var(--wui-spacing-s); } ::slotted(*) { transition: opacity 200ms ease-in-out; opacity: var(--local-opacity-100); } button > wui-text { transition: opacity 200ms ease-in-out; opacity: var(--local-opacity-100); } button[data-size='md'] { padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-l); } button[data-size='md'][data-icon-left='true'] { padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-s); } button[data-size='md'][data-icon-right='true'] { padding: 8.2px var(--wui-spacing-s) 9px var(--wui-spacing-l); } wui-loading-spinner { position: absolute; left: 50%; top: 50%; transition: all 200ms ease-in-out; transform: translate(-50%, -50%); opacity: var(--local-opacity-000); } `; var __decorate$1e = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiButton = class WuiButton extends s$b { constructor() { super(...arguments); this.size = "md"; this.disabled = false; this.fullWidth = false; this.loading = false; this.variant = "fill"; this.hasIconLeft = false; this.hasIconRight = false; } render() { this.style.cssText = ` --local-width: ${this.fullWidth ? "100%" : "auto"}; --local-opacity-100: ${this.loading ? 0 : 1}; --local-opacity-000: ${this.loading ? 1 : 0};`; const textVariant = this.size === "md" ? "paragraph-600" : "small-600"; return x$6` `; } handleSlotLeftChange() { this.hasIconLeft = true; } handleSlotRightChange() { this.hasIconRight = true; } loadingTemplate() { if (this.loading) { return x$6``; } return x$6``; } }; WuiButton.styles = [resetStyles, elementStyles, styles$W]; __decorate$1e([ n$i() ], WuiButton.prototype, "size", void 0); __decorate$1e([ n$i({ type: Boolean }) ], WuiButton.prototype, "disabled", void 0); __decorate$1e([ n$i({ type: Boolean }) ], WuiButton.prototype, "fullWidth", void 0); __decorate$1e([ n$i({ type: Boolean }) ], WuiButton.prototype, "loading", void 0); __decorate$1e([ n$i() ], WuiButton.prototype, "variant", void 0); __decorate$1e([ n$i({ type: Boolean }) ], WuiButton.prototype, "hasIconLeft", void 0); __decorate$1e([ n$i({ type: Boolean }) ], WuiButton.prototype, "hasIconRight", void 0); WuiButton = __decorate$1e([ customElement("wui-button") ], WuiButton); const networkSvg = b$8` `; const styles$V = i$g` :host { display: flex; flex-direction: column; align-items: center; width: 76px; row-gap: var(--wui-spacing-xs); padding: var(--wui-spacing-xs) 10px; background-color: var(--wui-gray-glass-002); border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); position: relative; } wui-shimmer[data-type='network'] { border: none; -webkit-clip-path: var(--wui-path-network); clip-path: var(--wui-path-network); } svg { position: absolute; width: 48px; height: 54px; z-index: 1; } svg > path { stroke: var(--wui-gray-glass-010); stroke-width: 1px; } `; var __decorate$1d = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiCardSelectLoader = class WuiCardSelectLoader extends s$b { constructor() { super(...arguments); this.type = "wallet"; } render() { return x$6` ${this.shimmerTemplate()} `; } shimmerTemplate() { if (this.type === "network") { return x$6` ${networkSvg}`; } return x$6``; } }; WuiCardSelectLoader.styles = [resetStyles, elementStyles, styles$V]; __decorate$1d([ n$i() ], WuiCardSelectLoader.prototype, "type", void 0); WuiCardSelectLoader = __decorate$1d([ customElement("wui-card-select-loader") ], WuiCardSelectLoader); const networkLgSvg = b$8` `; const styles$U = i$g` :host { position: relative; border-radius: inherit; display: flex; justify-content: center; align-items: center; width: var(--local-width); height: var(--local-height); } svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; fill: var(--wui-gray-glass-002); } svg > path { stroke: var(--local-stroke); transition: stroke var(--wui-ease-out-power-1) var(--wui-duration-lg); } wui-image { width: 100%; height: 100%; -webkit-clip-path: var(--local-path); clip-path: var(--local-path); background: var(--wui-gray-glass-002); } wui-icon { transform: translateY(-5%); width: var(--local-icon-size); height: var(--local-icon-size); } `; var __decorate$1c = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiNetworkImage = class WuiNetworkImage extends s$b { constructor() { super(...arguments); this.size = "md"; this.name = "uknown"; this.selected = false; } render() { const isLg = this.size === "lg"; this.style.cssText = ` --local-stroke: ${this.selected ? "var(--wui-color-accent-100)" : "var(--wui-gray-glass-010)"}; --local-path: ${isLg ? "var(--wui-path-network-lg)" : "var(--wui-path-network)"}; --local-width: ${isLg ? "86px" : "48px"}; --local-height: ${isLg ? "96px" : "54px"}; --local-icon-size: ${isLg ? "42px" : "24px"}; `; return x$6`${this.templateVisual()} ${isLg ? networkLgSvg : networkSvg}`; } templateVisual() { if (this.imageSrc) { return x$6``; } return x$6``; } }; WuiNetworkImage.styles = [resetStyles, styles$U]; __decorate$1c([ n$i() ], WuiNetworkImage.prototype, "size", void 0); __decorate$1c([ n$i() ], WuiNetworkImage.prototype, "name", void 0); __decorate$1c([ n$i() ], WuiNetworkImage.prototype, "imageSrc", void 0); __decorate$1c([ n$i({ type: Boolean }) ], WuiNetworkImage.prototype, "selected", void 0); WuiNetworkImage = __decorate$1c([ customElement("wui-network-image") ], WuiNetworkImage); const styles$T = i$g` button { flex-direction: column; width: 76px; row-gap: var(--wui-spacing-xs); padding: var(--wui-spacing-xs) var(--wui-spacing-0); background-color: var(--wui-gray-glass-002); border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); } button > wui-text { color: var(--wui-color-fg-100); max-width: var(--wui-icon-box-size-xl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-content: center; } button:disabled > wui-text { color: var(--wui-gray-glass-015); } [data-selected='true'] { background-color: var(--wui-accent-glass-020); } @media (hover: hover) and (pointer: fine) { [data-selected='true']:hover:enabled { background-color: var(--wui-accent-glass-015); } } [data-selected='true']:active:enabled { background-color: var(--wui-accent-glass-010); } `; var __decorate$1b = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiCardSelect = class WuiCardSelect extends s$b { constructor() { super(...arguments); this.name = "Unknown"; this.type = "wallet"; this.imageSrc = void 0; this.disabled = false; this.selected = false; this.installed = false; } render() { return x$6` `; } imageTemplate() { if (this.type === "network") { return x$6` `; } return x$6` `; } }; WuiCardSelect.styles = [resetStyles, elementStyles, styles$T]; __decorate$1b([ n$i() ], WuiCardSelect.prototype, "name", void 0); __decorate$1b([ n$i() ], WuiCardSelect.prototype, "type", void 0); __decorate$1b([ n$i() ], WuiCardSelect.prototype, "imageSrc", void 0); __decorate$1b([ n$i({ type: Boolean }) ], WuiCardSelect.prototype, "disabled", void 0); __decorate$1b([ n$i({ type: Boolean }) ], WuiCardSelect.prototype, "selected", void 0); __decorate$1b([ n$i({ type: Boolean }) ], WuiCardSelect.prototype, "installed", void 0); WuiCardSelect = __decorate$1b([ customElement("wui-card-select") ], WuiCardSelect); const styles$S = i$g` a { border: 1px solid var(--wui-gray-glass-010); border-radius: var(--wui-border-radius-3xl); } wui-image { border-radius: var(--wui-border-radius-3xl); overflow: hidden; } a.disabled > wui-icon, a.disabled > wui-image { filter: grayscale(1); } a[data-variant='fill'] { color: var(--wui-color-inverse-100); background-color: var(--wui-color-accent-100); } a[data-variant='shade'], a[data-variant='shadeSmall'] { background-color: transparent; background-color: var(--wui-gray-glass-010); color: var(--wui-color-fg-200); } a[data-variant='success'] { column-gap: var(--wui-spacing-xxs); border: 1px solid var(--wui-success-glass-010); background-color: var(--wui-success-glass-010); color: var(--wui-color-success-100); } a[data-variant='transparent'] { column-gap: var(--wui-spacing-xxs); background-color: transparent; color: var(--wui-color-fg-150); } a[data-variant='transparent'], a[data-variant='success'], a[data-variant='shadeSmall'] { padding: 7px var(--wui-spacing-s) 7px 10px; } a[data-variant='transparent']:has(wui-text:first-child), a[data-variant='success']:has(wui-text:first-child), a[data-variant='shadeSmall']:has(wui-text:first-child) { padding: 7px var(--wui-spacing-s); } a[data-variant='fill'], a[data-variant='shade'] { column-gap: var(--wui-spacing-xs); padding: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-xxs) var(--wui-spacing-xs); } a[data-variant='fill']:has(wui-text:first-child), a[data-variant='shade']:has(wui-text:first-child) { padding: 9px var(--wui-spacing-m) 9px var(--wui-spacing-m); } a[data-variant='fill'] > wui-image, a[data-variant='shade'] > wui-image { width: 24px; height: 24px; } a[data-variant='fill'] > wui-image { box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); } a[data-variant='shade'] > wui-image, a[data-variant='shadeSmall'] > wui-image { box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); } a[data-variant='fill'] > wui-icon, a[data-variant='shade'] > wui-icon { width: 14px; height: 14px; } a[data-variant='transparent'] > wui-image, a[data-variant='success'] > wui-image, a[data-variant='shadeSmall'] > wui-image { width: 14px; height: 14px; } a[data-variant='transparent'] > wui-icon, a[data-variant='success'] > wui-icon, a[data-variant='shadeSmall'] > wui-icon { width: 12px; height: 12px; } a[data-variant='fill']:focus-visible { background-color: var(--wui-color-accent-090); } a[data-variant='shade']:focus-visible, a[data-variant='shadeSmall']:focus-visible { background-color: var(--wui-gray-glass-015); } a[data-variant='transparent']:focus-visible { background-color: var(--wui-gray-glass-005); } a[data-variant='success']:focus-visible { background-color: var(--wui-success-glass-015); } a.disabled { color: var(--wui-gray-glass-015); background-color: var(--wui-gray-glass-015); pointer-events: none; } @media (hover: hover) and (pointer: fine) { a[data-variant='fill']:hover { background-color: var(--wui-color-accent-090); } a[data-variant='shade']:hover, a[data-variant='shadeSmall']:hover { background-color: var(--wui-gray-glass-015); } a[data-variant='transparent']:hover { background-color: var(--wui-gray-glass-005); } a[data-variant='success']:hover { background-color: var(--wui-success-glass-015); } } a[data-variant='fill']:active { background-color: var(--wui-color-accent-080); } a[data-variant='shade']:active, a[data-variant='shadeSmall']:active { background-color: var(--wui-gray-glass-020); } a[data-variant='transparent']:active { background-color: var(--wui-gray-glass-010); } a[data-variant='success']:active { background-color: var(--wui-success-glass-020); } `; var __decorate$1a = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiChip = class WuiChip extends s$b { constructor() { super(...arguments); this.variant = "fill"; this.imageSrc = void 0; this.disabled = false; this.icon = "externalLink"; this.href = ""; this.text = void 0; } render() { const isSmall = this.variant === "success" || this.variant === "transparent" || this.variant === "shadeSmall"; const textVariant = isSmall ? "small-600" : "paragraph-600"; return x$6` ${this.imageTemplate()} ${this.title ? this.title : UiHelperUtil.getHostName(this.href)} `; } imageTemplate() { if (this.imageSrc) { return x$6``; } return null; } }; WuiChip.styles = [resetStyles, elementStyles, styles$S]; __decorate$1a([ n$i() ], WuiChip.prototype, "variant", void 0); __decorate$1a([ n$i() ], WuiChip.prototype, "imageSrc", void 0); __decorate$1a([ n$i({ type: Boolean }) ], WuiChip.prototype, "disabled", void 0); __decorate$1a([ n$i() ], WuiChip.prototype, "icon", void 0); __decorate$1a([ n$i() ], WuiChip.prototype, "href", void 0); __decorate$1a([ n$i() ], WuiChip.prototype, "text", void 0); WuiChip = __decorate$1a([ customElement("wui-chip") ], WuiChip); const styles$R = i$g` :host { position: relative; display: block; } button { background: var(--wui-color-accent-100); border: 1px solid var(--wui-gray-glass-010); border-radius: var(--wui-border-radius-m); gap: var(--wui-spacing-xs); } button.loading { background: var(--wui-gray-glass-010); border: 1px solid var(--wui-gray-glass-010); pointer-events: none; } button:disabled { background-color: var(--wui-gray-glass-015); border: 1px solid var(--wui-gray-glass-010); } button:disabled > wui-text { color: var(--wui-gray-glass-015); } @media (hover: hover) and (pointer: fine) { button:hover:enabled { background-color: var(--wui-color-accent-090); } button:active:enabled { background-color: var(--wui-color-accent-080); } } button:focus-visible { border: 1px solid var(--wui-gray-glass-010); background-color: var(--wui-color-accent-090); -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); } button[data-size='sm'] { padding: 6.75px 10px 7.25px; } ::slotted(*) { transition: opacity 200ms ease-in-out; opacity: var(--local-opacity-100); } button > wui-text { transition: opacity 200ms ease-in-out; opacity: var(--local-opacity-100); color: var(--wui-color-inverse-100); } button[data-size='md'] { padding: 9px var(--wui-spacing-l) 9px var(--wui-spacing-l); } button[data-size='md'] + wui-text { padding-left: var(--wui-spacing-3xs); } @media (max-width: 500px) { button[data-size='md'] { height: 32px; padding: 5px 12px; } button[data-size='md'] > wui-text > slot { font-size: 14px !important; } } wui-loading-spinner { width: 14px; height: 14px; } wui-loading-spinner::slotted(svg) { width: 10px !important; height: 10px !important; } button[data-size='sm'] > wui-loading-spinner { width: 12px; height: 12px; } `; var __decorate$19 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiConnectButton = class WuiConnectButton extends s$b { constructor() { super(...arguments); this.size = "md"; this.loading = false; } render() { const textVariant = this.size === "md" ? "paragraph-600" : "small-600"; return x$6` `; } loadingTemplate() { if (!this.loading) { return null; } return x$6``; } }; WuiConnectButton.styles = [resetStyles, elementStyles, styles$R]; __decorate$19([ n$i() ], WuiConnectButton.prototype, "size", void 0); __decorate$19([ n$i({ type: Boolean }) ], WuiConnectButton.prototype, "loading", void 0); WuiConnectButton = __decorate$19([ customElement("wui-connect-button") ], WuiConnectButton); const styles$Q = i$g` wui-flex { width: 100%; background-color: var(--wui-gray-glass-002); border-radius: var(--wui-border-radius-xs); } `; var __decorate$18 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiCtaButton = class WuiCtaButton extends s$b { constructor() { super(...arguments); this.disabled = false; this.label = ""; this.buttonLabel = ""; } render() { return x$6` ${this.label} ${this.buttonLabel} `; } }; WuiCtaButton.styles = [resetStyles, elementStyles, styles$Q]; __decorate$18([ n$i({ type: Boolean }) ], WuiCtaButton.prototype, "disabled", void 0); __decorate$18([ n$i() ], WuiCtaButton.prototype, "label", void 0); __decorate$18([ n$i() ], WuiCtaButton.prototype, "buttonLabel", void 0); WuiCtaButton = __decorate$18([ customElement("wui-cta-button") ], WuiCtaButton); /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const f$c = (o2) => void 0 === o2.strings; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const s$a = (i2, t2) => { var _a2; const e2 = i2._$AN; if (void 0 === e2) return false; for (const i3 of e2) (_a2 = i3._$AO) == null ? void 0 : _a2.call(i3, t2, false), s$a(i3, t2); return true; }, o$h = (i2) => { let t2, e2; do { if (void 0 === (t2 = i2._$AM)) break; e2 = t2._$AN, e2.delete(i2), i2 = t2; } while (0 === (e2 == null ? void 0 : e2.size)); }, r$f = (i2) => { for (let t2; t2 = i2._$AM; i2 = t2) { let e2 = t2._$AN; if (void 0 === e2) t2._$AN = e2 = /* @__PURE__ */ new Set(); else if (e2.has(i2)) break; e2.add(i2), c$d(t2); } }; function h$e(i2) { void 0 !== this._$AN ? (o$h(this), this._$AM = i2, r$f(this)) : this._$AM = i2; } function n$h(i2, t2 = false, e2 = 0) { const r2 = this._$AH, h2 = this._$AN; if (void 0 !== h2 && 0 !== h2.size) if (t2) if (Array.isArray(r2)) for (let i3 = e2; i3 < r2.length; i3++) s$a(r2[i3], false), o$h(r2[i3]); else null != r2 && (s$a(r2, false), o$h(r2)); else s$a(this, i2); } const c$d = (i2) => { i2.type == t$b.CHILD && (i2._$AP ?? (i2._$AP = n$h), i2._$AQ ?? (i2._$AQ = h$e)); }; let f$b = class f extends i$d { constructor() { super(...arguments), this._$AN = void 0; } _$AT(i2, t2, e2) { super._$AT(i2, t2, e2), r$f(this), this.isConnected = i2._$AU; } _$AO(i2, t2 = true) { var _a2, _b2; i2 !== this.isConnected && (this.isConnected = i2, i2 ? (_a2 = this.reconnected) == null ? void 0 : _a2.call(this) : (_b2 = this.disconnected) == null ? void 0 : _b2.call(this)), t2 && (s$a(this, i2), o$h(this)); } setValue(t2) { if (f$c(this._$Ct)) this._$Ct._$AI(t2, this); else { const i2 = [...this._$Ct._$AH]; i2[this._$Ci] = t2, this._$Ct._$AI(i2, this, 0); } } disconnected() { } reconnected() { } }; /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const e$e = () => new h$d(); let h$d = class h { }; const o$g = /* @__PURE__ */ new WeakMap(), n$g = e$g(class extends f$b { render(i2) { return T$9; } update(i2, [s2]) { var _a2; const e2 = s2 !== this.Y; return e2 && void 0 !== this.Y && this.rt(void 0), (e2 || this.lt !== this.ct) && (this.Y = s2, this.ht = (_a2 = i2.options) == null ? void 0 : _a2.host, this.rt(this.ct = i2.element)), T$9; } rt(t2) { if ("function" == typeof this.Y) { const i2 = this.ht ?? globalThis; let s2 = o$g.get(i2); void 0 === s2 && (s2 = /* @__PURE__ */ new WeakMap(), o$g.set(i2, s2)), void 0 !== s2.get(this.Y) && this.Y.call(this.ht, void 0), s2.set(this.Y, t2), void 0 !== t2 && this.Y.call(this.ht, t2); } else this.Y.value = t2; } get lt() { var _a2, _b2; return "function" == typeof this.Y ? (_a2 = o$g.get(this.ht ?? globalThis)) == null ? void 0 : _a2.get(this.Y) : (_b2 = this.Y) == null ? void 0 : _b2.value; } disconnected() { this.lt === this.ct && this.rt(void 0); } reconnected() { this.rt(this.ct); } }); const styles$P = i$g` :host { position: relative; width: 100%; display: inline-block; color: var(--wui-color-fg-275); } input { width: 100%; border-radius: var(--wui-border-radius-xs); border: 1px solid var(--wui-gray-glass-005); background: var(--wui-gray-glass-005); font-size: var(--wui-font-size-paragraph); font-weight: var(--wui-font-weight-light); letter-spacing: var(--wui-letter-spacing-paragraph); color: var(--wui-color-fg-100); transition: all var(--wui-ease-inout-power-1) var(--wui-duration-lg); caret-color: var(--wui-color-accent-100); } input:disabled { cursor: not-allowed; border: 1px solid var(--wui-gray-glass-010); } input:disabled::placeholder, input:disabled + wui-icon { color: var(--wui-color-fg-300); } input::placeholder { color: var(--wui-color-fg-275); } input:focus:enabled { transition: all var(--wui-ease-out-power-2) var(--wui-duration-sm); background-color: var(--wui-gray-glass-010); border: 1px solid var(--wui-color-accent-100); -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); } input:hover:enabled { background-color: var(--wui-gray-glass-010); } wui-icon { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; } .wui-size-sm { padding: 9px var(--wui-spacing-m) 10px var(--wui-spacing-s); } wui-icon + .wui-size-sm { padding: 9px var(--wui-spacing-m) 10px 36px; } wui-icon[data-input='sm'] { left: var(--wui-spacing-s); } .wui-size-md { padding: 15px var(--wui-spacing-m) var(--wui-spacing-l) var(--wui-spacing-m); } wui-icon + .wui-size-md, wui-loading-spinner + .wui-size-md { padding: 10.5px var(--wui-spacing-3xl) 10.5px 40px; } wui-icon[data-input='md'] { left: var(--wui-spacing-l); } input:placeholder-shown ~ ::slotted(wui-input-element), input:placeholder-shown ~ ::slotted(wui-icon) { opacity: 0; pointer-events: none; } ::slotted(wui-input-element), ::slotted(wui-icon) { position: absolute; top: 50%; transform: translateY(-50%); transition: all var(--wui-ease-in-power-2) var(--wui-duration-md); } ::slotted(wui-input-element) { right: var(--wui-spacing-m); } ::slotted(wui-icon) { right: 0px; } `; var __decorate$17 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiInputText = class WuiInputText extends s$b { constructor() { super(...arguments); this.inputElementRef = e$e(); this.size = "md"; this.disabled = false; this.placeholder = ""; this.type = "text"; } render() { const sizeClass = `wui-size-${this.size}`; return x$6` ${this.templateIcon()} `; } templateIcon() { if (this.icon) { return x$6``; } return null; } dispatchInputChangeEvent() { var _a2; this.dispatchEvent(new CustomEvent("inputChange", { detail: (_a2 = this.inputElementRef.value) == null ? void 0 : _a2.value, bubbles: true, composed: true })); } }; WuiInputText.styles = [resetStyles, elementStyles, styles$P]; __decorate$17([ n$i() ], WuiInputText.prototype, "size", void 0); __decorate$17([ n$i() ], WuiInputText.prototype, "icon", void 0); __decorate$17([ n$i({ type: Boolean }) ], WuiInputText.prototype, "disabled", void 0); __decorate$17([ n$i() ], WuiInputText.prototype, "placeholder", void 0); __decorate$17([ n$i() ], WuiInputText.prototype, "type", void 0); __decorate$17([ n$i() ], WuiInputText.prototype, "keyHint", void 0); __decorate$17([ n$i() ], WuiInputText.prototype, "value", void 0); WuiInputText = __decorate$17([ customElement("wui-input-text") ], WuiInputText); const styles$O = i$g` :host { position: relative; display: inline-block; } wui-text { margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); } `; var __decorate$16 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiEmailInput = class WuiEmailInput extends s$b { constructor() { super(...arguments); this.disabled = false; } render() { return x$6` ${this.templateError()} `; } templateError() { if (this.errorMessage) { return x$6`${this.errorMessage}`; } return null; } }; WuiEmailInput.styles = [resetStyles, styles$O]; __decorate$16([ n$i() ], WuiEmailInput.prototype, "errorMessage", void 0); __decorate$16([ n$i({ type: Boolean }) ], WuiEmailInput.prototype, "disabled", void 0); __decorate$16([ n$i() ], WuiEmailInput.prototype, "value", void 0); WuiEmailInput = __decorate$16([ customElement("wui-email-input") ], WuiEmailInput); const styles$N = i$g` button { border-radius: var(--wui-border-radius-xxs); color: var(--wui-color-fg-100); padding: var(--wui-spacing-2xs); } @media (max-width: 700px) { button { padding: var(--wui-spacing-s); } } button > wui-icon { pointer-events: none; } button:disabled > wui-icon { color: var(--wui-color-bg-300) !important; } button:disabled { background-color: transparent; } `; var __decorate$15 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiIconLink = class WuiIconLink extends s$b { constructor() { super(...arguments); this.size = "md"; this.disabled = false; this.icon = "copy"; this.iconColor = "inherit"; } render() { return x$6` `; } }; WuiIconLink.styles = [resetStyles, elementStyles, colorStyles, styles$N]; __decorate$15([ n$i() ], WuiIconLink.prototype, "size", void 0); __decorate$15([ n$i({ type: Boolean }) ], WuiIconLink.prototype, "disabled", void 0); __decorate$15([ n$i() ], WuiIconLink.prototype, "icon", void 0); __decorate$15([ n$i() ], WuiIconLink.prototype, "iconColor", void 0); WuiIconLink = __decorate$15([ customElement("wui-icon-link") ], WuiIconLink); const styles$M = i$g` button { background-color: var(--wui-color-fg-300); border-radius: var(--wui-border-radius-4xs); width: 16px; height: 16px; } button:disabled { background-color: var(--wui-color-bg-300); } wui-icon { color: var(--wui-color-bg-200) !important; } button:focus-visible { background-color: var(--wui-color-fg-250); border: 1px solid var(--wui-color-accent-100); } button:active:enabled { background-color: var(--wui-color-fg-225); } @media (hover: hover) and (pointer: fine) { button:hover:enabled { background-color: var(--wui-color-fg-250); } } `; var __decorate$14 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiInputElement = class WuiInputElement extends s$b { constructor() { super(...arguments); this.icon = "copy"; } render() { return x$6` `; } }; WuiInputElement.styles = [resetStyles, elementStyles, styles$M]; __decorate$14([ n$i() ], WuiInputElement.prototype, "icon", void 0); WuiInputElement = __decorate$14([ customElement("wui-input-element") ], WuiInputElement); const styles$L = i$g` :host { position: relative; display: inline-block; } input { width: 50px; height: 50px; background: var(--wui-gray-glass-010); border-radius: var(--wui-border-radius-xs); border: 1px solid var(--wui-gray-glass-005); font-family: var(--wui-font-family); font-size: var(--wui-font-size-large); font-weight: var(--wui-font-weight-regular); letter-spacing: var(--wui-letter-spacing-large); text-align: center; color: var(--wui-color-fg-100); caret-color: var(--wui-color-accent-100); transition: all var(--wui-ease-inout-power-1) var(--wui-duration-lg); 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(--wui-gray-glass-010); background: var(--wui-gray-glass-005); } input:focus:enabled { transition: all var(--wui-ease-out-power-2) var(--wui-duration-sm); background-color: var(--wui-gray-glass-015); border: 1px solid var(--wui-color-accent-100); -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); } @media (hover: hover) and (pointer: fine) { input:hover:enabled { background-color: var(--wui-gray-glass-015); } } `; var __decorate$13 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiInputNumeric = class WuiInputNumeric extends s$b { constructor() { super(...arguments); this.disabled = false; this.value = ""; } render() { return x$6` `; } }; WuiInputNumeric.styles = [resetStyles, elementStyles, styles$L]; __decorate$13([ n$i({ type: Boolean }) ], WuiInputNumeric.prototype, "disabled", void 0); __decorate$13([ n$i({ type: String }) ], WuiInputNumeric.prototype, "value", void 0); WuiInputNumeric = __decorate$13([ customElement("wui-input-numeric") ], WuiInputNumeric); const styles$K = i$g` button { padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); border-radius: var(--wui-border-radius-3xs); background-color: transparent; color: var(--wui-color-accent-100); } button:disabled { background-color: transparent; color: var(--wui-gray-glass-015); } `; var __decorate$12 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiLink = class WuiLink extends s$b { constructor() { super(...arguments); this.disabled = false; this.color = "inherit"; } render() { return x$6` `; } }; WuiLink.styles = [resetStyles, elementStyles, styles$K]; __decorate$12([ n$i({ type: Boolean }) ], WuiLink.prototype, "disabled", void 0); __decorate$12([ n$i() ], WuiLink.prototype, "color", void 0); WuiLink = __decorate$12([ customElement("wui-link") ], WuiLink); const styles$J = i$g` button { column-gap: var(--wui-spacing-s); padding: 11px 18px 11px var(--wui-spacing-s); width: 100%; background-color: var(--wui-gray-glass-002); border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-250); } button[data-iconvariant='square'], button[data-iconvariant='square-blue'] { padding: 6px 18px 6px 9px; } button > wui-flex { flex: 1; } button > wui-image { width: 32px; height: 32px; box-shadow: 0 0 0 2px var(--wui-gray-glass-005); border-radius: var(--wui-border-radius-3xl); } button > wui-icon { width: 36px; height: 36px; } button > wui-icon-box[data-variant='blue'] { box-shadow: 0 0 0 2px var(--wui-accent-glass-005); } button > wui-icon-box[data-variant='overlay'] { box-shadow: 0 0 0 2px var(--wui-gray-glass-005); } button > wui-icon-box[data-variant='square-blue'] { border-radius: var(--wui-border-radius-3xs); position: relative; border: none; width: 36px; height: 36px; } button > wui-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(--wui-accent-glass-010); pointer-events: none; } button > wui-icon:last-child { width: 14px; height: 14px; } button:disabled { background-color: var(--wui-gray-glass-015); color: var(--wui-gray-glass-015); } button[data-loading='true'] > wui-icon { transition: opacity 200ms ease-in-out; opacity: 0; } wui-loading-spinner { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); } `; var __decorate$11 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiListItem = class WuiListItem extends s$b { constructor() { super(...arguments); this.variant = "icon"; this.disabled = false; this.imageSrc = void 0; this.alt = void 0; this.chevron = false; this.loading = false; } render() { return x$6` `; } visualTemplate() { if (this.variant === "image" && this.imageSrc) { return x$6``; } else if (this.iconVariant === "square" && this.icon && this.variant === "icon") { return x$6``; } else if (this.variant === "icon" && this.icon && this.iconVariant) { const color = ["blue", "square-blue"].includes(this.iconVariant) ? "accent-100" : "fg-200"; const size2 = this.iconVariant === "square-blue" ? "mdl" : "md"; const iconSize = this.iconSize ? this.iconSize : size2; return x$6` `; } return null; } loadingTemplate() { if (this.loading) { return x$6``; } return x$6``; } chevronTemplate() { if (this.chevron) { return x$6``; } return null; } }; WuiListItem.styles = [resetStyles, elementStyles, styles$J]; __decorate$11([ n$i() ], WuiListItem.prototype, "icon", void 0); __decorate$11([ n$i() ], WuiListItem.prototype, "iconSize", void 0); __decorate$11([ n$i() ], WuiListItem.prototype, "variant", void 0); __decorate$11([ n$i() ], WuiListItem.prototype, "iconVariant", void 0); __decorate$11([ n$i({ type: Boolean }) ], WuiListItem.prototype, "disabled", void 0); __decorate$11([ n$i() ], WuiListItem.prototype, "imageSrc", void 0); __decorate$11([ n$i() ], WuiListItem.prototype, "alt", void 0); __decorate$11([ n$i({ type: Boolean }) ], WuiListItem.prototype, "chevron", void 0); __decorate$11([ n$i({ type: Boolean }) ], WuiListItem.prototype, "loading", void 0); WuiListItem = __decorate$11([ customElement("wui-list-item") ], WuiListItem); var TransactionTypePastTense; (function(TransactionTypePastTense2) { TransactionTypePastTense2["approve"] = "approved"; TransactionTypePastTense2["bought"] = "bought"; TransactionTypePastTense2["borrow"] = "borrowed"; TransactionTypePastTense2["burn"] = "burnt"; TransactionTypePastTense2["cancel"] = "canceled"; TransactionTypePastTense2["claim"] = "claimed"; TransactionTypePastTense2["deploy"] = "deployed"; TransactionTypePastTense2["deposit"] = "deposited"; TransactionTypePastTense2["execute"] = "executed"; TransactionTypePastTense2["mint"] = "minted"; TransactionTypePastTense2["receive"] = "received"; TransactionTypePastTense2["repay"] = "repaid"; TransactionTypePastTense2["send"] = "sent"; TransactionTypePastTense2["sell"] = "sold"; TransactionTypePastTense2["stake"] = "staked"; TransactionTypePastTense2["trade"] = "swapped"; TransactionTypePastTense2["unstake"] = "unstaked"; TransactionTypePastTense2["withdraw"] = "withdrawn"; })(TransactionTypePastTense || (TransactionTypePastTense = {})); const styles$I = i$g` :host > wui-flex { display: flex; justify-content: center; align-items: center; position: relative; width: 40px; height: 40px; box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); background-color: var(--wui-gray-glass-005); } :host > wui-flex wui-image { display: block; z-index: -1; } :host > wui-flex, :host > wui-flex wui-image, .swap-images-container, .swap-images-container.nft, wui-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); } wui-icon { width: 20px; height: 20px; } wui-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 wui-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 wui-image:last-child { clip-path: inset(0px 0px 0px calc(50% + 2px)); } `; var __decorate$10 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiTransactionVisual = class WuiTransactionVisual extends s$b { constructor() { super(...arguments); this.images = []; this.secondImage = { type: void 0, url: "" }; } render() { const [firstImage, secondImage] = this.images; const isLeftNFT = (firstImage == null ? void 0 : firstImage.type) === "NFT"; const isRightNFT = (secondImage == null ? void 0 : secondImage.url) ? secondImage.type === "NFT" : isLeftNFT; const leftRadius = isLeftNFT ? "var(--wui-border-radius-xxs)" : "var(--wui-border-radius-s)"; const rightRadius = isRightNFT ? "var(--wui-border-radius-xxs)" : "var(--wui-border-radius-s)"; this.style.cssText = ` --local-left-border-radius: ${leftRadius}; --local-right-border-radius: ${rightRadius}; `; return x$6` ${this.templateVisual()} ${this.templateIcon()} `; } templateVisual() { const [firstImage, secondImage] = this.images; const firstImageType = firstImage == null ? void 0 : firstImage.type; const haveTwoImages = this.images.length === 2; if (haveTwoImages && ((firstImage == null ? void 0 : firstImage.url) || (secondImage == null ? void 0 : secondImage.url))) { return x$6`
${(firstImage == null ? void 0 : firstImage.url) ? x$6`` : null} ${(secondImage == null ? void 0 : secondImage.url) ? x$6`` : null}
`; } else if (firstImage == null ? void 0 : firstImage.url) { return x$6``; } else if (firstImageType === "NFT") { return x$6``; } return x$6``; } templateIcon() { let color = "accent-100"; let icon = void 0; icon = this.getIcon(); if (this.status) { color = this.getStatusColor(); } if (!icon) { return null; } return x$6` `; } getDirectionIcon() { switch (this.direction) { case "in": return "arrowBottom"; case "out": return "arrowTop"; default: return void 0; } } getIcon() { if (this.onlyDirectionIcon) { return this.getDirectionIcon(); } if (this.type === "trade") { return "swapHorizontalBold"; } else if (this.type === "approve") { return "checkmark"; } else if (this.type === "cancel") { return "close"; } return 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"; } } }; WuiTransactionVisual.styles = [styles$I]; __decorate$10([ n$i() ], WuiTransactionVisual.prototype, "type", void 0); __decorate$10([ n$i() ], WuiTransactionVisual.prototype, "status", void 0); __decorate$10([ n$i() ], WuiTransactionVisual.prototype, "direction", void 0); __decorate$10([ n$i({ type: Boolean }) ], WuiTransactionVisual.prototype, "onlyDirectionIcon", void 0); __decorate$10([ n$i({ type: Array }) ], WuiTransactionVisual.prototype, "images", void 0); __decorate$10([ n$i({ type: Object }) ], WuiTransactionVisual.prototype, "secondImage", void 0); WuiTransactionVisual = __decorate$10([ customElement("wui-transaction-visual") ], WuiTransactionVisual); const styles$H = i$g` :host > wui-flex:first-child { align-items: center; column-gap: var(--wui-spacing-s); padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs); width: 100%; } :host > wui-flex:first-child wui-text:nth-child(1) { text-transform: capitalize; } wui-transaction-visual { width: 40px; height: 40px; } wui-flex { flex: 1; } :host wui-flex wui-flex { overflow: hidden; } :host .description-container wui-text span { word-break: break-all; } :host .description-container wui-text { overflow: hidden; } :host .description-separator-icon { margin: 0px 6px; } :host wui-text > span { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; } `; var __decorate$$ = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiTransactionListItem = class WuiTransactionListItem extends s$b { constructor() { super(...arguments); this.type = "approve"; this.onlyDirectionIcon = false; this.images = []; } render() { return x$6` ${TransactionTypePastTense[this.type]} ${this.templateDescription()} ${this.templateSecondDescription()} ${this.date} `; } templateDescription() { var _a2; const description = (_a2 = this.descriptions) == null ? void 0 : _a2[0]; return description ? x$6` ${description} ` : null; } templateSecondDescription() { var _a2; const description = (_a2 = this.descriptions) == null ? void 0 : _a2[1]; return description ? x$6` ${description} ` : null; } }; WuiTransactionListItem.styles = [resetStyles, styles$H]; __decorate$$([ n$i() ], WuiTransactionListItem.prototype, "type", void 0); __decorate$$([ n$i({ type: Array }) ], WuiTransactionListItem.prototype, "descriptions", void 0); __decorate$$([ n$i() ], WuiTransactionListItem.prototype, "date", void 0); __decorate$$([ n$i({ type: Boolean }) ], WuiTransactionListItem.prototype, "onlyDirectionIcon", void 0); __decorate$$([ n$i() ], WuiTransactionListItem.prototype, "status", void 0); __decorate$$([ n$i() ], WuiTransactionListItem.prototype, "direction", void 0); __decorate$$([ n$i({ type: Array }) ], WuiTransactionListItem.prototype, "images", void 0); WuiTransactionListItem = __decorate$$([ customElement("wui-transaction-list-item") ], WuiTransactionListItem); const styles$G = i$g` :host > wui-flex:first-child { column-gap: var(--wui-spacing-s); padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); width: 100%; } wui-flex { display: flex; flex: 1; } `; var __decorate$_ = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiTransactionListItemLoader = class WuiTransactionListItemLoader extends s$b { render() { return x$6` `; } }; WuiTransactionListItemLoader.styles = [resetStyles, styles$G]; WuiTransactionListItemLoader = __decorate$_([ customElement("wui-transaction-list-item-loader") ], WuiTransactionListItemLoader); const styles$F = i$g` :host { display: block; padding: 3.5px 5px !important; border-radius: var(--wui-border-radius-5xs); } :host([data-variant='main']) { background-color: var(--wui-accent-glass-015); color: var(--wui-color-accent-100); } :host([data-variant='shade']) { background-color: var(--wui-gray-glass-010); color: var(--wui-color-fg-200); } :host([data-variant='success']) { background-color: var(--wui-icon-box-bg-success-100); color: var(--wui-color-success-100); } :host([data-variant='error']) { background-color: var(--wui-icon-box-bg-error-100); color: var(--wui-color-error-100); } `; var __decorate$Z = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiTag = class WuiTag extends s$b { constructor() { super(...arguments); this.variant = "main"; } render() { this.dataset["variant"] = this.variant; return x$6` `; } }; WuiTag.styles = [resetStyles, styles$F]; __decorate$Z([ n$i() ], WuiTag.prototype, "variant", void 0); WuiTag = __decorate$Z([ customElement("wui-tag") ], WuiTag); const styles$E = i$g` button { column-gap: var(--wui-spacing-s); padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); width: 100%; background-color: var(--wui-gray-glass-002); border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-100); } button > wui-text:nth-child(2) { display: flex; flex: 1; } wui-icon { color: var(--wui-color-fg-200) !important; } button:disabled { background-color: var(--wui-gray-glass-015); color: var(--wui-gray-glass-015); } button:disabled > wui-tag { background-color: var(--wui-gray-glass-010); color: var(--wui-color-fg-300); } `; var __decorate$Y = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiListWallet = class WuiListWallet extends s$b { constructor() { super(...arguments); this.walletImages = []; this.imageSrc = ""; this.name = ""; this.installed = false; this.disabled = false; this.showAllWallets = false; } render() { return x$6` `; } templateAllWallets() { if (this.showAllWallets && this.imageSrc) { return x$6` `; } else if (this.showAllWallets && this.walletIcon) { return x$6` `; } return null; } templateWalletImage() { if (!this.showAllWallets && this.imageSrc) { return x$6``; } else if (!this.showAllWallets && !this.imageSrc) { return x$6``; } return null; } templateStatus() { if (this.tagLabel && this.tagVariant) { return x$6`${this.tagLabel}`; } else if (this.icon) { return x$6``; } return null; } }; WuiListWallet.styles = [resetStyles, elementStyles, styles$E]; __decorate$Y([ n$i({ type: Array }) ], WuiListWallet.prototype, "walletImages", void 0); __decorate$Y([ n$i() ], WuiListWallet.prototype, "imageSrc", void 0); __decorate$Y([ n$i() ], WuiListWallet.prototype, "name", void 0); __decorate$Y([ n$i() ], WuiListWallet.prototype, "tagLabel", void 0); __decorate$Y([ n$i() ], WuiListWallet.prototype, "tagVariant", void 0); __decorate$Y([ n$i() ], WuiListWallet.prototype, "icon", void 0); __decorate$Y([ n$i() ], WuiListWallet.prototype, "walletIcon", void 0); __decorate$Y([ n$i({ type: Boolean }) ], WuiListWallet.prototype, "installed", void 0); __decorate$Y([ n$i({ type: Boolean }) ], WuiListWallet.prototype, "disabled", void 0); __decorate$Y([ n$i({ type: Boolean }) ], WuiListWallet.prototype, "showAllWallets", void 0); WuiListWallet = __decorate$Y([ customElement("wui-list-wallet") ], WuiListWallet); const styles$D = i$g` :host { display: block; width: 40px; height: 40px; border-radius: var(--wui-border-radius-3xl); border: 1px solid var(--wui-gray-glass-010); overflow: hidden; } wui-icon { width: 100%; height: 100%; } `; var __decorate$X = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiLogo = class WuiLogo extends s$b { constructor() { super(...arguments); this.logo = "google"; } render() { return x$6` `; } }; WuiLogo.styles = [resetStyles, styles$D]; __decorate$X([ n$i() ], WuiLogo.prototype, "logo", void 0); WuiLogo = __decorate$X([ customElement("wui-logo") ], WuiLogo); const styles$C = i$g` :host { display: block; } button { width: 50px; height: 50px; background: var(--wui-gray-glass-002); border-radius: var(--wui-border-radius-xs); } `; var __decorate$W = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiLogoSelect = class WuiLogoSelect extends s$b { constructor() { super(...arguments); this.logo = "google"; this.disabled = false; } render() { return x$6` `; } }; WuiLogoSelect.styles = [resetStyles, elementStyles, styles$C]; __decorate$W([ n$i() ], WuiLogoSelect.prototype, "logo", void 0); __decorate$W([ n$i({ type: Boolean }) ], WuiLogoSelect.prototype, "disabled", void 0); WuiLogoSelect = __decorate$W([ customElement("wui-logo-select") ], WuiLogoSelect); const styles$B = i$g` :host { display: block; } button { border-radius: var(--wui-border-radius-3xl); display: flex; gap: var(--wui-spacing-xs); padding: var(--wui-spacing-2xs) var(--wui-spacing-s) var(--wui-spacing-2xs) var(--wui-spacing-xs); border: 1px solid var(--wui-gray-glass-010); background-color: var(--wui-gray-glass-005); color: var(--wui-color-fg-100); } button:disabled { border: 1px solid var(--wui-gray-glass-005); background-color: var(--wui-gray-glass-015); color: var(--wui-gray-glass-015); } @media (hover: hover) and (pointer: fine) { button:hover:enabled { background-color: var(--wui-gray-glass-010); } button:active:enabled { background-color: var(--wui-gray-glass-015); } } wui-image, wui-icon-box { border-radius: var(--wui-border-radius-3xl); width: 24px; height: 24px; box-shadow: 0 0 0 2px var(--wui-gray-glass-005); } `; var __decorate$V = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiNetworkButton = class WuiNetworkButton extends s$b { constructor() { super(...arguments); this.imageSrc = void 0; this.disabled = false; } render() { return x$6` `; } visualTemplate() { if (this.imageSrc) { return x$6``; } return x$6` `; } }; WuiNetworkButton.styles = [resetStyles, elementStyles, styles$B]; __decorate$V([ n$i() ], WuiNetworkButton.prototype, "imageSrc", void 0); __decorate$V([ n$i({ type: Boolean }) ], WuiNetworkButton.prototype, "disabled", void 0); WuiNetworkButton = __decorate$V([ customElement("wui-network-button") ], WuiNetworkButton); const styles$A = i$g` :host { position: relative; display: block; } `; var __decorate$U = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiOtp = class WuiOtp extends s$b { constructor() { super(...arguments); this.length = 6; this.otp = ""; this.values = Array.from({ length: this.length }).map(() => ""); this.numerics = []; this.shouldInputBeEnabled = (index2) => { const previousInputs = this.values.slice(0, index2); return previousInputs.every((input) => input !== ""); }; this.handleKeyDown = (e2, index2) => { const inputElement = e2.target; const input = this.getInputElement(inputElement); const keyArr = ["ArrowLeft", "ArrowRight", "Shift", "Delete"]; if (!input) { return; } if (keyArr.includes(e2.key)) { e2.preventDefault(); } const currentCaretPos = input.selectionStart; switch (e2.key) { case "ArrowLeft": if (currentCaretPos) { input.setSelectionRange(currentCaretPos + 1, currentCaretPos + 1); } this.focusInputField("prev", index2); break; case "ArrowRight": this.focusInputField("next", index2); break; case "Shift": this.focusInputField("next", index2); break; case "Delete": if (input.value === "") { this.focusInputField("prev", index2); } else { this.updateInput(input, index2, ""); } break; case "Backspace": if (input.value === "") { this.focusInputField("prev", index2); } else { this.updateInput(input, index2, ""); } break; } }; this.focusInputField = (dir, index2) => { if (dir === "next") { const nextIndex = index2 + 1; if (!this.shouldInputBeEnabled(nextIndex)) { return; } const numeric2 = this.numerics[nextIndex < this.length ? nextIndex : index2]; const input = numeric2 ? this.getInputElement(numeric2) : void 0; if (input) { input.disabled = false; input.focus(); } } if (dir === "prev") { const nextIndex = index2 - 1; const numeric2 = this.numerics[nextIndex > -1 ? nextIndex : index2]; const input = numeric2 ? this.getInputElement(numeric2) : void 0; if (input) { input.focus(); } } }; } firstUpdated() { var _a2, _b2; if (this.otp) { this.values = this.otp.split(""); } const numericElements = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelectorAll("wui-input-numeric"); if (numericElements) { this.numerics = Array.from(numericElements); } (_b2 = this.numerics[0]) == null ? void 0 : _b2.focus(); } render() { return x$6` ${Array.from({ length: this.length }).map((_2, index2) => x$6` this.handleInput(e2, index2)} @keydown=${(e2) => this.handleKeyDown(e2, index2)} .disabled=${!this.shouldInputBeEnabled(index2)} .value=${this.values[index2] || ""} > `)} `; } updateInput(element, index2, value) { const numeric2 = this.numerics[index2]; const input = element || (numeric2 ? this.getInputElement(numeric2) : void 0); if (input) { input.value = value; this.values = this.values.map((val, i2) => i2 === index2 ? value : val); } } handleInput(e2, index2) { const inputElement = e2.target; const input = this.getInputElement(inputElement); if (input) { const inputValue = input.value; if (e2.inputType === "insertFromPaste") { this.handlePaste(input, inputValue, index2); } else { const isValid2 = UiHelperUtil.isNumber(inputValue); if (isValid2 && e2.data) { this.updateInput(input, index2, e2.data); this.focusInputField("next", index2); } else { this.updateInput(input, index2, ""); } } } this.dispatchInputChangeEvent(); } handlePaste(input, inputValue, index2) { const value = inputValue[0]; const isValid2 = value && UiHelperUtil.isNumber(value); if (isValid2) { this.updateInput(input, index2, value); const inputString = inputValue.substring(1); if (index2 + 1 < this.length && inputString.length) { const nextNumeric = this.numerics[index2 + 1]; const nextInput = nextNumeric ? this.getInputElement(nextNumeric) : void 0; if (nextInput) { this.handlePaste(nextInput, inputString, index2 + 1); } } else { this.focusInputField("next", index2); } } else { this.updateInput(input, index2, ""); } } getInputElement(el) { var _a2; if ((_a2 = el.shadowRoot) == null ? void 0 : _a2.querySelector("input")) { return el.shadowRoot.querySelector("input"); } return null; } dispatchInputChangeEvent() { const value = this.values.join(""); this.dispatchEvent(new CustomEvent("inputChange", { detail: value, bubbles: true, composed: true })); } }; WuiOtp.styles = [resetStyles, styles$A]; __decorate$U([ n$i({ type: Number }) ], WuiOtp.prototype, "length", void 0); __decorate$U([ n$i({ type: String }) ], WuiOtp.prototype, "otp", void 0); __decorate$U([ r$g() ], WuiOtp.prototype, "values", void 0); WuiOtp = __decorate$U([ customElement("wui-otp") ], WuiOtp); var browser$5 = {}; var canPromise$1 = function() { return typeof Promise === "function" && Promise.prototype && Promise.prototype.then; }; var qrcode = {}; var utils$4 = {}; let toSJISFunction; const CODEWORDS_COUNT = [ 0, // Not used 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 ]; utils$4.getSymbolSize = function getSymbolSize2(version2) { if (!version2) throw new Error('"version" cannot be null or undefined'); if (version2 < 1 || version2 > 40) throw new Error('"version" should be in range from 1 to 40'); return version2 * 4 + 17; }; utils$4.getSymbolTotalCodewords = function getSymbolTotalCodewords(version2) { return CODEWORDS_COUNT[version2]; }; utils$4.getBCHDigit = function(data2) { let digit = 0; while (data2 !== 0) { digit++; data2 >>>= 1; } return digit; }; utils$4.setToSJISFunction = function setToSJISFunction(f2) { if (typeof f2 !== "function") { throw new Error('"toSJISFunc" is not a valid function.'); } toSJISFunction = f2; }; utils$4.isKanjiModeEnabled = function() { return typeof toSJISFunction !== "undefined"; }; utils$4.toSJIS = function toSJIS(kanji2) { return toSJISFunction(kanji2); }; var errorCorrectionLevel = {}; (function(exports3) { exports3.L = { bit: 1 }; exports3.M = { bit: 0 }; exports3.Q = { bit: 3 }; exports3.H = { bit: 2 }; function fromString2(string2) { if (typeof string2 !== "string") { throw new Error("Param is not a string"); } const lcStr = string2.toLowerCase(); switch (lcStr) { case "l": case "low": return exports3.L; case "m": case "medium": return exports3.M; case "q": case "quartile": return exports3.Q; case "h": case "high": return exports3.H; default: throw new Error("Unknown EC Level: " + string2); } } exports3.isValid = function isValid2(level) { return level && typeof level.bit !== "undefined" && level.bit >= 0 && level.bit < 4; }; exports3.from = function from2(value, defaultValue) { if (exports3.isValid(value)) { return value; } try { return fromString2(value); } catch (e2) { return defaultValue; } }; })(errorCorrectionLevel); function BitBuffer$1() { this.buffer = []; this.length = 0; } BitBuffer$1.prototype = { get: function(index2) { const bufIndex = Math.floor(index2 / 8); return (this.buffer[bufIndex] >>> 7 - index2 % 8 & 1) === 1; }, put: function(num, length) { for (let i2 = 0; i2 < length; i2++) { this.putBit((num >>> length - i2 - 1 & 1) === 1); } }, getLengthInBits: function() { return this.length; }, putBit: function(bit) { const bufIndex = Math.floor(this.length / 8); if (this.buffer.length <= bufIndex) { this.buffer.push(0); } if (bit) { this.buffer[bufIndex] |= 128 >>> this.length % 8; } this.length++; } }; var bitBuffer = BitBuffer$1; function BitMatrix$1(size2) { if (!size2 || size2 < 1) { throw new Error("BitMatrix size must be defined and greater than 0"); } this.size = size2; this.data = new Uint8Array(size2 * size2); this.reservedBit = new Uint8Array(size2 * size2); } BitMatrix$1.prototype.set = function(row, col, value, reserved) { const index2 = row * this.size + col; this.data[index2] = value; if (reserved) this.reservedBit[index2] = true; }; BitMatrix$1.prototype.get = function(row, col) { return this.data[row * this.size + col]; }; BitMatrix$1.prototype.xor = function(row, col, value) { this.data[row * this.size + col] ^= value; }; BitMatrix$1.prototype.isReserved = function(row, col) { return this.reservedBit[row * this.size + col]; }; var bitMatrix = BitMatrix$1; var alignmentPattern = {}; (function(exports3) { const getSymbolSize2 = utils$4.getSymbolSize; exports3.getRowColCoords = function getRowColCoords(version2) { if (version2 === 1) return []; const posCount = Math.floor(version2 / 7) + 2; const size2 = getSymbolSize2(version2); const intervals = size2 === 145 ? 26 : Math.ceil((size2 - 13) / (2 * posCount - 2)) * 2; const positions = [size2 - 7]; for (let i2 = 1; i2 < posCount - 1; i2++) { positions[i2] = positions[i2 - 1] - intervals; } positions.push(6); return positions.reverse(); }; exports3.getPositions = function getPositions(version2) { const coords = []; const pos = exports3.getRowColCoords(version2); const posLength = pos.length; for (let i2 = 0; i2 < posLength; i2++) { for (let j2 = 0; j2 < posLength; j2++) { if (i2 === 0 && j2 === 0 || // top-left i2 === 0 && j2 === posLength - 1 || // bottom-left i2 === posLength - 1 && j2 === 0) { continue; } coords.push([pos[i2], pos[j2]]); } } return coords; }; })(alignmentPattern); var finderPattern = {}; const getSymbolSize = utils$4.getSymbolSize; const FINDER_PATTERN_SIZE = 7; finderPattern.getPositions = function getPositions(version2) { const size2 = getSymbolSize(version2); return [ // top-left [0, 0], // top-right [size2 - FINDER_PATTERN_SIZE, 0], // bottom-left [0, size2 - FINDER_PATTERN_SIZE] ]; }; var maskPattern = {}; (function(exports3) { exports3.Patterns = { PATTERN000: 0, PATTERN001: 1, PATTERN010: 2, PATTERN011: 3, PATTERN100: 4, PATTERN101: 5, PATTERN110: 6, PATTERN111: 7 }; const PenaltyScores = { N1: 3, N2: 3, N3: 40, N4: 10 }; exports3.isValid = function isValid2(mask2) { return mask2 != null && mask2 !== "" && !isNaN(mask2) && mask2 >= 0 && mask2 <= 7; }; exports3.from = function from2(value) { return exports3.isValid(value) ? parseInt(value, 10) : void 0; }; exports3.getPenaltyN1 = function getPenaltyN1(data2) { const size2 = data2.size; let points = 0; let sameCountCol = 0; let sameCountRow = 0; let lastCol = null; let lastRow = null; for (let row = 0; row < size2; row++) { sameCountCol = sameCountRow = 0; lastCol = lastRow = null; for (let col = 0; col < size2; col++) { let module2 = data2.get(row, col); if (module2 === lastCol) { sameCountCol++; } else { if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5); lastCol = module2; sameCountCol = 1; } module2 = data2.get(col, row); if (module2 === lastRow) { sameCountRow++; } else { if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5); lastRow = module2; sameCountRow = 1; } } if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5); if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5); } return points; }; exports3.getPenaltyN2 = function getPenaltyN2(data2) { const size2 = data2.size; let points = 0; for (let row = 0; row < size2 - 1; row++) { for (let col = 0; col < size2 - 1; col++) { const last = data2.get(row, col) + data2.get(row, col + 1) + data2.get(row + 1, col) + data2.get(row + 1, col + 1); if (last === 4 || last === 0) points++; } } return points * PenaltyScores.N2; }; exports3.getPenaltyN3 = function getPenaltyN3(data2) { const size2 = data2.size; let points = 0; let bitsCol = 0; let bitsRow = 0; for (let row = 0; row < size2; row++) { bitsCol = bitsRow = 0; for (let col = 0; col < size2; col++) { bitsCol = bitsCol << 1 & 2047 | data2.get(row, col); if (col >= 10 && (bitsCol === 1488 || bitsCol === 93)) points++; bitsRow = bitsRow << 1 & 2047 | data2.get(col, row); if (col >= 10 && (bitsRow === 1488 || bitsRow === 93)) points++; } } return points * PenaltyScores.N3; }; exports3.getPenaltyN4 = function getPenaltyN4(data2) { let darkCount = 0; const modulesCount = data2.data.length; for (let i2 = 0; i2 < modulesCount; i2++) darkCount += data2.data[i2]; const k2 = Math.abs(Math.ceil(darkCount * 100 / modulesCount / 5) - 10); return k2 * PenaltyScores.N4; }; function getMaskAt(maskPattern2, i2, j2) { switch (maskPattern2) { case exports3.Patterns.PATTERN000: return (i2 + j2) % 2 === 0; case exports3.Patterns.PATTERN001: return i2 % 2 === 0; case exports3.Patterns.PATTERN010: return j2 % 3 === 0; case exports3.Patterns.PATTERN011: return (i2 + j2) % 3 === 0; case exports3.Patterns.PATTERN100: return (Math.floor(i2 / 2) + Math.floor(j2 / 3)) % 2 === 0; case exports3.Patterns.PATTERN101: return i2 * j2 % 2 + i2 * j2 % 3 === 0; case exports3.Patterns.PATTERN110: return (i2 * j2 % 2 + i2 * j2 % 3) % 2 === 0; case exports3.Patterns.PATTERN111: return (i2 * j2 % 3 + (i2 + j2) % 2) % 2 === 0; default: throw new Error("bad maskPattern:" + maskPattern2); } } exports3.applyMask = function applyMask(pattern2, data2) { const size2 = data2.size; for (let col = 0; col < size2; col++) { for (let row = 0; row < size2; row++) { if (data2.isReserved(row, col)) continue; data2.xor(row, col, getMaskAt(pattern2, row, col)); } } }; exports3.getBestMask = function getBestMask(data2, setupFormatFunc) { const numPatterns = Object.keys(exports3.Patterns).length; let bestPattern = 0; let lowerPenalty = Infinity; for (let p2 = 0; p2 < numPatterns; p2++) { setupFormatFunc(p2); exports3.applyMask(p2, data2); const penalty = exports3.getPenaltyN1(data2) + exports3.getPenaltyN2(data2) + exports3.getPenaltyN3(data2) + exports3.getPenaltyN4(data2); exports3.applyMask(p2, data2); if (penalty < lowerPenalty) { lowerPenalty = penalty; bestPattern = p2; } } return bestPattern; }; })(maskPattern); var errorCorrectionCode = {}; const ECLevel$1 = errorCorrectionLevel; const EC_BLOCKS_TABLE = [ // L M Q H 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 ]; const EC_CODEWORDS_TABLE = [ // L M Q H 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 ]; errorCorrectionCode.getBlocksCount = function getBlocksCount(version2, errorCorrectionLevel2) { switch (errorCorrectionLevel2) { case ECLevel$1.L: return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 0]; case ECLevel$1.M: return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 1]; case ECLevel$1.Q: return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 2]; case ECLevel$1.H: return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 3]; default: return void 0; } }; errorCorrectionCode.getTotalCodewordsCount = function getTotalCodewordsCount(version2, errorCorrectionLevel2) { switch (errorCorrectionLevel2) { case ECLevel$1.L: return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 0]; case ECLevel$1.M: return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 1]; case ECLevel$1.Q: return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 2]; case ECLevel$1.H: return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 3]; default: return void 0; } }; var polynomial = {}; var galoisField = {}; const EXP_TABLE = new Uint8Array(512); const LOG_TABLE = new Uint8Array(256); (function initTables() { let x2 = 1; for (let i2 = 0; i2 < 255; i2++) { EXP_TABLE[i2] = x2; LOG_TABLE[x2] = i2; x2 <<= 1; if (x2 & 256) { x2 ^= 285; } } for (let i2 = 255; i2 < 512; i2++) { EXP_TABLE[i2] = EXP_TABLE[i2 - 255]; } })(); galoisField.log = function log2(n2) { if (n2 < 1) throw new Error("log(" + n2 + ")"); return LOG_TABLE[n2]; }; galoisField.exp = function exp(n2) { return EXP_TABLE[n2]; }; galoisField.mul = function mul(x2, y2) { if (x2 === 0 || y2 === 0) return 0; return EXP_TABLE[LOG_TABLE[x2] + LOG_TABLE[y2]]; }; (function(exports3) { const GF = galoisField; exports3.mul = function mul(p1, p2) { const coeff = new Uint8Array(p1.length + p2.length - 1); for (let i2 = 0; i2 < p1.length; i2++) { for (let j2 = 0; j2 < p2.length; j2++) { coeff[i2 + j2] ^= GF.mul(p1[i2], p2[j2]); } } return coeff; }; exports3.mod = function mod(divident, divisor) { let result = new Uint8Array(divident); while (result.length - divisor.length >= 0) { const coeff = result[0]; for (let i2 = 0; i2 < divisor.length; i2++) { result[i2] ^= GF.mul(divisor[i2], coeff); } let offset = 0; while (offset < result.length && result[offset] === 0) offset++; result = result.slice(offset); } return result; }; exports3.generateECPolynomial = function generateECPolynomial(degree) { let poly = new Uint8Array([1]); for (let i2 = 0; i2 < degree; i2++) { poly = exports3.mul(poly, new Uint8Array([1, GF.exp(i2)])); } return poly; }; })(polynomial); const Polynomial = polynomial; function ReedSolomonEncoder$1(degree) { this.genPoly = void 0; this.degree = degree; if (this.degree) this.initialize(this.degree); } ReedSolomonEncoder$1.prototype.initialize = function initialize(degree) { this.degree = degree; this.genPoly = Polynomial.generateECPolynomial(this.degree); }; ReedSolomonEncoder$1.prototype.encode = function encode2(data2) { if (!this.genPoly) { throw new Error("Encoder not initialized"); } const paddedData = new Uint8Array(data2.length + this.degree); paddedData.set(data2); const remainder = Polynomial.mod(paddedData, this.genPoly); const start = this.degree - remainder.length; if (start > 0) { const buff = new Uint8Array(this.degree); buff.set(remainder, start); return buff; } return remainder; }; var reedSolomonEncoder = ReedSolomonEncoder$1; var version$1 = {}; var mode = {}; var versionCheck = {}; versionCheck.isValid = function isValid2(version2) { return !isNaN(version2) && version2 >= 1 && version2 <= 40; }; var regex = {}; const numeric$1 = "[0-9]+"; const alphanumeric = "[A-Z $%*+\\-./:]+"; let kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+"; kanji = kanji.replace(/u/g, "\\u"); const byte = "(?:(?![A-Z0-9 $%*+\\-./:]|" + kanji + ")(?:.|[\r\n]))+"; regex.KANJI = new RegExp(kanji, "g"); regex.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"); regex.BYTE = new RegExp(byte, "g"); regex.NUMERIC = new RegExp(numeric$1, "g"); regex.ALPHANUMERIC = new RegExp(alphanumeric, "g"); const TEST_KANJI = new RegExp("^" + kanji + "$"); const TEST_NUMERIC = new RegExp("^" + numeric$1 + "$"); const TEST_ALPHANUMERIC = new RegExp("^[A-Z0-9 $%*+\\-./:]+$"); regex.testKanji = function testKanji(str) { return TEST_KANJI.test(str); }; regex.testNumeric = function testNumeric(str) { return TEST_NUMERIC.test(str); }; regex.testAlphanumeric = function testAlphanumeric(str) { return TEST_ALPHANUMERIC.test(str); }; (function(exports3) { const VersionCheck = versionCheck; const Regex = regex; exports3.NUMERIC = { id: "Numeric", bit: 1 << 0, ccBits: [10, 12, 14] }; exports3.ALPHANUMERIC = { id: "Alphanumeric", bit: 1 << 1, ccBits: [9, 11, 13] }; exports3.BYTE = { id: "Byte", bit: 1 << 2, ccBits: [8, 16, 16] }; exports3.KANJI = { id: "Kanji", bit: 1 << 3, ccBits: [8, 10, 12] }; exports3.MIXED = { bit: -1 }; exports3.getCharCountIndicator = function getCharCountIndicator(mode2, version2) { if (!mode2.ccBits) throw new Error("Invalid mode: " + mode2); if (!VersionCheck.isValid(version2)) { throw new Error("Invalid version: " + version2); } if (version2 >= 1 && version2 < 10) return mode2.ccBits[0]; else if (version2 < 27) return mode2.ccBits[1]; return mode2.ccBits[2]; }; exports3.getBestModeForData = function getBestModeForData(dataStr) { if (Regex.testNumeric(dataStr)) return exports3.NUMERIC; else if (Regex.testAlphanumeric(dataStr)) return exports3.ALPHANUMERIC; else if (Regex.testKanji(dataStr)) return exports3.KANJI; else return exports3.BYTE; }; exports3.toString = function toString2(mode2) { if (mode2 && mode2.id) return mode2.id; throw new Error("Invalid mode"); }; exports3.isValid = function isValid2(mode2) { return mode2 && mode2.bit && mode2.ccBits; }; function fromString2(string2) { if (typeof string2 !== "string") { throw new Error("Param is not a string"); } const lcStr = string2.toLowerCase(); switch (lcStr) { case "numeric": return exports3.NUMERIC; case "alphanumeric": return exports3.ALPHANUMERIC; case "kanji": return exports3.KANJI; case "byte": return exports3.BYTE; default: throw new Error("Unknown mode: " + string2); } } exports3.from = function from2(value, defaultValue) { if (exports3.isValid(value)) { return value; } try { return fromString2(value); } catch (e2) { return defaultValue; } }; })(mode); (function(exports3) { const Utils2 = utils$4; const ECCode2 = errorCorrectionCode; const ECLevel2 = errorCorrectionLevel; const Mode2 = mode; const VersionCheck = versionCheck; const G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0; const G18_BCH = Utils2.getBCHDigit(G18); function getBestVersionForDataLength(mode2, length, errorCorrectionLevel2) { for (let currentVersion = 1; currentVersion <= 40; currentVersion++) { if (length <= exports3.getCapacity(currentVersion, errorCorrectionLevel2, mode2)) { return currentVersion; } } return void 0; } function getReservedBitsCount(mode2, version2) { return Mode2.getCharCountIndicator(mode2, version2) + 4; } function getTotalBitsFromDataArray(segments2, version2) { let totalBits = 0; segments2.forEach(function(data2) { const reservedBits = getReservedBitsCount(data2.mode, version2); totalBits += reservedBits + data2.getBitsLength(); }); return totalBits; } function getBestVersionForMixedData(segments2, errorCorrectionLevel2) { for (let currentVersion = 1; currentVersion <= 40; currentVersion++) { const length = getTotalBitsFromDataArray(segments2, currentVersion); if (length <= exports3.getCapacity(currentVersion, errorCorrectionLevel2, Mode2.MIXED)) { return currentVersion; } } return void 0; } exports3.from = function from2(value, defaultValue) { if (VersionCheck.isValid(value)) { return parseInt(value, 10); } return defaultValue; }; exports3.getCapacity = function getCapacity(version2, errorCorrectionLevel2, mode2) { if (!VersionCheck.isValid(version2)) { throw new Error("Invalid QR Code version"); } if (typeof mode2 === "undefined") mode2 = Mode2.BYTE; const totalCodewords = Utils2.getSymbolTotalCodewords(version2); const ecTotalCodewords = ECCode2.getTotalCodewordsCount(version2, errorCorrectionLevel2); const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8; if (mode2 === Mode2.MIXED) return dataTotalCodewordsBits; const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode2, version2); switch (mode2) { case Mode2.NUMERIC: return Math.floor(usableBits / 10 * 3); case Mode2.ALPHANUMERIC: return Math.floor(usableBits / 11 * 2); case Mode2.KANJI: return Math.floor(usableBits / 13); case Mode2.BYTE: default: return Math.floor(usableBits / 8); } }; exports3.getBestVersionForData = function getBestVersionForData(data2, errorCorrectionLevel2) { let seg; const ecl = ECLevel2.from(errorCorrectionLevel2, ECLevel2.M); if (Array.isArray(data2)) { if (data2.length > 1) { return getBestVersionForMixedData(data2, ecl); } if (data2.length === 0) { return 1; } seg = data2[0]; } else { seg = data2; } return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl); }; exports3.getEncodedBits = function getEncodedBits(version2) { if (!VersionCheck.isValid(version2) || version2 < 7) { throw new Error("Invalid QR Code version"); } let d2 = version2 << 12; while (Utils2.getBCHDigit(d2) - G18_BCH >= 0) { d2 ^= G18 << Utils2.getBCHDigit(d2) - G18_BCH; } return version2 << 12 | d2; }; })(version$1); var formatInfo = {}; const Utils$3 = utils$4; const G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0; const G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1; const G15_BCH = Utils$3.getBCHDigit(G15); formatInfo.getEncodedBits = function getEncodedBits(errorCorrectionLevel2, mask2) { const data2 = errorCorrectionLevel2.bit << 3 | mask2; let d2 = data2 << 10; while (Utils$3.getBCHDigit(d2) - G15_BCH >= 0) { d2 ^= G15 << Utils$3.getBCHDigit(d2) - G15_BCH; } return (data2 << 10 | d2) ^ G15_MASK; }; var segments = {}; const Mode$4 = mode; function NumericData(data2) { this.mode = Mode$4.NUMERIC; this.data = data2.toString(); } NumericData.getBitsLength = function getBitsLength(length) { return 10 * Math.floor(length / 3) + (length % 3 ? length % 3 * 3 + 1 : 0); }; NumericData.prototype.getLength = function getLength() { return this.data.length; }; NumericData.prototype.getBitsLength = function getBitsLength() { return NumericData.getBitsLength(this.data.length); }; NumericData.prototype.write = function write(bitBuffer2) { let i2, group, value; for (i2 = 0; i2 + 3 <= this.data.length; i2 += 3) { group = this.data.substr(i2, 3); value = parseInt(group, 10); bitBuffer2.put(value, 10); } const remainingNum = this.data.length - i2; if (remainingNum > 0) { group = this.data.substr(i2); value = parseInt(group, 10); bitBuffer2.put(value, remainingNum * 3 + 1); } }; var numericData = NumericData; const Mode$3 = mode; const ALPHA_NUM_CHARS = [ "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 AlphanumericData(data2) { this.mode = Mode$3.ALPHANUMERIC; this.data = data2; } AlphanumericData.getBitsLength = function getBitsLength(length) { return 11 * Math.floor(length / 2) + 6 * (length % 2); }; AlphanumericData.prototype.getLength = function getLength() { return this.data.length; }; AlphanumericData.prototype.getBitsLength = function getBitsLength() { return AlphanumericData.getBitsLength(this.data.length); }; AlphanumericData.prototype.write = function write(bitBuffer2) { let i2; for (i2 = 0; i2 + 2 <= this.data.length; i2 += 2) { let value = ALPHA_NUM_CHARS.indexOf(this.data[i2]) * 45; value += ALPHA_NUM_CHARS.indexOf(this.data[i2 + 1]); bitBuffer2.put(value, 11); } if (this.data.length % 2) { bitBuffer2.put(ALPHA_NUM_CHARS.indexOf(this.data[i2]), 6); } }; var alphanumericData = AlphanumericData; var encodeUtf8$1 = function encodeUtf82(input) { var result = []; var size2 = input.length; for (var index2 = 0; index2 < size2; index2++) { var point = input.charCodeAt(index2); if (point >= 55296 && point <= 56319 && size2 > index2 + 1) { var second = input.charCodeAt(index2 + 1); if (second >= 56320 && second <= 57343) { point = (point - 55296) * 1024 + second - 56320 + 65536; index2 += 1; } } if (point < 128) { result.push(point); continue; } if (point < 2048) { result.push(point >> 6 | 192); result.push(point & 63 | 128); continue; } if (point < 55296 || point >= 57344 && point < 65536) { result.push(point >> 12 | 224); result.push(point >> 6 & 63 | 128); result.push(point & 63 | 128); continue; } if (point >= 65536 && point <= 1114111) { result.push(point >> 18 | 240); result.push(point >> 12 & 63 | 128); result.push(point >> 6 & 63 | 128); result.push(point & 63 | 128); continue; } result.push(239, 191, 189); } return new Uint8Array(result).buffer; }; const encodeUtf8 = encodeUtf8$1; const Mode$2 = mode; function ByteData(data2) { this.mode = Mode$2.BYTE; if (typeof data2 === "string") { data2 = encodeUtf8(data2); } this.data = new Uint8Array(data2); } ByteData.getBitsLength = function getBitsLength(length) { return length * 8; }; ByteData.prototype.getLength = function getLength() { return this.data.length; }; ByteData.prototype.getBitsLength = function getBitsLength() { return ByteData.getBitsLength(this.data.length); }; ByteData.prototype.write = function(bitBuffer2) { for (let i2 = 0, l2 = this.data.length; i2 < l2; i2++) { bitBuffer2.put(this.data[i2], 8); } }; var byteData = ByteData; const Mode$1 = mode; const Utils$2 = utils$4; function KanjiData(data2) { this.mode = Mode$1.KANJI; this.data = data2; } KanjiData.getBitsLength = function getBitsLength(length) { return length * 13; }; KanjiData.prototype.getLength = function getLength() { return this.data.length; }; KanjiData.prototype.getBitsLength = function getBitsLength() { return KanjiData.getBitsLength(this.data.length); }; KanjiData.prototype.write = function(bitBuffer2) { let i2; for (i2 = 0; i2 < this.data.length; i2++) { let value = Utils$2.toSJIS(this.data[i2]); if (value >= 33088 && value <= 40956) { value -= 33088; } else if (value >= 57408 && value <= 60351) { value -= 49472; } else { throw new Error( "Invalid SJIS character: " + this.data[i2] + "\nMake sure your charset is UTF-8" ); } value = (value >>> 8 & 255) * 192 + (value & 255); bitBuffer2.put(value, 13); } }; var kanjiData = KanjiData; var dijkstra = { exports: {} }; (function(module2) { var dijkstra2 = { single_source_shortest_paths: function(graph, s2, d2) { var predecessors = {}; var costs = {}; costs[s2] = 0; var open = dijkstra2.PriorityQueue.make(); open.push(s2, 0); var closest, u2, v2, cost_of_s_to_u, adjacent_nodes, cost_of_e, cost_of_s_to_u_plus_cost_of_e, cost_of_s_to_v, first_visit; while (!open.empty()) { closest = open.pop(); u2 = closest.value; cost_of_s_to_u = closest.cost; adjacent_nodes = graph[u2] || {}; for (v2 in adjacent_nodes) { if (adjacent_nodes.hasOwnProperty(v2)) { cost_of_e = adjacent_nodes[v2]; cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e; cost_of_s_to_v = costs[v2]; first_visit = typeof costs[v2] === "undefined"; if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) { costs[v2] = cost_of_s_to_u_plus_cost_of_e; open.push(v2, cost_of_s_to_u_plus_cost_of_e); predecessors[v2] = u2; } } } } if (typeof d2 !== "undefined" && typeof costs[d2] === "undefined") { var msg = ["Could not find a path from ", s2, " to ", d2, "."].join(""); throw new Error(msg); } return predecessors; }, extract_shortest_path_from_predecessor_list: function(predecessors, d2) { var nodes = []; var u2 = d2; while (u2) { nodes.push(u2); predecessors[u2]; u2 = predecessors[u2]; } nodes.reverse(); return nodes; }, find_path: function(graph, s2, d2) { var predecessors = dijkstra2.single_source_shortest_paths(graph, s2, d2); return dijkstra2.extract_shortest_path_from_predecessor_list( predecessors, d2 ); }, /** * A very naive priority queue implementation. */ PriorityQueue: { make: function(opts) { var T2 = dijkstra2.PriorityQueue, t2 = {}, key; opts = opts || {}; for (key in T2) { if (T2.hasOwnProperty(key)) { t2[key] = T2[key]; } } t2.queue = []; t2.sorter = opts.sorter || T2.default_sorter; return t2; }, default_sorter: function(a2, b2) { return a2.cost - b2.cost; }, /** * Add a new item to the queue and ensure the highest priority element * is at the front of the queue. */ push: function(value, cost) { var item = { value, cost }; this.queue.push(item); this.queue.sort(this.sorter); }, /** * Return the highest priority element in the queue. */ pop: function() { return this.queue.shift(); }, empty: function() { return this.queue.length === 0; } } }; { module2.exports = dijkstra2; } })(dijkstra); var dijkstraExports = dijkstra.exports; (function(exports3) { const Mode2 = mode; const NumericData2 = numericData; const AlphanumericData2 = alphanumericData; const ByteData2 = byteData; const KanjiData2 = kanjiData; const Regex = regex; const Utils2 = utils$4; const dijkstra2 = dijkstraExports; function getStringByteLength(str) { return unescape(encodeURIComponent(str)).length; } function getSegments(regex2, mode2, str) { const segments2 = []; let result; while ((result = regex2.exec(str)) !== null) { segments2.push({ data: result[0], index: result.index, mode: mode2, length: result[0].length }); } return segments2; } function getSegmentsFromString(dataStr) { const numSegs = getSegments(Regex.NUMERIC, Mode2.NUMERIC, dataStr); const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode2.ALPHANUMERIC, dataStr); let byteSegs; let kanjiSegs; if (Utils2.isKanjiModeEnabled()) { byteSegs = getSegments(Regex.BYTE, Mode2.BYTE, dataStr); kanjiSegs = getSegments(Regex.KANJI, Mode2.KANJI, dataStr); } else { byteSegs = getSegments(Regex.BYTE_KANJI, Mode2.BYTE, dataStr); kanjiSegs = []; } const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs); return segs.sort(function(s1, s2) { return s1.index - s2.index; }).map(function(obj) { return { data: obj.data, mode: obj.mode, length: obj.length }; }); } function getSegmentBitsLength(length, mode2) { switch (mode2) { case Mode2.NUMERIC: return NumericData2.getBitsLength(length); case Mode2.ALPHANUMERIC: return AlphanumericData2.getBitsLength(length); case Mode2.KANJI: return KanjiData2.getBitsLength(length); case Mode2.BYTE: return ByteData2.getBitsLength(length); } } function mergeSegments(segs) { return segs.reduce(function(acc, curr) { const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null; if (prevSeg && prevSeg.mode === curr.mode) { acc[acc.length - 1].data += curr.data; return acc; } acc.push(curr); return acc; }, []); } function buildNodes(segs) { const nodes = []; for (let i2 = 0; i2 < segs.length; i2++) { const seg = segs[i2]; switch (seg.mode) { case Mode2.NUMERIC: nodes.push([ seg, { data: seg.data, mode: Mode2.ALPHANUMERIC, length: seg.length }, { data: seg.data, mode: Mode2.BYTE, length: seg.length } ]); break; case Mode2.ALPHANUMERIC: nodes.push([ seg, { data: seg.data, mode: Mode2.BYTE, length: seg.length } ]); break; case Mode2.KANJI: nodes.push([ seg, { data: seg.data, mode: Mode2.BYTE, length: getStringByteLength(seg.data) } ]); break; case Mode2.BYTE: nodes.push([ { data: seg.data, mode: Mode2.BYTE, length: getStringByteLength(seg.data) } ]); } } return nodes; } function buildGraph(nodes, version2) { const table = {}; const graph = { start: {} }; let prevNodeIds = ["start"]; for (let i2 = 0; i2 < nodes.length; i2++) { const nodeGroup = nodes[i2]; const currentNodeIds = []; for (let j2 = 0; j2 < nodeGroup.length; j2++) { const node2 = nodeGroup[j2]; const key = "" + i2 + j2; currentNodeIds.push(key); table[key] = { node: node2, lastCount: 0 }; graph[key] = {}; for (let n2 = 0; n2 < prevNodeIds.length; n2++) { const prevNodeId = prevNodeIds[n2]; if (table[prevNodeId] && table[prevNodeId].node.mode === node2.mode) { graph[prevNodeId][key] = getSegmentBitsLength(table[prevNodeId].lastCount + node2.length, node2.mode) - getSegmentBitsLength(table[prevNodeId].lastCount, node2.mode); table[prevNodeId].lastCount += node2.length; } else { if (table[prevNodeId]) table[prevNodeId].lastCount = node2.length; graph[prevNodeId][key] = getSegmentBitsLength(node2.length, node2.mode) + 4 + Mode2.getCharCountIndicator(node2.mode, version2); } } } prevNodeIds = currentNodeIds; } for (let n2 = 0; n2 < prevNodeIds.length; n2++) { graph[prevNodeIds[n2]].end = 0; } return { map: graph, table }; } function buildSingleSegment(data2, modesHint) { let mode2; const bestMode = Mode2.getBestModeForData(data2); mode2 = Mode2.from(modesHint, bestMode); if (mode2 !== Mode2.BYTE && mode2.bit < bestMode.bit) { throw new Error('"' + data2 + '" cannot be encoded with mode ' + Mode2.toString(mode2) + ".\n Suggested mode is: " + Mode2.toString(bestMode)); } if (mode2 === Mode2.KANJI && !Utils2.isKanjiModeEnabled()) { mode2 = Mode2.BYTE; } switch (mode2) { case Mode2.NUMERIC: return new NumericData2(data2); case Mode2.ALPHANUMERIC: return new AlphanumericData2(data2); case Mode2.KANJI: return new KanjiData2(data2); case Mode2.BYTE: return new ByteData2(data2); } } exports3.fromArray = function fromArray(array2) { return array2.reduce(function(acc, seg) { if (typeof seg === "string") { acc.push(buildSingleSegment(seg, null)); } else if (seg.data) { acc.push(buildSingleSegment(seg.data, seg.mode)); } return acc; }, []); }; exports3.fromString = function fromString2(data2, version2) { const segs = getSegmentsFromString(data2, Utils2.isKanjiModeEnabled()); const nodes = buildNodes(segs); const graph = buildGraph(nodes, version2); const path = dijkstra2.find_path(graph.map, "start", "end"); const optimizedSegs = []; for (let i2 = 1; i2 < path.length - 1; i2++) { optimizedSegs.push(graph.table[path[i2]].node); } return exports3.fromArray(mergeSegments(optimizedSegs)); }; exports3.rawSplit = function rawSplit(data2) { return exports3.fromArray( getSegmentsFromString(data2, Utils2.isKanjiModeEnabled()) ); }; })(segments); const Utils$1 = utils$4; const ECLevel = errorCorrectionLevel; const BitBuffer = bitBuffer; const BitMatrix = bitMatrix; const AlignmentPattern = alignmentPattern; const FinderPattern = finderPattern; const MaskPattern = maskPattern; const ECCode = errorCorrectionCode; const ReedSolomonEncoder = reedSolomonEncoder; const Version = version$1; const FormatInfo = formatInfo; const Mode = mode; const Segments = segments; function setupFinderPattern(matrix, version2) { const size2 = matrix.size; const pos = FinderPattern.getPositions(version2); for (let i2 = 0; i2 < pos.length; i2++) { const row = pos[i2][0]; const col = pos[i2][1]; for (let r2 = -1; r2 <= 7; r2++) { if (row + r2 <= -1 || size2 <= row + r2) continue; for (let c2 = -1; c2 <= 7; c2++) { if (col + c2 <= -1 || size2 <= col + c2) continue; if (r2 >= 0 && r2 <= 6 && (c2 === 0 || c2 === 6) || c2 >= 0 && c2 <= 6 && (r2 === 0 || r2 === 6) || r2 >= 2 && r2 <= 4 && c2 >= 2 && c2 <= 4) { matrix.set(row + r2, col + c2, true, true); } else { matrix.set(row + r2, col + c2, false, true); } } } } } function setupTimingPattern(matrix) { const size2 = matrix.size; for (let r2 = 8; r2 < size2 - 8; r2++) { const value = r2 % 2 === 0; matrix.set(r2, 6, value, true); matrix.set(6, r2, value, true); } } function setupAlignmentPattern(matrix, version2) { const pos = AlignmentPattern.getPositions(version2); for (let i2 = 0; i2 < pos.length; i2++) { const row = pos[i2][0]; const col = pos[i2][1]; for (let r2 = -2; r2 <= 2; r2++) { for (let c2 = -2; c2 <= 2; c2++) { if (r2 === -2 || r2 === 2 || c2 === -2 || c2 === 2 || r2 === 0 && c2 === 0) { matrix.set(row + r2, col + c2, true, true); } else { matrix.set(row + r2, col + c2, false, true); } } } } } function setupVersionInfo(matrix, version2) { const size2 = matrix.size; const bits = Version.getEncodedBits(version2); let row, col, mod; for (let i2 = 0; i2 < 18; i2++) { row = Math.floor(i2 / 3); col = i2 % 3 + size2 - 8 - 3; mod = (bits >> i2 & 1) === 1; matrix.set(row, col, mod, true); matrix.set(col, row, mod, true); } } function setupFormatInfo(matrix, errorCorrectionLevel2, maskPattern2) { const size2 = matrix.size; const bits = FormatInfo.getEncodedBits(errorCorrectionLevel2, maskPattern2); let i2, mod; for (i2 = 0; i2 < 15; i2++) { mod = (bits >> i2 & 1) === 1; if (i2 < 6) { matrix.set(i2, 8, mod, true); } else if (i2 < 8) { matrix.set(i2 + 1, 8, mod, true); } else { matrix.set(size2 - 15 + i2, 8, mod, true); } if (i2 < 8) { matrix.set(8, size2 - i2 - 1, mod, true); } else if (i2 < 9) { matrix.set(8, 15 - i2 - 1 + 1, mod, true); } else { matrix.set(8, 15 - i2 - 1, mod, true); } } matrix.set(size2 - 8, 8, 1, true); } function setupData(matrix, data2) { const size2 = matrix.size; let inc2 = -1; let row = size2 - 1; let bitIndex = 7; let byteIndex = 0; for (let col = size2 - 1; col > 0; col -= 2) { if (col === 6) col--; while (true) { for (let c2 = 0; c2 < 2; c2++) { if (!matrix.isReserved(row, col - c2)) { let dark = false; if (byteIndex < data2.length) { dark = (data2[byteIndex] >>> bitIndex & 1) === 1; } matrix.set(row, col - c2, dark); bitIndex--; if (bitIndex === -1) { byteIndex++; bitIndex = 7; } } } row += inc2; if (row < 0 || size2 <= row) { row -= inc2; inc2 = -inc2; break; } } } } function createData(version2, errorCorrectionLevel2, segments2) { const buffer2 = new BitBuffer(); segments2.forEach(function(data2) { buffer2.put(data2.mode.bit, 4); buffer2.put(data2.getLength(), Mode.getCharCountIndicator(data2.mode, version2)); data2.write(buffer2); }); const totalCodewords = Utils$1.getSymbolTotalCodewords(version2); const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8; if (buffer2.getLengthInBits() + 4 <= dataTotalCodewordsBits) { buffer2.put(0, 4); } while (buffer2.getLengthInBits() % 8 !== 0) { buffer2.putBit(0); } const remainingByte = (dataTotalCodewordsBits - buffer2.getLengthInBits()) / 8; for (let i2 = 0; i2 < remainingByte; i2++) { buffer2.put(i2 % 2 ? 17 : 236, 8); } return createCodewords(buffer2, version2, errorCorrectionLevel2); } function createCodewords(bitBuffer2, version2, errorCorrectionLevel2) { const totalCodewords = Utils$1.getSymbolTotalCodewords(version2); const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2); const dataTotalCodewords = totalCodewords - ecTotalCodewords; const ecTotalBlocks = ECCode.getBlocksCount(version2, errorCorrectionLevel2); const blocksInGroup2 = totalCodewords % ecTotalBlocks; const blocksInGroup1 = ecTotalBlocks - blocksInGroup2; const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks); const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks); const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1; const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1; const rs2 = new ReedSolomonEncoder(ecCount); let offset = 0; const dcData = new Array(ecTotalBlocks); const ecData = new Array(ecTotalBlocks); let maxDataSize = 0; const buffer2 = new Uint8Array(bitBuffer2.buffer); for (let b2 = 0; b2 < ecTotalBlocks; b2++) { const dataSize = b2 < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2; dcData[b2] = buffer2.slice(offset, offset + dataSize); ecData[b2] = rs2.encode(dcData[b2]); offset += dataSize; maxDataSize = Math.max(maxDataSize, dataSize); } const data2 = new Uint8Array(totalCodewords); let index2 = 0; let i2, r2; for (i2 = 0; i2 < maxDataSize; i2++) { for (r2 = 0; r2 < ecTotalBlocks; r2++) { if (i2 < dcData[r2].length) { data2[index2++] = dcData[r2][i2]; } } } for (i2 = 0; i2 < ecCount; i2++) { for (r2 = 0; r2 < ecTotalBlocks; r2++) { data2[index2++] = ecData[r2][i2]; } } return data2; } function createSymbol(data2, version2, errorCorrectionLevel2, maskPattern2) { let segments2; if (Array.isArray(data2)) { segments2 = Segments.fromArray(data2); } else if (typeof data2 === "string") { let estimatedVersion = version2; if (!estimatedVersion) { const rawSegments = Segments.rawSplit(data2); estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel2); } segments2 = Segments.fromString(data2, estimatedVersion || 40); } else { throw new Error("Invalid data"); } const bestVersion = Version.getBestVersionForData(segments2, errorCorrectionLevel2); if (!bestVersion) { throw new Error("The amount of data is too big to be stored in a QR Code"); } if (!version2) { version2 = bestVersion; } else if (version2 < bestVersion) { throw new Error( "\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + bestVersion + ".\n" ); } const dataBits = createData(version2, errorCorrectionLevel2, segments2); const moduleCount = Utils$1.getSymbolSize(version2); const modules = new BitMatrix(moduleCount); setupFinderPattern(modules, version2); setupTimingPattern(modules); setupAlignmentPattern(modules, version2); setupFormatInfo(modules, errorCorrectionLevel2, 0); if (version2 >= 7) { setupVersionInfo(modules, version2); } setupData(modules, dataBits); if (isNaN(maskPattern2)) { maskPattern2 = MaskPattern.getBestMask( modules, setupFormatInfo.bind(null, modules, errorCorrectionLevel2) ); } MaskPattern.applyMask(maskPattern2, modules); setupFormatInfo(modules, errorCorrectionLevel2, maskPattern2); return { modules, version: version2, errorCorrectionLevel: errorCorrectionLevel2, maskPattern: maskPattern2, segments: segments2 }; } qrcode.create = function create2(data2, options) { if (typeof data2 === "undefined" || data2 === "") { throw new Error("No input text"); } let errorCorrectionLevel2 = ECLevel.M; let version2; let mask2; if (typeof options !== "undefined") { errorCorrectionLevel2 = ECLevel.from(options.errorCorrectionLevel, ECLevel.M); version2 = Version.from(options.version); mask2 = MaskPattern.from(options.maskPattern); if (options.toSJISFunc) { Utils$1.setToSJISFunction(options.toSJISFunc); } } return createSymbol(data2, version2, errorCorrectionLevel2, mask2); }; var canvas = {}; var utils$3 = {}; (function(exports3) { function hex2rgba(hex2) { if (typeof hex2 === "number") { hex2 = hex2.toString(); } if (typeof hex2 !== "string") { throw new Error("Color should be defined as hex string"); } let hexCode = hex2.slice().replace("#", "").split(""); if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) { throw new Error("Invalid hex color: " + hex2); } if (hexCode.length === 3 || hexCode.length === 4) { hexCode = Array.prototype.concat.apply([], hexCode.map(function(c2) { return [c2, c2]; })); } if (hexCode.length === 6) hexCode.push("F", "F"); const hexValue = parseInt(hexCode.join(""), 16); return { r: hexValue >> 24 & 255, g: hexValue >> 16 & 255, b: hexValue >> 8 & 255, a: hexValue & 255, hex: "#" + hexCode.slice(0, 6).join("") }; } exports3.getOptions = function getOptions2(options) { if (!options) options = {}; if (!options.color) options.color = {}; const margin = typeof options.margin === "undefined" || options.margin === null || options.margin < 0 ? 4 : options.margin; const width = options.width && options.width >= 21 ? options.width : void 0; const scale = options.scale || 4; return { width, scale: width ? 4 : scale, margin, color: { dark: hex2rgba(options.color.dark || "#000000ff"), light: hex2rgba(options.color.light || "#ffffffff") }, type: options.type, rendererOpts: options.rendererOpts || {} }; }; exports3.getScale = function getScale(qrSize, opts) { return opts.width && opts.width >= qrSize + opts.margin * 2 ? opts.width / (qrSize + opts.margin * 2) : opts.scale; }; exports3.getImageWidth = function getImageWidth(qrSize, opts) { const scale = exports3.getScale(qrSize, opts); return Math.floor((qrSize + opts.margin * 2) * scale); }; exports3.qrToImageData = function qrToImageData(imgData, qr, opts) { const size2 = qr.modules.size; const data2 = qr.modules.data; const scale = exports3.getScale(size2, opts); const symbolSize = Math.floor((size2 + opts.margin * 2) * scale); const scaledMargin = opts.margin * scale; const palette = [opts.color.light, opts.color.dark]; for (let i2 = 0; i2 < symbolSize; i2++) { for (let j2 = 0; j2 < symbolSize; j2++) { let posDst = (i2 * symbolSize + j2) * 4; let pxColor = opts.color.light; if (i2 >= scaledMargin && j2 >= scaledMargin && i2 < symbolSize - scaledMargin && j2 < symbolSize - scaledMargin) { const iSrc = Math.floor((i2 - scaledMargin) / scale); const jSrc = Math.floor((j2 - scaledMargin) / scale); pxColor = palette[data2[iSrc * size2 + jSrc] ? 1 : 0]; } imgData[posDst++] = pxColor.r; imgData[posDst++] = pxColor.g; imgData[posDst++] = pxColor.b; imgData[posDst] = pxColor.a; } } }; })(utils$3); (function(exports3) { const Utils2 = utils$3; function clearCanvas(ctx, canvas2, size2) { ctx.clearRect(0, 0, canvas2.width, canvas2.height); if (!canvas2.style) canvas2.style = {}; canvas2.height = size2; canvas2.width = size2; canvas2.style.height = size2 + "px"; canvas2.style.width = size2 + "px"; } function getCanvasElement() { try { return document.createElement("canvas"); } catch (e2) { throw new Error("You need to specify a canvas element"); } } exports3.render = function render(qrData, canvas2, options) { let opts = options; let canvasEl = canvas2; if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) { opts = canvas2; canvas2 = void 0; } if (!canvas2) { canvasEl = getCanvasElement(); } opts = Utils2.getOptions(opts); const size2 = Utils2.getImageWidth(qrData.modules.size, opts); const ctx = canvasEl.getContext("2d"); const image = ctx.createImageData(size2, size2); Utils2.qrToImageData(image.data, qrData, opts); clearCanvas(ctx, canvasEl, size2); ctx.putImageData(image, 0, 0); return canvasEl; }; exports3.renderToDataURL = function renderToDataURL(qrData, canvas2, options) { let opts = options; if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) { opts = canvas2; canvas2 = void 0; } if (!opts) opts = {}; const canvasEl = exports3.render(qrData, canvas2, opts); const type2 = opts.type || "image/png"; const rendererOpts = opts.rendererOpts || {}; return canvasEl.toDataURL(type2, rendererOpts.quality); }; })(canvas); var svgTag = {}; const Utils = utils$3; function getColorAttrib(color, attrib) { const alpha = color.a / 255; const str = attrib + '="' + color.hex + '"'; return alpha < 1 ? str + " " + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' : str; } function svgCmd(cmd, x2, y2) { let str = cmd + x2; if (typeof y2 !== "undefined") str += " " + y2; return str; } function qrToPath(data2, size2, margin) { let path = ""; let moveBy = 0; let newRow = false; let lineLength = 0; for (let i2 = 0; i2 < data2.length; i2++) { const col = Math.floor(i2 % size2); const row = Math.floor(i2 / size2); if (!col && !newRow) newRow = true; if (data2[i2]) { lineLength++; if (!(i2 > 0 && col > 0 && data2[i2 - 1])) { path += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0); moveBy = 0; newRow = false; } if (!(col + 1 < size2 && data2[i2 + 1])) { path += svgCmd("h", lineLength); lineLength = 0; } } else { moveBy++; } } return path; } svgTag.render = function render(qrData, options, cb) { const opts = Utils.getOptions(options); const size2 = qrData.modules.size; const data2 = qrData.modules.data; const qrcodesize = size2 + opts.margin * 2; const bg = !opts.color.light.a ? "" : "'; const path = "'; const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"'; const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" '; const svgTag2 = '' + bg + path + "\n"; if (typeof cb === "function") { cb(null, svgTag2); } return svgTag2; }; const canPromise = canPromise$1; const QRCode$3 = qrcode; const CanvasRenderer = canvas; const SvgRenderer = svgTag; function renderCanvas(renderFunc, canvas2, text, opts, cb) { const args = [].slice.call(arguments, 1); const argsNum = args.length; const isLastArgCb = typeof args[argsNum - 1] === "function"; if (!isLastArgCb && !canPromise()) { throw new Error("Callback required as last argument"); } if (isLastArgCb) { if (argsNum < 2) { throw new Error("Too few arguments provided"); } if (argsNum === 2) { cb = text; text = canvas2; canvas2 = opts = void 0; } else if (argsNum === 3) { if (canvas2.getContext && typeof cb === "undefined") { cb = opts; opts = void 0; } else { cb = opts; opts = text; text = canvas2; canvas2 = void 0; } } } else { if (argsNum < 1) { throw new Error("Too few arguments provided"); } if (argsNum === 1) { text = canvas2; canvas2 = opts = void 0; } else if (argsNum === 2 && !canvas2.getContext) { opts = text; text = canvas2; canvas2 = void 0; } return new Promise(function(resolve, reject) { try { const data2 = QRCode$3.create(text, opts); resolve(renderFunc(data2, canvas2, opts)); } catch (e2) { reject(e2); } }); } try { const data2 = QRCode$3.create(text, opts); cb(null, renderFunc(data2, canvas2, opts)); } catch (e2) { cb(e2); } } browser$5.create = QRCode$3.create; browser$5.toCanvas = renderCanvas.bind(null, CanvasRenderer.render); browser$5.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL); browser$5.toString = renderCanvas.bind(null, function(data2, _2, opts) { return SvgRenderer.render(data2, opts); }); const CONNECTING_ERROR_MARGIN = 0.1; const CIRCLE_SIZE_MODIFIER = 2.5; const QRCODE_MATRIX_MARGIN = 7; function isAdjecentDots(cy, otherCy, cellSize) { if (cy === otherCy) { return false; } const diff2 = cy - otherCy < 0 ? otherCy - cy : cy - otherCy; return diff2 <= cellSize + CONNECTING_ERROR_MARGIN; } function getMatrix(value, errorCorrectionLevel2) { const arr2 = Array.prototype.slice.call(browser$5.create(value, { errorCorrectionLevel: errorCorrectionLevel2 }).modules.data, 0); const sqrt = Math.sqrt(arr2.length); return arr2.reduce((rows, key, index2) => (index2 % sqrt === 0 ? rows.push([key]) : rows[rows.length - 1].push(key)) && rows, []); } const QrCodeUtil = { generate(uri, size2, logoSize) { const dotColor = "#141414"; const edgeColor = "transparent"; const strokeWidth = 5; const dots = []; const matrix = getMatrix(uri, "Q"); const cellSize = size2 / matrix.length; const qrList = [ { x: 0, y: 0 }, { x: 1, y: 0 }, { x: 0, y: 1 } ]; qrList.forEach(({ x: x2, y: y2 }) => { const x1 = (matrix.length - QRCODE_MATRIX_MARGIN) * cellSize * x2; const y1 = (matrix.length - QRCODE_MATRIX_MARGIN) * cellSize * y2; const borderRadius = 0.45; for (let i2 = 0; i2 < qrList.length; i2 += 1) { const dotSize = cellSize * (QRCODE_MATRIX_MARGIN - i2 * 2); dots.push(b$8` `); } }); const clearArenaSize = Math.floor((logoSize + 25) / cellSize); const matrixMiddleStart = matrix.length / 2 - clearArenaSize / 2; const matrixMiddleEnd = matrix.length / 2 + clearArenaSize / 2 - 1; const circles = []; matrix.forEach((row, i2) => { row.forEach((_2, j2) => { if (matrix[i2][j2]) { if (!(i2 < QRCODE_MATRIX_MARGIN && j2 < QRCODE_MATRIX_MARGIN || i2 > matrix.length - (QRCODE_MATRIX_MARGIN + 1) && j2 < QRCODE_MATRIX_MARGIN || i2 < QRCODE_MATRIX_MARGIN && j2 > matrix.length - (QRCODE_MATRIX_MARGIN + 1))) { if (!(i2 > matrixMiddleStart && i2 < matrixMiddleEnd && j2 > matrixMiddleStart && j2 < matrixMiddleEnd)) { const cx = i2 * cellSize + cellSize / 2; const cy = j2 * cellSize + cellSize / 2; circles.push([cx, cy]); } } } }); }); const circlesToConnect = {}; circles.forEach(([cx, cy]) => { var _a2; if (circlesToConnect[cx]) { (_a2 = circlesToConnect[cx]) == null ? void 0 : _a2.push(cy); } else { circlesToConnect[cx] = [cy]; } }); Object.entries(circlesToConnect).map(([cx, cys]) => { const newCys = cys.filter((cy) => cys.every((otherCy) => !isAdjecentDots(cy, otherCy, cellSize))); return [Number(cx), newCys]; }).forEach(([cx, cys]) => { cys.forEach((cy) => { dots.push(b$8``); }); }); Object.entries(circlesToConnect).filter(([_2, cys]) => cys.length > 1).map(([cx, cys]) => { const newCys = cys.filter((cy) => cys.some((otherCy) => isAdjecentDots(cy, otherCy, cellSize))); return [Number(cx), newCys]; }).map(([cx, cys]) => { cys.sort((a2, b2) => a2 < b2 ? -1 : 1); const groups = []; for (const cy of cys) { const group = groups.find((item) => item.some((otherCy) => isAdjecentDots(cy, otherCy, cellSize))); if (group) { group.push(cy); } else { groups.push([cy]); } } return [cx, groups.map((item) => [item[0], item[item.length - 1]])]; }).forEach(([cx, groups]) => { groups.forEach(([y1, y2]) => { dots.push(b$8` `); }); }); return dots; } }; const styles$z = i$g` :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(--wui-border-radius-l), 40px); background-color: var(--wui-color-inverse-100); padding: var(--wui-spacing-l); } :host([data-theme='light']) { box-shadow: 0 0 0 1px var(--wui-color-bg-125); background-color: var(--wui-color-bg-125); } svg:first-child, wui-image, wui-icon { position: absolute; top: 50%; left: 50%; transform: translateY(-50%) translateX(-50%); } wui-image { width: 25%; height: 25%; border-radius: var(--wui-border-radius-xs); } wui-icon { width: 100%; height: 100%; color: #3396ff !important; transform: translateY(-50%) translateX(-50%) scale(0.25); } `; var __decorate$T = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiQrCode = class WuiQrCode extends s$b { constructor() { super(...arguments); this.uri = ""; this.size = 0; this.theme = "dark"; this.imageSrc = void 0; this.alt = void 0; } render() { this.dataset["theme"] = this.theme; this.style.cssText = `--local-size: ${this.size}px`; return x$6`${this.templateVisual()} ${this.templateSvg()}`; } templateSvg() { const size2 = this.theme === "light" ? this.size : this.size - 16 * 2; return b$8` ${QrCodeUtil.generate(this.uri, size2, size2 / 4)} `; } templateVisual() { if (this.imageSrc) { return x$6``; } return x$6``; } }; WuiQrCode.styles = [resetStyles, styles$z]; __decorate$T([ n$i() ], WuiQrCode.prototype, "uri", void 0); __decorate$T([ n$i({ type: Number }) ], WuiQrCode.prototype, "size", void 0); __decorate$T([ n$i() ], WuiQrCode.prototype, "theme", void 0); __decorate$T([ n$i() ], WuiQrCode.prototype, "imageSrc", void 0); __decorate$T([ n$i() ], WuiQrCode.prototype, "alt", void 0); WuiQrCode = __decorate$T([ customElement("wui-qr-code") ], WuiQrCode); const styles$y = i$g` :host { position: relative; display: inline-block; width: 100%; } `; var __decorate$S = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiSearchBar = class WuiSearchBar extends s$b { constructor() { super(...arguments); this.inputComponentRef = e$e(); } render() { return x$6` `; } clearValue() { const inputComponent = this.inputComponentRef.value; const inputElement = inputComponent == null ? void 0 : inputComponent.inputElementRef.value; if (inputElement) { inputElement.value = ""; inputElement.focus(); inputElement.dispatchEvent(new Event("input")); } } }; WuiSearchBar.styles = [resetStyles, styles$y]; WuiSearchBar = __decorate$S([ customElement("wui-search-bar") ], WuiSearchBar); const styles$x = i$g` :host { display: flex; column-gap: var(--wui-spacing-xs); align-items: center; padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs); border-radius: var(--wui-border-radius-3xl); border: 1px solid var(--wui-gray-glass-005); background-color: var(--wui-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); } `; var __decorate$R = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiSnackbar = class WuiSnackbar extends s$b { constructor() { super(...arguments); this.backgroundColor = "accent-100"; this.iconColor = "accent-100"; this.icon = "checkmark"; this.message = ""; } render() { return x$6` ${this.message} `; } }; WuiSnackbar.styles = [resetStyles, styles$x]; __decorate$R([ n$i() ], WuiSnackbar.prototype, "backgroundColor", void 0); __decorate$R([ n$i() ], WuiSnackbar.prototype, "iconColor", void 0); __decorate$R([ n$i() ], WuiSnackbar.prototype, "icon", void 0); __decorate$R([ n$i() ], WuiSnackbar.prototype, "message", void 0); WuiSnackbar = __decorate$R([ customElement("wui-snackbar") ], WuiSnackbar); const styles$w = i$g` :host { display: inline-flex; background-color: var(--wui-gray-glass-002); border-radius: var(--wui-border-radius-3xl); padding: var(--wui-spacing-3xs); position: relative; 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(--wui-border-radius-3xl); background-color: var(--wui-gray-glass-002); box-shadow: inset 0 0 0 1px var(--wui-gray-glass-002); transform: translateX(calc(var(--local-tab) * var(--local-tab-width))); transition: transform var(--wui-ease-out-power-2) var(--wui-duration-lg); } :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 > wui-text { position: absolute; left: 18px; opacity: 0; } button[data-active='true'] > wui-icon, button[data-active='true'] > wui-text { color: var(--wui-color-fg-100); } button[data-active='false'] > wui-icon, button[data-active='false'] > wui-text { color: var(--wui-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 > wui-text { color: var(--wui-color-fg-200); } button[data-active='false']:disabled > wui-text { color: var(--wui-color-fg-300); } button > wui-icon, button > wui-text { pointer-events: none; transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg); } button { width: var(--local-tab-width); } :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 > wui-icon, button:active:enabled > wui-icon { color: var(--wui-color-fg-125); } button:hover:enabled > wui-text, button:active:enabled > wui-text { color: var(--wui-color-fg-125); } button { border-radius: var(--wui-border-radius-3xl); } `; var __decorate$Q = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiTabs = class WuiTabs extends s$b { constructor() { super(...arguments); this.tabs = []; this.onTabChange = () => null; this.buttons = []; this.disabled = false; this.activeTab = 0; this.localTabWidth = "100px"; this.isDense = false; } render() { 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"; return this.tabs.map((tab, index2) => { const isActive = index2 === this.activeTab; return x$6` `; }); } firstUpdated() { if (this.shadowRoot && this.isDense) { this.buttons = [...this.shadowRoot.querySelectorAll("button")]; setTimeout(() => { this.animateTabs(0, true); }, 0); } } onTabClick(index2) { if (this.buttons) { this.animateTabs(index2, false); } this.activeTab = index2; this.onTabChange(index2); } animateTabs(index2, initialAnimation) { const passiveBtn = this.buttons[this.activeTab]; const activeBtn = this.buttons[index2]; const passiveBtnText = passiveBtn == null ? void 0 : passiveBtn.querySelector("wui-text"); const activeBtnText = activeBtn == null ? void 0 : activeBtn.querySelector("wui-text"); const activeBtnBounds = activeBtn == null ? void 0 : activeBtn.getBoundingClientRect(); const activeBtnTextBounds = activeBtnText == null ? void 0 : activeBtnText.getBoundingClientRect(); if (passiveBtn && passiveBtnText && !initialAnimation && index2 !== this.activeTab) { passiveBtnText.animate([{ opacity: 0 }], { duration: 50, easing: "ease", fill: "forwards" }); passiveBtn.animate([{ width: `34px` }], { duration: 500, easing: "ease", fill: "forwards" }); } if (activeBtn && activeBtnBounds && activeBtnTextBounds && activeBtnText) { if (index2 !== this.activeTab || initialAnimation) { this.localTabWidth = `${Math.round(activeBtnBounds.width + activeBtnTextBounds.width) + 6}px`; activeBtn.animate([{ width: `${activeBtnBounds.width + activeBtnTextBounds.width}px` }], { duration: initialAnimation ? 0 : 500, fill: "forwards", easing: "ease" }); activeBtnText.animate([{ opacity: 1 }], { duration: initialAnimation ? 0 : 125, delay: initialAnimation ? 0 : 200, fill: "forwards", easing: "ease" }); } } } }; WuiTabs.styles = [resetStyles, elementStyles, styles$w]; __decorate$Q([ n$i({ type: Array }) ], WuiTabs.prototype, "tabs", void 0); __decorate$Q([ n$i() ], WuiTabs.prototype, "onTabChange", void 0); __decorate$Q([ n$i({ type: Array }) ], WuiTabs.prototype, "buttons", void 0); __decorate$Q([ n$i({ type: Boolean }) ], WuiTabs.prototype, "disabled", void 0); __decorate$Q([ r$g() ], WuiTabs.prototype, "activeTab", void 0); __decorate$Q([ r$g() ], WuiTabs.prototype, "localTabWidth", void 0); __decorate$Q([ r$g() ], WuiTabs.prototype, "isDense", void 0); WuiTabs = __decorate$Q([ customElement("wui-tabs") ], WuiTabs); const styles$v = i$g` :host { display: block; padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); border-radius: var(--wui-border-radius-xxs); background-color: var(--wui-color-fg-100); color: var(--wui-color-bg-100); position: relative; } wui-icon { position: absolute; width: 12px !important; height: 4px !important; } wui-icon[data-placement='top'] { bottom: 0; left: 50%; transform: translate(-50%, 95%); } wui-icon[data-placement='bottom'] { top: 0; left: 50%; transform: translate(-50%, -95%) rotate(180deg); } wui-icon[data-placement='right'] { top: 50%; left: 0; transform: translate(-65%, -50%) rotate(90deg); } wui-icon[data-placement='left'] { top: 50%; right: 0%; transform: translate(65%, -50%) rotate(270deg); } `; var __decorate$P = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiTooltip = class WuiTooltip extends s$b { constructor() { super(...arguments); this.placement = "top"; this.message = ""; } render() { return x$6` ${this.message}`; } }; WuiTooltip.styles = [resetStyles, elementStyles, styles$v]; __decorate$P([ n$i() ], WuiTooltip.prototype, "placement", void 0); __decorate$P([ n$i() ], WuiTooltip.prototype, "message", void 0); WuiTooltip = __decorate$P([ customElement("wui-tooltip") ], WuiTooltip); const styles$u = i$g` :host { display: flex; justify-content: center; align-items: center; width: var(--wui-icon-box-size-xl); height: var(--wui-icon-box-size-xl); box-shadow: 0 0 0 8px var(--wui-thumbnail-border); border-radius: var(--local-border-radius); overflow: hidden; } wui-icon { width: 32px; height: 32px; } `; var __decorate$O = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiVisualThumbnail = class WuiVisualThumbnail extends s$b { render() { this.style.cssText = `--local-border-radius: ${this.borderRadiusFull ? "1000px" : "20px"};`; return x$6`${this.templateVisual()}`; } templateVisual() { if (this.imageSrc) { return x$6``; } return x$6``; } }; WuiVisualThumbnail.styles = [resetStyles, styles$u]; __decorate$O([ n$i() ], WuiVisualThumbnail.prototype, "imageSrc", void 0); __decorate$O([ n$i() ], WuiVisualThumbnail.prototype, "alt", void 0); __decorate$O([ n$i({ type: Boolean }) ], WuiVisualThumbnail.prototype, "borderRadiusFull", void 0); WuiVisualThumbnail = __decorate$O([ customElement("wui-visual-thumbnail") ], WuiVisualThumbnail); const styles$t = i$g` :host { display: block; } button { width: 100%; display: block; padding-top: var(--wui-spacing-l); padding-bottom: var(--wui-spacing-l); padding-left: var(--wui-spacing-s); padding-right: var(--wui-spacing-2l); border-radius: var(--wui-border-radius-s); background-color: var(--wui-accent-glass-015); } button:hover { background-color: var(--wui-accent-glass-010) !important; } button:active { background-color: var(--wui-accent-glass-020) !important; } `; var __decorate$N = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiNoticeCard = class WuiNoticeCard extends s$b { constructor() { super(...arguments); this.label = ""; this.description = ""; this.icon = "wallet"; } render() { return x$6` `; } }; WuiNoticeCard.styles = [resetStyles, elementStyles, styles$t]; __decorate$N([ n$i() ], WuiNoticeCard.prototype, "label", void 0); __decorate$N([ n$i() ], WuiNoticeCard.prototype, "description", void 0); __decorate$N([ n$i() ], WuiNoticeCard.prototype, "icon", void 0); WuiNoticeCard = __decorate$N([ customElement("wui-notice-card") ], WuiNoticeCard); const styles$s = i$g` button { height: auto; position: relative; flex-direction: column; gap: var(--wui-spacing-s); padding: 17px 18px 17px var(--wui-spacing-m); width: 100%; background-color: var(--wui-gray-glass-002); border-radius: var(--wui-border-radius-xs); color: var(--wui-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(--wui-color-bg-200), transparent); border-bottom-left-radius: var(--wui-border-radius-xs); border-bottom-right-radius: var(--wui-border-radius-xs); } .heightContent { max-height: 100px; } pre { text-align: left; white-space: pre-wrap; height: auto; overflow-x: auto; overflow-wrap: anywhere; } `; var __decorate$M = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const MAX_HEIGHT = 100; let WuiListAccordion = class WuiListAccordion extends s$b { constructor() { super(...arguments); this.textTitle = ""; this.overflowedContent = ""; this.toggled = false; this.enableAccordion = false; this.scrollElement = void 0; this.scrollHeightElement = 0; } firstUpdated() { setTimeout(() => { var _a2; const heightElement = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(".heightContent"); if (heightElement) { this.scrollElement = heightElement; const scrollHeight = heightElement == null ? void 0 : heightElement.scrollHeight; if (scrollHeight && scrollHeight > MAX_HEIGHT) { this.enableAccordion = true; this.scrollHeightElement = scrollHeight; this.requestUpdate(); } } }, 0); } render() { return x$6` `; } onClick() { var _a2; const icon = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("wui-icon"); if (this.enableAccordion) { this.toggled = !this.toggled; this.requestUpdate(); if (this.scrollElement) { this.scrollElement.animate([ { maxHeight: this.toggled ? `${MAX_HEIGHT}px` : `${this.scrollHeightElement}px` }, { maxHeight: this.toggled ? `${this.scrollHeightElement}px` : `${MAX_HEIGHT}px` } ], { duration: 300, fill: "forwards", easing: "ease" }); } if (icon) { icon.animate([ { transform: this.toggled ? `rotate(0deg)` : `rotate(180deg)` }, { transform: this.toggled ? `rotate(180deg)` : `rotate(0deg)` } ], { duration: 300, fill: "forwards", easing: "ease" }); } } } chevronTemplate() { if (this.enableAccordion) { return x$6` `; } return null; } }; WuiListAccordion.styles = [resetStyles, elementStyles, styles$s]; __decorate$M([ n$i() ], WuiListAccordion.prototype, "textTitle", void 0); __decorate$M([ n$i() ], WuiListAccordion.prototype, "overflowedContent", void 0); WuiListAccordion = __decorate$M([ customElement("wui-list-accordion") ], WuiListAccordion); const styles$r = i$g` :host { display: flex; column-gap: var(--wui-spacing-s); padding: 17px 18px 17px var(--wui-spacing-m); width: 100%; background-color: var(--wui-gray-glass-002); border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-250); } wui-image { width: var(--wui-icon-size-lg); height: var(--wui-icon-size-lg); border-radius: var(--wui-border-radius-3xl); } wui-icon { width: var(--wui-icon-size-lg); height: var(--wui-icon-size-lg); } `; var __decorate$L = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiListContent = class WuiListContent extends s$b { constructor() { super(...arguments); this.imageSrc = void 0; this.textTitle = ""; this.textValue = void 0; } render() { return x$6` ${this.textTitle} ${this.templateContent()} `; } templateContent() { if (this.imageSrc) { return x$6``; } else if (this.textValue) { return x$6` ${this.textValue} `; } return x$6``; } }; WuiListContent.styles = [resetStyles, elementStyles, styles$r]; __decorate$L([ n$i() ], WuiListContent.prototype, "imageSrc", void 0); __decorate$L([ n$i() ], WuiListContent.prototype, "textTitle", void 0); __decorate$L([ n$i() ], WuiListContent.prototype, "textValue", void 0); WuiListContent = __decorate$L([ customElement("wui-list-content") ], WuiListContent); const styles$q = i$g` :host { display: flex; flex-direction: column; gap: var(--wui-spacing-l); padding: 17px 18px 17px var(--wui-spacing-m); width: 100%; background-color: var(--wui-gray-glass-002); border-radius: var(--wui-border-radius-xs); color: var(--wui-color-fg-250); } wui-image { width: var(--wui-icon-size-lg); height: var(--wui-icon-size-lg); border-radius: var(--wui-border-radius-3xl); } wui-icon { width: var(--wui-icon-size-lg); height: var(--wui-icon-size-lg); } `; var __decorate$K = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiListWalletTransaction = class WuiListWalletTransaction extends s$b { constructor() { super(...arguments); this.amount = ""; this.networkCurreny = ""; this.networkImageUrl = ""; this.receiverAddress = ""; } render() { return x$6` Sending ${this.amount} ${this.networkCurreny} ${this.templateNetworkVisual()} To `; } templateNetworkVisual() { if (this.networkImageUrl) { return x$6``; } return x$6``; } }; WuiListWalletTransaction.styles = [resetStyles, elementStyles, styles$q]; __decorate$K([ n$i() ], WuiListWalletTransaction.prototype, "amount", void 0); __decorate$K([ n$i() ], WuiListWalletTransaction.prototype, "networkCurreny", void 0); __decorate$K([ n$i() ], WuiListWalletTransaction.prototype, "networkImageUrl", void 0); __decorate$K([ n$i() ], WuiListWalletTransaction.prototype, "receiverAddress", void 0); WuiListWalletTransaction = __decorate$K([ customElement("wui-list-wallet-transaction") ], WuiListWalletTransaction); const styles$p = i$g` :host { display: grid; width: inherit; height: inherit; } `; var __decorate$J = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiGrid = class WuiGrid extends s$b { render() { 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(--wui-spacing-${this.columnGap})`}; row-gap: ${this.rowGap && `var(--wui-spacing-${this.rowGap})`}; gap: ${this.gap && `var(--wui-spacing-${this.gap})`}; padding-top: ${this.padding && UiHelperUtil.getSpacingStyles(this.padding, 0)}; padding-right: ${this.padding && UiHelperUtil.getSpacingStyles(this.padding, 1)}; padding-bottom: ${this.padding && UiHelperUtil.getSpacingStyles(this.padding, 2)}; padding-left: ${this.padding && UiHelperUtil.getSpacingStyles(this.padding, 3)}; margin-top: ${this.margin && UiHelperUtil.getSpacingStyles(this.margin, 0)}; margin-right: ${this.margin && UiHelperUtil.getSpacingStyles(this.margin, 1)}; margin-bottom: ${this.margin && UiHelperUtil.getSpacingStyles(this.margin, 2)}; margin-left: ${this.margin && UiHelperUtil.getSpacingStyles(this.margin, 3)}; `; return x$6``; } }; WuiGrid.styles = [resetStyles, styles$p]; __decorate$J([ n$i() ], WuiGrid.prototype, "gridTemplateRows", void 0); __decorate$J([ n$i() ], WuiGrid.prototype, "gridTemplateColumns", void 0); __decorate$J([ n$i() ], WuiGrid.prototype, "justifyItems", void 0); __decorate$J([ n$i() ], WuiGrid.prototype, "alignItems", void 0); __decorate$J([ n$i() ], WuiGrid.prototype, "justifyContent", void 0); __decorate$J([ n$i() ], WuiGrid.prototype, "alignContent", void 0); __decorate$J([ n$i() ], WuiGrid.prototype, "columnGap", void 0); __decorate$J([ n$i() ], WuiGrid.prototype, "rowGap", void 0); __decorate$J([ n$i() ], WuiGrid.prototype, "gap", void 0); __decorate$J([ n$i() ], WuiGrid.prototype, "padding", void 0); __decorate$J([ n$i() ], WuiGrid.prototype, "margin", void 0); WuiGrid = __decorate$J([ customElement("wui-grid") ], WuiGrid); const styles$o = i$g` :host { position: relative; display: flex; width: 100%; height: 1px; background-color: var(--wui-gray-glass-005); justify-content: center; align-items: center; } :host > wui-text { position: absolute; padding: 0px 10px; background-color: var(--wui-color-modal-bg); } `; var __decorate$I = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let WuiSeparator = class WuiSeparator extends s$b { constructor() { super(...arguments); this.text = ""; } render() { return x$6`${this.template()}`; } template() { if (this.text) { return x$6`${this.text}`; } return null; } }; WuiSeparator.styles = [resetStyles, styles$o]; __decorate$I([ n$i() ], WuiSeparator.prototype, "text", void 0); WuiSeparator = __decorate$I([ customElement("wui-separator") ], WuiSeparator); var dayjs_min = { exports: {} }; (function(module2, exports3) { !function(t2, e2) { module2.exports = e2(); }(commonjsGlobal, function() { var t2 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c2 = "month", f2 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|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, M2 = { 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(t3) { var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100; return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]"; } }, m2 = function(t3, e3, n3) { var r3 = String(t3); return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3; }, v2 = { s: m2, z: function(t3) { var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i3 = n3 % 60; return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0"); }, m: function t3(e3, n3) { if (e3.date() < n3.date()) return -t3(n3, e3); var r3 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i3 = e3.clone().add(r3, c2), s3 = n3 - i3 < 0, u3 = e3.clone().add(r3 + (s3 ? -1 : 1), c2); return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0); }, a: function(t3) { return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3); }, p: function(t3) { return { M: c2, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f2 }[t3] || String(t3 || "").toLowerCase().replace(/s$/, ""); }, u: function(t3) { return void 0 === t3; } }, g2 = "en", D2 = {}; D2[g2] = M2; var p2 = "$isDayjsObject", S2 = function(t3) { return t3 instanceof _2 || !(!t3 || !t3[p2]); }, w2 = function t3(e3, n3, r3) { var i3; if (!e3) return g2; if ("string" == typeof e3) { var s3 = e3.toLowerCase(); D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3); var u3 = e3.split("-"); if (!i3 && u3.length > 1) return t3(u3[0]); } else { var a3 = e3.name; D2[a3] = e3, i3 = a3; } return !r3 && i3 && (g2 = i3), i3 || !r3 && g2; }, O2 = function(t3, e3) { if (S2(t3)) return t3.clone(); var n3 = "object" == typeof e3 ? e3 : {}; return n3.date = t3, n3.args = arguments, new _2(n3); }, b2 = v2; b2.l = w2, b2.i = S2, b2.w = function(t3, e3) { return O2(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset }); }; var _2 = function() { function M3(t3) { this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true; } var m3 = M3.prototype; return m3.parse = function(t3) { this.$d = function(t4) { var e3 = t4.date, n3 = t4.utc; if (null === e3) return /* @__PURE__ */ new Date(NaN); if (b2.u(e3)) return /* @__PURE__ */ new Date(); if (e3 instanceof Date) return new Date(e3); if ("string" == typeof e3 && !/Z$/i.test(e3)) { var r3 = e3.match($2); if (r3) { var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3); return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3); } } return new Date(e3); }(t3), this.init(); }, m3.init = function() { var t3 = this.$d; this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds(); }, m3.$utils = function() { return b2; }, m3.isValid = function() { return !(this.$d.toString() === l2); }, m3.isSame = function(t3, e3) { var n3 = O2(t3); return this.startOf(e3) <= n3 && n3 <= this.endOf(e3); }, m3.isAfter = function(t3, e3) { return O2(t3) < this.startOf(e3); }, m3.isBefore = function(t3, e3) { return this.endOf(e3) < O2(t3); }, m3.$g = function(t3, e3, n3) { return b2.u(t3) ? this[e3] : this.set(n3, t3); }, m3.unix = function() { return Math.floor(this.valueOf() / 1e3); }, m3.valueOf = function() { return this.$d.getTime(); }, m3.startOf = function(t3, e3) { var n3 = this, r3 = !!b2.u(e3) || e3, f3 = b2.p(t3), l3 = function(t4, e4) { var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3); return r3 ? i3 : i3.endOf(a2); }, $3 = function(t4, e4) { return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3); }, y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : ""); switch (f3) { case h2: return r3 ? l3(1, 0) : l3(31, 11); case c2: return r3 ? l3(1, M4) : l3(0, M4 + 1); case o2: var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3; return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4); case a2: case d2: return $3(v3 + "Hours", 0); case u2: return $3(v3 + "Minutes", 1); case s2: return $3(v3 + "Seconds", 2); case i2: return $3(v3 + "Milliseconds", 3); default: return this.clone(); } }, m3.endOf = function(t3) { return this.startOf(t3, false); }, m3.$set = function(t3, e3) { var n3, o3 = b2.p(t3), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f3 + "Date", n3[d2] = f3 + "Date", n3[c2] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u2] = f3 + "Hours", n3[s2] = f3 + "Minutes", n3[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $3 = o3 === a2 ? this.$D + (e3 - this.$W) : e3; if (o3 === c2 || o3 === h2) { var y3 = this.clone().set(d2, 1); y3.$d[l3]($3), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d; } else l3 && this.$d[l3]($3); return this.init(), this; }, m3.set = function(t3, e3) { return this.clone().$set(t3, e3); }, m3.get = function(t3) { return this[b2.p(t3)](); }, m3.add = function(r3, f3) { var d3, l3 = this; r3 = Number(r3); var $3 = b2.p(f3), y3 = function(t3) { var e3 = O2(l3); return b2.w(e3.date(e3.date() + Math.round(t3 * r3)), l3); }; if ($3 === c2) return this.set(c2, this.$M + r3); if ($3 === h2) return this.set(h2, this.$y + r3); if ($3 === a2) return y3(1); if ($3 === o2) return y3(7); var M4 = (d3 = {}, d3[s2] = e2, d3[u2] = n2, d3[i2] = t2, d3)[$3] || 1, m4 = this.$d.getTime() + r3 * M4; return b2.w(m4, this); }, m3.subtract = function(t3, e3) { return this.add(-1 * t3, e3); }, m3.format = function(t3) { var e3 = this, n3 = this.$locale(); if (!this.isValid()) return n3.invalidDate || l2; var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = function(t4, n4, i4, s4) { return t4 && (t4[n4] || t4(e3, r3)) || i4[n4].slice(0, s4); }, d3 = function(t4) { return b2.s(s3 % 12 || 12, t4, "0"); }, $3 = f3 || function(t4, e4, n4) { var r4 = t4 < 12 ? "AM" : "PM"; return n4 ? r4.toLowerCase() : r4; }; return r3.replace(y2, function(t4, r4) { return r4 || function(t5) { switch (t5) { case "YY": return String(e3.$y).slice(-2); case "YYYY": return b2.s(e3.$y, 4, "0"); case "M": return a3 + 1; case "MM": return b2.s(a3 + 1, 2, "0"); case "MMM": return h3(n3.monthsShort, a3, c3, 3); case "MMMM": return h3(c3, a3); case "D": return e3.$D; case "DD": return b2.s(e3.$D, 2, "0"); case "d": return String(e3.$W); case "dd": return h3(n3.weekdaysMin, e3.$W, o3, 2); case "ddd": return h3(n3.weekdaysShort, e3.$W, o3, 3); case "dddd": return o3[e3.$W]; case "H": return String(s3); case "HH": return b2.s(s3, 2, "0"); case "h": return d3(1); case "hh": return d3(2); case "a": return $3(s3, u3, true); case "A": return $3(s3, u3, false); case "m": return String(u3); case "mm": return b2.s(u3, 2, "0"); case "s": return String(e3.$s); case "ss": return b2.s(e3.$s, 2, "0"); case "SSS": return b2.s(e3.$ms, 3, "0"); case "Z": return i3; } return null; }(t4) || i3.replace(":", ""); }); }, m3.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); }, m3.diff = function(r3, d3, l3) { var $3, y3 = this, M4 = b2.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e2, g3 = this - m4, D3 = function() { return b2.m(y3, m4); }; switch (M4) { case h2: $3 = D3() / 12; break; case c2: $3 = D3(); break; case f2: $3 = D3() / 3; break; case o2: $3 = (g3 - v3) / 6048e5; break; case a2: $3 = (g3 - v3) / 864e5; break; case u2: $3 = g3 / n2; break; case s2: $3 = g3 / e2; break; case i2: $3 = g3 / t2; break; default: $3 = g3; } return l3 ? $3 : b2.a($3); }, m3.daysInMonth = function() { return this.endOf(c2).$D; }, m3.$locale = function() { return D2[this.$L]; }, m3.locale = function(t3, e3) { if (!t3) return this.$L; var n3 = this.clone(), r3 = w2(t3, e3, true); return r3 && (n3.$L = r3), n3; }, m3.clone = function() { return b2.w(this.$d, this); }, m3.toDate = function() { return new Date(this.valueOf()); }, m3.toJSON = function() { return this.isValid() ? this.toISOString() : null; }, m3.toISOString = function() { return this.$d.toISOString(); }, m3.toString = function() { return this.$d.toUTCString(); }, M3; }(), k2 = _2.prototype; return O2.prototype = k2, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) { k2[t3[1]] = function(e3) { return this.$g(e3, t3[0], t3[1]); }; }), O2.extend = function(t3, e3) { return t3.$i || (t3(e3, _2, O2), t3.$i = true), O2; }, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) { return O2(1e3 * t3); }, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2; }); })(dayjs_min); var dayjs_minExports = dayjs_min.exports; const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports); var updateLocale$1 = { exports: {} }; (function(module2, exports3) { !function(e2, n2) { module2.exports = n2(); }(commonjsGlobal, function() { return function(e2, n2, t2) { t2.updateLocale = function(e3, n3) { var o2 = t2.Ls[e3]; if (o2) return (n3 ? Object.keys(n3) : []).forEach(function(e4) { o2[e4] = n3[e4]; }), o2; }; }; }); })(updateLocale$1); var updateLocaleExports = updateLocale$1.exports; const updateLocale = /* @__PURE__ */ getDefaultExportFromCjs(updateLocaleExports); var relativeTime$1 = { exports: {} }; (function(module2, exports3) { !function(r2, e2) { module2.exports = e2(); }(commonjsGlobal, function() { return function(r2, e2, t2) { r2 = r2 || {}; var n2 = e2.prototype, o2 = { 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 i2(r3, e3, t3, o3) { return n2.fromToBase(r3, e3, t3, o3); } t2.en.relativeTime = o2, n2.fromToBase = function(e3, n3, i3, d3, u2) { for (var f2, a2, s2, l2 = i3.$locale().relativeTime || o2, h2 = r2.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" }], m2 = h2.length, c2 = 0; c2 < m2; c2 += 1) { var y2 = h2[c2]; y2.d && (f2 = d3 ? t2(e3).diff(i3, y2.d, true) : i3.diff(e3, y2.d, true)); var p2 = (r2.rounding || Math.round)(Math.abs(f2)); if (s2 = f2 > 0, p2 <= y2.r || !y2.r) { p2 <= 1 && c2 > 0 && (y2 = h2[c2 - 1]); var v2 = l2[y2.l]; u2 && (p2 = u2("" + p2)), a2 = "string" == typeof v2 ? v2.replace("%d", p2) : v2(p2, n3, y2.l, s2); break; } } if (n3) return a2; var M2 = s2 ? l2.future : l2.past; return "function" == typeof M2 ? M2(a2) : M2.replace("%s", a2); }, n2.to = function(r3, e3) { return i2(r3, e3, this, true); }, n2.from = function(r3, e3) { return i2(r3, e3, this); }; var d2 = function(r3) { return r3.$u ? t2.utc() : t2(); }; n2.toNow = function(r3) { return this.to(d2(this), r3); }, n2.fromNow = function(r3) { return this.from(d2(this), r3); }; }; }); })(relativeTime$1); var relativeTimeExports = relativeTime$1.exports; const relativeTime = /* @__PURE__ */ getDefaultExportFromCjs(relativeTimeExports); dayjs.extend(relativeTime); dayjs.extend(updateLocale); dayjs.updateLocale("en", { relativeTime: { future: "in %s", past: "%s ago", s: "%s 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" } }); const DateUtil = { getYear(date2 = (/* @__PURE__ */ new Date()).toISOString()) { return dayjs(date2).year(); }, getRelativeDateFromNow(date2) { return dayjs(date2).fromNow(true); } }; const FLOAT_FIXED_VALUE = 3; const plusTypes = ["receive", "deposit", "borrow", "claim"]; const minusTypes = ["withdraw", "repay", "burn"]; const TransactionUtil = { getTransactionGroupTitle(year) { const currentYear = DateUtil.getYear(); const isCurrentYear = year === currentYear; const groupTitle = isCurrentYear ? "This Year" : year; return groupTitle; }, getTransactionImages(transfers) { const [transfer, secondTransfer] = transfers; const isAllNFT = Boolean(transfer) && (transfers == null ? void 0 : transfers.every((item) => Boolean(item.nft_info))); const haveMultipleTransfers = (transfers == null ? void 0 : transfers.length) > 1; const haveTwoTransfers = (transfers == null ? void 0 : transfers.length) === 2; if (haveTwoTransfers && !isAllNFT) { return [this.getTransactionImage(transfer), this.getTransactionImage(secondTransfer)]; } if (haveMultipleTransfers) { return transfers.map((item) => this.getTransactionImage(item)); } return [this.getTransactionImage(transfer)]; }, getTransactionImage(transfer) { return { type: TransactionUtil.getTransactionTransferTokenType(transfer), url: TransactionUtil.getTransactionImageURL(transfer) }; }, getTransactionImageURL(transfer) { var _a2, _b2, _c2, _d, _e2; let imageURL = null; const isNFT = Boolean(transfer == null ? void 0 : transfer.nft_info); const isFungible = Boolean(transfer == null ? void 0 : transfer.fungible_info); if (transfer && isNFT) { imageURL = (_c2 = (_b2 = (_a2 = transfer == null ? void 0 : transfer.nft_info) == null ? void 0 : _a2.content) == null ? void 0 : _b2.preview) == null ? void 0 : _c2.url; } else if (transfer && isFungible) { imageURL = (_e2 = (_d = transfer == null ? void 0 : transfer.fungible_info) == null ? void 0 : _d.icon) == null ? void 0 : _e2.url; } return imageURL; }, getTransactionTransferTokenType(transfer) { if (transfer == null ? void 0 : transfer.fungible_info) { return "FUNGIBLE"; } else if (transfer == null ? void 0 : transfer.nft_info) { return "NFT"; } return null; }, getTransactionDescriptions(transaction) { var _a2, _b2, _c2; const type2 = (_a2 = transaction.metadata) == null ? void 0 : _a2.operationType; const transfers = transaction.transfers; const haveTransfer = ((_b2 = transaction.transfers) == null ? void 0 : _b2.length) > 0; const haveMultipleTransfers = ((_c2 = transaction.transfers) == null ? void 0 : _c2.length) > 1; const isFungible = haveTransfer && (transfers == null ? void 0 : transfers.every((transfer) => Boolean(transfer.fungible_info))); const [firstTransfer, secondTransfer] = transfers; let firstDescription = this.getTransferDescription(firstTransfer); let secondDescription = this.getTransferDescription(secondTransfer); if (!haveTransfer) { const isSendOrReceive = type2 === "send" || type2 === "receive"; if (isSendOrReceive && isFungible) { firstDescription = UiHelperUtil.getTruncateString({ string: transaction.metadata.sentFrom, charsStart: 4, charsEnd: 6, truncate: "middle" }); secondDescription = UiHelperUtil.getTruncateString({ string: transaction.metadata.sentTo, charsStart: 4, charsEnd: 6, truncate: "middle" }); return [firstDescription, secondDescription]; } return [transaction.metadata.status]; } if (haveMultipleTransfers) { return transfers.map((item) => this.getTransferDescription(item)); } let prefix = ""; if (plusTypes.includes(type2)) { prefix = "+"; } else if (minusTypes.includes(type2)) { prefix = "-"; } firstDescription = prefix.concat(firstDescription); return [firstDescription]; }, getTransferDescription(transfer) { var _a2; let description = ""; if (!transfer) { return description; } if (transfer == null ? void 0 : transfer.nft_info) { description = ((_a2 = transfer == null ? void 0 : transfer.nft_info) == null ? void 0 : _a2.name) || "-"; } else if (transfer == null ? void 0 : transfer.fungible_info) { description = this.getFungibleTransferDescription(transfer) || "-"; } return description; }, getFungibleTransferDescription(transfer) { var _a2; if (!transfer) { return null; } const quantity = this.getQuantityFixedValue(transfer == null ? void 0 : transfer.quantity.numeric); const description = [quantity, (_a2 = transfer == null ? void 0 : transfer.fungible_info) == null ? void 0 : _a2.symbol].join(" ").trim(); return description; }, getQuantityFixedValue(value) { if (!value) { return null; } const parsedValue = parseFloat(value); return parsedValue.toFixed(FLOAT_FIXED_VALUE); } }; const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, TransactionUtil, UiHelperUtil, get WuiAccountButton() { return WuiAccountButton; }, get WuiAllWalletsImage() { return WuiAllWalletsImage; }, get WuiAvatar() { return WuiAvatar; }, get WuiButton() { return WuiButton; }, get WuiCard() { return WuiCard; }, get WuiCardSelect() { return WuiCardSelect; }, get WuiCardSelectLoader() { return WuiCardSelectLoader; }, get WuiChip() { return WuiChip; }, get WuiConnectButton() { return WuiConnectButton; }, get WuiCtaButton() { return WuiCtaButton; }, get WuiEmailInput() { return WuiEmailInput; }, get WuiFlex() { return WuiFlex; }, get WuiGrid() { return WuiGrid; }, get WuiIcon() { return WuiIcon; }, get WuiIconBox() { return WuiIconBox; }, get WuiIconLink() { return WuiIconLink; }, get WuiImage() { return WuiImage; }, get WuiInputElement() { return WuiInputElement; }, get WuiInputNumeric() { return WuiInputNumeric; }, get WuiInputText() { return WuiInputText; }, get WuiLink() { return WuiLink; }, get WuiListAccordion() { return WuiListAccordion; }, get WuiListContent() { return WuiListContent; }, get WuiListItem() { return WuiListItem; }, get WuiListWallet() { return WuiListWallet; }, get WuiListWalletTransaction() { return WuiListWalletTransaction; }, get WuiLoadingHexagon() { return WuiLoadingHexagon; }, get WuiLoadingSpinner() { return WuiLoadingSpinner; }, get WuiLoadingThumbnail() { return WuiLoadingThumbnail; }, get WuiLogo() { return WuiLogo; }, get WuiLogoSelect() { return WuiLogoSelect; }, get WuiNetworkButton() { return WuiNetworkButton; }, get WuiNetworkImage() { return WuiNetworkImage; }, get WuiNoticeCard() { return WuiNoticeCard; }, get WuiOtp() { return WuiOtp; }, get WuiQrCode() { return WuiQrCode; }, get WuiSearchBar() { return WuiSearchBar; }, get WuiSeparator() { return WuiSeparator; }, get WuiShimmer() { return WuiShimmer; }, get WuiSnackbar() { return WuiSnackbar; }, get WuiTabs() { return WuiTabs; }, get WuiTag() { return WuiTag; }, get WuiText() { return WuiText; }, get WuiTooltip() { return WuiTooltip; }, get WuiTransactionListItem() { return WuiTransactionListItem; }, get WuiTransactionListItemLoader() { return WuiTransactionListItemLoader; }, get WuiTransactionVisual() { return WuiTransactionVisual; }, get WuiVisual() { return WuiVisual; }, get WuiVisualThumbnail() { return WuiVisualThumbnail; }, get WuiWalletImage() { return WuiWalletImage; }, customElement, initializeTheming, setColorTheme, setThemeVariables }, Symbol.toStringTag, { value: "Module" })); /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t$a = globalThis, e$d = t$a.ShadowRoot && (void 0 === t$a.ShadyCSS || t$a.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$9 = Symbol(), o$f = /* @__PURE__ */ new WeakMap(); let n$f = class n { constructor(t2, e2, o2) { if (this._$cssResult$ = true, o2 !== s$9) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); this.cssText = t2, this.t = e2; } get styleSheet() { let t2 = this.o; const s2 = this.t; if (e$d && void 0 === t2) { const e2 = void 0 !== s2 && 1 === s2.length; e2 && (t2 = o$f.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && o$f.set(s2, t2)); } return t2; } toString() { return this.cssText; } }; const r$e = (t2) => new n$f("string" == typeof t2 ? t2 : t2 + "", void 0, s$9), i$c = (t2, ...e2) => { const o2 = 1 === t2.length ? t2[0] : e2.reduce((e3, s2, o3) => e3 + ((t3) => { if (true === t3._$cssResult$) return t3.cssText; if ("number" == typeof t3) return t3; throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); })(s2) + t2[o3 + 1], t2[0]); return new n$f(o2, t2, s$9); }, S$a = (s2, o2) => { if (e$d) s2.adoptedStyleSheets = o2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); else for (const e2 of o2) { const o3 = document.createElement("style"), n2 = t$a.litNonce; void 0 !== n2 && o3.setAttribute("nonce", n2), o3.textContent = e2.cssText, s2.appendChild(o3); } }, c$c = e$d ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { let e2 = ""; for (const s2 of t3.cssRules) e2 += s2.cssText; return r$e(e2); })(t2) : t2; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const { is: i$b, defineProperty: e$c, getOwnPropertyDescriptor: r$d, getOwnPropertyNames: h$c, getOwnPropertySymbols: o$e, getPrototypeOf: n$e } = Object, a$8 = globalThis, c$b = a$8.trustedTypes, l$9 = c$b ? c$b.emptyScript : "", p$a = a$8.reactiveElementPolyfillSupport, d$9 = (t2, s2) => t2, u$7 = { toAttribute(t2, s2) { switch (s2) { case Boolean: t2 = t2 ? l$9 : null; break; case Object: case Array: t2 = null == t2 ? t2 : JSON.stringify(t2); } return t2; }, fromAttribute(t2, s2) { let i2 = t2; switch (s2) { case Boolean: i2 = null !== t2; break; case Number: i2 = null === t2 ? null : Number(t2); break; case Object: case Array: try { i2 = JSON.parse(t2); } catch (t3) { i2 = null; } } return i2; } }, f$a = (t2, s2) => !i$b(t2, s2), y$9 = { attribute: true, type: String, converter: u$7, reflect: false, hasChanged: f$a }; Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), a$8.litPropertyMetadata ?? (a$8.litPropertyMetadata = /* @__PURE__ */ new WeakMap()); let b$7 = class b extends HTMLElement { static addInitializer(t2) { this._$Ei(), (this.l ?? (this.l = [])).push(t2); } static get observedAttributes() { return this.finalize(), this._$Eh && [...this._$Eh.keys()]; } static createProperty(t2, s2 = y$9) { if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { const i2 = Symbol(), r2 = this.getPropertyDescriptor(t2, i2, s2); void 0 !== r2 && e$c(this.prototype, t2, r2); } } static getPropertyDescriptor(t2, s2, i2) { const { get: e2, set: h2 } = r$d(this.prototype, t2) ?? { get() { return this[s2]; }, set(t3) { this[s2] = t3; } }; return { get() { return e2 == null ? void 0 : e2.call(this); }, set(s3) { const r2 = e2 == null ? void 0 : e2.call(this); h2.call(this, s3), this.requestUpdate(t2, r2, i2); }, configurable: true, enumerable: true }; } static getPropertyOptions(t2) { return this.elementProperties.get(t2) ?? y$9; } static _$Ei() { if (this.hasOwnProperty(d$9("elementProperties"))) return; const t2 = n$e(this); t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); } static finalize() { if (this.hasOwnProperty(d$9("finalized"))) return; if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$9("properties"))) { const t3 = this.properties, s2 = [...h$c(t3), ...o$e(t3)]; for (const i2 of s2) this.createProperty(i2, t3[i2]); } const t2 = this[Symbol.metadata]; if (null !== t2) { const s2 = litPropertyMetadata.get(t2); if (void 0 !== s2) for (const [t3, i2] of s2) this.elementProperties.set(t3, i2); } this._$Eh = /* @__PURE__ */ new Map(); for (const [t3, s2] of this.elementProperties) { const i2 = this._$Eu(t3, s2); void 0 !== i2 && this._$Eh.set(i2, t3); } this.elementStyles = this.finalizeStyles(this.styles); } static finalizeStyles(s2) { const i2 = []; if (Array.isArray(s2)) { const e2 = new Set(s2.flat(1 / 0).reverse()); for (const s3 of e2) i2.unshift(c$c(s3)); } else void 0 !== s2 && i2.push(c$c(s2)); return i2; } static _$Eu(t2, s2) { const i2 = s2.attribute; return false === i2 ? void 0 : "string" == typeof i2 ? i2 : "string" == typeof t2 ? t2.toLowerCase() : void 0; } constructor() { super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); } _$Ev() { var _a2; this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (_a2 = this.constructor.l) == null ? void 0 : _a2.forEach((t2) => t2(this)); } addController(t2) { var _a2; (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t2), void 0 !== this.renderRoot && this.isConnected && ((_a2 = t2.hostConnected) == null ? void 0 : _a2.call(t2)); } removeController(t2) { var _a2; (_a2 = this._$EO) == null ? void 0 : _a2.delete(t2); } _$E_() { const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; for (const i2 of s2.keys()) this.hasOwnProperty(i2) && (t2.set(i2, this[i2]), delete this[i2]); t2.size > 0 && (this._$Ep = t2); } createRenderRoot() { const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); return S$a(t2, this.constructor.elementStyles), t2; } connectedCallback() { var _a2; this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), (_a2 = this._$EO) == null ? void 0 : _a2.forEach((t2) => { var _a3; return (_a3 = t2.hostConnected) == null ? void 0 : _a3.call(t2); }); } enableUpdating(t2) { } disconnectedCallback() { var _a2; (_a2 = this._$EO) == null ? void 0 : _a2.forEach((t2) => { var _a3; return (_a3 = t2.hostDisconnected) == null ? void 0 : _a3.call(t2); }); } attributeChangedCallback(t2, s2, i2) { this._$AK(t2, i2); } _$EC(t2, s2) { var _a2; const i2 = this.constructor.elementProperties.get(t2), e2 = this.constructor._$Eu(t2, i2); if (void 0 !== e2 && true === i2.reflect) { const r2 = (void 0 !== ((_a2 = i2.converter) == null ? void 0 : _a2.toAttribute) ? i2.converter : u$7).toAttribute(s2, i2.type); this._$Em = t2, null == r2 ? this.removeAttribute(e2) : this.setAttribute(e2, r2), this._$Em = null; } } _$AK(t2, s2) { var _a2; const i2 = this.constructor, e2 = i2._$Eh.get(t2); if (void 0 !== e2 && this._$Em !== e2) { const t3 = i2.getPropertyOptions(e2), r2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== ((_a2 = t3.converter) == null ? void 0 : _a2.fromAttribute) ? t3.converter : u$7; this._$Em = e2, this[e2] = r2.fromAttribute(s2, t3.type), this._$Em = null; } } requestUpdate(t2, s2, i2) { if (void 0 !== t2) { if (i2 ?? (i2 = this.constructor.getPropertyOptions(t2)), !(i2.hasChanged ?? f$a)(this[t2], s2)) return; this.P(t2, s2, i2); } false === this.isUpdatePending && (this._$ES = this._$ET()); } P(t2, s2, i2) { this._$AL.has(t2) || this._$AL.set(t2, s2), true === i2.reflect && this._$Em !== t2 && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t2); } async _$ET() { this.isUpdatePending = true; try { await this._$ES; } catch (t3) { Promise.reject(t3); } const t2 = this.scheduleUpdate(); return null != t2 && await t2, !this.isUpdatePending; } scheduleUpdate() { return this.performUpdate(); } performUpdate() { var _a2; if (!this.isUpdatePending) return; if (!this.hasUpdated) { if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) { for (const [t4, s3] of this._$Ep) this[t4] = s3; this._$Ep = void 0; } const t3 = this.constructor.elementProperties; if (t3.size > 0) for (const [s3, i2] of t3) true !== i2.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i2); } let t2 = false; const s2 = this._$AL; try { t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), (_a2 = this._$EO) == null ? void 0 : _a2.forEach((t3) => { var _a3; return (_a3 = t3.hostUpdate) == null ? void 0 : _a3.call(t3); }), this.update(s2)) : this._$EU(); } catch (s3) { throw t2 = false, this._$EU(), s3; } t2 && this._$AE(s2); } willUpdate(t2) { } _$AE(t2) { var _a2; (_a2 = this._$EO) == null ? void 0 : _a2.forEach((t3) => { var _a3; return (_a3 = t3.hostUpdated) == null ? void 0 : _a3.call(t3); }), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); } _$EU() { this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; } get updateComplete() { return this.getUpdateComplete(); } getUpdateComplete() { return this._$ES; } shouldUpdate(t2) { return true; } update(t2) { this._$Ej && (this._$Ej = this._$Ej.forEach((t3) => this._$EC(t3, this[t3]))), this._$EU(); } updated(t2) { } firstUpdated(t2) { } }; b$7.elementStyles = [], b$7.shadowRootOptions = { mode: "open" }, b$7[d$9("elementProperties")] = /* @__PURE__ */ new Map(), b$7[d$9("finalized")] = /* @__PURE__ */ new Map(), p$a == null ? void 0 : p$a({ ReactiveElement: b$7 }), (a$8.reactiveElementVersions ?? (a$8.reactiveElementVersions = [])).push("2.0.4"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t$9 = globalThis, i$a = t$9.trustedTypes, s$8 = i$a ? i$a.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, e$b = "$lit$", h$b = `lit$${Math.random().toFixed(9).slice(2)}$`, o$d = "?" + h$b, n$d = `<${o$d}>`, r$c = document, l$8 = () => r$c.createComment(""), c$a = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, a$7 = Array.isArray, u$6 = (t2) => a$7(t2) || "function" == typeof (t2 == null ? void 0 : t2[Symbol.iterator]), d$8 = "[ \n\f\r]", f$9 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v$9 = /-->/g, _$9 = />/g, m$6 = RegExp(`>|${d$8}(?:([^\\s"'>=/]+)(${d$8}*=${d$8}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"), p$9 = /'/g, g$a = /"/g, $$6 = /^(?:script|style|textarea|title)$/i, y$8 = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), x$5 = y$8(1), w$a = Symbol.for("lit-noChange"), T$8 = Symbol.for("lit-nothing"), A$6 = /* @__PURE__ */ new WeakMap(), E$8 = r$c.createTreeWalker(r$c, 129); function C$6(t2, i2) { if (!Array.isArray(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); return void 0 !== s$8 ? s$8.createHTML(i2) : i2; } const P$6 = (t2, i2) => { const s2 = t2.length - 1, o2 = []; let r2, l2 = 2 === i2 ? "" : "", c2 = f$9; for (let i3 = 0; i3 < s2; i3++) { const s3 = t2[i3]; let a2, u2, d2 = -1, y2 = 0; for (; y2 < s3.length && (c2.lastIndex = y2, u2 = c2.exec(s3), null !== u2); ) y2 = c2.lastIndex, c2 === f$9 ? "!--" === u2[1] ? c2 = v$9 : void 0 !== u2[1] ? c2 = _$9 : void 0 !== u2[2] ? ($$6.test(u2[2]) && (r2 = RegExp("" === u2[0] ? (c2 = r2 ?? f$9, d2 = -1) : void 0 === u2[1] ? d2 = -2 : (d2 = c2.lastIndex - u2[2].length, a2 = u2[1], c2 = void 0 === u2[3] ? m$6 : '"' === u2[3] ? g$a : p$9) : c2 === g$a || c2 === p$9 ? c2 = m$6 : c2 === v$9 || c2 === _$9 ? c2 = f$9 : (c2 = m$6, r2 = void 0); const x2 = c2 === m$6 && t2[i3 + 1].startsWith("/>") ? " " : ""; l2 += c2 === f$9 ? s3 + n$d : d2 >= 0 ? (o2.push(a2), s3.slice(0, d2) + e$b + s3.slice(d2) + h$b + x2) : s3 + h$b + (-2 === d2 ? i3 : x2); } return [C$6(t2, l2 + (t2[s2] || "") + (2 === i2 ? "" : "")), o2]; }; let V$7 = class V2 { constructor({ strings: t2, _$litType$: s2 }, n2) { let r2; this.parts = []; let c2 = 0, a2 = 0; const u2 = t2.length - 1, d2 = this.parts, [f2, v2] = P$6(t2, s2); if (this.el = V2.createElement(f2, n2), E$8.currentNode = this.el.content, 2 === s2) { const t3 = this.el.content.firstChild; t3.replaceWith(...t3.childNodes); } for (; null !== (r2 = E$8.nextNode()) && d2.length < u2; ) { if (1 === r2.nodeType) { if (r2.hasAttributes()) for (const t3 of r2.getAttributeNames()) if (t3.endsWith(e$b)) { const i2 = v2[a2++], s3 = r2.getAttribute(t3).split(h$b), e2 = /([.?@])?(.*)/.exec(i2); d2.push({ type: 1, index: c2, name: e2[2], strings: s3, ctor: "." === e2[1] ? k$7 : "?" === e2[1] ? H$5 : "@" === e2[1] ? I$4 : R$4 }), r2.removeAttribute(t3); } else t3.startsWith(h$b) && (d2.push({ type: 6, index: c2 }), r2.removeAttribute(t3)); if ($$6.test(r2.tagName)) { const t3 = r2.textContent.split(h$b), s3 = t3.length - 1; if (s3 > 0) { r2.textContent = i$a ? i$a.emptyScript : ""; for (let i2 = 0; i2 < s3; i2++) r2.append(t3[i2], l$8()), E$8.nextNode(), d2.push({ type: 2, index: ++c2 }); r2.append(t3[s3], l$8()); } } } else if (8 === r2.nodeType) if (r2.data === o$d) d2.push({ type: 2, index: c2 }); else { let t3 = -1; for (; -1 !== (t3 = r2.data.indexOf(h$b, t3 + 1)); ) d2.push({ type: 7, index: c2 }), t3 += h$b.length - 1; } c2++; } } static createElement(t2, i2) { const s2 = r$c.createElement("template"); return s2.innerHTML = t2, s2; } }; function N$6(t2, i2, s2 = t2, e2) { var _a2, _b2; if (i2 === w$a) return i2; let h2 = void 0 !== e2 ? (_a2 = s2._$Co) == null ? void 0 : _a2[e2] : s2._$Cl; const o2 = c$a(i2) ? void 0 : i2._$litDirective$; return (h2 == null ? void 0 : h2.constructor) !== o2 && ((_b2 = h2 == null ? void 0 : h2._$AO) == null ? void 0 : _b2.call(h2, false), void 0 === o2 ? h2 = void 0 : (h2 = new o2(t2), h2._$AT(t2, s2, e2)), void 0 !== e2 ? (s2._$Co ?? (s2._$Co = []))[e2] = h2 : s2._$Cl = h2), void 0 !== h2 && (i2 = N$6(t2, h2._$AS(t2, i2.values), h2, e2)), i2; } let S$9 = class S { constructor(t2, i2) { this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2; } get parentNode() { return this._$AM.parentNode; } get _$AU() { return this._$AM._$AU; } u(t2) { const { el: { content: i2 }, parts: s2 } = this._$AD, e2 = ((t2 == null ? void 0 : t2.creationScope) ?? r$c).importNode(i2, true); E$8.currentNode = e2; let h2 = E$8.nextNode(), o2 = 0, n2 = 0, l2 = s2[0]; for (; void 0 !== l2; ) { if (o2 === l2.index) { let i3; 2 === l2.type ? i3 = new M$5(h2, h2.nextSibling, this, t2) : 1 === l2.type ? i3 = new l2.ctor(h2, l2.name, l2.strings, this, t2) : 6 === l2.type && (i3 = new L$7(h2, this, t2)), this._$AV.push(i3), l2 = s2[++n2]; } o2 !== (l2 == null ? void 0 : l2.index) && (h2 = E$8.nextNode(), o2++); } return E$8.currentNode = r$c, e2; } p(t2) { let i2 = 0; for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i2), i2 += s2.strings.length - 2) : s2._$AI(t2[i2])), i2++; } }; let M$5 = class M2 { get _$AU() { var _a2; return ((_a2 = this._$AM) == null ? void 0 : _a2._$AU) ?? this._$Cv; } constructor(t2, i2, s2, e2) { this.type = 2, this._$AH = T$8, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$Cv = (e2 == null ? void 0 : e2.isConnected) ?? true; } get parentNode() { let t2 = this._$AA.parentNode; const i2 = this._$AM; return void 0 !== i2 && 11 === (t2 == null ? void 0 : t2.nodeType) && (t2 = i2.parentNode), t2; } get startNode() { return this._$AA; } get endNode() { return this._$AB; } _$AI(t2, i2 = this) { t2 = N$6(this, t2, i2), c$a(t2) ? t2 === T$8 || null == t2 || "" === t2 ? (this._$AH !== T$8 && this._$AR(), this._$AH = T$8) : t2 !== this._$AH && t2 !== w$a && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : u$6(t2) ? this.k(t2) : this._(t2); } S(t2) { return this._$AA.parentNode.insertBefore(t2, this._$AB); } T(t2) { this._$AH !== t2 && (this._$AR(), this._$AH = this.S(t2)); } _(t2) { this._$AH !== T$8 && c$a(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(r$c.createTextNode(t2)), this._$AH = t2; } $(t2) { var _a2; const { values: i2, _$litType$: s2 } = t2, e2 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = V$7.createElement(C$6(s2.h, s2.h[0]), this.options)), s2); if (((_a2 = this._$AH) == null ? void 0 : _a2._$AD) === e2) this._$AH.p(i2); else { const t3 = new S$9(e2, this), s3 = t3.u(this.options); t3.p(i2), this.T(s3), this._$AH = t3; } } _$AC(t2) { let i2 = A$6.get(t2.strings); return void 0 === i2 && A$6.set(t2.strings, i2 = new V$7(t2)), i2; } k(t2) { a$7(this._$AH) || (this._$AH = [], this._$AR()); const i2 = this._$AH; let s2, e2 = 0; for (const h2 of t2) e2 === i2.length ? i2.push(s2 = new M2(this.S(l$8()), this.S(l$8()), this, this.options)) : s2 = i2[e2], s2._$AI(h2), e2++; e2 < i2.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i2.length = e2); } _$AR(t2 = this._$AA.nextSibling, i2) { var _a2; for ((_a2 = this._$AP) == null ? void 0 : _a2.call(this, false, true, i2); t2 && t2 !== this._$AB; ) { const i3 = t2.nextSibling; t2.remove(), t2 = i3; } } setConnected(t2) { var _a2; void 0 === this._$AM && (this._$Cv = t2, (_a2 = this._$AP) == null ? void 0 : _a2.call(this, t2)); } }; let R$4 = class R { get tagName() { return this.element.tagName; } get _$AU() { return this._$AM._$AU; } constructor(t2, i2, s2, e2, h2) { this.type = 1, this._$AH = T$8, this._$AN = void 0, this.element = t2, this.name = i2, this._$AM = e2, this.options = h2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = T$8; } _$AI(t2, i2 = this, s2, e2) { const h2 = this.strings; let o2 = false; if (void 0 === h2) t2 = N$6(this, t2, i2, 0), o2 = !c$a(t2) || t2 !== this._$AH && t2 !== w$a, o2 && (this._$AH = t2); else { const e3 = t2; let n2, r2; for (t2 = h2[0], n2 = 0; n2 < h2.length - 1; n2++) r2 = N$6(this, e3[s2 + n2], i2, n2), r2 === w$a && (r2 = this._$AH[n2]), o2 || (o2 = !c$a(r2) || r2 !== this._$AH[n2]), r2 === T$8 ? t2 = T$8 : t2 !== T$8 && (t2 += (r2 ?? "") + h2[n2 + 1]), this._$AH[n2] = r2; } o2 && !e2 && this.j(t2); } j(t2) { t2 === T$8 ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); } }; let k$7 = class k extends R$4 { constructor() { super(...arguments), this.type = 3; } j(t2) { this.element[this.name] = t2 === T$8 ? void 0 : t2; } }; let H$5 = class H extends R$4 { constructor() { super(...arguments), this.type = 4; } j(t2) { this.element.toggleAttribute(this.name, !!t2 && t2 !== T$8); } }; let I$4 = class I extends R$4 { constructor(t2, i2, s2, e2, h2) { super(t2, i2, s2, e2, h2), this.type = 5; } _$AI(t2, i2 = this) { if ((t2 = N$6(this, t2, i2, 0) ?? T$8) === w$a) return; const s2 = this._$AH, e2 = t2 === T$8 && s2 !== T$8 || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h2 = t2 !== T$8 && (s2 === T$8 || e2); e2 && this.element.removeEventListener(this.name, this, s2), h2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; } handleEvent(t2) { var _a2; "function" == typeof this._$AH ? this._$AH.call(((_a2 = this.options) == null ? void 0 : _a2.host) ?? this.element, t2) : this._$AH.handleEvent(t2); } }; let L$7 = class L { constructor(t2, i2, s2) { this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i2, this.options = s2; } get _$AU() { return this._$AM._$AU; } _$AI(t2) { N$6(this, t2); } }; const Z$5 = t$9.litHtmlPolyfillSupport; Z$5 == null ? void 0 : Z$5(V$7, M$5), (t$9.litHtmlVersions ?? (t$9.litHtmlVersions = [])).push("3.1.3"); const j$8 = (t2, i2, s2) => { const e2 = (s2 == null ? void 0 : s2.renderBefore) ?? i2; let h2 = e2._$litPart$; if (void 0 === h2) { const t3 = (s2 == null ? void 0 : s2.renderBefore) ?? null; e2._$litPart$ = h2 = new M$5(i2.insertBefore(l$8(), t3), t3, void 0, s2 ?? {}); } return h2._$AI(t2), h2; }; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ let s$7 = class s extends b$7 { constructor() { super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; } createRenderRoot() { var _a2; const t2 = super.createRenderRoot(); return (_a2 = this.renderOptions).renderBefore ?? (_a2.renderBefore = t2.firstChild), t2; } update(t2) { const i2 = this.render(); this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = j$8(i2, this.renderRoot, this.renderOptions); } connectedCallback() { var _a2; super.connectedCallback(), (_a2 = this._$Do) == null ? void 0 : _a2.setConnected(true); } disconnectedCallback() { var _a2; super.disconnectedCallback(), (_a2 = this._$Do) == null ? void 0 : _a2.setConnected(false); } render() { return w$a; } }; s$7._$litElement$ = true, s$7["finalized"] = true, (_b = globalThis.litElementHydrateSupport) == null ? void 0 : _b.call(globalThis, { LitElement: s$7 }); const r$b = globalThis.litElementPolyfillSupport; r$b == null ? void 0 : r$b({ LitElement: s$7 }); (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.5"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const o$c = { attribute: true, type: String, converter: u$7, reflect: false, hasChanged: f$a }, r$a = (t2 = o$c, e2, r2) => { const { kind: n2, metadata: i2 } = r2; let s2 = globalThis.litPropertyMetadata.get(i2); if (void 0 === s2 && globalThis.litPropertyMetadata.set(i2, s2 = /* @__PURE__ */ new Map()), s2.set(r2.name, t2), "accessor" === n2) { const { name: o2 } = r2; return { set(r3) { const n3 = e2.get.call(this); e2.set.call(this, r3), this.requestUpdate(o2, n3, t2); }, init(e3) { return void 0 !== e3 && this.P(o2, void 0, t2), e3; } }; } if ("setter" === n2) { const { name: o2 } = r2; return function(r3) { const n3 = this[o2]; e2.call(this, r3), this.requestUpdate(o2, n3, t2); }; } throw Error("Unsupported decorator location: " + n2); }; function n$c(t2) { return (e2, o2) => "object" == typeof o2 ? r$a(t2, e2, o2) : ((t3, e3, o3) => { const r2 = e3.hasOwnProperty(o3); return e3.constructor.createProperty(o3, r2 ? { ...t3, wrapped: true } : t3), r2 ? Object.getOwnPropertyDescriptor(e3, o3) : void 0; })(t2, e2, o2); } /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ function r$9(r2) { return n$c({ ...r2, state: true, attribute: false }); } /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const o$b = (o2) => o2 ?? T$8; var __decorate$H = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mAccountButton = class W3mAccountButton extends s$7 { constructor() { super(); this.unsubscribe = []; this.disabled = false; this.balance = "show"; this.charsStart = 4; this.charsEnd = 6; this.address = AccountController.state.address; this.balanceVal = AccountController.state.balance; this.balanceSymbol = AccountController.state.balanceSymbol; this.profileName = AccountController.state.profileName; this.profileImage = AccountController.state.profileImage; this.network = NetworkController.state.caipNetwork; this.unsubscribe.push(...[ AccountController.subscribe((val) => { if (val.isConnected) { this.address = val.address; this.balanceVal = val.balance; this.profileName = val.profileName; this.profileImage = val.profileImage; this.balanceSymbol = val.balanceSymbol; } else { this.address = ""; this.balanceVal = ""; this.profileName = ""; this.profileImage = ""; this.balanceSymbol = ""; } }), NetworkController.subscribeKey("caipNetwork", (val) => this.network = val) ]); } disconnectedCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } render() { const networkImage = AssetUtil.getNetworkImage(this.network); const showBalance = this.balance === "show"; return x$5` `; } onClick() { ModalController.open(); } }; __decorate$H([ n$c({ type: Boolean }) ], W3mAccountButton.prototype, "disabled", void 0); __decorate$H([ n$c() ], W3mAccountButton.prototype, "balance", void 0); __decorate$H([ n$c() ], W3mAccountButton.prototype, "charsStart", void 0); __decorate$H([ n$c() ], W3mAccountButton.prototype, "charsEnd", void 0); __decorate$H([ r$9() ], W3mAccountButton.prototype, "address", void 0); __decorate$H([ r$9() ], W3mAccountButton.prototype, "balanceVal", void 0); __decorate$H([ r$9() ], W3mAccountButton.prototype, "balanceSymbol", void 0); __decorate$H([ r$9() ], W3mAccountButton.prototype, "profileName", void 0); __decorate$H([ r$9() ], W3mAccountButton.prototype, "profileImage", void 0); __decorate$H([ r$9() ], W3mAccountButton.prototype, "network", void 0); W3mAccountButton = __decorate$H([ customElement("w3m-account-button") ], W3mAccountButton); const styles$n = i$c` :host { display: block; width: max-content; } `; var __decorate$G = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mButton = class W3mButton extends s$7 { constructor() { super(); this.unsubscribe = []; this.disabled = false; this.balance = void 0; this.size = void 0; this.label = void 0; this.loadingLabel = void 0; this.charsStart = 4; this.charsEnd = 6; this.isAccount = AccountController.state.isConnected; this.unsubscribe.push(AccountController.subscribeKey("isConnected", (val) => { this.isAccount = val; })); } disconnectedCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } render() { return this.isAccount ? x$5` ` : x$5` `; } }; W3mButton.styles = styles$n; __decorate$G([ n$c({ type: Boolean }) ], W3mButton.prototype, "disabled", void 0); __decorate$G([ n$c() ], W3mButton.prototype, "balance", void 0); __decorate$G([ n$c() ], W3mButton.prototype, "size", void 0); __decorate$G([ n$c() ], W3mButton.prototype, "label", void 0); __decorate$G([ n$c() ], W3mButton.prototype, "loadingLabel", void 0); __decorate$G([ n$c() ], W3mButton.prototype, "charsStart", void 0); __decorate$G([ n$c() ], W3mButton.prototype, "charsEnd", void 0); __decorate$G([ r$9() ], W3mButton.prototype, "isAccount", void 0); W3mButton = __decorate$G([ customElement("w3m-button") ], W3mButton); var __decorate$F = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mConnectButton = class W3mConnectButton extends s$7 { constructor() { super(); this.unsubscribe = []; this.size = "md"; this.label = "Connect Wallet"; this.loadingLabel = "Connecting..."; this.open = ModalController.state.open; this.loading = ModalController.state.loading; this.unsubscribe.push(ModalController.subscribe((val) => { this.open = val.open; this.loading = val.loading; })); } disconnectedCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } render() { const isLoading = this.loading || this.open; return x$5` ${isLoading ? this.loadingLabel : this.label} `; } onClick() { if (this.open) { ModalController.close(); } else if (!this.loading) { ModalController.open(); } } }; __decorate$F([ n$c() ], W3mConnectButton.prototype, "size", void 0); __decorate$F([ n$c() ], W3mConnectButton.prototype, "label", void 0); __decorate$F([ n$c() ], W3mConnectButton.prototype, "loadingLabel", void 0); __decorate$F([ r$9() ], W3mConnectButton.prototype, "open", void 0); __decorate$F([ r$9() ], W3mConnectButton.prototype, "loading", void 0); W3mConnectButton = __decorate$F([ customElement("w3m-connect-button") ], W3mConnectButton); const styles$m = i$c` :host { z-index: var(--w3m-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(--wui-cover); } @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); } } wui-card { max-width: 360px; width: 100%; position: relative; animation-delay: 0.3s; animation-duration: 0.2s; animation-name: zoom-in; animation-fill-mode: backwards; animation-timing-function: var(--wui-ease-out-power-2); outline: none; } wui-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) { wui-flex { align-items: flex-start; } wui-card { margin: var(--wui-spacing-xxl) 0px; } } @media (max-width: 430px) { wui-flex { align-items: flex-end; } wui-card { max-width: 100%; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: none; animation-name: slide-in; } } `; var __decorate$E = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const SCROLL_LOCK = "scroll-lock"; let W3mModal = class W3mModal extends s$7 { constructor() { super(); this.unsubscribe = []; this.abortController = void 0; this.open = ModalController.state.open; this.caipAddress = AccountController.state.address; this.isSiweEnabled = SIWEController.state.isSiweEnabled; this.initializeTheming(); ApiController.prefetch(); this.unsubscribe.push(ModalController.subscribeKey("open", (val) => val ? this.onOpen() : this.onClose()), SIWEController.subscribeKey("isSiweEnabled", (isEnabled) => { this.isSiweEnabled = isEnabled; }), AccountController.subscribe((newAccountState) => this.onNewAccountState(newAccountState))); EventsController.sendEvent({ type: "track", event: "MODAL_LOADED" }); } disconnectedCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); this.onRemoveKeyboardListener(); } render() { return this.open ? x$5` ` : null; } async onOverlayClick(event) { if (event.target === event.currentTarget) { await this.handleClose(); } } async handleClose() { if (this.isSiweEnabled && SIWEController.state.status !== "success") { await ConnectionController.disconnect(); } ModalController.close(); } initializeTheming() { const { themeVariables, themeMode } = ThemeController.state; const defaultThemeMode = UiHelperUtil.getColorTheme(themeMode); initializeTheming(themeVariables, defaultThemeMode); } async onClose() { this.onScrollUnlock(); await this.animate([{ opacity: 1 }, { opacity: 0 }], { duration: 200, easing: "ease", fill: "forwards" }).finished; SnackController.hide(); this.open = false; this.onRemoveKeyboardListener(); } async onOpen() { this.onScrollLock(); this.open = true; await this.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 200, easing: "ease", fill: "forwards", delay: 300 }).finished; this.onAddKeyboardListener(); } onScrollLock() { const styleTag = document.createElement("style"); styleTag.dataset["w3m"] = SCROLL_LOCK; styleTag.textContent = ` html, body { touch-action: none; overflow: hidden; overscroll-behavior: contain; } w3m-modal { pointer-events: auto; } `; document.head.appendChild(styleTag); } onScrollUnlock() { const styleTag = document.head.querySelector(`style[data-w3m="${SCROLL_LOCK}"]`); if (styleTag) { styleTag.remove(); } } onAddKeyboardListener() { var _a2; this.abortController = new AbortController(); const card = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("wui-card"); card == null ? void 0 : card.focus(); window.addEventListener("keydown", (event) => { if (event.key === "Escape") { this.handleClose(); } else if (event.key === "Tab") { const { tagName } = event.target; if (tagName && !tagName.includes("W3M-") && !tagName.includes("WUI-")) { card == null ? void 0 : card.focus(); } } }, this.abortController); } onRemoveKeyboardListener() { var _a2; (_a2 = this.abortController) == null ? void 0 : _a2.abort(); this.abortController = void 0; } async onNewAccountState(newState) { const { isConnected, caipAddress: newCaipAddress } = newState; if (this.isSiweEnabled) { if (isConnected && !this.caipAddress) { this.caipAddress = newCaipAddress; } if (isConnected && newCaipAddress && this.caipAddress !== newCaipAddress) { await SIWEController.signOut(); this.onSiweNavigation(); this.caipAddress = newCaipAddress; } try { const session = await SIWEController.getSession(); if (session && !isConnected) { await SIWEController.signOut(); } else if (isConnected && !session) { this.onSiweNavigation(); } } catch (error2) { if (isConnected) { this.onSiweNavigation(); } } } } onSiweNavigation() { if (this.open) { RouterController.push("ConnectingSiwe"); } else { ModalController.open({ view: "ConnectingSiwe" }); } } }; W3mModal.styles = styles$m; __decorate$E([ r$9() ], W3mModal.prototype, "open", void 0); __decorate$E([ r$9() ], W3mModal.prototype, "caipAddress", void 0); __decorate$E([ r$9() ], W3mModal.prototype, "isSiweEnabled", void 0); W3mModal = __decorate$E([ customElement("w3m-modal") ], W3mModal); const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, get W3mModal() { return W3mModal; } }, Symbol.toStringTag, { value: "Module" })); const styles$l = i$c` :host { display: block; width: max-content; } `; var __decorate$D = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mNetworkButton = class W3mNetworkButton extends s$7 { constructor() { super(); this.unsubscribe = []; this.disabled = false; this.network = NetworkController.state.caipNetwork; this.connected = AccountController.state.isConnected; this.loading = ModalController.state.loading; this.unsubscribe.push(...[ NetworkController.subscribeKey("caipNetwork", (val) => this.network = val), AccountController.subscribeKey("isConnected", (val) => this.connected = val), ModalController.subscribeKey("loading", (val) => this.loading = val) ]); } disconnectedCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } render() { var _a2; return x$5` ${((_a2 = this.network) == null ? void 0 : _a2.name) ?? (this.connected ? "Unknown Network" : "Select Network")} `; } onClick() { if (!this.loading) { ModalController.open({ view: "Networks" }); } } }; W3mNetworkButton.styles = styles$l; __decorate$D([ n$c({ type: Boolean }) ], W3mNetworkButton.prototype, "disabled", void 0); __decorate$D([ r$9() ], W3mNetworkButton.prototype, "network", void 0); __decorate$D([ r$9() ], W3mNetworkButton.prototype, "connected", void 0); __decorate$D([ r$9() ], W3mNetworkButton.prototype, "loading", void 0); W3mNetworkButton = __decorate$D([ customElement("w3m-network-button") ], W3mNetworkButton); const styles$k = i$c` :host { display: block; will-change: transform, opacity; } `; var __decorate$C = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mRouter = class W3mRouter extends s$7 { constructor() { super(); this.resizeObserver = void 0; this.prevHeight = "0px"; this.prevHistoryLength = 1; this.unsubscribe = []; this.view = RouterController.state.view; this.unsubscribe.push(RouterController.subscribeKey("view", (val) => this.onViewChange(val))); } firstUpdated() { this.resizeObserver = new ResizeObserver(async ([content]) => { const height = `${content == null ? void 0 : content.contentRect.height}px`; if (this.prevHeight !== "0px") { await this.animate([{ height: this.prevHeight }, { height }], { duration: 150, easing: "ease", fill: "forwards" }).finished; this.style.height = "auto"; } this.prevHeight = height; }); this.resizeObserver.observe(this.getWrapper()); } disconnectedCallback() { var _a2; (_a2 = this.resizeObserver) == null ? void 0 : _a2.unobserve(this.getWrapper()); this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } render() { return x$5`
${this.viewTemplate()}
`; } viewTemplate() { switch (this.view) { case "Connect": return x$5``; case "ConnectingWalletConnect": return x$5``; case "ConnectingExternal": return x$5``; case "ConnectingSiwe": return x$5``; case "AllWallets": return x$5``; case "Networks": return x$5``; case "SwitchNetwork": return x$5``; case "Account": return x$5``; case "WhatIsAWallet": return x$5``; case "WhatIsANetwork": return x$5``; case "GetWallet": return x$5``; case "Downloads": return x$5``; case "EmailVerifyOtp": return x$5``; case "EmailVerifyDevice": return x$5``; case "ApproveTransaction": return x$5``; case "Transactions": return x$5``; case "UpgradeEmailWallet": return x$5``; case "UpdateEmailWallet": return x$5``; case "UpdateEmailWalletWaiting": return x$5``; default: return x$5``; } } async onViewChange(newView) { const { history } = RouterController.state; let xOut = -10; let xIn = 10; if (history.length < this.prevHistoryLength) { xOut = 10; xIn = -10; } this.prevHistoryLength = history.length; await this.animate([ { opacity: 1, transform: "translateX(0px)" }, { opacity: 0, transform: `translateX(${xOut}px)` } ], { duration: 150, easing: "ease", fill: "forwards" }).finished; this.view = newView; await this.animate([ { opacity: 0, transform: `translateX(${xIn}px)` }, { opacity: 1, transform: "translateX(0px)" } ], { duration: 150, easing: "ease", fill: "forwards", delay: 50 }).finished; } getWrapper() { var _a2; return (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("div"); } }; W3mRouter.styles = styles$k; __decorate$C([ r$9() ], W3mRouter.prototype, "view", void 0); W3mRouter = __decorate$C([ customElement("w3m-router") ], W3mRouter); const styles$j = i$c` wui-flex { width: 100%; } :host > wui-flex:first-child { transform: translateY(calc(var(--wui-spacing-xxs) * -1)); } wui-icon-link { margin-right: calc(var(--wui-icon-box-size-md) * -1); } wui-notice-card { margin-bottom: var(--wui-spacing-3xs); } `; var __decorate$B = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mAccountView = class W3mAccountView extends s$7 { constructor() { super(); this.usubscribe = []; this.address = AccountController.state.address; this.profileImage = AccountController.state.profileImage; this.profileName = AccountController.state.profileName; this.balance = AccountController.state.balance; this.balanceSymbol = AccountController.state.balanceSymbol; this.network = NetworkController.state.caipNetwork; this.disconecting = false; this.usubscribe.push(...[ AccountController.subscribe((val) => { if (val.address) { this.address = val.address; this.profileImage = val.profileImage; this.profileName = val.profileName; this.balance = val.balance; this.balanceSymbol = val.balanceSymbol; } else { ModalController.close(); } }) ], NetworkController.subscribeKey("caipNetwork", (val) => { if (val == null ? void 0 : val.id) { this.network = val; } })); } disconnectedCallback() { this.usubscribe.forEach((unsubscribe) => unsubscribe()); } render() { var _a2; if (!this.address) { throw new Error("w3m-account-view: No account provided"); } const networkImage = AssetUtil.getNetworkImage(this.network); return x$5` ${this.profileName ? UiHelperUtil.getTruncateString({ string: this.profileName, charsStart: 20, charsEnd: 0, truncate: "end" }) : UiHelperUtil.getTruncateString({ string: this.address, charsStart: 4, charsEnd: 6, truncate: "middle" })} ${CoreHelperUtil.formatBalance(this.balance, this.balanceSymbol)} ${this.explorerBtnTemplate()} ${this.emailCardTemplate()} ${this.emailBtnTemplate()} ${((_a2 = this.network) == null ? void 0 : _a2.name) ?? "Unknown"} Activity Disconnect `; } emailCardTemplate() { const type2 = StorageUtil.getConnectedConnector(); const emailConnector = ConnectorController.getEmailConnector(); const { origin } = location; if (!emailConnector || type2 !== "EMAIL" || origin.includes(ConstantsUtil$1.SECURE_SITE)) { return null; } return x$5` `; } emailBtnTemplate() { const type2 = StorageUtil.getConnectedConnector(); const emailConnector = ConnectorController.getEmailConnector(); if (!emailConnector || type2 !== "EMAIL") { return null; } const email = emailConnector.provider.getEmail() ?? ""; return x$5` this.onGoToUpdateEmail(email)} > ${email} `; } explorerBtnTemplate() { const { addressExplorerUrl } = AccountController.state; if (!addressExplorerUrl) { return null; } return x$5` Block Explorer `; } isAllowedNetworkSwitch() { const { requestedCaipNetworks } = NetworkController.state; const isMultiNetwork = requestedCaipNetworks ? requestedCaipNetworks.length > 1 : false; const isValidNetwork = requestedCaipNetworks == null ? void 0 : requestedCaipNetworks.find(({ id: id2 }) => { var _a2; return id2 === ((_a2 = this.network) == null ? void 0 : _a2.id); }); return isMultiNetwork || !isValidNetwork; } onCopyAddress() { try { if (this.address) { CoreHelperUtil.copyToClopboard(this.address); SnackController.showSuccess("Address copied"); } } catch { SnackController.showError("Failed to copy"); } } onNetworks() { if (this.isAllowedNetworkSwitch()) { RouterController.push("Networks"); } } onTransactions() { EventsController.sendEvent({ type: "track", event: "CLICK_TRANSACTIONS" }); RouterController.push("Transactions"); } async onDisconnect() { try { this.disconecting = true; await ConnectionController.disconnect(); EventsController.sendEvent({ type: "track", event: "DISCONNECT_SUCCESS" }); ModalController.close(); } catch { EventsController.sendEvent({ type: "track", event: "DISCONNECT_ERROR" }); SnackController.showError("Failed to disconnect"); } finally { this.disconecting = false; } } onExplorer() { const { addressExplorerUrl } = AccountController.state; if (addressExplorerUrl) { CoreHelperUtil.openHref(addressExplorerUrl, "_blank"); } } onGoToUpgradeView() { EventsController.sendEvent({ type: "track", event: "EMAIL_UPGRADE_FROM_MODAL" }); RouterController.push("UpgradeEmailWallet"); } onGoToUpdateEmail(email) { RouterController.push("UpdateEmailWallet", { email }); } }; W3mAccountView.styles = styles$j; __decorate$B([ r$9() ], W3mAccountView.prototype, "address", void 0); __decorate$B([ r$9() ], W3mAccountView.prototype, "profileImage", void 0); __decorate$B([ r$9() ], W3mAccountView.prototype, "profileName", void 0); __decorate$B([ r$9() ], W3mAccountView.prototype, "balance", void 0); __decorate$B([ r$9() ], W3mAccountView.prototype, "balanceSymbol", void 0); __decorate$B([ r$9() ], W3mAccountView.prototype, "network", void 0); __decorate$B([ r$9() ], W3mAccountView.prototype, "disconecting", void 0); W3mAccountView = __decorate$B([ customElement("w3m-account-view") ], W3mAccountView); var __decorate$A = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mAllWalletsView = class W3mAllWalletsView extends s$7 { constructor() { super(...arguments); this.search = ""; this.onDebouncedSearch = CoreHelperUtil.debounce((value) => { this.search = value; }); } render() { const isSearch = this.search.length >= 2; return x$5` ${this.qrButtonTemplate()} ${isSearch ? x$5`` : x$5``} `; } onInputChange(event) { this.onDebouncedSearch(event.detail); } qrButtonTemplate() { if (CoreHelperUtil.isMobile()) { return x$5` `; } return null; } onWalletConnectQr() { RouterController.push("ConnectingWalletConnect"); } }; __decorate$A([ r$9() ], W3mAllWalletsView.prototype, "search", void 0); W3mAllWalletsView = __decorate$A([ customElement("w3m-all-wallets-view") ], W3mAllWalletsView); const styles$i = i$c` wui-flex { max-height: clamp(360px, 540px, 80vh); overflow: scroll; scrollbar-width: none; } wui-flex::-webkit-scrollbar { display: none; } `; var __decorate$z = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mConnectView = class W3mConnectView extends s$7 { constructor() { super(); this.unsubscribe = []; this.connectors = ConnectorController.state.connectors; this.unsubscribe.push(ConnectorController.subscribeKey("connectors", (val) => this.connectors = val)); } disconnectedCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } render() { return x$5` ${this.walletConnectConnectorTemplate()} ${this.recentTemplate()} ${this.announcedTemplate()} ${this.injectedTemplate()} ${this.featuredTemplate()} ${this.customTemplate()} ${this.recommendedTemplate()} ${this.connectorsTemplate()} ${this.allWalletsTemplate()} `; } walletConnectConnectorTemplate() { if (CoreHelperUtil.isMobile()) { return null; } const connector = this.connectors.find((c2) => c2.type === "WALLET_CONNECT"); if (!connector) { return null; } return x$5` this.onConnector(connector)} tagLabel="qr code" tagVariant="main" data-testid="wallet-selector-walletconnect" > `; } customTemplate() { const { customWallets } = OptionsController.state; if (!(customWallets == null ? void 0 : customWallets.length)) { return null; } const wallets = this.filterOutDuplicateWallets(customWallets); return wallets.map((wallet2) => x$5` this.onConnectWallet(wallet2)} > `); } featuredTemplate() { const connector = this.connectors.find((c2) => c2.type === "WALLET_CONNECT"); if (!connector) { return null; } const { featured } = ApiController.state; if (!featured.length) { return null; } const wallets = this.filterOutDuplicateWallets(featured); return wallets.map((wallet2) => x$5` this.onConnectWallet(wallet2)} > `); } recentTemplate() { const recent = StorageUtil.getRecentWallets(); return recent.map((wallet2) => x$5` this.onConnectWallet(wallet2)} tagLabel="recent" tagVariant="shade" > `); } announcedTemplate() { return this.connectors.map((connector) => { if (connector.type !== "ANNOUNCED") { return null; } return x$5` this.onConnector(connector)} tagVariant="success" .installed=${true} > `; }); } injectedTemplate() { const announced = this.connectors.find((c2) => c2.type === "ANNOUNCED"); return this.connectors.map((connector) => { if (connector.type !== "INJECTED") { return null; } if (!ConnectionController.checkInstalled()) { return null; } return x$5` this.onConnector(connector)} > `; }); } connectorsTemplate() { const announcedRdns = ConnectorController.getAnnouncedConnectorRdns(); return this.connectors.map((connector) => { if (["WALLET_CONNECT", "INJECTED", "ANNOUNCED", "EMAIL"].includes(connector.type)) { return null; } if (announcedRdns.includes(ConstantsUtil$1.CONNECTOR_RDNS_MAP[connector.id])) { return null; } return x$5` this.onConnector(connector)} > `; }); } allWalletsTemplate() { const connector = this.connectors.find((c2) => c2.type === "WALLET_CONNECT"); if (!connector) { return null; } const count = ApiController.state.count; const featuredCount = ApiController.state.featured.length; const rawCount = count + featuredCount; const roundedCount = rawCount < 10 ? rawCount : Math.floor(rawCount / 10) * 10; const tagLabel = roundedCount < rawCount ? `${roundedCount}+` : `${roundedCount}`; return x$5` `; } recommendedTemplate() { const connector = this.connectors.find((c2) => c2.type === "WALLET_CONNECT"); if (!connector) { return null; } const { recommended } = ApiController.state; const { customWallets, featuredWalletIds } = OptionsController.state; const { connectors } = ConnectorController.state; const recent = StorageUtil.getRecentWallets(); const eip6963 = connectors.filter((c2) => c2.type === "ANNOUNCED"); if (featuredWalletIds || customWallets || !recommended.length) { return null; } const overrideLength = eip6963.length + recent.length; const maxRecommended = Math.max(0, 2 - overrideLength); const wallets = this.filterOutDuplicateWallets(recommended).slice(0, maxRecommended); return wallets.map((wallet2) => x$5` this.onConnectWallet(wallet2)} > `); } onConnector(connector) { if (connector.type === "WALLET_CONNECT") { if (CoreHelperUtil.isMobile()) { RouterController.push("AllWallets"); } else { RouterController.push("ConnectingWalletConnect"); } } else { RouterController.push("ConnectingExternal", { connector }); } } filterOutDuplicateWallets(wallets) { const { connectors } = ConnectorController.state; const recent = StorageUtil.getRecentWallets(); const recentIds = recent.map((wallet2) => wallet2.id); const rdnsIds = connectors.map((c2) => { var _a2; return (_a2 = c2.info) == null ? void 0 : _a2.rdns; }).filter(Boolean); const filtered = wallets.filter((wallet2) => !recentIds.includes(wallet2.id) && !rdnsIds.includes(wallet2.rdns ?? void 0)); return filtered; } onAllWallets() { EventsController.sendEvent({ type: "track", event: "CLICK_ALL_WALLETS" }); RouterController.push("AllWallets"); } onConnectWallet(wallet2) { RouterController.push("ConnectingWalletConnect", { wallet: wallet2 }); } }; W3mConnectView.styles = styles$i; __decorate$z([ r$9() ], W3mConnectView.prototype, "connectors", void 0); W3mConnectView = __decorate$z([ customElement("w3m-connect-view") ], W3mConnectView); const styles$h = i$c` @keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(3px); } 50% { transform: translateX(-3px); } 75% { transform: translateX(3px); } 100% { transform: translateX(0); } } wui-flex:first-child:not(:only-child) { position: relative; } wui-loading-thumbnail { position: absolute; } wui-icon-box { position: absolute; right: calc(var(--wui-spacing-3xs) * -1); bottom: calc(var(--wui-spacing-3xs) * -1); opacity: 0; transform: scale(0.5); transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg); } wui-text[align='center'] { width: 100%; padding: 0px var(--wui-spacing-l); } [data-error='true'] wui-icon-box { opacity: 1; transform: scale(1); } [data-error='true'] > wui-flex:first-child { animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; } [data-retry='false'] wui-link { display: none; } [data-retry='true'] wui-link { display: block; opacity: 1; } `; var __decorate$y = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; class W3mConnectingWidget extends s$7 { constructor() { var _a2, _b2, _c2, _d; super(); this.wallet = (_a2 = RouterController.state.data) == null ? void 0 : _a2.wallet; this.connector = (_b2 = RouterController.state.data) == null ? void 0 : _b2.connector; this.timeout = void 0; this.secondaryBtnLabel = "Try again"; this.secondaryBtnIcon = "refresh"; this.secondaryLabel = "Accept connection request in the wallet"; this.onConnect = void 0; this.onRender = void 0; this.onAutoConnect = void 0; this.isWalletConnect = true; this.unsubscribe = []; this.imageSrc = AssetUtil.getWalletImage(this.wallet) ?? AssetUtil.getConnectorImage(this.connector); this.name = ((_c2 = this.wallet) == null ? void 0 : _c2.name) ?? ((_d = this.connector) == null ? void 0 : _d.name) ?? "Wallet"; this.isRetrying = false; this.uri = ConnectionController.state.wcUri; this.error = ConnectionController.state.wcError; this.ready = false; this.showRetry = false; this.buffering = false; this.isMobile = false; this.onRetry = void 0; this.unsubscribe.push(...[ ConnectionController.subscribeKey("wcUri", (val) => { var _a3; this.uri = val; if (this.isRetrying && this.onRetry) { this.isRetrying = false; (_a3 = this.onConnect) == null ? void 0 : _a3.call(this); } }), ConnectionController.subscribeKey("wcError", (val) => this.error = val), ConnectionController.subscribeKey("buffering", (val) => this.buffering = val) ]); } firstUpdated() { var _a2; (_a2 = this.onAutoConnect) == null ? void 0 : _a2.call(this); this.showRetry = !this.onAutoConnect; } disconnectedCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); clearTimeout(this.timeout); } render() { var _a2; (_a2 = this.onRender) == null ? void 0 : _a2.call(this); this.onShowRetry(); const subLabel = this.error ? "Connection can be declined if a previous request is still active" : this.secondaryLabel; let label = `Continue in ${this.name}`; if (this.buffering) { label = "Connecting..."; } if (this.error) { label = "Connection declined"; } return x$5` ${this.error ? null : this.loaderTemplate()} ${label} ${subLabel} ${this.secondaryBtnLabel} ${this.isWalletConnect ? x$5` Copy link ` : null} `; } onShowRetry() { var _a2; if (this.error && !this.showRetry) { this.showRetry = true; const retryButton = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("wui-button"); retryButton == null ? void 0 : retryButton.animate([{ opacity: 0 }, { opacity: 1 }], { fill: "forwards", easing: "ease" }); } } onTryAgain() { var _a2, _b2; if (!this.buffering) { ConnectionController.setWcError(false); if (this.onRetry) { this.isRetrying = true; (_a2 = this.onRetry) == null ? void 0 : _a2.call(this); } else { (_b2 = this.onConnect) == null ? void 0 : _b2.call(this); } } } loaderTemplate() { const borderRadiusMaster = ThemeController.state.themeVariables["--w3m-border-radius-master"]; const radius = borderRadiusMaster ? parseInt(borderRadiusMaster.replace("px", ""), 10) : 4; return x$5``; } onCopyUri() { try { if (this.uri) { CoreHelperUtil.copyToClopboard(this.uri); SnackController.showSuccess("Link copied"); } } catch { SnackController.showError("Failed to copy"); } } } W3mConnectingWidget.styles = styles$h; __decorate$y([ r$9() ], W3mConnectingWidget.prototype, "uri", void 0); __decorate$y([ r$9() ], W3mConnectingWidget.prototype, "error", void 0); __decorate$y([ r$9() ], W3mConnectingWidget.prototype, "ready", void 0); __decorate$y([ r$9() ], W3mConnectingWidget.prototype, "showRetry", void 0); __decorate$y([ r$9() ], W3mConnectingWidget.prototype, "buffering", void 0); __decorate$y([ n$c({ type: Boolean }) ], W3mConnectingWidget.prototype, "isMobile", void 0); __decorate$y([ n$c() ], W3mConnectingWidget.prototype, "onRetry", void 0); var __decorate$x = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const platformMap = { INJECTED: "browser", ANNOUNCED: "browser" }; let W3mConnectingExternalView = class W3mConnectingExternalView extends W3mConnectingWidget { constructor() { super(); if (!this.connector) { throw new Error("w3m-connecting-view: No connector provided"); } EventsController.sendEvent({ type: "track", event: "SELECT_WALLET", properties: { name: this.connector.name ?? "Unknown", platform: platformMap[this.connector.type] ?? "external" } }); this.onConnect = this.onConnectProxy.bind(this); this.onAutoConnect = this.onConnectProxy.bind(this); this.isWalletConnect = false; } async onConnectProxy() { try { this.error = false; if (this.connector) { if (this.connector.imageUrl) { StorageUtil.setConnectedWalletImageUrl(this.connector.imageUrl); } await ConnectionController.connectExternal(this.connector); if (SIWEController.state.isSiweEnabled) { RouterController.push("ConnectingSiwe"); } else { ModalController.close(); } EventsController.sendEvent({ type: "track", event: "CONNECT_SUCCESS", properties: { method: "external" } }); } } catch (error2) { EventsController.sendEvent({ type: "track", event: "CONNECT_ERROR", properties: { message: (error2 == null ? void 0 : error2.message) ?? "Unknown" } }); this.error = true; } } }; W3mConnectingExternalView = __decorate$x([ customElement("w3m-connecting-external-view") ], W3mConnectingExternalView); var __decorate$w = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mConnectingSiweView = class W3mConnectingSiweView extends s$7 { constructor() { var _a2; super(...arguments); this.dappName = (_a2 = OptionsController.state.metadata) == null ? void 0 : _a2.name; this.isSigning = false; } render() { return x$5` ${this.dappName ?? "Dapp"} needs to connect to your wallet Sign this message to prove you own this wallet and proceed. Canceling will disconnect you. Cancel ${this.isSigning ? "Signing..." : "Sign"} `; } async onSign() { this.isSigning = true; EventsController.sendEvent({ event: "CLICK_SIGN_SIWE_MESSAGE", type: "track" }); try { SIWEController.setStatus("loading"); const session = await SIWEController.signIn(); SIWEController.setStatus("success"); EventsController.sendEvent({ event: "SIWE_AUTH_SUCCESS", type: "track" }); return session; } catch (error2) { SnackController.showError("Signature declined"); SIWEController.setStatus("error"); return EventsController.sendEvent({ event: "SIWE_AUTH_ERROR", type: "track" }); } finally { this.isSigning = false; } } async onCancel() { const { isConnected } = AccountController.state; if (isConnected) { await ConnectionController.disconnect(); ModalController.close(); } else { RouterController.push("Connect"); } EventsController.sendEvent({ event: "CLICK_CANCEL_SIWE", type: "track" }); } }; __decorate$w([ r$9() ], W3mConnectingSiweView.prototype, "isSigning", void 0); W3mConnectingSiweView = __decorate$w([ customElement("w3m-connecting-siwe-view") ], W3mConnectingSiweView); var __decorate$v = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mConnectingWcView = class W3mConnectingWcView extends s$7 { constructor() { var _a2; super(); this.interval = void 0; this.lastRetry = Date.now(); this.wallet = (_a2 = RouterController.state.data) == null ? void 0 : _a2.wallet; this.platform = void 0; this.platforms = []; this.initializeConnection(); this.interval = setInterval(this.initializeConnection.bind(this), ConstantsUtil$1.TEN_SEC_MS); } disconnectedCallback() { clearTimeout(this.interval); } render() { if (!this.wallet) { return x$5``; } this.determinePlatforms(); return x$5` ${this.headerTemplate()}
${this.platformTemplate()}
`; } async initializeConnection(retry = false) { try { const { wcPairingExpiry } = ConnectionController.state; if (retry || CoreHelperUtil.isPairingExpired(wcPairingExpiry)) { ConnectionController.connectWalletConnect(); if (this.wallet) { const url = AssetUtil.getWalletImage(this.wallet); if (url) { StorageUtil.setConnectedWalletImageUrl(url); } } else { const connectors = ConnectorController.state.connectors; const connector = connectors.find((c2) => c2.type === "WALLET_CONNECT"); const url = AssetUtil.getConnectorImage(connector); if (url) { StorageUtil.setConnectedWalletImageUrl(url); } } await ConnectionController.state.wcPromise; this.finalizeConnection(); if (SIWEController.state.isSiweEnabled) { RouterController.push("ConnectingSiwe"); } else { ModalController.close(); } } } catch (error2) { EventsController.sendEvent({ type: "track", event: "CONNECT_ERROR", properties: { message: (error2 == null ? void 0 : error2.message) ?? "Unknown" } }); ConnectionController.setWcError(true); if (CoreHelperUtil.isAllowedRetry(this.lastRetry)) { SnackController.showError("Declined"); this.lastRetry = Date.now(); this.initializeConnection(true); } } } finalizeConnection() { const { wcLinking, recentWallet } = ConnectionController.state; if (wcLinking) { StorageUtil.setWalletConnectDeepLink(wcLinking); } if (recentWallet) { StorageUtil.setWeb3ModalRecent(recentWallet); } EventsController.sendEvent({ type: "track", event: "CONNECT_SUCCESS", properties: { method: wcLinking ? "mobile" : "qrcode" } }); } determinePlatforms() { if (!this.wallet) { throw new Error("w3m-connecting-wc-view:determinePlatforms No wallet"); } if (this.platform) { return; } const { mobile_link, desktop_link, webapp_link, injected, rdns } = this.wallet; const injectedIds = injected == null ? void 0 : injected.map(({ injected_id }) => injected_id).filter(Boolean); const browserIds = rdns ? [rdns] : injectedIds ?? []; const isBrowser = browserIds.length; const isMobileWc = mobile_link; const isWebWc = webapp_link; const isBrowserInstalled = ConnectionController.checkInstalled(browserIds); const isBrowserWc = isBrowser && isBrowserInstalled; const isDesktopWc = desktop_link && !CoreHelperUtil.isMobile(); if (isBrowserWc) { this.platforms.push("browser"); } if (isMobileWc) { this.platforms.push(CoreHelperUtil.isMobile() ? "mobile" : "qrcode"); } if (isWebWc) { this.platforms.push("web"); } if (isDesktopWc) { this.platforms.push("desktop"); } if (!isBrowserWc && isBrowser) { this.platforms.push("unsupported"); } this.platform = this.platforms[0]; } platformTemplate() { switch (this.platform) { case "browser": return x$5``; case "desktop": return x$5` this.initializeConnection(true)}> `; case "web": return x$5` this.initializeConnection(true)}> `; case "mobile": return x$5` this.initializeConnection(true)}> `; case "qrcode": return x$5``; default: return x$5``; } } headerTemplate() { const multiPlatform = this.platforms.length > 1; if (!multiPlatform) { return null; } return x$5` `; } async onSelectPlatform(platform) { var _a2; const container = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("div"); if (container) { await container.animate([{ opacity: 1 }, { opacity: 0 }], { duration: 200, fill: "forwards", easing: "ease" }).finished; this.platform = platform; container.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 200, fill: "forwards", easing: "ease" }); } } }; __decorate$v([ r$9() ], W3mConnectingWcView.prototype, "platform", void 0); __decorate$v([ r$9() ], W3mConnectingWcView.prototype, "platforms", void 0); W3mConnectingWcView = __decorate$v([ customElement("w3m-connecting-wc-view") ], W3mConnectingWcView); var __decorate$u = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mDownloadsView = class W3mDownloadsView extends s$7 { constructor() { var _a2; super(...arguments); this.wallet = (_a2 = RouterController.state.data) == null ? void 0 : _a2.wallet; } render() { if (!this.wallet) { throw new Error("w3m-downloads-view"); } return x$5` ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()} ${this.homepageTemplate()} `; } chromeTemplate() { var _a2; if (!((_a2 = this.wallet) == null ? void 0 : _a2.chrome_store)) { return null; } return x$5` Chrome Extension `; } iosTemplate() { var _a2; if (!((_a2 = this.wallet) == null ? void 0 : _a2.app_store)) { return null; } return x$5` iOS App `; } androidTemplate() { var _a2; if (!((_a2 = this.wallet) == null ? void 0 : _a2.play_store)) { return null; } return x$5` Android App `; } homepageTemplate() { var _a2; if (!((_a2 = this.wallet) == null ? void 0 : _a2.homepage)) { return null; } return x$5` Website `; } onChromeStore() { var _a2; if ((_a2 = this.wallet) == null ? void 0 : _a2.chrome_store) { CoreHelperUtil.openHref(this.wallet.chrome_store, "_blank"); } } onAppStore() { var _a2; if ((_a2 = this.wallet) == null ? void 0 : _a2.app_store) { CoreHelperUtil.openHref(this.wallet.app_store, "_blank"); } } onPlayStore() { var _a2; if ((_a2 = this.wallet) == null ? void 0 : _a2.play_store) { CoreHelperUtil.openHref(this.wallet.play_store, "_blank"); } } onHomePage() { var _a2; if ((_a2 = this.wallet) == null ? void 0 : _a2.homepage) { CoreHelperUtil.openHref(this.wallet.homepage, "_blank"); } } }; W3mDownloadsView = __decorate$u([ customElement("w3m-downloads-view") ], W3mDownloadsView); var __decorate$t = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const EXPLORER = "https://walletconnect.com/explorer"; let W3mGetWalletView = class W3mGetWalletView extends s$7 { render() { return x$5` ${this.recommendedWalletsTemplate()} { CoreHelperUtil.openHref("https://walletconnect.com/explorer?type=wallet", "_blank"); }} > `; } recommendedWalletsTemplate() { const { recommended, featured } = ApiController.state; const { customWallets } = OptionsController.state; const wallets = [...featured, ...customWallets ?? [], ...recommended].slice(0, 4); return wallets.map((wallet2) => x$5` { CoreHelperUtil.openHref(wallet2.homepage ?? EXPLORER, "_blank"); }} > `); } }; W3mGetWalletView = __decorate$t([ customElement("w3m-get-wallet-view") ], W3mGetWalletView); const styles$g = i$c` @keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(3px); } 50% { transform: translateX(-3px); } 75% { transform: translateX(3px); } 100% { transform: translateX(0); } } wui-flex:first-child:not(:only-child) { position: relative; } wui-loading-hexagon { position: absolute; } wui-icon-box { position: absolute; right: 4px; bottom: 0; opacity: 0; transform: scale(0.5); z-index: 1; transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg); } wui-button { display: none; } [data-error='true'] wui-icon-box { opacity: 1; transform: scale(1); } [data-error='true'] > wui-flex:first-child { animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; } wui-button[data-retry='true'] { display: block; opacity: 1; } `; var __decorate$s = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mNetworkSwitchView = class W3mNetworkSwitchView extends s$7 { constructor() { var _a2; super(); this.network = (_a2 = RouterController.state.data) == null ? void 0 : _a2.network; this.unsubscribe = []; this.showRetry = false; this.error = false; } disconnectedCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } firstUpdated() { this.onSwitchNetwork(); } render() { if (!this.network) { throw new Error("w3m-network-switch-view: No network provided"); } this.onShowRetry(); const label = this.error ? "Switch declined" : "Approve in wallet"; const subLabel = 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"; return x$5` ${this.error ? null : x$5``} ${label} ${subLabel} Try again `; } onShowRetry() { var _a2; if (this.error && !this.showRetry) { this.showRetry = true; const retryButton = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("wui-button"); retryButton == null ? void 0 : retryButton.animate([{ opacity: 0 }, { opacity: 1 }], { fill: "forwards", easing: "ease" }); } } async onSwitchNetwork() { try { this.error = false; if (this.network) { await NetworkController.switchActiveNetwork(this.network); if (!SIWEController.state.isSiweEnabled) { RouterUtil.navigateAfterNetworkSwitch(); } } } catch { this.error = true; } } }; W3mNetworkSwitchView.styles = styles$g; __decorate$s([ r$9() ], W3mNetworkSwitchView.prototype, "showRetry", void 0); __decorate$s([ r$9() ], W3mNetworkSwitchView.prototype, "error", void 0); W3mNetworkSwitchView = __decorate$s([ customElement("w3m-network-switch-view") ], W3mNetworkSwitchView); const styles$f = i$c` :host > wui-grid { max-height: 360px; overflow: auto; } wui-grid::-webkit-scrollbar { display: none; } `; var __decorate$r = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mNetworksView = class W3mNetworksView extends s$7 { constructor() { super(); this.unsubscribe = []; this.caipNetwork = NetworkController.state.caipNetwork; this.unsubscribe.push(NetworkController.subscribeKey("caipNetwork", (val) => this.caipNetwork = val)); } disconnectedCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } render() { return x$5` ${this.networksTemplate()} Your connected wallet may not support some of the networks available for this dApp What is a network `; } onNetworkHelp() { EventsController.sendEvent({ type: "track", event: "CLICK_NETWORK_HELP" }); RouterController.push("WhatIsANetwork"); } networksTemplate() { const { approvedCaipNetworkIds, requestedCaipNetworks, supportsAllNetworks } = NetworkController.state; const approvedIds = approvedCaipNetworkIds; const requestedNetworks = requestedCaipNetworks; const approvedIndexMap = {}; if (requestedNetworks && approvedIds) { approvedIds.forEach((id2, index2) => { approvedIndexMap[id2] = index2; }); requestedNetworks.sort((a2, b2) => { const indexA = approvedIndexMap[a2.id]; const indexB = approvedIndexMap[b2.id]; if (indexA !== void 0 && indexB !== void 0) { return indexA - indexB; } else if (indexA !== void 0) { return -1; } else if (indexB !== void 0) { return 1; } return 0; }); } return requestedNetworks == null ? void 0 : requestedNetworks.map((network) => { var _a2; return x$5` this.onSwitchNetwork(network)} .disabled=${!supportsAllNetworks && !(approvedIds == null ? void 0 : approvedIds.includes(network.id))} data-testid=${`w3m-network-switch-${network.name ?? network.id}`} > `; }); } async onSwitchNetwork(network) { const { isConnected } = AccountController.state; const { approvedCaipNetworkIds, supportsAllNetworks, caipNetwork } = NetworkController.state; const { data: data2 } = RouterController.state; if (isConnected && (caipNetwork == null ? void 0 : caipNetwork.id) !== network.id) { if (approvedCaipNetworkIds == null ? void 0 : approvedCaipNetworkIds.includes(network.id)) { await NetworkController.switchActiveNetwork(network); RouterUtil.navigateAfterNetworkSwitch(); } else if (supportsAllNetworks) { RouterController.push("SwitchNetwork", { ...data2, network }); } } else if (!isConnected) { NetworkController.setCaipNetwork(network); RouterController.push("Connect"); } } }; W3mNetworksView.styles = styles$f; __decorate$r([ r$9() ], W3mNetworksView.prototype, "caipNetwork", void 0); W3mNetworksView = __decorate$r([ customElement("w3m-networks-view") ], W3mNetworksView); const styles$e = i$c` :host > wui-flex:first-child { height: 500px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; } `; var __decorate$q = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const PAGINATOR_ID$1 = "last-transaction"; const LOADING_ITEM_COUNT = 7; let W3mTransactionsView = class W3mTransactionsView extends s$7 { constructor() { super(); this.unsubscribe = []; this.paginationObserver = void 0; this.address = AccountController.state.address; this.transactions = TransactionsController.state.transactions; this.transactionsByYear = TransactionsController.state.transactionsByYear; this.loading = TransactionsController.state.loading; this.empty = TransactionsController.state.empty; this.next = TransactionsController.state.next; this.unsubscribe.push(...[ AccountController.subscribe((val) => { if (val.isConnected) { if (this.address !== val.address) { this.address = val.address; TransactionsController.resetTransactions(); TransactionsController.fetchTransactions(val.address); } } }), TransactionsController.subscribe((val) => { this.transactions = val.transactions; this.transactionsByYear = val.transactionsByYear; this.loading = val.loading; this.empty = val.empty; this.next = val.next; }) ]); } firstUpdated() { if (this.transactions.length === 0) { TransactionsController.fetchTransactions(this.address); } this.createPaginationObserver(); } updated() { this.setPaginationObserver(); } disconnectedCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } render() { return x$5` ${this.empty ? null : this.templateTransactionsByYear()} ${this.loading ? this.templateLoading() : null} ${!this.loading && this.empty ? this.templateEmpty() : null} `; } templateTransactionsByYear() { const sortedYearKeys = Object.keys(this.transactionsByYear).sort().reverse(); return sortedYearKeys.map((year, index2) => { const isLastGroup = index2 === sortedYearKeys.length - 1; const yearInt = parseInt(year, 10); const groupTitle = TransactionUtil.getTransactionGroupTitle(yearInt); const transactions = this.transactionsByYear[yearInt]; if (!transactions) { return null; } return x$5` ${groupTitle} ${this.templateTransactions(transactions, isLastGroup)} `; }); } templateRenderTransaction(transaction, isLastTransaction) { const { date: date2, descriptions, direction, isAllNFT, images, status, transfers, type: type2 } = this.getTransactionListItemProps(transaction); const haveMultipleTransfers = (transfers == null ? void 0 : transfers.length) > 1; const haveTwoTransfers = (transfers == null ? void 0 : transfers.length) === 2; if (haveTwoTransfers && !isAllNFT) { return x$5` `; } if (haveMultipleTransfers) { return transfers.map((transfer, index2) => { const description = TransactionUtil.getTransferDescription(transfer); const isLastTransfer = isLastTransaction && index2 === transfers.length - 1; return x$5` `; }); } return x$5` `; } templateTransactions(transactions, isLastGroup) { return transactions.map((transaction, index2) => { const isLastTransaction = isLastGroup && index2 === transactions.length - 1; return x$5`${this.templateRenderTransaction(transaction, isLastTransaction)}`; }); } templateEmpty() { return x$5` No Transactions yet Start trading on dApps
to grow your wallet!
`; } templateLoading() { return Array(LOADING_ITEM_COUNT).fill(x$5` `).map((item) => item); } createPaginationObserver() { const { projectId: projectId2 } = OptionsController.state; this.paginationObserver = new IntersectionObserver(([element]) => { if ((element == null ? void 0 : element.isIntersecting) && !this.loading) { TransactionsController.fetchTransactions(this.address); EventsController.sendEvent({ type: "track", event: "LOAD_MORE_TRANSACTIONS", properties: { address: this.address, projectId: projectId2, cursor: this.next } }); } }, {}); this.setPaginationObserver(); } setPaginationObserver() { var _a2, _b2, _c2; (_a2 = this.paginationObserver) == null ? void 0 : _a2.disconnect(); const lastItem = (_b2 = this.shadowRoot) == null ? void 0 : _b2.querySelector(`#${PAGINATOR_ID$1}`); if (lastItem) { (_c2 = this.paginationObserver) == null ? void 0 : _c2.observe(lastItem); } } getTransactionListItemProps(transaction) { var _a2, _b2, _c2, _d, _e2; const date2 = DateUtil.getRelativeDateFromNow((_a2 = transaction == null ? void 0 : transaction.metadata) == null ? void 0 : _a2.minedAt); const descriptions = TransactionUtil.getTransactionDescriptions(transaction); const transfers = transaction == null ? void 0 : transaction.transfers; const transfer = (_b2 = transaction == null ? void 0 : transaction.transfers) == null ? void 0 : _b2[0]; const isAllNFT = Boolean(transfer) && ((_c2 = transaction == null ? void 0 : transaction.transfers) == null ? void 0 : _c2.every((item) => Boolean(item.nft_info))); const images = TransactionUtil.getTransactionImages(transfers); return { date: date2, direction: transfer == null ? void 0 : transfer.direction, descriptions, isAllNFT, images, status: (_d = transaction.metadata) == null ? void 0 : _d.status, transfers, type: (_e2 = transaction.metadata) == null ? void 0 : _e2.operationType }; } }; W3mTransactionsView.styles = styles$e; __decorate$q([ r$9() ], W3mTransactionsView.prototype, "address", void 0); __decorate$q([ r$9() ], W3mTransactionsView.prototype, "transactions", void 0); __decorate$q([ r$9() ], W3mTransactionsView.prototype, "transactionsByYear", void 0); __decorate$q([ r$9() ], W3mTransactionsView.prototype, "loading", void 0); __decorate$q([ r$9() ], W3mTransactionsView.prototype, "empty", void 0); __decorate$q([ r$9() ], W3mTransactionsView.prototype, "next", void 0); W3mTransactionsView = __decorate$q([ customElement("w3m-transactions-view") ], W3mTransactionsView); var __decorate$p = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const data$2 = [ { 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 W3mWhatIsANetworkView = class W3mWhatIsANetworkView extends s$7 { render() { return x$5` { CoreHelperUtil.openHref("https://ethereum.org/en/developers/docs/networks/", "_blank"); }} > Learn more `; } }; W3mWhatIsANetworkView = __decorate$p([ customElement("w3m-what-is-a-network-view") ], W3mWhatIsANetworkView); var __decorate$o = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const data$1 = [ { 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 W3mWhatIsAWalletView = class W3mWhatIsAWalletView extends s$7 { render() { return x$5` Get a wallet `; } onGetWallet() { EventsController.sendEvent({ type: "track", event: "CLICK_GET_WALLET" }); RouterController.push("GetWallet"); } }; W3mWhatIsAWalletView = __decorate$o([ customElement("w3m-what-is-a-wallet-view") ], W3mWhatIsAWalletView); const styles$d = i$c` wui-loading-spinner { margin: 9px auto; } `; const W3mFrameConstants = { SECURE_SITE_SDK: "https://secure.web3modal.com/sdk", APP_EVENT_KEY: "@w3m-app/", FRAME_EVENT_KEY: "@w3m-frame/", RPC_METHOD_KEY: "RPC_", STORAGE_KEY: "@w3m-storage/", 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", APP_SWITCH_NETWORK: "@w3m-app/SWITCH_NETWORK", APP_CONNECT_EMAIL: "@w3m-app/CONNECT_EMAIL", APP_CONNECT_DEVICE: "@w3m-app/CONNECT_DEVICE", APP_CONNECT_OTP: "@w3m-app/CONNECT_OTP", APP_GET_USER: "@w3m-app/GET_USER", APP_SIGN_OUT: "@w3m-app/SIGN_OUT", APP_IS_CONNECTED: "@w3m-app/IS_CONNECTED", APP_GET_CHAIN_ID: "@w3m-app/GET_CHAIN_ID", APP_RPC_REQUEST: "@w3m-app/RPC_REQUEST", APP_UPDATE_EMAIL: "@w3m-app/UPDATE_EMAIL", APP_AWAIT_UPDATE_EMAIL: "@w3m-app/AWAIT_UPDATE_EMAIL", APP_SYNC_THEME: "@w3m-app/SYNC_THEME", APP_SYNC_DAPP_DATA: "@w3m-app/SYNC_DAPP_DATA", FRAME_SWITCH_NETWORK_ERROR: "@w3m-frame/SWITCH_NETWORK_ERROR", FRAME_SWITCH_NETWORK_SUCCESS: "@w3m-frame/SWITCH_NETWORK_SUCCESS", FRAME_CONNECT_EMAIL_ERROR: "@w3m-frame/CONNECT_EMAIL_ERROR", FRAME_CONNECT_EMAIL_SUCCESS: "@w3m-frame/CONNECT_EMAIL_SUCCESS", FRAME_CONNECT_DEVICE_ERROR: "@w3m-frame/CONNECT_DEVICE_ERROR", FRAME_CONNECT_DEVICE_SUCCESS: "@w3m-frame/CONNECT_DEVICE_SUCCESS", FRAME_CONNECT_OTP_SUCCESS: "@w3m-frame/CONNECT_OTP_SUCCESS", FRAME_CONNECT_OTP_ERROR: "@w3m-frame/CONNECT_OTP_ERROR", FRAME_GET_USER_SUCCESS: "@w3m-frame/GET_USER_SUCCESS", FRAME_GET_USER_ERROR: "@w3m-frame/GET_USER_ERROR", FRAME_SIGN_OUT_SUCCESS: "@w3m-frame/SIGN_OUT_SUCCESS", FRAME_SIGN_OUT_ERROR: "@w3m-frame/SIGN_OUT_ERROR", FRAME_IS_CONNECTED_SUCCESS: "@w3m-frame/IS_CONNECTED_SUCCESS", FRAME_IS_CONNECTED_ERROR: "@w3m-frame/IS_CONNECTED_ERROR", FRAME_GET_CHAIN_ID_SUCCESS: "@w3m-frame/GET_CHAIN_ID_SUCCESS", FRAME_GET_CHAIN_ID_ERROR: "@w3m-frame/GET_CHAIN_ID_ERROR", FRAME_RPC_REQUEST_SUCCESS: "@w3m-frame/RPC_REQUEST_SUCCESS", FRAME_RPC_REQUEST_ERROR: "@w3m-frame/RPC_REQUEST_ERROR", FRAME_SESSION_UPDATE: "@w3m-frame/SESSION_UPDATE", FRAME_UPDATE_EMAIL_SUCCESS: "@w3m-frame/UPDATE_EMAIL_SUCCESS", FRAME_UPDATE_EMAIL_ERROR: "@w3m-frame/UPDATE_EMAIL_ERROR", FRAME_AWAIT_UPDATE_EMAIL_SUCCESS: "@w3m-frame/AWAIT_UPDATE_EMAIL_SUCCESS", FRAME_AWAIT_UPDATE_EMAIL_ERROR: "@w3m-frame/AWAIT_UPDATE_EMAIL_ERROR", FRAME_SYNC_THEME_SUCCESS: "@w3m-frame/SYNC_THEME_SUCCESS", FRAME_SYNC_THEME_ERROR: "@w3m-frame/SYNC_THEME_ERROR", FRAME_SYNC_DAPP_DATA_SUCCESS: "@w3m-frame/SYNC_DAPP_DATA_SUCCESS", FRAME_SYNC_DAPP_DATA_ERROR: "@w3m-frame/SYNC_DAPP_DATA_ERROR" }; const W3mFrameRpcConstants = { SAFE_RPC_METHODS: ["eth_blockNumber", "eth_estimateGas", "eth_getTransactionByHash"], GET_CHAIN_ID: "eth_chainId" }; var util$4; (function(util2) { util2.assertEqual = (val) => val; function assertIs(_arg) { } util2.assertIs = assertIs; function assertNever(_x) { throw new Error(); } util2.assertNever = assertNever; util2.arrayToEnum = (items) => { const obj = {}; for (const item of items) { obj[item] = item; } return obj; }; util2.getValidEnumValues = (obj) => { const validKeys = util2.objectKeys(obj).filter((k2) => typeof obj[obj[k2]] !== "number"); const filtered = {}; for (const k2 of validKeys) { filtered[k2] = obj[k2]; } return util2.objectValues(filtered); }; util2.objectValues = (obj) => { return util2.objectKeys(obj).map(function(e2) { return obj[e2]; }); }; util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object2) => { const keys2 = []; for (const key in object2) { if (Object.prototype.hasOwnProperty.call(object2, key)) { keys2.push(key); } } return keys2; }; util2.find = (arr2, checker) => { for (const item of arr2) { if (checker(item)) return item; } return void 0; }; util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val; function joinValues(array2, separator = " | ") { return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator); } util2.joinValues = joinValues; util2.jsonStringifyReplacer = (_2, value) => { if (typeof value === "bigint") { return value.toString(); } return value; }; })(util$4 || (util$4 = {})); var objectUtil; (function(objectUtil2) { objectUtil2.mergeShapes = (first, second) => { return { ...first, ...second // second overwrites first }; }; })(objectUtil || (objectUtil = {})); const ZodParsedType = util$4.arrayToEnum([ "string", "nan", "number", "integer", "float", "boolean", "date", "bigint", "symbol", "function", "undefined", "null", "array", "object", "unknown", "promise", "void", "never", "map", "set" ]); const getParsedType = (data2) => { const t2 = typeof data2; switch (t2) { case "undefined": return ZodParsedType.undefined; case "string": return ZodParsedType.string; case "number": return isNaN(data2) ? ZodParsedType.nan : ZodParsedType.number; case "boolean": return ZodParsedType.boolean; case "function": return ZodParsedType.function; case "bigint": return ZodParsedType.bigint; case "symbol": return ZodParsedType.symbol; case "object": if (Array.isArray(data2)) { return ZodParsedType.array; } if (data2 === null) { return ZodParsedType.null; } if (data2.then && typeof data2.then === "function" && data2.catch && typeof data2.catch === "function") { return ZodParsedType.promise; } if (typeof Map !== "undefined" && data2 instanceof Map) { return ZodParsedType.map; } if (typeof Set !== "undefined" && data2 instanceof Set) { return ZodParsedType.set; } if (typeof Date !== "undefined" && data2 instanceof Date) { return ZodParsedType.date; } return ZodParsedType.object; default: return ZodParsedType.unknown; } }; const ZodIssueCode = util$4.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" ]); const quotelessJson = (obj) => { const json2 = JSON.stringify(obj, null, 2); return json2.replace(/"([^"]+)":/g, "$1:"); }; class ZodError extends Error { constructor(issues) { super(); this.issues = []; this.addIssue = (sub) => { this.issues = [...this.issues, sub]; }; this.addIssues = (subs = []) => { this.issues = [...this.issues, ...subs]; }; const actualProto = new.target.prototype; if (Object.setPrototypeOf) { Object.setPrototypeOf(this, actualProto); } else { this.__proto__ = actualProto; } this.name = "ZodError"; this.issues = issues; } get errors() { return this.issues; } format(_mapper) { const mapper = _mapper || function(issue) { return issue.message; }; const fieldErrors = { _errors: [] }; const processError = (error2) => { for (const issue of error2.issues) { if (issue.code === "invalid_union") { issue.unionErrors.map(processError); } else if (issue.code === "invalid_return_type") { processError(issue.returnTypeError); } else if (issue.code === "invalid_arguments") { processError(issue.argumentsError); } else if (issue.path.length === 0) { fieldErrors._errors.push(mapper(issue)); } else { let curr = fieldErrors; let i2 = 0; while (i2 < issue.path.length) { const el = issue.path[i2]; const terminal = i2 === issue.path.length - 1; if (!terminal) { curr[el] = curr[el] || { _errors: [] }; } else { curr[el] = curr[el] || { _errors: [] }; curr[el]._errors.push(mapper(issue)); } curr = curr[el]; i2++; } } } }; processError(this); return fieldErrors; } toString() { return this.message; } get message() { return JSON.stringify(this.issues, util$4.jsonStringifyReplacer, 2); } get isEmpty() { return this.issues.length === 0; } flatten(mapper = (issue) => issue.message) { const fieldErrors = {}; const formErrors = []; for (const sub of this.issues) { if (sub.path.length > 0) { fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; fieldErrors[sub.path[0]].push(mapper(sub)); } else { formErrors.push(mapper(sub)); } } return { formErrors, fieldErrors }; } get formErrors() { return this.flatten(); } } ZodError.create = (issues) => { const error2 = new ZodError(issues); return error2; }; const errorMap = (issue, _ctx) => { let message; switch (issue.code) { case ZodIssueCode.invalid_type: if (issue.received === ZodParsedType.undefined) { message = "Required"; } else { message = `Expected ${issue.expected}, received ${issue.received}`; } break; case ZodIssueCode.invalid_literal: message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util$4.jsonStringifyReplacer)}`; break; case ZodIssueCode.unrecognized_keys: message = `Unrecognized key(s) in object: ${util$4.joinValues(issue.keys, ", ")}`; break; case ZodIssueCode.invalid_union: message = `Invalid input`; break; case ZodIssueCode.invalid_union_discriminator: message = `Invalid discriminator value. Expected ${util$4.joinValues(issue.options)}`; break; case ZodIssueCode.invalid_enum_value: message = `Invalid enum value. Expected ${util$4.joinValues(issue.options)}, received '${issue.received}'`; break; case ZodIssueCode.invalid_arguments: message = `Invalid function arguments`; break; case ZodIssueCode.invalid_return_type: message = `Invalid function return type`; break; case ZodIssueCode.invalid_date: message = `Invalid date`; break; case ZodIssueCode.invalid_string: if (typeof issue.validation === "object") { if ("includes" in issue.validation) { message = `Invalid input: must include "${issue.validation.includes}"`; if (typeof issue.validation.position === "number") { message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`; } } else if ("startsWith" in issue.validation) { message = `Invalid input: must start with "${issue.validation.startsWith}"`; } else if ("endsWith" in issue.validation) { message = `Invalid input: must end with "${issue.validation.endsWith}"`; } else { util$4.assertNever(issue.validation); } } else if (issue.validation !== "regex") { message = `Invalid ${issue.validation}`; } else { message = "Invalid"; } break; case ZodIssueCode.too_small: if (issue.type === "array") message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`; else if (issue.type === "string") message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`; else if (issue.type === "number") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`; else if (issue.type === "date") message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`; else message = "Invalid input"; break; case ZodIssueCode.too_big: if (issue.type === "array") message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`; else if (issue.type === "string") message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`; else if (issue.type === "number") message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; else if (issue.type === "bigint") message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; else if (issue.type === "date") message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`; else message = "Invalid input"; break; case ZodIssueCode.custom: message = `Invalid input`; break; case ZodIssueCode.invalid_intersection_types: message = `Intersection results could not be merged`; break; case ZodIssueCode.not_multiple_of: message = `Number must be a multiple of ${issue.multipleOf}`; break; case ZodIssueCode.not_finite: message = "Number must be finite"; break; default: message = _ctx.defaultError; util$4.assertNever(issue); } return { message }; }; let overrideErrorMap = errorMap; function setErrorMap(map2) { overrideErrorMap = map2; } function getErrorMap() { return overrideErrorMap; } const makeIssue = (params) => { const { data: data2, path, errorMaps, issueData } = params; const fullPath = [...path, ...issueData.path || []]; const fullIssue = { ...issueData, path: fullPath }; let errorMessage = ""; const maps = errorMaps.filter((m2) => !!m2).slice().reverse(); for (const map2 of maps) { errorMessage = map2(fullIssue, { data: data2, defaultError: errorMessage }).message; } return { ...issueData, path: fullPath, message: issueData.message || errorMessage }; }; const EMPTY_PATH = []; function addIssueToContext(ctx, issueData) { const issue = makeIssue({ issueData, data: ctx.data, path: ctx.path, errorMaps: [ ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), errorMap // then global default map ].filter((x2) => !!x2) }); ctx.common.issues.push(issue); } class ParseStatus { constructor() { this.value = "valid"; } dirty() { if (this.value === "valid") this.value = "dirty"; } abort() { if (this.value !== "aborted") this.value = "aborted"; } static mergeArray(status, results2) { const arrayValue = []; for (const s2 of results2) { if (s2.status === "aborted") return INVALID; if (s2.status === "dirty") status.dirty(); arrayValue.push(s2.value); } return { status: status.value, value: arrayValue }; } static async mergeObjectAsync(status, pairs) { const syncPairs = []; for (const pair of pairs) { syncPairs.push({ key: await pair.key, value: await pair.value }); } return ParseStatus.mergeObjectSync(status, syncPairs); } static mergeObjectSync(status, pairs) { const finalObject = {}; for (const pair of pairs) { const { key, value } = pair; if (key.status === "aborted") return INVALID; if (value.status === "aborted") return INVALID; if (key.status === "dirty") status.dirty(); if (value.status === "dirty") status.dirty(); if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) { finalObject[key.value] = value.value; } } return { status: status.value, value: finalObject }; } } const INVALID = Object.freeze({ status: "aborted" }); const DIRTY = (value) => ({ status: "dirty", value }); const OK = (value) => ({ status: "valid", value }); const isAborted = (x2) => x2.status === "aborted"; const isDirty = (x2) => x2.status === "dirty"; const isValid = (x2) => x2.status === "valid"; const isAsync = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise; var errorUtil; (function(errorUtil2) { errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {}; errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message; })(errorUtil || (errorUtil = {})); class ParseInputLazyPath { constructor(parent2, value, path, key) { this._cachedPath = []; this.parent = parent2; this.data = value; this._path = path; this._key = key; } get path() { if (!this._cachedPath.length) { if (this._key instanceof Array) { this._cachedPath.push(...this._path, ...this._key); } else { this._cachedPath.push(...this._path, this._key); } } return this._cachedPath; } } const handleResult = (ctx, result) => { if (isValid(result)) { return { success: true, data: result.value }; } else { if (!ctx.common.issues.length) { throw new Error("Validation failed but no issues detected."); } return { success: false, get error() { if (this._error) return this._error; const error2 = new ZodError(ctx.common.issues); this._error = error2; return this._error; } }; } }; function processCreateParams(params) { if (!params) return {}; const { errorMap: errorMap2, invalid_type_error, required_error, description } = params; if (errorMap2 && (invalid_type_error || required_error)) { throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); } if (errorMap2) return { errorMap: errorMap2, description }; const customMap = (iss, ctx) => { if (iss.code !== "invalid_type") return { message: ctx.defaultError }; if (typeof ctx.data === "undefined") { return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError }; } return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError }; }; return { errorMap: customMap, description }; } class ZodType { constructor(def) { this.spa = this.safeParseAsync; this._def = def; 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(input) { return getParsedType(input.data); } _getOrReturnCtx(input, ctx) { return ctx || { common: input.parent.common, data: input.data, parsedType: getParsedType(input.data), schemaErrorMap: this._def.errorMap, path: input.path, parent: input.parent }; } _processInputParams(input) { return { status: new ParseStatus(), ctx: { common: input.parent.common, data: input.data, parsedType: getParsedType(input.data), schemaErrorMap: this._def.errorMap, path: input.path, parent: input.parent } }; } _parseSync(input) { const result = this._parse(input); if (isAsync(result)) { throw new Error("Synchronous parse encountered promise."); } return result; } _parseAsync(input) { const result = this._parse(input); return Promise.resolve(result); } parse(data2, params) { const result = this.safeParse(data2, params); if (result.success) return result.data; throw result.error; } safeParse(data2, params) { var _a2; const ctx = { common: { issues: [], async: (_a2 = params === null || params === void 0 ? void 0 : params.async) !== null && _a2 !== void 0 ? _a2 : false, contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap }, path: (params === null || params === void 0 ? void 0 : params.path) || [], schemaErrorMap: this._def.errorMap, parent: null, data: data2, parsedType: getParsedType(data2) }; const result = this._parseSync({ data: data2, path: ctx.path, parent: ctx }); return handleResult(ctx, result); } async parseAsync(data2, params) { const result = await this.safeParseAsync(data2, params); if (result.success) return result.data; throw result.error; } async safeParseAsync(data2, params) { const ctx = { common: { issues: [], contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap, async: true }, path: (params === null || params === void 0 ? void 0 : params.path) || [], schemaErrorMap: this._def.errorMap, parent: null, data: data2, parsedType: getParsedType(data2) }; const maybeAsyncResult = this._parse({ data: data2, path: ctx.path, parent: ctx }); const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); return handleResult(ctx, result); } refine(check, message) { const getIssueProperties = (val) => { if (typeof message === "string" || typeof message === "undefined") { return { message }; } else if (typeof message === "function") { return message(val); } else { return message; } }; return this._refinement((val, ctx) => { const result = check(val); const setError = () => ctx.addIssue({ code: ZodIssueCode.custom, ...getIssueProperties(val) }); if (typeof Promise !== "undefined" && result instanceof Promise) { return result.then((data2) => { if (!data2) { setError(); return false; } else { return true; } }); } if (!result) { setError(); return false; } else { return true; } }); } refinement(check, refinementData) { return this._refinement((val, ctx) => { if (!check(val)) { ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData); return false; } else { return true; } }); } _refinement(refinement) { return new ZodEffects({ schema: this, typeName: ZodFirstPartyTypeKind.ZodEffects, effect: { type: "refinement", refinement } }); } superRefine(refinement) { return this._refinement(refinement); } optional() { return ZodOptional.create(this, this._def); } nullable() { return ZodNullable.create(this, this._def); } nullish() { return this.nullable().optional(); } array() { return ZodArray.create(this, this._def); } promise() { return ZodPromise.create(this, this._def); } or(option) { return ZodUnion.create([this, option], this._def); } and(incoming) { return ZodIntersection.create(this, incoming, this._def); } transform(transform) { return new ZodEffects({ ...processCreateParams(this._def), schema: this, typeName: ZodFirstPartyTypeKind.ZodEffects, effect: { type: "transform", transform } }); } default(def) { const defaultValueFunc = typeof def === "function" ? def : () => def; return new ZodDefault({ ...processCreateParams(this._def), innerType: this, defaultValue: defaultValueFunc, typeName: ZodFirstPartyTypeKind.ZodDefault }); } brand() { return new ZodBranded({ typeName: ZodFirstPartyTypeKind.ZodBranded, type: this, ...processCreateParams(this._def) }); } catch(def) { const catchValueFunc = typeof def === "function" ? def : () => def; return new ZodCatch({ ...processCreateParams(this._def), innerType: this, catchValue: catchValueFunc, typeName: ZodFirstPartyTypeKind.ZodCatch }); } describe(description) { const This = this.constructor; return new This({ ...this._def, description }); } pipe(target) { return ZodPipeline.create(this, target); } readonly() { return ZodReadonly.create(this); } isOptional() { return this.safeParse(void 0).success; } isNullable() { return this.safeParse(null).success; } } const cuidRegex = /^c[^\s-]{8,}$/i; const cuid2Regex = /^[a-z][a-z0-9]*$/; const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/; const uuidRegex = /^[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; const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; let emojiRegex; const ipv4Regex = /^(((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}))$/; const ipv6Regex = /^(([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})))$/; const datetimeRegex = (args) => { if (args.precision) { if (args.offset) { return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`); } else { return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`); } } else if (args.precision === 0) { if (args.offset) { return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`); } else { return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`); } } else { if (args.offset) { return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`); } else { return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`); } } }; function isValidIP(ip, version2) { if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) { return true; } if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) { return true; } return false; } class ZodString extends ZodType { _parse(input) { if (this._def.coerce) { input.data = String(input.data); } const parsedType = this._getType(input); if (parsedType !== ZodParsedType.string) { const ctx2 = this._getOrReturnCtx(input); addIssueToContext( ctx2, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.string, received: ctx2.parsedType } // ); return INVALID; } const status = new ParseStatus(); let ctx = void 0; for (const check of this._def.checks) { if (check.kind === "min") { if (input.data.length < check.value) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_small, minimum: check.value, type: "string", inclusive: true, exact: false, message: check.message }); status.dirty(); } } else if (check.kind === "max") { if (input.data.length > check.value) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_big, maximum: check.value, type: "string", inclusive: true, exact: false, message: check.message }); status.dirty(); } } else if (check.kind === "length") { const tooBig = input.data.length > check.value; const tooSmall = input.data.length < check.value; if (tooBig || tooSmall) { ctx = this._getOrReturnCtx(input, ctx); if (tooBig) { addIssueToContext(ctx, { code: ZodIssueCode.too_big, maximum: check.value, type: "string", inclusive: true, exact: true, message: check.message }); } else if (tooSmall) { addIssueToContext(ctx, { code: ZodIssueCode.too_small, minimum: check.value, type: "string", inclusive: true, exact: true, message: check.message }); } status.dirty(); } } else if (check.kind === "email") { if (!emailRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "email", code: ZodIssueCode.invalid_string, message: check.message }); status.dirty(); } } else if (check.kind === "emoji") { if (!emojiRegex) { emojiRegex = new RegExp(_emojiRegex, "u"); } if (!emojiRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "emoji", code: ZodIssueCode.invalid_string, message: check.message }); status.dirty(); } } else if (check.kind === "uuid") { if (!uuidRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "uuid", code: ZodIssueCode.invalid_string, message: check.message }); status.dirty(); } } else if (check.kind === "cuid") { if (!cuidRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "cuid", code: ZodIssueCode.invalid_string, message: check.message }); status.dirty(); } } else if (check.kind === "cuid2") { if (!cuid2Regex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "cuid2", code: ZodIssueCode.invalid_string, message: check.message }); status.dirty(); } } else if (check.kind === "ulid") { if (!ulidRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "ulid", code: ZodIssueCode.invalid_string, message: check.message }); status.dirty(); } } else if (check.kind === "url") { try { new URL(input.data); } catch (_a2) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "url", code: ZodIssueCode.invalid_string, message: check.message }); status.dirty(); } } else if (check.kind === "regex") { check.regex.lastIndex = 0; const testResult = check.regex.test(input.data); if (!testResult) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "regex", code: ZodIssueCode.invalid_string, message: check.message }); status.dirty(); } } else if (check.kind === "trim") { input.data = input.data.trim(); } else if (check.kind === "includes") { if (!input.data.includes(check.value, check.position)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.invalid_string, validation: { includes: check.value, position: check.position }, message: check.message }); status.dirty(); } } else if (check.kind === "toLowerCase") { input.data = input.data.toLowerCase(); } else if (check.kind === "toUpperCase") { input.data = input.data.toUpperCase(); } else if (check.kind === "startsWith") { if (!input.data.startsWith(check.value)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.invalid_string, validation: { startsWith: check.value }, message: check.message }); status.dirty(); } } else if (check.kind === "endsWith") { if (!input.data.endsWith(check.value)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.invalid_string, validation: { endsWith: check.value }, message: check.message }); status.dirty(); } } else if (check.kind === "datetime") { const regex2 = datetimeRegex(check); if (!regex2.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.invalid_string, validation: "datetime", message: check.message }); status.dirty(); } } else if (check.kind === "ip") { if (!isValidIP(input.data, check.version)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { validation: "ip", code: ZodIssueCode.invalid_string, message: check.message }); status.dirty(); } } else { util$4.assertNever(check); } } return { status: status.value, value: input.data }; } _regex(regex2, validation, message) { return this.refinement((data2) => regex2.test(data2), { validation, code: ZodIssueCode.invalid_string, ...errorUtil.errToObj(message) }); } _addCheck(check) { return new ZodString({ ...this._def, checks: [...this._def.checks, check] }); } email(message) { return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) }); } url(message) { return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) }); } emoji(message) { return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) }); } uuid(message) { return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) }); } cuid(message) { return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) }); } cuid2(message) { return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) }); } ulid(message) { return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) }); } ip(options) { return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) }); } datetime(options) { var _a2; if (typeof options === "string") { return this._addCheck({ kind: "datetime", precision: null, offset: false, message: options }); } return this._addCheck({ kind: "datetime", precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision, offset: (_a2 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a2 !== void 0 ? _a2 : false, ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message) }); } regex(regex2, message) { return this._addCheck({ kind: "regex", regex: regex2, ...errorUtil.errToObj(message) }); } includes(value, options) { return this._addCheck({ kind: "includes", value, position: options === null || options === void 0 ? void 0 : options.position, ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message) }); } startsWith(value, message) { return this._addCheck({ kind: "startsWith", value, ...errorUtil.errToObj(message) }); } endsWith(value, message) { return this._addCheck({ kind: "endsWith", value, ...errorUtil.errToObj(message) }); } min(minLength, message) { return this._addCheck({ kind: "min", value: minLength, ...errorUtil.errToObj(message) }); } max(maxLength, message) { return this._addCheck({ kind: "max", value: maxLength, ...errorUtil.errToObj(message) }); } length(len2, message) { return this._addCheck({ kind: "length", value: len2, ...errorUtil.errToObj(message) }); } /** * @deprecated Use z.string().min(1) instead. * @see {@link ZodString.min} */ nonempty(message) { return this.min(1, errorUtil.errToObj(message)); } trim() { return new ZodString({ ...this._def, checks: [...this._def.checks, { kind: "trim" }] }); } toLowerCase() { return new ZodString({ ...this._def, checks: [...this._def.checks, { kind: "toLowerCase" }] }); } toUpperCase() { return new ZodString({ ...this._def, checks: [...this._def.checks, { kind: "toUpperCase" }] }); } get isDatetime() { return !!this._def.checks.find((ch2) => ch2.kind === "datetime"); } get isEmail() { return !!this._def.checks.find((ch2) => ch2.kind === "email"); } get isURL() { return !!this._def.checks.find((ch2) => ch2.kind === "url"); } get isEmoji() { return !!this._def.checks.find((ch2) => ch2.kind === "emoji"); } get isUUID() { return !!this._def.checks.find((ch2) => ch2.kind === "uuid"); } get isCUID() { return !!this._def.checks.find((ch2) => ch2.kind === "cuid"); } get isCUID2() { return !!this._def.checks.find((ch2) => ch2.kind === "cuid2"); } get isULID() { return !!this._def.checks.find((ch2) => ch2.kind === "ulid"); } get isIP() { return !!this._def.checks.find((ch2) => ch2.kind === "ip"); } get minLength() { let min2 = null; for (const ch2 of this._def.checks) { if (ch2.kind === "min") { if (min2 === null || ch2.value > min2) min2 = ch2.value; } } return min2; } get maxLength() { let max2 = null; for (const ch2 of this._def.checks) { if (ch2.kind === "max") { if (max2 === null || ch2.value < max2) max2 = ch2.value; } } return max2; } } ZodString.create = (params) => { var _a2; return new ZodString({ checks: [], typeName: ZodFirstPartyTypeKind.ZodString, coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false, ...processCreateParams(params) }); }; function floatSafeRemainder(val, step) { const valDecCount = (val.toString().split(".")[1] || "").length; const stepDecCount = (step.toString().split(".")[1] || "").length; const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; const valInt = parseInt(val.toFixed(decCount).replace(".", "")); const stepInt = parseInt(step.toFixed(decCount).replace(".", "")); return valInt % stepInt / Math.pow(10, decCount); } class ZodNumber extends ZodType { constructor() { super(...arguments); this.min = this.gte; this.max = this.lte; this.step = this.multipleOf; } _parse(input) { if (this._def.coerce) { input.data = Number(input.data); } const parsedType = this._getType(input); if (parsedType !== ZodParsedType.number) { const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.number, received: ctx2.parsedType }); return INVALID; } let ctx = void 0; const status = new ParseStatus(); for (const check of this._def.checks) { if (check.kind === "int") { if (!util$4.isInteger(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: "integer", received: "float", message: check.message }); status.dirty(); } } else if (check.kind === "min") { const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; if (tooSmall) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_small, minimum: check.value, type: "number", inclusive: check.inclusive, exact: false, message: check.message }); status.dirty(); } } else if (check.kind === "max") { const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; if (tooBig) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_big, maximum: check.value, type: "number", inclusive: check.inclusive, exact: false, message: check.message }); status.dirty(); } } else if (check.kind === "multipleOf") { if (floatSafeRemainder(input.data, check.value) !== 0) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.not_multiple_of, multipleOf: check.value, message: check.message }); status.dirty(); } } else if (check.kind === "finite") { if (!Number.isFinite(input.data)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.not_finite, message: check.message }); status.dirty(); } } else { util$4.assertNever(check); } } return { status: status.value, value: input.data }; } gte(value, message) { return this.setLimit("min", value, true, errorUtil.toString(message)); } gt(value, message) { return this.setLimit("min", value, false, errorUtil.toString(message)); } lte(value, message) { return this.setLimit("max", value, true, errorUtil.toString(message)); } lt(value, message) { return this.setLimit("max", value, false, errorUtil.toString(message)); } setLimit(kind, value, inclusive, message) { return new ZodNumber({ ...this._def, checks: [ ...this._def.checks, { kind, value, inclusive, message: errorUtil.toString(message) } ] }); } _addCheck(check) { return new ZodNumber({ ...this._def, checks: [...this._def.checks, check] }); } int(message) { return this._addCheck({ kind: "int", message: errorUtil.toString(message) }); } positive(message) { return this._addCheck({ kind: "min", value: 0, inclusive: false, message: errorUtil.toString(message) }); } negative(message) { return this._addCheck({ kind: "max", value: 0, inclusive: false, message: errorUtil.toString(message) }); } nonpositive(message) { return this._addCheck({ kind: "max", value: 0, inclusive: true, message: errorUtil.toString(message) }); } nonnegative(message) { return this._addCheck({ kind: "min", value: 0, inclusive: true, message: errorUtil.toString(message) }); } multipleOf(value, message) { return this._addCheck({ kind: "multipleOf", value, message: errorUtil.toString(message) }); } finite(message) { return this._addCheck({ kind: "finite", message: errorUtil.toString(message) }); } safe(message) { return this._addCheck({ kind: "min", inclusive: true, value: Number.MIN_SAFE_INTEGER, message: errorUtil.toString(message) })._addCheck({ kind: "max", inclusive: true, value: Number.MAX_SAFE_INTEGER, message: errorUtil.toString(message) }); } get minValue() { let min2 = null; for (const ch2 of this._def.checks) { if (ch2.kind === "min") { if (min2 === null || ch2.value > min2) min2 = ch2.value; } } return min2; } get maxValue() { let max2 = null; for (const ch2 of this._def.checks) { if (ch2.kind === "max") { if (max2 === null || ch2.value < max2) max2 = ch2.value; } } return max2; } get isInt() { return !!this._def.checks.find((ch2) => ch2.kind === "int" || ch2.kind === "multipleOf" && util$4.isInteger(ch2.value)); } get isFinite() { let max2 = null, min2 = null; for (const ch2 of this._def.checks) { if (ch2.kind === "finite" || ch2.kind === "int" || ch2.kind === "multipleOf") { return true; } else if (ch2.kind === "min") { if (min2 === null || ch2.value > min2) min2 = ch2.value; } else if (ch2.kind === "max") { if (max2 === null || ch2.value < max2) max2 = ch2.value; } } return Number.isFinite(min2) && Number.isFinite(max2); } } ZodNumber.create = (params) => { return new ZodNumber({ checks: [], typeName: ZodFirstPartyTypeKind.ZodNumber, coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, ...processCreateParams(params) }); }; class ZodBigInt extends ZodType { constructor() { super(...arguments); this.min = this.gte; this.max = this.lte; } _parse(input) { if (this._def.coerce) { input.data = BigInt(input.data); } const parsedType = this._getType(input); if (parsedType !== ZodParsedType.bigint) { const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.bigint, received: ctx2.parsedType }); return INVALID; } let ctx = void 0; const status = new ParseStatus(); for (const check of this._def.checks) { if (check.kind === "min") { const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; if (tooSmall) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_small, type: "bigint", minimum: check.value, inclusive: check.inclusive, message: check.message }); status.dirty(); } } else if (check.kind === "max") { const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; if (tooBig) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_big, type: "bigint", maximum: check.value, inclusive: check.inclusive, message: check.message }); status.dirty(); } } else if (check.kind === "multipleOf") { if (input.data % check.value !== BigInt(0)) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.not_multiple_of, multipleOf: check.value, message: check.message }); status.dirty(); } } else { util$4.assertNever(check); } } return { status: status.value, value: input.data }; } gte(value, message) { return this.setLimit("min", value, true, errorUtil.toString(message)); } gt(value, message) { return this.setLimit("min", value, false, errorUtil.toString(message)); } lte(value, message) { return this.setLimit("max", value, true, errorUtil.toString(message)); } lt(value, message) { return this.setLimit("max", value, false, errorUtil.toString(message)); } setLimit(kind, value, inclusive, message) { return new ZodBigInt({ ...this._def, checks: [ ...this._def.checks, { kind, value, inclusive, message: errorUtil.toString(message) } ] }); } _addCheck(check) { return new ZodBigInt({ ...this._def, checks: [...this._def.checks, check] }); } positive(message) { return this._addCheck({ kind: "min", value: BigInt(0), inclusive: false, message: errorUtil.toString(message) }); } negative(message) { return this._addCheck({ kind: "max", value: BigInt(0), inclusive: false, message: errorUtil.toString(message) }); } nonpositive(message) { return this._addCheck({ kind: "max", value: BigInt(0), inclusive: true, message: errorUtil.toString(message) }); } nonnegative(message) { return this._addCheck({ kind: "min", value: BigInt(0), inclusive: true, message: errorUtil.toString(message) }); } multipleOf(value, message) { return this._addCheck({ kind: "multipleOf", value, message: errorUtil.toString(message) }); } get minValue() { let min2 = null; for (const ch2 of this._def.checks) { if (ch2.kind === "min") { if (min2 === null || ch2.value > min2) min2 = ch2.value; } } return min2; } get maxValue() { let max2 = null; for (const ch2 of this._def.checks) { if (ch2.kind === "max") { if (max2 === null || ch2.value < max2) max2 = ch2.value; } } return max2; } } ZodBigInt.create = (params) => { var _a2; return new ZodBigInt({ checks: [], typeName: ZodFirstPartyTypeKind.ZodBigInt, coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false, ...processCreateParams(params) }); }; class ZodBoolean extends ZodType { _parse(input) { if (this._def.coerce) { input.data = Boolean(input.data); } const parsedType = this._getType(input); if (parsedType !== ZodParsedType.boolean) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.boolean, received: ctx.parsedType }); return INVALID; } return OK(input.data); } } ZodBoolean.create = (params) => { return new ZodBoolean({ typeName: ZodFirstPartyTypeKind.ZodBoolean, coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, ...processCreateParams(params) }); }; class ZodDate extends ZodType { _parse(input) { if (this._def.coerce) { input.data = new Date(input.data); } const parsedType = this._getType(input); if (parsedType !== ZodParsedType.date) { const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.date, received: ctx2.parsedType }); return INVALID; } if (isNaN(input.data.getTime())) { const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode.invalid_date }); return INVALID; } const status = new ParseStatus(); let ctx = void 0; for (const check of this._def.checks) { if (check.kind === "min") { if (input.data.getTime() < check.value) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_small, message: check.message, inclusive: true, exact: false, minimum: check.value, type: "date" }); status.dirty(); } } else if (check.kind === "max") { if (input.data.getTime() > check.value) { ctx = this._getOrReturnCtx(input, ctx); addIssueToContext(ctx, { code: ZodIssueCode.too_big, message: check.message, inclusive: true, exact: false, maximum: check.value, type: "date" }); status.dirty(); } } else { util$4.assertNever(check); } } return { status: status.value, value: new Date(input.data.getTime()) }; } _addCheck(check) { return new ZodDate({ ...this._def, checks: [...this._def.checks, check] }); } min(minDate, message) { return this._addCheck({ kind: "min", value: minDate.getTime(), message: errorUtil.toString(message) }); } max(maxDate, message) { return this._addCheck({ kind: "max", value: maxDate.getTime(), message: errorUtil.toString(message) }); } get minDate() { let min2 = null; for (const ch2 of this._def.checks) { if (ch2.kind === "min") { if (min2 === null || ch2.value > min2) min2 = ch2.value; } } return min2 != null ? new Date(min2) : null; } get maxDate() { let max2 = null; for (const ch2 of this._def.checks) { if (ch2.kind === "max") { if (max2 === null || ch2.value < max2) max2 = ch2.value; } } return max2 != null ? new Date(max2) : null; } } ZodDate.create = (params) => { return new ZodDate({ checks: [], coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, typeName: ZodFirstPartyTypeKind.ZodDate, ...processCreateParams(params) }); }; class ZodSymbol extends ZodType { _parse(input) { const parsedType = this._getType(input); if (parsedType !== ZodParsedType.symbol) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.symbol, received: ctx.parsedType }); return INVALID; } return OK(input.data); } } ZodSymbol.create = (params) => { return new ZodSymbol({ typeName: ZodFirstPartyTypeKind.ZodSymbol, ...processCreateParams(params) }); }; class ZodUndefined extends ZodType { _parse(input) { const parsedType = this._getType(input); if (parsedType !== ZodParsedType.undefined) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.undefined, received: ctx.parsedType }); return INVALID; } return OK(input.data); } } ZodUndefined.create = (params) => { return new ZodUndefined({ typeName: ZodFirstPartyTypeKind.ZodUndefined, ...processCreateParams(params) }); }; class ZodNull extends ZodType { _parse(input) { const parsedType = this._getType(input); if (parsedType !== ZodParsedType.null) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.null, received: ctx.parsedType }); return INVALID; } return OK(input.data); } } ZodNull.create = (params) => { return new ZodNull({ typeName: ZodFirstPartyTypeKind.ZodNull, ...processCreateParams(params) }); }; class ZodAny extends ZodType { constructor() { super(...arguments); this._any = true; } _parse(input) { return OK(input.data); } } ZodAny.create = (params) => { return new ZodAny({ typeName: ZodFirstPartyTypeKind.ZodAny, ...processCreateParams(params) }); }; class ZodUnknown extends ZodType { constructor() { super(...arguments); this._unknown = true; } _parse(input) { return OK(input.data); } } ZodUnknown.create = (params) => { return new ZodUnknown({ typeName: ZodFirstPartyTypeKind.ZodUnknown, ...processCreateParams(params) }); }; class ZodNever extends ZodType { _parse(input) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.never, received: ctx.parsedType }); return INVALID; } } ZodNever.create = (params) => { return new ZodNever({ typeName: ZodFirstPartyTypeKind.ZodNever, ...processCreateParams(params) }); }; class ZodVoid extends ZodType { _parse(input) { const parsedType = this._getType(input); if (parsedType !== ZodParsedType.undefined) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.void, received: ctx.parsedType }); return INVALID; } return OK(input.data); } } ZodVoid.create = (params) => { return new ZodVoid({ typeName: ZodFirstPartyTypeKind.ZodVoid, ...processCreateParams(params) }); }; class ZodArray extends ZodType { _parse(input) { const { ctx, status } = this._processInputParams(input); const def = this._def; if (ctx.parsedType !== ZodParsedType.array) { addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.array, received: ctx.parsedType }); return INVALID; } if (def.exactLength !== null) { const tooBig = ctx.data.length > def.exactLength.value; const tooSmall = ctx.data.length < def.exactLength.value; if (tooBig || tooSmall) { addIssueToContext(ctx, { code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small, minimum: tooSmall ? def.exactLength.value : void 0, maximum: tooBig ? def.exactLength.value : void 0, type: "array", inclusive: true, exact: true, message: def.exactLength.message }); status.dirty(); } } if (def.minLength !== null) { if (ctx.data.length < def.minLength.value) { addIssueToContext(ctx, { code: ZodIssueCode.too_small, minimum: def.minLength.value, type: "array", inclusive: true, exact: false, message: def.minLength.message }); status.dirty(); } } if (def.maxLength !== null) { if (ctx.data.length > def.maxLength.value) { addIssueToContext(ctx, { code: ZodIssueCode.too_big, maximum: def.maxLength.value, type: "array", inclusive: true, exact: false, message: def.maxLength.message }); status.dirty(); } } if (ctx.common.async) { return Promise.all([...ctx.data].map((item, i2) => { return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i2)); })).then((result2) => { return ParseStatus.mergeArray(status, result2); }); } const result = [...ctx.data].map((item, i2) => { return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i2)); }); return ParseStatus.mergeArray(status, result); } get element() { return this._def.type; } min(minLength, message) { return new ZodArray({ ...this._def, minLength: { value: minLength, message: errorUtil.toString(message) } }); } max(maxLength, message) { return new ZodArray({ ...this._def, maxLength: { value: maxLength, message: errorUtil.toString(message) } }); } length(len2, message) { return new ZodArray({ ...this._def, exactLength: { value: len2, message: errorUtil.toString(message) } }); } nonempty(message) { return this.min(1, message); } } ZodArray.create = (schema, params) => { return new ZodArray({ type: schema, minLength: null, maxLength: null, exactLength: null, typeName: ZodFirstPartyTypeKind.ZodArray, ...processCreateParams(params) }); }; function deepPartialify(schema) { if (schema instanceof ZodObject) { const newShape = {}; for (const key in schema.shape) { const fieldSchema = schema.shape[key]; newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)); } return new ZodObject({ ...schema._def, shape: () => newShape }); } else if (schema instanceof ZodArray) { return new ZodArray({ ...schema._def, type: deepPartialify(schema.element) }); } else if (schema instanceof ZodOptional) { return ZodOptional.create(deepPartialify(schema.unwrap())); } else if (schema instanceof ZodNullable) { return ZodNullable.create(deepPartialify(schema.unwrap())); } else if (schema instanceof ZodTuple) { return ZodTuple.create(schema.items.map((item) => deepPartialify(item))); } else { return schema; } } class ZodObject extends ZodType { constructor() { super(...arguments); this._cached = null; this.nonstrict = this.passthrough; this.augment = this.extend; } _getCached() { if (this._cached !== null) return this._cached; const shape = this._def.shape(); const keys2 = util$4.objectKeys(shape); return this._cached = { shape, keys: keys2 }; } _parse(input) { const parsedType = this._getType(input); if (parsedType !== ZodParsedType.object) { const ctx2 = this._getOrReturnCtx(input); addIssueToContext(ctx2, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.object, received: ctx2.parsedType }); return INVALID; } const { status, ctx } = this._processInputParams(input); const { shape, keys: shapeKeys } = this._getCached(); const extraKeys = []; if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) { for (const key in ctx.data) { if (!shapeKeys.includes(key)) { extraKeys.push(key); } } } const pairs = []; for (const key of shapeKeys) { const keyValidator = shape[key]; const value = ctx.data[key]; pairs.push({ key: { status: "valid", value: key }, value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)), alwaysSet: key in ctx.data }); } if (this._def.catchall instanceof ZodNever) { const unknownKeys = this._def.unknownKeys; if (unknownKeys === "passthrough") { for (const key of extraKeys) { pairs.push({ key: { status: "valid", value: key }, value: { status: "valid", value: ctx.data[key] } }); } } else if (unknownKeys === "strict") { if (extraKeys.length > 0) { addIssueToContext(ctx, { code: ZodIssueCode.unrecognized_keys, keys: extraKeys }); status.dirty(); } } else if (unknownKeys === "strip") ; else { throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); } } else { const catchall = this._def.catchall; for (const key of extraKeys) { const value = ctx.data[key]; pairs.push({ key: { status: "valid", value: key }, value: catchall._parse( new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value) ), alwaysSet: key in ctx.data }); } } if (ctx.common.async) { return Promise.resolve().then(async () => { const syncPairs = []; for (const pair of pairs) { const key = await pair.key; syncPairs.push({ key, value: await pair.value, alwaysSet: pair.alwaysSet }); } return syncPairs; }).then((syncPairs) => { return ParseStatus.mergeObjectSync(status, syncPairs); }); } else { return ParseStatus.mergeObjectSync(status, pairs); } } get shape() { return this._def.shape(); } strict(message) { errorUtil.errToObj; return new ZodObject({ ...this._def, unknownKeys: "strict", ...message !== void 0 ? { errorMap: (issue, ctx) => { var _a2, _b2, _c2, _d; const defaultError = (_c2 = (_b2 = (_a2 = this._def).errorMap) === null || _b2 === void 0 ? void 0 : _b2.call(_a2, issue, ctx).message) !== null && _c2 !== void 0 ? _c2 : ctx.defaultError; if (issue.code === "unrecognized_keys") return { message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError }; return { message: defaultError }; } } : {} }); } strip() { return new ZodObject({ ...this._def, unknownKeys: "strip" }); } passthrough() { return new ZodObject({ ...this._def, unknownKeys: "passthrough" }); } // const AugmentFactory = // (def: Def) => // ( // augmentation: Augmentation // ): ZodObject< // extendShape, Augmentation>, // Def["unknownKeys"], // Def["catchall"] // > => { // return new ZodObject({ // ...def, // shape: () => ({ // ...def.shape(), // ...augmentation, // }), // }) as any; // }; extend(augmentation) { return new ZodObject({ ...this._def, shape: () => ({ ...this._def.shape(), ...augmentation }) }); } /** * Prior to zod@1.0.12 there was a bug in the * inferred type of merged objects. Please * upgrade if you are experiencing issues. */ merge(merging) { const merged = new ZodObject({ unknownKeys: merging._def.unknownKeys, catchall: merging._def.catchall, shape: () => ({ ...this._def.shape(), ...merging._def.shape() }), typeName: ZodFirstPartyTypeKind.ZodObject }); return merged; } // merge< // Incoming extends AnyZodObject, // Augmentation extends Incoming["shape"], // NewOutput extends { // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation // ? Augmentation[k]["_output"] // : k extends keyof Output // ? Output[k] // : never; // }, // NewInput extends { // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation // ? Augmentation[k]["_input"] // : k extends keyof Input // ? Input[k] // : never; // } // >( // merging: Incoming // ): ZodObject< // extendShape>, // Incoming["_def"]["unknownKeys"], // Incoming["_def"]["catchall"], // NewOutput, // NewInput // > { // const merged: any = new ZodObject({ // unknownKeys: merging._def.unknownKeys, // catchall: merging._def.catchall, // shape: () => // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), // typeName: ZodFirstPartyTypeKind.ZodObject, // }) as any; // return merged; // } setKey(key, schema) { return this.augment({ [key]: schema }); } // merge( // merging: Incoming // ): //ZodObject = (merging) => { // ZodObject< // extendShape>, // Incoming["_def"]["unknownKeys"], // Incoming["_def"]["catchall"] // > { // // const mergedShape = objectUtil.mergeShapes( // // this._def.shape(), // // merging._def.shape() // // ); // const merged: any = new ZodObject({ // unknownKeys: merging._def.unknownKeys, // catchall: merging._def.catchall, // shape: () => // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), // typeName: ZodFirstPartyTypeKind.ZodObject, // }) as any; // return merged; // } catchall(index2) { return new ZodObject({ ...this._def, catchall: index2 }); } pick(mask2) { const shape = {}; util$4.objectKeys(mask2).forEach((key) => { if (mask2[key] && this.shape[key]) { shape[key] = this.shape[key]; } }); return new ZodObject({ ...this._def, shape: () => shape }); } omit(mask2) { const shape = {}; util$4.objectKeys(this.shape).forEach((key) => { if (!mask2[key]) { shape[key] = this.shape[key]; } }); return new ZodObject({ ...this._def, shape: () => shape }); } /** * @deprecated */ deepPartial() { return deepPartialify(this); } partial(mask2) { const newShape = {}; util$4.objectKeys(this.shape).forEach((key) => { const fieldSchema = this.shape[key]; if (mask2 && !mask2[key]) { newShape[key] = fieldSchema; } else { newShape[key] = fieldSchema.optional(); } }); return new ZodObject({ ...this._def, shape: () => newShape }); } required(mask2) { const newShape = {}; util$4.objectKeys(this.shape).forEach((key) => { if (mask2 && !mask2[key]) { newShape[key] = this.shape[key]; } else { const fieldSchema = this.shape[key]; let newField = fieldSchema; while (newField instanceof ZodOptional) { newField = newField._def.innerType; } newShape[key] = newField; } }); return new ZodObject({ ...this._def, shape: () => newShape }); } keyof() { return createZodEnum(util$4.objectKeys(this.shape)); } } ZodObject.create = (shape, params) => { return new ZodObject({ shape: () => shape, unknownKeys: "strip", catchall: ZodNever.create(), typeName: ZodFirstPartyTypeKind.ZodObject, ...processCreateParams(params) }); }; ZodObject.strictCreate = (shape, params) => { return new ZodObject({ shape: () => shape, unknownKeys: "strict", catchall: ZodNever.create(), typeName: ZodFirstPartyTypeKind.ZodObject, ...processCreateParams(params) }); }; ZodObject.lazycreate = (shape, params) => { return new ZodObject({ shape, unknownKeys: "strip", catchall: ZodNever.create(), typeName: ZodFirstPartyTypeKind.ZodObject, ...processCreateParams(params) }); }; class ZodUnion extends ZodType { _parse(input) { const { ctx } = this._processInputParams(input); const options = this._def.options; function handleResults(results2) { for (const result of results2) { if (result.result.status === "valid") { return result.result; } } for (const result of results2) { if (result.result.status === "dirty") { ctx.common.issues.push(...result.ctx.common.issues); return result.result; } } const unionErrors = results2.map((result) => new ZodError(result.ctx.common.issues)); addIssueToContext(ctx, { code: ZodIssueCode.invalid_union, unionErrors }); return INVALID; } if (ctx.common.async) { return Promise.all(options.map(async (option) => { const childCtx = { ...ctx, common: { ...ctx.common, issues: [] }, parent: null }; return { result: await option._parseAsync({ data: ctx.data, path: ctx.path, parent: childCtx }), ctx: childCtx }; })).then(handleResults); } else { let dirty = void 0; const issues = []; for (const option of options) { const childCtx = { ...ctx, common: { ...ctx.common, issues: [] }, parent: null }; const result = option._parseSync({ data: ctx.data, path: ctx.path, parent: childCtx }); if (result.status === "valid") { return result; } else if (result.status === "dirty" && !dirty) { dirty = { result, ctx: childCtx }; } if (childCtx.common.issues.length) { issues.push(childCtx.common.issues); } } if (dirty) { ctx.common.issues.push(...dirty.ctx.common.issues); return dirty.result; } const unionErrors = issues.map((issues2) => new ZodError(issues2)); addIssueToContext(ctx, { code: ZodIssueCode.invalid_union, unionErrors }); return INVALID; } } get options() { return this._def.options; } } ZodUnion.create = (types2, params) => { return new ZodUnion({ options: types2, typeName: ZodFirstPartyTypeKind.ZodUnion, ...processCreateParams(params) }); }; const getDiscriminator = (type2) => { if (type2 instanceof ZodLazy) { return getDiscriminator(type2.schema); } else if (type2 instanceof ZodEffects) { return getDiscriminator(type2.innerType()); } else if (type2 instanceof ZodLiteral) { return [type2.value]; } else if (type2 instanceof ZodEnum) { return type2.options; } else if (type2 instanceof ZodNativeEnum) { return Object.keys(type2.enum); } else if (type2 instanceof ZodDefault) { return getDiscriminator(type2._def.innerType); } else if (type2 instanceof ZodUndefined) { return [void 0]; } else if (type2 instanceof ZodNull) { return [null]; } else { return null; } }; class ZodDiscriminatedUnion extends ZodType { _parse(input) { const { ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.object) { addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.object, received: ctx.parsedType }); return INVALID; } const discriminator = this.discriminator; const discriminatorValue = ctx.data[discriminator]; const option = this.optionsMap.get(discriminatorValue); if (!option) { addIssueToContext(ctx, { code: ZodIssueCode.invalid_union_discriminator, options: Array.from(this.optionsMap.keys()), path: [discriminator] }); return INVALID; } if (ctx.common.async) { return option._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }); } else { return option._parseSync({ data: ctx.data, path: ctx.path, parent: ctx }); } } get discriminator() { return this._def.discriminator; } get options() { return this._def.options; } get optionsMap() { return this._def.optionsMap; } /** * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. * However, it only allows a union of objects, all of which need to share a discriminator property. This property must * have a different value for each object in the union. * @param discriminator the name of the discriminator property * @param types an array of object schemas * @param params */ static create(discriminator, options, params) { const optionsMap = /* @__PURE__ */ new Map(); for (const type2 of options) { const discriminatorValues = getDiscriminator(type2.shape[discriminator]); if (!discriminatorValues) { throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); } for (const value of discriminatorValues) { if (optionsMap.has(value)) { throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); } optionsMap.set(value, type2); } } return new ZodDiscriminatedUnion({ typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion, discriminator, options, optionsMap, ...processCreateParams(params) }); } } function mergeValues(a2, b2) { const aType = getParsedType(a2); const bType = getParsedType(b2); if (a2 === b2) { return { valid: true, data: a2 }; } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) { const bKeys = util$4.objectKeys(b2); const sharedKeys = util$4.objectKeys(a2).filter((key) => bKeys.indexOf(key) !== -1); const newObj = { ...a2, ...b2 }; for (const key of sharedKeys) { const sharedValue = mergeValues(a2[key], b2[key]); if (!sharedValue.valid) { return { valid: false }; } newObj[key] = sharedValue.data; } return { valid: true, data: newObj }; } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) { if (a2.length !== b2.length) { return { valid: false }; } const newArray = []; for (let index2 = 0; index2 < a2.length; index2++) { const itemA = a2[index2]; const itemB = b2[index2]; const sharedValue = mergeValues(itemA, itemB); if (!sharedValue.valid) { return { valid: false }; } newArray.push(sharedValue.data); } return { valid: true, data: newArray }; } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a2 === +b2) { return { valid: true, data: a2 }; } else { return { valid: false }; } } class ZodIntersection extends ZodType { _parse(input) { const { status, ctx } = this._processInputParams(input); const handleParsed = (parsedLeft, parsedRight) => { if (isAborted(parsedLeft) || isAborted(parsedRight)) { return INVALID; } const merged = mergeValues(parsedLeft.value, parsedRight.value); if (!merged.valid) { addIssueToContext(ctx, { code: ZodIssueCode.invalid_intersection_types }); return INVALID; } if (isDirty(parsedLeft) || isDirty(parsedRight)) { status.dirty(); } return { status: status.value, value: merged.data }; }; if (ctx.common.async) { return Promise.all([ this._def.left._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }), this._def.right._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }) ]).then(([left, right]) => handleParsed(left, right)); } else { return handleParsed(this._def.left._parseSync({ data: ctx.data, path: ctx.path, parent: ctx }), this._def.right._parseSync({ data: ctx.data, path: ctx.path, parent: ctx })); } } } ZodIntersection.create = (left, right, params) => { return new ZodIntersection({ left, right, typeName: ZodFirstPartyTypeKind.ZodIntersection, ...processCreateParams(params) }); }; class ZodTuple extends ZodType { _parse(input) { const { status, ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.array) { addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.array, received: ctx.parsedType }); return INVALID; } if (ctx.data.length < this._def.items.length) { addIssueToContext(ctx, { code: ZodIssueCode.too_small, minimum: this._def.items.length, inclusive: true, exact: false, type: "array" }); return INVALID; } const rest = this._def.rest; if (!rest && ctx.data.length > this._def.items.length) { addIssueToContext(ctx, { code: ZodIssueCode.too_big, maximum: this._def.items.length, inclusive: true, exact: false, type: "array" }); status.dirty(); } const items = [...ctx.data].map((item, itemIndex) => { const schema = this._def.items[itemIndex] || this._def.rest; if (!schema) return null; return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex)); }).filter((x2) => !!x2); if (ctx.common.async) { return Promise.all(items).then((results2) => { return ParseStatus.mergeArray(status, results2); }); } else { return ParseStatus.mergeArray(status, items); } } get items() { return this._def.items; } rest(rest) { return new ZodTuple({ ...this._def, rest }); } } ZodTuple.create = (schemas, params) => { if (!Array.isArray(schemas)) { throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); } return new ZodTuple({ items: schemas, typeName: ZodFirstPartyTypeKind.ZodTuple, rest: null, ...processCreateParams(params) }); }; class ZodRecord extends ZodType { get keySchema() { return this._def.keyType; } get valueSchema() { return this._def.valueType; } _parse(input) { const { status, ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.object) { addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.object, received: ctx.parsedType }); return INVALID; } const pairs = []; const keyType = this._def.keyType; const valueType = this._def.valueType; for (const key in ctx.data) { pairs.push({ key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)), value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)) }); } if (ctx.common.async) { return ParseStatus.mergeObjectAsync(status, pairs); } else { return ParseStatus.mergeObjectSync(status, pairs); } } get element() { return this._def.valueType; } static create(first, second, third) { if (second instanceof ZodType) { return new ZodRecord({ keyType: first, valueType: second, typeName: ZodFirstPartyTypeKind.ZodRecord, ...processCreateParams(third) }); } return new ZodRecord({ keyType: ZodString.create(), valueType: first, typeName: ZodFirstPartyTypeKind.ZodRecord, ...processCreateParams(second) }); } } class ZodMap extends ZodType { get keySchema() { return this._def.keyType; } get valueSchema() { return this._def.valueType; } _parse(input) { const { status, ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.map) { addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.map, received: ctx.parsedType }); return INVALID; } const keyType = this._def.keyType; const valueType = this._def.valueType; const pairs = [...ctx.data.entries()].map(([key, value], index2) => { return { key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index2, "key"])), value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index2, "value"])) }; }); if (ctx.common.async) { const finalMap = /* @__PURE__ */ new Map(); return Promise.resolve().then(async () => { for (const pair of pairs) { const key = await pair.key; const value = await pair.value; if (key.status === "aborted" || value.status === "aborted") { return INVALID; } if (key.status === "dirty" || value.status === "dirty") { status.dirty(); } finalMap.set(key.value, value.value); } return { status: status.value, value: finalMap }; }); } else { const finalMap = /* @__PURE__ */ new Map(); for (const pair of pairs) { const key = pair.key; const value = pair.value; if (key.status === "aborted" || value.status === "aborted") { return INVALID; } if (key.status === "dirty" || value.status === "dirty") { status.dirty(); } finalMap.set(key.value, value.value); } return { status: status.value, value: finalMap }; } } } ZodMap.create = (keyType, valueType, params) => { return new ZodMap({ valueType, keyType, typeName: ZodFirstPartyTypeKind.ZodMap, ...processCreateParams(params) }); }; class ZodSet extends ZodType { _parse(input) { const { status, ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.set) { addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.set, received: ctx.parsedType }); return INVALID; } const def = this._def; if (def.minSize !== null) { if (ctx.data.size < def.minSize.value) { addIssueToContext(ctx, { code: ZodIssueCode.too_small, minimum: def.minSize.value, type: "set", inclusive: true, exact: false, message: def.minSize.message }); status.dirty(); } } if (def.maxSize !== null) { if (ctx.data.size > def.maxSize.value) { addIssueToContext(ctx, { code: ZodIssueCode.too_big, maximum: def.maxSize.value, type: "set", inclusive: true, exact: false, message: def.maxSize.message }); status.dirty(); } } const valueType = this._def.valueType; function finalizeSet(elements2) { const parsedSet = /* @__PURE__ */ new Set(); for (const element of elements2) { if (element.status === "aborted") return INVALID; if (element.status === "dirty") status.dirty(); parsedSet.add(element.value); } return { status: status.value, value: parsedSet }; } const elements = [...ctx.data.values()].map((item, i2) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i2))); if (ctx.common.async) { return Promise.all(elements).then((elements2) => finalizeSet(elements2)); } else { return finalizeSet(elements); } } min(minSize, message) { return new ZodSet({ ...this._def, minSize: { value: minSize, message: errorUtil.toString(message) } }); } max(maxSize, message) { return new ZodSet({ ...this._def, maxSize: { value: maxSize, message: errorUtil.toString(message) } }); } size(size2, message) { return this.min(size2, message).max(size2, message); } nonempty(message) { return this.min(1, message); } } ZodSet.create = (valueType, params) => { return new ZodSet({ valueType, minSize: null, maxSize: null, typeName: ZodFirstPartyTypeKind.ZodSet, ...processCreateParams(params) }); }; class ZodFunction extends ZodType { constructor() { super(...arguments); this.validate = this.implement; } _parse(input) { const { ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.function) { addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.function, received: ctx.parsedType }); return INVALID; } function makeArgsIssue(args, error2) { return makeIssue({ data: args, path: ctx.path, errorMaps: [ ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), errorMap ].filter((x2) => !!x2), issueData: { code: ZodIssueCode.invalid_arguments, argumentsError: error2 } }); } function makeReturnsIssue(returns, error2) { return makeIssue({ data: returns, path: ctx.path, errorMaps: [ ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), errorMap ].filter((x2) => !!x2), issueData: { code: ZodIssueCode.invalid_return_type, returnTypeError: error2 } }); } const params = { errorMap: ctx.common.contextualErrorMap }; const fn2 = ctx.data; if (this._def.returns instanceof ZodPromise) { const me2 = this; return OK(async function(...args) { const error2 = new ZodError([]); const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e2) => { error2.addIssue(makeArgsIssue(args, e2)); throw error2; }); const result = await Reflect.apply(fn2, this, parsedArgs); const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e2) => { error2.addIssue(makeReturnsIssue(result, e2)); throw error2; }); return parsedReturns; }); } else { const me2 = this; return OK(function(...args) { const parsedArgs = me2._def.args.safeParse(args, params); if (!parsedArgs.success) { throw new ZodError([makeArgsIssue(args, parsedArgs.error)]); } const result = Reflect.apply(fn2, this, parsedArgs.data); const parsedReturns = me2._def.returns.safeParse(result, params); if (!parsedReturns.success) { throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]); } return parsedReturns.data; }); } } parameters() { return this._def.args; } returnType() { return this._def.returns; } args(...items) { return new ZodFunction({ ...this._def, args: ZodTuple.create(items).rest(ZodUnknown.create()) }); } returns(returnType) { return new ZodFunction({ ...this._def, returns: returnType }); } implement(func2) { const validatedFunc = this.parse(func2); return validatedFunc; } strictImplement(func2) { const validatedFunc = this.parse(func2); return validatedFunc; } static create(args, returns, params) { return new ZodFunction({ args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()), returns: returns || ZodUnknown.create(), typeName: ZodFirstPartyTypeKind.ZodFunction, ...processCreateParams(params) }); } } class ZodLazy extends ZodType { get schema() { return this._def.getter(); } _parse(input) { const { ctx } = this._processInputParams(input); const lazySchema = this._def.getter(); return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx }); } } ZodLazy.create = (getter, params) => { return new ZodLazy({ getter, typeName: ZodFirstPartyTypeKind.ZodLazy, ...processCreateParams(params) }); }; class ZodLiteral extends ZodType { _parse(input) { if (input.data !== this._def.value) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { received: ctx.data, code: ZodIssueCode.invalid_literal, expected: this._def.value }); return INVALID; } return { status: "valid", value: input.data }; } get value() { return this._def.value; } } ZodLiteral.create = (value, params) => { return new ZodLiteral({ value, typeName: ZodFirstPartyTypeKind.ZodLiteral, ...processCreateParams(params) }); }; function createZodEnum(values, params) { return new ZodEnum({ values, typeName: ZodFirstPartyTypeKind.ZodEnum, ...processCreateParams(params) }); } class ZodEnum extends ZodType { _parse(input) { if (typeof input.data !== "string") { const ctx = this._getOrReturnCtx(input); const expectedValues = this._def.values; addIssueToContext(ctx, { expected: util$4.joinValues(expectedValues), received: ctx.parsedType, code: ZodIssueCode.invalid_type }); return INVALID; } if (this._def.values.indexOf(input.data) === -1) { const ctx = this._getOrReturnCtx(input); const expectedValues = this._def.values; addIssueToContext(ctx, { received: ctx.data, code: ZodIssueCode.invalid_enum_value, options: expectedValues }); return INVALID; } return OK(input.data); } get options() { return this._def.values; } get enum() { const enumValues = {}; for (const val of this._def.values) { enumValues[val] = val; } return enumValues; } get Values() { const enumValues = {}; for (const val of this._def.values) { enumValues[val] = val; } return enumValues; } get Enum() { const enumValues = {}; for (const val of this._def.values) { enumValues[val] = val; } return enumValues; } extract(values) { return ZodEnum.create(values); } exclude(values) { return ZodEnum.create(this.options.filter((opt) => !values.includes(opt))); } } ZodEnum.create = createZodEnum; class ZodNativeEnum extends ZodType { _parse(input) { const nativeEnumValues = util$4.getValidEnumValues(this._def.values); const ctx = this._getOrReturnCtx(input); if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) { const expectedValues = util$4.objectValues(nativeEnumValues); addIssueToContext(ctx, { expected: util$4.joinValues(expectedValues), received: ctx.parsedType, code: ZodIssueCode.invalid_type }); return INVALID; } if (nativeEnumValues.indexOf(input.data) === -1) { const expectedValues = util$4.objectValues(nativeEnumValues); addIssueToContext(ctx, { received: ctx.data, code: ZodIssueCode.invalid_enum_value, options: expectedValues }); return INVALID; } return OK(input.data); } get enum() { return this._def.values; } } ZodNativeEnum.create = (values, params) => { return new ZodNativeEnum({ values, typeName: ZodFirstPartyTypeKind.ZodNativeEnum, ...processCreateParams(params) }); }; class ZodPromise extends ZodType { unwrap() { return this._def.type; } _parse(input) { const { ctx } = this._processInputParams(input); if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) { addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.promise, received: ctx.parsedType }); return INVALID; } const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data); return OK(promisified.then((data2) => { return this._def.type.parseAsync(data2, { path: ctx.path, errorMap: ctx.common.contextualErrorMap }); })); } } ZodPromise.create = (schema, params) => { return new ZodPromise({ type: schema, typeName: ZodFirstPartyTypeKind.ZodPromise, ...processCreateParams(params) }); }; class ZodEffects extends ZodType { innerType() { return this._def.schema; } sourceType() { return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema; } _parse(input) { const { status, ctx } = this._processInputParams(input); const effect = this._def.effect || null; const checkCtx = { addIssue: (arg) => { addIssueToContext(ctx, arg); if (arg.fatal) { status.abort(); } else { status.dirty(); } }, get path() { return ctx.path; } }; checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); if (effect.type === "preprocess") { const processed = effect.transform(ctx.data, checkCtx); if (ctx.common.issues.length) { return { status: "dirty", value: ctx.data }; } if (ctx.common.async) { return Promise.resolve(processed).then((processed2) => { return this._def.schema._parseAsync({ data: processed2, path: ctx.path, parent: ctx }); }); } else { return this._def.schema._parseSync({ data: processed, path: ctx.path, parent: ctx }); } } if (effect.type === "refinement") { const executeRefinement = (acc) => { const result = effect.refinement(acc, checkCtx); if (ctx.common.async) { return Promise.resolve(result); } if (result instanceof Promise) { throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); } return acc; }; if (ctx.common.async === false) { const inner = this._def.schema._parseSync({ data: ctx.data, path: ctx.path, parent: ctx }); if (inner.status === "aborted") return INVALID; if (inner.status === "dirty") status.dirty(); executeRefinement(inner.value); return { status: status.value, value: inner.value }; } else { return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => { if (inner.status === "aborted") return INVALID; if (inner.status === "dirty") status.dirty(); return executeRefinement(inner.value).then(() => { return { status: status.value, value: inner.value }; }); }); } } if (effect.type === "transform") { if (ctx.common.async === false) { const base3 = this._def.schema._parseSync({ data: ctx.data, path: ctx.path, parent: ctx }); if (!isValid(base3)) return base3; const result = effect.transform(base3.value, checkCtx); if (result instanceof Promise) { throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); } return { status: status.value, value: result }; } else { return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base3) => { if (!isValid(base3)) return base3; return Promise.resolve(effect.transform(base3.value, checkCtx)).then((result) => ({ status: status.value, value: result })); }); } } util$4.assertNever(effect); } } ZodEffects.create = (schema, effect, params) => { return new ZodEffects({ schema, typeName: ZodFirstPartyTypeKind.ZodEffects, effect, ...processCreateParams(params) }); }; ZodEffects.createWithPreprocess = (preprocess, schema, params) => { return new ZodEffects({ schema, effect: { type: "preprocess", transform: preprocess }, typeName: ZodFirstPartyTypeKind.ZodEffects, ...processCreateParams(params) }); }; class ZodOptional extends ZodType { _parse(input) { const parsedType = this._getType(input); if (parsedType === ZodParsedType.undefined) { return OK(void 0); } return this._def.innerType._parse(input); } unwrap() { return this._def.innerType; } } ZodOptional.create = (type2, params) => { return new ZodOptional({ innerType: type2, typeName: ZodFirstPartyTypeKind.ZodOptional, ...processCreateParams(params) }); }; class ZodNullable extends ZodType { _parse(input) { const parsedType = this._getType(input); if (parsedType === ZodParsedType.null) { return OK(null); } return this._def.innerType._parse(input); } unwrap() { return this._def.innerType; } } ZodNullable.create = (type2, params) => { return new ZodNullable({ innerType: type2, typeName: ZodFirstPartyTypeKind.ZodNullable, ...processCreateParams(params) }); }; class ZodDefault extends ZodType { _parse(input) { const { ctx } = this._processInputParams(input); let data2 = ctx.data; if (ctx.parsedType === ZodParsedType.undefined) { data2 = this._def.defaultValue(); } return this._def.innerType._parse({ data: data2, path: ctx.path, parent: ctx }); } removeDefault() { return this._def.innerType; } } ZodDefault.create = (type2, params) => { return new ZodDefault({ innerType: type2, typeName: ZodFirstPartyTypeKind.ZodDefault, defaultValue: typeof params.default === "function" ? params.default : () => params.default, ...processCreateParams(params) }); }; class ZodCatch extends ZodType { _parse(input) { const { ctx } = this._processInputParams(input); const newCtx = { ...ctx, common: { ...ctx.common, issues: [] } }; const result = this._def.innerType._parse({ data: newCtx.data, path: newCtx.path, parent: { ...newCtx } }); if (isAsync(result)) { return result.then((result2) => { return { status: "valid", value: result2.status === "valid" ? result2.value : this._def.catchValue({ get error() { return new ZodError(newCtx.common.issues); }, input: newCtx.data }) }; }); } else { return { status: "valid", value: result.status === "valid" ? result.value : this._def.catchValue({ get error() { return new ZodError(newCtx.common.issues); }, input: newCtx.data }) }; } } removeCatch() { return this._def.innerType; } } ZodCatch.create = (type2, params) => { return new ZodCatch({ innerType: type2, typeName: ZodFirstPartyTypeKind.ZodCatch, catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, ...processCreateParams(params) }); }; class ZodNaN extends ZodType { _parse(input) { const parsedType = this._getType(input); if (parsedType !== ZodParsedType.nan) { const ctx = this._getOrReturnCtx(input); addIssueToContext(ctx, { code: ZodIssueCode.invalid_type, expected: ZodParsedType.nan, received: ctx.parsedType }); return INVALID; } return { status: "valid", value: input.data }; } } ZodNaN.create = (params) => { return new ZodNaN({ typeName: ZodFirstPartyTypeKind.ZodNaN, ...processCreateParams(params) }); }; const BRAND = Symbol("zod_brand"); class ZodBranded extends ZodType { _parse(input) { const { ctx } = this._processInputParams(input); const data2 = ctx.data; return this._def.type._parse({ data: data2, path: ctx.path, parent: ctx }); } unwrap() { return this._def.type; } } class ZodPipeline extends ZodType { _parse(input) { const { status, ctx } = this._processInputParams(input); if (ctx.common.async) { const handleAsync = async () => { const inResult = await this._def.in._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }); if (inResult.status === "aborted") return INVALID; if (inResult.status === "dirty") { status.dirty(); return DIRTY(inResult.value); } else { return this._def.out._parseAsync({ data: inResult.value, path: ctx.path, parent: ctx }); } }; return handleAsync(); } else { const inResult = this._def.in._parseSync({ data: ctx.data, path: ctx.path, parent: ctx }); if (inResult.status === "aborted") return INVALID; if (inResult.status === "dirty") { status.dirty(); return { status: "dirty", value: inResult.value }; } else { return this._def.out._parseSync({ data: inResult.value, path: ctx.path, parent: ctx }); } } } static create(a2, b2) { return new ZodPipeline({ in: a2, out: b2, typeName: ZodFirstPartyTypeKind.ZodPipeline }); } } class ZodReadonly extends ZodType { _parse(input) { const result = this._def.innerType._parse(input); if (isValid(result)) { result.value = Object.freeze(result.value); } return result; } } ZodReadonly.create = (type2, params) => { return new ZodReadonly({ innerType: type2, typeName: ZodFirstPartyTypeKind.ZodReadonly, ...processCreateParams(params) }); }; const custom = (check, params = {}, fatal) => { if (check) return ZodAny.create().superRefine((data2, ctx) => { var _a2, _b2; if (!check(data2)) { const p2 = typeof params === "function" ? params(data2) : typeof params === "string" ? { message: params } : params; const _fatal = (_b2 = (_a2 = p2.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b2 !== void 0 ? _b2 : true; const p22 = typeof p2 === "string" ? { message: p2 } : p2; ctx.addIssue({ code: "custom", ...p22, fatal: _fatal }); } }); return ZodAny.create(); }; const late = { object: ZodObject.lazycreate }; var ZodFirstPartyTypeKind; (function(ZodFirstPartyTypeKind2) { ZodFirstPartyTypeKind2["ZodString"] = "ZodString"; ZodFirstPartyTypeKind2["ZodNumber"] = "ZodNumber"; ZodFirstPartyTypeKind2["ZodNaN"] = "ZodNaN"; ZodFirstPartyTypeKind2["ZodBigInt"] = "ZodBigInt"; ZodFirstPartyTypeKind2["ZodBoolean"] = "ZodBoolean"; ZodFirstPartyTypeKind2["ZodDate"] = "ZodDate"; ZodFirstPartyTypeKind2["ZodSymbol"] = "ZodSymbol"; ZodFirstPartyTypeKind2["ZodUndefined"] = "ZodUndefined"; ZodFirstPartyTypeKind2["ZodNull"] = "ZodNull"; ZodFirstPartyTypeKind2["ZodAny"] = "ZodAny"; ZodFirstPartyTypeKind2["ZodUnknown"] = "ZodUnknown"; ZodFirstPartyTypeKind2["ZodNever"] = "ZodNever"; ZodFirstPartyTypeKind2["ZodVoid"] = "ZodVoid"; ZodFirstPartyTypeKind2["ZodArray"] = "ZodArray"; ZodFirstPartyTypeKind2["ZodObject"] = "ZodObject"; ZodFirstPartyTypeKind2["ZodUnion"] = "ZodUnion"; ZodFirstPartyTypeKind2["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; ZodFirstPartyTypeKind2["ZodIntersection"] = "ZodIntersection"; ZodFirstPartyTypeKind2["ZodTuple"] = "ZodTuple"; ZodFirstPartyTypeKind2["ZodRecord"] = "ZodRecord"; ZodFirstPartyTypeKind2["ZodMap"] = "ZodMap"; ZodFirstPartyTypeKind2["ZodSet"] = "ZodSet"; ZodFirstPartyTypeKind2["ZodFunction"] = "ZodFunction"; ZodFirstPartyTypeKind2["ZodLazy"] = "ZodLazy"; ZodFirstPartyTypeKind2["ZodLiteral"] = "ZodLiteral"; ZodFirstPartyTypeKind2["ZodEnum"] = "ZodEnum"; ZodFirstPartyTypeKind2["ZodEffects"] = "ZodEffects"; ZodFirstPartyTypeKind2["ZodNativeEnum"] = "ZodNativeEnum"; ZodFirstPartyTypeKind2["ZodOptional"] = "ZodOptional"; ZodFirstPartyTypeKind2["ZodNullable"] = "ZodNullable"; ZodFirstPartyTypeKind2["ZodDefault"] = "ZodDefault"; ZodFirstPartyTypeKind2["ZodCatch"] = "ZodCatch"; ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise"; ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded"; ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline"; ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly"; })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {})); const instanceOfType = (cls, params = { message: `Input not instance of ${cls.name}` }) => custom((data2) => data2 instanceof cls, params); const stringType = ZodString.create; const numberType = ZodNumber.create; const nanType = ZodNaN.create; const bigIntType = ZodBigInt.create; const booleanType = ZodBoolean.create; const dateType = ZodDate.create; const symbolType = ZodSymbol.create; const undefinedType = ZodUndefined.create; const nullType = ZodNull.create; const anyType = ZodAny.create; const unknownType = ZodUnknown.create; const neverType = ZodNever.create; const voidType = ZodVoid.create; const arrayType = ZodArray.create; const objectType = ZodObject.create; const strictObjectType = ZodObject.strictCreate; const unionType = ZodUnion.create; const discriminatedUnionType = ZodDiscriminatedUnion.create; const intersectionType = ZodIntersection.create; const tupleType = ZodTuple.create; const recordType = ZodRecord.create; const mapType = ZodMap.create; const setType = ZodSet.create; const functionType = ZodFunction.create; const lazyType = ZodLazy.create; const literalType = ZodLiteral.create; const enumType = ZodEnum.create; const nativeEnumType = ZodNativeEnum.create; const promiseType = ZodPromise.create; const effectsType = ZodEffects.create; const optionalType = ZodOptional.create; const nullableType = ZodNullable.create; const preprocessType = ZodEffects.createWithPreprocess; const pipelineType = ZodPipeline.create; const ostring = () => stringType().optional(); const onumber = () => numberType().optional(); const oboolean = () => booleanType().optional(); const coerce$4 = { string: (arg) => ZodString.create({ ...arg, coerce: true }), number: (arg) => ZodNumber.create({ ...arg, coerce: true }), boolean: (arg) => ZodBoolean.create({ ...arg, coerce: true }), bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }), date: (arg) => ZodDate.create({ ...arg, coerce: true }) }; const NEVER = INVALID; var z$7 = /* @__PURE__ */ Object.freeze({ __proto__: null, defaultErrorMap: errorMap, setErrorMap, getErrorMap, makeIssue, EMPTY_PATH, addIssueToContext, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, get util() { return util$4; }, get objectUtil() { return objectUtil; }, ZodParsedType, getParsedType, ZodType, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodTransformer: ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, ZodReadonly, custom, Schema: ZodType, ZodSchema: ZodType, late, get ZodFirstPartyTypeKind() { return ZodFirstPartyTypeKind; }, coerce: coerce$4, any: anyType, array: arrayType, bigint: bigIntType, boolean: booleanType, date: dateType, discriminatedUnion: discriminatedUnionType, effect: effectsType, "enum": enumType, "function": functionType, "instanceof": instanceOfType, intersection: intersectionType, lazy: lazyType, literal: literalType, map: mapType, nan: nanType, nativeEnum: nativeEnumType, never: neverType, "null": nullType, nullable: nullableType, number: numberType, object: objectType, oboolean, onumber, optional: optionalType, ostring, pipeline: pipelineType, preprocess: preprocessType, promise: promiseType, record: recordType, set: setType, strictObject: strictObjectType, string: stringType, symbol: symbolType, transformer: effectsType, tuple: tupleType, "undefined": undefinedType, union: unionType, unknown: unknownType, "void": voidType, NEVER, ZodIssueCode, quotelessJson, ZodError }); const zError = z$7.object({ message: z$7.string() }); function zType(key) { return z$7.literal(W3mFrameConstants[key]); } z$7.object({ accessList: z$7.array(z$7.string()), blockHash: z$7.string().nullable(), blockNumber: z$7.string().nullable(), chainId: z$7.string(), from: z$7.string(), gas: z$7.string(), hash: z$7.string(), input: z$7.string().nullable(), maxFeePerGas: z$7.string(), maxPriorityFeePerGas: z$7.string(), nonce: z$7.string(), r: z$7.string(), s: z$7.string(), to: z$7.string(), transactionIndex: z$7.string().nullable(), type: z$7.string(), v: z$7.string(), value: z$7.string() }); const AppSwitchNetworkRequest = z$7.object({ chainId: z$7.number() }); const AppConnectEmailRequest = z$7.object({ email: z$7.string().email() }); const AppConnectOtpRequest = z$7.object({ otp: z$7.string() }); const AppGetUserRequest = z$7.object({ chainId: z$7.optional(z$7.number()) }); const AppUpdateEmailRequest = z$7.object({ email: z$7.string().email() }); const AppSyncThemeRequest = z$7.object({ themeMode: z$7.optional(z$7.enum(["light", "dark"])), themeVariables: z$7.optional(z$7.record(z$7.string(), z$7.string().or(z$7.number()))) }); const AppSyncDappDataRequest = z$7.object({ metadata: z$7.object({ name: z$7.string(), description: z$7.string(), url: z$7.string(), icons: z$7.array(z$7.string()) }).optional(), sdkVersion: z$7.string(), projectId: z$7.string() }); const FrameConnectEmailResponse = z$7.object({ action: z$7.enum(["VERIFY_DEVICE", "VERIFY_OTP"]) }); const FrameGetUserResponse = z$7.object({ email: z$7.string().email(), address: z$7.string(), chainId: z$7.number() }); const FrameIsConnectedResponse = z$7.object({ isConnected: z$7.boolean() }); const FrameGetChainIdResponse = z$7.object({ chainId: z$7.number() }); const FrameSwitchNetworkResponse = z$7.object({ chainId: z$7.number() }); const FrameAwaitUpdateEmailResponse = z$7.object({ email: z$7.string().email() }); const RpcResponse = z$7.any(); const RpcPersonalSignRequest = z$7.object({ method: z$7.literal("personal_sign"), params: z$7.array(z$7.any()) }); const RpcEthSendTransactionRequest = z$7.object({ method: z$7.literal("eth_sendTransaction"), params: z$7.array(z$7.any()) }); const RpcEthAccountsRequest = z$7.object({ method: z$7.literal("eth_accounts") }); const RpcGetBalance = z$7.object({ method: z$7.literal("eth_getBalance"), params: z$7.array(z$7.any()) }); const RpcEthEstimateGas = z$7.object({ method: z$7.literal("eth_estimateGas"), params: z$7.array(z$7.any()) }); const RpcEthGasPrice = z$7.object({ method: z$7.literal("eth_gasPrice") }); const RpcEthSignTypedDataV4 = z$7.object({ method: z$7.literal("eth_signTypedData_v4"), params: z$7.array(z$7.any()) }); const RpcEthGetTransactionByHash = z$7.object({ method: z$7.literal("eth_getTransactionByHash"), params: z$7.array(z$7.any()) }); const RpcEthBlockNumber = z$7.object({ method: z$7.literal("eth_blockNumber") }); const RpcEthChainId = z$7.object({ method: z$7.literal("eth_chainId") }); const FrameSession = z$7.object({ token: z$7.string() }); const W3mFrameSchema = { appEvent: z$7.object({ type: zType("APP_SWITCH_NETWORK"), payload: AppSwitchNetworkRequest }).or(z$7.object({ type: zType("APP_CONNECT_EMAIL"), payload: AppConnectEmailRequest })).or(z$7.object({ type: zType("APP_CONNECT_DEVICE") })).or(z$7.object({ type: zType("APP_CONNECT_OTP"), payload: AppConnectOtpRequest })).or(z$7.object({ type: zType("APP_GET_USER"), payload: z$7.optional(AppGetUserRequest) })).or(z$7.object({ type: zType("APP_SIGN_OUT") })).or(z$7.object({ type: zType("APP_IS_CONNECTED"), payload: z$7.optional(FrameSession) })).or(z$7.object({ type: zType("APP_GET_CHAIN_ID") })).or(z$7.object({ type: zType("APP_RPC_REQUEST"), payload: RpcPersonalSignRequest.or(RpcEthSendTransactionRequest).or(RpcEthAccountsRequest).or(RpcGetBalance).or(RpcEthEstimateGas).or(RpcEthGasPrice).or(RpcEthSignTypedDataV4).or(RpcEthBlockNumber).or(RpcEthChainId).or(RpcEthGetTransactionByHash) })).or(z$7.object({ type: zType("APP_UPDATE_EMAIL"), payload: AppUpdateEmailRequest })).or(z$7.object({ type: zType("APP_AWAIT_UPDATE_EMAIL") })).or(z$7.object({ type: zType("APP_SYNC_THEME"), payload: AppSyncThemeRequest })).or(z$7.object({ type: zType("APP_SYNC_DAPP_DATA"), payload: AppSyncDappDataRequest })), frameEvent: z$7.object({ type: zType("FRAME_SWITCH_NETWORK_ERROR"), payload: zError }).or(z$7.object({ type: zType("FRAME_SWITCH_NETWORK_SUCCESS"), payload: FrameSwitchNetworkResponse })).or(z$7.object({ type: zType("FRAME_CONNECT_EMAIL_ERROR"), payload: zError })).or(z$7.object({ type: zType("FRAME_CONNECT_EMAIL_SUCCESS"), payload: FrameConnectEmailResponse })).or(z$7.object({ type: zType("FRAME_CONNECT_OTP_ERROR"), payload: zError })).or(z$7.object({ type: zType("FRAME_CONNECT_OTP_SUCCESS") })).or(z$7.object({ type: zType("FRAME_CONNECT_DEVICE_ERROR"), payload: zError })).or(z$7.object({ type: zType("FRAME_CONNECT_DEVICE_SUCCESS") })).or(z$7.object({ type: zType("FRAME_GET_USER_ERROR"), payload: zError })).or(z$7.object({ type: zType("FRAME_GET_USER_SUCCESS"), payload: FrameGetUserResponse })).or(z$7.object({ type: zType("FRAME_SIGN_OUT_ERROR"), payload: zError })).or(z$7.object({ type: zType("FRAME_SIGN_OUT_SUCCESS") })).or(z$7.object({ type: zType("FRAME_IS_CONNECTED_ERROR"), payload: zError })).or(z$7.object({ type: zType("FRAME_IS_CONNECTED_SUCCESS"), payload: FrameIsConnectedResponse })).or(z$7.object({ type: zType("FRAME_GET_CHAIN_ID_ERROR"), payload: zError })).or(z$7.object({ type: zType("FRAME_GET_CHAIN_ID_SUCCESS"), payload: FrameGetChainIdResponse })).or(z$7.object({ type: zType("FRAME_RPC_REQUEST_ERROR"), payload: zError })).or(z$7.object({ type: zType("FRAME_RPC_REQUEST_SUCCESS"), payload: RpcResponse })).or(z$7.object({ type: zType("FRAME_SESSION_UPDATE"), payload: FrameSession })).or(z$7.object({ type: zType("FRAME_UPDATE_EMAIL_ERROR"), payload: zError })).or(z$7.object({ type: zType("FRAME_UPDATE_EMAIL_SUCCESS") })).or(z$7.object({ type: zType("FRAME_AWAIT_UPDATE_EMAIL_ERROR"), payload: zError })).or(z$7.object({ type: zType("FRAME_AWAIT_UPDATE_EMAIL_SUCCESS"), payload: FrameAwaitUpdateEmailResponse })).or(z$7.object({ type: zType("FRAME_SYNC_THEME_ERROR"), payload: zError })).or(z$7.object({ type: zType("FRAME_SYNC_THEME_SUCCESS") })).or(z$7.object({ type: zType("FRAME_SYNC_DAPP_DATA_ERROR"), payload: zError })).or(z$7.object({ type: zType("FRAME_SYNC_DAPP_DATA_SUCCESS") })) }; const W3mFrameStorage = { set(key, value) { localStorage.setItem(`${W3mFrameConstants.STORAGE_KEY}${key}`, value); }, get(key) { return localStorage.getItem(`${W3mFrameConstants.STORAGE_KEY}${key}`); }, delete(key) { localStorage.removeItem(`${W3mFrameConstants.STORAGE_KEY}${key}`); } }; const RESTRICTED_TIMEZONES = [ "ASIA/SHANGHAI", "ASIA/URUMQI", "ASIA/CHONGQING", "ASIA/HARBIN", "ASIA/KASHGAR", "ASIA/MACAU", "ASIA/HONG_KONG", "ASIA/MACAO", "ASIA/BEIJING", "ASIA/HARBIN" ]; const EMAIL_MINIMUM_TIMEOUT = 30 * 1e3; const W3mFrameHelpers = { getBlockchainApiUrl() { try { const { timeZone } = new Intl.DateTimeFormat().resolvedOptions(); const capTimeZone = timeZone.toUpperCase(); return RESTRICTED_TIMEZONES.includes(capTimeZone) ? "https://rpc.walletconnect.org" : "https://rpc.walletconnect.com"; } catch { return false; } }, checkIfAllowedToTriggerEmail() { const lastEmailLoginTime = W3mFrameStorage.get(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME); if (lastEmailLoginTime) { const difference = Date.now() - Number(lastEmailLoginTime); if (difference < EMAIL_MINIMUM_TIMEOUT) { const cooldownSec = Math.ceil((EMAIL_MINIMUM_TIMEOUT - difference) / 1e3); throw new Error(`Please try again after ${cooldownSec} seconds`); } } }, getTimeToNextEmailLogin() { const lastEmailLoginTime = W3mFrameStorage.get(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME); if (lastEmailLoginTime) { const difference = Date.now() - Number(lastEmailLoginTime); if (difference < EMAIL_MINIMUM_TIMEOUT) { return Math.ceil((EMAIL_MINIMUM_TIMEOUT - difference) / 1e3); } } return 0; } }; class W3mFrame { constructor(projectId2, isAppClient = false) { this.iframe = null; this.rpcUrl = W3mFrameHelpers.getBlockchainApiUrl(); this.events = { onFrameEvent: (callback) => { window.addEventListener("message", ({ data: data2 }) => { var _a2; if (!((_a2 = data2.type) == null ? void 0 : _a2.includes(W3mFrameConstants.FRAME_EVENT_KEY))) { return; } const frameEvent = W3mFrameSchema.frameEvent.parse(data2); callback(frameEvent); }); }, onAppEvent: (callback) => { window.addEventListener("message", ({ data: data2 }) => { var _a2; if (!((_a2 = data2.type) == null ? void 0 : _a2.includes(W3mFrameConstants.APP_EVENT_KEY))) { return; } const appEvent = W3mFrameSchema.appEvent.parse(data2); callback(appEvent); }); }, postAppEvent: (event) => { var _a2; if (!((_a2 = this.iframe) == null ? void 0 : _a2.contentWindow)) { throw new Error("W3mFrame: iframe is not set"); } W3mFrameSchema.appEvent.parse(event); window.postMessage(event); this.iframe.contentWindow.postMessage(event, "*"); }, postFrameEvent: (event) => { if (!parent) { throw new Error("W3mFrame: parent is not set"); } W3mFrameSchema.frameEvent.parse(event); parent.postMessage(event, "*"); } }; this.projectId = projectId2; this.frameLoadPromise = new Promise((resolve, reject) => { this.frameLoadPromiseResolver = { resolve, reject }; }); if (isAppClient) { this.frameLoadPromise = new Promise((resolve, reject) => { this.frameLoadPromiseResolver = { resolve, reject }; }); const iframe = document.createElement("iframe"); iframe.id = "w3m-iframe"; iframe.src = `${W3mFrameConstants.SECURE_SITE_SDK}?projectId=${projectId2}`; iframe.style.position = "fixed"; iframe.style.zIndex = "999999"; iframe.style.display = "none"; iframe.style.opacity = "0"; iframe.style.borderRadius = `clamp(0px, var(--wui-border-radius-l), 44px)`; document.body.appendChild(iframe); this.iframe = iframe; this.iframe.onload = () => { var _a2; (_a2 = this.frameLoadPromiseResolver) == null ? void 0 : _a2.resolve(void 0); }; this.iframe.onerror = () => { var _a2; (_a2 = this.frameLoadPromiseResolver) == null ? void 0 : _a2.reject("Unable to load email login dependency"); }; } } get networks() { const data2 = [ 1, 5, 11155111, 10, 420, 42161, 421613, 137, 80001, 42220, 1313161554, 1313161555, 56, 97, 43114, 43113, 324, 280, 100, 8453, 84531, 7777777, 999 ].map((id2) => ({ [id2]: { rpcUrl: `${this.rpcUrl}/v1/?chainId=eip155:${id2}&projectId=${this.projectId}`, chainId: id2 } })); return Object.assign({}, ...data2); } } class W3mFrameProvider { constructor(projectId2) { this.connectEmailResolver = void 0; this.connectDeviceResolver = void 0; this.connectOtpResolver = void 0; this.connectResolver = void 0; this.disconnectResolver = void 0; this.isConnectedResolver = void 0; this.getChainIdResolver = void 0; this.switchChainResolver = void 0; this.rpcRequestResolver = void 0; this.updateEmailResolver = void 0; this.awaitUpdateEmailResolver = void 0; this.syncThemeResolver = void 0; this.syncDappDataResolver = void 0; this.w3mFrame = new W3mFrame(projectId2, true); this.w3mFrame.events.onFrameEvent((event) => { console.log("💻 received", event); switch (event.type) { case W3mFrameConstants.FRAME_CONNECT_EMAIL_SUCCESS: return this.onConnectEmailSuccess(event); case W3mFrameConstants.FRAME_CONNECT_EMAIL_ERROR: return this.onConnectEmailError(event); case W3mFrameConstants.FRAME_CONNECT_DEVICE_SUCCESS: return this.onConnectDeviceSuccess(); case W3mFrameConstants.FRAME_CONNECT_DEVICE_ERROR: return this.onConnectDeviceError(event); case W3mFrameConstants.FRAME_CONNECT_OTP_SUCCESS: return this.onConnectOtpSuccess(); case W3mFrameConstants.FRAME_CONNECT_OTP_ERROR: return this.onConnectOtpError(event); case W3mFrameConstants.FRAME_GET_USER_SUCCESS: return this.onConnectSuccess(event); case W3mFrameConstants.FRAME_GET_USER_ERROR: return this.onConnectError(event); case W3mFrameConstants.FRAME_IS_CONNECTED_SUCCESS: return this.onIsConnectedSuccess(event); case W3mFrameConstants.FRAME_IS_CONNECTED_ERROR: return this.onIsConnectedError(event); case W3mFrameConstants.FRAME_GET_CHAIN_ID_SUCCESS: return this.onGetChainIdSuccess(event); case W3mFrameConstants.FRAME_GET_CHAIN_ID_ERROR: return this.onGetChainIdError(event); case W3mFrameConstants.FRAME_SIGN_OUT_SUCCESS: return this.onSignOutSuccess(); case W3mFrameConstants.FRAME_SIGN_OUT_ERROR: return this.onSignOutError(event); case W3mFrameConstants.FRAME_SWITCH_NETWORK_SUCCESS: return this.onSwitchChainSuccess(event); case W3mFrameConstants.FRAME_SWITCH_NETWORK_ERROR: return this.onSwitchChainError(event); case W3mFrameConstants.FRAME_RPC_REQUEST_SUCCESS: return this.onRpcRequestSuccess(event); case W3mFrameConstants.FRAME_RPC_REQUEST_ERROR: return this.onRpcRequestError(event); case W3mFrameConstants.FRAME_SESSION_UPDATE: return this.onSessionUpdate(event); case W3mFrameConstants.FRAME_UPDATE_EMAIL_SUCCESS: return this.onUpdateEmailSuccess(); case W3mFrameConstants.FRAME_UPDATE_EMAIL_ERROR: return this.onUpdateEmailError(event); case W3mFrameConstants.FRAME_AWAIT_UPDATE_EMAIL_SUCCESS: return this.onAwaitUpdateEmailSuccess(event); case W3mFrameConstants.FRAME_AWAIT_UPDATE_EMAIL_ERROR: return this.onAwaitUpdateEmailError(event); case W3mFrameConstants.FRAME_SYNC_THEME_SUCCESS: return this.onSyncThemeSuccess(); case W3mFrameConstants.FRAME_SYNC_THEME_ERROR: return this.onSyncThemeError(event); case W3mFrameConstants.FRAME_SYNC_DAPP_DATA_SUCCESS: return this.onSyncDappDataSuccess(); case W3mFrameConstants.FRAME_SYNC_DAPP_DATA_ERROR: return this.onSyncDappDataError(event); default: return null; } }); } getLoginEmailUsed() { return Boolean(W3mFrameStorage.get(W3mFrameConstants.EMAIL_LOGIN_USED_KEY)); } getEmail() { return W3mFrameStorage.get(W3mFrameConstants.EMAIL); } async connectEmail(payload) { await this.w3mFrame.frameLoadPromise; W3mFrameHelpers.checkIfAllowedToTriggerEmail(); this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_CONNECT_EMAIL, payload }); return new Promise((resolve, reject) => { this.connectEmailResolver = { resolve, reject }; }); } async connectDevice() { await this.w3mFrame.frameLoadPromise; this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_CONNECT_DEVICE }); return new Promise((resolve, reject) => { this.connectDeviceResolver = { resolve, reject }; }); } async connectOtp(payload) { await this.w3mFrame.frameLoadPromise; this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_CONNECT_OTP, payload }); return new Promise((resolve, reject) => { this.connectOtpResolver = { resolve, reject }; }); } async isConnected() { await this.w3mFrame.frameLoadPromise; this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_IS_CONNECTED, payload: void 0 }); return new Promise((resolve, reject) => { this.isConnectedResolver = { resolve, reject }; }); } async getChainId() { await this.w3mFrame.frameLoadPromise; this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_GET_CHAIN_ID }); return new Promise((resolve, reject) => { this.getChainIdResolver = { resolve, reject }; }); } async updateEmail(payload) { await this.w3mFrame.frameLoadPromise; W3mFrameHelpers.checkIfAllowedToTriggerEmail(); this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_UPDATE_EMAIL, payload }); return new Promise((resolve, reject) => { this.updateEmailResolver = { resolve, reject }; }); } async awaitUpdateEmail() { await this.w3mFrame.frameLoadPromise; this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_AWAIT_UPDATE_EMAIL }); return new Promise((resolve, reject) => { this.awaitUpdateEmailResolver = { resolve, reject }; }); } async syncTheme(payload) { await this.w3mFrame.frameLoadPromise; this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_SYNC_THEME, payload }); return new Promise((resolve, reject) => { this.syncThemeResolver = { resolve, reject }; }); } async syncDappData(payload) { await this.w3mFrame.frameLoadPromise; this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_SYNC_DAPP_DATA, payload }); return new Promise((resolve, reject) => { this.syncDappDataResolver = { resolve, reject }; }); } async connect(payload) { const chainId = (payload == null ? void 0 : payload.chainId) ?? this.getLastUsedChainId() ?? 1; await this.w3mFrame.frameLoadPromise; this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_GET_USER, payload: { chainId } }); return new Promise((resolve, reject) => { this.connectResolver = { resolve, reject }; }); } async switchNetwork(chainId) { await this.w3mFrame.frameLoadPromise; this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_SWITCH_NETWORK, payload: { chainId } }); return new Promise((resolve, reject) => { this.switchChainResolver = { resolve, reject }; }); } async disconnect() { await this.w3mFrame.frameLoadPromise; this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_SIGN_OUT }); return new Promise((resolve, reject) => { this.disconnectResolver = { resolve, reject }; }); } async request(req) { await this.w3mFrame.frameLoadPromise; if (W3mFrameRpcConstants.GET_CHAIN_ID === req.method) { return this.getLastUsedChainId(); } this.w3mFrame.events.postAppEvent({ type: W3mFrameConstants.APP_RPC_REQUEST, payload: req }); return new Promise((resolve, reject) => { this.rpcRequestResolver = { resolve, reject }; }); } onRpcRequest(callback) { this.w3mFrame.events.onAppEvent((event) => { if (event.type.includes(W3mFrameConstants.RPC_METHOD_KEY)) { callback(event); } }); } onRpcResponse(callback) { this.w3mFrame.events.onFrameEvent((event) => { if (event.type.includes(W3mFrameConstants.RPC_METHOD_KEY)) { callback(event); } }); } onIsConnected(callback) { this.w3mFrame.events.onFrameEvent((event) => { if (event.type === W3mFrameConstants.FRAME_GET_USER_SUCCESS) { callback(); } }); } onConnectEmailSuccess(event) { var _a2; (_a2 = this.connectEmailResolver) == null ? void 0 : _a2.resolve(event.payload); this.setNewLastEmailLoginTime(); } onConnectEmailError(event) { var _a2; (_a2 = this.connectEmailResolver) == null ? void 0 : _a2.reject(event.payload.message); } onConnectDeviceSuccess() { var _a2; (_a2 = this.connectDeviceResolver) == null ? void 0 : _a2.resolve(void 0); } onConnectDeviceError(event) { var _a2; (_a2 = this.connectDeviceResolver) == null ? void 0 : _a2.reject(event.payload.message); } onConnectOtpSuccess() { var _a2; (_a2 = this.connectOtpResolver) == null ? void 0 : _a2.resolve(void 0); } onConnectOtpError(event) { var _a2; (_a2 = this.connectOtpResolver) == null ? void 0 : _a2.reject(event.payload.message); } onConnectSuccess(event) { var _a2; this.setEmailLoginSuccess(event.payload.email); this.setLastUsedChainId(event.payload.chainId); (_a2 = this.connectResolver) == null ? void 0 : _a2.resolve(event.payload); } onConnectError(event) { var _a2; (_a2 = this.connectResolver) == null ? void 0 : _a2.reject(event.payload.message); } onIsConnectedSuccess(event) { var _a2; if (!event.payload.isConnected) { this.deleteEmailLoginCache(); } (_a2 = this.isConnectedResolver) == null ? void 0 : _a2.resolve(event.payload); } onIsConnectedError(event) { var _a2; (_a2 = this.isConnectedResolver) == null ? void 0 : _a2.reject(event.payload.message); } onGetChainIdSuccess(event) { var _a2; this.setLastUsedChainId(event.payload.chainId); (_a2 = this.getChainIdResolver) == null ? void 0 : _a2.resolve(event.payload); } onGetChainIdError(event) { var _a2; (_a2 = this.getChainIdResolver) == null ? void 0 : _a2.reject(event.payload.message); } onSignOutSuccess() { var _a2; (_a2 = this.disconnectResolver) == null ? void 0 : _a2.resolve(void 0); this.deleteEmailLoginCache(); } onSignOutError(event) { var _a2; (_a2 = this.disconnectResolver) == null ? void 0 : _a2.reject(event.payload.message); } onSwitchChainSuccess(event) { var _a2; this.setLastUsedChainId(event.payload.chainId); (_a2 = this.switchChainResolver) == null ? void 0 : _a2.resolve(event.payload); } onSwitchChainError(event) { var _a2; (_a2 = this.switchChainResolver) == null ? void 0 : _a2.reject(event.payload.message); } onRpcRequestSuccess(event) { var _a2; (_a2 = this.rpcRequestResolver) == null ? void 0 : _a2.resolve(event.payload); } onRpcRequestError(event) { var _a2; (_a2 = this.rpcRequestResolver) == null ? void 0 : _a2.reject(event.payload.message); } onSessionUpdate(event) { } onUpdateEmailSuccess() { var _a2; (_a2 = this.updateEmailResolver) == null ? void 0 : _a2.resolve(void 0); this.setNewLastEmailLoginTime(); } onUpdateEmailError(event) { var _a2; (_a2 = this.updateEmailResolver) == null ? void 0 : _a2.reject(event.payload.message); } onAwaitUpdateEmailSuccess(event) { var _a2; this.setEmailLoginSuccess(event.payload.email); (_a2 = this.awaitUpdateEmailResolver) == null ? void 0 : _a2.resolve(event.payload); } onAwaitUpdateEmailError(event) { var _a2; (_a2 = this.awaitUpdateEmailResolver) == null ? void 0 : _a2.reject(event.payload.message); } onSyncThemeSuccess() { var _a2; (_a2 = this.syncThemeResolver) == null ? void 0 : _a2.resolve(void 0); } onSyncThemeError(event) { var _a2; (_a2 = this.syncThemeResolver) == null ? void 0 : _a2.reject(event.payload.message); } onSyncDappDataSuccess() { var _a2; (_a2 = this.syncDappDataResolver) == null ? void 0 : _a2.resolve(void 0); } onSyncDappDataError(event) { var _a2; (_a2 = this.syncDappDataResolver) == null ? void 0 : _a2.reject(event.payload.message); } setNewLastEmailLoginTime() { W3mFrameStorage.set(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME, Date.now().toString()); } setEmailLoginSuccess(email) { W3mFrameStorage.set(W3mFrameConstants.EMAIL, email); W3mFrameStorage.set(W3mFrameConstants.EMAIL_LOGIN_USED_KEY, "true"); W3mFrameStorage.delete(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME); } deleteEmailLoginCache() { W3mFrameStorage.delete(W3mFrameConstants.EMAIL_LOGIN_USED_KEY); W3mFrameStorage.delete(W3mFrameConstants.EMAIL); W3mFrameStorage.delete(W3mFrameConstants.LAST_USED_CHAIN_KEY); } setLastUsedChainId(chainId) { W3mFrameStorage.set(W3mFrameConstants.LAST_USED_CHAIN_KEY, `${chainId}`); } getLastUsedChainId() { return Number(W3mFrameStorage.get(W3mFrameConstants.LAST_USED_CHAIN_KEY)); } } var __decorate$n = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const OTP_LENGTH = 6; let W3mEmailVerifyOtpView = class W3mEmailVerifyOtpView extends s$7 { constructor() { var _a2; super(...arguments); this.email = (_a2 = RouterController.state.data) == null ? void 0 : _a2.email; this.emailConnector = ConnectorController.getEmailConnector(); this.loading = false; this.timeoutTimeLeft = W3mFrameHelpers.getTimeToNextEmailLogin(); this.error = ""; this.otp = ""; } firstUpdated() { this.startOTPTimeout(); } disconnectedCallback() { clearTimeout(this.OTPTimeout); } render() { if (!this.email) { throw new Error("w3m-email-verify-otp-view: No email provided"); } const isResendDisabled = Boolean(this.timeoutTimeLeft); return x$5` Enter the code we sent to ${this.email} The code expires in 20 minutes ${this.loading ? x$5`` : x$5` ${this.error ? x$5`${this.error}. Try Again` : null} `} Didn't receive it? Resend ${isResendDisabled ? `in ${this.timeoutTimeLeft}s` : "Code"} `; } startOTPTimeout() { this.timeoutTimeLeft = W3mFrameHelpers.getTimeToNextEmailLogin(); this.OTPTimeout = setInterval(() => { if (this.timeoutTimeLeft > 0) { this.timeoutTimeLeft = W3mFrameHelpers.getTimeToNextEmailLogin(); } else { clearInterval(this.OTPTimeout); } }, 1e3); } async onOtpInputChange(event) { try { if (!this.loading) { this.otp = event.detail; if (this.emailConnector && this.otp.length === OTP_LENGTH) { this.loading = true; await this.emailConnector.provider.connectOtp({ otp: this.otp }); EventsController.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_PASS" }); await ConnectionController.connectExternal(this.emailConnector); ModalController.close(); EventsController.sendEvent({ type: "track", event: "CONNECT_SUCCESS", properties: { method: "email" } }); } } } catch (error2) { EventsController.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_FAIL" }); this.error = CoreHelperUtil.parseError(error2); this.loading = false; } } async onResendCode() { try { if (!this.loading && !this.timeoutTimeLeft) { this.error = ""; this.otp = ""; const emailConnector = ConnectorController.getEmailConnector(); if (!emailConnector || !this.email) { throw new Error("w3m-email-login-widget: Unable to resend email"); } this.loading = true; await emailConnector.provider.connectEmail({ email: this.email }); EventsController.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_SENT" }); this.startOTPTimeout(); SnackController.showSuccess("Code email resent"); } } catch (error2) { SnackController.showError(error2); } finally { this.loading = false; } } }; W3mEmailVerifyOtpView.styles = styles$d; __decorate$n([ r$9() ], W3mEmailVerifyOtpView.prototype, "loading", void 0); __decorate$n([ r$9() ], W3mEmailVerifyOtpView.prototype, "timeoutTimeLeft", void 0); __decorate$n([ r$9() ], W3mEmailVerifyOtpView.prototype, "error", void 0); W3mEmailVerifyOtpView = __decorate$n([ customElement("w3m-email-verify-otp-view") ], W3mEmailVerifyOtpView); const styles$c = i$c` wui-icon-box { height: var(--wui-icon-box-size-xl); width: var(--wui-icon-box-size-xl); } `; var __decorate$m = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mEmailVerifyDeviceView = class W3mEmailVerifyDeviceView extends s$7 { constructor() { var _a2; super(); this.email = (_a2 = RouterController.state.data) == null ? void 0 : _a2.email; this.emailConnector = ConnectorController.getEmailConnector(); this.loading = false; this.listenForDeviceApproval(); } render() { if (!this.email) { throw new Error("w3m-email-verify-device-view: No email provided"); } if (!this.emailConnector) { throw new Error("w3m-email-verify-device-view: No email connector provided"); } return x$5` Approve the login link we sent to ${this.email} The code expires in 20 minutes Didn't receive it? Resend email `; } async listenForDeviceApproval() { if (this.emailConnector) { await this.emailConnector.provider.connectDevice(); EventsController.sendEvent({ type: "track", event: "DEVICE_REGISTERED_FOR_EMAIL" }); EventsController.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_SENT" }); RouterController.replace("EmailVerifyOtp", { email: this.email }); } } async onResendCode() { try { if (!this.loading) { if (!this.emailConnector || !this.email) { throw new Error("w3m-email-login-widget: Unable to resend email"); } this.loading = true; await this.emailConnector.provider.connectEmail({ email: this.email }); SnackController.showSuccess("Code email resent"); } } catch (error2) { SnackController.showError(error2); } finally { this.loading = false; } } }; W3mEmailVerifyDeviceView.styles = styles$c; __decorate$m([ r$9() ], W3mEmailVerifyDeviceView.prototype, "loading", void 0); W3mEmailVerifyDeviceView = __decorate$m([ customElement("w3m-email-verify-device-view") ], W3mEmailVerifyDeviceView); const styles$b = i$c` div { width: 100%; height: 400px; } [data-ready='false'] { transform: scale(1.05); } @media (max-width: 430px) { [data-ready='false'] { transform: translateY(-50px); } } `; var __decorate$l = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mApproveTransactionView = class W3mApproveTransactionView extends s$7 { constructor() { super(); this.bodyObserver = void 0; this.unsubscribe = []; this.iframe = document.getElementById("w3m-iframe"); this.ready = false; this.unsubscribe.push(ModalController.subscribeKey("open", (val) => { if (!val) { this.onHideIframe(); } })); } disconnectedCallback() { var _a2; this.unsubscribe.forEach((unsubscribe) => unsubscribe()); (_a2 = this.bodyObserver) == null ? void 0 : _a2.unobserve(window.document.body); } firstUpdated() { const verticalPadding = 10; this.iframe.style.display = "block"; const blueprint = this.renderRoot.querySelector("div"); this.bodyObserver = new ResizeObserver(() => { const data2 = blueprint == null ? void 0 : blueprint.getBoundingClientRect(); const dimensions = data2 ?? { left: 0, top: 0, width: 0, height: 0 }; this.iframe.style.width = `${dimensions.width}px`; this.iframe.style.height = `${dimensions.height - verticalPadding}px`; this.iframe.style.left = `${dimensions.left}px`; this.iframe.style.top = `${dimensions.top + verticalPadding / 2}px`; this.ready = true; }); this.bodyObserver.observe(window.document.body); } render() { if (this.ready) { this.onShowIframe(); } return x$5`
`; } onShowIframe() { const isMobile = window.innerWidth <= 430; this.iframe.animate([ { opacity: 0, transform: isMobile ? "translateY(50px)" : "scale(.95)" }, { opacity: 1, transform: isMobile ? "translateY(0)" : "scale(1)" } ], { duration: 200, easing: "ease", fill: "forwards", delay: 300 }); } async onHideIframe() { await this.iframe.animate([{ opacity: 1 }, { opacity: 0 }], { duration: 200, easing: "ease", fill: "forwards" }).finished; this.iframe.style.display = "none"; } }; W3mApproveTransactionView.styles = styles$b; __decorate$l([ r$9() ], W3mApproveTransactionView.prototype, "ready", void 0); W3mApproveTransactionView = __decorate$l([ customElement("w3m-approve-transaction-view") ], W3mApproveTransactionView); var __decorate$k = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mUpgradeWalletView = class W3mUpgradeWalletView extends s$7 { render() { return x$5` Follow the instructions on You will have to reconnect for security reasons `; } }; W3mUpgradeWalletView = __decorate$k([ customElement("w3m-upgrade-wallet-view") ], W3mUpgradeWalletView); /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const f$8 = (o2) => void 0 === o2.strings; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t$8 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, e$a = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 }); let i$9 = class i { constructor(t2) { } get _$AU() { return this._$AM._$AU; } _$AT(t2, e2, i2) { this._$Ct = t2, this._$AM = e2, this._$Ci = i2; } _$AS(t2, e2) { return this.update(t2, e2); } update(t2, e2) { return this.render(...e2); } }; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const s$6 = (i2, t2) => { var _a2; const e2 = i2._$AN; if (void 0 === e2) return false; for (const i3 of e2) (_a2 = i3._$AO) == null ? void 0 : _a2.call(i3, t2, false), s$6(i3, t2); return true; }, o$a = (i2) => { let t2, e2; do { if (void 0 === (t2 = i2._$AM)) break; e2 = t2._$AN, e2.delete(i2), i2 = t2; } while (0 === (e2 == null ? void 0 : e2.size)); }, r$8 = (i2) => { for (let t2; t2 = i2._$AM; i2 = t2) { let e2 = t2._$AN; if (void 0 === e2) t2._$AN = e2 = /* @__PURE__ */ new Set(); else if (e2.has(i2)) break; e2.add(i2), c$9(t2); } }; function h$a(i2) { void 0 !== this._$AN ? (o$a(this), this._$AM = i2, r$8(this)) : this._$AM = i2; } function n$b(i2, t2 = false, e2 = 0) { const r2 = this._$AH, h2 = this._$AN; if (void 0 !== h2 && 0 !== h2.size) if (t2) if (Array.isArray(r2)) for (let i3 = e2; i3 < r2.length; i3++) s$6(r2[i3], false), o$a(r2[i3]); else null != r2 && (s$6(r2, false), o$a(r2)); else s$6(this, i2); } const c$9 = (i2) => { i2.type == t$8.CHILD && (i2._$AP ?? (i2._$AP = n$b), i2._$AQ ?? (i2._$AQ = h$a)); }; let f$7 = class f extends i$9 { constructor() { super(...arguments), this._$AN = void 0; } _$AT(i2, t2, e2) { super._$AT(i2, t2, e2), r$8(this), this.isConnected = i2._$AU; } _$AO(i2, t2 = true) { var _a2, _b2; i2 !== this.isConnected && (this.isConnected = i2, i2 ? (_a2 = this.reconnected) == null ? void 0 : _a2.call(this) : (_b2 = this.disconnected) == null ? void 0 : _b2.call(this)), t2 && (s$6(this, i2), o$a(this)); } setValue(t2) { if (f$8(this._$Ct)) this._$Ct._$AI(t2, this); else { const i2 = [...this._$Ct._$AH]; i2[this._$Ci] = t2, this._$Ct._$AI(i2, this, 0); } } disconnected() { } reconnected() { } }; /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const e$9 = () => new h$9(); let h$9 = class h { }; const o$9 = /* @__PURE__ */ new WeakMap(), n$a = e$a(class extends f$7 { render(i2) { return T$8; } update(i2, [s2]) { var _a2; const e2 = s2 !== this.Y; return e2 && void 0 !== this.Y && this.rt(void 0), (e2 || this.lt !== this.ct) && (this.Y = s2, this.ht = (_a2 = i2.options) == null ? void 0 : _a2.host, this.rt(this.ct = i2.element)), T$8; } rt(t2) { if ("function" == typeof this.Y) { const i2 = this.ht ?? globalThis; let s2 = o$9.get(i2); void 0 === s2 && (s2 = /* @__PURE__ */ new WeakMap(), o$9.set(i2, s2)), void 0 !== s2.get(this.Y) && this.Y.call(this.ht, void 0), s2.set(this.Y, t2), void 0 !== t2 && this.Y.call(this.ht, t2); } else this.Y.value = t2; } get lt() { var _a2, _b2; return "function" == typeof this.Y ? (_a2 = o$9.get(this.ht ?? globalThis)) == null ? void 0 : _a2.get(this.Y) : (_b2 = this.Y) == null ? void 0 : _b2.value; } disconnected() { this.lt === this.ct && this.rt(void 0); } reconnected() { this.rt(this.ct); } }); const styles$a = i$c` wui-email-input { width: 100%; } form { width: 100%; display: block; position: relative; } `; var __decorate$j = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mUpdateEmailWalletView = class W3mUpdateEmailWalletView extends s$7 { constructor() { var _a2; super(...arguments); this.formRef = e$9(); this.initialValue = ((_a2 = RouterController.state.data) == null ? void 0 : _a2.email) ?? ""; this.email = ""; this.loading = false; } firstUpdated() { var _a2; (_a2 = this.formRef.value) == null ? void 0 : _a2.addEventListener("keydown", (event) => { if (event.key === "Enter") { this.onSubmitEmail(event); } }); } render() { const showSubmit = !this.loading && this.email.length > 3 && this.email !== this.initialValue; return x$5`
Cancel Save
`; } onEmailInputChange(event) { this.email = event.detail; } async onSubmitEmail(event) { try { if (this.loading) { return; } this.loading = true; event.preventDefault(); const emailConnector = ConnectorController.getEmailConnector(); if (!emailConnector) { throw new Error("w3m-update-email-wallet: Email connector not found"); } await emailConnector.provider.updateEmail({ email: this.email }); EventsController.sendEvent({ type: "track", event: "EMAIL_EDIT" }); RouterController.replace("UpdateEmailWalletWaiting", { email: this.email }); } catch (error2) { SnackController.showError(error2); this.loading = false; } } }; W3mUpdateEmailWalletView.styles = styles$a; __decorate$j([ r$9() ], W3mUpdateEmailWalletView.prototype, "email", void 0); __decorate$j([ r$9() ], W3mUpdateEmailWalletView.prototype, "loading", void 0); W3mUpdateEmailWalletView = __decorate$j([ customElement("w3m-update-email-wallet-view") ], W3mUpdateEmailWalletView); const styles$9 = i$c` wui-icon-box { height: var(--wui-icon-box-size-xl); width: var(--wui-icon-box-size-xl); } `; var __decorate$i = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mUpdateEmailWalletWaitingView = class W3mUpdateEmailWalletWaitingView extends s$7 { constructor() { var _a2; super(); this.email = (_a2 = RouterController.state.data) == null ? void 0 : _a2.email; this.emailConnector = ConnectorController.getEmailConnector(); this.loading = false; this.listenForEmailUpdateApproval(); } render() { if (!this.email) { throw new Error("w3m-update-email-wallet-waiting-view: No email provided"); } if (!this.emailConnector) { throw new Error("w3m-update-email-wallet-waiting-view: No email connector provided"); } return x$5` Approve verification link we sent to ${this.email} You will receive an approval request on your former mail to confirm the new one Didn't receive it? Resend email `; } async listenForEmailUpdateApproval() { if (this.emailConnector) { await this.emailConnector.provider.awaitUpdateEmail(); RouterController.replace("Account"); SnackController.showSuccess("Email updated"); } } async onResendCode() { try { if (!this.loading) { if (!this.emailConnector || !this.email) { throw new Error("w3m-update-email-wallet-waiting-view: Unable to resend email"); } this.loading = true; await this.emailConnector.provider.updateEmail({ email: this.email }); this.listenForEmailUpdateApproval(); SnackController.showSuccess("Code email resent"); } } catch (error2) { SnackController.showError(error2); } finally { this.loading = false; } } }; W3mUpdateEmailWalletWaitingView.styles = styles$9; __decorate$i([ r$9() ], W3mUpdateEmailWalletWaitingView.prototype, "loading", void 0); W3mUpdateEmailWalletWaitingView = __decorate$i([ customElement("w3m-update-email-wallet-waiting-view") ], W3mUpdateEmailWalletWaitingView); const styles$8 = i$c` wui-grid { max-height: clamp(360px, 400px, 80vh); overflow: scroll; scrollbar-width: none; grid-auto-rows: min-content; grid-template-columns: repeat(auto-fill, 76px); } @media (max-width: 435px) { wui-grid { grid-template-columns: repeat(auto-fill, 77px); } } wui-grid[data-scroll='false'] { overflow: hidden; } wui-grid::-webkit-scrollbar { display: none; } wui-loading-spinner { padding-top: var(--wui-spacing-l); padding-bottom: var(--wui-spacing-l); justify-content: center; grid-column: 1 / span 4; } `; function markWalletsAsInstalled(wallets) { const { connectors } = ConnectorController.state; const installedConnectors = connectors.filter((c2) => c2.type === "ANNOUNCED").reduce((acum, val) => { var _a2; if (!((_a2 = val.info) == null ? void 0 : _a2.rdns)) { return acum; } acum[val.info.rdns] = true; return acum; }, {}); const walletsWithInstalled = wallets.map((wallet2) => ({ ...wallet2, installed: Boolean(wallet2.rdns) && Boolean(installedConnectors[wallet2.rdns ?? ""]) })); const sortedWallets = walletsWithInstalled.sort((a2, b2) => Number(b2.installed) - Number(a2.installed)); return sortedWallets; } var __decorate$h = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const PAGINATOR_ID = "local-paginator"; let W3mAllWalletsList = class W3mAllWalletsList extends s$7 { constructor() { super(); this.unsubscribe = []; this.paginationObserver = void 0; this.initial = !ApiController.state.wallets.length; this.wallets = ApiController.state.wallets; this.recommended = ApiController.state.recommended; this.featured = ApiController.state.featured; this.unsubscribe.push(...[ ApiController.subscribeKey("wallets", (val) => this.wallets = val), ApiController.subscribeKey("recommended", (val) => this.recommended = val), ApiController.subscribeKey("featured", (val) => this.featured = val) ]); } firstUpdated() { this.initialFetch(); this.createPaginationObserver(); } disconnectedCallback() { var _a2; this.unsubscribe.forEach((unsubscribe) => unsubscribe()); (_a2 = this.paginationObserver) == null ? void 0 : _a2.disconnect(); } render() { return x$5` ${this.initial ? this.shimmerTemplate(16) : this.walletsTemplate()} ${this.paginationLoaderTemplate()} `; } async initialFetch() { var _a2; const gridEl = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("wui-grid"); if (this.initial && gridEl) { await ApiController.fetchWallets({ page: 1 }); await gridEl.animate([{ opacity: 1 }, { opacity: 0 }], { duration: 200, fill: "forwards", easing: "ease" }).finished; this.initial = false; gridEl.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 200, fill: "forwards", easing: "ease" }); } } shimmerTemplate(items, id2) { return [...Array(items)].map(() => x$5` `); } walletsTemplate() { const wallets = [...this.featured, ...this.recommended, ...this.wallets]; const walletsWithInstalled = markWalletsAsInstalled(wallets); return walletsWithInstalled.map((wallet2) => x$5` this.onConnectWallet(wallet2)} .installed=${wallet2.installed} > `); } paginationLoaderTemplate() { const { wallets, recommended, featured, count } = ApiController.state; const columns = window.innerWidth < 352 ? 3 : 4; const currentWallets = wallets.length + recommended.length; const minimumRows = Math.ceil(currentWallets / columns); let shimmerCount = minimumRows * columns - currentWallets + columns; shimmerCount -= wallets.length ? featured.length % columns : 0; if (count === 0 && featured.length > 0) { return null; } if (count === 0 || [...featured, ...wallets, ...recommended].length < count) { return this.shimmerTemplate(shimmerCount, PAGINATOR_ID); } return null; } createPaginationObserver() { var _a2; const loaderEl = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(`#${PAGINATOR_ID}`); if (loaderEl) { this.paginationObserver = new IntersectionObserver(([element]) => { if ((element == null ? void 0 : element.isIntersecting) && !this.initial) { const { page, count, wallets } = ApiController.state; if (wallets.length < count) { ApiController.fetchWallets({ page: page + 1 }); } } }); this.paginationObserver.observe(loaderEl); } } onConnectWallet(wallet2) { const { connectors } = ConnectorController.state; const connector = connectors.find(({ explorerId }) => explorerId === wallet2.id); if (connector) { RouterController.push("ConnectingExternal", { connector }); } else { RouterController.push("ConnectingWalletConnect", { wallet: wallet2 }); } } }; W3mAllWalletsList.styles = styles$8; __decorate$h([ r$9() ], W3mAllWalletsList.prototype, "initial", void 0); __decorate$h([ r$9() ], W3mAllWalletsList.prototype, "wallets", void 0); __decorate$h([ r$9() ], W3mAllWalletsList.prototype, "recommended", void 0); __decorate$h([ r$9() ], W3mAllWalletsList.prototype, "featured", void 0); W3mAllWalletsList = __decorate$h([ customElement("w3m-all-wallets-list") ], W3mAllWalletsList); const styles$7 = i$c` wui-grid, wui-loading-spinner, wui-flex { height: 360px; } wui-grid { overflow: scroll; scrollbar-width: none; grid-auto-rows: min-content; } wui-grid[data-scroll='false'] { overflow: hidden; } wui-grid::-webkit-scrollbar { display: none; } wui-loading-spinner { justify-content: center; align-items: center; } `; var __decorate$g = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mAllWalletsSearch = class W3mAllWalletsSearch extends s$7 { constructor() { super(...arguments); this.prevQuery = ""; this.loading = true; this.query = ""; } render() { this.onSearch(); return this.loading ? x$5`` : this.walletsTemplate(); } async onSearch() { if (this.query !== this.prevQuery) { this.prevQuery = this.query; this.loading = true; await ApiController.searchWallet({ search: this.query }); this.loading = false; } } walletsTemplate() { const { search } = ApiController.state; const wallets = markWalletsAsInstalled(search); if (!search.length) { return x$5` No Wallet found `; } return x$5` ${wallets.map((wallet2) => x$5` this.onConnectWallet(wallet2)} .installed=${wallet2.installed} > `)} `; } onConnectWallet(wallet2) { const { connectors } = ConnectorController.state; const connector = connectors.find(({ explorerId }) => explorerId === wallet2.id); if (connector) { RouterController.push("ConnectingExternal", { connector }); } else { RouterController.push("ConnectingWalletConnect", { wallet: wallet2 }); } } }; W3mAllWalletsSearch.styles = styles$7; __decorate$g([ r$9() ], W3mAllWalletsSearch.prototype, "loading", void 0); __decorate$g([ n$c() ], W3mAllWalletsSearch.prototype, "query", void 0); W3mAllWalletsSearch = __decorate$g([ customElement("w3m-all-wallets-search") ], W3mAllWalletsSearch); var __decorate$f = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mConnectingHeader = class W3mConnectingHeader extends s$7 { constructor() { super(); this.platformTabs = []; this.unsubscribe = []; this.platforms = []; this.onSelectPlatfrom = void 0; this.buffering = false; this.unsubscribe.push(ConnectionController.subscribeKey("buffering", (val) => this.buffering = val)); } disconnectCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } render() { const tabs = this.generateTabs(); return x$5` `; } generateTabs() { const tabs = this.platforms.map((platform) => { if (platform === "browser") { return { label: "Browser", icon: "extension", platform: "browser" }; } else if (platform === "mobile") { return { label: "Mobile", icon: "mobile", platform: "mobile" }; } else if (platform === "qrcode") { return { label: "Mobile", icon: "mobile", platform: "qrcode" }; } else if (platform === "web") { return { label: "Webapp", icon: "browser", platform: "web" }; } else if (platform === "desktop") { return { label: "Desktop", icon: "desktop", platform: "desktop" }; } return { label: "Browser", icon: "extension", platform: "unsupported" }; }); this.platformTabs = tabs.map(({ platform }) => platform); return tabs; } onTabChange(index2) { var _a2; const tab = this.platformTabs[index2]; if (tab) { (_a2 = this.onSelectPlatfrom) == null ? void 0 : _a2.call(this, tab); } } }; __decorate$f([ n$c({ type: Array }) ], W3mConnectingHeader.prototype, "platforms", void 0); __decorate$f([ n$c() ], W3mConnectingHeader.prototype, "onSelectPlatfrom", void 0); __decorate$f([ r$9() ], W3mConnectingHeader.prototype, "buffering", void 0); W3mConnectingHeader = __decorate$f([ customElement("w3m-connecting-header") ], W3mConnectingHeader); var __decorate$e = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mConnectingWcBrowser = class W3mConnectingWcBrowser extends W3mConnectingWidget { constructor() { super(); if (!this.wallet) { throw new Error("w3m-connecting-wc-browser: No wallet provided"); } this.onConnect = this.onConnectProxy.bind(this); this.onAutoConnect = this.onConnectProxy.bind(this); EventsController.sendEvent({ type: "track", event: "SELECT_WALLET", properties: { name: this.wallet.name, platform: "browser" } }); } async onConnectProxy() { try { this.error = false; const { connectors } = ConnectorController.state; const announcedConnector = connectors.find((c2) => { var _a2, _b2; return c2.type === "ANNOUNCED" && ((_a2 = c2.info) == null ? void 0 : _a2.rdns) === ((_b2 = this.wallet) == null ? void 0 : _b2.rdns); }); const injectedConnector = connectors.find((c2) => c2.type === "INJECTED"); if (announcedConnector) { await ConnectionController.connectExternal(announcedConnector); } else if (injectedConnector) { await ConnectionController.connectExternal(injectedConnector); } ModalController.close(); EventsController.sendEvent({ type: "track", event: "CONNECT_SUCCESS", properties: { method: "browser" } }); } catch (error2) { EventsController.sendEvent({ type: "track", event: "CONNECT_ERROR", properties: { message: (error2 == null ? void 0 : error2.message) ?? "Unknown" } }); this.error = true; } } }; W3mConnectingWcBrowser = __decorate$e([ customElement("w3m-connecting-wc-browser") ], W3mConnectingWcBrowser); var __decorate$d = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mConnectingWcDesktop = class W3mConnectingWcDesktop extends W3mConnectingWidget { constructor() { super(); if (!this.wallet) { throw new Error("w3m-connecting-wc-desktop: No wallet provided"); } this.onConnect = this.onConnectProxy.bind(this); this.onRender = this.onRenderProxy.bind(this); EventsController.sendEvent({ type: "track", event: "SELECT_WALLET", properties: { name: this.wallet.name, platform: "desktop" } }); } onRenderProxy() { if (!this.ready && this.uri) { this.ready = true; this.timeout = setTimeout(() => { var _a2; (_a2 = this.onConnect) == null ? void 0 : _a2.call(this); }, 200); } } onConnectProxy() { var _a2; if (((_a2 = this.wallet) == null ? void 0 : _a2.desktop_link) && this.uri) { try { this.error = false; const { desktop_link, name: name2 } = this.wallet; const { redirect, href } = CoreHelperUtil.formatNativeUrl(desktop_link, this.uri); ConnectionController.setWcLinking({ name: name2, href }); ConnectionController.setRecentWallet(this.wallet); CoreHelperUtil.openHref(redirect, "_blank"); } catch { this.error = true; } } } }; W3mConnectingWcDesktop = __decorate$d([ customElement("w3m-connecting-wc-desktop") ], W3mConnectingWcDesktop); var __decorate$c = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mConnectingWcMobile = class W3mConnectingWcMobile extends W3mConnectingWidget { constructor() { super(); if (!this.wallet) { throw new Error("w3m-connecting-wc-mobile: No wallet provided"); } this.onConnect = this.onConnectProxy.bind(this); this.onRender = this.onRenderProxy.bind(this); document.addEventListener("visibilitychange", this.onBuffering.bind(this)); EventsController.sendEvent({ type: "track", event: "SELECT_WALLET", properties: { name: this.wallet.name, platform: "mobile" } }); } disconnectedCallback() { super.disconnectedCallback(); document.removeEventListener("visibilitychange", this.onBuffering.bind(this)); } onRenderProxy() { var _a2; if (!this.ready && this.uri) { this.ready = true; (_a2 = this.onConnect) == null ? void 0 : _a2.call(this); } } onConnectProxy() { var _a2; if (((_a2 = this.wallet) == null ? void 0 : _a2.mobile_link) && this.uri) { try { this.error = false; const { mobile_link, name: name2 } = this.wallet; const { redirect, href } = CoreHelperUtil.formatNativeUrl(mobile_link, this.uri); ConnectionController.setWcLinking({ name: name2, href }); ConnectionController.setRecentWallet(this.wallet); CoreHelperUtil.openHref(redirect, "_self"); } catch { this.error = true; } } } onBuffering() { const isIos = CoreHelperUtil.isIos(); if ((document == null ? void 0 : document.visibilityState) === "visible" && !this.error && isIos) { ConnectionController.setBuffering(true); setTimeout(() => { ConnectionController.setBuffering(false); }, 5e3); } } }; W3mConnectingWcMobile = __decorate$c([ customElement("w3m-connecting-wc-mobile") ], W3mConnectingWcMobile); const styles$6 = i$c` @keyframes fadein { from { opacity: 0; } to { opacity: 1; } } wui-shimmer { width: 100%; aspect-ratio: 1 / 1; border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important; } wui-qr-code { opacity: 0; animation-duration: 200ms; animation-timing-function: ease; animation-name: fadein; animation-fill-mode: forwards; } `; var __decorate$b = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mConnectingWcQrcode = class W3mConnectingWcQrcode extends W3mConnectingWidget { constructor() { var _a2; super(); this.forceUpdate = () => { this.requestUpdate(); }; window.addEventListener("resize", this.forceUpdate); EventsController.sendEvent({ type: "track", event: "SELECT_WALLET", properties: { name: ((_a2 = this.wallet) == null ? void 0 : _a2.name) ?? "WalletConnect", platform: "qrcode" } }); } disconnectedCallback() { super.disconnectedCallback(); window.removeEventListener("resize", this.forceUpdate); } render() { this.onRenderProxy(); return x$5` ${this.qrCodeTemplate()} Scan this QR Code with your phone ${this.copyTemplate()} `; } onRenderProxy() { if (!this.ready && this.uri) { this.timeout = setTimeout(() => { this.ready = true; }, 200); } } qrCodeTemplate() { if (!this.uri || !this.ready) { return null; } const size2 = this.getBoundingClientRect().width - 40; const alt = this.wallet ? this.wallet.name : void 0; ConnectionController.setWcLinking(void 0); ConnectionController.setRecentWallet(this.wallet); return x$5` `; } copyTemplate() { const inactive = !this.uri || !this.ready; return x$5` Copy link `; } }; W3mConnectingWcQrcode.styles = styles$6; W3mConnectingWcQrcode = __decorate$b([ customElement("w3m-connecting-wc-qrcode") ], W3mConnectingWcQrcode); const styles$5 = i$c` :host { display: flex; justify-content: center; gap: var(--wui-spacing-2xl); } wui-visual-thumbnail:nth-child(1) { z-index: 1; } `; var __decorate$a = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mConnectingSiwe = class W3mConnectingSiwe extends s$7 { constructor() { var _a2; super(...arguments); this.dappImageUrl = (_a2 = OptionsController.state.metadata) == null ? void 0 : _a2.icons; this.walletImageUrl = StorageUtil.getConnectedWalletImageUrl(); } firstUpdated() { var _a2; const visuals = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelectorAll("wui-visual-thumbnail"); if (visuals == null ? void 0 : visuals[0]) { this.createAnimation(visuals[0], "translate(18px)"); } if (visuals == null ? void 0 : visuals[1]) { this.createAnimation(visuals[1], "translate(-18px)"); } } render() { var _a2; return x$5` `; } createAnimation(element, translation) { element.animate([{ transform: "translateX(0px)" }, { transform: translation }], { duration: 1600, easing: "cubic-bezier(0.56, 0, 0.48, 1)", direction: "alternate", iterations: Infinity }); } }; W3mConnectingSiwe.styles = styles$5; W3mConnectingSiwe = __decorate$a([ customElement("w3m-connecting-siwe") ], W3mConnectingSiwe); var __decorate$9 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mConnectingWcUnsupported = class W3mConnectingWcUnsupported extends s$7 { constructor() { var _a2; super(); this.wallet = (_a2 = RouterController.state.data) == null ? void 0 : _a2.wallet; if (!this.wallet) { throw new Error("w3m-connecting-wc-unsupported: No wallet provided"); } EventsController.sendEvent({ type: "track", event: "SELECT_WALLET", properties: { name: this.wallet.name, platform: "browser" } }); } render() { return x$5` Not Detected `; } }; W3mConnectingWcUnsupported = __decorate$9([ customElement("w3m-connecting-wc-unsupported") ], W3mConnectingWcUnsupported); var __decorate$8 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mConnectingWcWeb = class W3mConnectingWcWeb extends W3mConnectingWidget { constructor() { super(); if (!this.wallet) { throw new Error("w3m-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"; EventsController.sendEvent({ type: "track", event: "SELECT_WALLET", properties: { name: this.wallet.name, platform: "web" } }); } onConnectProxy() { var _a2; if (((_a2 = this.wallet) == null ? void 0 : _a2.webapp_link) && this.uri) { try { this.error = false; const { webapp_link, name: name2 } = this.wallet; const { redirect, href } = CoreHelperUtil.formatUniversalUrl(webapp_link, this.uri); ConnectionController.setWcLinking({ name: name2, href }); ConnectionController.setRecentWallet(this.wallet); CoreHelperUtil.openHref(redirect, "_blank"); } catch { this.error = true; } } } }; W3mConnectingWcWeb = __decorate$8([ customElement("w3m-connecting-wc-web") ], W3mConnectingWcWeb); const styles$4 = i$c` wui-icon-link[data-hidden='true'] { opacity: 0 !important; pointer-events: none; } `; var __decorate$7 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; function headings() { var _a2, _b2, _c2, _d, _e2, _f, _g; const connectorName = (_b2 = (_a2 = RouterController.state.data) == null ? void 0 : _a2.connector) == null ? void 0 : _b2.name; const walletName = (_d = (_c2 = RouterController.state.data) == null ? void 0 : _c2.wallet) == null ? void 0 : _d.name; const networkName = (_f = (_e2 = RouterController.state.data) == null ? void 0 : _e2.network) == null ? void 0 : _f.name; const name2 = walletName ?? connectorName; const connectors = ConnectorController.getConnectors(); const isEmail = connectors.length === 1 && ((_g = connectors[0]) == null ? void 0 : _g.id) === "w3m-email"; return { Connect: `Connect ${isEmail ? "Email" : ""} Wallet`, Account: void 0, ConnectingExternal: name2 ?? "Connect Wallet", ConnectingWalletConnect: name2 ?? "WalletConnect", ConnectingSiwe: "Sign In", Networks: "Choose Network", SwitchNetwork: networkName ?? "Switch Network", AllWallets: "All Wallets", WhatIsANetwork: "What is a network?", WhatIsAWallet: "What is a wallet?", GetWallet: "Get a wallet", Downloads: name2 ? `Get ${name2}` : "Downloads", EmailVerifyOtp: "Confirm Email", EmailVerifyDevice: "Register Device", ApproveTransaction: "Approve Transaction", Transactions: "Activity", UpgradeEmailWallet: "Upgrade your Wallet", UpdateEmailWallet: "Edit Email", UpdateEmailWalletWaiting: "Approve Email" }; } let W3mHeader = class W3mHeader extends s$7 { constructor() { super(); this.unsubscribe = []; this.heading = headings()[RouterController.state.view]; this.buffering = false; this.showBack = false; this.unsubscribe.push(RouterController.subscribeKey("view", (val) => { this.onViewChange(val); this.onHistoryChange(); }), ConnectionController.subscribeKey("buffering", (val) => this.buffering = val)); } disconnectCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } render() { return x$5` ${this.dynamicButtonTemplate()} ${this.titleTemplate()} ${this.separatorTemplate()} `; } onWalletHelp() { EventsController.sendEvent({ type: "track", event: "CLICK_WALLET_HELP" }); RouterController.push("WhatIsAWallet"); } async onClose() { if (SIWEController.state.isSiweEnabled && SIWEController.state.status !== "success") { await ConnectionController.disconnect(); } ModalController.close(); } titleTemplate() { return x$5`${this.heading}`; } dynamicButtonTemplate() { const { view } = RouterController.state; const isConnectHelp = view === "Connect"; const isApproveTransaction = view === "ApproveTransaction"; if (this.showBack && !isApproveTransaction) { return x$5``; } return x$5``; } separatorTemplate() { if (!this.heading) { return null; } return x$5``; } getPadding() { if (this.heading) { return ["l", "2l", "l", "2l"]; } return ["l", "2l", "0", "2l"]; } async onViewChange(view) { var _a2; const headingEl = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("wui-text"); if (headingEl) { const preset = headings()[view]; await headingEl.animate([{ opacity: 1 }, { opacity: 0 }], { duration: 200, fill: "forwards", easing: "ease" }).finished; this.heading = preset; headingEl.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 200, fill: "forwards", easing: "ease" }); } } async onHistoryChange() { var _a2; const { history } = RouterController.state; const buttonEl = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("#dynamic"); if (history.length > 1 && !this.showBack && buttonEl) { await buttonEl.animate([{ opacity: 1 }, { opacity: 0 }], { duration: 200, fill: "forwards", easing: "ease" }).finished; this.showBack = true; buttonEl.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 200, fill: "forwards", easing: "ease" }); } else if (history.length <= 1 && this.showBack && buttonEl) { await buttonEl.animate([{ opacity: 1 }, { opacity: 0 }], { duration: 200, fill: "forwards", easing: "ease" }).finished; this.showBack = false; buttonEl.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 200, fill: "forwards", easing: "ease" }); } } onGoBack() { if (RouterController.state.view === "ConnectingSiwe") { RouterController.push("Connect"); } else { RouterController.goBack(); } } }; W3mHeader.styles = [styles$4]; __decorate$7([ r$9() ], W3mHeader.prototype, "heading", void 0); __decorate$7([ r$9() ], W3mHeader.prototype, "buffering", void 0); __decorate$7([ r$9() ], W3mHeader.prototype, "showBack", void 0); W3mHeader = __decorate$7([ customElement("w3m-header") ], W3mHeader); var __decorate$6 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mHelpWidget = class W3mHelpWidget extends s$7 { constructor() { super(...arguments); this.data = []; } render() { return x$5` ${this.data.map((item) => x$5` ${item.images.map((image) => x$5``)} ${item.title} ${item.text} `)} `; } }; __decorate$6([ n$c({ type: Array }) ], W3mHelpWidget.prototype, "data", void 0); W3mHelpWidget = __decorate$6([ customElement("w3m-help-widget") ], W3mHelpWidget); const styles$3 = i$c` wui-flex { background-color: var(--wui-gray-glass-005); } a { text-decoration: none; color: var(--wui-color-fg-175); font-weight: 500; } `; var __decorate$5 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mLegalFooter = class W3mLegalFooter extends s$7 { render() { const { termsConditionsUrl, privacyPolicyUrl } = OptionsController.state; if (!termsConditionsUrl && !privacyPolicyUrl) { return null; } return x$5` By connecting your wallet, you agree to our
${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
`; } andTemplate() { const { termsConditionsUrl, privacyPolicyUrl } = OptionsController.state; return termsConditionsUrl && privacyPolicyUrl ? "and" : ""; } termsTemplate() { const { termsConditionsUrl } = OptionsController.state; if (!termsConditionsUrl) { return null; } return x$5`Terms of Service`; } privacyTemplate() { const { privacyPolicyUrl } = OptionsController.state; if (!privacyPolicyUrl) { return null; } return x$5`Privacy Policy`; } }; W3mLegalFooter.styles = [styles$3]; W3mLegalFooter = __decorate$5([ customElement("w3m-legal-footer") ], W3mLegalFooter); const styles$2 = i$c` :host { display: block; padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl); } `; var __decorate$4 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mMobileDownloadLinks = class W3mMobileDownloadLinks extends s$7 { constructor() { super(...arguments); this.wallet = void 0; } render() { if (!this.wallet) { this.style.display = "none"; return null; } const { name: name2, app_store, play_store, chrome_store, homepage } = this.wallet; const isMobile = CoreHelperUtil.isMobile(); const isIos = CoreHelperUtil.isIos(); const isAndroid = CoreHelperUtil.isAndroid(); const isMultiple = [app_store, play_store, homepage, chrome_store].filter(Boolean).length > 1; const shortName = UiHelperUtil.getTruncateString({ string: name2, charsStart: 12, charsEnd: 0, truncate: "end" }); if (isMultiple && !isMobile) { return x$5` RouterController.push("Downloads", { wallet: this.wallet })} > `; } if (!isMultiple && homepage) { return x$5` `; } if (app_store && isIos) { return x$5` `; } if (play_store && isAndroid) { return x$5` `; } this.style.display = "none"; return null; } onAppStore() { var _a2; if ((_a2 = this.wallet) == null ? void 0 : _a2.app_store) { CoreHelperUtil.openHref(this.wallet.app_store, "_blank"); } } onPlayStore() { var _a2; if ((_a2 = this.wallet) == null ? void 0 : _a2.play_store) { CoreHelperUtil.openHref(this.wallet.play_store, "_blank"); } } onHomePage() { var _a2; if ((_a2 = this.wallet) == null ? void 0 : _a2.homepage) { CoreHelperUtil.openHref(this.wallet.homepage, "_blank"); } } }; W3mMobileDownloadLinks.styles = [styles$2]; __decorate$4([ n$c({ type: Object }) ], W3mMobileDownloadLinks.prototype, "wallet", void 0); W3mMobileDownloadLinks = __decorate$4([ customElement("w3m-mobile-download-links") ], W3mMobileDownloadLinks); const styles$1 = i$c` :host { display: block; position: absolute; opacity: 0; pointer-events: none; top: 11px; left: 50%; width: max-content; } `; var __decorate$3 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; const presets = { success: { backgroundColor: "success-100", iconColor: "success-100", icon: "checkmark" }, error: { backgroundColor: "error-100", iconColor: "error-100", icon: "close" } }; let W3mSnackBar = class W3mSnackBar extends s$7 { constructor() { super(); this.unsubscribe = []; this.timeout = void 0; this.open = SnackController.state.open; this.unsubscribe.push(SnackController.subscribeKey("open", (val) => { this.open = val; this.onOpen(); })); } disconnectedCallback() { clearTimeout(this.timeout); this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } render() { const { message, variant } = SnackController.state; const preset = presets[variant]; return x$5` `; } onOpen() { clearTimeout(this.timeout); if (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 = setTimeout(() => SnackController.hide(), 2500); } else { this.animate([ { opacity: 1, transform: "translateX(-50%) scale(1)" }, { opacity: 0, transform: "translateX(-50%) scale(0.85)" } ], { duration: 150, fill: "forwards", easing: "ease" }); } } }; W3mSnackBar.styles = styles$1; __decorate$3([ r$9() ], W3mSnackBar.prototype, "open", void 0); W3mSnackBar = __decorate$3([ customElement("w3m-snackbar") ], W3mSnackBar); const styles = i$c` wui-separator { margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1); width: calc(100% + var(--wui-spacing-s) * 2); } wui-email-input { width: 100%; } form { width: 100%; display: block; position: relative; } wui-icon-link, wui-loading-spinner { position: absolute; top: 21px; transform: translateY(-50%); } wui-icon-link { right: var(--wui-spacing-xs); } wui-loading-spinner { right: var(--wui-spacing-m); } .alphaBanner { padding: 10px 12px 10px 10px; border-radius: var(--wui-border-radius-s); background: var(--wui-accent-glass-010); margin-bottom: var(--wui-spacing-s); } `; var __decorate$2 = globalThis && globalThis.__decorate || function(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; }; let W3mEmailLoginWidget = class W3mEmailLoginWidget extends s$7 { constructor() { super(); this.unsubscribe = []; this.formRef = e$9(); this.connectors = ConnectorController.state.connectors; this.email = ""; this.loading = false; this.error = ""; this.unsubscribe.push(ConnectorController.subscribeKey("connectors", (val) => this.connectors = val)); } disconnectedCallback() { this.unsubscribe.forEach((unsubscribe) => unsubscribe()); } firstUpdated() { var _a2; (_a2 = this.formRef.value) == null ? void 0 : _a2.addEventListener("keydown", (event) => { if (event.key === "Enter") { this.onSubmitEmail(event); } }); } render() { const multipleConnectors = this.connectors.length > 1; const connector = this.connectors.find((c2) => c2.type === "EMAIL"); if (!connector) { return null; } return x$5` ${this.alphaWarningTemplate()}
${this.submitButtonTemplate()}${this.loadingTemplate()}
${multipleConnectors ? x$5`` : null} `; } alphaWarningTemplate() { const showAlphaWarning = true; return showAlphaWarning ? x$5` This is an alpha version to test before launch ` : null; } submitButtonTemplate() { const showSubmit = !this.loading && this.email.length > 3; return showSubmit ? x$5` ` : null; } loadingTemplate() { return this.loading ? x$5`` : null; } onEmailInputChange(event) { this.email = event.detail; this.error = ""; } async onSubmitEmail(event) { try { if (this.loading) { return; } this.loading = true; event.preventDefault(); const emailConnector = ConnectorController.getEmailConnector(); if (!emailConnector) { throw new Error("w3m-email-login-widget: Email connector not found"); } const { action } = await emailConnector.provider.connectEmail({ email: this.email }); EventsController.sendEvent({ type: "track", event: "EMAIL_SUBMITTED" }); if (action === "VERIFY_OTP") { EventsController.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_SENT" }); RouterController.push("EmailVerifyOtp", { email: this.email }); } else if (action === "VERIFY_DEVICE") { RouterController.push("EmailVerifyDevice", { email: this.email }); } } catch (error2) { const parsedError = CoreHelperUtil.parseError(error2); if (parsedError == null ? void 0 : parsedError.includes("Invalid email")) { this.error = "Invalid email. Try again."; } else { SnackController.showError(error2); } } finally { this.loading = false; } } onFocusEvent() { EventsController.sendEvent({ type: "track", event: "EMAIL_LOGIN_SELECTED" }); } }; W3mEmailLoginWidget.styles = styles; __decorate$2([ r$9() ], W3mEmailLoginWidget.prototype, "connectors", void 0); __decorate$2([ r$9() ], W3mEmailLoginWidget.prototype, "email", void 0); __decorate$2([ r$9() ], W3mEmailLoginWidget.prototype, "loading", void 0); __decorate$2([ r$9() ], W3mEmailLoginWidget.prototype, "error", void 0); W3mEmailLoginWidget = __decorate$2([ customElement("w3m-email-login-widget") ], W3mEmailLoginWidget); let isInitialized = false; class Web3ModalScaffold { constructor(options) { this.initPromise = void 0; this.setIsConnected = (isConnected) => { AccountController.setIsConnected(isConnected); }; this.setCaipAddress = (caipAddress) => { AccountController.setCaipAddress(caipAddress); }; this.setBalance = (balance, balanceSymbol) => { AccountController.setBalance(balance, balanceSymbol); }; this.setProfileName = (profileName) => { AccountController.setProfileName(profileName); }; this.setProfileImage = (profileImage) => { AccountController.setProfileImage(profileImage); }; this.resetAccount = () => { AccountController.resetAccount(); }; this.setCaipNetwork = (caipNetwork) => { NetworkController.setCaipNetwork(caipNetwork); }; this.getCaipNetwork = () => NetworkController.state.caipNetwork; this.setRequestedCaipNetworks = (requestedCaipNetworks) => { NetworkController.setRequestedCaipNetworks(requestedCaipNetworks); }; this.getApprovedCaipNetworksData = () => NetworkController.getApprovedCaipNetworksData(); this.resetNetwork = () => { NetworkController.resetNetwork(); }; this.setConnectors = (connectors) => { ConnectorController.setConnectors(connectors); }; this.addConnector = (connector) => { ConnectorController.addConnector(connector); }; this.getConnectors = () => ConnectorController.getConnectors(); this.resetWcConnection = () => { ConnectionController.resetWcConnection(); }; this.fetchIdentity = (request) => BlockchainApiController.fetchIdentity(request); this.setAddressExplorerUrl = (addressExplorerUrl) => { AccountController.setAddressExplorerUrl(addressExplorerUrl); }; this.setSIWENonce = (nonce) => { SIWEController.setNonce(nonce); }; this.setSIWESession = (session) => { SIWEController.setSession(session); }; this.setSIWEStatus = (status) => { SIWEController.setStatus(status); }; this.setSIWEMessage = (message) => { SIWEController.setMessage(message); }; this.initControllers(options); this.initOrContinue(); } async open(options) { await this.initOrContinue(); ModalController.open(options); } async close() { await this.initOrContinue(); ModalController.close(); } setLoading(loading) { ModalController.setLoading(loading); } getThemeMode() { return ThemeController.state.themeMode; } getThemeVariables() { return ThemeController.state.themeVariables; } setThemeMode(themeMode) { ThemeController.setThemeMode(themeMode); setColorTheme(ThemeController.state.themeMode); try { const emailConnector = ConnectorController.getEmailConnector(); if (emailConnector) { emailConnector.provider.syncTheme({ themeMode: ThemeController.getSnapshot().themeMode }); } } catch { console.info("Unable to sync theme to email connector"); } } setThemeVariables(themeVariables) { ThemeController.setThemeVariables(themeVariables); setThemeVariables(ThemeController.state.themeVariables); try { const emailConnector = ConnectorController.getEmailConnector(); if (emailConnector) { emailConnector.provider.syncTheme({ themeVariables: ThemeController.getSnapshot().themeVariables }); } } catch { console.info("Unable to sync theme to email connector"); } } subscribeTheme(callback) { return ThemeController.subscribe(callback); } getState() { return { ...PublicStateController.state }; } subscribeState(callback) { return PublicStateController.subscribe(callback); } getEvent() { return { ...EventsController.state }; } subscribeEvents(callback) { return EventsController.subscribe(callback); } subscribeSIWEState(callback) { return SIWEController.subscribe(callback); } initControllers(options) { NetworkController.setClient(options.networkControllerClient); NetworkController.setDefaultCaipNetwork(options.defaultChain); OptionsController.setProjectId(options.projectId); OptionsController.setIncludeWalletIds(options.includeWalletIds); OptionsController.setExcludeWalletIds(options.excludeWalletIds); OptionsController.setFeaturedWalletIds(options.featuredWalletIds); OptionsController.setTokens(options.tokens); OptionsController.setTermsConditionsUrl(options.termsConditionsUrl); OptionsController.setPrivacyPolicyUrl(options.privacyPolicyUrl); OptionsController.setCustomWallets(options.customWallets); OptionsController.setEnableAnalytics(options.enableAnalytics); OptionsController.setSdkVersion(options._sdkVersion); ConnectionController.setClient(options.connectionControllerClient); if (options.siweControllerClient) { const siweClient = options.siweControllerClient; SIWEController.setSIWEClient(siweClient); } if (options.metadata) { OptionsController.setMetadata(options.metadata); } if (options.themeMode) { ThemeController.setThemeMode(options.themeMode); } if (options.themeVariables) { ThemeController.setThemeVariables(options.themeVariables); } } async initOrContinue() { if (!this.initPromise && !isInitialized && CoreHelperUtil.isClient()) { isInitialized = true; this.initPromise = new Promise(async (resolve) => { await Promise.all([Promise.resolve().then(() => index$6), Promise.resolve().then(() => index$5)]); const modal = document.createElement("w3m-modal"); document.body.insertAdjacentElement("beforeend", modal); resolve(); }); } return this.initPromise; } } const ConstantsUtil = { WALLET_CONNECT_CONNECTOR_ID: "walletConnect", INJECTED_CONNECTOR_ID: "injected", COINBASE_CONNECTOR_ID: "coinbaseWallet", SAFE_CONNECTOR_ID: "safe", LEDGER_CONNECTOR_ID: "ledger", EIP6963_CONNECTOR_ID: "eip6963", EMAIL_CONNECTOR_ID: "w3mEmail", EIP155: "eip155", ADD_CHAIN_METHOD: "wallet_addEthereumChain", EIP6963_ANNOUNCE_EVENT: "eip6963:announceProvider", EIP6963_REQUEST_EVENT: "eip6963:requestProvider", VERSION: "3.5.7" }; const PresetsUtil = { ConnectorExplorerIds: { [ConstantsUtil.COINBASE_CONNECTOR_ID]: "fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa", [ConstantsUtil.SAFE_CONNECTOR_ID]: "225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f", [ConstantsUtil.LEDGER_CONNECTOR_ID]: "19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927" }, EIP155NetworkImageIds: { 1: "692ed6ba-e569-459a-556a-776476829e00", 42161: "600a9a04-c1b9-42ca-6785-9b4b6ff85200", 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" }, ConnectorImageIds: { [ConstantsUtil.COINBASE_CONNECTOR_ID]: "0c2840c3-5b04-4c44-9661-fbd4b49e1800", [ConstantsUtil.SAFE_CONNECTOR_ID]: "461db637-8616-43ce-035a-d89b8a1d5800", [ConstantsUtil.LEDGER_CONNECTOR_ID]: "54a1aa77-d202-4f8d-0fb2-5d2bb6db0300", [ConstantsUtil.WALLET_CONNECT_CONNECTOR_ID]: "ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400", [ConstantsUtil.INJECTED_CONNECTOR_ID]: "07ba87ed-43aa-4adf-4540-9e6a2b9cae00" }, ConnectorNamesMap: { [ConstantsUtil.INJECTED_CONNECTOR_ID]: "Browser Wallet", [ConstantsUtil.WALLET_CONNECT_CONNECTOR_ID]: "WalletConnect", [ConstantsUtil.COINBASE_CONNECTOR_ID]: "Coinbase", [ConstantsUtil.LEDGER_CONNECTOR_ID]: "Ledger", [ConstantsUtil.SAFE_CONNECTOR_ID]: "Safe" }, ConnectorTypesMap: { [ConstantsUtil.INJECTED_CONNECTOR_ID]: "INJECTED", [ConstantsUtil.WALLET_CONNECT_CONNECTOR_ID]: "WALLET_CONNECT", [ConstantsUtil.EIP6963_CONNECTOR_ID]: "ANNOUNCED", [ConstantsUtil.EMAIL_CONNECTOR_ID]: "EMAIL" }, WalletConnectRpcChainIds: [ 1, 5, 11155111, 10, 420, 42161, 421613, 137, 80001, 42220, 1313161554, 1313161555, 56, 97, 43114, 43113, 100, 8453, 84531, 7777777, 999, 324, 280 ] }; const HelpersUtil = { caipNetworkIdToNumber(caipnetworkId) { return caipnetworkId ? Number(caipnetworkId.split(":")[1]) : void 0; }, getCaipTokens(tokens) { if (!tokens) { return void 0; } const caipTokens = {}; Object.entries(tokens).forEach(([id2, token2]) => { caipTokens[`${ConstantsUtil.EIP155}:${id2}`] = token2; }); return caipTokens; } }; function getCaipDefaultChain(chain) { if (!chain) { return void 0; } return { id: `${ConstantsUtil.EIP155}:${chain.id}`, name: chain.name, imageId: PresetsUtil.EIP155NetworkImageIds[chain.id] }; } const WALLET_CHOICE_KEY = "wagmi.wallet"; class Web3Modal extends Web3ModalScaffold { constructor(options) { const { wagmiConfig: wagmiConfig2, siweConfig, chains: chains2, defaultChain, tokens, _sdkVersion, ...w3mOptions } = options; if (!wagmiConfig2) { throw new Error("web3modal:constructor - wagmiConfig is undefined"); } if (!w3mOptions.projectId) { throw new Error("web3modal:constructor - projectId is undefined"); } const networkControllerClient = { switchCaipNetwork: async (caipNetwork) => { const chainId = HelpersUtil.caipNetworkIdToNumber(caipNetwork == null ? void 0 : caipNetwork.id); if (chainId) { await switchNetwork({ chainId }); } }, async getApprovedCaipNetworksData() { var _a2, _b2, _c2, _d; const walletChoice = localStorage.getItem(WALLET_CHOICE_KEY); if (walletChoice == null ? void 0 : walletChoice.includes(ConstantsUtil.EMAIL_CONNECTOR_ID)) { return { supportsAllNetworks: false, approvedCaipNetworkIds: PresetsUtil.WalletConnectRpcChainIds.map((id2) => `${ConstantsUtil.EIP155}:${id2}`) }; } else if (walletChoice == null ? void 0 : walletChoice.includes(ConstantsUtil.WALLET_CONNECT_CONNECTOR_ID)) { const connector = wagmiConfig2.connectors.find((c2) => c2.id === ConstantsUtil.WALLET_CONNECT_CONNECTOR_ID); if (!connector) { throw new Error("networkControllerClient:getApprovedCaipNetworks - connector is undefined"); } const provider = await connector.getProvider(); const ns2 = (_b2 = (_a2 = provider.signer) == null ? void 0 : _a2.session) == null ? void 0 : _b2.namespaces; const nsMethods = (_c2 = ns2 == null ? void 0 : ns2[ConstantsUtil.EIP155]) == null ? void 0 : _c2.methods; const nsChains = (_d = ns2 == null ? void 0 : ns2[ConstantsUtil.EIP155]) == null ? void 0 : _d.chains; return { supportsAllNetworks: nsMethods == null ? void 0 : nsMethods.includes(ConstantsUtil.ADD_CHAIN_METHOD), approvedCaipNetworkIds: nsChains }; } return { approvedCaipNetworkIds: void 0, supportsAllNetworks: true }; } }; const connectionControllerClient = { connectWalletConnect: async (onUri) => { var _a2; const connector = wagmiConfig2.connectors.find((c2) => c2.id === ConstantsUtil.WALLET_CONNECT_CONNECTOR_ID); if (!connector) { throw new Error("connectionControllerClient:getWalletConnectUri - connector is undefined"); } connector.on("message", (event) => { if (event.type === "display_uri") { onUri(event.data); connector.removeAllListeners(); } }); const chainId = HelpersUtil.caipNetworkIdToNumber((_a2 = this.getCaipNetwork()) == null ? void 0 : _a2.id); await connect({ connector, chainId }); }, connectExternal: async ({ id: id2, provider, info }) => { var _a2, _b2; const connector = wagmiConfig2.connectors.find((c2) => c2.id === id2); if (!connector) { throw new Error("connectionControllerClient:connectExternal - connector is undefined"); } if (provider && info && connector.id === ConstantsUtil.EIP6963_CONNECTOR_ID) { (_a2 = connector.setEip6963Wallet) == null ? void 0 : _a2.call(connector, { provider, info }); } const chainId = HelpersUtil.caipNetworkIdToNumber((_b2 = this.getCaipNetwork()) == null ? void 0 : _b2.id); await connect({ connector, chainId }); }, checkInstalled: (ids) => { const eip6963Connectors = this.getConnectors().filter((c2) => c2.type === "ANNOUNCED"); const injectedConnector = this.getConnectors().find((c2) => c2.type === "INJECTED"); if (!ids) { return Boolean(window.ethereum); } if (eip6963Connectors.length) { const installed = ids.some((id2) => eip6963Connectors.some((c2) => { var _a2; return ((_a2 = c2.info) == null ? void 0 : _a2.rdns) === id2; })); if (installed) { return true; } } if (injectedConnector) { if (!(window == null ? void 0 : window.ethereum)) { return false; } return ids.some((id2) => { var _a2; return Boolean((_a2 = window.ethereum) == null ? void 0 : _a2[String(id2)]); }); } return false; }, disconnect: async () => { var _a2; await disconnect(); if ((_a2 = siweConfig == null ? void 0 : siweConfig.options) == null ? void 0 : _a2.signOutOnDisconnect) { await siweConfig.signOut(); } }, signMessage: async (message) => signMessage({ message }) }; super({ networkControllerClient, connectionControllerClient, siweControllerClient: siweConfig, defaultChain: getCaipDefaultChain(defaultChain), tokens: HelpersUtil.getCaipTokens(tokens), _sdkVersion: _sdkVersion ?? `html-wagmi-${ConstantsUtil.VERSION}`, ...w3mOptions }); this.hasSyncedConnectedAccount = false; this.options = void 0; this.options = options; this.syncRequestedNetworks(chains2); this.syncConnectors(wagmiConfig2); this.syncEmailConnector(wagmiConfig2); this.listenEIP6963Connector(wagmiConfig2); this.listenEmailConnector(wagmiConfig2); watchAccount(() => this.syncAccount()); watchNetwork(() => this.syncNetwork()); } getState() { const state2 = super.getState(); return { ...state2, selectedNetworkId: HelpersUtil.caipNetworkIdToNumber(state2.selectedNetworkId) }; } subscribeState(callback) { return super.subscribeState((state2) => callback({ ...state2, selectedNetworkId: HelpersUtil.caipNetworkIdToNumber(state2.selectedNetworkId) })); } syncRequestedNetworks(chains2) { const requestedCaipNetworks = chains2 == null ? void 0 : chains2.map((chain) => { var _a2, _b2; return { id: `${ConstantsUtil.EIP155}:${chain.id}`, name: chain.name, imageId: PresetsUtil.EIP155NetworkImageIds[chain.id], imageUrl: (_b2 = (_a2 = this.options) == null ? void 0 : _a2.chainImages) == null ? void 0 : _b2[chain.id] }; }); this.setRequestedCaipNetworks(requestedCaipNetworks ?? []); } async syncAccount() { const { address, isConnected } = getAccount(); const { chain } = getNetwork(); this.resetAccount(); if (isConnected && address && chain) { const caipAddress = `${ConstantsUtil.EIP155}:${chain.id}:${address}`; this.setIsConnected(isConnected); this.setCaipAddress(caipAddress); await Promise.all([ this.syncProfile(address, chain), this.syncBalance(address, chain), this.getApprovedCaipNetworksData() ]); this.hasSyncedConnectedAccount = true; } else if (!isConnected && this.hasSyncedConnectedAccount) { this.resetWcConnection(); this.resetNetwork(); } } async syncNetwork() { var _a2, _b2, _c2, _d; const { address, isConnected } = getAccount(); const { chain } = getNetwork(); if (chain) { const chainId = String(chain.id); const caipChainId = `${ConstantsUtil.EIP155}:${chainId}`; this.setCaipNetwork({ id: caipChainId, name: chain.name, imageId: PresetsUtil.EIP155NetworkImageIds[chain.id], imageUrl: (_b2 = (_a2 = this.options) == null ? void 0 : _a2.chainImages) == null ? void 0 : _b2[chain.id] }); if (isConnected && address) { const caipAddress = `${ConstantsUtil.EIP155}:${chain.id}:${address}`; this.setCaipAddress(caipAddress); if ((_d = (_c2 = chain.blockExplorers) == null ? void 0 : _c2.default) == null ? void 0 : _d.url) { const url = `${chain.blockExplorers.default.url}/address/${address}`; this.setAddressExplorerUrl(url); } else { this.setAddressExplorerUrl(void 0); } if (this.hasSyncedConnectedAccount) { await this.syncProfile(address, chain); await this.syncBalance(address, chain); } } } } async syncProfile(address, chain) { if (chain.id !== mainnet.id) { this.setProfileName(null); this.setProfileImage(null); return; } try { const { name: name2, avatar } = await this.fetchIdentity({ caipChainId: `${ConstantsUtil.EIP155}:${chain.id}`, address }); this.setProfileName(name2); this.setProfileImage(avatar); } catch { const profileName = await fetchEnsName({ address, chainId: chain.id }); if (profileName) { this.setProfileName(profileName); const profileImage = await fetchEnsAvatar({ name: profileName, chainId: chain.id }); if (profileImage) { this.setProfileImage(profileImage); } } } } async syncBalance(address, chain) { var _a2, _b2, _c2; const balance = await fetchBalance({ address, chainId: chain.id, token: (_c2 = (_b2 = (_a2 = this.options) == null ? void 0 : _a2.tokens) == null ? void 0 : _b2[chain.id]) == null ? void 0 : _c2.address }); this.setBalance(balance.formatted, balance.symbol); } syncConnectors(wagmiConfig2) { const w3mConnectors = []; wagmiConfig2.connectors.forEach(({ id: id2, name: name2 }) => { var _a2, _b2; if (![ConstantsUtil.EIP6963_CONNECTOR_ID, ConstantsUtil.EMAIL_CONNECTOR_ID].includes(id2)) { w3mConnectors.push({ id: id2, explorerId: PresetsUtil.ConnectorExplorerIds[id2], imageId: PresetsUtil.ConnectorImageIds[id2], imageUrl: (_b2 = (_a2 = this.options) == null ? void 0 : _a2.connectorImages) == null ? void 0 : _b2[id2], name: PresetsUtil.ConnectorNamesMap[id2] ?? name2, type: PresetsUtil.ConnectorTypesMap[id2] ?? "EXTERNAL" }); } }); this.setConnectors(w3mConnectors); } async syncEmailConnector(wagmiConfig2) { const emailConnector = wagmiConfig2.connectors.find(({ id: id2 }) => id2 === "w3mEmail"); if (emailConnector) { const provider = await emailConnector.getProvider(); this.addConnector({ id: ConstantsUtil.EMAIL_CONNECTOR_ID, type: "EMAIL", name: "Email", provider }); } } eip6963EventHandler(connector, event) { var _a2, _b2; if (event.detail) { const { info, provider } = event.detail; const connectors = this.getConnectors(); const existingConnector = connectors.find((c2) => c2.name === info.name); if (!existingConnector) { this.addConnector({ id: ConstantsUtil.EIP6963_CONNECTOR_ID, type: "ANNOUNCED", imageUrl: info.icon ?? ((_b2 = (_a2 = this.options) == null ? void 0 : _a2.connectorImages) == null ? void 0 : _b2[ConstantsUtil.EIP6963_CONNECTOR_ID]), name: info.name, provider, info }); connector.isAuthorized({ info, provider }); } } } listenEIP6963Connector(wagmiConfig2) { const connector = wagmiConfig2.connectors.find((c2) => c2.id === ConstantsUtil.EIP6963_CONNECTOR_ID); if (typeof window !== "undefined" && connector) { const handler = this.eip6963EventHandler.bind(this, connector); window.addEventListener(ConstantsUtil.EIP6963_ANNOUNCE_EVENT, handler); window.dispatchEvent(new Event(ConstantsUtil.EIP6963_REQUEST_EVENT)); } } async listenEmailConnector(wagmiConfig2) { const connector = wagmiConfig2.connectors.find((c2) => c2.id === ConstantsUtil.EMAIL_CONNECTOR_ID); if (typeof window !== "undefined" && connector) { super.setLoading(true); const provider = await connector.getProvider(); const isLoginEmailUsed = provider.getLoginEmailUsed(); super.setLoading(isLoginEmailUsed); provider.onRpcRequest(() => { super.open({ view: "ApproveTransaction" }); }); provider.onRpcResponse(() => { super.close(); }); provider.onIsConnected(() => { super.setLoading(false); }); } } } var __classPrivateFieldSet$3 = globalThis && globalThis.__classPrivateFieldSet || function(receiver, state2, value, kind, f2) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f2) throw new TypeError("Private accessor was defined without a setter"); if (typeof state2 === "function" ? receiver !== state2 || !f2 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return kind === "a" ? f2.call(receiver, value) : f2 ? f2.value = value : state2.set(receiver, value), value; }; var __classPrivateFieldGet$3 = globalThis && globalThis.__classPrivateFieldGet || function(receiver, state2, kind, f2) { if (kind === "a" && !f2) throw new TypeError("Private accessor was defined without a getter"); if (typeof state2 === "function" ? receiver !== state2 || !f2 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f2 : kind === "a" ? f2.call(receiver) : f2 ? f2.value : state2.get(receiver); }; var _EIP6963Connector_defaultProvider, _EIP6963Connector_eip6963Wallet; const connectedRdnsKey = "connectedRdns"; class EIP6963Connector extends InjectedConnector { constructor(config2) { super({ chains: config2.chains, options: { shimDisconnect: true } }); this.id = "eip6963"; this.name = "EIP6963"; _EIP6963Connector_defaultProvider.set(this, void 0); _EIP6963Connector_eip6963Wallet.set(this, void 0); this.onAccountsChanged = (accounts) => { var _a2; if (accounts.length === 0) { (_a2 = this.storage) == null ? void 0 : _a2.removeItem(connectedRdnsKey); this.emit("disconnect"); } else if (accounts[0]) { this.emit("change", { account: getAddress(accounts[0]) }); } }; __classPrivateFieldSet$3(this, _EIP6963Connector_defaultProvider, this.options.getProvider(), "f"); } async connect(options) { var _a2; const data2 = await super.connect(options); if (__classPrivateFieldGet$3(this, _EIP6963Connector_eip6963Wallet, "f")) { (_a2 = this.storage) == null ? void 0 : _a2.setItem(connectedRdnsKey, __classPrivateFieldGet$3(this, _EIP6963Connector_eip6963Wallet, "f").info.rdns); } return data2; } async disconnect() { var _a2; await super.disconnect(); (_a2 = this.storage) == null ? void 0 : _a2.removeItem(connectedRdnsKey); __classPrivateFieldSet$3(this, _EIP6963Connector_eip6963Wallet, void 0, "f"); } async isAuthorized(eip6963Wallet) { var _a2; const connectedEIP6963Rdns = (_a2 = this.storage) == null ? void 0 : _a2.getItem(connectedRdnsKey); if (connectedEIP6963Rdns) { if (__classPrivateFieldGet$3(this, _EIP6963Connector_eip6963Wallet, "f") && connectedEIP6963Rdns === __classPrivateFieldGet$3(this, _EIP6963Connector_eip6963Wallet, "f").info.rdns) { const provider = __classPrivateFieldGet$3(this, _EIP6963Connector_eip6963Wallet, "f").provider; const accounts = await provider.request({ method: "eth_accounts" }); if (accounts.length) { return true; } } if (eip6963Wallet) { __classPrivateFieldSet$3(this, _EIP6963Connector_eip6963Wallet, eip6963Wallet, "f"); } } return super.isAuthorized(); } async getProvider() { var _a2; return Promise.resolve(((_a2 = __classPrivateFieldGet$3(this, _EIP6963Connector_eip6963Wallet, "f")) == null ? void 0 : _a2.provider) ?? __classPrivateFieldGet$3(this, _EIP6963Connector_defaultProvider, "f")); } setEip6963Wallet(eip6963Wallet) { __classPrivateFieldSet$3(this, _EIP6963Connector_eip6963Wallet, eip6963Wallet, "f"); } } _EIP6963Connector_defaultProvider = /* @__PURE__ */ new WeakMap(), _EIP6963Connector_eip6963Wallet = /* @__PURE__ */ new WeakMap(); class EmailConnector extends Connector { constructor(config2) { super(config2); this.id = "w3mEmail"; this.name = "Web3Modal Email"; this.ready = true; this.provider = {}; if (typeof window !== "undefined") { this.provider = new W3mFrameProvider(config2.options.projectId); } } async getProvider() { return Promise.resolve(this.provider); } async connect(options = {}) { const { address, chainId } = await this.provider.connect({ chainId: options.chainId }); return { account: address, chain: { id: chainId, unsupported: this.isChainUnsupported(1) } }; } async switchChain(chainId) { try { const chain = this.chains.find((c2) => c2.id === chainId); if (!chain) { throw new SwitchChainError(new Error("chain not found on connector.")); } await this.provider.switchNetwork(chainId); const unsupported = this.isChainUnsupported(chainId); this.emit("change", { chain: { id: chainId, unsupported } }); return chain; } catch (error2) { if (error2 instanceof Error) { throw new SwitchChainError(error2); } throw error2; } } async disconnect() { await this.provider.disconnect(); } async getAccount() { const { address } = await this.provider.connect(); return address; } async getChainId() { const { chainId } = await this.provider.getChainId(); return chainId; } async getWalletClient() { const { address, chainId } = await this.provider.connect(); return Promise.resolve(createWalletClient({ account: address, chain: { id: chainId }, transport: custom$1(this.provider) })); } async isAuthorized() { const { isConnected } = await this.provider.isConnected(); return isConnected; } onAccountsChanged() { } onChainChanged() { } onDisconnect() { } } var buffer = {}; var base64Js = {}; base64Js.byteLength = byteLength; base64Js.toByteArray = toByteArray; base64Js.fromByteArray = fromByteArray; var lookup = []; var revLookup = []; var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; for (var i$8 = 0, len = code.length; i$8 < len; ++i$8) { lookup[i$8] = code[i$8]; revLookup[code.charCodeAt(i$8)] = i$8; } revLookup["-".charCodeAt(0)] = 62; revLookup["_".charCodeAt(0)] = 63; function getLens(b64) { var len2 = b64.length; if (len2 % 4 > 0) { throw new Error("Invalid string. Length must be a multiple of 4"); } var validLen = b64.indexOf("="); if (validLen === -1) validLen = len2; var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; return [validLen, placeHoldersLen]; } function byteLength(b64) { var lens = getLens(b64); var validLen = lens[0]; var placeHoldersLen = lens[1]; return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; } function _byteLength(b64, validLen, placeHoldersLen) { return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; } function toByteArray(b64) { var tmp; var lens = getLens(b64); var validLen = lens[0]; var placeHoldersLen = lens[1]; var arr2 = new Arr(_byteLength(b64, validLen, placeHoldersLen)); var curByte = 0; var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; var i2; for (i2 = 0; i2 < len2; i2 += 4) { tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)]; arr2[curByte++] = tmp >> 16 & 255; arr2[curByte++] = tmp >> 8 & 255; arr2[curByte++] = tmp & 255; } if (placeHoldersLen === 2) { tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4; arr2[curByte++] = tmp & 255; } if (placeHoldersLen === 1) { tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2; arr2[curByte++] = tmp >> 8 & 255; arr2[curByte++] = tmp & 255; } return arr2; } function tripletToBase64(num) { return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; } function encodeChunk(uint8, start, end) { var tmp; var output2 = []; for (var i2 = start; i2 < end; i2 += 3) { tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255); output2.push(tripletToBase64(tmp)); } return output2.join(""); } function fromByteArray(uint8) { var tmp; var len2 = uint8.length; var extraBytes = len2 % 3; var parts = []; var maxChunkLength = 16383; for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) { parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength)); } if (extraBytes === 1) { tmp = uint8[len2 - 1]; parts.push( lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==" ); } else if (extraBytes === 2) { tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; parts.push( lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=" ); } return parts.join(""); } var ieee754 = {}; /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ ieee754.read = function(buffer2, offset, isLE2, mLen, nBytes) { var e2, m2; var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var nBits = -7; var i2 = isLE2 ? nBytes - 1 : 0; var d2 = isLE2 ? -1 : 1; var s2 = buffer2[offset + i2]; i2 += d2; e2 = s2 & (1 << -nBits) - 1; s2 >>= -nBits; nBits += eLen; for (; nBits > 0; e2 = e2 * 256 + buffer2[offset + i2], i2 += d2, nBits -= 8) { } m2 = e2 & (1 << -nBits) - 1; e2 >>= -nBits; nBits += mLen; for (; nBits > 0; m2 = m2 * 256 + buffer2[offset + i2], i2 += d2, nBits -= 8) { } if (e2 === 0) { e2 = 1 - eBias; } else if (e2 === eMax) { return m2 ? NaN : (s2 ? -1 : 1) * Infinity; } else { m2 = m2 + Math.pow(2, mLen); e2 = e2 - eBias; } return (s2 ? -1 : 1) * m2 * Math.pow(2, e2 - mLen); }; ieee754.write = function(buffer2, value, offset, isLE2, mLen, nBytes) { var e2, m2, c2; var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var rt2 = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; var i2 = isLE2 ? 0 : nBytes - 1; var d2 = isLE2 ? 1 : -1; var s2 = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; value = Math.abs(value); if (isNaN(value) || value === Infinity) { m2 = isNaN(value) ? 1 : 0; e2 = eMax; } else { e2 = Math.floor(Math.log(value) / Math.LN2); if (value * (c2 = Math.pow(2, -e2)) < 1) { e2--; c2 *= 2; } if (e2 + eBias >= 1) { value += rt2 / c2; } else { value += rt2 * Math.pow(2, 1 - eBias); } if (value * c2 >= 2) { e2++; c2 /= 2; } if (e2 + eBias >= eMax) { m2 = 0; e2 = eMax; } else if (e2 + eBias >= 1) { m2 = (value * c2 - 1) * Math.pow(2, mLen); e2 = e2 + eBias; } else { m2 = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); e2 = 0; } } for (; mLen >= 8; buffer2[offset + i2] = m2 & 255, i2 += d2, m2 /= 256, mLen -= 8) { } e2 = e2 << mLen | m2; eLen += mLen; for (; eLen > 0; buffer2[offset + i2] = e2 & 255, i2 += d2, e2 /= 256, eLen -= 8) { } buffer2[offset + i2 - d2] |= s2 * 128; }; /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ (function(exports3) { const base642 = base64Js; const ieee754$1 = ieee754; const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; exports3.Buffer = Buffer2; exports3.SlowBuffer = SlowBuffer; exports3.INSPECT_MAX_BYTES = 50; const K_MAX_LENGTH = 2147483647; exports3.kMaxLength = K_MAX_LENGTH; Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport(); if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && 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 typedArraySupport() { try { const arr2 = new Uint8Array(1); const proto = { foo: function() { return 42; } }; Object.setPrototypeOf(proto, Uint8Array.prototype); Object.setPrototypeOf(arr2, proto); return arr2.foo() === 42; } catch (e2) { return false; } } Object.defineProperty(Buffer2.prototype, "parent", { enumerable: true, get: function() { if (!Buffer2.isBuffer(this)) return void 0; return this.buffer; } }); Object.defineProperty(Buffer2.prototype, "offset", { enumerable: true, get: function() { if (!Buffer2.isBuffer(this)) return void 0; return this.byteOffset; } }); function createBuffer(length) { if (length > K_MAX_LENGTH) { throw new RangeError('The value "' + length + '" is invalid for option "size"'); } const buf = new Uint8Array(length); Object.setPrototypeOf(buf, Buffer2.prototype); return buf; } function Buffer2(arg, encodingOrOffset, length) { if (typeof arg === "number") { if (typeof encodingOrOffset === "string") { throw new TypeError( 'The "string" argument must be of type string. Received type number' ); } return allocUnsafe2(arg); } return from2(arg, encodingOrOffset, length); } Buffer2.poolSize = 8192; function from2(value, encodingOrOffset, length) { if (typeof value === "string") { return fromString2(value, encodingOrOffset); } if (ArrayBuffer.isView(value)) { return fromArrayView(value); } if (value == null) { throw new TypeError( "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value ); } if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { return fromArrayBuffer(value, encodingOrOffset, length); } if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { return fromArrayBuffer(value, encodingOrOffset, length); } if (typeof value === "number") { throw new TypeError( 'The "value" argument must not be of type number. Received type number' ); } const valueOf = value.valueOf && value.valueOf(); if (valueOf != null && valueOf !== value) { return Buffer2.from(valueOf, encodingOrOffset, length); } const b2 = fromObject(value); if (b2) return b2; if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length); } throw new TypeError( "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value ); } Buffer2.from = function(value, encodingOrOffset, length) { return from2(value, encodingOrOffset, length); }; Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype); Object.setPrototypeOf(Buffer2, Uint8Array); function assertSize2(size2) { if (typeof size2 !== "number") { throw new TypeError('"size" argument must be of type number'); } else if (size2 < 0) { throw new RangeError('The value "' + size2 + '" is invalid for option "size"'); } } function alloc(size2, fill, encoding) { assertSize2(size2); if (size2 <= 0) { return createBuffer(size2); } if (fill !== void 0) { return typeof encoding === "string" ? createBuffer(size2).fill(fill, encoding) : createBuffer(size2).fill(fill); } return createBuffer(size2); } Buffer2.alloc = function(size2, fill, encoding) { return alloc(size2, fill, encoding); }; function allocUnsafe2(size2) { assertSize2(size2); return createBuffer(size2 < 0 ? 0 : checked(size2) | 0); } Buffer2.allocUnsafe = function(size2) { return allocUnsafe2(size2); }; Buffer2.allocUnsafeSlow = function(size2) { return allocUnsafe2(size2); }; function fromString2(string2, encoding) { if (typeof encoding !== "string" || encoding === "") { encoding = "utf8"; } if (!Buffer2.isEncoding(encoding)) { throw new TypeError("Unknown encoding: " + encoding); } const length = byteLength2(string2, encoding) | 0; let buf = createBuffer(length); const actual = buf.write(string2, encoding); if (actual !== length) { buf = buf.slice(0, actual); } return buf; } function fromArrayLike(array2) { const length = array2.length < 0 ? 0 : checked(array2.length) | 0; const buf = createBuffer(length); for (let i2 = 0; i2 < length; i2 += 1) { buf[i2] = array2[i2] & 255; } return buf; } function fromArrayView(arrayView) { if (isInstance(arrayView, Uint8Array)) { const copy = new Uint8Array(arrayView); return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); } return fromArrayLike(arrayView); } function fromArrayBuffer(array2, byteOffset, length) { if (byteOffset < 0 || array2.byteLength < byteOffset) { throw new RangeError('"offset" is outside of buffer bounds'); } if (array2.byteLength < byteOffset + (length || 0)) { throw new RangeError('"length" is outside of buffer bounds'); } let buf; if (byteOffset === void 0 && length === void 0) { buf = new Uint8Array(array2); } else if (length === void 0) { buf = new Uint8Array(array2, byteOffset); } else { buf = new Uint8Array(array2, byteOffset, length); } Object.setPrototypeOf(buf, Buffer2.prototype); return buf; } function fromObject(obj) { if (Buffer2.isBuffer(obj)) { const len2 = checked(obj.length) | 0; const buf = createBuffer(len2); if (buf.length === 0) { return buf; } obj.copy(buf, 0, 0, len2); return buf; } if (obj.length !== void 0) { if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { return createBuffer(0); } return fromArrayLike(obj); } if (obj.type === "Buffer" && Array.isArray(obj.data)) { return fromArrayLike(obj.data); } } function checked(length) { if (length >= K_MAX_LENGTH) { throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); } return length | 0; } function SlowBuffer(length) { if (+length != length) { length = 0; } return Buffer2.alloc(+length); } Buffer2.isBuffer = function isBuffer(b2) { return b2 != null && b2._isBuffer === true && b2 !== Buffer2.prototype; }; Buffer2.compare = function compare2(a2, b2) { if (isInstance(a2, Uint8Array)) a2 = Buffer2.from(a2, a2.offset, a2.byteLength); if (isInstance(b2, Uint8Array)) b2 = Buffer2.from(b2, b2.offset, b2.byteLength); if (!Buffer2.isBuffer(a2) || !Buffer2.isBuffer(b2)) { throw new TypeError( 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' ); } if (a2 === b2) return 0; let x2 = a2.length; let y2 = b2.length; for (let i2 = 0, len2 = Math.min(x2, y2); i2 < len2; ++i2) { if (a2[i2] !== b2[i2]) { x2 = a2[i2]; y2 = b2[i2]; break; } } if (x2 < y2) return -1; if (y2 < x2) return 1; return 0; }; Buffer2.isEncoding = function isEncoding(encoding) { switch (String(encoding).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 true; default: return false; } }; Buffer2.concat = function concat2(list, length) { if (!Array.isArray(list)) { throw new TypeError('"list" argument must be an Array of Buffers'); } if (list.length === 0) { return Buffer2.alloc(0); } let i2; if (length === void 0) { length = 0; for (i2 = 0; i2 < list.length; ++i2) { length += list[i2].length; } } const buffer2 = Buffer2.allocUnsafe(length); let pos = 0; for (i2 = 0; i2 < list.length; ++i2) { let buf = list[i2]; if (isInstance(buf, Uint8Array)) { if (pos + buf.length > buffer2.length) { if (!Buffer2.isBuffer(buf)) buf = Buffer2.from(buf); buf.copy(buffer2, pos); } else { Uint8Array.prototype.set.call( buffer2, buf, pos ); } } else if (!Buffer2.isBuffer(buf)) { throw new TypeError('"list" argument must be an Array of Buffers'); } else { buf.copy(buffer2, pos); } pos += buf.length; } return buffer2; }; function byteLength2(string2, encoding) { if (Buffer2.isBuffer(string2)) { return string2.length; } if (ArrayBuffer.isView(string2) || isInstance(string2, ArrayBuffer)) { return string2.byteLength; } if (typeof string2 !== "string") { throw new TypeError( 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string2 ); } const len2 = string2.length; const mustMatch = arguments.length > 2 && arguments[2] === true; if (!mustMatch && len2 === 0) return 0; let loweredCase = false; for (; ; ) { switch (encoding) { case "ascii": case "latin1": case "binary": return len2; case "utf8": case "utf-8": return utf8ToBytes2(string2).length; case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return len2 * 2; case "hex": return len2 >>> 1; case "base64": return base64ToBytes(string2).length; default: if (loweredCase) { return mustMatch ? -1 : utf8ToBytes2(string2).length; } encoding = ("" + encoding).toLowerCase(); loweredCase = true; } } } Buffer2.byteLength = byteLength2; function slowToString(encoding, start, end) { let loweredCase = false; if (start === void 0 || start < 0) { start = 0; } if (start > this.length) { return ""; } if (end === void 0 || end > this.length) { end = this.length; } if (end <= 0) { return ""; } end >>>= 0; start >>>= 0; if (end <= start) { return ""; } if (!encoding) encoding = "utf8"; while (true) { switch (encoding) { case "hex": return hexSlice(this, start, end); case "utf8": case "utf-8": return utf8Slice(this, start, end); case "ascii": return asciiSlice(this, start, end); case "latin1": case "binary": return latin1Slice(this, start, end); case "base64": return base64Slice(this, start, end); case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return utf16leSlice(this, start, end); default: if (loweredCase) throw new TypeError("Unknown encoding: " + encoding); encoding = (encoding + "").toLowerCase(); loweredCase = true; } } } Buffer2.prototype._isBuffer = true; function swap(b2, n2, m2) { const i2 = b2[n2]; b2[n2] = b2[m2]; b2[m2] = i2; } Buffer2.prototype.swap16 = function swap16() { const len2 = this.length; if (len2 % 2 !== 0) { throw new RangeError("Buffer size must be a multiple of 16-bits"); } for (let i2 = 0; i2 < len2; i2 += 2) { swap(this, i2, i2 + 1); } return this; }; Buffer2.prototype.swap32 = function swap32() { const len2 = this.length; if (len2 % 4 !== 0) { throw new RangeError("Buffer size must be a multiple of 32-bits"); } for (let i2 = 0; i2 < len2; i2 += 4) { swap(this, i2, i2 + 3); swap(this, i2 + 1, i2 + 2); } return this; }; Buffer2.prototype.swap64 = function swap64() { const len2 = this.length; if (len2 % 8 !== 0) { throw new RangeError("Buffer size must be a multiple of 64-bits"); } for (let i2 = 0; i2 < len2; i2 += 8) { swap(this, i2, i2 + 7); swap(this, i2 + 1, i2 + 6); swap(this, i2 + 2, i2 + 5); swap(this, i2 + 3, i2 + 4); } return this; }; Buffer2.prototype.toString = function toString2() { const length = this.length; if (length === 0) return ""; if (arguments.length === 0) return utf8Slice(this, 0, length); return slowToString.apply(this, arguments); }; Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; Buffer2.prototype.equals = function equals(b2) { if (!Buffer2.isBuffer(b2)) throw new TypeError("Argument must be a Buffer"); if (this === b2) return true; return Buffer2.compare(this, b2) === 0; }; Buffer2.prototype.inspect = function inspect() { let str = ""; const max2 = exports3.INSPECT_MAX_BYTES; str = this.toString("hex", 0, max2).replace(/(.{2})/g, "$1 ").trim(); if (this.length > max2) str += " ... "; return ""; }; if (customInspectSymbol) { Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect; } Buffer2.prototype.compare = function compare2(target, start, end, thisStart, thisEnd) { if (isInstance(target, Uint8Array)) { target = Buffer2.from(target, target.offset, target.byteLength); } if (!Buffer2.isBuffer(target)) { throw new TypeError( 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target ); } if (start === void 0) { start = 0; } if (end === void 0) { end = target ? target.length : 0; } if (thisStart === void 0) { thisStart = 0; } if (thisEnd === void 0) { thisEnd = this.length; } if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { throw new RangeError("out of range index"); } if (thisStart >= thisEnd && start >= end) { return 0; } if (thisStart >= thisEnd) { return -1; } if (start >= end) { return 1; } start >>>= 0; end >>>= 0; thisStart >>>= 0; thisEnd >>>= 0; if (this === target) return 0; let x2 = thisEnd - thisStart; let y2 = end - start; const len2 = Math.min(x2, y2); const thisCopy = this.slice(thisStart, thisEnd); const targetCopy = target.slice(start, end); for (let i2 = 0; i2 < len2; ++i2) { if (thisCopy[i2] !== targetCopy[i2]) { x2 = thisCopy[i2]; y2 = targetCopy[i2]; break; } } if (x2 < y2) return -1; if (y2 < x2) return 1; return 0; }; function bidirectionalIndexOf(buffer2, val, byteOffset, encoding, dir) { if (buffer2.length === 0) return -1; if (typeof byteOffset === "string") { encoding = byteOffset; byteOffset = 0; } else if (byteOffset > 2147483647) { byteOffset = 2147483647; } else if (byteOffset < -2147483648) { byteOffset = -2147483648; } byteOffset = +byteOffset; if (numberIsNaN(byteOffset)) { byteOffset = dir ? 0 : buffer2.length - 1; } if (byteOffset < 0) byteOffset = buffer2.length + byteOffset; if (byteOffset >= buffer2.length) { if (dir) return -1; else byteOffset = buffer2.length - 1; } else if (byteOffset < 0) { if (dir) byteOffset = 0; else return -1; } if (typeof val === "string") { val = Buffer2.from(val, encoding); } if (Buffer2.isBuffer(val)) { if (val.length === 0) { return -1; } return arrayIndexOf(buffer2, val, byteOffset, encoding, dir); } else if (typeof val === "number") { val = val & 255; if (typeof Uint8Array.prototype.indexOf === "function") { if (dir) { return Uint8Array.prototype.indexOf.call(buffer2, val, byteOffset); } else { return Uint8Array.prototype.lastIndexOf.call(buffer2, val, byteOffset); } } return arrayIndexOf(buffer2, [val], byteOffset, encoding, dir); } throw new TypeError("val must be string, number or Buffer"); } function arrayIndexOf(arr2, val, byteOffset, encoding, dir) { let indexSize = 1; let arrLength = arr2.length; let valLength = val.length; if (encoding !== void 0) { encoding = String(encoding).toLowerCase(); if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { if (arr2.length < 2 || val.length < 2) { return -1; } indexSize = 2; arrLength /= 2; valLength /= 2; byteOffset /= 2; } } function read(buf, i3) { if (indexSize === 1) { return buf[i3]; } else { return buf.readUInt16BE(i3 * indexSize); } } let i2; if (dir) { let foundIndex = -1; for (i2 = byteOffset; i2 < arrLength; i2++) { if (read(arr2, i2) === read(val, foundIndex === -1 ? 0 : i2 - foundIndex)) { if (foundIndex === -1) foundIndex = i2; if (i2 - foundIndex + 1 === valLength) return foundIndex * indexSize; } else { if (foundIndex !== -1) i2 -= i2 - foundIndex; foundIndex = -1; } } } else { if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; for (i2 = byteOffset; i2 >= 0; i2--) { let found = true; for (let j2 = 0; j2 < valLength; j2++) { if (read(arr2, i2 + j2) !== read(val, j2)) { found = false; break; } } if (found) return i2; } } return -1; } Buffer2.prototype.includes = function includes2(val, byteOffset, encoding) { return this.indexOf(val, byteOffset, encoding) !== -1; }; Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, true); }; Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, false); }; function hexWrite(buf, string2, offset, length) { offset = Number(offset) || 0; const remaining = buf.length - offset; if (!length) { length = remaining; } else { length = Number(length); if (length > remaining) { length = remaining; } } const strLen = string2.length; if (length > strLen / 2) { length = strLen / 2; } let i2; for (i2 = 0; i2 < length; ++i2) { const parsed = parseInt(string2.substr(i2 * 2, 2), 16); if (numberIsNaN(parsed)) return i2; buf[offset + i2] = parsed; } return i2; } function utf8Write(buf, string2, offset, length) { return blitBuffer(utf8ToBytes2(string2, buf.length - offset), buf, offset, length); } function asciiWrite(buf, string2, offset, length) { return blitBuffer(asciiToBytes(string2), buf, offset, length); } function base64Write(buf, string2, offset, length) { return blitBuffer(base64ToBytes(string2), buf, offset, length); } function ucs2Write(buf, string2, offset, length) { return blitBuffer(utf16leToBytes(string2, buf.length - offset), buf, offset, length); } Buffer2.prototype.write = function write(string2, offset, length, encoding) { if (offset === void 0) { encoding = "utf8"; length = this.length; offset = 0; } else if (length === void 0 && typeof offset === "string") { encoding = offset; length = this.length; offset = 0; } else if (isFinite(offset)) { offset = offset >>> 0; if (isFinite(length)) { length = length >>> 0; if (encoding === void 0) encoding = "utf8"; } else { encoding = length; length = void 0; } } else { throw new Error( "Buffer.write(string, encoding, offset[, length]) is no longer supported" ); } const remaining = this.length - offset; if (length === void 0 || length > remaining) length = remaining; if (string2.length > 0 && (length < 0 || offset < 0) || offset > this.length) { throw new RangeError("Attempt to write outside buffer bounds"); } if (!encoding) encoding = "utf8"; let loweredCase = false; for (; ; ) { switch (encoding) { case "hex": return hexWrite(this, string2, offset, length); case "utf8": case "utf-8": return utf8Write(this, string2, offset, length); case "ascii": case "latin1": case "binary": return asciiWrite(this, string2, offset, length); case "base64": return base64Write(this, string2, offset, length); case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return ucs2Write(this, string2, offset, length); default: if (loweredCase) throw new TypeError("Unknown encoding: " + encoding); encoding = ("" + encoding).toLowerCase(); loweredCase = true; } } }; Buffer2.prototype.toJSON = function toJSON() { return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) }; }; function base64Slice(buf, start, end) { if (start === 0 && end === buf.length) { return base642.fromByteArray(buf); } else { return base642.fromByteArray(buf.slice(start, end)); } } function utf8Slice(buf, start, end) { end = Math.min(buf.length, end); const res = []; let i2 = start; while (i2 < end) { const firstByte = buf[i2]; let codePoint = null; let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; if (i2 + bytesPerSequence <= end) { let secondByte, thirdByte, fourthByte, tempCodePoint; switch (bytesPerSequence) { case 1: if (firstByte < 128) { codePoint = firstByte; } break; case 2: secondByte = buf[i2 + 1]; if ((secondByte & 192) === 128) { tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; if (tempCodePoint > 127) { codePoint = tempCodePoint; } } break; case 3: secondByte = buf[i2 + 1]; thirdByte = buf[i2 + 2]; if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { codePoint = tempCodePoint; } } break; case 4: secondByte = buf[i2 + 1]; thirdByte = buf[i2 + 2]; fourthByte = buf[i2 + 3]; if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; if (tempCodePoint > 65535 && tempCodePoint < 1114112) { codePoint = tempCodePoint; } } } } if (codePoint === null) { codePoint = 65533; bytesPerSequence = 1; } else if (codePoint > 65535) { codePoint -= 65536; res.push(codePoint >>> 10 & 1023 | 55296); codePoint = 56320 | codePoint & 1023; } res.push(codePoint); i2 += bytesPerSequence; } return decodeCodePointsArray(res); } const MAX_ARGUMENTS_LENGTH = 4096; function decodeCodePointsArray(codePoints) { const len2 = codePoints.length; if (len2 <= MAX_ARGUMENTS_LENGTH) { return String.fromCharCode.apply(String, codePoints); } let res = ""; let i2 = 0; while (i2 < len2) { res += String.fromCharCode.apply( String, codePoints.slice(i2, i2 += MAX_ARGUMENTS_LENGTH) ); } return res; } function asciiSlice(buf, start, end) { let ret = ""; end = Math.min(buf.length, end); for (let i2 = start; i2 < end; ++i2) { ret += String.fromCharCode(buf[i2] & 127); } return ret; } function latin1Slice(buf, start, end) { let ret = ""; end = Math.min(buf.length, end); for (let i2 = start; i2 < end; ++i2) { ret += String.fromCharCode(buf[i2]); } return ret; } function hexSlice(buf, start, end) { const len2 = buf.length; if (!start || start < 0) start = 0; if (!end || end < 0 || end > len2) end = len2; let out = ""; for (let i2 = start; i2 < end; ++i2) { out += hexSliceLookupTable[buf[i2]]; } return out; } function utf16leSlice(buf, start, end) { const bytes2 = buf.slice(start, end); let res = ""; for (let i2 = 0; i2 < bytes2.length - 1; i2 += 2) { res += String.fromCharCode(bytes2[i2] + bytes2[i2 + 1] * 256); } return res; } Buffer2.prototype.slice = function slice2(start, end) { const len2 = this.length; start = ~~start; end = end === void 0 ? len2 : ~~end; if (start < 0) { start += len2; if (start < 0) start = 0; } else if (start > len2) { start = len2; } if (end < 0) { end += len2; if (end < 0) end = 0; } else if (end > len2) { end = len2; } if (end < start) end = start; const newBuf = this.subarray(start, end); Object.setPrototypeOf(newBuf, Buffer2.prototype); return newBuf; }; function checkOffset(offset, ext, length) { if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint"); if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length"); } Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength3, noAssert) { offset = offset >>> 0; byteLength3 = byteLength3 >>> 0; if (!noAssert) checkOffset(offset, byteLength3, this.length); let val = this[offset]; let mul = 1; let i2 = 0; while (++i2 < byteLength3 && (mul *= 256)) { val += this[offset + i2] * mul; } return val; }; Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength3, noAssert) { offset = offset >>> 0; byteLength3 = byteLength3 >>> 0; if (!noAssert) { checkOffset(offset, byteLength3, this.length); } let val = this[offset + --byteLength3]; let mul = 1; while (byteLength3 > 0 && (mul *= 256)) { val += this[offset + --byteLength3] * mul; } return val; }; Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 1, this.length); return this[offset]; }; Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 2, this.length); return this[offset] | this[offset + 1] << 8; }; Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 2, this.length); return this[offset] << 8 | this[offset + 1]; }; Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 4, this.length); return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; }; Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 4, this.length); return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); }; Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { offset = offset >>> 0; validateNumber(offset, "offset"); const first = this[offset]; const last = this[offset + 7]; if (first === void 0 || last === void 0) { boundsError(offset, this.length - 8); } const lo2 = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24; return BigInt(lo2) + (BigInt(hi) << BigInt(32)); }); Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { offset = offset >>> 0; validateNumber(offset, "offset"); const first = this[offset]; const last = this[offset + 7]; if (first === void 0 || last === void 0) { boundsError(offset, this.length - 8); } const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; const lo2 = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last; return (BigInt(hi) << BigInt(32)) + BigInt(lo2); }); Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength3, noAssert) { offset = offset >>> 0; byteLength3 = byteLength3 >>> 0; if (!noAssert) checkOffset(offset, byteLength3, this.length); let val = this[offset]; let mul = 1; let i2 = 0; while (++i2 < byteLength3 && (mul *= 256)) { val += this[offset + i2] * mul; } mul *= 128; if (val >= mul) val -= Math.pow(2, 8 * byteLength3); return val; }; Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength3, noAssert) { offset = offset >>> 0; byteLength3 = byteLength3 >>> 0; if (!noAssert) checkOffset(offset, byteLength3, this.length); let i2 = byteLength3; let mul = 1; let val = this[offset + --i2]; while (i2 > 0 && (mul *= 256)) { val += this[offset + --i2] * mul; } mul *= 128; if (val >= mul) val -= Math.pow(2, 8 * byteLength3); return val; }; Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 1, this.length); if (!(this[offset] & 128)) return this[offset]; return (255 - this[offset] + 1) * -1; }; Buffer2.prototype.readInt16LE = function readInt16LE2(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 2, this.length); const val = this[offset] | this[offset + 1] << 8; return val & 32768 ? val | 4294901760 : val; }; Buffer2.prototype.readInt16BE = function readInt16BE2(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 2, this.length); const val = this[offset + 1] | this[offset] << 8; return val & 32768 ? val | 4294901760 : val; }; Buffer2.prototype.readInt32LE = function readInt32LE2(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 4, this.length); return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; }; Buffer2.prototype.readInt32BE = function readInt32BE2(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 4, this.length); return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; }; Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { offset = offset >>> 0; validateNumber(offset, "offset"); const first = this[offset]; const last = this[offset + 7]; if (first === void 0 || last === void 0) { boundsError(offset, this.length - 8); } const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24); return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); }); Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { offset = offset >>> 0; validateNumber(offset, "offset"); const first = this[offset]; const last = this[offset + 7]; if (first === void 0 || last === void 0) { boundsError(offset, this.length - 8); } const val = (first << 24) + // Overflow this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last); }); Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 4, this.length); return ieee754$1.read(this, offset, true, 23, 4); }; Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 4, this.length); return ieee754$1.read(this, offset, false, 23, 4); }; Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 8, this.length); return ieee754$1.read(this, offset, true, 52, 8); }; Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { offset = offset >>> 0; if (!noAssert) checkOffset(offset, 8, this.length); return ieee754$1.read(this, offset, false, 52, 8); }; function checkInt(buf, value, offset, ext, max2, min2) { if (!Buffer2.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); if (value > max2 || value < min2) throw new RangeError('"value" argument is out of bounds'); if (offset + ext > buf.length) throw new RangeError("Index out of range"); } Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength3, noAssert) { value = +value; offset = offset >>> 0; byteLength3 = byteLength3 >>> 0; if (!noAssert) { const maxBytes = Math.pow(2, 8 * byteLength3) - 1; checkInt(this, value, offset, byteLength3, maxBytes, 0); } let mul = 1; let i2 = 0; this[offset] = value & 255; while (++i2 < byteLength3 && (mul *= 256)) { this[offset + i2] = value / mul & 255; } return offset + byteLength3; }; Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength3, noAssert) { value = +value; offset = offset >>> 0; byteLength3 = byteLength3 >>> 0; if (!noAssert) { const maxBytes = Math.pow(2, 8 * byteLength3) - 1; checkInt(this, value, offset, byteLength3, maxBytes, 0); } let i2 = byteLength3 - 1; let mul = 1; this[offset + i2] = value & 255; while (--i2 >= 0 && (mul *= 256)) { this[offset + i2] = value / mul & 255; } return offset + byteLength3; }; Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) checkInt(this, value, offset, 1, 255, 0); this[offset] = value & 255; return offset + 1; }; Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); this[offset] = value & 255; this[offset + 1] = value >>> 8; return offset + 2; }; Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); this[offset] = value >>> 8; this[offset + 1] = value & 255; return offset + 2; }; Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); this[offset + 3] = value >>> 24; this[offset + 2] = value >>> 16; this[offset + 1] = value >>> 8; this[offset] = value & 255; return offset + 4; }; Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); this[offset] = value >>> 24; this[offset + 1] = value >>> 16; this[offset + 2] = value >>> 8; this[offset + 3] = value & 255; return offset + 4; }; function wrtBigUInt64LE(buf, value, offset, min2, max2) { checkIntBI(value, min2, max2, buf, offset, 7); let lo2 = Number(value & BigInt(4294967295)); buf[offset++] = lo2; lo2 = lo2 >> 8; buf[offset++] = lo2; lo2 = lo2 >> 8; buf[offset++] = lo2; lo2 = lo2 >> 8; buf[offset++] = lo2; let hi = Number(value >> BigInt(32) & BigInt(4294967295)); buf[offset++] = hi; hi = hi >> 8; buf[offset++] = hi; hi = hi >> 8; buf[offset++] = hi; hi = hi >> 8; buf[offset++] = hi; return offset; } function wrtBigUInt64BE(buf, value, offset, min2, max2) { checkIntBI(value, min2, max2, buf, offset, 7); let lo2 = Number(value & BigInt(4294967295)); buf[offset + 7] = lo2; lo2 = lo2 >> 8; buf[offset + 6] = lo2; lo2 = lo2 >> 8; buf[offset + 5] = lo2; lo2 = lo2 >> 8; buf[offset + 4] = lo2; let hi = Number(value >> BigInt(32) & BigInt(4294967295)); buf[offset + 3] = hi; hi = hi >> 8; buf[offset + 2] = hi; hi = hi >> 8; buf[offset + 1] = hi; hi = hi >> 8; buf[offset] = hi; return offset + 8; } Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) { return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); }); Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) { return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); }); Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength3, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) { const limit = Math.pow(2, 8 * byteLength3 - 1); checkInt(this, value, offset, byteLength3, limit - 1, -limit); } let i2 = 0; let mul = 1; let sub = 0; this[offset] = value & 255; while (++i2 < byteLength3 && (mul *= 256)) { if (value < 0 && sub === 0 && this[offset + i2 - 1] !== 0) { sub = 1; } this[offset + i2] = (value / mul >> 0) - sub & 255; } return offset + byteLength3; }; Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength3, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) { const limit = Math.pow(2, 8 * byteLength3 - 1); checkInt(this, value, offset, byteLength3, limit - 1, -limit); } let i2 = byteLength3 - 1; let mul = 1; let sub = 0; this[offset + i2] = value & 255; while (--i2 >= 0 && (mul *= 256)) { if (value < 0 && sub === 0 && this[offset + i2 + 1] !== 0) { sub = 1; } this[offset + i2] = (value / mul >> 0) - sub & 255; } return offset + byteLength3; }; Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) checkInt(this, value, offset, 1, 127, -128); if (value < 0) value = 255 + value + 1; this[offset] = value & 255; return offset + 1; }; Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768); this[offset] = value & 255; this[offset + 1] = value >>> 8; return offset + 2; }; Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768); this[offset] = value >>> 8; this[offset + 1] = value & 255; return offset + 2; }; Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648); this[offset] = value & 255; this[offset + 1] = value >>> 8; this[offset + 2] = value >>> 16; this[offset + 3] = value >>> 24; return offset + 4; }; Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648); if (value < 0) value = 4294967295 + value + 1; this[offset] = value >>> 24; this[offset + 1] = value >>> 16; this[offset + 2] = value >>> 8; this[offset + 3] = value & 255; return offset + 4; }; Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) { return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); }); Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) { return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); }); function checkIEEE754(buf, value, offset, ext, max2, min2) { if (offset + ext > buf.length) throw new RangeError("Index out of range"); if (offset < 0) throw new RangeError("Index out of range"); } function writeFloat(buf, value, offset, littleEndian, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) { checkIEEE754(buf, value, offset, 4); } ieee754$1.write(buf, value, offset, littleEndian, 23, 4); return offset + 4; } Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert); }; Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { return writeFloat(this, value, offset, false, noAssert); }; function writeDouble(buf, value, offset, littleEndian, noAssert) { value = +value; offset = offset >>> 0; if (!noAssert) { checkIEEE754(buf, value, offset, 8); } ieee754$1.write(buf, value, offset, littleEndian, 52, 8); return offset + 8; } Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert); }; Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert); }; Buffer2.prototype.copy = function copy(target, targetStart, start, end) { if (!Buffer2.isBuffer(target)) throw new TypeError("argument should be a Buffer"); if (!start) start = 0; if (!end && end !== 0) end = this.length; if (targetStart >= target.length) targetStart = target.length; if (!targetStart) targetStart = 0; if (end > 0 && end < start) end = start; if (end === start) return 0; if (target.length === 0 || this.length === 0) return 0; if (targetStart < 0) { throw new RangeError("targetStart out of bounds"); } if (start < 0 || start >= this.length) throw new RangeError("Index out of range"); if (end < 0) throw new RangeError("sourceEnd out of bounds"); if (end > this.length) end = this.length; if (target.length - targetStart < end - start) { end = target.length - targetStart + start; } const len2 = end - start; if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { this.copyWithin(targetStart, start, end); } else { Uint8Array.prototype.set.call( target, this.subarray(start, end), targetStart ); } return len2; }; Buffer2.prototype.fill = function fill(val, start, end, encoding) { if (typeof val === "string") { if (typeof start === "string") { encoding = start; start = 0; end = this.length; } else if (typeof end === "string") { encoding = end; end = this.length; } if (encoding !== void 0 && typeof encoding !== "string") { throw new TypeError("encoding must be a string"); } if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) { throw new TypeError("Unknown encoding: " + encoding); } if (val.length === 1) { const code2 = val.charCodeAt(0); if (encoding === "utf8" && code2 < 128 || encoding === "latin1") { val = code2; } } } else if (typeof val === "number") { val = val & 255; } else if (typeof val === "boolean") { val = Number(val); } if (start < 0 || this.length < start || this.length < end) { throw new RangeError("Out of range index"); } if (end <= start) { return this; } start = start >>> 0; end = end === void 0 ? this.length : end >>> 0; if (!val) val = 0; let i2; if (typeof val === "number") { for (i2 = start; i2 < end; ++i2) { this[i2] = val; } } else { const bytes2 = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding); const len2 = bytes2.length; if (len2 === 0) { throw new TypeError('The value "' + val + '" is invalid for argument "value"'); } for (i2 = 0; i2 < end - start; ++i2) { this[i2 + start] = bytes2[i2 % len2]; } } return this; }; const errors2 = {}; function E2(sym, getMessage, Base) { errors2[sym] = class NodeError extends Base { constructor() { super(); Object.defineProperty(this, "message", { value: getMessage.apply(this, arguments), writable: true, configurable: true }); this.name = `${this.name} [${sym}]`; this.stack; delete this.name; } get code() { return sym; } set code(value) { Object.defineProperty(this, "code", { configurable: true, enumerable: true, value, writable: true }); } toString() { return `${this.name} [${sym}]: ${this.message}`; } }; } E2( "ERR_BUFFER_OUT_OF_BOUNDS", function(name2) { if (name2) { return `${name2} is outside of buffer bounds`; } return "Attempt to access memory outside buffer bounds"; }, RangeError ); E2( "ERR_INVALID_ARG_TYPE", function(name2, actual) { return `The "${name2}" argument must be of type number. Received type ${typeof actual}`; }, TypeError ); E2( "ERR_OUT_OF_RANGE", function(str, range2, input) { let msg = `The value of "${str}" is out of range.`; let received = input; if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { received = addNumericalSeparator(String(input)); } else if (typeof input === "bigint") { received = String(input); if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { received = addNumericalSeparator(received); } received += "n"; } msg += ` It must be ${range2}. Received ${received}`; return msg; }, RangeError ); function addNumericalSeparator(val) { let res = ""; let i2 = val.length; const start = val[0] === "-" ? 1 : 0; for (; i2 >= start + 4; i2 -= 3) { res = `_${val.slice(i2 - 3, i2)}${res}`; } return `${val.slice(0, i2)}${res}`; } function checkBounds(buf, offset, byteLength3) { validateNumber(offset, "offset"); if (buf[offset] === void 0 || buf[offset + byteLength3] === void 0) { boundsError(offset, buf.length - (byteLength3 + 1)); } } function checkIntBI(value, min2, max2, buf, offset, byteLength3) { if (value > max2 || value < min2) { const n2 = typeof min2 === "bigint" ? "n" : ""; let range2; if (byteLength3 > 3) { if (min2 === 0 || min2 === BigInt(0)) { range2 = `>= 0${n2} and < 2${n2} ** ${(byteLength3 + 1) * 8}${n2}`; } else { range2 = `>= -(2${n2} ** ${(byteLength3 + 1) * 8 - 1}${n2}) and < 2 ** ${(byteLength3 + 1) * 8 - 1}${n2}`; } } else { range2 = `>= ${min2}${n2} and <= ${max2}${n2}`; } throw new errors2.ERR_OUT_OF_RANGE("value", range2, value); } checkBounds(buf, offset, byteLength3); } function validateNumber(value, name2) { if (typeof value !== "number") { throw new errors2.ERR_INVALID_ARG_TYPE(name2, "number", value); } } function boundsError(value, length, type2) { if (Math.floor(value) !== value) { validateNumber(value, type2); throw new errors2.ERR_OUT_OF_RANGE(type2 || "offset", "an integer", value); } if (length < 0) { throw new errors2.ERR_BUFFER_OUT_OF_BOUNDS(); } throw new errors2.ERR_OUT_OF_RANGE( type2 || "offset", `>= ${type2 ? 1 : 0} and <= ${length}`, value ); } const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; function base64clean(str) { str = str.split("=")[0]; str = str.trim().replace(INVALID_BASE64_RE, ""); if (str.length < 2) return ""; while (str.length % 4 !== 0) { str = str + "="; } return str; } function utf8ToBytes2(string2, units) { units = units || Infinity; let codePoint; const length = string2.length; let leadSurrogate = null; const bytes2 = []; for (let i2 = 0; i2 < length; ++i2) { codePoint = string2.charCodeAt(i2); if (codePoint > 55295 && codePoint < 57344) { if (!leadSurrogate) { if (codePoint > 56319) { if ((units -= 3) > -1) bytes2.push(239, 191, 189); continue; } else if (i2 + 1 === length) { if ((units -= 3) > -1) bytes2.push(239, 191, 189); continue; } leadSurrogate = codePoint; continue; } if (codePoint < 56320) { if ((units -= 3) > -1) bytes2.push(239, 191, 189); leadSurrogate = codePoint; continue; } codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; } else if (leadSurrogate) { if ((units -= 3) > -1) bytes2.push(239, 191, 189); } leadSurrogate = null; if (codePoint < 128) { if ((units -= 1) < 0) break; bytes2.push(codePoint); } else if (codePoint < 2048) { if ((units -= 2) < 0) break; bytes2.push( codePoint >> 6 | 192, codePoint & 63 | 128 ); } else if (codePoint < 65536) { if ((units -= 3) < 0) break; bytes2.push( codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128 ); } else if (codePoint < 1114112) { if ((units -= 4) < 0) break; bytes2.push( codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128 ); } else { throw new Error("Invalid code point"); } } return bytes2; } function asciiToBytes(str) { const byteArray = []; for (let i2 = 0; i2 < str.length; ++i2) { byteArray.push(str.charCodeAt(i2) & 255); } return byteArray; } function utf16leToBytes(str, units) { let c2, hi, lo2; const byteArray = []; for (let i2 = 0; i2 < str.length; ++i2) { if ((units -= 2) < 0) break; c2 = str.charCodeAt(i2); hi = c2 >> 8; lo2 = c2 % 256; byteArray.push(lo2); byteArray.push(hi); } return byteArray; } function base64ToBytes(str) { return base642.toByteArray(base64clean(str)); } function blitBuffer(src2, dst, offset, length) { let i2; for (i2 = 0; i2 < length; ++i2) { if (i2 + offset >= dst.length || i2 >= src2.length) break; dst[i2 + offset] = src2[i2]; } return i2; } function isInstance(obj, type2) { return obj instanceof type2 || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type2.name; } function numberIsNaN(obj) { return obj !== obj; } const hexSliceLookupTable = function() { const alphabet2 = "0123456789abcdef"; const table = new Array(256); for (let i2 = 0; i2 < 16; ++i2) { const i16 = i2 * 16; for (let j2 = 0; j2 < 16; ++j2) { table[i16 + j2] = alphabet2[i2] + alphabet2[j2]; } } return table; }(); function defineBigIntMethod(fn2) { return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn2; } function BufferBigIntNotDefined() { throw new Error("BigInt not supported"); } })(buffer); if (typeof window !== "undefined") { if (!window.Buffer) { window.Buffer = buffer.Buffer; } if (!window.global) { window.global = window; } if (!window.process) { window.process = {}; } if (!((_c = window.process) == null ? void 0 : _c.env)) { window.process = { env: {} }; } } var _client, _provider$1; var CoinbaseWalletConnector = class extends Connector { constructor({ chains: chains2, options }) { super({ chains: chains2, options: { reloadOnDisconnect: false, ...options } }); this.id = "coinbaseWallet"; this.name = "Coinbase Wallet"; this.ready = true; __privateAdd$1(this, _client, void 0); __privateAdd$1(this, _provider$1, void 0); this.onAccountsChanged = (accounts) => { if (accounts.length === 0) this.emit("disconnect"); else this.emit("change", { account: getAddress(accounts[0]) }); }; this.onChainChanged = (chainId) => { const id2 = normalizeChainId(chainId); const unsupported = this.isChainUnsupported(id2); this.emit("change", { chain: { id: id2, unsupported } }); }; this.onDisconnect = () => { this.emit("disconnect"); }; } async connect({ chainId } = {}) { try { const provider = await this.getProvider(); provider.on("accountsChanged", this.onAccountsChanged); provider.on("chainChanged", this.onChainChanged); provider.on("disconnect", this.onDisconnect); this.emit("message", { type: "connecting" }); const accounts = await provider.enable(); const account = getAddress(accounts[0]); let id2 = await this.getChainId(); let unsupported = this.isChainUnsupported(id2); if (chainId && id2 !== chainId) { const chain = await this.switchChain(chainId); id2 = chain.id; unsupported = this.isChainUnsupported(id2); } return { account, chain: { id: id2, unsupported } }; } catch (error2) { if (/(user closed modal|accounts received is empty)/i.test( error2.message )) throw new UserRejectedRequestError(error2); throw error2; } } async disconnect() { if (!__privateGet$1(this, _provider$1)) return; const provider = await this.getProvider(); provider.removeListener("accountsChanged", this.onAccountsChanged); provider.removeListener("chainChanged", this.onChainChanged); provider.removeListener("disconnect", this.onDisconnect); provider.disconnect(); provider.close(); } async getAccount() { const provider = await this.getProvider(); const accounts = await provider.request({ method: "eth_accounts" }); return getAddress(accounts[0]); } async getChainId() { const provider = await this.getProvider(); const chainId = normalizeChainId(provider.chainId); return chainId; } async getProvider() { var _a2; if (!__privateGet$1(this, _provider$1)) { let CoinbaseWalletSDK2 = (await Promise.resolve().then(() => index$3)).default; if (typeof CoinbaseWalletSDK2 !== "function" && typeof CoinbaseWalletSDK2.default === "function") CoinbaseWalletSDK2 = CoinbaseWalletSDK2.default; __privateSet$1(this, _client, new CoinbaseWalletSDK2(this.options)); const walletExtensionChainId = (_a2 = __privateGet$1(this, _client).walletExtension) == null ? void 0 : _a2.getChainId(); const chain = this.chains.find( (chain2) => this.options.chainId ? chain2.id === this.options.chainId : chain2.id === walletExtensionChainId ) || this.chains[0]; const chainId = this.options.chainId || (chain == null ? void 0 : chain.id); const jsonRpcUrl = this.options.jsonRpcUrl || (chain == null ? void 0 : chain.rpcUrls.default.http[0]); __privateSet$1(this, _provider$1, __privateGet$1(this, _client).makeWeb3Provider(jsonRpcUrl, chainId)); } return __privateGet$1(this, _provider$1); } async getWalletClient({ chainId } = {}) { const [provider, account] = await Promise.all([ this.getProvider(), this.getAccount() ]); const chain = this.chains.find((x2) => x2.id === chainId); if (!provider) throw new Error("provider is required."); return createWalletClient({ account, chain, transport: custom$1(provider) }); } async isAuthorized() { try { const account = await this.getAccount(); return !!account; } catch { return false; } } async switchChain(chainId) { var _a2; const provider = await this.getProvider(); const id2 = numberToHex$1(chainId); try { await provider.request({ method: "wallet_switchEthereumChain", params: [{ chainId: id2 }] }); return this.chains.find((x2) => x2.id === chainId) ?? { id: chainId, name: `Chain ${id2}`, network: `${id2}`, nativeCurrency: { name: "Ether", decimals: 18, symbol: "ETH" }, rpcUrls: { default: { http: [""] }, public: { http: [""] } } }; } catch (error2) { const chain = this.chains.find((x2) => x2.id === chainId); if (!chain) throw new ChainNotConfiguredForConnectorError({ chainId, connectorId: this.id }); if (error2.code === 4902) { try { await provider.request({ method: "wallet_addEthereumChain", params: [ { chainId: id2, chainName: chain.name, nativeCurrency: chain.nativeCurrency, rpcUrls: [((_a2 = chain.rpcUrls.public) == null ? void 0 : _a2.http[0]) ?? ""], blockExplorerUrls: this.getBlockExplorerUrls(chain) } ] }); return chain; } catch (error22) { throw new UserRejectedRequestError(error22); } } throw new SwitchChainError(error2); } } async watchAsset({ address, decimals = 18, image, symbol }) { const provider = await this.getProvider(); return provider.request({ method: "wallet_watchAsset", params: { type: "ERC20", options: { address, decimals, image, symbol } } }); } }; _client = /* @__PURE__ */ new WeakMap(); _provider$1 = /* @__PURE__ */ new WeakMap(); var chacha20poly1305 = {}; var chacha = {}; var binary = {}; var int = {}; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); function imulShim(a2, b2) { var ah = a2 >>> 16 & 65535, al = a2 & 65535; var bh = b2 >>> 16 & 65535, bl = b2 & 65535; return al * bl + (ah * bl + al * bh << 16 >>> 0) | 0; } exports3.mul = Math.imul || imulShim; function add(a2, b2) { return a2 + b2 | 0; } exports3.add = add; function sub(a2, b2) { return a2 - b2 | 0; } exports3.sub = sub; function rotl(x2, n2) { return x2 << n2 | x2 >>> 32 - n2; } exports3.rotl = rotl; function rotr(x2, n2) { return x2 << 32 - n2 | x2 >>> n2; } exports3.rotr = rotr; function isIntegerShim(n2) { return typeof n2 === "number" && isFinite(n2) && Math.floor(n2) === n2; } exports3.isInteger = Number.isInteger || isIntegerShim; exports3.MAX_SAFE_INTEGER = 9007199254740991; exports3.isSafeInteger = function(n2) { return exports3.isInteger(n2) && (n2 >= -exports3.MAX_SAFE_INTEGER && n2 <= exports3.MAX_SAFE_INTEGER); }; })(int); Object.defineProperty(binary, "__esModule", { value: true }); var int_1 = int; function readInt16BE(array2, offset) { if (offset === void 0) { offset = 0; } return (array2[offset + 0] << 8 | array2[offset + 1]) << 16 >> 16; } binary.readInt16BE = readInt16BE; function readUint16BE(array2, offset) { if (offset === void 0) { offset = 0; } return (array2[offset + 0] << 8 | array2[offset + 1]) >>> 0; } binary.readUint16BE = readUint16BE; function readInt16LE(array2, offset) { if (offset === void 0) { offset = 0; } return (array2[offset + 1] << 8 | array2[offset]) << 16 >> 16; } binary.readInt16LE = readInt16LE; function readUint16LE(array2, offset) { if (offset === void 0) { offset = 0; } return (array2[offset + 1] << 8 | array2[offset]) >>> 0; } binary.readUint16LE = readUint16LE; function writeUint16BE(value, out, offset) { if (out === void 0) { out = new Uint8Array(2); } if (offset === void 0) { offset = 0; } out[offset + 0] = value >>> 8; out[offset + 1] = value >>> 0; return out; } binary.writeUint16BE = writeUint16BE; binary.writeInt16BE = writeUint16BE; function writeUint16LE(value, out, offset) { if (out === void 0) { out = new Uint8Array(2); } if (offset === void 0) { offset = 0; } out[offset + 0] = value >>> 0; out[offset + 1] = value >>> 8; return out; } binary.writeUint16LE = writeUint16LE; binary.writeInt16LE = writeUint16LE; function readInt32BE(array2, offset) { if (offset === void 0) { offset = 0; } return array2[offset] << 24 | array2[offset + 1] << 16 | array2[offset + 2] << 8 | array2[offset + 3]; } binary.readInt32BE = readInt32BE; function readUint32BE(array2, offset) { if (offset === void 0) { offset = 0; } return (array2[offset] << 24 | array2[offset + 1] << 16 | array2[offset + 2] << 8 | array2[offset + 3]) >>> 0; } binary.readUint32BE = readUint32BE; function readInt32LE(array2, offset) { if (offset === void 0) { offset = 0; } return array2[offset + 3] << 24 | array2[offset + 2] << 16 | array2[offset + 1] << 8 | array2[offset]; } binary.readInt32LE = readInt32LE; function readUint32LE(array2, offset) { if (offset === void 0) { offset = 0; } return (array2[offset + 3] << 24 | array2[offset + 2] << 16 | array2[offset + 1] << 8 | array2[offset]) >>> 0; } binary.readUint32LE = readUint32LE; function writeUint32BE(value, out, offset) { if (out === void 0) { out = new Uint8Array(4); } if (offset === void 0) { offset = 0; } out[offset + 0] = value >>> 24; out[offset + 1] = value >>> 16; out[offset + 2] = value >>> 8; out[offset + 3] = value >>> 0; return out; } binary.writeUint32BE = writeUint32BE; binary.writeInt32BE = writeUint32BE; function writeUint32LE(value, out, offset) { if (out === void 0) { out = new Uint8Array(4); } if (offset === void 0) { offset = 0; } out[offset + 0] = value >>> 0; out[offset + 1] = value >>> 8; out[offset + 2] = value >>> 16; out[offset + 3] = value >>> 24; return out; } binary.writeUint32LE = writeUint32LE; binary.writeInt32LE = writeUint32LE; function readInt64BE(array2, offset) { if (offset === void 0) { offset = 0; } var hi = readInt32BE(array2, offset); var lo2 = readInt32BE(array2, offset + 4); return hi * 4294967296 + lo2 - (lo2 >> 31) * 4294967296; } binary.readInt64BE = readInt64BE; function readUint64BE(array2, offset) { if (offset === void 0) { offset = 0; } var hi = readUint32BE(array2, offset); var lo2 = readUint32BE(array2, offset + 4); return hi * 4294967296 + lo2; } binary.readUint64BE = readUint64BE; function readInt64LE(array2, offset) { if (offset === void 0) { offset = 0; } var lo2 = readInt32LE(array2, offset); var hi = readInt32LE(array2, offset + 4); return hi * 4294967296 + lo2 - (lo2 >> 31) * 4294967296; } binary.readInt64LE = readInt64LE; function readUint64LE(array2, offset) { if (offset === void 0) { offset = 0; } var lo2 = readUint32LE(array2, offset); var hi = readUint32LE(array2, offset + 4); return hi * 4294967296 + lo2; } binary.readUint64LE = readUint64LE; function writeUint64BE(value, out, offset) { if (out === void 0) { out = new Uint8Array(8); } if (offset === void 0) { offset = 0; } writeUint32BE(value / 4294967296 >>> 0, out, offset); writeUint32BE(value >>> 0, out, offset + 4); return out; } binary.writeUint64BE = writeUint64BE; binary.writeInt64BE = writeUint64BE; function writeUint64LE(value, out, offset) { if (out === void 0) { out = new Uint8Array(8); } if (offset === void 0) { offset = 0; } writeUint32LE(value >>> 0, out, offset); writeUint32LE(value / 4294967296 >>> 0, out, offset + 4); return out; } binary.writeUint64LE = writeUint64LE; binary.writeInt64LE = writeUint64LE; function readUintBE(bitLength, array2, offset) { if (offset === void 0) { offset = 0; } if (bitLength % 8 !== 0) { throw new Error("readUintBE supports only bitLengths divisible by 8"); } if (bitLength / 8 > array2.length - offset) { throw new Error("readUintBE: array is too short for the given bitLength"); } var result = 0; var mul = 1; for (var i2 = bitLength / 8 + offset - 1; i2 >= offset; i2--) { result += array2[i2] * mul; mul *= 256; } return result; } binary.readUintBE = readUintBE; function readUintLE(bitLength, array2, offset) { if (offset === void 0) { offset = 0; } if (bitLength % 8 !== 0) { throw new Error("readUintLE supports only bitLengths divisible by 8"); } if (bitLength / 8 > array2.length - offset) { throw new Error("readUintLE: array is too short for the given bitLength"); } var result = 0; var mul = 1; for (var i2 = offset; i2 < offset + bitLength / 8; i2++) { result += array2[i2] * mul; mul *= 256; } return result; } binary.readUintLE = readUintLE; function writeUintBE(bitLength, value, out, offset) { if (out === void 0) { out = new Uint8Array(bitLength / 8); } if (offset === void 0) { offset = 0; } if (bitLength % 8 !== 0) { throw new Error("writeUintBE supports only bitLengths divisible by 8"); } if (!int_1.isSafeInteger(value)) { throw new Error("writeUintBE value must be an integer"); } var div = 1; for (var i2 = bitLength / 8 + offset - 1; i2 >= offset; i2--) { out[i2] = value / div & 255; div *= 256; } return out; } binary.writeUintBE = writeUintBE; function writeUintLE(bitLength, value, out, offset) { if (out === void 0) { out = new Uint8Array(bitLength / 8); } if (offset === void 0) { offset = 0; } if (bitLength % 8 !== 0) { throw new Error("writeUintLE supports only bitLengths divisible by 8"); } if (!int_1.isSafeInteger(value)) { throw new Error("writeUintLE value must be an integer"); } var div = 1; for (var i2 = offset; i2 < offset + bitLength / 8; i2++) { out[i2] = value / div & 255; div *= 256; } return out; } binary.writeUintLE = writeUintLE; function readFloat32BE(array2, offset) { if (offset === void 0) { offset = 0; } var view = new DataView(array2.buffer, array2.byteOffset, array2.byteLength); return view.getFloat32(offset); } binary.readFloat32BE = readFloat32BE; function readFloat32LE(array2, offset) { if (offset === void 0) { offset = 0; } var view = new DataView(array2.buffer, array2.byteOffset, array2.byteLength); return view.getFloat32(offset, true); } binary.readFloat32LE = readFloat32LE; function readFloat64BE(array2, offset) { if (offset === void 0) { offset = 0; } var view = new DataView(array2.buffer, array2.byteOffset, array2.byteLength); return view.getFloat64(offset); } binary.readFloat64BE = readFloat64BE; function readFloat64LE(array2, offset) { if (offset === void 0) { offset = 0; } var view = new DataView(array2.buffer, array2.byteOffset, array2.byteLength); return view.getFloat64(offset, true); } binary.readFloat64LE = readFloat64LE; function writeFloat32BE(value, out, offset) { if (out === void 0) { out = new Uint8Array(4); } if (offset === void 0) { offset = 0; } var view = new DataView(out.buffer, out.byteOffset, out.byteLength); view.setFloat32(offset, value); return out; } binary.writeFloat32BE = writeFloat32BE; function writeFloat32LE(value, out, offset) { if (out === void 0) { out = new Uint8Array(4); } if (offset === void 0) { offset = 0; } var view = new DataView(out.buffer, out.byteOffset, out.byteLength); view.setFloat32(offset, value, true); return out; } binary.writeFloat32LE = writeFloat32LE; function writeFloat64BE(value, out, offset) { if (out === void 0) { out = new Uint8Array(8); } if (offset === void 0) { offset = 0; } var view = new DataView(out.buffer, out.byteOffset, out.byteLength); view.setFloat64(offset, value); return out; } binary.writeFloat64BE = writeFloat64BE; function writeFloat64LE(value, out, offset) { if (out === void 0) { out = new Uint8Array(8); } if (offset === void 0) { offset = 0; } var view = new DataView(out.buffer, out.byteOffset, out.byteLength); view.setFloat64(offset, value, true); return out; } binary.writeFloat64LE = writeFloat64LE; var wipe$1 = {}; Object.defineProperty(wipe$1, "__esModule", { value: true }); function wipe(array2) { for (var i2 = 0; i2 < array2.length; i2++) { array2[i2] = 0; } return array2; } wipe$1.wipe = wipe; Object.defineProperty(chacha, "__esModule", { value: true }); var binary_1 = binary; var wipe_1$3 = wipe$1; var ROUNDS = 20; function core(out, input, key) { var j0 = 1634760805; var j1 = 857760878; var j2 = 2036477234; var j3 = 1797285236; var j4 = key[3] << 24 | key[2] << 16 | key[1] << 8 | key[0]; var j5 = key[7] << 24 | key[6] << 16 | key[5] << 8 | key[4]; var j6 = key[11] << 24 | key[10] << 16 | key[9] << 8 | key[8]; var j7 = key[15] << 24 | key[14] << 16 | key[13] << 8 | key[12]; var j8 = key[19] << 24 | key[18] << 16 | key[17] << 8 | key[16]; var j9 = key[23] << 24 | key[22] << 16 | key[21] << 8 | key[20]; var j10 = key[27] << 24 | key[26] << 16 | key[25] << 8 | key[24]; var j11 = key[31] << 24 | key[30] << 16 | key[29] << 8 | key[28]; var j12 = input[3] << 24 | input[2] << 16 | input[1] << 8 | input[0]; var j13 = input[7] << 24 | input[6] << 16 | input[5] << 8 | input[4]; var j14 = input[11] << 24 | input[10] << 16 | input[9] << 8 | input[8]; var j15 = input[15] << 24 | input[14] << 16 | input[13] << 8 | input[12]; var x0 = j0; var x1 = j1; var x2 = j2; var x3 = j3; var x4 = j4; var x5 = j5; var x6 = j6; var x7 = j7; var x8 = j8; var x9 = j9; var x10 = j10; var x11 = j11; var x12 = j12; var x13 = j13; var x14 = j14; var x15 = j15; for (var i2 = 0; i2 < ROUNDS; i2 += 2) { x0 = x0 + x4 | 0; x12 ^= x0; x12 = x12 >>> 32 - 16 | x12 << 16; x8 = x8 + x12 | 0; x4 ^= x8; x4 = x4 >>> 32 - 12 | x4 << 12; x1 = x1 + x5 | 0; x13 ^= x1; x13 = x13 >>> 32 - 16 | x13 << 16; x9 = x9 + x13 | 0; x5 ^= x9; x5 = x5 >>> 32 - 12 | x5 << 12; x2 = x2 + x6 | 0; x14 ^= x2; x14 = x14 >>> 32 - 16 | x14 << 16; x10 = x10 + x14 | 0; x6 ^= x10; x6 = x6 >>> 32 - 12 | x6 << 12; x3 = x3 + x7 | 0; x15 ^= x3; x15 = x15 >>> 32 - 16 | x15 << 16; x11 = x11 + x15 | 0; x7 ^= x11; x7 = x7 >>> 32 - 12 | x7 << 12; x2 = x2 + x6 | 0; x14 ^= x2; x14 = x14 >>> 32 - 8 | x14 << 8; x10 = x10 + x14 | 0; x6 ^= x10; x6 = x6 >>> 32 - 7 | x6 << 7; x3 = x3 + x7 | 0; x15 ^= x3; x15 = x15 >>> 32 - 8 | x15 << 8; x11 = x11 + x15 | 0; x7 ^= x11; x7 = x7 >>> 32 - 7 | x7 << 7; x1 = x1 + x5 | 0; x13 ^= x1; x13 = x13 >>> 32 - 8 | x13 << 8; x9 = x9 + x13 | 0; x5 ^= x9; x5 = x5 >>> 32 - 7 | x5 << 7; x0 = x0 + x4 | 0; x12 ^= x0; x12 = x12 >>> 32 - 8 | x12 << 8; x8 = x8 + x12 | 0; x4 ^= x8; x4 = x4 >>> 32 - 7 | x4 << 7; x0 = x0 + x5 | 0; x15 ^= x0; x15 = x15 >>> 32 - 16 | x15 << 16; x10 = x10 + x15 | 0; x5 ^= x10; x5 = x5 >>> 32 - 12 | x5 << 12; x1 = x1 + x6 | 0; x12 ^= x1; x12 = x12 >>> 32 - 16 | x12 << 16; x11 = x11 + x12 | 0; x6 ^= x11; x6 = x6 >>> 32 - 12 | x6 << 12; x2 = x2 + x7 | 0; x13 ^= x2; x13 = x13 >>> 32 - 16 | x13 << 16; x8 = x8 + x13 | 0; x7 ^= x8; x7 = x7 >>> 32 - 12 | x7 << 12; x3 = x3 + x4 | 0; x14 ^= x3; x14 = x14 >>> 32 - 16 | x14 << 16; x9 = x9 + x14 | 0; x4 ^= x9; x4 = x4 >>> 32 - 12 | x4 << 12; x2 = x2 + x7 | 0; x13 ^= x2; x13 = x13 >>> 32 - 8 | x13 << 8; x8 = x8 + x13 | 0; x7 ^= x8; x7 = x7 >>> 32 - 7 | x7 << 7; x3 = x3 + x4 | 0; x14 ^= x3; x14 = x14 >>> 32 - 8 | x14 << 8; x9 = x9 + x14 | 0; x4 ^= x9; x4 = x4 >>> 32 - 7 | x4 << 7; x1 = x1 + x6 | 0; x12 ^= x1; x12 = x12 >>> 32 - 8 | x12 << 8; x11 = x11 + x12 | 0; x6 ^= x11; x6 = x6 >>> 32 - 7 | x6 << 7; x0 = x0 + x5 | 0; x15 ^= x0; x15 = x15 >>> 32 - 8 | x15 << 8; x10 = x10 + x15 | 0; x5 ^= x10; x5 = x5 >>> 32 - 7 | x5 << 7; } binary_1.writeUint32LE(x0 + j0 | 0, out, 0); binary_1.writeUint32LE(x1 + j1 | 0, out, 4); binary_1.writeUint32LE(x2 + j2 | 0, out, 8); binary_1.writeUint32LE(x3 + j3 | 0, out, 12); binary_1.writeUint32LE(x4 + j4 | 0, out, 16); binary_1.writeUint32LE(x5 + j5 | 0, out, 20); binary_1.writeUint32LE(x6 + j6 | 0, out, 24); binary_1.writeUint32LE(x7 + j7 | 0, out, 28); binary_1.writeUint32LE(x8 + j8 | 0, out, 32); binary_1.writeUint32LE(x9 + j9 | 0, out, 36); binary_1.writeUint32LE(x10 + j10 | 0, out, 40); binary_1.writeUint32LE(x11 + j11 | 0, out, 44); binary_1.writeUint32LE(x12 + j12 | 0, out, 48); binary_1.writeUint32LE(x13 + j13 | 0, out, 52); binary_1.writeUint32LE(x14 + j14 | 0, out, 56); binary_1.writeUint32LE(x15 + j15 | 0, out, 60); } function streamXOR(key, nonce, src2, dst, nonceInplaceCounterLength) { if (nonceInplaceCounterLength === void 0) { nonceInplaceCounterLength = 0; } if (key.length !== 32) { throw new Error("ChaCha: key size must be 32 bytes"); } if (dst.length < src2.length) { throw new Error("ChaCha: destination is shorter than source"); } var nc; var counterLength; if (nonceInplaceCounterLength === 0) { if (nonce.length !== 8 && nonce.length !== 12) { throw new Error("ChaCha nonce must be 8 or 12 bytes"); } nc = new Uint8Array(16); counterLength = nc.length - nonce.length; nc.set(nonce, counterLength); } else { if (nonce.length !== 16) { throw new Error("ChaCha nonce with counter must be 16 bytes"); } nc = nonce; counterLength = nonceInplaceCounterLength; } var block = new Uint8Array(64); for (var i2 = 0; i2 < src2.length; i2 += 64) { core(block, nc, key); for (var j2 = i2; j2 < i2 + 64 && j2 < src2.length; j2++) { dst[j2] = src2[j2] ^ block[j2 - i2]; } incrementCounter(nc, 0, counterLength); } wipe_1$3.wipe(block); if (nonceInplaceCounterLength === 0) { wipe_1$3.wipe(nc); } return dst; } chacha.streamXOR = streamXOR; function stream(key, nonce, dst, nonceInplaceCounterLength) { if (nonceInplaceCounterLength === void 0) { nonceInplaceCounterLength = 0; } wipe_1$3.wipe(dst); return streamXOR(key, nonce, dst, dst, nonceInplaceCounterLength); } chacha.stream = stream; function incrementCounter(counter, pos, len2) { var carry = 1; while (len2--) { carry = carry + (counter[pos] & 255) | 0; counter[pos] = carry & 255; carry >>>= 8; pos++; } if (carry > 0) { throw new Error("ChaCha: counter overflow"); } } var poly1305 = {}; var constantTime = {}; Object.defineProperty(constantTime, "__esModule", { value: true }); function select(subject, resultIfOne, resultIfZero) { return ~(subject - 1) & resultIfOne | subject - 1 & resultIfZero; } constantTime.select = select; function lessOrEqual(a2, b2) { return (a2 | 0) - (b2 | 0) - 1 >>> 31 & 1; } constantTime.lessOrEqual = lessOrEqual; function compare$c(a2, b2) { if (a2.length !== b2.length) { return 0; } var result = 0; for (var i2 = 0; i2 < a2.length; i2++) { result |= a2[i2] ^ b2[i2]; } return 1 & result - 1 >>> 8; } constantTime.compare = compare$c; function equal(a2, b2) { if (a2.length === 0 || b2.length === 0) { return false; } return compare$c(a2, b2) !== 0; } constantTime.equal = equal; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); var constant_time_12 = constantTime; var wipe_12 = wipe$1; exports3.DIGEST_LENGTH = 16; var Poly1305 = ( /** @class */ function() { function Poly13052(key) { this.digestLength = exports3.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 = false; var t0 = key[0] | key[1] << 8; this._r[0] = t0 & 8191; var t1 = key[2] | key[3] << 8; this._r[1] = (t0 >>> 13 | t1 << 3) & 8191; var t2 = key[4] | key[5] << 8; this._r[2] = (t1 >>> 10 | t2 << 6) & 7939; var t3 = key[6] | key[7] << 8; this._r[3] = (t2 >>> 7 | t3 << 9) & 8191; var t4 = key[8] | key[9] << 8; this._r[4] = (t3 >>> 4 | t4 << 12) & 255; this._r[5] = t4 >>> 1 & 8190; var t5 = key[10] | key[11] << 8; this._r[6] = (t4 >>> 14 | t5 << 2) & 8191; var t6 = key[12] | key[13] << 8; this._r[7] = (t5 >>> 11 | t6 << 5) & 8065; var t7 = key[14] | key[15] << 8; this._r[8] = (t6 >>> 8 | t7 << 8) & 8191; this._r[9] = t7 >>> 5 & 127; this._pad[0] = key[16] | key[17] << 8; this._pad[1] = key[18] | key[19] << 8; this._pad[2] = key[20] | key[21] << 8; this._pad[3] = key[22] | key[23] << 8; this._pad[4] = key[24] | key[25] << 8; this._pad[5] = key[26] | key[27] << 8; this._pad[6] = key[28] | key[29] << 8; this._pad[7] = key[30] | key[31] << 8; } Poly13052.prototype._blocks = function(m2, mpos, bytes2) { var hibit = this._fin ? 0 : 1 << 11; var h0 = this._h[0], h1 = this._h[1], h2 = this._h[2], h3 = this._h[3], h4 = this._h[4], h5 = this._h[5], h6 = this._h[6], h7 = this._h[7], h8 = this._h[8], h9 = this._h[9]; var r0 = this._r[0], r1 = this._r[1], r2 = this._r[2], r3 = this._r[3], r4 = this._r[4], r5 = this._r[5], r6 = this._r[6], r7 = this._r[7], r8 = this._r[8], r9 = this._r[9]; while (bytes2 >= 16) { var t0 = m2[mpos + 0] | m2[mpos + 1] << 8; h0 += t0 & 8191; var t1 = m2[mpos + 2] | m2[mpos + 3] << 8; h1 += (t0 >>> 13 | t1 << 3) & 8191; var t2 = m2[mpos + 4] | m2[mpos + 5] << 8; h2 += (t1 >>> 10 | t2 << 6) & 8191; var t3 = m2[mpos + 6] | m2[mpos + 7] << 8; h3 += (t2 >>> 7 | t3 << 9) & 8191; var t4 = m2[mpos + 8] | m2[mpos + 9] << 8; h4 += (t3 >>> 4 | t4 << 12) & 8191; h5 += t4 >>> 1 & 8191; var t5 = m2[mpos + 10] | m2[mpos + 11] << 8; h6 += (t4 >>> 14 | t5 << 2) & 8191; var t6 = m2[mpos + 12] | m2[mpos + 13] << 8; h7 += (t5 >>> 11 | t6 << 5) & 8191; var t7 = m2[mpos + 14] | m2[mpos + 15] << 8; h8 += (t6 >>> 8 | t7 << 8) & 8191; h9 += t7 >>> 5 | hibit; var c2 = 0; var d0 = c2; d0 += h0 * r0; d0 += h1 * (5 * r9); d0 += h2 * (5 * r8); d0 += h3 * (5 * r7); d0 += h4 * (5 * r6); c2 = d0 >>> 13; d0 &= 8191; d0 += h5 * (5 * r5); d0 += h6 * (5 * r4); d0 += h7 * (5 * r3); d0 += h8 * (5 * r2); d0 += h9 * (5 * r1); c2 += d0 >>> 13; d0 &= 8191; var d1 = c2; d1 += h0 * r1; d1 += h1 * r0; d1 += h2 * (5 * r9); d1 += h3 * (5 * r8); d1 += h4 * (5 * r7); c2 = d1 >>> 13; d1 &= 8191; d1 += h5 * (5 * r6); d1 += h6 * (5 * r5); d1 += h7 * (5 * r4); d1 += h8 * (5 * r3); d1 += h9 * (5 * r2); c2 += d1 >>> 13; d1 &= 8191; var d2 = c2; d2 += h0 * r2; d2 += h1 * r1; d2 += h2 * r0; d2 += h3 * (5 * r9); d2 += h4 * (5 * r8); c2 = d2 >>> 13; d2 &= 8191; d2 += h5 * (5 * r7); d2 += h6 * (5 * r6); d2 += h7 * (5 * r5); d2 += h8 * (5 * r4); d2 += h9 * (5 * r3); c2 += d2 >>> 13; d2 &= 8191; var d3 = c2; d3 += h0 * r3; d3 += h1 * r2; d3 += h2 * r1; d3 += h3 * r0; d3 += h4 * (5 * r9); c2 = d3 >>> 13; d3 &= 8191; d3 += h5 * (5 * r8); d3 += h6 * (5 * r7); d3 += h7 * (5 * r6); d3 += h8 * (5 * r5); d3 += h9 * (5 * r4); c2 += d3 >>> 13; d3 &= 8191; var d4 = c2; d4 += h0 * r4; d4 += h1 * r3; d4 += h2 * r2; d4 += h3 * r1; d4 += h4 * r0; c2 = d4 >>> 13; d4 &= 8191; d4 += h5 * (5 * r9); d4 += h6 * (5 * r8); d4 += h7 * (5 * r7); d4 += h8 * (5 * r6); d4 += h9 * (5 * r5); c2 += d4 >>> 13; d4 &= 8191; var d5 = c2; d5 += h0 * r5; d5 += h1 * r4; d5 += h2 * r3; d5 += h3 * r2; d5 += h4 * r1; c2 = d5 >>> 13; d5 &= 8191; d5 += h5 * r0; d5 += h6 * (5 * r9); d5 += h7 * (5 * r8); d5 += h8 * (5 * r7); d5 += h9 * (5 * r6); c2 += d5 >>> 13; d5 &= 8191; var d6 = c2; d6 += h0 * r6; d6 += h1 * r5; d6 += h2 * r4; d6 += h3 * r3; d6 += h4 * r2; c2 = d6 >>> 13; d6 &= 8191; d6 += h5 * r1; d6 += h6 * r0; d6 += h7 * (5 * r9); d6 += h8 * (5 * r8); d6 += h9 * (5 * r7); c2 += d6 >>> 13; d6 &= 8191; var d7 = c2; d7 += h0 * r7; d7 += h1 * r6; d7 += h2 * r5; d7 += h3 * r4; d7 += h4 * r3; c2 = d7 >>> 13; d7 &= 8191; d7 += h5 * r2; d7 += h6 * r1; d7 += h7 * r0; d7 += h8 * (5 * r9); d7 += h9 * (5 * r8); c2 += d7 >>> 13; d7 &= 8191; var d8 = c2; d8 += h0 * r8; d8 += h1 * r7; d8 += h2 * r6; d8 += h3 * r5; d8 += h4 * r4; c2 = d8 >>> 13; d8 &= 8191; d8 += h5 * r3; d8 += h6 * r2; d8 += h7 * r1; d8 += h8 * r0; d8 += h9 * (5 * r9); c2 += d8 >>> 13; d8 &= 8191; var d9 = c2; d9 += h0 * r9; d9 += h1 * r8; d9 += h2 * r7; d9 += h3 * r6; d9 += h4 * r5; c2 = d9 >>> 13; d9 &= 8191; d9 += h5 * r4; d9 += h6 * r3; d9 += h7 * r2; d9 += h8 * r1; d9 += h9 * r0; c2 += d9 >>> 13; d9 &= 8191; c2 = (c2 << 2) + c2 | 0; c2 = c2 + d0 | 0; d0 = c2 & 8191; c2 = c2 >>> 13; d1 += c2; h0 = d0; h1 = d1; h2 = d2; h3 = d3; h4 = d4; h5 = d5; h6 = d6; h7 = d7; h8 = d8; h9 = d9; mpos += 16; bytes2 -= 16; } this._h[0] = h0; this._h[1] = h1; this._h[2] = h2; this._h[3] = h3; this._h[4] = h4; this._h[5] = h5; this._h[6] = h6; this._h[7] = h7; this._h[8] = h8; this._h[9] = h9; }; Poly13052.prototype.finish = function(mac, macpos) { if (macpos === void 0) { macpos = 0; } var g2 = new Uint16Array(10); var c2; var mask2; var f2; var i2; if (this._leftover) { i2 = this._leftover; this._buffer[i2++] = 1; for (; i2 < 16; i2++) { this._buffer[i2] = 0; } this._fin = 1; this._blocks(this._buffer, 0, 16); } c2 = this._h[1] >>> 13; this._h[1] &= 8191; for (i2 = 2; i2 < 10; i2++) { this._h[i2] += c2; c2 = this._h[i2] >>> 13; this._h[i2] &= 8191; } this._h[0] += c2 * 5; c2 = this._h[0] >>> 13; this._h[0] &= 8191; this._h[1] += c2; c2 = this._h[1] >>> 13; this._h[1] &= 8191; this._h[2] += c2; g2[0] = this._h[0] + 5; c2 = g2[0] >>> 13; g2[0] &= 8191; for (i2 = 1; i2 < 10; i2++) { g2[i2] = this._h[i2] + c2; c2 = g2[i2] >>> 13; g2[i2] &= 8191; } g2[9] -= 1 << 13; mask2 = (c2 ^ 1) - 1; for (i2 = 0; i2 < 10; i2++) { g2[i2] &= mask2; } mask2 = ~mask2; for (i2 = 0; i2 < 10; i2++) { this._h[i2] = this._h[i2] & mask2 | g2[i2]; } 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; f2 = this._h[0] + this._pad[0]; this._h[0] = f2 & 65535; for (i2 = 1; i2 < 8; i2++) { f2 = (this._h[i2] + this._pad[i2] | 0) + (f2 >>> 16) | 0; this._h[i2] = f2 & 65535; } mac[macpos + 0] = this._h[0] >>> 0; mac[macpos + 1] = this._h[0] >>> 8; mac[macpos + 2] = this._h[1] >>> 0; mac[macpos + 3] = this._h[1] >>> 8; mac[macpos + 4] = this._h[2] >>> 0; mac[macpos + 5] = this._h[2] >>> 8; mac[macpos + 6] = this._h[3] >>> 0; mac[macpos + 7] = this._h[3] >>> 8; mac[macpos + 8] = this._h[4] >>> 0; mac[macpos + 9] = this._h[4] >>> 8; mac[macpos + 10] = this._h[5] >>> 0; mac[macpos + 11] = this._h[5] >>> 8; mac[macpos + 12] = this._h[6] >>> 0; mac[macpos + 13] = this._h[6] >>> 8; mac[macpos + 14] = this._h[7] >>> 0; mac[macpos + 15] = this._h[7] >>> 8; this._finished = true; return this; }; Poly13052.prototype.update = function(m2) { var mpos = 0; var bytes2 = m2.length; var want; if (this._leftover) { want = 16 - this._leftover; if (want > bytes2) { want = bytes2; } for (var i2 = 0; i2 < want; i2++) { this._buffer[this._leftover + i2] = m2[mpos + i2]; } bytes2 -= want; mpos += want; this._leftover += want; if (this._leftover < 16) { return this; } this._blocks(this._buffer, 0, 16); this._leftover = 0; } if (bytes2 >= 16) { want = bytes2 - bytes2 % 16; this._blocks(m2, mpos, want); mpos += want; bytes2 -= want; } if (bytes2) { for (var i2 = 0; i2 < bytes2; i2++) { this._buffer[this._leftover + i2] = m2[mpos + i2]; } this._leftover += bytes2; } return this; }; Poly13052.prototype.digest = function() { if (this._finished) { throw new Error("Poly1305 was finished"); } var mac = new Uint8Array(16); this.finish(mac); return mac; }; Poly13052.prototype.clean = function() { wipe_12.wipe(this._buffer); wipe_12.wipe(this._r); wipe_12.wipe(this._h); wipe_12.wipe(this._pad); this._leftover = 0; this._fin = 0; this._finished = true; return this; }; return Poly13052; }() ); exports3.Poly1305 = Poly1305; function oneTimeAuth(key, data2) { var h2 = new Poly1305(key); h2.update(data2); var digest = h2.digest(); h2.clean(); return digest; } exports3.oneTimeAuth = oneTimeAuth; function equal2(a2, b2) { if (a2.length !== exports3.DIGEST_LENGTH || b2.length !== exports3.DIGEST_LENGTH) { return false; } return constant_time_12.equal(a2, b2); } exports3.equal = equal2; })(poly1305); (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); var chacha_1 = chacha; var poly1305_1 = poly1305; var wipe_12 = wipe$1; var binary_12 = binary; var constant_time_12 = constantTime; exports3.KEY_LENGTH = 32; exports3.NONCE_LENGTH = 12; exports3.TAG_LENGTH = 16; var ZEROS = new Uint8Array(16); var ChaCha20Poly1305 = ( /** @class */ function() { function ChaCha20Poly13052(key) { this.nonceLength = exports3.NONCE_LENGTH; this.tagLength = exports3.TAG_LENGTH; if (key.length !== exports3.KEY_LENGTH) { throw new Error("ChaCha20Poly1305 needs 32-byte key"); } this._key = new Uint8Array(key); } ChaCha20Poly13052.prototype.seal = function(nonce, plaintext, associatedData, dst) { if (nonce.length > 16) { throw new Error("ChaCha20Poly1305: incorrect nonce length"); } var counter = new Uint8Array(16); counter.set(nonce, counter.length - nonce.length); var authKey = new Uint8Array(32); chacha_1.stream(this._key, counter, authKey, 4); var resultLength = plaintext.length + this.tagLength; var result; if (dst) { if (dst.length !== resultLength) { throw new Error("ChaCha20Poly1305: incorrect destination length"); } result = dst; } else { result = new Uint8Array(resultLength); } chacha_1.streamXOR(this._key, counter, plaintext, result, 4); this._authenticate(result.subarray(result.length - this.tagLength, result.length), authKey, result.subarray(0, result.length - this.tagLength), associatedData); wipe_12.wipe(counter); return result; }; ChaCha20Poly13052.prototype.open = function(nonce, sealed, associatedData, dst) { if (nonce.length > 16) { throw new Error("ChaCha20Poly1305: incorrect nonce length"); } if (sealed.length < this.tagLength) { return null; } var counter = new Uint8Array(16); counter.set(nonce, counter.length - nonce.length); var authKey = new Uint8Array(32); chacha_1.stream(this._key, counter, authKey, 4); var calculatedTag = new Uint8Array(this.tagLength); this._authenticate(calculatedTag, authKey, sealed.subarray(0, sealed.length - this.tagLength), associatedData); if (!constant_time_12.equal(calculatedTag, sealed.subarray(sealed.length - this.tagLength, sealed.length))) { return null; } var resultLength = sealed.length - this.tagLength; var result; if (dst) { if (dst.length !== resultLength) { throw new Error("ChaCha20Poly1305: incorrect destination length"); } result = dst; } else { result = new Uint8Array(resultLength); } chacha_1.streamXOR(this._key, counter, sealed.subarray(0, sealed.length - this.tagLength), result, 4); wipe_12.wipe(counter); return result; }; ChaCha20Poly13052.prototype.clean = function() { wipe_12.wipe(this._key); return this; }; ChaCha20Poly13052.prototype._authenticate = function(tagOut, authKey, ciphertext, associatedData) { var h2 = new poly1305_1.Poly1305(authKey); if (associatedData) { h2.update(associatedData); if (associatedData.length % 16 > 0) { h2.update(ZEROS.subarray(associatedData.length % 16)); } } h2.update(ciphertext); if (ciphertext.length % 16 > 0) { h2.update(ZEROS.subarray(ciphertext.length % 16)); } var length = new Uint8Array(8); if (associatedData) { binary_12.writeUint64LE(associatedData.length, length); } h2.update(length); binary_12.writeUint64LE(ciphertext.length, length); h2.update(length); var tag = h2.digest(); for (var i2 = 0; i2 < tag.length; i2++) { tagOut[i2] = tag[i2]; } h2.clean(); wipe_12.wipe(tag); wipe_12.wipe(length); }; return ChaCha20Poly13052; }() ); exports3.ChaCha20Poly1305 = ChaCha20Poly1305; })(chacha20poly1305); var hkdf = {}; var hmac$1 = {}; var hash$1 = {}; Object.defineProperty(hash$1, "__esModule", { value: true }); function isSerializableHash(h2) { return typeof h2.saveState !== "undefined" && typeof h2.restoreState !== "undefined" && typeof h2.cleanSavedState !== "undefined"; } hash$1.isSerializableHash = isSerializableHash; Object.defineProperty(hmac$1, "__esModule", { value: true }); var hash_1 = hash$1; var constant_time_1 = constantTime; var wipe_1$2 = wipe$1; var HMAC = ( /** @class */ function() { function HMAC2(hash2, key) { this._finished = false; this._inner = new hash2(); this._outer = new hash2(); this.blockSize = this._outer.blockSize; this.digestLength = this._outer.digestLength; var pad2 = new Uint8Array(this.blockSize); if (key.length > this.blockSize) { this._inner.update(key).finish(pad2).clean(); } else { pad2.set(key); } for (var i2 = 0; i2 < pad2.length; i2++) { pad2[i2] ^= 54; } this._inner.update(pad2); for (var i2 = 0; i2 < pad2.length; i2++) { pad2[i2] ^= 54 ^ 92; } this._outer.update(pad2); if (hash_1.isSerializableHash(this._inner) && hash_1.isSerializableHash(this._outer)) { this._innerKeyedState = this._inner.saveState(); this._outerKeyedState = this._outer.saveState(); } wipe_1$2.wipe(pad2); } HMAC2.prototype.reset = function() { if (!hash_1.isSerializableHash(this._inner) || !hash_1.isSerializableHash(this._outer)) { throw new Error("hmac: can't reset() because hash doesn't implement restoreState()"); } this._inner.restoreState(this._innerKeyedState); this._outer.restoreState(this._outerKeyedState); this._finished = false; return this; }; HMAC2.prototype.clean = function() { if (hash_1.isSerializableHash(this._inner)) { this._inner.cleanSavedState(this._innerKeyedState); } if (hash_1.isSerializableHash(this._outer)) { this._outer.cleanSavedState(this._outerKeyedState); } this._inner.clean(); this._outer.clean(); }; HMAC2.prototype.update = function(data2) { this._inner.update(data2); return this; }; HMAC2.prototype.finish = function(out) { if (this._finished) { this._outer.finish(out); return this; } this._inner.finish(out); this._outer.update(out.subarray(0, this.digestLength)).finish(out); this._finished = true; return this; }; HMAC2.prototype.digest = function() { var out = new Uint8Array(this.digestLength); this.finish(out); return out; }; HMAC2.prototype.saveState = function() { if (!hash_1.isSerializableHash(this._inner)) { throw new Error("hmac: can't saveState() because hash doesn't implement it"); } return this._inner.saveState(); }; HMAC2.prototype.restoreState = function(savedState) { if (!hash_1.isSerializableHash(this._inner) || !hash_1.isSerializableHash(this._outer)) { throw new Error("hmac: can't restoreState() because hash doesn't implement it"); } this._inner.restoreState(savedState); this._outer.restoreState(this._outerKeyedState); this._finished = false; return this; }; HMAC2.prototype.cleanSavedState = function(savedState) { if (!hash_1.isSerializableHash(this._inner)) { throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it"); } this._inner.cleanSavedState(savedState); }; return HMAC2; }() ); hmac$1.HMAC = HMAC; function hmac(hash2, key, data2) { var h2 = new HMAC(hash2, key); h2.update(data2); var digest = h2.digest(); h2.clean(); return digest; } hmac$1.hmac = hmac; hmac$1.equal = constant_time_1.equal; Object.defineProperty(hkdf, "__esModule", { value: true }); var hmac_1 = hmac$1; var wipe_1$1 = wipe$1; var HKDF = ( /** @class */ function() { function HKDF2(hash2, key, salt, info) { if (salt === void 0) { salt = new Uint8Array(0); } this._counter = new Uint8Array(1); this._hash = hash2; this._info = info; var okm = hmac_1.hmac(this._hash, salt, key); this._hmac = new hmac_1.HMAC(hash2, okm); this._buffer = new Uint8Array(this._hmac.digestLength); this._bufpos = this._buffer.length; } HKDF2.prototype._fillBuffer = function() { this._counter[0]++; var ctr = this._counter[0]; if (ctr === 0) { throw new Error("hkdf: cannot expand more"); } this._hmac.reset(); if (ctr > 1) { this._hmac.update(this._buffer); } if (this._info) { this._hmac.update(this._info); } this._hmac.update(this._counter); this._hmac.finish(this._buffer); this._bufpos = 0; }; HKDF2.prototype.expand = function(length) { var out = new Uint8Array(length); for (var i2 = 0; i2 < out.length; i2++) { if (this._bufpos === this._buffer.length) { this._fillBuffer(); } out[i2] = this._buffer[this._bufpos++]; } return out; }; HKDF2.prototype.clean = function() { this._hmac.clean(); wipe_1$1.wipe(this._buffer); wipe_1$1.wipe(this._counter); this._bufpos = 0; }; return HKDF2; }() ); var HKDF_1 = hkdf.HKDF = HKDF; var random = {}; var system = {}; var browser$4 = {}; Object.defineProperty(browser$4, "__esModule", { value: true }); browser$4.BrowserRandomSource = void 0; const QUOTA = 65536; class BrowserRandomSource { constructor() { this.isAvailable = false; this.isInstantiated = false; const browserCrypto = typeof self !== "undefined" ? self.crypto || self.msCrypto : null; if (browserCrypto && browserCrypto.getRandomValues !== void 0) { this._crypto = browserCrypto; this.isAvailable = true; this.isInstantiated = true; } } randomBytes(length) { if (!this.isAvailable || !this._crypto) { throw new Error("Browser random byte generator is not available."); } const out = new Uint8Array(length); for (let i2 = 0; i2 < out.length; i2 += QUOTA) { this._crypto.getRandomValues(out.subarray(i2, i2 + Math.min(out.length - i2, QUOTA))); } return out; } } browser$4.BrowserRandomSource = BrowserRandomSource; function commonjsRequire(path) { throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } var node = {}; const __viteBrowserExternal = {}; const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: __viteBrowserExternal }, Symbol.toStringTag, { value: "Module" })); const require$$3 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1); Object.defineProperty(node, "__esModule", { value: true }); node.NodeRandomSource = void 0; const wipe_1 = wipe$1; class NodeRandomSource { constructor() { this.isAvailable = false; this.isInstantiated = false; if (typeof commonjsRequire !== "undefined") { const nodeCrypto = require$$3; if (nodeCrypto && nodeCrypto.randomBytes) { this._crypto = nodeCrypto; this.isAvailable = true; this.isInstantiated = true; } } } randomBytes(length) { if (!this.isAvailable || !this._crypto) { throw new Error("Node.js random byte generator is not available."); } let buffer2 = this._crypto.randomBytes(length); if (buffer2.length !== length) { throw new Error("NodeRandomSource: got fewer bytes than requested"); } const out = new Uint8Array(length); for (let i2 = 0; i2 < out.length; i2++) { out[i2] = buffer2[i2]; } (0, wipe_1.wipe)(buffer2); return out; } } node.NodeRandomSource = NodeRandomSource; Object.defineProperty(system, "__esModule", { value: true }); system.SystemRandomSource = void 0; const browser_1 = browser$4; const node_1 = node; class SystemRandomSource { constructor() { this.isAvailable = false; this.name = ""; this._source = new browser_1.BrowserRandomSource(); if (this._source.isAvailable) { this.isAvailable = true; this.name = "Browser"; return; } this._source = new node_1.NodeRandomSource(); if (this._source.isAvailable) { this.isAvailable = true; this.name = "Node"; return; } } randomBytes(length) { if (!this.isAvailable) { throw new Error("System random byte generator is not available."); } return this._source.randomBytes(length); } } system.SystemRandomSource = SystemRandomSource; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.randomStringForEntropy = exports3.randomString = exports3.randomUint32 = exports3.randomBytes = exports3.defaultRandomSource = void 0; const system_1 = system; const binary_12 = binary; const wipe_12 = wipe$1; exports3.defaultRandomSource = new system_1.SystemRandomSource(); function randomBytes(length, prng = exports3.defaultRandomSource) { return prng.randomBytes(length); } exports3.randomBytes = randomBytes; function randomUint32(prng = exports3.defaultRandomSource) { const buf = randomBytes(4, prng); const result = (0, binary_12.readUint32LE)(buf); (0, wipe_12.wipe)(buf); return result; } exports3.randomUint32 = randomUint32; const ALPHANUMERIC = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; function randomString(length, charset = ALPHANUMERIC, prng = exports3.defaultRandomSource) { if (charset.length < 2) { throw new Error("randomString charset is too short"); } if (charset.length > 256) { throw new Error("randomString charset is too long"); } let out = ""; const charsLen = charset.length; const maxByte = 256 - 256 % charsLen; while (length > 0) { const buf = randomBytes(Math.ceil(length * 256 / maxByte), prng); for (let i2 = 0; i2 < buf.length && length > 0; i2++) { const randomByte = buf[i2]; if (randomByte < maxByte) { out += charset.charAt(randomByte % charsLen); length--; } } (0, wipe_12.wipe)(buf); } return out; } exports3.randomString = randomString; function randomStringForEntropy(bits, charset = ALPHANUMERIC, prng = exports3.defaultRandomSource) { const length = Math.ceil(bits / (Math.log(charset.length) / Math.LN2)); return randomString(length, charset, prng); } exports3.randomStringForEntropy = randomStringForEntropy; })(random); var sha256$1 = {}; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); var binary_12 = binary; var wipe_12 = wipe$1; exports3.DIGEST_LENGTH = 32; exports3.BLOCK_SIZE = 64; var SHA256 = ( /** @class */ function() { function SHA2562() { this.digestLength = exports3.DIGEST_LENGTH; this.blockSize = exports3.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 = false; this.reset(); } SHA2562.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; }; SHA2562.prototype.reset = function() { this._initState(); this._bufferLength = 0; this._bytesHashed = 0; this._finished = false; return this; }; SHA2562.prototype.clean = function() { wipe_12.wipe(this._buffer); wipe_12.wipe(this._temp); this.reset(); }; SHA2562.prototype.update = function(data2, dataLength) { if (dataLength === void 0) { dataLength = data2.length; } if (this._finished) { throw new Error("SHA256: can't update because hash was finished."); } var dataPos = 0; this._bytesHashed += dataLength; if (this._bufferLength > 0) { while (this._bufferLength < this.blockSize && dataLength > 0) { this._buffer[this._bufferLength++] = data2[dataPos++]; dataLength--; } if (this._bufferLength === this.blockSize) { hashBlocks(this._temp, this._state, this._buffer, 0, this.blockSize); this._bufferLength = 0; } } if (dataLength >= this.blockSize) { dataPos = hashBlocks(this._temp, this._state, data2, dataPos, dataLength); dataLength %= this.blockSize; } while (dataLength > 0) { this._buffer[this._bufferLength++] = data2[dataPos++]; dataLength--; } return this; }; SHA2562.prototype.finish = function(out) { if (!this._finished) { var bytesHashed = this._bytesHashed; var left = this._bufferLength; var bitLenHi = bytesHashed / 536870912 | 0; var bitLenLo = bytesHashed << 3; var padLength = bytesHashed % 64 < 56 ? 64 : 128; this._buffer[left] = 128; for (var i2 = left + 1; i2 < padLength - 8; i2++) { this._buffer[i2] = 0; } binary_12.writeUint32BE(bitLenHi, this._buffer, padLength - 8); binary_12.writeUint32BE(bitLenLo, this._buffer, padLength - 4); hashBlocks(this._temp, this._state, this._buffer, 0, padLength); this._finished = true; } for (var i2 = 0; i2 < this.digestLength / 4; i2++) { binary_12.writeUint32BE(this._state[i2], out, i2 * 4); } return this; }; SHA2562.prototype.digest = function() { var out = new Uint8Array(this.digestLength); this.finish(out); return out; }; SHA2562.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 }; }; SHA2562.prototype.restoreState = function(savedState) { this._state.set(savedState.state); this._bufferLength = savedState.bufferLength; if (savedState.buffer) { this._buffer.set(savedState.buffer); } this._bytesHashed = savedState.bytesHashed; this._finished = false; return this; }; SHA2562.prototype.cleanSavedState = function(savedState) { wipe_12.wipe(savedState.state); if (savedState.buffer) { wipe_12.wipe(savedState.buffer); } savedState.bufferLength = 0; savedState.bytesHashed = 0; }; return SHA2562; }() ); exports3.SHA256 = SHA256; var K2 = 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 hashBlocks(w2, v2, p2, pos, len2) { while (len2 >= 64) { var a2 = v2[0]; var b2 = v2[1]; var c2 = v2[2]; var d2 = v2[3]; var e2 = v2[4]; var f2 = v2[5]; var g2 = v2[6]; var h2 = v2[7]; for (var i2 = 0; i2 < 16; i2++) { var j2 = pos + i2 * 4; w2[i2] = binary_12.readUint32BE(p2, j2); } for (var i2 = 16; i2 < 64; i2++) { var u2 = w2[i2 - 2]; var t1 = (u2 >>> 17 | u2 << 32 - 17) ^ (u2 >>> 19 | u2 << 32 - 19) ^ u2 >>> 10; u2 = w2[i2 - 15]; var t2 = (u2 >>> 7 | u2 << 32 - 7) ^ (u2 >>> 18 | u2 << 32 - 18) ^ u2 >>> 3; w2[i2] = (t1 + w2[i2 - 7] | 0) + (t2 + w2[i2 - 16] | 0); } for (var i2 = 0; i2 < 64; i2++) { var t1 = (((e2 >>> 6 | e2 << 32 - 6) ^ (e2 >>> 11 | e2 << 32 - 11) ^ (e2 >>> 25 | e2 << 32 - 25)) + (e2 & f2 ^ ~e2 & g2) | 0) + (h2 + (K2[i2] + w2[i2] | 0) | 0) | 0; var t2 = ((a2 >>> 2 | a2 << 32 - 2) ^ (a2 >>> 13 | a2 << 32 - 13) ^ (a2 >>> 22 | a2 << 32 - 22)) + (a2 & b2 ^ a2 & c2 ^ b2 & c2) | 0; h2 = g2; g2 = f2; f2 = e2; e2 = d2 + t1 | 0; d2 = c2; c2 = b2; b2 = a2; a2 = t1 + t2 | 0; } v2[0] += a2; v2[1] += b2; v2[2] += c2; v2[3] += d2; v2[4] += e2; v2[5] += f2; v2[6] += g2; v2[7] += h2; pos += 64; len2 -= 64; } return pos; } function hash2(data2) { var h2 = new SHA256(); h2.update(data2); var digest = h2.digest(); h2.clean(); return digest; } exports3.hash = hash2; })(sha256$1); var x25519 = {}; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.sharedKey = exports3.generateKeyPair = exports3.generateKeyPairFromSeed = exports3.scalarMultBase = exports3.scalarMult = exports3.SHARED_KEY_LENGTH = exports3.SECRET_KEY_LENGTH = exports3.PUBLIC_KEY_LENGTH = void 0; const random_1 = random; const wipe_12 = wipe$1; exports3.PUBLIC_KEY_LENGTH = 32; exports3.SECRET_KEY_LENGTH = 32; exports3.SHARED_KEY_LENGTH = 32; function gf(init2) { const r2 = new Float64Array(16); if (init2) { for (let i2 = 0; i2 < init2.length; i2++) { r2[i2] = init2[i2]; } } return r2; } const _9 = new Uint8Array(32); _9[0] = 9; const _121665 = gf([56129, 1]); function car25519(o2) { let c2 = 1; for (let i2 = 0; i2 < 16; i2++) { let v2 = o2[i2] + c2 + 65535; c2 = Math.floor(v2 / 65536); o2[i2] = v2 - c2 * 65536; } o2[0] += c2 - 1 + 37 * (c2 - 1); } function sel25519(p2, q2, b2) { const c2 = ~(b2 - 1); for (let i2 = 0; i2 < 16; i2++) { const t2 = c2 & (p2[i2] ^ q2[i2]); p2[i2] ^= t2; q2[i2] ^= t2; } } function pack25519(o2, n2) { const m2 = gf(); const t2 = gf(); for (let i2 = 0; i2 < 16; i2++) { t2[i2] = n2[i2]; } car25519(t2); car25519(t2); car25519(t2); for (let j2 = 0; j2 < 2; j2++) { m2[0] = t2[0] - 65517; for (let i2 = 1; i2 < 15; i2++) { m2[i2] = t2[i2] - 65535 - (m2[i2 - 1] >> 16 & 1); m2[i2 - 1] &= 65535; } m2[15] = t2[15] - 32767 - (m2[14] >> 16 & 1); const b2 = m2[15] >> 16 & 1; m2[14] &= 65535; sel25519(t2, m2, 1 - b2); } for (let i2 = 0; i2 < 16; i2++) { o2[2 * i2] = t2[i2] & 255; o2[2 * i2 + 1] = t2[i2] >> 8; } } function unpack25519(o2, n2) { for (let i2 = 0; i2 < 16; i2++) { o2[i2] = n2[2 * i2] + (n2[2 * i2 + 1] << 8); } o2[15] &= 32767; } function add(o2, a2, b2) { for (let i2 = 0; i2 < 16; i2++) { o2[i2] = a2[i2] + b2[i2]; } } function sub(o2, a2, b2) { for (let i2 = 0; i2 < 16; i2++) { o2[i2] = a2[i2] - b2[i2]; } } function mul(o2, a2, b2) { let v2, c2, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b2[0], b1 = b2[1], b22 = b2[2], b3 = b2[3], b4 = b2[4], b5 = b2[5], b6 = b2[6], b7 = b2[7], b8 = b2[8], b9 = b2[9], b10 = b2[10], b11 = b2[11], b12 = b2[12], b13 = b2[13], b14 = b2[14], b15 = b2[15]; v2 = a2[0]; t0 += v2 * b0; t1 += v2 * b1; t2 += v2 * b22; t3 += v2 * b3; t4 += v2 * b4; t5 += v2 * b5; t6 += v2 * b6; t7 += v2 * b7; t8 += v2 * b8; t9 += v2 * b9; t10 += v2 * b10; t11 += v2 * b11; t12 += v2 * b12; t13 += v2 * b13; t14 += v2 * b14; t15 += v2 * b15; v2 = a2[1]; t1 += v2 * b0; t2 += v2 * b1; t3 += v2 * b22; t4 += v2 * b3; t5 += v2 * b4; t6 += v2 * b5; t7 += v2 * b6; t8 += v2 * b7; t9 += v2 * b8; t10 += v2 * b9; t11 += v2 * b10; t12 += v2 * b11; t13 += v2 * b12; t14 += v2 * b13; t15 += v2 * b14; t16 += v2 * b15; v2 = a2[2]; t2 += v2 * b0; t3 += v2 * b1; t4 += v2 * b22; t5 += v2 * b3; t6 += v2 * b4; t7 += v2 * b5; t8 += v2 * b6; t9 += v2 * b7; t10 += v2 * b8; t11 += v2 * b9; t12 += v2 * b10; t13 += v2 * b11; t14 += v2 * b12; t15 += v2 * b13; t16 += v2 * b14; t17 += v2 * b15; v2 = a2[3]; t3 += v2 * b0; t4 += v2 * b1; t5 += v2 * b22; t6 += v2 * b3; t7 += v2 * b4; t8 += v2 * b5; t9 += v2 * b6; t10 += v2 * b7; t11 += v2 * b8; t12 += v2 * b9; t13 += v2 * b10; t14 += v2 * b11; t15 += v2 * b12; t16 += v2 * b13; t17 += v2 * b14; t18 += v2 * b15; v2 = a2[4]; t4 += v2 * b0; t5 += v2 * b1; t6 += v2 * b22; t7 += v2 * b3; t8 += v2 * b4; t9 += v2 * b5; t10 += v2 * b6; t11 += v2 * b7; t12 += v2 * b8; t13 += v2 * b9; t14 += v2 * b10; t15 += v2 * b11; t16 += v2 * b12; t17 += v2 * b13; t18 += v2 * b14; t19 += v2 * b15; v2 = a2[5]; t5 += v2 * b0; t6 += v2 * b1; t7 += v2 * b22; t8 += v2 * b3; t9 += v2 * b4; t10 += v2 * b5; t11 += v2 * b6; t12 += v2 * b7; t13 += v2 * b8; t14 += v2 * b9; t15 += v2 * b10; t16 += v2 * b11; t17 += v2 * b12; t18 += v2 * b13; t19 += v2 * b14; t20 += v2 * b15; v2 = a2[6]; t6 += v2 * b0; t7 += v2 * b1; t8 += v2 * b22; t9 += v2 * b3; t10 += v2 * b4; t11 += v2 * b5; t12 += v2 * b6; t13 += v2 * b7; t14 += v2 * b8; t15 += v2 * b9; t16 += v2 * b10; t17 += v2 * b11; t18 += v2 * b12; t19 += v2 * b13; t20 += v2 * b14; t21 += v2 * b15; v2 = a2[7]; t7 += v2 * b0; t8 += v2 * b1; t9 += v2 * b22; t10 += v2 * b3; t11 += v2 * b4; t12 += v2 * b5; t13 += v2 * b6; t14 += v2 * b7; t15 += v2 * b8; t16 += v2 * b9; t17 += v2 * b10; t18 += v2 * b11; t19 += v2 * b12; t20 += v2 * b13; t21 += v2 * b14; t22 += v2 * b15; v2 = a2[8]; t8 += v2 * b0; t9 += v2 * b1; t10 += v2 * b22; t11 += v2 * b3; t12 += v2 * b4; t13 += v2 * b5; t14 += v2 * b6; t15 += v2 * b7; t16 += v2 * b8; t17 += v2 * b9; t18 += v2 * b10; t19 += v2 * b11; t20 += v2 * b12; t21 += v2 * b13; t22 += v2 * b14; t23 += v2 * b15; v2 = a2[9]; t9 += v2 * b0; t10 += v2 * b1; t11 += v2 * b22; t12 += v2 * b3; t13 += v2 * b4; t14 += v2 * b5; t15 += v2 * b6; t16 += v2 * b7; t17 += v2 * b8; t18 += v2 * b9; t19 += v2 * b10; t20 += v2 * b11; t21 += v2 * b12; t22 += v2 * b13; t23 += v2 * b14; t24 += v2 * b15; v2 = a2[10]; t10 += v2 * b0; t11 += v2 * b1; t12 += v2 * b22; t13 += v2 * b3; t14 += v2 * b4; t15 += v2 * b5; t16 += v2 * b6; t17 += v2 * b7; t18 += v2 * b8; t19 += v2 * b9; t20 += v2 * b10; t21 += v2 * b11; t22 += v2 * b12; t23 += v2 * b13; t24 += v2 * b14; t25 += v2 * b15; v2 = a2[11]; t11 += v2 * b0; t12 += v2 * b1; t13 += v2 * b22; t14 += v2 * b3; t15 += v2 * b4; t16 += v2 * b5; t17 += v2 * b6; t18 += v2 * b7; t19 += v2 * b8; t20 += v2 * b9; t21 += v2 * b10; t22 += v2 * b11; t23 += v2 * b12; t24 += v2 * b13; t25 += v2 * b14; t26 += v2 * b15; v2 = a2[12]; t12 += v2 * b0; t13 += v2 * b1; t14 += v2 * b22; t15 += v2 * b3; t16 += v2 * b4; t17 += v2 * b5; t18 += v2 * b6; t19 += v2 * b7; t20 += v2 * b8; t21 += v2 * b9; t22 += v2 * b10; t23 += v2 * b11; t24 += v2 * b12; t25 += v2 * b13; t26 += v2 * b14; t27 += v2 * b15; v2 = a2[13]; t13 += v2 * b0; t14 += v2 * b1; t15 += v2 * b22; t16 += v2 * b3; t17 += v2 * b4; t18 += v2 * b5; t19 += v2 * b6; t20 += v2 * b7; t21 += v2 * b8; t22 += v2 * b9; t23 += v2 * b10; t24 += v2 * b11; t25 += v2 * b12; t26 += v2 * b13; t27 += v2 * b14; t28 += v2 * b15; v2 = a2[14]; t14 += v2 * b0; t15 += v2 * b1; t16 += v2 * b22; t17 += v2 * b3; t18 += v2 * b4; t19 += v2 * b5; t20 += v2 * b6; t21 += v2 * b7; t22 += v2 * b8; t23 += v2 * b9; t24 += v2 * b10; t25 += v2 * b11; t26 += v2 * b12; t27 += v2 * b13; t28 += v2 * b14; t29 += v2 * b15; v2 = a2[15]; t15 += v2 * b0; t16 += v2 * b1; t17 += v2 * b22; t18 += v2 * b3; t19 += v2 * b4; t20 += v2 * b5; t21 += v2 * b6; t22 += v2 * b7; t23 += v2 * b8; t24 += v2 * b9; t25 += v2 * b10; t26 += v2 * b11; t27 += v2 * b12; t28 += v2 * b13; t29 += v2 * b14; t30 += v2 * b15; t0 += 38 * t16; t1 += 38 * t17; t2 += 38 * t18; t3 += 38 * t19; t4 += 38 * t20; t5 += 38 * t21; t6 += 38 * t22; t7 += 38 * t23; t8 += 38 * t24; t9 += 38 * t25; t10 += 38 * t26; t11 += 38 * t27; t12 += 38 * t28; t13 += 38 * t29; t14 += 38 * t30; c2 = 1; v2 = t0 + c2 + 65535; c2 = Math.floor(v2 / 65536); t0 = v2 - c2 * 65536; v2 = t1 + c2 + 65535; c2 = Math.floor(v2 / 65536); t1 = v2 - c2 * 65536; v2 = t2 + c2 + 65535; c2 = Math.floor(v2 / 65536); t2 = v2 - c2 * 65536; v2 = t3 + c2 + 65535; c2 = Math.floor(v2 / 65536); t3 = v2 - c2 * 65536; v2 = t4 + c2 + 65535; c2 = Math.floor(v2 / 65536); t4 = v2 - c2 * 65536; v2 = t5 + c2 + 65535; c2 = Math.floor(v2 / 65536); t5 = v2 - c2 * 65536; v2 = t6 + c2 + 65535; c2 = Math.floor(v2 / 65536); t6 = v2 - c2 * 65536; v2 = t7 + c2 + 65535; c2 = Math.floor(v2 / 65536); t7 = v2 - c2 * 65536; v2 = t8 + c2 + 65535; c2 = Math.floor(v2 / 65536); t8 = v2 - c2 * 65536; v2 = t9 + c2 + 65535; c2 = Math.floor(v2 / 65536); t9 = v2 - c2 * 65536; v2 = t10 + c2 + 65535; c2 = Math.floor(v2 / 65536); t10 = v2 - c2 * 65536; v2 = t11 + c2 + 65535; c2 = Math.floor(v2 / 65536); t11 = v2 - c2 * 65536; v2 = t12 + c2 + 65535; c2 = Math.floor(v2 / 65536); t12 = v2 - c2 * 65536; v2 = t13 + c2 + 65535; c2 = Math.floor(v2 / 65536); t13 = v2 - c2 * 65536; v2 = t14 + c2 + 65535; c2 = Math.floor(v2 / 65536); t14 = v2 - c2 * 65536; v2 = t15 + c2 + 65535; c2 = Math.floor(v2 / 65536); t15 = v2 - c2 * 65536; t0 += c2 - 1 + 37 * (c2 - 1); c2 = 1; v2 = t0 + c2 + 65535; c2 = Math.floor(v2 / 65536); t0 = v2 - c2 * 65536; v2 = t1 + c2 + 65535; c2 = Math.floor(v2 / 65536); t1 = v2 - c2 * 65536; v2 = t2 + c2 + 65535; c2 = Math.floor(v2 / 65536); t2 = v2 - c2 * 65536; v2 = t3 + c2 + 65535; c2 = Math.floor(v2 / 65536); t3 = v2 - c2 * 65536; v2 = t4 + c2 + 65535; c2 = Math.floor(v2 / 65536); t4 = v2 - c2 * 65536; v2 = t5 + c2 + 65535; c2 = Math.floor(v2 / 65536); t5 = v2 - c2 * 65536; v2 = t6 + c2 + 65535; c2 = Math.floor(v2 / 65536); t6 = v2 - c2 * 65536; v2 = t7 + c2 + 65535; c2 = Math.floor(v2 / 65536); t7 = v2 - c2 * 65536; v2 = t8 + c2 + 65535; c2 = Math.floor(v2 / 65536); t8 = v2 - c2 * 65536; v2 = t9 + c2 + 65535; c2 = Math.floor(v2 / 65536); t9 = v2 - c2 * 65536; v2 = t10 + c2 + 65535; c2 = Math.floor(v2 / 65536); t10 = v2 - c2 * 65536; v2 = t11 + c2 + 65535; c2 = Math.floor(v2 / 65536); t11 = v2 - c2 * 65536; v2 = t12 + c2 + 65535; c2 = Math.floor(v2 / 65536); t12 = v2 - c2 * 65536; v2 = t13 + c2 + 65535; c2 = Math.floor(v2 / 65536); t13 = v2 - c2 * 65536; v2 = t14 + c2 + 65535; c2 = Math.floor(v2 / 65536); t14 = v2 - c2 * 65536; v2 = t15 + c2 + 65535; c2 = Math.floor(v2 / 65536); t15 = v2 - c2 * 65536; t0 += c2 - 1 + 37 * (c2 - 1); o2[0] = t0; o2[1] = t1; o2[2] = t2; o2[3] = t3; o2[4] = t4; o2[5] = t5; o2[6] = t6; o2[7] = t7; o2[8] = t8; o2[9] = t9; o2[10] = t10; o2[11] = t11; o2[12] = t12; o2[13] = t13; o2[14] = t14; o2[15] = t15; } function square(o2, a2) { mul(o2, a2, a2); } function inv25519(o2, inp) { const c2 = gf(); for (let i2 = 0; i2 < 16; i2++) { c2[i2] = inp[i2]; } for (let i2 = 253; i2 >= 0; i2--) { square(c2, c2); if (i2 !== 2 && i2 !== 4) { mul(c2, c2, inp); } } for (let i2 = 0; i2 < 16; i2++) { o2[i2] = c2[i2]; } } function scalarMult(n2, p2) { const z2 = new Uint8Array(32); const x2 = new Float64Array(80); const a2 = gf(), b2 = gf(), c2 = gf(), d2 = gf(), e2 = gf(), f2 = gf(); for (let i2 = 0; i2 < 31; i2++) { z2[i2] = n2[i2]; } z2[31] = n2[31] & 127 | 64; z2[0] &= 248; unpack25519(x2, p2); for (let i2 = 0; i2 < 16; i2++) { b2[i2] = x2[i2]; } a2[0] = d2[0] = 1; for (let i2 = 254; i2 >= 0; --i2) { const r2 = z2[i2 >>> 3] >>> (i2 & 7) & 1; sel25519(a2, b2, r2); sel25519(c2, d2, r2); add(e2, a2, c2); sub(a2, a2, c2); add(c2, b2, d2); sub(b2, b2, d2); square(d2, e2); square(f2, a2); mul(a2, c2, a2); mul(c2, b2, e2); add(e2, a2, c2); sub(a2, a2, c2); square(b2, a2); sub(c2, d2, f2); mul(a2, c2, _121665); add(a2, a2, d2); mul(c2, c2, a2); mul(a2, d2, f2); mul(d2, b2, x2); square(b2, e2); sel25519(a2, b2, r2); sel25519(c2, d2, r2); } for (let i2 = 0; i2 < 16; i2++) { x2[i2 + 16] = a2[i2]; x2[i2 + 32] = c2[i2]; x2[i2 + 48] = b2[i2]; x2[i2 + 64] = d2[i2]; } const x32 = x2.subarray(32); const x16 = x2.subarray(16); inv25519(x32, x32); mul(x16, x16, x32); const q2 = new Uint8Array(32); pack25519(q2, x16); return q2; } exports3.scalarMult = scalarMult; function scalarMultBase(n2) { return scalarMult(n2, _9); } exports3.scalarMultBase = scalarMultBase; function generateKeyPairFromSeed(seed) { if (seed.length !== exports3.SECRET_KEY_LENGTH) { throw new Error(`x25519: seed must be ${exports3.SECRET_KEY_LENGTH} bytes`); } const secretKey = new Uint8Array(seed); const publicKey = scalarMultBase(secretKey); return { publicKey, secretKey }; } exports3.generateKeyPairFromSeed = generateKeyPairFromSeed; function generateKeyPair2(prng) { const seed = (0, random_1.randomBytes)(32, prng); const result = generateKeyPairFromSeed(seed); (0, wipe_12.wipe)(seed); return result; } exports3.generateKeyPair = generateKeyPair2; function sharedKey(mySecretKey, theirPublicKey, rejectZero = false) { if (mySecretKey.length !== exports3.PUBLIC_KEY_LENGTH) { throw new Error("X25519: incorrect secret key length"); } if (theirPublicKey.length !== exports3.PUBLIC_KEY_LENGTH) { throw new Error("X25519: incorrect public key length"); } const result = scalarMult(mySecretKey, theirPublicKey); if (rejectZero) { let zeros2 = 0; for (let i2 = 0; i2 < result.length; i2++) { zeros2 |= result[i2]; } if (zeros2 === 0) { throw new Error("X25519: invalid shared key"); } } return result; } exports3.sharedKey = sharedKey; })(x25519); function allocUnsafe(size2 = 0) { if (globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null) { return globalThis.Buffer.allocUnsafe(size2); } return new Uint8Array(size2); } function concat(arrays, length) { if (!length) { length = arrays.reduce((acc, curr) => acc + curr.length, 0); } const output2 = allocUnsafe(length); let offset = 0; for (const arr2 of arrays) { output2.set(arr2, offset); offset += arr2.length; } return output2; } function base(ALPHABET, name2) { if (ALPHABET.length >= 255) { throw new TypeError("Alphabet too long"); } var BASE_MAP = new Uint8Array(256); for (var j2 = 0; j2 < BASE_MAP.length; j2++) { BASE_MAP[j2] = 255; } for (var i2 = 0; i2 < ALPHABET.length; i2++) { var x2 = ALPHABET.charAt(i2); var xc = x2.charCodeAt(0); if (BASE_MAP[xc] !== 255) { throw new TypeError(x2 + " is ambiguous"); } BASE_MAP[xc] = i2; } var BASE = ALPHABET.length; var LEADER = ALPHABET.charAt(0); var FACTOR = Math.log(BASE) / Math.log(256); var iFACTOR = Math.log(256) / Math.log(BASE); function encode2(source) { if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); } else if (Array.isArray(source)) { source = Uint8Array.from(source); } if (!(source instanceof Uint8Array)) { throw new TypeError("Expected Uint8Array"); } if (source.length === 0) { return ""; } var zeroes = 0; var length = 0; var pbegin = 0; var pend = source.length; while (pbegin !== pend && source[pbegin] === 0) { pbegin++; zeroes++; } var size2 = (pend - pbegin) * iFACTOR + 1 >>> 0; var b58 = new Uint8Array(size2); while (pbegin !== pend) { var carry = source[pbegin]; var i3 = 0; for (var it1 = size2 - 1; (carry !== 0 || i3 < length) && it1 !== -1; it1--, i3++) { carry += 256 * b58[it1] >>> 0; b58[it1] = carry % BASE >>> 0; carry = carry / BASE >>> 0; } if (carry !== 0) { throw new Error("Non-zero carry"); } length = i3; pbegin++; } var it2 = size2 - length; while (it2 !== size2 && b58[it2] === 0) { it2++; } var str = LEADER.repeat(zeroes); for (; it2 < size2; ++it2) { str += ALPHABET.charAt(b58[it2]); } return str; } function decodeUnsafe(source) { if (typeof source !== "string") { throw new TypeError("Expected String"); } if (source.length === 0) { return new Uint8Array(); } var psz = 0; if (source[psz] === " ") { return; } var zeroes = 0; var length = 0; while (source[psz] === LEADER) { zeroes++; psz++; } var size2 = (source.length - psz) * FACTOR + 1 >>> 0; var b256 = new Uint8Array(size2); while (source[psz]) { var carry = BASE_MAP[source.charCodeAt(psz)]; if (carry === 255) { return; } var i3 = 0; for (var it3 = size2 - 1; (carry !== 0 || i3 < length) && it3 !== -1; it3--, i3++) { carry += BASE * b256[it3] >>> 0; b256[it3] = carry % 256 >>> 0; carry = carry / 256 >>> 0; } if (carry !== 0) { throw new Error("Non-zero carry"); } length = i3; psz++; } if (source[psz] === " ") { return; } var it4 = size2 - length; while (it4 !== size2 && b256[it4] === 0) { it4++; } var vch = new Uint8Array(zeroes + (size2 - it4)); var j3 = zeroes; while (it4 !== size2) { vch[j3++] = b256[it4++]; } return vch; } function decode2(string2) { var buffer2 = decodeUnsafe(string2); if (buffer2) { return buffer2; } throw new Error(`Non-${name2} character`); } return { encode: encode2, decodeUnsafe, decode: decode2 }; } var src = base; var _brrp__multiformats_scope_baseX = src; const coerce$3 = (o2) => { if (o2 instanceof Uint8Array && o2.constructor.name === "Uint8Array") return o2; if (o2 instanceof ArrayBuffer) return new Uint8Array(o2); if (ArrayBuffer.isView(o2)) { return new Uint8Array(o2.buffer, o2.byteOffset, o2.byteLength); } throw new Error("Unknown type, must be binary type"); }; const fromString$1 = (str) => new TextEncoder().encode(str); const toString$1 = (b2) => new TextDecoder().decode(b2); class Encoder { constructor(name2, prefix, baseEncode) { this.name = name2; this.prefix = prefix; this.baseEncode = baseEncode; } encode(bytes2) { if (bytes2 instanceof Uint8Array) { return `${this.prefix}${this.baseEncode(bytes2)}`; } else { throw Error("Unknown type, must be binary type"); } } } class Decoder { constructor(name2, prefix, baseDecode) { this.name = name2; this.prefix = prefix; if (prefix.codePointAt(0) === void 0) { throw new Error("Invalid prefix character"); } this.prefixCodePoint = prefix.codePointAt(0); this.baseDecode = baseDecode; } decode(text) { if (typeof text === "string") { if (text.codePointAt(0) !== this.prefixCodePoint) { throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); } return this.baseDecode(text.slice(this.prefix.length)); } else { throw Error("Can only multibase decode strings"); } } or(decoder) { return or$2(this, decoder); } } class ComposedDecoder { constructor(decoders) { this.decoders = decoders; } or(decoder) { return or$2(this, decoder); } decode(input) { const prefix = input[0]; const decoder = this.decoders[prefix]; if (decoder) { return decoder.decode(input); } else { throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); } } } const or$2 = (left, right) => new ComposedDecoder({ ...left.decoders || { [left.prefix]: left }, ...right.decoders || { [right.prefix]: right } }); class Codec { constructor(name2, prefix, baseEncode, baseDecode) { this.name = name2; this.prefix = prefix; this.baseEncode = baseEncode; this.baseDecode = baseDecode; this.encoder = new Encoder(name2, prefix, baseEncode); this.decoder = new Decoder(name2, prefix, baseDecode); } encode(input) { return this.encoder.encode(input); } decode(input) { return this.decoder.decode(input); } } const from = ({ name: name2, prefix, encode: encode2, decode: decode2 }) => new Codec(name2, prefix, encode2, decode2); const baseX = ({ prefix, name: name2, alphabet: alphabet2 }) => { const { encode: encode2, decode: decode2 } = _brrp__multiformats_scope_baseX(alphabet2, name2); return from({ prefix, name: name2, encode: encode2, decode: (text) => coerce$3(decode2(text)) }); }; const decode$2 = (string2, alphabet2, bitsPerChar, name2) => { const codes2 = {}; for (let i2 = 0; i2 < alphabet2.length; ++i2) { codes2[alphabet2[i2]] = i2; } let end = string2.length; while (string2[end - 1] === "=") { --end; } const out = new Uint8Array(end * bitsPerChar / 8 | 0); let bits = 0; let buffer2 = 0; let written = 0; for (let i2 = 0; i2 < end; ++i2) { const value = codes2[string2[i2]]; if (value === void 0) { throw new SyntaxError(`Non-${name2} character`); } buffer2 = buffer2 << bitsPerChar | value; bits += bitsPerChar; if (bits >= 8) { bits -= 8; out[written++] = 255 & buffer2 >> bits; } } if (bits >= bitsPerChar || 255 & buffer2 << 8 - bits) { throw new SyntaxError("Unexpected end of data"); } return out; }; const encode$1 = (data2, alphabet2, bitsPerChar) => { const pad2 = alphabet2[alphabet2.length - 1] === "="; const mask2 = (1 << bitsPerChar) - 1; let out = ""; let bits = 0; let buffer2 = 0; for (let i2 = 0; i2 < data2.length; ++i2) { buffer2 = buffer2 << 8 | data2[i2]; bits += 8; while (bits > bitsPerChar) { bits -= bitsPerChar; out += alphabet2[mask2 & buffer2 >> bits]; } } if (bits) { out += alphabet2[mask2 & buffer2 << bitsPerChar - bits]; } if (pad2) { while (out.length * bitsPerChar & 7) { out += "="; } } return out; }; const rfc4648 = ({ name: name2, prefix, bitsPerChar, alphabet: alphabet2 }) => { return from({ prefix, name: name2, encode(input) { return encode$1(input, alphabet2, bitsPerChar); }, decode(input) { return decode$2(input, alphabet2, bitsPerChar, name2); } }); }; const identity = from({ prefix: "\0", name: "identity", encode: (buf) => toString$1(buf), decode: (str) => fromString$1(str) }); const identityBase = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, identity }, Symbol.toStringTag, { value: "Module" })); const base2 = rfc4648({ prefix: "0", name: "base2", alphabet: "01", bitsPerChar: 1 }); const base2$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, base2 }, Symbol.toStringTag, { value: "Module" })); const base8 = rfc4648({ prefix: "7", name: "base8", alphabet: "01234567", bitsPerChar: 3 }); const base8$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, base8 }, Symbol.toStringTag, { value: "Module" })); const base10 = baseX({ prefix: "9", name: "base10", alphabet: "0123456789" }); const base10$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, base10 }, Symbol.toStringTag, { value: "Module" })); const base16 = rfc4648({ prefix: "f", name: "base16", alphabet: "0123456789abcdef", bitsPerChar: 4 }); const base16upper = rfc4648({ prefix: "F", name: "base16upper", alphabet: "0123456789ABCDEF", bitsPerChar: 4 }); const base16$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, base16, base16upper }, Symbol.toStringTag, { value: "Module" })); const base32 = rfc4648({ prefix: "b", name: "base32", alphabet: "abcdefghijklmnopqrstuvwxyz234567", bitsPerChar: 5 }); const base32upper = rfc4648({ prefix: "B", name: "base32upper", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", bitsPerChar: 5 }); const base32pad = rfc4648({ prefix: "c", name: "base32pad", alphabet: "abcdefghijklmnopqrstuvwxyz234567=", bitsPerChar: 5 }); const base32padupper = rfc4648({ prefix: "C", name: "base32padupper", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=", bitsPerChar: 5 }); const base32hex = rfc4648({ prefix: "v", name: "base32hex", alphabet: "0123456789abcdefghijklmnopqrstuv", bitsPerChar: 5 }); const base32hexupper = rfc4648({ prefix: "V", name: "base32hexupper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV", bitsPerChar: 5 }); const base32hexpad = rfc4648({ prefix: "t", name: "base32hexpad", alphabet: "0123456789abcdefghijklmnopqrstuv=", bitsPerChar: 5 }); const base32hexpadupper = rfc4648({ prefix: "T", name: "base32hexpadupper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=", bitsPerChar: 5 }); const base32z = rfc4648({ prefix: "h", name: "base32z", alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769", bitsPerChar: 5 }); const base32$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, base32, base32hex, base32hexpad, base32hexpadupper, base32hexupper, base32pad, base32padupper, base32upper, base32z }, Symbol.toStringTag, { value: "Module" })); const base36 = baseX({ prefix: "k", name: "base36", alphabet: "0123456789abcdefghijklmnopqrstuvwxyz" }); const base36upper = baseX({ prefix: "K", name: "base36upper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" }); const base36$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, base36, base36upper }, Symbol.toStringTag, { value: "Module" })); const base58btc = baseX({ name: "base58btc", prefix: "z", alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" }); const base58flickr = baseX({ name: "base58flickr", prefix: "Z", alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" }); const base58 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, base58btc, base58flickr }, Symbol.toStringTag, { value: "Module" })); const base64$2 = rfc4648({ prefix: "m", name: "base64", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", bitsPerChar: 6 }); const base64pad = rfc4648({ prefix: "M", name: "base64pad", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", bitsPerChar: 6 }); const base64url = rfc4648({ prefix: "u", name: "base64url", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", bitsPerChar: 6 }); const base64urlpad = rfc4648({ prefix: "U", name: "base64urlpad", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=", bitsPerChar: 6 }); const base64$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, base64: base64$2, base64pad, base64url, base64urlpad }, Symbol.toStringTag, { value: "Module" })); const alphabet = Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"); const alphabetBytesToChars = alphabet.reduce((p2, c2, i2) => { p2[i2] = c2; return p2; }, []); const alphabetCharsToBytes = alphabet.reduce((p2, c2, i2) => { p2[c2.codePointAt(0)] = i2; return p2; }, []); function encode(data2) { return data2.reduce((p2, c2) => { p2 += alphabetBytesToChars[c2]; return p2; }, ""); } function decode$1(str) { const byts = []; for (const char of str) { const byt = alphabetCharsToBytes[char.codePointAt(0)]; if (byt === void 0) { throw new Error(`Non-base256emoji character: ${char}`); } byts.push(byt); } return new Uint8Array(byts); } const base256emoji = from({ prefix: "🚀", name: "base256emoji", encode, decode: decode$1 }); const base256emoji$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, base256emoji }, Symbol.toStringTag, { value: "Module" })); new TextEncoder(); new TextDecoder(); const bases = { ...identityBase, ...base2$1, ...base8$1, ...base10$1, ...base16$1, ...base32$1, ...base36$1, ...base58, ...base64$3, ...base256emoji$1 }; function createCodec(name2, prefix, encode2, decode2) { return { name: name2, prefix, encoder: { name: name2, prefix, encode: encode2 }, decoder: { decode: decode2 } }; } const string$1 = createCodec("utf8", "u", (buf) => { const decoder = new TextDecoder("utf8"); return "u" + decoder.decode(buf); }, (str) => { const encoder2 = new TextEncoder(); return encoder2.encode(str.substring(1)); }); const ascii = createCodec("ascii", "a", (buf) => { let string2 = "a"; for (let i2 = 0; i2 < buf.length; i2++) { string2 += String.fromCharCode(buf[i2]); } return string2; }, (str) => { str = str.substring(1); const buf = allocUnsafe(str.length); for (let i2 = 0; i2 < str.length; i2++) { buf[i2] = str.charCodeAt(i2); } return buf; }); const BASES = { utf8: string$1, "utf-8": string$1, hex: bases.base16, latin1: ascii, ascii, binary: ascii, ...bases }; function fromString(string2, encoding = "utf8") { const base3 = BASES[encoding]; if (!base3) { throw new Error(`Unsupported encoding "${encoding}"`); } if ((encoding === "utf8" || encoding === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null) { return globalThis.Buffer.from(string2, "utf8"); } return base3.decoder.decode(`${base3.prefix}${string2}`); } function toString(array2, encoding = "utf8") { const base3 = BASES[encoding]; if (!base3) { throw new Error(`Unsupported encoding "${encoding}"`); } if ((encoding === "utf8" || encoding === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null) { return globalThis.Buffer.from(array2.buffer, array2.byteOffset, array2.byteLength).toString("utf8"); } return base3.encoder.encode(array2).substring(1); } var __spreadArray$1 = globalThis && globalThis.__spreadArray || function(to2, from2, pack) { if (pack || arguments.length === 2) for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) { if (ar2 || !(i2 in from2)) { if (!ar2) ar2 = Array.prototype.slice.call(from2, 0, i2); ar2[i2] = from2[i2]; } } return to2.concat(ar2 || Array.prototype.slice.call(from2)); }; var BrowserInfo = ( /** @class */ function() { function BrowserInfo2(name2, version2, os2) { this.name = name2; this.version = version2; this.os = os2; this.type = "browser"; } return BrowserInfo2; }() ); var NodeInfo = ( /** @class */ function() { function NodeInfo2(version2) { this.version = version2; this.type = "node"; this.name = "node"; this.os = process.platform; } return NodeInfo2; }() ); var SearchBotDeviceInfo = ( /** @class */ function() { function SearchBotDeviceInfo2(name2, version2, os2, bot) { this.name = name2; this.version = version2; this.os = os2; this.bot = bot; this.type = "bot-device"; } return SearchBotDeviceInfo2; }() ); var BotInfo = ( /** @class */ function() { function BotInfo2() { this.type = "bot"; this.bot = true; this.name = "bot"; this.version = null; this.os = null; } return BotInfo2; }() ); var ReactNativeInfo = ( /** @class */ function() { function ReactNativeInfo2() { this.type = "react-native"; this.name = "react-native"; this.version = null; this.os = null; } return ReactNativeInfo2; }() ); var SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/; var SEARCHBOT_OS_REGEX = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/; var REQUIRED_VERSION_PARTS = 3; var userAgentRules = [ ["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", SEARCHBOX_UA_REGEX] ]; var operatingSystemRules = [ ["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 detect(userAgent) { if (!!userAgent) { return parseUserAgent(userAgent); } if (typeof document === "undefined" && typeof navigator !== "undefined" && navigator.product === "ReactNative") { return new ReactNativeInfo(); } if (typeof navigator !== "undefined") { return parseUserAgent(navigator.userAgent); } return getNodeVersion(); } function matchUserAgent(ua) { return ua !== "" && userAgentRules.reduce(function(matched, _a2) { var browser2 = _a2[0], regex2 = _a2[1]; if (matched) { return matched; } var uaMatch = regex2.exec(ua); return !!uaMatch && [browser2, uaMatch]; }, false); } function parseUserAgent(ua) { var matchedRule = matchUserAgent(ua); if (!matchedRule) { return null; } var name2 = matchedRule[0], match = matchedRule[1]; if (name2 === "searchbot") { return new BotInfo(); } var versionParts = match[1] && match[1].split(".").join("_").split("_").slice(0, 3); if (versionParts) { if (versionParts.length < REQUIRED_VERSION_PARTS) { versionParts = __spreadArray$1(__spreadArray$1([], versionParts, true), createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length), true); } } else { versionParts = []; } var version2 = versionParts.join("."); var os2 = detectOS(ua); var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua); if (searchBotMatch && searchBotMatch[1]) { return new SearchBotDeviceInfo(name2, version2, os2, searchBotMatch[1]); } return new BrowserInfo(name2, version2, os2); } function detectOS(ua) { for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) { var _a2 = operatingSystemRules[ii], os2 = _a2[0], regex2 = _a2[1]; var match = regex2.exec(ua); if (match) { return os2; } } return null; } function getNodeVersion() { var isNode = typeof process !== "undefined" && process.version; return isNode ? new NodeInfo(process.version.slice(1)) : null; } function createVersionParts(count) { var output2 = []; for (var ii = 0; ii < count; ii++) { output2.push("0"); } return output2; } var cjs$5 = {}; /*! ***************************************************************************** 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 extendStatics$1 = function(d2, b2) { extendStatics$1 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) { d3.__proto__ = b3; } || function(d3, b3) { for (var p2 in b3) if (b3.hasOwnProperty(p2)) d3[p2] = b3[p2]; }; return extendStatics$1(d2, b2); }; function __extends$1(d2, b2) { extendStatics$1(d2, b2); function __() { this.constructor = d2; } d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __()); } var __assign$1 = function() { __assign$1 = Object.assign || function __assign2(t2) { for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { s2 = arguments[i2]; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2]; } return t2; }; return __assign$1.apply(this, arguments); }; function __rest$1(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; } function __decorate$1(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; } function __param$1(paramIndex, decorator) { return function(target, key) { decorator(target, key, paramIndex); }; } function __metadata$1(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter$1(thisArg, _arguments, P2, generator) { function adopt(value) { return value instanceof P2 ? value : new P2(function(resolve) { resolve(value); }); } return new (P2 || (P2 = Promise))(function(resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e2) { reject(e2); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e2) { reject(e2); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator$1(thisArg, body) { var _2 = { label: 0, sent: function() { if (t2[0] & 1) throw t2[1]; return t2[1]; }, trys: [], ops: [] }, f2, y2, t2, g2; return g2 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g2[Symbol.iterator] = function() { return this; }), g2; function verb(n2) { return function(v2) { return step([n2, v2]); }; } function step(op) { if (f2) throw new TypeError("Generator is already executing."); while (_2) try { if (f2 = 1, y2 && (t2 = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t2 = y2["return"]) && t2.call(y2), 0) : y2.next) && !(t2 = t2.call(y2, op[1])).done) return t2; if (y2 = 0, t2) op = [op[0] & 2, t2.value]; switch (op[0]) { case 0: case 1: t2 = op; break; case 4: _2.label++; return { value: op[1], done: false }; case 5: _2.label++; y2 = op[1]; op = [0]; continue; case 7: op = _2.ops.pop(); _2.trys.pop(); continue; default: if (!(t2 = _2.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) { _2 = 0; continue; } if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) { _2.label = op[1]; break; } if (op[0] === 6 && _2.label < t2[1]) { _2.label = t2[1]; t2 = op; break; } if (t2 && _2.label < t2[2]) { _2.label = t2[2]; _2.ops.push(op); break; } if (t2[2]) _2.ops.pop(); _2.trys.pop(); continue; } op = body.call(thisArg, _2); } catch (e2) { op = [6, e2]; y2 = 0; } finally { f2 = t2 = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } function __createBinding$1(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; o2[k22] = m2[k2]; } function __exportStar$1(m2, exports3) { for (var p2 in m2) if (p2 !== "default" && !exports3.hasOwnProperty(p2)) exports3[p2] = m2[p2]; } function __values$1(o2) { var s2 = typeof Symbol === "function" && Symbol.iterator, m2 = s2 && o2[s2], i2 = 0; if (m2) return m2.call(o2); if (o2 && typeof o2.length === "number") return { next: function() { if (o2 && i2 >= o2.length) o2 = void 0; return { value: o2 && o2[i2++], done: !o2 }; } }; throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read$1(o2, n2) { var m2 = typeof Symbol === "function" && o2[Symbol.iterator]; if (!m2) return o2; var i2 = m2.call(o2), r2, ar2 = [], e2; try { while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value); } catch (error2) { e2 = { error: error2 }; } finally { try { if (r2 && !r2.done && (m2 = i2["return"])) m2.call(i2); } finally { if (e2) throw e2.error; } } return ar2; } function __spread$1() { for (var ar2 = [], i2 = 0; i2 < arguments.length; i2++) ar2 = ar2.concat(__read$1(arguments[i2])); return ar2; } function __spreadArrays$1() { for (var s2 = 0, i2 = 0, il = arguments.length; i2 < il; i2++) s2 += arguments[i2].length; for (var r2 = Array(s2), k2 = 0, i2 = 0; i2 < il; i2++) for (var a2 = arguments[i2], j2 = 0, jl = a2.length; j2 < jl; j2++, k2++) r2[k2] = a2[j2]; return r2; } function __await$1(v2) { return this instanceof __await$1 ? (this.v = v2, this) : new __await$1(v2); } function __asyncGenerator$1(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g2 = generator.apply(thisArg, _arguments || []), i2, q2 = []; return i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { return this; }, i2; function verb(n2) { if (g2[n2]) i2[n2] = function(v2) { return new Promise(function(a2, b2) { q2.push([n2, v2, a2, b2]) > 1 || resume(n2, v2); }); }; } function resume(n2, v2) { try { step(g2[n2](v2)); } catch (e2) { settle(q2[0][3], e2); } } function step(r2) { r2.value instanceof __await$1 ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q2[0][2], r2); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f2, v2) { if (f2(v2), q2.shift(), q2.length) resume(q2[0][0], q2[0][1]); } } function __asyncDelegator$1(o2) { var i2, p2; return i2 = {}, verb("next"), verb("throw", function(e2) { throw e2; }), verb("return"), i2[Symbol.iterator] = function() { return this; }, i2; function verb(n2, f2) { i2[n2] = o2[n2] ? function(v2) { return (p2 = !p2) ? { value: __await$1(o2[n2](v2)), done: n2 === "return" } : f2 ? f2(v2) : v2; } : f2; } } function __asyncValues$1(o2) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m2 = o2[Symbol.asyncIterator], i2; return m2 ? m2.call(o2) : (o2 = typeof __values$1 === "function" ? __values$1(o2) : o2[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { return this; }, i2); function verb(n2) { i2[n2] = o2[n2] && function(v2) { return new Promise(function(resolve, reject) { v2 = o2[n2](v2), settle(resolve, reject, v2.done, v2.value); }); }; } function settle(resolve, reject, d2, v2) { Promise.resolve(v2).then(function(v3) { resolve({ value: v3, done: d2 }); }, reject); } } function __makeTemplateObject$1(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; } function __importStar$1(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k2 in mod) if (Object.hasOwnProperty.call(mod, k2)) result[k2] = mod[k2]; } result.default = mod; return result; } function __importDefault$f(mod) { return mod && mod.__esModule ? mod : { default: mod }; } function __classPrivateFieldGet$2(receiver, privateMap) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return privateMap.get(receiver); } function __classPrivateFieldSet$2(receiver, privateMap, value) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to set private field on non-instance"); } privateMap.set(receiver, value); return value; } const tslib_es6$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, get __assign() { return __assign$1; }, __asyncDelegator: __asyncDelegator$1, __asyncGenerator: __asyncGenerator$1, __asyncValues: __asyncValues$1, __await: __await$1, __awaiter: __awaiter$1, __classPrivateFieldGet: __classPrivateFieldGet$2, __classPrivateFieldSet: __classPrivateFieldSet$2, __createBinding: __createBinding$1, __decorate: __decorate$1, __exportStar: __exportStar$1, __extends: __extends$1, __generator: __generator$1, __importDefault: __importDefault$f, __importStar: __importStar$1, __makeTemplateObject: __makeTemplateObject$1, __metadata: __metadata$1, __param: __param$1, __read: __read$1, __rest: __rest$1, __spread: __spread$1, __spreadArrays: __spreadArrays$1, __values: __values$1 }, Symbol.toStringTag, { value: "Module" })); const require$$0$4 = /* @__PURE__ */ getAugmentedNamespace(tslib_es6$2); var utils$2 = {}; var delay = {}; var hasRequiredDelay; function requireDelay() { if (hasRequiredDelay) return delay; hasRequiredDelay = 1; Object.defineProperty(delay, "__esModule", { value: true }); delay.delay = void 0; function delay$1(timeout2) { return new Promise((resolve) => { setTimeout(() => { resolve(true); }, timeout2); }); } delay.delay = delay$1; return delay; } var convert = {}; var constants$5 = {}; var misc$1 = {}; var hasRequiredMisc; function requireMisc() { if (hasRequiredMisc) return misc$1; hasRequiredMisc = 1; Object.defineProperty(misc$1, "__esModule", { value: true }); misc$1.ONE_THOUSAND = misc$1.ONE_HUNDRED = void 0; misc$1.ONE_HUNDRED = 100; misc$1.ONE_THOUSAND = 1e3; return misc$1; } var time$2 = {}; var hasRequiredTime; function requireTime() { if (hasRequiredTime) return time$2; hasRequiredTime = 1; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.ONE_YEAR = exports3.FOUR_WEEKS = exports3.THREE_WEEKS = exports3.TWO_WEEKS = exports3.ONE_WEEK = exports3.THIRTY_DAYS = exports3.SEVEN_DAYS = exports3.FIVE_DAYS = exports3.THREE_DAYS = exports3.ONE_DAY = exports3.TWENTY_FOUR_HOURS = exports3.TWELVE_HOURS = exports3.SIX_HOURS = exports3.THREE_HOURS = exports3.ONE_HOUR = exports3.SIXTY_MINUTES = exports3.THIRTY_MINUTES = exports3.TEN_MINUTES = exports3.FIVE_MINUTES = exports3.ONE_MINUTE = exports3.SIXTY_SECONDS = exports3.THIRTY_SECONDS = exports3.TEN_SECONDS = exports3.FIVE_SECONDS = exports3.ONE_SECOND = void 0; exports3.ONE_SECOND = 1; exports3.FIVE_SECONDS = 5; exports3.TEN_SECONDS = 10; exports3.THIRTY_SECONDS = 30; exports3.SIXTY_SECONDS = 60; exports3.ONE_MINUTE = exports3.SIXTY_SECONDS; exports3.FIVE_MINUTES = exports3.ONE_MINUTE * 5; exports3.TEN_MINUTES = exports3.ONE_MINUTE * 10; exports3.THIRTY_MINUTES = exports3.ONE_MINUTE * 30; exports3.SIXTY_MINUTES = exports3.ONE_MINUTE * 60; exports3.ONE_HOUR = exports3.SIXTY_MINUTES; exports3.THREE_HOURS = exports3.ONE_HOUR * 3; exports3.SIX_HOURS = exports3.ONE_HOUR * 6; exports3.TWELVE_HOURS = exports3.ONE_HOUR * 12; exports3.TWENTY_FOUR_HOURS = exports3.ONE_HOUR * 24; exports3.ONE_DAY = exports3.TWENTY_FOUR_HOURS; exports3.THREE_DAYS = exports3.ONE_DAY * 3; exports3.FIVE_DAYS = exports3.ONE_DAY * 5; exports3.SEVEN_DAYS = exports3.ONE_DAY * 7; exports3.THIRTY_DAYS = exports3.ONE_DAY * 30; exports3.ONE_WEEK = exports3.SEVEN_DAYS; exports3.TWO_WEEKS = exports3.ONE_WEEK * 2; exports3.THREE_WEEKS = exports3.ONE_WEEK * 3; exports3.FOUR_WEEKS = exports3.ONE_WEEK * 4; exports3.ONE_YEAR = exports3.ONE_DAY * 365; })(time$2); return time$2; } var hasRequiredConstants$1; function requireConstants$1() { if (hasRequiredConstants$1) return constants$5; hasRequiredConstants$1 = 1; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); const tslib_12 = require$$0$4; tslib_12.__exportStar(requireMisc(), exports3); tslib_12.__exportStar(requireTime(), exports3); })(constants$5); return constants$5; } var hasRequiredConvert; function requireConvert() { if (hasRequiredConvert) return convert; hasRequiredConvert = 1; Object.defineProperty(convert, "__esModule", { value: true }); convert.fromMiliseconds = convert.toMiliseconds = void 0; const constants_12 = requireConstants$1(); function toMiliseconds(seconds) { return seconds * constants_12.ONE_THOUSAND; } convert.toMiliseconds = toMiliseconds; function fromMiliseconds(miliseconds) { return Math.floor(miliseconds / constants_12.ONE_THOUSAND); } convert.fromMiliseconds = fromMiliseconds; return convert; } var hasRequiredUtils; function requireUtils() { if (hasRequiredUtils) return utils$2; hasRequiredUtils = 1; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); const tslib_12 = require$$0$4; tslib_12.__exportStar(requireDelay(), exports3); tslib_12.__exportStar(requireConvert(), exports3); })(utils$2); return utils$2; } var watch$2 = {}; var hasRequiredWatch$1; function requireWatch$1() { if (hasRequiredWatch$1) return watch$2; hasRequiredWatch$1 = 1; Object.defineProperty(watch$2, "__esModule", { value: true }); watch$2.Watch = void 0; class Watch { constructor() { this.timestamps = /* @__PURE__ */ new Map(); } start(label) { if (this.timestamps.has(label)) { throw new Error(`Watch already started for label: ${label}`); } this.timestamps.set(label, { started: Date.now() }); } stop(label) { const timestamp = this.get(label); if (typeof timestamp.elapsed !== "undefined") { throw new Error(`Watch already stopped for label: ${label}`); } const elapsed = Date.now() - timestamp.started; this.timestamps.set(label, { started: timestamp.started, elapsed }); } get(label) { const timestamp = this.timestamps.get(label); if (typeof timestamp === "undefined") { throw new Error(`No timestamp found for label: ${label}`); } return timestamp; } elapsed(label) { const timestamp = this.get(label); const elapsed = timestamp.elapsed || Date.now() - timestamp.started; return elapsed; } } watch$2.Watch = Watch; watch$2.default = Watch; return watch$2; } var types$1 = {}; var watch$1 = {}; var hasRequiredWatch; function requireWatch() { if (hasRequiredWatch) return watch$1; hasRequiredWatch = 1; Object.defineProperty(watch$1, "__esModule", { value: true }); watch$1.IWatch = void 0; class IWatch { } watch$1.IWatch = IWatch; return watch$1; } var hasRequiredTypes$1; function requireTypes$1() { if (hasRequiredTypes$1) return types$1; hasRequiredTypes$1 = 1; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); const tslib_12 = require$$0$4; tslib_12.__exportStar(requireWatch(), exports3); })(types$1); return types$1; } (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); const tslib_12 = require$$0$4; tslib_12.__exportStar(requireUtils(), exports3); tslib_12.__exportStar(requireWatch$1(), exports3); tslib_12.__exportStar(requireTypes$1(), exports3); tslib_12.__exportStar(requireConstants$1(), exports3); })(cjs$5); var cjs$4 = {}; Object.defineProperty(cjs$4, "__esModule", { value: true }); cjs$4.getLocalStorage = cjs$4.getLocalStorageOrThrow = cjs$4.getCrypto = cjs$4.getCryptoOrThrow = getLocation_1 = cjs$4.getLocation = cjs$4.getLocationOrThrow = getNavigator_1 = cjs$4.getNavigator = cjs$4.getNavigatorOrThrow = getDocument_1 = cjs$4.getDocument = cjs$4.getDocumentOrThrow = cjs$4.getFromWindowOrThrow = cjs$4.getFromWindow = void 0; function getFromWindow(name2) { let res = void 0; if (typeof window !== "undefined" && typeof window[name2] !== "undefined") { res = window[name2]; } return res; } cjs$4.getFromWindow = getFromWindow; function getFromWindowOrThrow(name2) { const res = getFromWindow(name2); if (!res) { throw new Error(`${name2} is not defined in Window`); } return res; } cjs$4.getFromWindowOrThrow = getFromWindowOrThrow; function getDocumentOrThrow() { return getFromWindowOrThrow("document"); } cjs$4.getDocumentOrThrow = getDocumentOrThrow; function getDocument() { return getFromWindow("document"); } var getDocument_1 = cjs$4.getDocument = getDocument; function getNavigatorOrThrow() { return getFromWindowOrThrow("navigator"); } cjs$4.getNavigatorOrThrow = getNavigatorOrThrow; function getNavigator() { return getFromWindow("navigator"); } var getNavigator_1 = cjs$4.getNavigator = getNavigator; function getLocationOrThrow() { return getFromWindowOrThrow("location"); } cjs$4.getLocationOrThrow = getLocationOrThrow; function getLocation$1() { return getFromWindow("location"); } var getLocation_1 = cjs$4.getLocation = getLocation$1; function getCryptoOrThrow() { return getFromWindowOrThrow("crypto"); } cjs$4.getCryptoOrThrow = getCryptoOrThrow; function getCrypto() { return getFromWindow("crypto"); } cjs$4.getCrypto = getCrypto; function getLocalStorageOrThrow() { return getFromWindowOrThrow("localStorage"); } cjs$4.getLocalStorageOrThrow = getLocalStorageOrThrow; function getLocalStorage() { return getFromWindow("localStorage"); } cjs$4.getLocalStorage = getLocalStorage; var cjs$3 = {}; Object.defineProperty(cjs$3, "__esModule", { value: true }); var getWindowMetadata_1 = cjs$3.getWindowMetadata = void 0; const window_getters_1 = cjs$4; function getWindowMetadata() { let doc; let loc; try { doc = window_getters_1.getDocumentOrThrow(); loc = window_getters_1.getLocationOrThrow(); } catch (e2) { return null; } function getIcons() { const links = doc.getElementsByTagName("link"); const icons2 = []; for (let i2 = 0; i2 < links.length; i2++) { const link = links[i2]; const rel = link.getAttribute("rel"); if (rel) { if (rel.toLowerCase().indexOf("icon") > -1) { const href = link.getAttribute("href"); if (href) { if (href.toLowerCase().indexOf("https:") === -1 && href.toLowerCase().indexOf("http:") === -1 && href.indexOf("//") !== 0) { let absoluteHref = loc.protocol + "//" + loc.host; if (href.indexOf("/") === 0) { absoluteHref += href; } else { const path = loc.pathname.split("/"); path.pop(); const finalPath = path.join("/"); absoluteHref += finalPath + "/" + href; } icons2.push(absoluteHref); } else if (href.indexOf("//") === 0) { const absoluteUrl = loc.protocol + href; icons2.push(absoluteUrl); } else { icons2.push(href); } } } } } return icons2; } function getWindowMetadataOfAny(...args) { const metaTags = doc.getElementsByTagName("meta"); for (let i2 = 0; i2 < metaTags.length; i2++) { const tag = metaTags[i2]; const attributes = ["itemprop", "property", "name"].map((target) => tag.getAttribute(target)).filter((attr) => { if (attr) { return args.includes(attr); } return false; }); if (attributes.length && attributes) { const content = tag.getAttribute("content"); if (content) { return content; } } } return ""; } function getName() { let name3 = getWindowMetadataOfAny("name", "og:site_name", "og:title", "twitter:title"); if (!name3) { name3 = doc.title; } return name3; } function getDescription() { const description2 = getWindowMetadataOfAny("description", "og:description", "twitter:description", "keywords"); return description2; } const name2 = getName(); const description = getDescription(); const url = loc.origin; const icons = getIcons(); const meta = { description, url, icons, name: name2 }; return meta; } getWindowMetadata_1 = cjs$3.getWindowMetadata = getWindowMetadata; var queryString = {}; var strictUriEncode = (str) => encodeURIComponent(str).replace(/[!'()*]/g, (x2) => `%${x2.charCodeAt(0).toString(16).toUpperCase()}`); var token = "%[a-f0-9]{2}"; var singleMatcher = new RegExp("(" + token + ")|([^%]+?)", "gi"); var multiMatcher = new RegExp("(" + token + ")+", "gi"); function decodeComponents(components, split2) { try { return [decodeURIComponent(components.join(""))]; } catch (err) { } if (components.length === 1) { return components; } split2 = split2 || 1; var left = components.slice(0, split2); var right = components.slice(split2); return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right)); } function decode(input) { try { return decodeURIComponent(input); } catch (err) { var tokens = input.match(singleMatcher) || []; for (var i2 = 1; i2 < tokens.length; i2++) { input = decodeComponents(tokens, i2).join(""); tokens = input.match(singleMatcher) || []; } return input; } } function customDecodeURIComponent(input) { var replaceMap = { "%FE%FF": "��", "%FF%FE": "��" }; var match = multiMatcher.exec(input); while (match) { try { replaceMap[match[0]] = decodeURIComponent(match[0]); } catch (err) { var result = decode(match[0]); if (result !== match[0]) { replaceMap[match[0]] = result; } } match = multiMatcher.exec(input); } replaceMap["%C2"] = "�"; var entries2 = Object.keys(replaceMap); for (var i2 = 0; i2 < entries2.length; i2++) { var key = entries2[i2]; input = input.replace(new RegExp(key, "g"), replaceMap[key]); } return input; } var decodeUriComponent = function(encodedURI) { if (typeof encodedURI !== "string") { throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof encodedURI + "`"); } try { encodedURI = encodedURI.replace(/\+/g, " "); return decodeURIComponent(encodedURI); } catch (err) { return customDecodeURIComponent(encodedURI); } }; var splitOnFirst = (string2, separator) => { if (!(typeof string2 === "string" && typeof separator === "string")) { throw new TypeError("Expected the arguments to be of type `string`"); } if (separator === "") { return [string2]; } const separatorIndex = string2.indexOf(separator); if (separatorIndex === -1) { return [string2]; } return [ string2.slice(0, separatorIndex), string2.slice(separatorIndex + separator.length) ]; }; var filterObj = function(obj, predicate) { var ret = {}; var keys2 = Object.keys(obj); var isArr = Array.isArray(predicate); for (var i2 = 0; i2 < keys2.length; i2++) { var key = keys2[i2]; var val = obj[key]; if (isArr ? predicate.indexOf(key) !== -1 : predicate(key, val, obj)) { ret[key] = val; } } return ret; }; (function(exports3) { const strictUriEncode$1 = strictUriEncode; const decodeComponent = decodeUriComponent; const splitOnFirst$1 = splitOnFirst; const filterObject = filterObj; const isNullOrUndefined = (value) => value === null || value === void 0; const encodeFragmentIdentifier = Symbol("encodeFragmentIdentifier"); function encoderForArrayFormat(options) { switch (options.arrayFormat) { case "index": return (key) => (result, value) => { const index2 = result.length; if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { return result; } if (value === null) { return [...result, [encode2(key, options), "[", index2, "]"].join("")]; } return [ ...result, [encode2(key, options), "[", encode2(index2, options), "]=", encode2(value, options)].join("") ]; }; case "bracket": return (key) => (result, value) => { if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { return result; } if (value === null) { return [...result, [encode2(key, options), "[]"].join("")]; } return [...result, [encode2(key, options), "[]=", encode2(value, options)].join("")]; }; case "colon-list-separator": return (key) => (result, value) => { if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { return result; } if (value === null) { return [...result, [encode2(key, options), ":list="].join("")]; } return [...result, [encode2(key, options), ":list=", encode2(value, options)].join("")]; }; case "comma": case "separator": case "bracket-separator": { const keyValueSep = options.arrayFormat === "bracket-separator" ? "[]=" : "="; return (key) => (result, value) => { if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { return result; } value = value === null ? "" : value; if (result.length === 0) { return [[encode2(key, options), keyValueSep, encode2(value, options)].join("")]; } return [[result, encode2(value, options)].join(options.arrayFormatSeparator)]; }; } default: return (key) => (result, value) => { if (value === void 0 || options.skipNull && value === null || options.skipEmptyString && value === "") { return result; } if (value === null) { return [...result, encode2(key, options)]; } return [...result, [encode2(key, options), "=", encode2(value, options)].join("")]; }; } } function parserForArrayFormat(options) { let result; switch (options.arrayFormat) { case "index": return (key, value, accumulator) => { result = /\[(\d*)\]$/.exec(key); key = key.replace(/\[\d*\]$/, ""); if (!result) { accumulator[key] = value; return; } if (accumulator[key] === void 0) { accumulator[key] = {}; } accumulator[key][result[1]] = value; }; case "bracket": return (key, value, accumulator) => { result = /(\[\])$/.exec(key); key = key.replace(/\[\]$/, ""); if (!result) { accumulator[key] = value; return; } if (accumulator[key] === void 0) { accumulator[key] = [value]; return; } accumulator[key] = [].concat(accumulator[key], value); }; case "colon-list-separator": return (key, value, accumulator) => { result = /(:list)$/.exec(key); key = key.replace(/:list$/, ""); if (!result) { accumulator[key] = value; return; } if (accumulator[key] === void 0) { accumulator[key] = [value]; return; } accumulator[key] = [].concat(accumulator[key], value); }; case "comma": case "separator": return (key, value, accumulator) => { const isArray2 = typeof value === "string" && value.includes(options.arrayFormatSeparator); const isEncodedArray = typeof value === "string" && !isArray2 && decode2(value, options).includes(options.arrayFormatSeparator); value = isEncodedArray ? decode2(value, options) : value; const newValue = isArray2 || isEncodedArray ? value.split(options.arrayFormatSeparator).map((item) => decode2(item, options)) : value === null ? value : decode2(value, options); accumulator[key] = newValue; }; case "bracket-separator": return (key, value, accumulator) => { const isArray2 = /(\[\])$/.test(key); key = key.replace(/\[\]$/, ""); if (!isArray2) { accumulator[key] = value ? decode2(value, options) : value; return; } const arrayValue = value === null ? [] : value.split(options.arrayFormatSeparator).map((item) => decode2(item, options)); if (accumulator[key] === void 0) { accumulator[key] = arrayValue; return; } accumulator[key] = [].concat(accumulator[key], arrayValue); }; default: return (key, value, accumulator) => { if (accumulator[key] === void 0) { accumulator[key] = value; return; } accumulator[key] = [].concat(accumulator[key], value); }; } } function validateArrayFormatSeparator(value) { if (typeof value !== "string" || value.length !== 1) { throw new TypeError("arrayFormatSeparator must be single character string"); } } function encode2(value, options) { if (options.encode) { return options.strict ? strictUriEncode$1(value) : encodeURIComponent(value); } return value; } function decode2(value, options) { if (options.decode) { return decodeComponent(value); } return value; } function keysSorter(input) { if (Array.isArray(input)) { return input.sort(); } if (typeof input === "object") { return keysSorter(Object.keys(input)).sort((a2, b2) => Number(a2) - Number(b2)).map((key) => input[key]); } return input; } function removeHash(input) { const hashStart = input.indexOf("#"); if (hashStart !== -1) { input = input.slice(0, hashStart); } return input; } function getHash(url) { let hash2 = ""; const hashStart = url.indexOf("#"); if (hashStart !== -1) { hash2 = url.slice(hashStart); } return hash2; } function extract2(input) { input = removeHash(input); const queryStart = input.indexOf("?"); if (queryStart === -1) { return ""; } return input.slice(queryStart + 1); } function parseValue(value, options) { if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === "string" && value.trim() !== "")) { value = Number(value); } else if (options.parseBooleans && value !== null && (value.toLowerCase() === "true" || value.toLowerCase() === "false")) { value = value.toLowerCase() === "true"; } return value; } function parse2(query2, options) { options = Object.assign({ decode: true, sort: true, arrayFormat: "none", arrayFormatSeparator: ",", parseNumbers: false, parseBooleans: false }, options); validateArrayFormatSeparator(options.arrayFormatSeparator); const formatter = parserForArrayFormat(options); const ret = /* @__PURE__ */ Object.create(null); if (typeof query2 !== "string") { return ret; } query2 = query2.trim().replace(/^[?#&]/, ""); if (!query2) { return ret; } for (const param of query2.split("&")) { if (param === "") { continue; } let [key, value] = splitOnFirst$1(options.decode ? param.replace(/\+/g, " ") : param, "="); value = value === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(options.arrayFormat) ? value : decode2(value, options); formatter(decode2(key, options), value, ret); } for (const key of Object.keys(ret)) { const value = ret[key]; if (typeof value === "object" && value !== null) { for (const k2 of Object.keys(value)) { value[k2] = parseValue(value[k2], options); } } else { ret[key] = parseValue(value, options); } } if (options.sort === false) { return ret; } return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => { const value = ret[key]; if (Boolean(value) && typeof value === "object" && !Array.isArray(value)) { result[key] = keysSorter(value); } else { result[key] = value; } return result; }, /* @__PURE__ */ Object.create(null)); } exports3.extract = extract2; exports3.parse = parse2; exports3.stringify = (object2, options) => { if (!object2) { return ""; } options = Object.assign({ encode: true, strict: true, arrayFormat: "none", arrayFormatSeparator: "," }, options); validateArrayFormatSeparator(options.arrayFormatSeparator); const shouldFilter = (key) => options.skipNull && isNullOrUndefined(object2[key]) || options.skipEmptyString && object2[key] === ""; const formatter = encoderForArrayFormat(options); const objectCopy = {}; for (const key of Object.keys(object2)) { if (!shouldFilter(key)) { objectCopy[key] = object2[key]; } } const keys2 = Object.keys(objectCopy); if (options.sort !== false) { keys2.sort(options.sort); } return keys2.map((key) => { const value = object2[key]; if (value === void 0) { return ""; } if (value === null) { return encode2(key, options); } if (Array.isArray(value)) { if (value.length === 0 && options.arrayFormat === "bracket-separator") { return encode2(key, options) + "[]"; } return value.reduce(formatter(key), []).join("&"); } return encode2(key, options) + "=" + encode2(value, options); }).filter((x2) => x2.length > 0).join("&"); }; exports3.parseUrl = (url, options) => { options = Object.assign({ decode: true }, options); const [url_, hash2] = splitOnFirst$1(url, "#"); return Object.assign( { url: url_.split("?")[0] || "", query: parse2(extract2(url), options) }, options && options.parseFragmentIdentifier && hash2 ? { fragmentIdentifier: decode2(hash2, options) } : {} ); }; exports3.stringifyUrl = (object2, options) => { options = Object.assign({ encode: true, strict: true, [encodeFragmentIdentifier]: true }, options); const url = removeHash(object2.url).split("?")[0] || ""; const queryFromUrl = exports3.extract(object2.url); const parsedQueryFromUrl = exports3.parse(queryFromUrl, { sort: false }); const query2 = Object.assign(parsedQueryFromUrl, object2.query); let queryString2 = exports3.stringify(query2, options); if (queryString2) { queryString2 = `?${queryString2}`; } let hash2 = getHash(object2.url); if (object2.fragmentIdentifier) { hash2 = `#${options[encodeFragmentIdentifier] ? encode2(object2.fragmentIdentifier, options) : object2.fragmentIdentifier}`; } return `${url}${queryString2}${hash2}`; }; exports3.pick = (input, filter, options) => { options = Object.assign({ parseFragmentIdentifier: true, [encodeFragmentIdentifier]: false }, options); const { url, query: query2, fragmentIdentifier } = exports3.parseUrl(input, options); return exports3.stringifyUrl({ url, query: filterObject(query2, filter), fragmentIdentifier }, options); }; exports3.exclude = (input, filter, options) => { const exclusionFilter = Array.isArray(filter) ? (key) => !filter.includes(key) : (key, value) => !filter(key, value); return exports3.pick(input, exclusionFilter, options); }; })(queryString); const C$5 = { 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" } }; const K$7 = ":"; function ve$1(e2) { const [n2, t2] = e2.split(K$7); return { namespace: n2, reference: t2 }; } function Un(e2, n2 = []) { const t2 = []; return Object.keys(e2).forEach((r2) => { if (n2.length && !n2.includes(r2)) return; const o2 = e2[r2]; t2.push(...o2.accounts); }), t2; } function L$6(e2, n2) { return e2.includes(":") ? [e2] : n2.chains || []; } const J$1 = "base10", p$8 = "base16", F$6 = "base64pad", H$4 = "utf8", Q$5 = 0, _$8 = 1, Dn = 0, Pe$1 = 1, Z$4 = 12, X$2 = 32; function kn() { const e2 = x25519.generateKeyPair(); return { privateKey: toString(e2.secretKey, p$8), publicKey: toString(e2.publicKey, p$8) }; } function Vn$1() { const e2 = random.randomBytes(X$2); return toString(e2, p$8); } function Mn(e2, n2) { const t2 = x25519.sharedKey(fromString(e2, p$8), fromString(n2, p$8), true), r2 = new HKDF_1(sha256$1.SHA256, t2).expand(X$2); return toString(r2, p$8); } function Kn(e2) { const n2 = sha256$1.hash(fromString(e2, p$8)); return toString(n2, p$8); } function Ln(e2) { const n2 = sha256$1.hash(fromString(e2, H$4)); return toString(n2, p$8); } function Re$1(e2) { return fromString(`${e2}`, J$1); } function $$5(e2) { return Number(toString(e2, J$1)); } function xn(e2) { const n2 = Re$1(typeof e2.type < "u" ? e2.type : Q$5); if ($$5(n2) === _$8 && typeof e2.senderPublicKey > "u") throw new Error("Missing sender public key for type 1 envelope"); const t2 = typeof e2.senderPublicKey < "u" ? fromString(e2.senderPublicKey, p$8) : void 0, r2 = typeof e2.iv < "u" ? fromString(e2.iv, p$8) : random.randomBytes(Z$4), o2 = new chacha20poly1305.ChaCha20Poly1305(fromString(e2.symKey, p$8)).seal(r2, fromString(e2.message, H$4)); return Te$1({ type: n2, sealed: o2, iv: r2, senderPublicKey: t2 }); } function Fn(e2) { const n2 = new chacha20poly1305.ChaCha20Poly1305(fromString(e2.symKey, p$8)), { sealed: t2, iv: r2 } = ee$2(e2.encoded), o2 = n2.open(r2, t2); if (o2 === null) throw new Error("Failed to decrypt"); return toString(o2, H$4); } function Te$1(e2) { if ($$5(e2.type) === _$8) { if (typeof e2.senderPublicKey > "u") throw new Error("Missing sender public key for type 1 envelope"); return toString(concat([e2.type, e2.senderPublicKey, e2.iv, e2.sealed]), F$6); } return toString(concat([e2.type, e2.iv, e2.sealed]), F$6); } function ee$2(e2) { const n2 = fromString(e2, F$6), t2 = n2.slice(Dn, Pe$1), r2 = Pe$1; if ($$5(t2) === _$8) { const d2 = r2 + X$2, l2 = d2 + Z$4, c2 = n2.slice(r2, d2), u2 = n2.slice(d2, l2), a2 = n2.slice(l2); return { type: t2, sealed: a2, iv: u2, senderPublicKey: c2 }; } const o2 = r2 + Z$4, s2 = n2.slice(r2, o2), i2 = n2.slice(o2); return { type: t2, sealed: i2, iv: s2 }; } function Hn(e2, n2) { const t2 = ee$2(e2); return Ae$1({ type: $$5(t2.type), senderPublicKey: typeof t2.senderPublicKey < "u" ? toString(t2.senderPublicKey, p$8) : void 0, receiverPublicKey: n2 == null ? void 0 : n2.receiverPublicKey }); } function Ae$1(e2) { const n2 = (e2 == null ? void 0 : e2.type) || Q$5; if (n2 === _$8) { if (typeof (e2 == null ? void 0 : e2.senderPublicKey) > "u") throw new Error("missing sender public key"); if (typeof (e2 == null ? void 0 : e2.receiverPublicKey) > "u") throw new Error("missing receiver public key"); } return { type: n2, senderPublicKey: e2 == null ? void 0 : e2.senderPublicKey, receiverPublicKey: e2 == null ? void 0 : e2.receiverPublicKey }; } function qn(e2) { return e2.type === _$8 && typeof e2.senderPublicKey == "string" && typeof e2.receiverPublicKey == "string"; } var Bn = Object.defineProperty, Ue$2 = Object.getOwnPropertySymbols, Gn = Object.prototype.hasOwnProperty, Wn = Object.prototype.propertyIsEnumerable, _e$1 = (e2, n2, t2) => n2 in e2 ? Bn(e2, n2, { enumerable: true, configurable: true, writable: true, value: t2 }) : e2[n2] = t2, Ce$1 = (e2, n2) => { for (var t2 in n2 || (n2 = {})) Gn.call(n2, t2) && _e$1(e2, t2, n2[t2]); if (Ue$2) for (var t2 of Ue$2(n2)) Wn.call(n2, t2) && _e$1(e2, t2, n2[t2]); return e2; }; const je$2 = "ReactNative", m$5 = { reactNative: "react-native", node: "node", browser: "browser", unknown: "unknown" }, De$2 = "js"; function te$3() { return typeof process < "u" && typeof process.versions < "u" && typeof process.versions.node < "u"; } function C$4() { return !getDocument_1() && !!getNavigator_1() && navigator.product === je$2; } function D$8() { return !te$3() && !!getNavigator_1() && !!getDocument_1(); } function T$7() { return C$4() ? m$5.reactNative : te$3() ? m$5.node : D$8() ? m$5.browser : m$5.unknown; } function Jn() { var e2; try { return C$4() && typeof global < "u" && typeof (global == null ? void 0 : global.Application) < "u" ? (e2 = global.Application) == null ? void 0 : e2.applicationId : void 0; } catch { return; } } function ke$2(e2, n2) { let t2 = queryString.parse(e2); return t2 = Ce$1(Ce$1({}, t2), n2), e2 = queryString.stringify(t2), e2; } function Qn() { return getWindowMetadata_1() || { name: "", description: "", url: "", icons: [""] }; } function Ve$2() { if (T$7() === m$5.reactNative && typeof global < "u" && typeof (global == null ? void 0 : global.Platform) < "u") { const { OS: t2, Version: r2 } = global.Platform; return [t2, r2].join("-"); } const e2 = detect(); if (e2 === null) return "unknown"; const n2 = e2.os ? e2.os.replace(" ", "").toLowerCase() : "unknown"; return e2.type === "browser" ? [n2, e2.name, e2.version].join("-") : [n2, e2.version].join("-"); } function Me$2() { var e2; const n2 = T$7(); return n2 === m$5.browser ? [n2, ((e2 = getLocation_1()) == null ? void 0 : e2.host) || "unknown"].join(":") : n2; } function Ke$2(e2, n2, t2) { const r2 = Ve$2(), o2 = Me$2(); return [[e2, n2].join("-"), [De$2, t2].join("-"), r2, o2].join("/"); } function Xn({ protocol: e2, version: n2, relayUrl: t2, sdkVersion: r2, auth: o2, projectId: s2, useOnCloseEvent: i2, bundleId: d2 }) { const l2 = t2.split("?"), c2 = Ke$2(e2, n2, r2), u2 = { auth: o2, ua: c2, projectId: s2, useOnCloseEvent: i2 || void 0, origin: d2 || void 0 }, a2 = ke$2(l2[1] || "", u2); return l2[0] + "?" + a2; } function O$6(e2, n2) { return e2.filter((t2) => n2.includes(t2)).length === e2.length; } function rt$2(e2) { return Object.fromEntries(e2.entries()); } function ot$2(e2) { return new Map(Object.entries(e2)); } function at$2(e2 = cjs$5.FIVE_MINUTES, n2) { const t2 = cjs$5.toMiliseconds(e2 || cjs$5.FIVE_MINUTES); let r2, o2, s2; return { resolve: (i2) => { s2 && r2 && (clearTimeout(s2), r2(i2)); }, reject: (i2) => { s2 && o2 && (clearTimeout(s2), o2(i2)); }, done: () => new Promise((i2, d2) => { s2 = setTimeout(() => { d2(new Error(n2)); }, t2), r2 = i2, o2 = d2; }) }; } function ut$2(e2, n2, t2) { return new Promise(async (r2, o2) => { const s2 = setTimeout(() => o2(new Error(t2)), n2); try { const i2 = await e2; r2(i2); } catch (i2) { o2(i2); } clearTimeout(s2); }); } function re$4(e2, n2) { if (typeof n2 == "string" && n2.startsWith(`${e2}:`)) return n2; if (e2.toLowerCase() === "topic") { if (typeof n2 != "string") throw new Error('Value must be "string" for expirer target type: topic'); return `topic:${n2}`; } else if (e2.toLowerCase() === "id") { if (typeof n2 != "number") throw new Error('Value must be "number" for expirer target type: id'); return `id:${n2}`; } throw new Error(`Unknown expirer target type: ${e2}`); } function lt$6(e2) { return re$4("topic", e2); } function dt$2(e2) { return re$4("id", e2); } function ft$5(e2) { const [n2, t2] = e2.split(":"), r2 = { id: void 0, topic: void 0 }; if (n2 === "topic" && typeof t2 == "string") r2.topic = t2; else if (n2 === "id" && Number.isInteger(Number(t2))) r2.id = Number(t2); else throw new Error(`Invalid target, expected id:number or topic:string, got ${n2}:${t2}`); return r2; } function pt$2(e2, n2) { return cjs$5.fromMiliseconds((n2 || Date.now()) + cjs$5.toMiliseconds(e2)); } function mt$2(e2) { return Date.now() >= cjs$5.toMiliseconds(e2); } function yt$2(e2, n2) { return `${e2}${n2 ? `:${n2}` : ""}`; } function S$8(e2 = [], n2 = []) { return [.../* @__PURE__ */ new Set([...e2, ...n2])]; } async function ht$2({ id: e2, topic: n2, wcDeepLink: t2 }) { try { if (!t2) return; const r2 = typeof t2 == "string" ? JSON.parse(t2) : t2; let o2 = r2 == null ? void 0 : r2.href; if (typeof o2 != "string") return; o2.endsWith("/") && (o2 = o2.slice(0, -1)); const s2 = `${o2}/wc?requestId=${e2}&sessionTopic=${n2}`, i2 = T$7(); i2 === m$5.browser ? s2.startsWith("https://") ? window.open(s2, "_blank", "noreferrer noopener") : window.open(s2, "_self", "noreferrer noopener") : i2 === m$5.reactNative && typeof (global == null ? void 0 : global.Linking) < "u" && await global.Linking.openURL(s2); } catch (r2) { console.error(r2); } } async function gt$7(e2, n2) { try { return await e2.getItem(n2) || (D$8() ? localStorage.getItem(n2) : void 0); } catch (t2) { console.error(t2); } } const He$2 = "irn"; function vt$2(e2) { return (e2 == null ? void 0 : e2.relay) || { protocol: He$2 }; } function Et$2(e2) { const n2 = C$5[e2]; if (typeof n2 > "u") throw new Error(`Relay Protocol not supported: ${e2}`); return n2; } var bt$2 = Object.defineProperty, qe$2 = Object.getOwnPropertySymbols, Nt$2 = Object.prototype.hasOwnProperty, Ot$2 = Object.prototype.propertyIsEnumerable, Be$2 = (e2, n2, t2) => n2 in e2 ? bt$2(e2, n2, { enumerable: true, configurable: true, writable: true, value: t2 }) : e2[n2] = t2, St$2 = (e2, n2) => { for (var t2 in n2 || (n2 = {})) Nt$2.call(n2, t2) && Be$2(e2, t2, n2[t2]); if (qe$2) for (var t2 of qe$2(n2)) Ot$2.call(n2, t2) && Be$2(e2, t2, n2[t2]); return e2; }; function Ge$2(e2, n2 = "-") { const t2 = {}, r2 = "relay" + n2; return Object.keys(e2).forEach((o2) => { if (o2.startsWith(r2)) { const s2 = o2.replace(r2, ""), i2 = e2[o2]; t2[s2] = i2; } }), t2; } function wt$2(e2) { e2 = e2.includes("wc://") ? e2.replace("wc://", "") : e2, e2 = e2.includes("wc:") ? e2.replace("wc:", "") : e2; const n2 = e2.indexOf(":"), t2 = e2.indexOf("?") !== -1 ? e2.indexOf("?") : void 0, r2 = e2.substring(0, n2), o2 = e2.substring(n2 + 1, t2).split("@"), s2 = typeof t2 < "u" ? e2.substring(t2) : "", i2 = queryString.parse(s2); return { protocol: r2, topic: We$2(o2[0]), version: parseInt(o2[1], 10), symKey: i2.symKey, relay: Ge$2(i2) }; } function We$2(e2) { return e2.startsWith("//") ? e2.substring(2) : e2; } function ze$1(e2, n2 = "-") { const t2 = "relay", r2 = {}; return Object.keys(e2).forEach((o2) => { const s2 = t2 + n2 + o2; e2[o2] && (r2[s2] = e2[o2]); }), r2; } function It$2(e2) { return `${e2.protocol}:${e2.topic}@${e2.version}?` + queryString.stringify(St$2({ symKey: e2.symKey }, ze$1(e2.relay))); } var Pt$2 = Object.defineProperty, Rt$2 = Object.defineProperties, Tt$2 = Object.getOwnPropertyDescriptors, Ye$2 = Object.getOwnPropertySymbols, At$2 = Object.prototype.hasOwnProperty, Ut$2 = Object.prototype.propertyIsEnumerable, Je$1 = (e2, n2, t2) => n2 in e2 ? Pt$2(e2, n2, { enumerable: true, configurable: true, writable: true, value: t2 }) : e2[n2] = t2, _t$2 = (e2, n2) => { for (var t2 in n2 || (n2 = {})) At$2.call(n2, t2) && Je$1(e2, t2, n2[t2]); if (Ye$2) for (var t2 of Ye$2(n2)) Ut$2.call(n2, t2) && Je$1(e2, t2, n2[t2]); return e2; }, Ct$3 = (e2, n2) => Rt$2(e2, Tt$2(n2)); function A$5(e2) { const n2 = []; return e2.forEach((t2) => { const [r2, o2] = t2.split(":"); n2.push(`${r2}:${o2}`); }), n2; } function Qe$2(e2) { const n2 = []; return Object.values(e2).forEach((t2) => { n2.push(...A$5(t2.accounts)); }), n2; } function Ze$1(e2, n2) { const t2 = []; return Object.values(e2).forEach((r2) => { A$5(r2.accounts).includes(n2) && t2.push(...r2.methods); }), t2; } function Xe$1(e2, n2) { const t2 = []; return Object.values(e2).forEach((r2) => { A$5(r2.accounts).includes(n2) && t2.push(...r2.events); }), t2; } function jt$2(e2, n2) { const t2 = ln(e2, n2); if (t2) throw new Error(t2.message); const r2 = {}; for (const [o2, s2] of Object.entries(e2)) r2[o2] = { methods: s2.methods, events: s2.events, chains: s2.accounts.map((i2) => `${i2.split(":")[0]}:${i2.split(":")[1]}`) }; return r2; } function oe$3(e2) { return e2.includes(":"); } function en(e2) { return oe$3(e2) ? e2.split(":")[0] : e2; } function se$2(e2) { var n2, t2, r2; const o2 = {}; if (!B$6(e2)) return o2; for (const [s2, i2] of Object.entries(e2)) { const d2 = oe$3(s2) ? [s2] : i2.chains, l2 = i2.methods || [], c2 = i2.events || [], u2 = en(s2); o2[u2] = Ct$3(_t$2({}, o2[u2]), { chains: S$8(d2, (n2 = o2[u2]) == null ? void 0 : n2.chains), methods: S$8(l2, (t2 = o2[u2]) == null ? void 0 : t2.methods), events: S$8(c2, (r2 = o2[u2]) == null ? void 0 : r2.events) }); } return o2; } const nn = { 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 } }, tn = { 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 N$5(e2, n2) { const { message: t2, code: r2 } = tn[e2]; return { message: n2 ? `${t2} ${n2}` : t2, code: r2 }; } function U$3(e2, n2) { const { message: t2, code: r2 } = nn[e2]; return { message: n2 ? `${t2} ${n2}` : t2, code: r2 }; } function k$6(e2, n2) { return Array.isArray(e2) ? typeof n2 < "u" && e2.length ? e2.every(n2) : true : false; } function B$6(e2) { return Object.getPrototypeOf(e2) === Object.prototype && Object.keys(e2).length; } function w$9(e2) { return typeof e2 > "u"; } function h$8(e2, n2) { return n2 && w$9(e2) ? true : typeof e2 == "string" && !!e2.trim().length; } function G$5(e2, n2) { return n2 && w$9(e2) ? true : typeof e2 == "number" && !isNaN(e2); } function Dt$2(e2, n2) { const { requiredNamespaces: t2 } = n2, r2 = Object.keys(e2.namespaces), o2 = Object.keys(t2); let s2 = true; return O$6(o2, r2) ? (r2.forEach((i2) => { const { accounts: d2, methods: l2, events: c2 } = e2.namespaces[i2], u2 = A$5(d2), a2 = t2[i2]; (!O$6(L$6(i2, a2), u2) || !O$6(a2.methods, l2) || !O$6(a2.events, c2)) && (s2 = false); }), s2) : false; } function V$6(e2) { return h$8(e2, false) && e2.includes(":") ? e2.split(":").length === 2 : false; } function rn(e2) { if (h$8(e2, false) && e2.includes(":")) { const n2 = e2.split(":"); if (n2.length === 3) { const t2 = n2[0] + ":" + n2[1]; return !!n2[2] && V$6(t2); } } return false; } function kt$2(e2) { if (h$8(e2, false)) try { return typeof new URL(e2) < "u"; } catch { return false; } return false; } function Vt$2(e2) { var n2; return (n2 = e2 == null ? void 0 : e2.proposer) == null ? void 0 : n2.publicKey; } function Mt$2(e2) { return e2 == null ? void 0 : e2.topic; } function Kt$2(e2, n2) { let t2 = null; return h$8(e2 == null ? void 0 : e2.publicKey, false) || (t2 = N$5("MISSING_OR_INVALID", `${n2} controller public key should be a string`)), t2; } function ie$1(e2) { let n2 = true; return k$6(e2) ? e2.length && (n2 = e2.every((t2) => h$8(t2, false))) : n2 = false, n2; } function on(e2, n2, t2) { let r2 = null; return k$6(n2) && n2.length ? n2.forEach((o2) => { r2 || V$6(o2) || (r2 = U$3("UNSUPPORTED_CHAINS", `${t2}, chain ${o2} should be a string and conform to "namespace:chainId" format`)); }) : V$6(e2) || (r2 = U$3("UNSUPPORTED_CHAINS", `${t2}, 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"] }`)), r2; } function sn(e2, n2, t2) { let r2 = null; return Object.entries(e2).forEach(([o2, s2]) => { if (r2) return; const i2 = on(o2, L$6(o2, s2), `${n2} ${t2}`); i2 && (r2 = i2); }), r2; } function cn(e2, n2) { let t2 = null; return k$6(e2) ? e2.forEach((r2) => { t2 || rn(r2) || (t2 = U$3("UNSUPPORTED_ACCOUNTS", `${n2}, account ${r2} should be a string and conform to "namespace:chainId:address" format`)); }) : t2 = U$3("UNSUPPORTED_ACCOUNTS", `${n2}, accounts should be an array of strings conforming to "namespace:chainId:address" format`), t2; } function an(e2, n2) { let t2 = null; return Object.values(e2).forEach((r2) => { if (t2) return; const o2 = cn(r2 == null ? void 0 : r2.accounts, `${n2} namespace`); o2 && (t2 = o2); }), t2; } function un(e2, n2) { let t2 = null; return ie$1(e2 == null ? void 0 : e2.methods) ? ie$1(e2 == null ? void 0 : e2.events) || (t2 = U$3("UNSUPPORTED_EVENTS", `${n2}, events should be an array of strings or empty array for no events`)) : t2 = U$3("UNSUPPORTED_METHODS", `${n2}, methods should be an array of strings or empty array for no methods`), t2; } function ce$3(e2, n2) { let t2 = null; return Object.values(e2).forEach((r2) => { if (t2) return; const o2 = un(r2, `${n2}, namespace`); o2 && (t2 = o2); }), t2; } function Lt$2(e2, n2, t2) { let r2 = null; if (e2 && B$6(e2)) { const o2 = ce$3(e2, n2); o2 && (r2 = o2); const s2 = sn(e2, n2, t2); s2 && (r2 = s2); } else r2 = N$5("MISSING_OR_INVALID", `${n2}, ${t2} should be an object with data`); return r2; } function ln(e2, n2) { let t2 = null; if (e2 && B$6(e2)) { const r2 = ce$3(e2, n2); r2 && (t2 = r2); const o2 = an(e2, n2); o2 && (t2 = o2); } else t2 = N$5("MISSING_OR_INVALID", `${n2}, namespaces should be an object with data`); return t2; } function dn(e2) { return h$8(e2.protocol, true); } function xt$2(e2, n2) { let t2 = false; return n2 && !e2 ? t2 = true : e2 && k$6(e2) && e2.length && e2.forEach((r2) => { t2 = dn(r2); }), t2; } function Ft$2(e2) { return typeof e2 == "number"; } function Ht$2(e2) { return typeof e2 < "u" && typeof e2 !== null; } function qt$2(e2) { return !(!e2 || typeof e2 != "object" || !e2.code || !G$5(e2.code, false) || !e2.message || !h$8(e2.message, false)); } function Bt$2(e2) { return !(w$9(e2) || !h$8(e2.method, false)); } function Gt$2(e2) { return !(w$9(e2) || w$9(e2.result) && w$9(e2.error) || !G$5(e2.id, false) || !h$8(e2.jsonrpc, false)); } function Wt$1(e2) { return !(w$9(e2) || !h$8(e2.name, false)); } function zt$2(e2, n2) { return !(!V$6(n2) || !Qe$2(e2).includes(n2)); } function Yt$2(e2, n2, t2) { return h$8(t2, false) ? Ze$1(e2, n2).includes(t2) : false; } function Jt$2(e2, n2, t2) { return h$8(t2, false) ? Xe$1(e2, n2).includes(t2) : false; } function fn(e2, n2, t2) { let r2 = null; const o2 = Qt$1(e2), s2 = Zt$1(n2), i2 = Object.keys(o2), d2 = Object.keys(s2), l2 = pn(Object.keys(e2)), c2 = pn(Object.keys(n2)), u2 = l2.filter((a2) => !c2.includes(a2)); return u2.length && (r2 = N$5("NON_CONFORMING_NAMESPACES", `${t2} namespaces keys don't satisfy requiredNamespaces. Required: ${u2.toString()} Received: ${Object.keys(n2).toString()}`)), O$6(i2, d2) || (r2 = N$5("NON_CONFORMING_NAMESPACES", `${t2} namespaces chains don't satisfy required namespaces. Required: ${i2.toString()} Approved: ${d2.toString()}`)), Object.keys(n2).forEach((a2) => { if (!a2.includes(":") || r2) return; const b2 = A$5(n2[a2].accounts); b2.includes(a2) || (r2 = N$5("NON_CONFORMING_NAMESPACES", `${t2} namespaces accounts don't satisfy namespace accounts for ${a2} Required: ${a2} Approved: ${b2.toString()}`)); }), i2.forEach((a2) => { r2 || (O$6(o2[a2].methods, s2[a2].methods) ? O$6(o2[a2].events, s2[a2].events) || (r2 = N$5("NON_CONFORMING_NAMESPACES", `${t2} namespaces events don't satisfy namespace events for ${a2}`)) : r2 = N$5("NON_CONFORMING_NAMESPACES", `${t2} namespaces methods don't satisfy namespace methods for ${a2}`)); }), r2; } function Qt$1(e2) { const n2 = {}; return Object.keys(e2).forEach((t2) => { var r2; t2.includes(":") ? n2[t2] = e2[t2] : (r2 = e2[t2].chains) == null || r2.forEach((o2) => { n2[o2] = { methods: e2[t2].methods, events: e2[t2].events }; }); }), n2; } function pn(e2) { return [...new Set(e2.map((n2) => n2.includes(":") ? n2.split(":")[0] : n2))]; } function Zt$1(e2) { const n2 = {}; return Object.keys(e2).forEach((t2) => { if (t2.includes(":")) n2[t2] = e2[t2]; else { const r2 = A$5(e2[t2].accounts); r2 == null ? void 0 : r2.forEach((o2) => { n2[o2] = { accounts: e2[t2].accounts.filter((s2) => s2.includes(`${o2}:`)), methods: e2[t2].methods, events: e2[t2].events }; }); } }), n2; } function Xt$1(e2, n2) { return G$5(e2, false) && e2 <= n2.max && e2 >= n2.min; } function er$2() { const e2 = T$7(); return new Promise((n2) => { switch (e2) { case m$5.browser: n2(mn()); break; case m$5.reactNative: n2(yn()); break; case m$5.node: n2(hn()); break; default: n2(true); } }); } function mn() { return D$8() && (navigator == null ? void 0 : navigator.onLine); } async function yn() { if (C$4() && typeof global < "u" && global != null && global.NetInfo) { const e2 = await (global == null ? void 0 : global.NetInfo.fetch()); return e2 == null ? void 0 : e2.isConnected; } return true; } function hn() { return true; } function nr$2(e2) { switch (T$7()) { case m$5.browser: gn(e2); break; case m$5.reactNative: vn(e2); break; } } function gn(e2) { !C$4() && D$8() && (window.addEventListener("online", () => e2(true)), window.addEventListener("offline", () => e2(false))); } function vn(e2) { C$4() && typeof global < "u" && global != null && global.NetInfo && (global == null ? void 0 : global.NetInfo.addEventListener((n2) => e2(n2 == null ? void 0 : n2.isConnected))); } const ae$2 = {}; let tr$2 = class tr { static get(n2) { return ae$2[n2]; } static set(n2, t2) { ae$2[n2] = t2; } static delete(n2) { delete ae$2[n2]; } }; var NAMESPACE = "eip155"; var STORE_KEY = "store"; var REQUESTED_CHAINS_KEY = "requestedChains"; var ADD_ETH_CHAIN_METHOD = "wallet_addEthereumChain"; var _provider, _initProviderPromise, _createProvider, createProvider_fn, _initProvider, initProvider_fn, _isChainsStale, isChainsStale_fn, _setupListeners, setupListeners_fn, _removeListeners, removeListeners_fn, _setRequestedChainsIds, setRequestedChainsIds_fn, _getRequestedChainsIds, getRequestedChainsIds_fn, _getNamespaceChainsIds, getNamespaceChainsIds_fn, _getNamespaceMethods, getNamespaceMethods_fn; var WalletConnectConnector = class extends Connector { constructor(config2) { super({ ...config2, options: { isNewChainsStale: true, ...config2.options } }); __privateAdd$1(this, _createProvider); __privateAdd$1(this, _initProvider); __privateAdd$1(this, _isChainsStale); __privateAdd$1(this, _setupListeners); __privateAdd$1(this, _removeListeners); __privateAdd$1(this, _setRequestedChainsIds); __privateAdd$1(this, _getRequestedChainsIds); __privateAdd$1(this, _getNamespaceChainsIds); __privateAdd$1(this, _getNamespaceMethods); this.id = "walletConnect"; this.name = "WalletConnect"; this.ready = true; __privateAdd$1(this, _provider, void 0); __privateAdd$1(this, _initProviderPromise, void 0); this.onAccountsChanged = (accounts) => { if (accounts.length === 0) this.emit("disconnect"); else this.emit("change", { account: getAddress(accounts[0]) }); }; this.onChainChanged = (chainId) => { const id2 = Number(chainId); const unsupported = this.isChainUnsupported(id2); this.emit("change", { chain: { id: id2, unsupported } }); }; this.onDisconnect = () => { __privateMethod$1(this, _setRequestedChainsIds, setRequestedChainsIds_fn).call(this, []); this.emit("disconnect"); }; this.onDisplayUri = (uri) => { this.emit("message", { type: "display_uri", data: uri }); }; this.onConnect = () => { this.emit("connect", {}); }; __privateMethod$1(this, _createProvider, createProvider_fn).call(this); } async connect({ chainId, pairingTopic } = {}) { var _a2, _b2, _c2, _d, _e2; try { let targetChainId = chainId; if (!targetChainId) { const store = (_a2 = this.storage) == null ? void 0 : _a2.getItem(STORE_KEY); const lastUsedChainId = (_d = (_c2 = (_b2 = store == null ? void 0 : store.state) == null ? void 0 : _b2.data) == null ? void 0 : _c2.chain) == null ? void 0 : _d.id; if (lastUsedChainId && !this.isChainUnsupported(lastUsedChainId)) targetChainId = lastUsedChainId; else targetChainId = (_e2 = this.chains[0]) == null ? void 0 : _e2.id; } if (!targetChainId) throw new Error("No chains found on connector."); const provider = await this.getProvider(); __privateMethod$1(this, _setupListeners, setupListeners_fn).call(this); const isChainsStale = __privateMethod$1(this, _isChainsStale, isChainsStale_fn).call(this); if (provider.session && isChainsStale) await provider.disconnect(); if (!provider.session || isChainsStale) { const optionalChains = this.chains.filter((chain) => chain.id !== targetChainId).map((optionalChain) => optionalChain.id); this.emit("message", { type: "connecting" }); await provider.connect({ pairingTopic, optionalChains: [targetChainId, ...optionalChains] }); __privateMethod$1(this, _setRequestedChainsIds, setRequestedChainsIds_fn).call(this, this.chains.map(({ id: id22 }) => id22)); } const accounts = await provider.enable(); const account = getAddress(accounts[0]); const id2 = await this.getChainId(); const unsupported = this.isChainUnsupported(id2); return { account, chain: { id: id2, unsupported } }; } catch (error2) { if (/user rejected/i.test(error2 == null ? void 0 : error2.message)) { throw new UserRejectedRequestError(error2); } throw error2; } } async disconnect() { const provider = await this.getProvider(); try { await provider.disconnect(); } catch (error2) { if (!/No matching key/i.test(error2.message)) throw error2; } finally { __privateMethod$1(this, _removeListeners, removeListeners_fn).call(this); __privateMethod$1(this, _setRequestedChainsIds, setRequestedChainsIds_fn).call(this, []); } } async getAccount() { const { accounts } = await this.getProvider(); return getAddress(accounts[0]); } async getChainId() { const { chainId } = await this.getProvider(); return chainId; } async getProvider({ chainId } = {}) { if (!__privateGet$1(this, _provider)) await __privateMethod$1(this, _createProvider, createProvider_fn).call(this); if (chainId) await this.switchChain(chainId); return __privateGet$1(this, _provider); } async getWalletClient({ chainId } = {}) { const [provider, account] = await Promise.all([ this.getProvider({ chainId }), this.getAccount() ]); const chain = this.chains.find((x2) => x2.id === chainId); if (!provider) throw new Error("provider is required."); return createWalletClient({ account, chain, transport: custom$1(provider) }); } async isAuthorized() { try { const [account, provider] = await Promise.all([ this.getAccount(), this.getProvider() ]); const isChainsStale = __privateMethod$1(this, _isChainsStale, isChainsStale_fn).call(this); if (!account) return false; if (isChainsStale && provider.session) { try { await provider.disconnect(); } catch { } return false; } return true; } catch { return false; } } async switchChain(chainId) { var _a2, _b2; const chain = this.chains.find((chain2) => chain2.id === chainId); if (!chain) throw new SwitchChainError(new Error("chain not found on connector.")); try { const provider = await this.getProvider(); const namespaceChains = __privateMethod$1(this, _getNamespaceChainsIds, getNamespaceChainsIds_fn).call(this); const namespaceMethods = __privateMethod$1(this, _getNamespaceMethods, getNamespaceMethods_fn).call(this); const isChainApproved = namespaceChains.includes(chainId); if (!isChainApproved && namespaceMethods.includes(ADD_ETH_CHAIN_METHOD)) { await provider.request({ method: ADD_ETH_CHAIN_METHOD, params: [ { chainId: numberToHex$1(chain.id), blockExplorerUrls: [(_b2 = (_a2 = chain.blockExplorers) == null ? void 0 : _a2.default) == null ? void 0 : _b2.url], chainName: chain.name, nativeCurrency: chain.nativeCurrency, rpcUrls: [...chain.rpcUrls.default.http] } ] }); const requestedChains = __privateMethod$1(this, _getRequestedChainsIds, getRequestedChainsIds_fn).call(this); requestedChains.push(chainId); __privateMethod$1(this, _setRequestedChainsIds, setRequestedChainsIds_fn).call(this, requestedChains); } await provider.request({ method: "wallet_switchEthereumChain", params: [{ chainId: numberToHex$1(chainId) }] }); return chain; } catch (error2) { const message = typeof error2 === "string" ? error2 : error2 == null ? void 0 : error2.message; if (/user rejected request/i.test(message)) { throw new UserRejectedRequestError(error2); } throw new SwitchChainError(error2); } } }; _provider = /* @__PURE__ */ new WeakMap(); _initProviderPromise = /* @__PURE__ */ new WeakMap(); _createProvider = /* @__PURE__ */ new WeakSet(); createProvider_fn = async function() { if (!__privateGet$1(this, _initProviderPromise) && typeof window !== "undefined") { __privateSet$1(this, _initProviderPromise, __privateMethod$1(this, _initProvider, initProvider_fn).call(this)); } return __privateGet$1(this, _initProviderPromise); }; _initProvider = /* @__PURE__ */ new WeakSet(); initProvider_fn = async function() { const { EthereumProvider } = await Promise.resolve().then(() => index_es); const optionalChains = this.chains.map(({ id: id2 }) => id2); if (optionalChains.length) { const { projectId: projectId2, showQrModal = true, qrModalOptions, metadata: metadata2, relayUrl } = this.options; __privateSet$1(this, _provider, await EthereumProvider.init({ showQrModal, qrModalOptions, projectId: projectId2, optionalChains, rpcMap: Object.fromEntries( this.chains.map((chain) => [ chain.id, chain.rpcUrls.default.http[0] ]) ), metadata: metadata2, relayUrl })); } }; _isChainsStale = /* @__PURE__ */ new WeakSet(); isChainsStale_fn = function() { const namespaceMethods = __privateMethod$1(this, _getNamespaceMethods, getNamespaceMethods_fn).call(this); if (namespaceMethods.includes(ADD_ETH_CHAIN_METHOD)) return false; if (!this.options.isNewChainsStale) return false; const requestedChains = __privateMethod$1(this, _getRequestedChainsIds, getRequestedChainsIds_fn).call(this); const connectorChains = this.chains.map(({ id: id2 }) => id2); const namespaceChains = __privateMethod$1(this, _getNamespaceChainsIds, getNamespaceChainsIds_fn).call(this); if (namespaceChains.length && !namespaceChains.some((id2) => connectorChains.includes(id2))) return false; return !connectorChains.every((id2) => requestedChains.includes(id2)); }; _setupListeners = /* @__PURE__ */ new WeakSet(); setupListeners_fn = function() { if (!__privateGet$1(this, _provider)) return; __privateMethod$1(this, _removeListeners, removeListeners_fn).call(this); __privateGet$1(this, _provider).on("accountsChanged", this.onAccountsChanged); __privateGet$1(this, _provider).on("chainChanged", this.onChainChanged); __privateGet$1(this, _provider).on("disconnect", this.onDisconnect); __privateGet$1(this, _provider).on("session_delete", this.onDisconnect); __privateGet$1(this, _provider).on("display_uri", this.onDisplayUri); __privateGet$1(this, _provider).on("connect", this.onConnect); }; _removeListeners = /* @__PURE__ */ new WeakSet(); removeListeners_fn = function() { if (!__privateGet$1(this, _provider)) return; __privateGet$1(this, _provider).removeListener("accountsChanged", this.onAccountsChanged); __privateGet$1(this, _provider).removeListener("chainChanged", this.onChainChanged); __privateGet$1(this, _provider).removeListener("disconnect", this.onDisconnect); __privateGet$1(this, _provider).removeListener("session_delete", this.onDisconnect); __privateGet$1(this, _provider).removeListener("display_uri", this.onDisplayUri); __privateGet$1(this, _provider).removeListener("connect", this.onConnect); }; _setRequestedChainsIds = /* @__PURE__ */ new WeakSet(); setRequestedChainsIds_fn = function(chains2) { var _a2; (_a2 = this.storage) == null ? void 0 : _a2.setItem(REQUESTED_CHAINS_KEY, chains2); }; _getRequestedChainsIds = /* @__PURE__ */ new WeakSet(); getRequestedChainsIds_fn = function() { var _a2; return ((_a2 = this.storage) == null ? void 0 : _a2.getItem(REQUESTED_CHAINS_KEY)) ?? []; }; _getNamespaceChainsIds = /* @__PURE__ */ new WeakSet(); getNamespaceChainsIds_fn = function() { var _a2, _b2, _c2; if (!__privateGet$1(this, _provider)) return []; const namespaces = (_a2 = __privateGet$1(this, _provider).session) == null ? void 0 : _a2.namespaces; if (!namespaces) return []; const normalizedNamespaces = se$2(namespaces); const chainIds = (_c2 = (_b2 = normalizedNamespaces[NAMESPACE]) == null ? void 0 : _b2.chains) == null ? void 0 : _c2.map( (chain) => parseInt(chain.split(":")[1] || "") ); return chainIds ?? []; }; _getNamespaceMethods = /* @__PURE__ */ new WeakSet(); getNamespaceMethods_fn = function() { var _a2, _b2; if (!__privateGet$1(this, _provider)) return []; const namespaces = (_a2 = __privateGet$1(this, _provider).session) == null ? void 0 : _a2.namespaces; if (!namespaces) return []; const normalizedNamespaces = se$2(namespaces); const methods = (_b2 = normalizedNamespaces[NAMESPACE]) == null ? void 0 : _b2.methods; return methods ?? []; }; function publicProvider() { return function(chain) { if (!chain.rpcUrls.public.http[0]) return null; return { chain, rpcUrls: chain.rpcUrls.public }; }; } const RPC_URL = CoreHelperUtil.getBlockchainApiUrl(); function walletConnectProvider({ projectId: projectId2 }) { return function provider(chain) { if (!PresetsUtil.WalletConnectRpcChainIds.includes(chain.id)) { return null; } const baseHttpUrl = `${RPC_URL}/v1/?chainId=${ConstantsUtil.EIP155}:${chain.id}&projectId=${projectId2}`; return { chain: { ...chain, rpcUrls: { ...chain.rpcUrls, default: { http: [baseHttpUrl] } } }, rpcUrls: { http: [baseHttpUrl] } }; }; } function defaultWagmiConfig({ projectId: projectId2, chains: chains2, metadata: metadata2, enableInjected, enableCoinbase, enableEIP6963, enableEmail, enableWalletConnect }) { const { publicClient } = configureChains(chains2, [ walletConnectProvider({ projectId: projectId2 }), publicProvider() ]); const connectors = []; if (enableWalletConnect !== false) { connectors.push(new WalletConnectConnector({ chains: chains2, options: { projectId: projectId2, showQrModal: false, metadata: metadata2 } })); } if (enableInjected !== false) { connectors.push(new InjectedConnector({ chains: chains2, options: { shimDisconnect: true } })); } if (enableEIP6963 !== false) { connectors.push(new EIP6963Connector({ chains: chains2 })); } if (enableCoinbase !== false) { connectors.push(new CoinbaseWalletConnector({ chains: chains2, options: { appName: (metadata2 == null ? void 0 : metadata2.name) ?? "Unknown" } })); } if (enableEmail === true) { connectors.push(new EmailConnector({ chains: chains2, options: { projectId: projectId2 } })); } return createConfig({ autoConnect: true, connectors, publicClient }); } function createWeb3Modal(options) { return new Web3Modal({ ...options, _sdkVersion: `html-wagmi-${ConstantsUtil.VERSION}` }); } const featuredWallets = [ // Featured Wallet IDs will show on the main menu. "c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96", // Metamask "4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0", // Trust Wallet "18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1", // Rabby Wallet "21030f20fba1a77115858ee3a8bc5841c739ab4537441316e2f4b1d0a8d218af", // Tangem Wallet "19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927" // Ledger Live ]; const ABI_ERC20 = [ { constant: true, inputs: [], name: "name", outputs: [ { name: "", type: "string" } ], payable: false, stateMutability: "view", type: "function" }, { constant: false, inputs: [ { name: "_spender", type: "address" }, { name: "_value", type: "uint256" } ], name: "approve", outputs: [ { name: "", type: "bool" } ], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: true, inputs: [], name: "totalSupply", outputs: [ { name: "", type: "uint256" } ], payable: false, stateMutability: "view", type: "function" }, { constant: false, inputs: [ { name: "_from", type: "address" }, { name: "_to", type: "address" }, { name: "_value", type: "uint256" } ], name: "transferFrom", outputs: [ { name: "", type: "bool" } ], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: true, inputs: [], name: "decimals", outputs: [ { name: "", type: "uint8" } ], payable: false, stateMutability: "view", type: "function" }, { constant: true, inputs: [ { name: "_owner", type: "address" } ], name: "balanceOf", outputs: [ { name: "balance", type: "uint256" } ], payable: false, stateMutability: "view", type: "function" }, { constant: true, inputs: [], name: "symbol", outputs: [ { name: "", type: "string" } ], payable: false, stateMutability: "view", type: "function" }, { constant: false, inputs: [ { name: "_to", type: "address" }, { name: "_value", type: "uint256" } ], name: "transfer", outputs: [ { name: "", type: "bool" } ], payable: false, stateMutability: "nonpayable", type: "function" }, { constant: true, inputs: [ { name: "_owner", type: "address" }, { name: "_spender", type: "address" } ], name: "allowance", outputs: [ { name: "", type: "uint256" } ], payable: false, stateMutability: "view", type: "function" }, { payable: true, stateMutability: "payable", type: "fallback" }, { anonymous: false, inputs: [ { indexed: true, name: "owner", type: "address" }, { indexed: true, name: "spender", type: "address" }, { indexed: false, name: "value", type: "uint256" } ], name: "Approval", type: "event" }, { anonymous: false, inputs: [ { indexed: true, name: "from", type: "address" }, { indexed: true, name: "to", type: "address" }, { indexed: false, name: "value", type: "uint256" } ], name: "Transfer", type: "event" } ]; const ERC20TOKEN = "0xE283D0e3B8c102BAdF5E8166B73E02D96d92F688"; const projectId = "b0cff6026f93d0adda95a835f59a957d"; const chains = [bsc]; const metadata = { name: "Elephant Money", description: `The world's first global decentralized community bank`, url: "https://elephant.money", icons: ["https://imagedelivery.net/_aTEfDRm7z3tKgu9JhfeKA/a13da339-dc30-4dae-23b4-5d32e878e800/sm"] }; const termsOfServiceLink = "https://elephant.money/terms.html"; const privacyPolicyLink = "https://elephant.money/privacy.html"; const wagmiConfig = defaultWagmiConfig({ chains, projectId, metadata }); const web3Modal = createWeb3Modal({ wagmiConfig, projectId, chains, defaultChain: bsc, featuredWalletIds: featuredWallets, termsConditionsUrl: termsOfServiceLink, privacyPolicyUrl: privacyPolicyLink }); async function wallet_init(contractInit, networkErrorHandler, connectButton) { watchAccount(async (account) => { console.log("watch account", account.status, account); if (account.status == "connected") { let network = getNetwork(); if (connectButton != null) { connectButton.innerText = "DISCONNECT"; } console.log("account address", account.address); window.ethDefaultAddress = account.address; if (network.chain.id !== network.chains[0].id) { try { network = await switchNetwork({ chainId: network.chains[0].id }); } catch (e2) { console.error(e2); await networkErrorHandler("network selection"); return; } } if (typeof account.connector != "undefined") { try { let provider = await account.connector.getProvider(); console.log("provider", provider); await provider.enable(); await provider.request({ method: "eth_requestAccounts" }); window.web3 = new Web3(provider); } catch (error2) { console.error(error2); await networkErrorHandler("user / provider issue"); return; } console.log("contract init"); await contractInit(); } else { await networkErrorHandler("provider not found"); return; } } else { if (connectButton != null) { connectButton.innerText = "CONNECT"; } } }); } async function wallet_connect(onConnect = null) { const account = getAccount(); if (account.status == "connected") { await disconnect(); if (onConnect != null) { onConnect(); } } else if (account.status == "disconnected") { try { const session = await web3Modal.open(); console.log("connected wallet", account.address, session); } catch (error2) { alert("Clear cache, cookies, and all storage to resolve WalletConnect connection issues"); } } } function getWeb3() { return window.web3; } async function wallet_init_readonly(url) { window.web3 = new Web3(new Web3.providers.HttpProvider(url)); } async function wallet_bootstrap_e2e() { try { const web3js = getWeb3(); const account = getAccount({ web3Modal }); console.log(ABI_ERC20, ERC20TOKEN); const token2 = new web3js.eth.Contract(ABI_ERC20, ERC20TOKEN, { gasPrice: 3e9 }); const myBalance = await token2.methods.balanceOf(account.address).call(); console.log("bootstrap", "token balance", ERC20TOKEN, myBalance); } catch (error2) { console.error(error2); } } async function wallet_network_handler_e2e(msg, error2) { alert(`${msg}, ${error2 != null ? error2.toString() : ""}`); } var COMPRESSED$1 = "AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI"; const FENCED = /* @__PURE__ */ new Map([[8217, "apostrophe"], [8260, "fraction slash"], [12539, "middle dot"]]); const NSM_MAX = 4; function decode_arithmetic(bytes2) { let pos = 0; function u16() { return bytes2[pos++] << 8 | bytes2[pos++]; } let symbol_count = u16(); let total = 1; let acc = [0, 1]; for (let i2 = 1; i2 < symbol_count; i2++) { acc.push(total += u16()); } let skip = u16(); let pos_payload = pos; pos += skip; let read_width = 0; let read_buffer = 0; function read_bit() { if (read_width == 0) { read_buffer = read_buffer << 8 | bytes2[pos++]; read_width = 8; } return read_buffer >> --read_width & 1; } const N2 = 31; const FULL = 2 ** N2; const HALF = FULL >>> 1; const QRTR = HALF >> 1; const MASK = FULL - 1; let register = 0; for (let i2 = 0; i2 < N2; i2++) register = register << 1 | read_bit(); let symbols = []; let low = 0; let range2 = FULL; while (true) { let value = Math.floor(((register - low + 1) * total - 1) / range2); let start = 0; let end = symbol_count; while (end - start > 1) { let mid = start + end >>> 1; if (value < acc[mid]) { end = mid; } else { start = mid; } } if (start == 0) break; symbols.push(start); let a2 = low + Math.floor(range2 * acc[start] / total); let b2 = low + Math.floor(range2 * acc[start + 1] / total) - 1; while (((a2 ^ b2) & HALF) == 0) { register = register << 1 & MASK | read_bit(); a2 = a2 << 1 & MASK; b2 = b2 << 1 & MASK | 1; } while (a2 & ~b2 & QRTR) { register = register & HALF | register << 1 & MASK >>> 1 | read_bit(); a2 = a2 << 1 ^ HALF; b2 = (b2 ^ HALF) << 1 | HALF | 1; } low = a2; range2 = 1 + b2 - a2; } let offset = symbol_count - 4; return symbols.map((x2) => { switch (x2 - offset) { case 3: return offset + 65792 + (bytes2[pos_payload++] << 16 | bytes2[pos_payload++] << 8 | bytes2[pos_payload++]); case 2: return offset + 256 + (bytes2[pos_payload++] << 8 | bytes2[pos_payload++]); case 1: return offset + bytes2[pos_payload++]; default: return x2 - 1; } }); } function read_payload(v2) { let pos = 0; return () => v2[pos++]; } function read_compressed_payload(s2) { return read_payload(decode_arithmetic(unsafe_atob(s2))); } function unsafe_atob(s2) { let lookup2 = []; [..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((c2, i2) => lookup2[c2.charCodeAt(0)] = i2); let n2 = s2.length; let ret = new Uint8Array(6 * n2 >> 3); for (let i2 = 0, pos = 0, width = 0, carry = 0; i2 < n2; i2++) { carry = carry << 6 | lookup2[s2.charCodeAt(i2)]; width += 6; if (width >= 8) { ret[pos++] = carry >> (width -= 8); } } return ret; } function signed(i2) { return i2 & 1 ? ~i2 >> 1 : i2 >> 1; } function read_deltas(n2, next) { let v2 = Array(n2); for (let i2 = 0, x2 = 0; i2 < n2; i2++) v2[i2] = x2 += signed(next()); return v2; } function read_sorted(next, prev = 0) { let ret = []; while (true) { let x2 = next(); let n2 = next(); if (!n2) break; prev += x2; for (let i2 = 0; i2 < n2; i2++) { ret.push(prev + i2); } prev += n2 + 1; } return ret; } function read_sorted_arrays(next) { return read_array_while(() => { let v2 = read_sorted(next); if (v2.length) return v2; }); } function read_mapped(next) { let ret = []; while (true) { let w2 = next(); if (w2 == 0) break; ret.push(read_linear_table(w2, next)); } while (true) { let w2 = next() - 1; if (w2 < 0) break; ret.push(read_replacement_table(w2, next)); } return ret.flat(); } function read_array_while(next) { let v2 = []; while (true) { let x2 = next(v2.length); if (!x2) break; v2.push(x2); } return v2; } function read_transposed(n2, w2, next) { let m2 = Array(n2).fill().map(() => []); for (let i2 = 0; i2 < w2; i2++) { read_deltas(n2, next).forEach((x2, j2) => m2[j2].push(x2)); } return m2; } function read_linear_table(w2, next) { let dx = 1 + next(); let dy = next(); let vN = read_array_while(next); let m2 = read_transposed(vN.length, 1 + w2, next); return m2.flatMap((v2, i2) => { let [x2, ...ys2] = v2; return Array(vN[i2]).fill().map((_2, j2) => { let j_dy = j2 * dy; return [x2 + j2 * dx, ys2.map((y2) => y2 + j_dy)]; }); }); } function read_replacement_table(w2, next) { let n2 = 1 + next(); let m2 = read_transposed(n2, 1 + w2, next); return m2.map((v2) => [v2[0], v2.slice(1)]); } function read_trie(next) { let ret = []; let sorted = read_sorted(next); expand(decode2([]), []); return ret; function decode2(Q2) { let S2 = next(); let B2 = read_array_while(() => { let cps = read_sorted(next).map((i2) => sorted[i2]); if (cps.length) return decode2(cps); }); return { S: S2, B: B2, Q: Q2 }; } function expand({ S: S2, B: B2 }, cps, saved) { if (S2 & 4 && saved === cps[cps.length - 1]) return; if (S2 & 2) saved = cps[cps.length - 1]; if (S2 & 1) ret.push(cps); for (let br of B2) { for (let cp of br.Q) { expand(br, [...cps, cp], saved); } } } } function hex_cp(cp) { return cp.toString(16).toUpperCase().padStart(2, "0"); } function quote_cp(cp) { return `{${hex_cp(cp)}}`; } function explode_cp(s2) { let cps = []; for (let pos = 0, len2 = s2.length; pos < len2; ) { let cp = s2.codePointAt(pos); pos += cp < 65536 ? 1 : 2; cps.push(cp); } return cps; } function str_from_cps(cps) { const chunk = 4096; let len2 = cps.length; if (len2 < chunk) return String.fromCodePoint(...cps); let buf = []; for (let i2 = 0; i2 < len2; ) { buf.push(String.fromCodePoint(...cps.slice(i2, i2 += chunk))); } return buf.join(""); } function compare_arrays(a2, b2) { let n2 = a2.length; let c2 = n2 - b2.length; for (let i2 = 0; c2 == 0 && i2 < n2; i2++) c2 = a2[i2] - b2[i2]; return c2; } var COMPRESSED = "AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g"; const S0 = 44032; const L0 = 4352; const V0 = 4449; const T0 = 4519; const L_COUNT = 19; const V_COUNT = 21; const T_COUNT = 28; const N_COUNT = V_COUNT * T_COUNT; const S_COUNT = L_COUNT * N_COUNT; const S1 = S0 + S_COUNT; const L1 = L0 + L_COUNT; const V1 = V0 + V_COUNT; const T1 = T0 + T_COUNT; function unpack_cc(packed) { return packed >> 24 & 255; } function unpack_cp(packed) { return packed & 16777215; } let SHIFTED_RANK, EXCLUSIONS, DECOMP, RECOMP; function init$1() { let r2 = read_compressed_payload(COMPRESSED); SHIFTED_RANK = new Map(read_sorted_arrays(r2).flatMap((v2, i2) => v2.map((x2) => [x2, i2 + 1 << 24]))); EXCLUSIONS = new Set(read_sorted(r2)); DECOMP = /* @__PURE__ */ new Map(); RECOMP = /* @__PURE__ */ new Map(); for (let [cp, cps] of read_mapped(r2)) { if (!EXCLUSIONS.has(cp) && cps.length == 2) { let [a2, b2] = cps; let bucket = RECOMP.get(a2); if (!bucket) { bucket = /* @__PURE__ */ new Map(); RECOMP.set(a2, bucket); } bucket.set(b2, cp); } DECOMP.set(cp, cps.reverse()); } } function is_hangul(cp) { return cp >= S0 && cp < S1; } function compose_pair(a2, b2) { if (a2 >= L0 && a2 < L1 && b2 >= V0 && b2 < V1) { return S0 + (a2 - L0) * N_COUNT + (b2 - V0) * T_COUNT; } else if (is_hangul(a2) && b2 > T0 && b2 < T1 && (a2 - S0) % T_COUNT == 0) { return a2 + (b2 - T0); } else { let recomp = RECOMP.get(a2); if (recomp) { recomp = recomp.get(b2); if (recomp) { return recomp; } } return -1; } } function decomposed(cps) { if (!SHIFTED_RANK) init$1(); let ret = []; let buf = []; let check_order = false; function add(cp) { let cc = SHIFTED_RANK.get(cp); if (cc) { check_order = true; cp |= cc; } ret.push(cp); } for (let cp of cps) { while (true) { if (cp < 128) { ret.push(cp); } else if (is_hangul(cp)) { let s_index = cp - S0; let l_index = s_index / N_COUNT | 0; let v_index = s_index % N_COUNT / T_COUNT | 0; let t_index = s_index % T_COUNT; add(L0 + l_index); add(V0 + v_index); if (t_index > 0) add(T0 + t_index); } else { let mapped = DECOMP.get(cp); if (mapped) { buf.push(...mapped); } else { add(cp); } } if (!buf.length) break; cp = buf.pop(); } } if (check_order && ret.length > 1) { let prev_cc = unpack_cc(ret[0]); for (let i2 = 1; i2 < ret.length; i2++) { let cc = unpack_cc(ret[i2]); if (cc == 0 || prev_cc <= cc) { prev_cc = cc; continue; } let j2 = i2 - 1; while (true) { let tmp = ret[j2 + 1]; ret[j2 + 1] = ret[j2]; ret[j2] = tmp; if (!j2) break; prev_cc = unpack_cc(ret[--j2]); if (prev_cc <= cc) break; } prev_cc = unpack_cc(ret[i2]); } } return ret; } function composed_from_decomposed(v2) { let ret = []; let stack = []; let prev_cp = -1; let prev_cc = 0; for (let packed of v2) { let cc = unpack_cc(packed); let cp = unpack_cp(packed); if (prev_cp == -1) { if (cc == 0) { prev_cp = cp; } else { ret.push(cp); } } else if (prev_cc > 0 && prev_cc >= cc) { if (cc == 0) { ret.push(prev_cp, ...stack); stack.length = 0; prev_cp = cp; } else { stack.push(cp); } prev_cc = cc; } else { let composed = compose_pair(prev_cp, cp); if (composed >= 0) { prev_cp = composed; } else if (prev_cc == 0 && cc == 0) { ret.push(prev_cp); prev_cp = cp; } else { stack.push(cp); prev_cc = cc; } } } if (prev_cp >= 0) { ret.push(prev_cp, ...stack); } return ret; } function nfd(cps) { return decomposed(cps).map(unpack_cp); } function nfc(cps) { return composed_from_decomposed(decomposed(cps)); } const HYPHEN = 45; const STOP_CH = "."; const FE0F = 65039; const UNIQUE_PH = 1; const Array_from = (x2) => Array.from(x2); function group_has_cp(g2, cp) { return g2.P.has(cp) || g2.Q.has(cp); } class Emoji extends Array { get is_emoji() { return true; } // free tagging system } let MAPPED, IGNORED, CM, NSM, ESCAPE, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT; function init() { if (MAPPED) return; let r2 = read_compressed_payload(COMPRESSED$1); const read_sorted_array = () => read_sorted(r2); const read_sorted_set = () => new Set(read_sorted_array()); MAPPED = new Map(read_mapped(r2)); IGNORED = read_sorted_set(); CM = read_sorted_array(); NSM = new Set(read_sorted_array().map((i2) => CM[i2])); CM = new Set(CM); ESCAPE = read_sorted_set(); read_sorted_set(); let chunks = read_sorted_arrays(r2); let unrestricted = r2(); const read_chunked = () => new Set(read_sorted_array().flatMap((i2) => chunks[i2]).concat(read_sorted_array())); GROUPS = read_array_while((i2) => { let N2 = read_array_while(r2).map((x2) => x2 + 96); if (N2.length) { let R2 = i2 >= unrestricted; N2[0] -= 32; N2 = str_from_cps(N2); if (R2) N2 = `Restricted[${N2}]`; let P2 = read_chunked(); let Q2 = read_chunked(); let M2 = !r2(); return { N: N2, P: P2, Q: Q2, M: M2, R: R2 }; } }); WHOLE_VALID = read_sorted_set(); WHOLE_MAP = /* @__PURE__ */ new Map(); let wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a2, b2) => a2 - b2); wholes.forEach((cp, i2) => { let d2 = r2(); let w2 = wholes[i2] = d2 ? wholes[i2 - d2] : { V: [], M: /* @__PURE__ */ new Map() }; w2.V.push(cp); if (!WHOLE_VALID.has(cp)) { WHOLE_MAP.set(cp, w2); } }); for (let { V: V2, M: M2 } of new Set(WHOLE_MAP.values())) { let recs = []; for (let cp of V2) { let gs2 = GROUPS.filter((g2) => group_has_cp(g2, cp)); let rec = recs.find(({ G: G2 }) => gs2.some((g2) => G2.has(g2))); if (!rec) { rec = { G: /* @__PURE__ */ new Set(), V: [] }; recs.push(rec); } rec.V.push(cp); gs2.forEach((g2) => rec.G.add(g2)); } let union3 = recs.flatMap((x2) => Array_from(x2.G)); for (let { G: G2, V: V3 } of recs) { let complement = new Set(union3.filter((g2) => !G2.has(g2))); for (let cp of V3) { M2.set(cp, complement); } } } let union2 = /* @__PURE__ */ new Set(); let multi = /* @__PURE__ */ new Set(); const add_to_union = (cp) => union2.has(cp) ? multi.add(cp) : union2.add(cp); for (let g2 of GROUPS) { for (let cp of g2.P) add_to_union(cp); for (let cp of g2.Q) add_to_union(cp); } for (let cp of union2) { if (!WHOLE_MAP.has(cp) && !multi.has(cp)) { WHOLE_MAP.set(cp, UNIQUE_PH); } } VALID = new Set(Array_from(union2).concat(Array_from(nfd(union2)))); EMOJI_LIST = read_trie(r2).map((v2) => Emoji.from(v2)).sort(compare_arrays); EMOJI_ROOT = /* @__PURE__ */ new Map(); for (let cps of EMOJI_LIST) { let prev = [EMOJI_ROOT]; for (let cp of cps) { let next = prev.map((node2) => { let child = node2.get(cp); if (!child) { child = /* @__PURE__ */ new Map(); node2.set(cp, child); } return child; }); if (cp === FE0F) { prev.push(...next); } else { prev = next; } } for (let x2 of prev) { x2.V = cps; } } } function quoted_cp(cp) { return (should_escape(cp) ? "" : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp); } function bidi_qq(s2) { return `"${s2}"‎`; } function check_label_extension(cps) { if (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) { throw new Error(`invalid label extension: "${str_from_cps(cps.slice(0, 4))}"`); } } function check_leading_underscore(cps) { const UNDERSCORE = 95; for (let i2 = cps.lastIndexOf(UNDERSCORE); i2 > 0; ) { if (cps[--i2] !== UNDERSCORE) { throw new Error("underscore allowed only at start"); } } } function check_fenced(cps) { let cp = cps[0]; let prev = FENCED.get(cp); if (prev) throw error_placement(`leading ${prev}`); let n2 = cps.length; let last = -1; for (let i2 = 1; i2 < n2; i2++) { cp = cps[i2]; let match = FENCED.get(cp); if (match) { if (last == i2) throw error_placement(`${prev} + ${match}`); last = i2 + 1; prev = match; } } if (last == n2) throw error_placement(`trailing ${prev}`); } function safe_str_from_cps(cps, quoter = quote_cp) { let buf = []; if (is_combining_mark(cps[0])) buf.push("◌"); let prev = 0; let n2 = cps.length; for (let i2 = 0; i2 < n2; i2++) { let cp = cps[i2]; if (should_escape(cp)) { buf.push(str_from_cps(cps.slice(prev, i2))); buf.push(quoter(cp)); prev = i2 + 1; } } buf.push(str_from_cps(cps.slice(prev, n2))); return buf.join(""); } function is_combining_mark(cp) { init(); return CM.has(cp); } function should_escape(cp) { init(); return ESCAPE.has(cp); } function ens_normalize(name2) { return flatten(split(name2, nfc, filter_fe0f)); } function split(name2, nf, ef) { if (!name2) return []; init(); let offset = 0; return name2.split(STOP_CH).map((label) => { let input = explode_cp(label); let info = { input, offset // codepoint, not substring! }; offset += input.length + 1; try { let tokens = info.tokens = tokens_from_str(input, nf, ef); let token_count = tokens.length; let type2; if (!token_count) { throw new Error(`empty label`); } let norm = info.output = tokens.flat(); check_leading_underscore(norm); let emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; if (!emoji && norm.every((cp) => cp < 128)) { check_label_extension(norm); type2 = "ASCII"; } else { let chars = tokens.flatMap((x2) => x2.is_emoji ? [] : x2); if (!chars.length) { type2 = "Emoji"; } else { if (CM.has(norm[0])) throw error_placement("leading combining mark"); for (let i2 = 1; i2 < token_count; i2++) { let cps = tokens[i2]; if (!cps.is_emoji && CM.has(cps[0])) { throw error_placement(`emoji + combining mark: "${str_from_cps(tokens[i2 - 1])} + ${safe_str_from_cps([cps[0]])}"`); } } check_fenced(norm); let unique = Array_from(new Set(chars)); let [g2] = determine_group(unique); check_group(g2, chars); check_whole(g2, unique); type2 = g2.N; } } info.type = type2; } catch (err) { info.error = err; } return info; }); } function check_whole(group, unique) { let maker; let shared = []; for (let cp of unique) { let whole = WHOLE_MAP.get(cp); if (whole === UNIQUE_PH) return; if (whole) { let set2 = whole.M.get(cp); maker = maker ? maker.filter((g2) => set2.has(g2)) : Array_from(set2); if (!maker.length) return; } else { shared.push(cp); } } if (maker) { for (let g2 of maker) { if (shared.every((cp) => group_has_cp(g2, cp))) { throw new Error(`whole-script confusable: ${group.N}/${g2.N}`); } } } } function determine_group(unique) { let groups = GROUPS; for (let cp of unique) { let gs2 = groups.filter((g2) => group_has_cp(g2, cp)); if (!gs2.length) { if (!GROUPS.some((g2) => group_has_cp(g2, cp))) { throw error_disallowed(cp); } else { throw error_group_member(groups[0], cp); } } groups = gs2; if (gs2.length == 1) break; } return groups; } function flatten(split2) { return split2.map(({ input, error: error2, output: output2 }) => { if (error2) { let msg = error2.message; throw new Error(split2.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input))}: ${msg}`); } return str_from_cps(output2); }).join(STOP_CH); } function error_disallowed(cp) { return new Error(`disallowed character: ${quoted_cp(cp)}`); } function error_group_member(g2, cp) { let quoted = quoted_cp(cp); let gg = GROUPS.find((g3) => g3.P.has(cp)); if (gg) { quoted = `${gg.N} ${quoted}`; } return new Error(`illegal mixture: ${g2.N} + ${quoted}`); } function error_placement(where) { return new Error(`illegal placement: ${where}`); } function check_group(g2, cps) { for (let cp of cps) { if (!group_has_cp(g2, cp)) { throw error_group_member(g2, cp); } } if (g2.M) { let decomposed2 = nfd(cps); for (let i2 = 1, e2 = decomposed2.length; i2 < e2; i2++) { if (NSM.has(decomposed2[i2])) { let j2 = i2 + 1; for (let cp; j2 < e2 && NSM.has(cp = decomposed2[j2]); j2++) { for (let k2 = i2; k2 < j2; k2++) { if (decomposed2[k2] == cp) { throw new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`); } } } if (j2 - i2 > NSM_MAX) { throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed2.slice(i2 - 1, j2)))} (${j2 - i2}/${NSM_MAX})`); } i2 = j2; } } } } function tokens_from_str(input, nf, ef) { let ret = []; let chars = []; input = input.slice().reverse(); while (input.length) { let emoji = consume_emoji_reversed(input); if (emoji) { if (chars.length) { ret.push(nf(chars)); chars = []; } ret.push(ef(emoji)); } else { let cp = input.pop(); if (VALID.has(cp)) { chars.push(cp); } else { let cps = MAPPED.get(cp); if (cps) { chars.push(...cps); } else if (!IGNORED.has(cp)) { throw error_disallowed(cp); } } } } if (chars.length) { ret.push(nf(chars)); } return ret; } function filter_fe0f(cps) { return cps.filter((cp) => cp != FE0F); } function consume_emoji_reversed(cps, eaten) { let node2 = EMOJI_ROOT; let emoji; let pos = cps.length; while (pos) { node2 = node2.get(cps[--pos]); if (!node2) break; let { V: V2 } = node2; if (V2) { emoji = V2; if (eaten) eaten.push(...cps.slice(pos).reverse()); cps.length = pos; } } return emoji; } function normalize(name2) { return ens_normalize(name2); } const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, getEnsAddress, getEnsAvatar, getEnsName, getEnsResolver, getEnsText, labelhash, namehash, normalize }, Symbol.toStringTag, { value: "Module" })); var dist$5 = {}; var CoinbaseWalletSDK$1 = {}; var walletLogo$1 = {}; Object.defineProperty(walletLogo$1, "__esModule", { value: true }); walletLogo$1.walletLogo = void 0; const walletLogo = (type2, width) => { let height; switch (type2) { case "standard": height = width; return `data:image/svg+xml,%3Csvg width='${width}' height='${height}' 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": height = width; return `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${width}' height='${height}' 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": height = (0.1 * width).toFixed(2); return `data:image/svg+xml,%3Csvg width='${width}' height='${height}' 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": height = (0.25 * width).toFixed(2); return `data:image/svg+xml,%3Csvg width='${width}' height='${height}' 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": height = (0.1 * width).toFixed(2); return `data:image/svg+xml,%3Csvg width='${width}' height='${height}' 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": height = (0.25 * width).toFixed(2); return `data:image/svg+xml,%3Csvg width='${width}' height='${height}' 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: height = width; return `data:image/svg+xml,%3Csvg width='${width}' height='${height}' 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 `; } }; walletLogo$1.walletLogo = walletLogo; var constants$4 = {}; Object.defineProperty(constants$4, "__esModule", { value: true }); constants$4.LINK_API_URL = void 0; constants$4.LINK_API_URL = "https://www.walletlink.org"; var util$3 = {}; var bn = { exports: {} }; bn.exports; (function(module2) { (function(module3, exports3) { function assert2(val, msg) { if (!val) throw new Error(msg || "Assertion failed"); } function inherits2(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function() { }; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; } function BN2(number2, base3, endian) { if (BN2.isBN(number2)) { return number2; } this.negative = 0; this.words = null; this.length = 0; this.red = null; if (number2 !== null) { if (base3 === "le" || base3 === "be") { endian = base3; base3 = 10; } this._init(number2 || 0, base3 || 10, endian || "be"); } } if (typeof module3 === "object") { module3.exports = BN2; } else { exports3.BN = BN2; } BN2.BN = BN2; BN2.wordSize = 26; var Buffer2; try { if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { Buffer2 = window.Buffer; } else { Buffer2 = require$$3.Buffer; } } catch (e2) { } BN2.isBN = function isBN(num) { if (num instanceof BN2) { return true; } return num !== null && typeof num === "object" && num.constructor.wordSize === BN2.wordSize && Array.isArray(num.words); }; BN2.max = function max2(left, right) { if (left.cmp(right) > 0) return left; return right; }; BN2.min = function min2(left, right) { if (left.cmp(right) < 0) return left; return right; }; BN2.prototype._init = function init2(number2, base3, endian) { if (typeof number2 === "number") { return this._initNumber(number2, base3, endian); } if (typeof number2 === "object") { return this._initArray(number2, base3, endian); } if (base3 === "hex") { base3 = 16; } assert2(base3 === (base3 | 0) && base3 >= 2 && base3 <= 36); number2 = number2.toString().replace(/\s+/g, ""); var start = 0; if (number2[0] === "-") { start++; this.negative = 1; } if (start < number2.length) { if (base3 === 16) { this._parseHex(number2, start, endian); } else { this._parseBase(number2, base3, start); if (endian === "le") { this._initArray(this.toArray(), base3, endian); } } } }; BN2.prototype._initNumber = function _initNumber(number2, base3, endian) { if (number2 < 0) { this.negative = 1; number2 = -number2; } if (number2 < 67108864) { this.words = [number2 & 67108863]; this.length = 1; } else if (number2 < 4503599627370496) { this.words = [ number2 & 67108863, number2 / 67108864 & 67108863 ]; this.length = 2; } else { assert2(number2 < 9007199254740992); this.words = [ number2 & 67108863, number2 / 67108864 & 67108863, 1 ]; this.length = 3; } if (endian !== "le") return; this._initArray(this.toArray(), base3, endian); }; BN2.prototype._initArray = function _initArray(number2, base3, endian) { assert2(typeof number2.length === "number"); if (number2.length <= 0) { this.words = [0]; this.length = 1; return this; } this.length = Math.ceil(number2.length / 3); this.words = new Array(this.length); for (var i2 = 0; i2 < this.length; i2++) { this.words[i2] = 0; } var j2, w2; var off = 0; if (endian === "be") { for (i2 = number2.length - 1, j2 = 0; i2 >= 0; i2 -= 3) { w2 = number2[i2] | number2[i2 - 1] << 8 | number2[i2 - 2] << 16; this.words[j2] |= w2 << off & 67108863; this.words[j2 + 1] = w2 >>> 26 - off & 67108863; off += 24; if (off >= 26) { off -= 26; j2++; } } } else if (endian === "le") { for (i2 = 0, j2 = 0; i2 < number2.length; i2 += 3) { w2 = number2[i2] | number2[i2 + 1] << 8 | number2[i2 + 2] << 16; this.words[j2] |= w2 << off & 67108863; this.words[j2 + 1] = w2 >>> 26 - off & 67108863; off += 24; if (off >= 26) { off -= 26; j2++; } } } return this._strip(); }; function parseHex4Bits(string2, index2) { var c2 = string2.charCodeAt(index2); if (c2 >= 48 && c2 <= 57) { return c2 - 48; } else if (c2 >= 65 && c2 <= 70) { return c2 - 55; } else if (c2 >= 97 && c2 <= 102) { return c2 - 87; } else { assert2(false, "Invalid character in " + string2); } } function parseHexByte(string2, lowerBound, index2) { var r2 = parseHex4Bits(string2, index2); if (index2 - 1 >= lowerBound) { r2 |= parseHex4Bits(string2, index2 - 1) << 4; } return r2; } BN2.prototype._parseHex = function _parseHex(number2, start, endian) { this.length = Math.ceil((number2.length - start) / 6); this.words = new Array(this.length); for (var i2 = 0; i2 < this.length; i2++) { this.words[i2] = 0; } var off = 0; var j2 = 0; var w2; if (endian === "be") { for (i2 = number2.length - 1; i2 >= start; i2 -= 2) { w2 = parseHexByte(number2, start, i2) << off; this.words[j2] |= w2 & 67108863; if (off >= 18) { off -= 18; j2 += 1; this.words[j2] |= w2 >>> 26; } else { off += 8; } } } else { var parseLength = number2.length - start; for (i2 = parseLength % 2 === 0 ? start + 1 : start; i2 < number2.length; i2 += 2) { w2 = parseHexByte(number2, start, i2) << off; this.words[j2] |= w2 & 67108863; if (off >= 18) { off -= 18; j2 += 1; this.words[j2] |= w2 >>> 26; } else { off += 8; } } } this._strip(); }; function parseBase(str, start, end, mul) { var r2 = 0; var b2 = 0; var len2 = Math.min(str.length, end); for (var i2 = start; i2 < len2; i2++) { var c2 = str.charCodeAt(i2) - 48; r2 *= mul; if (c2 >= 49) { b2 = c2 - 49 + 10; } else if (c2 >= 17) { b2 = c2 - 17 + 10; } else { b2 = c2; } assert2(c2 >= 0 && b2 < mul, "Invalid character"); r2 += b2; } return r2; } BN2.prototype._parseBase = function _parseBase(number2, base3, start) { this.words = [0]; this.length = 1; for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base3) { limbLen++; } limbLen--; limbPow = limbPow / base3 | 0; var total = number2.length - start; var mod = total % limbLen; var end = Math.min(total, total - mod) + start; var word = 0; for (var i2 = start; i2 < end; i2 += limbLen) { word = parseBase(number2, i2, i2 + limbLen, base3); this.imuln(limbPow); if (this.words[0] + word < 67108864) { this.words[0] += word; } else { this._iaddn(word); } } if (mod !== 0) { var pow = 1; word = parseBase(number2, i2, number2.length, base3); for (i2 = 0; i2 < mod; i2++) { pow *= base3; } this.imuln(pow); if (this.words[0] + word < 67108864) { this.words[0] += word; } else { this._iaddn(word); } } this._strip(); }; BN2.prototype.copy = function copy(dest) { dest.words = new Array(this.length); for (var i2 = 0; i2 < this.length; i2++) { dest.words[i2] = this.words[i2]; } dest.length = this.length; dest.negative = this.negative; dest.red = this.red; }; function move(dest, src2) { dest.words = src2.words; dest.length = src2.length; dest.negative = src2.negative; dest.red = src2.red; } BN2.prototype._move = function _move(dest) { move(dest, this); }; BN2.prototype.clone = function clone() { var r2 = new BN2(null); this.copy(r2); return r2; }; BN2.prototype._expand = function _expand(size2) { while (this.length < size2) { this.words[this.length++] = 0; } return this; }; BN2.prototype._strip = function strip() { while (this.length > 1 && this.words[this.length - 1] === 0) { this.length--; } return this._normSign(); }; BN2.prototype._normSign = function _normSign() { if (this.length === 1 && this.words[0] === 0) { this.negative = 0; } return this; }; if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") { try { BN2.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect; } catch (e2) { BN2.prototype.inspect = inspect; } } else { BN2.prototype.inspect = inspect; } function inspect() { return (this.red ? ""; } var zeros2 = [ "", "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" ]; var groupSizes = [ 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 ]; var groupBases = [ 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 ]; BN2.prototype.toString = function toString2(base3, padding) { base3 = base3 || 10; padding = padding | 0 || 1; var out; if (base3 === 16 || base3 === "hex") { out = ""; var off = 0; var carry = 0; for (var i2 = 0; i2 < this.length; i2++) { var w2 = this.words[i2]; var word = ((w2 << off | carry) & 16777215).toString(16); carry = w2 >>> 24 - off & 16777215; off += 2; if (off >= 26) { off -= 26; i2--; } if (carry !== 0 || i2 !== this.length - 1) { out = zeros2[6 - word.length] + word + out; } else { out = word + out; } } if (carry !== 0) { out = carry.toString(16) + out; } while (out.length % padding !== 0) { out = "0" + out; } if (this.negative !== 0) { out = "-" + out; } return out; } if (base3 === (base3 | 0) && base3 >= 2 && base3 <= 36) { var groupSize = groupSizes[base3]; var groupBase = groupBases[base3]; out = ""; var c2 = this.clone(); c2.negative = 0; while (!c2.isZero()) { var r2 = c2.modrn(groupBase).toString(base3); c2 = c2.idivn(groupBase); if (!c2.isZero()) { out = zeros2[groupSize - r2.length] + r2 + out; } else { out = r2 + out; } } if (this.isZero()) { out = "0" + out; } while (out.length % padding !== 0) { out = "0" + out; } if (this.negative !== 0) { out = "-" + out; } return out; } assert2(false, "Base should be between 2 and 36"); }; BN2.prototype.toNumber = function toNumber() { var ret = this.words[0]; if (this.length === 2) { ret += this.words[1] * 67108864; } else if (this.length === 3 && this.words[2] === 1) { ret += 4503599627370496 + this.words[1] * 67108864; } else if (this.length > 2) { assert2(false, "Number can only safely store up to 53 bits"); } return this.negative !== 0 ? -ret : ret; }; BN2.prototype.toJSON = function toJSON() { return this.toString(16, 2); }; if (Buffer2) { BN2.prototype.toBuffer = function toBuffer2(endian, length) { return this.toArrayLike(Buffer2, endian, length); }; } BN2.prototype.toArray = function toArray(endian, length) { return this.toArrayLike(Array, endian, length); }; var allocate = function allocate2(ArrayType, size2) { if (ArrayType.allocUnsafe) { return ArrayType.allocUnsafe(size2); } return new ArrayType(size2); }; BN2.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { this._strip(); var byteLength2 = this.byteLength(); var reqLength = length || Math.max(1, byteLength2); assert2(byteLength2 <= reqLength, "byte array longer than desired length"); assert2(reqLength > 0, "Requested array length <= 0"); var res = allocate(ArrayType, reqLength); var postfix = endian === "le" ? "LE" : "BE"; this["_toArrayLike" + postfix](res, byteLength2); return res; }; BN2.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength2) { var position = 0; var carry = 0; for (var i2 = 0, shift = 0; i2 < this.length; i2++) { var word = this.words[i2] << shift | carry; res[position++] = word & 255; if (position < res.length) { res[position++] = word >> 8 & 255; } if (position < res.length) { res[position++] = word >> 16 & 255; } if (shift === 6) { if (position < res.length) { res[position++] = word >> 24 & 255; } carry = 0; shift = 0; } else { carry = word >>> 24; shift += 2; } } if (position < res.length) { res[position++] = carry; while (position < res.length) { res[position++] = 0; } } }; BN2.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength2) { var position = res.length - 1; var carry = 0; for (var i2 = 0, shift = 0; i2 < this.length; i2++) { var word = this.words[i2] << shift | carry; res[position--] = word & 255; if (position >= 0) { res[position--] = word >> 8 & 255; } if (position >= 0) { res[position--] = word >> 16 & 255; } if (shift === 6) { if (position >= 0) { res[position--] = word >> 24 & 255; } carry = 0; shift = 0; } else { carry = word >>> 24; shift += 2; } } if (position >= 0) { res[position--] = carry; while (position >= 0) { res[position--] = 0; } } }; if (Math.clz32) { BN2.prototype._countBits = function _countBits(w2) { return 32 - Math.clz32(w2); }; } else { BN2.prototype._countBits = function _countBits(w2) { var t2 = w2; var r2 = 0; if (t2 >= 4096) { r2 += 13; t2 >>>= 13; } if (t2 >= 64) { r2 += 7; t2 >>>= 7; } if (t2 >= 8) { r2 += 4; t2 >>>= 4; } if (t2 >= 2) { r2 += 2; t2 >>>= 2; } return r2 + t2; }; } BN2.prototype._zeroBits = function _zeroBits(w2) { if (w2 === 0) return 26; var t2 = w2; var r2 = 0; if ((t2 & 8191) === 0) { r2 += 13; t2 >>>= 13; } if ((t2 & 127) === 0) { r2 += 7; t2 >>>= 7; } if ((t2 & 15) === 0) { r2 += 4; t2 >>>= 4; } if ((t2 & 3) === 0) { r2 += 2; t2 >>>= 2; } if ((t2 & 1) === 0) { r2++; } return r2; }; BN2.prototype.bitLength = function bitLength() { var w2 = this.words[this.length - 1]; var hi = this._countBits(w2); return (this.length - 1) * 26 + hi; }; function toBitArray(num) { var w2 = new Array(num.bitLength()); for (var bit = 0; bit < w2.length; bit++) { var off = bit / 26 | 0; var wbit = bit % 26; w2[bit] = num.words[off] >>> wbit & 1; } return w2; } BN2.prototype.zeroBits = function zeroBits() { if (this.isZero()) return 0; var r2 = 0; for (var i2 = 0; i2 < this.length; i2++) { var b2 = this._zeroBits(this.words[i2]); r2 += b2; if (b2 !== 26) break; } return r2; }; BN2.prototype.byteLength = function byteLength2() { return Math.ceil(this.bitLength() / 8); }; BN2.prototype.toTwos = function toTwos(width) { if (this.negative !== 0) { return this.abs().inotn(width).iaddn(1); } return this.clone(); }; BN2.prototype.fromTwos = function fromTwos(width) { if (this.testn(width - 1)) { return this.notn(width).iaddn(1).ineg(); } return this.clone(); }; BN2.prototype.isNeg = function isNeg() { return this.negative !== 0; }; BN2.prototype.neg = function neg() { return this.clone().ineg(); }; BN2.prototype.ineg = function ineg() { if (!this.isZero()) { this.negative ^= 1; } return this; }; BN2.prototype.iuor = function iuor(num) { while (this.length < num.length) { this.words[this.length++] = 0; } for (var i2 = 0; i2 < num.length; i2++) { this.words[i2] = this.words[i2] | num.words[i2]; } return this._strip(); }; BN2.prototype.ior = function ior(num) { assert2((this.negative | num.negative) === 0); return this.iuor(num); }; BN2.prototype.or = function or2(num) { if (this.length > num.length) return this.clone().ior(num); return num.clone().ior(this); }; BN2.prototype.uor = function uor(num) { if (this.length > num.length) return this.clone().iuor(num); return num.clone().iuor(this); }; BN2.prototype.iuand = function iuand(num) { var b2; if (this.length > num.length) { b2 = num; } else { b2 = this; } for (var i2 = 0; i2 < b2.length; i2++) { this.words[i2] = this.words[i2] & num.words[i2]; } this.length = b2.length; return this._strip(); }; BN2.prototype.iand = function iand(num) { assert2((this.negative | num.negative) === 0); return this.iuand(num); }; BN2.prototype.and = function and(num) { if (this.length > num.length) return this.clone().iand(num); return num.clone().iand(this); }; BN2.prototype.uand = function uand(num) { if (this.length > num.length) return this.clone().iuand(num); return num.clone().iuand(this); }; BN2.prototype.iuxor = function iuxor(num) { var a2; var b2; if (this.length > num.length) { a2 = this; b2 = num; } else { a2 = num; b2 = this; } for (var i2 = 0; i2 < b2.length; i2++) { this.words[i2] = a2.words[i2] ^ b2.words[i2]; } if (this !== a2) { for (; i2 < a2.length; i2++) { this.words[i2] = a2.words[i2]; } } this.length = a2.length; return this._strip(); }; BN2.prototype.ixor = function ixor(num) { assert2((this.negative | num.negative) === 0); return this.iuxor(num); }; BN2.prototype.xor = function xor(num) { if (this.length > num.length) return this.clone().ixor(num); return num.clone().ixor(this); }; BN2.prototype.uxor = function uxor(num) { if (this.length > num.length) return this.clone().iuxor(num); return num.clone().iuxor(this); }; BN2.prototype.inotn = function inotn(width) { assert2(typeof width === "number" && width >= 0); var bytesNeeded = Math.ceil(width / 26) | 0; var bitsLeft = width % 26; this._expand(bytesNeeded); if (bitsLeft > 0) { bytesNeeded--; } for (var i2 = 0; i2 < bytesNeeded; i2++) { this.words[i2] = ~this.words[i2] & 67108863; } if (bitsLeft > 0) { this.words[i2] = ~this.words[i2] & 67108863 >> 26 - bitsLeft; } return this._strip(); }; BN2.prototype.notn = function notn(width) { return this.clone().inotn(width); }; BN2.prototype.setn = function setn(bit, val) { assert2(typeof bit === "number" && bit >= 0); var off = bit / 26 | 0; var wbit = bit % 26; this._expand(off + 1); if (val) { this.words[off] = this.words[off] | 1 << wbit; } else { this.words[off] = this.words[off] & ~(1 << wbit); } return this._strip(); }; BN2.prototype.iadd = function iadd(num) { var r2; if (this.negative !== 0 && num.negative === 0) { this.negative = 0; r2 = this.isub(num); this.negative ^= 1; return this._normSign(); } else if (this.negative === 0 && num.negative !== 0) { num.negative = 0; r2 = this.isub(num); num.negative = 1; return r2._normSign(); } var a2, b2; if (this.length > num.length) { a2 = this; b2 = num; } else { a2 = num; b2 = this; } var carry = 0; for (var i2 = 0; i2 < b2.length; i2++) { r2 = (a2.words[i2] | 0) + (b2.words[i2] | 0) + carry; this.words[i2] = r2 & 67108863; carry = r2 >>> 26; } for (; carry !== 0 && i2 < a2.length; i2++) { r2 = (a2.words[i2] | 0) + carry; this.words[i2] = r2 & 67108863; carry = r2 >>> 26; } this.length = a2.length; if (carry !== 0) { this.words[this.length] = carry; this.length++; } else if (a2 !== this) { for (; i2 < a2.length; i2++) { this.words[i2] = a2.words[i2]; } } return this; }; BN2.prototype.add = function add(num) { var res; if (num.negative !== 0 && this.negative === 0) { num.negative = 0; res = this.sub(num); num.negative ^= 1; return res; } else if (num.negative === 0 && this.negative !== 0) { this.negative = 0; res = num.sub(this); this.negative = 1; return res; } if (this.length > num.length) return this.clone().iadd(num); return num.clone().iadd(this); }; BN2.prototype.isub = function isub(num) { if (num.negative !== 0) { num.negative = 0; var r2 = this.iadd(num); num.negative = 1; return r2._normSign(); } else if (this.negative !== 0) { this.negative = 0; this.iadd(num); this.negative = 1; return this._normSign(); } var cmp2 = this.cmp(num); if (cmp2 === 0) { this.negative = 0; this.length = 1; this.words[0] = 0; return this; } var a2, b2; if (cmp2 > 0) { a2 = this; b2 = num; } else { a2 = num; b2 = this; } var carry = 0; for (var i2 = 0; i2 < b2.length; i2++) { r2 = (a2.words[i2] | 0) - (b2.words[i2] | 0) + carry; carry = r2 >> 26; this.words[i2] = r2 & 67108863; } for (; carry !== 0 && i2 < a2.length; i2++) { r2 = (a2.words[i2] | 0) + carry; carry = r2 >> 26; this.words[i2] = r2 & 67108863; } if (carry === 0 && i2 < a2.length && a2 !== this) { for (; i2 < a2.length; i2++) { this.words[i2] = a2.words[i2]; } } this.length = Math.max(this.length, i2); if (a2 !== this) { this.negative = 1; } return this._strip(); }; BN2.prototype.sub = function sub(num) { return this.clone().isub(num); }; function smallMulTo(self2, num, out) { out.negative = num.negative ^ self2.negative; var len2 = self2.length + num.length | 0; out.length = len2; len2 = len2 - 1 | 0; var a2 = self2.words[0] | 0; var b2 = num.words[0] | 0; var r2 = a2 * b2; var lo2 = r2 & 67108863; var carry = r2 / 67108864 | 0; out.words[0] = lo2; for (var k2 = 1; k2 < len2; k2++) { var ncarry = carry >>> 26; var rword = carry & 67108863; var maxJ = Math.min(k2, num.length - 1); for (var j2 = Math.max(0, k2 - self2.length + 1); j2 <= maxJ; j2++) { var i2 = k2 - j2 | 0; a2 = self2.words[i2] | 0; b2 = num.words[j2] | 0; r2 = a2 * b2 + rword; ncarry += r2 / 67108864 | 0; rword = r2 & 67108863; } out.words[k2] = rword | 0; carry = ncarry | 0; } if (carry !== 0) { out.words[k2] = carry | 0; } else { out.length--; } return out._strip(); } var comb10MulTo = function comb10MulTo2(self2, num, out) { var a2 = self2.words; var b2 = num.words; var o2 = out.words; var c2 = 0; var lo2; var mid; var hi; var a0 = a2[0] | 0; var al0 = a0 & 8191; var ah0 = a0 >>> 13; var a1 = a2[1] | 0; var al1 = a1 & 8191; var ah1 = a1 >>> 13; var a22 = a2[2] | 0; var al2 = a22 & 8191; var ah2 = a22 >>> 13; var a3 = a2[3] | 0; var al3 = a3 & 8191; var ah3 = a3 >>> 13; var a4 = a2[4] | 0; var al4 = a4 & 8191; var ah4 = a4 >>> 13; var a5 = a2[5] | 0; var al5 = a5 & 8191; var ah5 = a5 >>> 13; var a6 = a2[6] | 0; var al6 = a6 & 8191; var ah6 = a6 >>> 13; var a7 = a2[7] | 0; var al7 = a7 & 8191; var ah7 = a7 >>> 13; var a8 = a2[8] | 0; var al8 = a8 & 8191; var ah8 = a8 >>> 13; var a9 = a2[9] | 0; var al9 = a9 & 8191; var ah9 = a9 >>> 13; var b0 = b2[0] | 0; var bl0 = b0 & 8191; var bh0 = b0 >>> 13; var b1 = b2[1] | 0; var bl1 = b1 & 8191; var bh1 = b1 >>> 13; var b22 = b2[2] | 0; var bl2 = b22 & 8191; var bh2 = b22 >>> 13; var b3 = b2[3] | 0; var bl3 = b3 & 8191; var bh3 = b3 >>> 13; var b4 = b2[4] | 0; var bl4 = b4 & 8191; var bh4 = b4 >>> 13; var b5 = b2[5] | 0; var bl5 = b5 & 8191; var bh5 = b5 >>> 13; var b6 = b2[6] | 0; var bl6 = b6 & 8191; var bh6 = b6 >>> 13; var b7 = b2[7] | 0; var bl7 = b7 & 8191; var bh7 = b7 >>> 13; var b8 = b2[8] | 0; var bl8 = b8 & 8191; var bh8 = b8 >>> 13; var b9 = b2[9] | 0; var bl9 = b9 & 8191; var bh9 = b9 >>> 13; out.negative = self2.negative ^ num.negative; out.length = 19; lo2 = Math.imul(al0, bl0); mid = Math.imul(al0, bh0); mid = mid + Math.imul(ah0, bl0) | 0; hi = Math.imul(ah0, bh0); var w0 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; w0 &= 67108863; lo2 = Math.imul(al1, bl0); mid = Math.imul(al1, bh0); mid = mid + Math.imul(ah1, bl0) | 0; hi = Math.imul(ah1, bh0); lo2 = lo2 + Math.imul(al0, bl1) | 0; mid = mid + Math.imul(al0, bh1) | 0; mid = mid + Math.imul(ah0, bl1) | 0; hi = hi + Math.imul(ah0, bh1) | 0; var w1 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; w1 &= 67108863; lo2 = Math.imul(al2, bl0); mid = Math.imul(al2, bh0); mid = mid + Math.imul(ah2, bl0) | 0; hi = Math.imul(ah2, bh0); lo2 = lo2 + Math.imul(al1, bl1) | 0; mid = mid + Math.imul(al1, bh1) | 0; mid = mid + Math.imul(ah1, bl1) | 0; hi = hi + Math.imul(ah1, bh1) | 0; lo2 = lo2 + Math.imul(al0, bl2) | 0; mid = mid + Math.imul(al0, bh2) | 0; mid = mid + Math.imul(ah0, bl2) | 0; hi = hi + Math.imul(ah0, bh2) | 0; var w2 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0; w2 &= 67108863; lo2 = Math.imul(al3, bl0); mid = Math.imul(al3, bh0); mid = mid + Math.imul(ah3, bl0) | 0; hi = Math.imul(ah3, bh0); lo2 = lo2 + Math.imul(al2, bl1) | 0; mid = mid + Math.imul(al2, bh1) | 0; mid = mid + Math.imul(ah2, bl1) | 0; hi = hi + Math.imul(ah2, bh1) | 0; lo2 = lo2 + Math.imul(al1, bl2) | 0; mid = mid + Math.imul(al1, bh2) | 0; mid = mid + Math.imul(ah1, bl2) | 0; hi = hi + Math.imul(ah1, bh2) | 0; lo2 = lo2 + Math.imul(al0, bl3) | 0; mid = mid + Math.imul(al0, bh3) | 0; mid = mid + Math.imul(ah0, bl3) | 0; hi = hi + Math.imul(ah0, bh3) | 0; var w3 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0; w3 &= 67108863; lo2 = Math.imul(al4, bl0); mid = Math.imul(al4, bh0); mid = mid + Math.imul(ah4, bl0) | 0; hi = Math.imul(ah4, bh0); lo2 = lo2 + Math.imul(al3, bl1) | 0; mid = mid + Math.imul(al3, bh1) | 0; mid = mid + Math.imul(ah3, bl1) | 0; hi = hi + Math.imul(ah3, bh1) | 0; lo2 = lo2 + Math.imul(al2, bl2) | 0; mid = mid + Math.imul(al2, bh2) | 0; mid = mid + Math.imul(ah2, bl2) | 0; hi = hi + Math.imul(ah2, bh2) | 0; lo2 = lo2 + Math.imul(al1, bl3) | 0; mid = mid + Math.imul(al1, bh3) | 0; mid = mid + Math.imul(ah1, bl3) | 0; hi = hi + Math.imul(ah1, bh3) | 0; lo2 = lo2 + Math.imul(al0, bl4) | 0; mid = mid + Math.imul(al0, bh4) | 0; mid = mid + Math.imul(ah0, bl4) | 0; hi = hi + Math.imul(ah0, bh4) | 0; var w4 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0; w4 &= 67108863; lo2 = Math.imul(al5, bl0); mid = Math.imul(al5, bh0); mid = mid + Math.imul(ah5, bl0) | 0; hi = Math.imul(ah5, bh0); lo2 = lo2 + Math.imul(al4, bl1) | 0; mid = mid + Math.imul(al4, bh1) | 0; mid = mid + Math.imul(ah4, bl1) | 0; hi = hi + Math.imul(ah4, bh1) | 0; lo2 = lo2 + Math.imul(al3, bl2) | 0; mid = mid + Math.imul(al3, bh2) | 0; mid = mid + Math.imul(ah3, bl2) | 0; hi = hi + Math.imul(ah3, bh2) | 0; lo2 = lo2 + Math.imul(al2, bl3) | 0; mid = mid + Math.imul(al2, bh3) | 0; mid = mid + Math.imul(ah2, bl3) | 0; hi = hi + Math.imul(ah2, bh3) | 0; lo2 = lo2 + Math.imul(al1, bl4) | 0; mid = mid + Math.imul(al1, bh4) | 0; mid = mid + Math.imul(ah1, bl4) | 0; hi = hi + Math.imul(ah1, bh4) | 0; lo2 = lo2 + Math.imul(al0, bl5) | 0; mid = mid + Math.imul(al0, bh5) | 0; mid = mid + Math.imul(ah0, bl5) | 0; hi = hi + Math.imul(ah0, bh5) | 0; var w5 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0; w5 &= 67108863; lo2 = Math.imul(al6, bl0); mid = Math.imul(al6, bh0); mid = mid + Math.imul(ah6, bl0) | 0; hi = Math.imul(ah6, bh0); lo2 = lo2 + Math.imul(al5, bl1) | 0; mid = mid + Math.imul(al5, bh1) | 0; mid = mid + Math.imul(ah5, bl1) | 0; hi = hi + Math.imul(ah5, bh1) | 0; lo2 = lo2 + Math.imul(al4, bl2) | 0; mid = mid + Math.imul(al4, bh2) | 0; mid = mid + Math.imul(ah4, bl2) | 0; hi = hi + Math.imul(ah4, bh2) | 0; lo2 = lo2 + Math.imul(al3, bl3) | 0; mid = mid + Math.imul(al3, bh3) | 0; mid = mid + Math.imul(ah3, bl3) | 0; hi = hi + Math.imul(ah3, bh3) | 0; lo2 = lo2 + Math.imul(al2, bl4) | 0; mid = mid + Math.imul(al2, bh4) | 0; mid = mid + Math.imul(ah2, bl4) | 0; hi = hi + Math.imul(ah2, bh4) | 0; lo2 = lo2 + Math.imul(al1, bl5) | 0; mid = mid + Math.imul(al1, bh5) | 0; mid = mid + Math.imul(ah1, bl5) | 0; hi = hi + Math.imul(ah1, bh5) | 0; lo2 = lo2 + Math.imul(al0, bl6) | 0; mid = mid + Math.imul(al0, bh6) | 0; mid = mid + Math.imul(ah0, bl6) | 0; hi = hi + Math.imul(ah0, bh6) | 0; var w6 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; w6 &= 67108863; lo2 = Math.imul(al7, bl0); mid = Math.imul(al7, bh0); mid = mid + Math.imul(ah7, bl0) | 0; hi = Math.imul(ah7, bh0); lo2 = lo2 + Math.imul(al6, bl1) | 0; mid = mid + Math.imul(al6, bh1) | 0; mid = mid + Math.imul(ah6, bl1) | 0; hi = hi + Math.imul(ah6, bh1) | 0; lo2 = lo2 + Math.imul(al5, bl2) | 0; mid = mid + Math.imul(al5, bh2) | 0; mid = mid + Math.imul(ah5, bl2) | 0; hi = hi + Math.imul(ah5, bh2) | 0; lo2 = lo2 + Math.imul(al4, bl3) | 0; mid = mid + Math.imul(al4, bh3) | 0; mid = mid + Math.imul(ah4, bl3) | 0; hi = hi + Math.imul(ah4, bh3) | 0; lo2 = lo2 + Math.imul(al3, bl4) | 0; mid = mid + Math.imul(al3, bh4) | 0; mid = mid + Math.imul(ah3, bl4) | 0; hi = hi + Math.imul(ah3, bh4) | 0; lo2 = lo2 + Math.imul(al2, bl5) | 0; mid = mid + Math.imul(al2, bh5) | 0; mid = mid + Math.imul(ah2, bl5) | 0; hi = hi + Math.imul(ah2, bh5) | 0; lo2 = lo2 + Math.imul(al1, bl6) | 0; mid = mid + Math.imul(al1, bh6) | 0; mid = mid + Math.imul(ah1, bl6) | 0; hi = hi + Math.imul(ah1, bh6) | 0; lo2 = lo2 + Math.imul(al0, bl7) | 0; mid = mid + Math.imul(al0, bh7) | 0; mid = mid + Math.imul(ah0, bl7) | 0; hi = hi + Math.imul(ah0, bh7) | 0; var w7 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; w7 &= 67108863; lo2 = Math.imul(al8, bl0); mid = Math.imul(al8, bh0); mid = mid + Math.imul(ah8, bl0) | 0; hi = Math.imul(ah8, bh0); lo2 = lo2 + Math.imul(al7, bl1) | 0; mid = mid + Math.imul(al7, bh1) | 0; mid = mid + Math.imul(ah7, bl1) | 0; hi = hi + Math.imul(ah7, bh1) | 0; lo2 = lo2 + Math.imul(al6, bl2) | 0; mid = mid + Math.imul(al6, bh2) | 0; mid = mid + Math.imul(ah6, bl2) | 0; hi = hi + Math.imul(ah6, bh2) | 0; lo2 = lo2 + Math.imul(al5, bl3) | 0; mid = mid + Math.imul(al5, bh3) | 0; mid = mid + Math.imul(ah5, bl3) | 0; hi = hi + Math.imul(ah5, bh3) | 0; lo2 = lo2 + Math.imul(al4, bl4) | 0; mid = mid + Math.imul(al4, bh4) | 0; mid = mid + Math.imul(ah4, bl4) | 0; hi = hi + Math.imul(ah4, bh4) | 0; lo2 = lo2 + Math.imul(al3, bl5) | 0; mid = mid + Math.imul(al3, bh5) | 0; mid = mid + Math.imul(ah3, bl5) | 0; hi = hi + Math.imul(ah3, bh5) | 0; lo2 = lo2 + Math.imul(al2, bl6) | 0; mid = mid + Math.imul(al2, bh6) | 0; mid = mid + Math.imul(ah2, bl6) | 0; hi = hi + Math.imul(ah2, bh6) | 0; lo2 = lo2 + Math.imul(al1, bl7) | 0; mid = mid + Math.imul(al1, bh7) | 0; mid = mid + Math.imul(ah1, bl7) | 0; hi = hi + Math.imul(ah1, bh7) | 0; lo2 = lo2 + Math.imul(al0, bl8) | 0; mid = mid + Math.imul(al0, bh8) | 0; mid = mid + Math.imul(ah0, bl8) | 0; hi = hi + Math.imul(ah0, bh8) | 0; var w8 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; w8 &= 67108863; lo2 = Math.imul(al9, bl0); mid = Math.imul(al9, bh0); mid = mid + Math.imul(ah9, bl0) | 0; hi = Math.imul(ah9, bh0); lo2 = lo2 + Math.imul(al8, bl1) | 0; mid = mid + Math.imul(al8, bh1) | 0; mid = mid + Math.imul(ah8, bl1) | 0; hi = hi + Math.imul(ah8, bh1) | 0; lo2 = lo2 + Math.imul(al7, bl2) | 0; mid = mid + Math.imul(al7, bh2) | 0; mid = mid + Math.imul(ah7, bl2) | 0; hi = hi + Math.imul(ah7, bh2) | 0; lo2 = lo2 + Math.imul(al6, bl3) | 0; mid = mid + Math.imul(al6, bh3) | 0; mid = mid + Math.imul(ah6, bl3) | 0; hi = hi + Math.imul(ah6, bh3) | 0; lo2 = lo2 + Math.imul(al5, bl4) | 0; mid = mid + Math.imul(al5, bh4) | 0; mid = mid + Math.imul(ah5, bl4) | 0; hi = hi + Math.imul(ah5, bh4) | 0; lo2 = lo2 + Math.imul(al4, bl5) | 0; mid = mid + Math.imul(al4, bh5) | 0; mid = mid + Math.imul(ah4, bl5) | 0; hi = hi + Math.imul(ah4, bh5) | 0; lo2 = lo2 + Math.imul(al3, bl6) | 0; mid = mid + Math.imul(al3, bh6) | 0; mid = mid + Math.imul(ah3, bl6) | 0; hi = hi + Math.imul(ah3, bh6) | 0; lo2 = lo2 + Math.imul(al2, bl7) | 0; mid = mid + Math.imul(al2, bh7) | 0; mid = mid + Math.imul(ah2, bl7) | 0; hi = hi + Math.imul(ah2, bh7) | 0; lo2 = lo2 + Math.imul(al1, bl8) | 0; mid = mid + Math.imul(al1, bh8) | 0; mid = mid + Math.imul(ah1, bl8) | 0; hi = hi + Math.imul(ah1, bh8) | 0; lo2 = lo2 + Math.imul(al0, bl9) | 0; mid = mid + Math.imul(al0, bh9) | 0; mid = mid + Math.imul(ah0, bl9) | 0; hi = hi + Math.imul(ah0, bh9) | 0; var w9 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; w9 &= 67108863; lo2 = Math.imul(al9, bl1); mid = Math.imul(al9, bh1); mid = mid + Math.imul(ah9, bl1) | 0; hi = Math.imul(ah9, bh1); lo2 = lo2 + Math.imul(al8, bl2) | 0; mid = mid + Math.imul(al8, bh2) | 0; mid = mid + Math.imul(ah8, bl2) | 0; hi = hi + Math.imul(ah8, bh2) | 0; lo2 = lo2 + Math.imul(al7, bl3) | 0; mid = mid + Math.imul(al7, bh3) | 0; mid = mid + Math.imul(ah7, bl3) | 0; hi = hi + Math.imul(ah7, bh3) | 0; lo2 = lo2 + Math.imul(al6, bl4) | 0; mid = mid + Math.imul(al6, bh4) | 0; mid = mid + Math.imul(ah6, bl4) | 0; hi = hi + Math.imul(ah6, bh4) | 0; lo2 = lo2 + Math.imul(al5, bl5) | 0; mid = mid + Math.imul(al5, bh5) | 0; mid = mid + Math.imul(ah5, bl5) | 0; hi = hi + Math.imul(ah5, bh5) | 0; lo2 = lo2 + Math.imul(al4, bl6) | 0; mid = mid + Math.imul(al4, bh6) | 0; mid = mid + Math.imul(ah4, bl6) | 0; hi = hi + Math.imul(ah4, bh6) | 0; lo2 = lo2 + Math.imul(al3, bl7) | 0; mid = mid + Math.imul(al3, bh7) | 0; mid = mid + Math.imul(ah3, bl7) | 0; hi = hi + Math.imul(ah3, bh7) | 0; lo2 = lo2 + Math.imul(al2, bl8) | 0; mid = mid + Math.imul(al2, bh8) | 0; mid = mid + Math.imul(ah2, bl8) | 0; hi = hi + Math.imul(ah2, bh8) | 0; lo2 = lo2 + Math.imul(al1, bl9) | 0; mid = mid + Math.imul(al1, bh9) | 0; mid = mid + Math.imul(ah1, bl9) | 0; hi = hi + Math.imul(ah1, bh9) | 0; var w10 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; w10 &= 67108863; lo2 = Math.imul(al9, bl2); mid = Math.imul(al9, bh2); mid = mid + Math.imul(ah9, bl2) | 0; hi = Math.imul(ah9, bh2); lo2 = lo2 + Math.imul(al8, bl3) | 0; mid = mid + Math.imul(al8, bh3) | 0; mid = mid + Math.imul(ah8, bl3) | 0; hi = hi + Math.imul(ah8, bh3) | 0; lo2 = lo2 + Math.imul(al7, bl4) | 0; mid = mid + Math.imul(al7, bh4) | 0; mid = mid + Math.imul(ah7, bl4) | 0; hi = hi + Math.imul(ah7, bh4) | 0; lo2 = lo2 + Math.imul(al6, bl5) | 0; mid = mid + Math.imul(al6, bh5) | 0; mid = mid + Math.imul(ah6, bl5) | 0; hi = hi + Math.imul(ah6, bh5) | 0; lo2 = lo2 + Math.imul(al5, bl6) | 0; mid = mid + Math.imul(al5, bh6) | 0; mid = mid + Math.imul(ah5, bl6) | 0; hi = hi + Math.imul(ah5, bh6) | 0; lo2 = lo2 + Math.imul(al4, bl7) | 0; mid = mid + Math.imul(al4, bh7) | 0; mid = mid + Math.imul(ah4, bl7) | 0; hi = hi + Math.imul(ah4, bh7) | 0; lo2 = lo2 + Math.imul(al3, bl8) | 0; mid = mid + Math.imul(al3, bh8) | 0; mid = mid + Math.imul(ah3, bl8) | 0; hi = hi + Math.imul(ah3, bh8) | 0; lo2 = lo2 + Math.imul(al2, bl9) | 0; mid = mid + Math.imul(al2, bh9) | 0; mid = mid + Math.imul(ah2, bl9) | 0; hi = hi + Math.imul(ah2, bh9) | 0; var w11 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; w11 &= 67108863; lo2 = Math.imul(al9, bl3); mid = Math.imul(al9, bh3); mid = mid + Math.imul(ah9, bl3) | 0; hi = Math.imul(ah9, bh3); lo2 = lo2 + Math.imul(al8, bl4) | 0; mid = mid + Math.imul(al8, bh4) | 0; mid = mid + Math.imul(ah8, bl4) | 0; hi = hi + Math.imul(ah8, bh4) | 0; lo2 = lo2 + Math.imul(al7, bl5) | 0; mid = mid + Math.imul(al7, bh5) | 0; mid = mid + Math.imul(ah7, bl5) | 0; hi = hi + Math.imul(ah7, bh5) | 0; lo2 = lo2 + Math.imul(al6, bl6) | 0; mid = mid + Math.imul(al6, bh6) | 0; mid = mid + Math.imul(ah6, bl6) | 0; hi = hi + Math.imul(ah6, bh6) | 0; lo2 = lo2 + Math.imul(al5, bl7) | 0; mid = mid + Math.imul(al5, bh7) | 0; mid = mid + Math.imul(ah5, bl7) | 0; hi = hi + Math.imul(ah5, bh7) | 0; lo2 = lo2 + Math.imul(al4, bl8) | 0; mid = mid + Math.imul(al4, bh8) | 0; mid = mid + Math.imul(ah4, bl8) | 0; hi = hi + Math.imul(ah4, bh8) | 0; lo2 = lo2 + Math.imul(al3, bl9) | 0; mid = mid + Math.imul(al3, bh9) | 0; mid = mid + Math.imul(ah3, bl9) | 0; hi = hi + Math.imul(ah3, bh9) | 0; var w12 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; w12 &= 67108863; lo2 = Math.imul(al9, bl4); mid = Math.imul(al9, bh4); mid = mid + Math.imul(ah9, bl4) | 0; hi = Math.imul(ah9, bh4); lo2 = lo2 + Math.imul(al8, bl5) | 0; mid = mid + Math.imul(al8, bh5) | 0; mid = mid + Math.imul(ah8, bl5) | 0; hi = hi + Math.imul(ah8, bh5) | 0; lo2 = lo2 + Math.imul(al7, bl6) | 0; mid = mid + Math.imul(al7, bh6) | 0; mid = mid + Math.imul(ah7, bl6) | 0; hi = hi + Math.imul(ah7, bh6) | 0; lo2 = lo2 + Math.imul(al6, bl7) | 0; mid = mid + Math.imul(al6, bh7) | 0; mid = mid + Math.imul(ah6, bl7) | 0; hi = hi + Math.imul(ah6, bh7) | 0; lo2 = lo2 + Math.imul(al5, bl8) | 0; mid = mid + Math.imul(al5, bh8) | 0; mid = mid + Math.imul(ah5, bl8) | 0; hi = hi + Math.imul(ah5, bh8) | 0; lo2 = lo2 + Math.imul(al4, bl9) | 0; mid = mid + Math.imul(al4, bh9) | 0; mid = mid + Math.imul(ah4, bl9) | 0; hi = hi + Math.imul(ah4, bh9) | 0; var w13 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; w13 &= 67108863; lo2 = Math.imul(al9, bl5); mid = Math.imul(al9, bh5); mid = mid + Math.imul(ah9, bl5) | 0; hi = Math.imul(ah9, bh5); lo2 = lo2 + Math.imul(al8, bl6) | 0; mid = mid + Math.imul(al8, bh6) | 0; mid = mid + Math.imul(ah8, bl6) | 0; hi = hi + Math.imul(ah8, bh6) | 0; lo2 = lo2 + Math.imul(al7, bl7) | 0; mid = mid + Math.imul(al7, bh7) | 0; mid = mid + Math.imul(ah7, bl7) | 0; hi = hi + Math.imul(ah7, bh7) | 0; lo2 = lo2 + Math.imul(al6, bl8) | 0; mid = mid + Math.imul(al6, bh8) | 0; mid = mid + Math.imul(ah6, bl8) | 0; hi = hi + Math.imul(ah6, bh8) | 0; lo2 = lo2 + Math.imul(al5, bl9) | 0; mid = mid + Math.imul(al5, bh9) | 0; mid = mid + Math.imul(ah5, bl9) | 0; hi = hi + Math.imul(ah5, bh9) | 0; var w14 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; w14 &= 67108863; lo2 = Math.imul(al9, bl6); mid = Math.imul(al9, bh6); mid = mid + Math.imul(ah9, bl6) | 0; hi = Math.imul(ah9, bh6); lo2 = lo2 + Math.imul(al8, bl7) | 0; mid = mid + Math.imul(al8, bh7) | 0; mid = mid + Math.imul(ah8, bl7) | 0; hi = hi + Math.imul(ah8, bh7) | 0; lo2 = lo2 + Math.imul(al7, bl8) | 0; mid = mid + Math.imul(al7, bh8) | 0; mid = mid + Math.imul(ah7, bl8) | 0; hi = hi + Math.imul(ah7, bh8) | 0; lo2 = lo2 + Math.imul(al6, bl9) | 0; mid = mid + Math.imul(al6, bh9) | 0; mid = mid + Math.imul(ah6, bl9) | 0; hi = hi + Math.imul(ah6, bh9) | 0; var w15 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; w15 &= 67108863; lo2 = Math.imul(al9, bl7); mid = Math.imul(al9, bh7); mid = mid + Math.imul(ah9, bl7) | 0; hi = Math.imul(ah9, bh7); lo2 = lo2 + Math.imul(al8, bl8) | 0; mid = mid + Math.imul(al8, bh8) | 0; mid = mid + Math.imul(ah8, bl8) | 0; hi = hi + Math.imul(ah8, bh8) | 0; lo2 = lo2 + Math.imul(al7, bl9) | 0; mid = mid + Math.imul(al7, bh9) | 0; mid = mid + Math.imul(ah7, bl9) | 0; hi = hi + Math.imul(ah7, bh9) | 0; var w16 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; w16 &= 67108863; lo2 = Math.imul(al9, bl8); mid = Math.imul(al9, bh8); mid = mid + Math.imul(ah9, bl8) | 0; hi = Math.imul(ah9, bh8); lo2 = lo2 + Math.imul(al8, bl9) | 0; mid = mid + Math.imul(al8, bh9) | 0; mid = mid + Math.imul(ah8, bl9) | 0; hi = hi + Math.imul(ah8, bh9) | 0; var w17 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; w17 &= 67108863; lo2 = Math.imul(al9, bl9); mid = Math.imul(al9, bh9); mid = mid + Math.imul(ah9, bl9) | 0; hi = Math.imul(ah9, bh9); var w18 = (c2 + lo2 | 0) + ((mid & 8191) << 13) | 0; c2 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; w18 &= 67108863; o2[0] = w0; o2[1] = w1; o2[2] = w2; o2[3] = w3; o2[4] = w4; o2[5] = w5; o2[6] = w6; o2[7] = w7; o2[8] = w8; o2[9] = w9; o2[10] = w10; o2[11] = w11; o2[12] = w12; o2[13] = w13; o2[14] = w14; o2[15] = w15; o2[16] = w16; o2[17] = w17; o2[18] = w18; if (c2 !== 0) { o2[19] = c2; out.length++; } return out; }; if (!Math.imul) { comb10MulTo = smallMulTo; } function bigMulTo(self2, num, out) { out.negative = num.negative ^ self2.negative; out.length = self2.length + num.length; var carry = 0; var hncarry = 0; for (var k2 = 0; k2 < out.length - 1; k2++) { var ncarry = hncarry; hncarry = 0; var rword = carry & 67108863; var maxJ = Math.min(k2, num.length - 1); for (var j2 = Math.max(0, k2 - self2.length + 1); j2 <= maxJ; j2++) { var i2 = k2 - j2; var a2 = self2.words[i2] | 0; var b2 = num.words[j2] | 0; var r2 = a2 * b2; var lo2 = r2 & 67108863; ncarry = ncarry + (r2 / 67108864 | 0) | 0; lo2 = lo2 + rword | 0; rword = lo2 & 67108863; ncarry = ncarry + (lo2 >>> 26) | 0; hncarry += ncarry >>> 26; ncarry &= 67108863; } out.words[k2] = rword; carry = ncarry; ncarry = hncarry; } if (carry !== 0) { out.words[k2] = carry; } else { out.length--; } return out._strip(); } function jumboMulTo(self2, num, out) { return bigMulTo(self2, num, out); } BN2.prototype.mulTo = function mulTo(num, out) { var res; var len2 = this.length + num.length; if (this.length === 10 && num.length === 10) { res = comb10MulTo(this, num, out); } else if (len2 < 63) { res = smallMulTo(this, num, out); } else if (len2 < 1024) { res = bigMulTo(this, num, out); } else { res = jumboMulTo(this, num, out); } return res; }; BN2.prototype.mul = function mul(num) { var out = new BN2(null); out.words = new Array(this.length + num.length); return this.mulTo(num, out); }; BN2.prototype.mulf = function mulf(num) { var out = new BN2(null); out.words = new Array(this.length + num.length); return jumboMulTo(this, num, out); }; BN2.prototype.imul = function imul(num) { return this.clone().mulTo(num, this); }; BN2.prototype.imuln = function imuln(num) { var isNegNum = num < 0; if (isNegNum) num = -num; assert2(typeof num === "number"); assert2(num < 67108864); var carry = 0; for (var i2 = 0; i2 < this.length; i2++) { var w2 = (this.words[i2] | 0) * num; var lo2 = (w2 & 67108863) + (carry & 67108863); carry >>= 26; carry += w2 / 67108864 | 0; carry += lo2 >>> 26; this.words[i2] = lo2 & 67108863; } if (carry !== 0) { this.words[i2] = carry; this.length++; } return isNegNum ? this.ineg() : this; }; BN2.prototype.muln = function muln(num) { return this.clone().imuln(num); }; BN2.prototype.sqr = function sqr() { return this.mul(this); }; BN2.prototype.isqr = function isqr() { return this.imul(this.clone()); }; BN2.prototype.pow = function pow(num) { var w2 = toBitArray(num); if (w2.length === 0) return new BN2(1); var res = this; for (var i2 = 0; i2 < w2.length; i2++, res = res.sqr()) { if (w2[i2] !== 0) break; } if (++i2 < w2.length) { for (var q2 = res.sqr(); i2 < w2.length; i2++, q2 = q2.sqr()) { if (w2[i2] === 0) continue; res = res.mul(q2); } } return res; }; BN2.prototype.iushln = function iushln(bits) { assert2(typeof bits === "number" && bits >= 0); var r2 = bits % 26; var s2 = (bits - r2) / 26; var carryMask = 67108863 >>> 26 - r2 << 26 - r2; var i2; if (r2 !== 0) { var carry = 0; for (i2 = 0; i2 < this.length; i2++) { var newCarry = this.words[i2] & carryMask; var c2 = (this.words[i2] | 0) - newCarry << r2; this.words[i2] = c2 | carry; carry = newCarry >>> 26 - r2; } if (carry) { this.words[i2] = carry; this.length++; } } if (s2 !== 0) { for (i2 = this.length - 1; i2 >= 0; i2--) { this.words[i2 + s2] = this.words[i2]; } for (i2 = 0; i2 < s2; i2++) { this.words[i2] = 0; } this.length += s2; } return this._strip(); }; BN2.prototype.ishln = function ishln(bits) { assert2(this.negative === 0); return this.iushln(bits); }; BN2.prototype.iushrn = function iushrn(bits, hint, extended) { assert2(typeof bits === "number" && bits >= 0); var h2; if (hint) { h2 = (hint - hint % 26) / 26; } else { h2 = 0; } var r2 = bits % 26; var s2 = Math.min((bits - r2) / 26, this.length); var mask2 = 67108863 ^ 67108863 >>> r2 << r2; var maskedWords = extended; h2 -= s2; h2 = Math.max(0, h2); if (maskedWords) { for (var i2 = 0; i2 < s2; i2++) { maskedWords.words[i2] = this.words[i2]; } maskedWords.length = s2; } if (s2 === 0) ; else if (this.length > s2) { this.length -= s2; for (i2 = 0; i2 < this.length; i2++) { this.words[i2] = this.words[i2 + s2]; } } else { this.words[0] = 0; this.length = 1; } var carry = 0; for (i2 = this.length - 1; i2 >= 0 && (carry !== 0 || i2 >= h2); i2--) { var word = this.words[i2] | 0; this.words[i2] = carry << 26 - r2 | word >>> r2; carry = word & mask2; } if (maskedWords && carry !== 0) { maskedWords.words[maskedWords.length++] = carry; } if (this.length === 0) { this.words[0] = 0; this.length = 1; } return this._strip(); }; BN2.prototype.ishrn = function ishrn(bits, hint, extended) { assert2(this.negative === 0); return this.iushrn(bits, hint, extended); }; BN2.prototype.shln = function shln(bits) { return this.clone().ishln(bits); }; BN2.prototype.ushln = function ushln(bits) { return this.clone().iushln(bits); }; BN2.prototype.shrn = function shrn(bits) { return this.clone().ishrn(bits); }; BN2.prototype.ushrn = function ushrn(bits) { return this.clone().iushrn(bits); }; BN2.prototype.testn = function testn(bit) { assert2(typeof bit === "number" && bit >= 0); var r2 = bit % 26; var s2 = (bit - r2) / 26; var q2 = 1 << r2; if (this.length <= s2) return false; var w2 = this.words[s2]; return !!(w2 & q2); }; BN2.prototype.imaskn = function imaskn(bits) { assert2(typeof bits === "number" && bits >= 0); var r2 = bits % 26; var s2 = (bits - r2) / 26; assert2(this.negative === 0, "imaskn works only with positive numbers"); if (this.length <= s2) { return this; } if (r2 !== 0) { s2++; } this.length = Math.min(s2, this.length); if (r2 !== 0) { var mask2 = 67108863 ^ 67108863 >>> r2 << r2; this.words[this.length - 1] &= mask2; } return this._strip(); }; BN2.prototype.maskn = function maskn(bits) { return this.clone().imaskn(bits); }; BN2.prototype.iaddn = function iaddn(num) { assert2(typeof num === "number"); assert2(num < 67108864); if (num < 0) return this.isubn(-num); if (this.negative !== 0) { if (this.length === 1 && (this.words[0] | 0) <= num) { this.words[0] = num - (this.words[0] | 0); this.negative = 0; return this; } this.negative = 0; this.isubn(num); this.negative = 1; return this; } return this._iaddn(num); }; BN2.prototype._iaddn = function _iaddn(num) { this.words[0] += num; for (var i2 = 0; i2 < this.length && this.words[i2] >= 67108864; i2++) { this.words[i2] -= 67108864; if (i2 === this.length - 1) { this.words[i2 + 1] = 1; } else { this.words[i2 + 1]++; } } this.length = Math.max(this.length, i2 + 1); return this; }; BN2.prototype.isubn = function isubn(num) { assert2(typeof num === "number"); assert2(num < 67108864); if (num < 0) return this.iaddn(-num); if (this.negative !== 0) { this.negative = 0; this.iaddn(num); this.negative = 1; return this; } this.words[0] -= num; if (this.length === 1 && this.words[0] < 0) { this.words[0] = -this.words[0]; this.negative = 1; } else { for (var i2 = 0; i2 < this.length && this.words[i2] < 0; i2++) { this.words[i2] += 67108864; this.words[i2 + 1] -= 1; } } return this._strip(); }; BN2.prototype.addn = function addn(num) { return this.clone().iaddn(num); }; BN2.prototype.subn = function subn(num) { return this.clone().isubn(num); }; BN2.prototype.iabs = function iabs() { this.negative = 0; return this; }; BN2.prototype.abs = function abs() { return this.clone().iabs(); }; BN2.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { var len2 = num.length + shift; var i2; this._expand(len2); var w2; var carry = 0; for (i2 = 0; i2 < num.length; i2++) { w2 = (this.words[i2 + shift] | 0) + carry; var right = (num.words[i2] | 0) * mul; w2 -= right & 67108863; carry = (w2 >> 26) - (right / 67108864 | 0); this.words[i2 + shift] = w2 & 67108863; } for (; i2 < this.length - shift; i2++) { w2 = (this.words[i2 + shift] | 0) + carry; carry = w2 >> 26; this.words[i2 + shift] = w2 & 67108863; } if (carry === 0) return this._strip(); assert2(carry === -1); carry = 0; for (i2 = 0; i2 < this.length; i2++) { w2 = -(this.words[i2] | 0) + carry; carry = w2 >> 26; this.words[i2] = w2 & 67108863; } this.negative = 1; return this._strip(); }; BN2.prototype._wordDiv = function _wordDiv(num, mode2) { var shift = this.length - num.length; var a2 = this.clone(); var b2 = num; var bhi = b2.words[b2.length - 1] | 0; var bhiBits = this._countBits(bhi); shift = 26 - bhiBits; if (shift !== 0) { b2 = b2.ushln(shift); a2.iushln(shift); bhi = b2.words[b2.length - 1] | 0; } var m2 = a2.length - b2.length; var q2; if (mode2 !== "mod") { q2 = new BN2(null); q2.length = m2 + 1; q2.words = new Array(q2.length); for (var i2 = 0; i2 < q2.length; i2++) { q2.words[i2] = 0; } } var diff2 = a2.clone()._ishlnsubmul(b2, 1, m2); if (diff2.negative === 0) { a2 = diff2; if (q2) { q2.words[m2] = 1; } } for (var j2 = m2 - 1; j2 >= 0; j2--) { var qj = (a2.words[b2.length + j2] | 0) * 67108864 + (a2.words[b2.length + j2 - 1] | 0); qj = Math.min(qj / bhi | 0, 67108863); a2._ishlnsubmul(b2, qj, j2); while (a2.negative !== 0) { qj--; a2.negative = 0; a2._ishlnsubmul(b2, 1, j2); if (!a2.isZero()) { a2.negative ^= 1; } } if (q2) { q2.words[j2] = qj; } } if (q2) { q2._strip(); } a2._strip(); if (mode2 !== "div" && shift !== 0) { a2.iushrn(shift); } return { div: q2 || null, mod: a2 }; }; BN2.prototype.divmod = function divmod(num, mode2, positive) { assert2(!num.isZero()); if (this.isZero()) { return { div: new BN2(0), mod: new BN2(0) }; } var div, mod, res; if (this.negative !== 0 && num.negative === 0) { res = this.neg().divmod(num, mode2); if (mode2 !== "mod") { div = res.div.neg(); } if (mode2 !== "div") { mod = res.mod.neg(); if (positive && mod.negative !== 0) { mod.iadd(num); } } return { div, mod }; } if (this.negative === 0 && num.negative !== 0) { res = this.divmod(num.neg(), mode2); if (mode2 !== "mod") { div = res.div.neg(); } return { div, mod: res.mod }; } if ((this.negative & num.negative) !== 0) { res = this.neg().divmod(num.neg(), mode2); if (mode2 !== "div") { mod = res.mod.neg(); if (positive && mod.negative !== 0) { mod.isub(num); } } return { div: res.div, mod }; } if (num.length > this.length || this.cmp(num) < 0) { return { div: new BN2(0), mod: this }; } if (num.length === 1) { if (mode2 === "div") { return { div: this.divn(num.words[0]), mod: null }; } if (mode2 === "mod") { return { div: null, mod: new BN2(this.modrn(num.words[0])) }; } return { div: this.divn(num.words[0]), mod: new BN2(this.modrn(num.words[0])) }; } return this._wordDiv(num, mode2); }; BN2.prototype.div = function div(num) { return this.divmod(num, "div", false).div; }; BN2.prototype.mod = function mod(num) { return this.divmod(num, "mod", false).mod; }; BN2.prototype.umod = function umod(num) { return this.divmod(num, "mod", true).mod; }; BN2.prototype.divRound = function divRound(num) { var dm = this.divmod(num); if (dm.mod.isZero()) return dm.div; var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; var half = num.ushrn(1); var r2 = num.andln(1); var cmp2 = mod.cmp(half); if (cmp2 < 0 || r2 === 1 && cmp2 === 0) return dm.div; return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); }; BN2.prototype.modrn = function modrn(num) { var isNegNum = num < 0; if (isNegNum) num = -num; assert2(num <= 67108863); var p2 = (1 << 26) % num; var acc = 0; for (var i2 = this.length - 1; i2 >= 0; i2--) { acc = (p2 * acc + (this.words[i2] | 0)) % num; } return isNegNum ? -acc : acc; }; BN2.prototype.modn = function modn(num) { return this.modrn(num); }; BN2.prototype.idivn = function idivn(num) { var isNegNum = num < 0; if (isNegNum) num = -num; assert2(num <= 67108863); var carry = 0; for (var i2 = this.length - 1; i2 >= 0; i2--) { var w2 = (this.words[i2] | 0) + carry * 67108864; this.words[i2] = w2 / num | 0; carry = w2 % num; } this._strip(); return isNegNum ? this.ineg() : this; }; BN2.prototype.divn = function divn(num) { return this.clone().idivn(num); }; BN2.prototype.egcd = function egcd(p2) { assert2(p2.negative === 0); assert2(!p2.isZero()); var x2 = this; var y2 = p2.clone(); if (x2.negative !== 0) { x2 = x2.umod(p2); } else { x2 = x2.clone(); } var A2 = new BN2(1); var B2 = new BN2(0); var C2 = new BN2(0); var D2 = new BN2(1); var g2 = 0; while (x2.isEven() && y2.isEven()) { x2.iushrn(1); y2.iushrn(1); ++g2; } var yp = y2.clone(); var xp = x2.clone(); while (!x2.isZero()) { for (var i2 = 0, im = 1; (x2.words[0] & im) === 0 && i2 < 26; ++i2, im <<= 1) ; if (i2 > 0) { x2.iushrn(i2); while (i2-- > 0) { if (A2.isOdd() || B2.isOdd()) { A2.iadd(yp); B2.isub(xp); } A2.iushrn(1); B2.iushrn(1); } } for (var j2 = 0, jm = 1; (y2.words[0] & jm) === 0 && j2 < 26; ++j2, jm <<= 1) ; if (j2 > 0) { y2.iushrn(j2); while (j2-- > 0) { if (C2.isOdd() || D2.isOdd()) { C2.iadd(yp); D2.isub(xp); } C2.iushrn(1); D2.iushrn(1); } } if (x2.cmp(y2) >= 0) { x2.isub(y2); A2.isub(C2); B2.isub(D2); } else { y2.isub(x2); C2.isub(A2); D2.isub(B2); } } return { a: C2, b: D2, gcd: y2.iushln(g2) }; }; BN2.prototype._invmp = function _invmp(p2) { assert2(p2.negative === 0); assert2(!p2.isZero()); var a2 = this; var b2 = p2.clone(); if (a2.negative !== 0) { a2 = a2.umod(p2); } else { a2 = a2.clone(); } var x1 = new BN2(1); var x2 = new BN2(0); var delta = b2.clone(); while (a2.cmpn(1) > 0 && b2.cmpn(1) > 0) { for (var i2 = 0, im = 1; (a2.words[0] & im) === 0 && i2 < 26; ++i2, im <<= 1) ; if (i2 > 0) { a2.iushrn(i2); while (i2-- > 0) { if (x1.isOdd()) { x1.iadd(delta); } x1.iushrn(1); } } for (var j2 = 0, jm = 1; (b2.words[0] & jm) === 0 && j2 < 26; ++j2, jm <<= 1) ; if (j2 > 0) { b2.iushrn(j2); while (j2-- > 0) { if (x2.isOdd()) { x2.iadd(delta); } x2.iushrn(1); } } if (a2.cmp(b2) >= 0) { a2.isub(b2); x1.isub(x2); } else { b2.isub(a2); x2.isub(x1); } } var res; if (a2.cmpn(1) === 0) { res = x1; } else { res = x2; } if (res.cmpn(0) < 0) { res.iadd(p2); } return res; }; BN2.prototype.gcd = function gcd(num) { if (this.isZero()) return num.abs(); if (num.isZero()) return this.abs(); var a2 = this.clone(); var b2 = num.clone(); a2.negative = 0; b2.negative = 0; for (var shift = 0; a2.isEven() && b2.isEven(); shift++) { a2.iushrn(1); b2.iushrn(1); } do { while (a2.isEven()) { a2.iushrn(1); } while (b2.isEven()) { b2.iushrn(1); } var r2 = a2.cmp(b2); if (r2 < 0) { var t2 = a2; a2 = b2; b2 = t2; } else if (r2 === 0 || b2.cmpn(1) === 0) { break; } a2.isub(b2); } while (true); return b2.iushln(shift); }; BN2.prototype.invm = function invm(num) { return this.egcd(num).a.umod(num); }; BN2.prototype.isEven = function isEven() { return (this.words[0] & 1) === 0; }; BN2.prototype.isOdd = function isOdd() { return (this.words[0] & 1) === 1; }; BN2.prototype.andln = function andln(num) { return this.words[0] & num; }; BN2.prototype.bincn = function bincn(bit) { assert2(typeof bit === "number"); var r2 = bit % 26; var s2 = (bit - r2) / 26; var q2 = 1 << r2; if (this.length <= s2) { this._expand(s2 + 1); this.words[s2] |= q2; return this; } var carry = q2; for (var i2 = s2; carry !== 0 && i2 < this.length; i2++) { var w2 = this.words[i2] | 0; w2 += carry; carry = w2 >>> 26; w2 &= 67108863; this.words[i2] = w2; } if (carry !== 0) { this.words[i2] = carry; this.length++; } return this; }; BN2.prototype.isZero = function isZero() { return this.length === 1 && this.words[0] === 0; }; BN2.prototype.cmpn = function cmpn(num) { var negative = num < 0; if (this.negative !== 0 && !negative) return -1; if (this.negative === 0 && negative) return 1; this._strip(); var res; if (this.length > 1) { res = 1; } else { if (negative) { num = -num; } assert2(num <= 67108863, "Number is too big"); var w2 = this.words[0] | 0; res = w2 === num ? 0 : w2 < num ? -1 : 1; } if (this.negative !== 0) return -res | 0; return res; }; BN2.prototype.cmp = function cmp2(num) { if (this.negative !== 0 && num.negative === 0) return -1; if (this.negative === 0 && num.negative !== 0) return 1; var res = this.ucmp(num); if (this.negative !== 0) return -res | 0; return res; }; BN2.prototype.ucmp = function ucmp(num) { if (this.length > num.length) return 1; if (this.length < num.length) return -1; var res = 0; for (var i2 = this.length - 1; i2 >= 0; i2--) { var a2 = this.words[i2] | 0; var b2 = num.words[i2] | 0; if (a2 === b2) continue; if (a2 < b2) { res = -1; } else if (a2 > b2) { res = 1; } break; } return res; }; BN2.prototype.gtn = function gtn(num) { return this.cmpn(num) === 1; }; BN2.prototype.gt = function gt2(num) { return this.cmp(num) === 1; }; BN2.prototype.gten = function gten(num) { return this.cmpn(num) >= 0; }; BN2.prototype.gte = function gte2(num) { return this.cmp(num) >= 0; }; BN2.prototype.ltn = function ltn(num) { return this.cmpn(num) === -1; }; BN2.prototype.lt = function lt2(num) { return this.cmp(num) === -1; }; BN2.prototype.lten = function lten(num) { return this.cmpn(num) <= 0; }; BN2.prototype.lte = function lte2(num) { return this.cmp(num) <= 0; }; BN2.prototype.eqn = function eqn(num) { return this.cmpn(num) === 0; }; BN2.prototype.eq = function eq2(num) { return this.cmp(num) === 0; }; BN2.red = function red(num) { return new Red(num); }; BN2.prototype.toRed = function toRed(ctx) { assert2(!this.red, "Already a number in reduction context"); assert2(this.negative === 0, "red works only with positives"); return ctx.convertTo(this)._forceRed(ctx); }; BN2.prototype.fromRed = function fromRed() { assert2(this.red, "fromRed works only with numbers in reduction context"); return this.red.convertFrom(this); }; BN2.prototype._forceRed = function _forceRed(ctx) { this.red = ctx; return this; }; BN2.prototype.forceRed = function forceRed(ctx) { assert2(!this.red, "Already a number in reduction context"); return this._forceRed(ctx); }; BN2.prototype.redAdd = function redAdd(num) { assert2(this.red, "redAdd works only with red numbers"); return this.red.add(this, num); }; BN2.prototype.redIAdd = function redIAdd(num) { assert2(this.red, "redIAdd works only with red numbers"); return this.red.iadd(this, num); }; BN2.prototype.redSub = function redSub(num) { assert2(this.red, "redSub works only with red numbers"); return this.red.sub(this, num); }; BN2.prototype.redISub = function redISub(num) { assert2(this.red, "redISub works only with red numbers"); return this.red.isub(this, num); }; BN2.prototype.redShl = function redShl(num) { assert2(this.red, "redShl works only with red numbers"); return this.red.shl(this, num); }; BN2.prototype.redMul = function redMul(num) { assert2(this.red, "redMul works only with red numbers"); this.red._verify2(this, num); return this.red.mul(this, num); }; BN2.prototype.redIMul = function redIMul(num) { assert2(this.red, "redMul works only with red numbers"); this.red._verify2(this, num); return this.red.imul(this, num); }; BN2.prototype.redSqr = function redSqr() { assert2(this.red, "redSqr works only with red numbers"); this.red._verify1(this); return this.red.sqr(this); }; BN2.prototype.redISqr = function redISqr() { assert2(this.red, "redISqr works only with red numbers"); this.red._verify1(this); return this.red.isqr(this); }; BN2.prototype.redSqrt = function redSqrt() { assert2(this.red, "redSqrt works only with red numbers"); this.red._verify1(this); return this.red.sqrt(this); }; BN2.prototype.redInvm = function redInvm() { assert2(this.red, "redInvm works only with red numbers"); this.red._verify1(this); return this.red.invm(this); }; BN2.prototype.redNeg = function redNeg() { assert2(this.red, "redNeg works only with red numbers"); this.red._verify1(this); return this.red.neg(this); }; BN2.prototype.redPow = function redPow(num) { assert2(this.red && !num.red, "redPow(normalNum)"); this.red._verify1(this); return this.red.pow(this, num); }; var primes = { k256: null, p224: null, p192: null, p25519: null }; function MPrime(name2, p2) { this.name = name2; this.p = new BN2(p2, 16); this.n = this.p.bitLength(); this.k = new BN2(1).iushln(this.n).isub(this.p); this.tmp = this._tmp(); } MPrime.prototype._tmp = function _tmp() { var tmp = new BN2(null); tmp.words = new Array(Math.ceil(this.n / 13)); return tmp; }; MPrime.prototype.ireduce = function ireduce(num) { var r2 = num; var rlen; do { this.split(r2, this.tmp); r2 = this.imulK(r2); r2 = r2.iadd(this.tmp); rlen = r2.bitLength(); } while (rlen > this.n); var cmp2 = rlen < this.n ? -1 : r2.ucmp(this.p); if (cmp2 === 0) { r2.words[0] = 0; r2.length = 1; } else if (cmp2 > 0) { r2.isub(this.p); } else { if (r2.strip !== void 0) { r2.strip(); } else { r2._strip(); } } return r2; }; MPrime.prototype.split = function split2(input, out) { input.iushrn(this.n, 0, out); }; MPrime.prototype.imulK = function imulK(num) { return num.imul(this.k); }; function K256() { MPrime.call( this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f" ); } inherits2(K256, MPrime); K256.prototype.split = function split2(input, output2) { var mask2 = 4194303; var outLen = Math.min(input.length, 9); for (var i2 = 0; i2 < outLen; i2++) { output2.words[i2] = input.words[i2]; } output2.length = outLen; if (input.length <= 9) { input.words[0] = 0; input.length = 1; return; } var prev = input.words[9]; output2.words[output2.length++] = prev & mask2; for (i2 = 10; i2 < input.length; i2++) { var next = input.words[i2] | 0; input.words[i2 - 10] = (next & mask2) << 4 | prev >>> 22; prev = next; } prev >>>= 22; input.words[i2 - 10] = prev; if (prev === 0 && input.length > 10) { input.length -= 10; } else { input.length -= 9; } }; K256.prototype.imulK = function imulK(num) { num.words[num.length] = 0; num.words[num.length + 1] = 0; num.length += 2; var lo2 = 0; for (var i2 = 0; i2 < num.length; i2++) { var w2 = num.words[i2] | 0; lo2 += w2 * 977; num.words[i2] = lo2 & 67108863; lo2 = w2 * 64 + (lo2 / 67108864 | 0); } if (num.words[num.length - 1] === 0) { num.length--; if (num.words[num.length - 1] === 0) { num.length--; } } return num; }; function P224() { MPrime.call( this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001" ); } inherits2(P224, MPrime); function P192() { MPrime.call( this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff" ); } inherits2(P192, MPrime); function P25519() { MPrime.call( this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed" ); } inherits2(P25519, MPrime); P25519.prototype.imulK = function imulK(num) { var carry = 0; for (var i2 = 0; i2 < num.length; i2++) { var hi = (num.words[i2] | 0) * 19 + carry; var lo2 = hi & 67108863; hi >>>= 26; num.words[i2] = lo2; carry = hi; } if (carry !== 0) { num.words[num.length++] = carry; } return num; }; BN2._prime = function prime(name2) { if (primes[name2]) return primes[name2]; var prime2; if (name2 === "k256") { prime2 = new K256(); } else if (name2 === "p224") { prime2 = new P224(); } else if (name2 === "p192") { prime2 = new P192(); } else if (name2 === "p25519") { prime2 = new P25519(); } else { throw new Error("Unknown prime " + name2); } primes[name2] = prime2; return prime2; }; function Red(m2) { if (typeof m2 === "string") { var prime = BN2._prime(m2); this.m = prime.p; this.prime = prime; } else { assert2(m2.gtn(1), "modulus must be greater than 1"); this.m = m2; this.prime = null; } } Red.prototype._verify1 = function _verify1(a2) { assert2(a2.negative === 0, "red works only with positives"); assert2(a2.red, "red works only with red numbers"); }; Red.prototype._verify2 = function _verify2(a2, b2) { assert2((a2.negative | b2.negative) === 0, "red works only with positives"); assert2( a2.red && a2.red === b2.red, "red works only with red numbers" ); }; Red.prototype.imod = function imod(a2) { if (this.prime) return this.prime.ireduce(a2)._forceRed(this); move(a2, a2.umod(this.m)._forceRed(this)); return a2; }; Red.prototype.neg = function neg(a2) { if (a2.isZero()) { return a2.clone(); } return this.m.sub(a2)._forceRed(this); }; Red.prototype.add = function add(a2, b2) { this._verify2(a2, b2); var res = a2.add(b2); if (res.cmp(this.m) >= 0) { res.isub(this.m); } return res._forceRed(this); }; Red.prototype.iadd = function iadd(a2, b2) { this._verify2(a2, b2); var res = a2.iadd(b2); if (res.cmp(this.m) >= 0) { res.isub(this.m); } return res; }; Red.prototype.sub = function sub(a2, b2) { this._verify2(a2, b2); var res = a2.sub(b2); if (res.cmpn(0) < 0) { res.iadd(this.m); } return res._forceRed(this); }; Red.prototype.isub = function isub(a2, b2) { this._verify2(a2, b2); var res = a2.isub(b2); if (res.cmpn(0) < 0) { res.iadd(this.m); } return res; }; Red.prototype.shl = function shl(a2, num) { this._verify1(a2); return this.imod(a2.ushln(num)); }; Red.prototype.imul = function imul(a2, b2) { this._verify2(a2, b2); return this.imod(a2.imul(b2)); }; Red.prototype.mul = function mul(a2, b2) { this._verify2(a2, b2); return this.imod(a2.mul(b2)); }; Red.prototype.isqr = function isqr(a2) { return this.imul(a2, a2.clone()); }; Red.prototype.sqr = function sqr(a2) { return this.mul(a2, a2); }; Red.prototype.sqrt = function sqrt(a2) { if (a2.isZero()) return a2.clone(); var mod3 = this.m.andln(3); assert2(mod3 % 2 === 1); if (mod3 === 3) { var pow = this.m.add(new BN2(1)).iushrn(2); return this.pow(a2, pow); } var q2 = this.m.subn(1); var s2 = 0; while (!q2.isZero() && q2.andln(1) === 0) { s2++; q2.iushrn(1); } assert2(!q2.isZero()); var one = new BN2(1).toRed(this); var nOne = one.redNeg(); var lpow = this.m.subn(1).iushrn(1); var z2 = this.m.bitLength(); z2 = new BN2(2 * z2 * z2).toRed(this); while (this.pow(z2, lpow).cmp(nOne) !== 0) { z2.redIAdd(nOne); } var c2 = this.pow(z2, q2); var r2 = this.pow(a2, q2.addn(1).iushrn(1)); var t2 = this.pow(a2, q2); var m2 = s2; while (t2.cmp(one) !== 0) { var tmp = t2; for (var i2 = 0; tmp.cmp(one) !== 0; i2++) { tmp = tmp.redSqr(); } assert2(i2 < m2); var b2 = this.pow(c2, new BN2(1).iushln(m2 - i2 - 1)); r2 = r2.redMul(b2); c2 = b2.redSqr(); t2 = t2.redMul(c2); m2 = i2; } return r2; }; Red.prototype.invm = function invm(a2) { var inv = a2._invmp(this.m); if (inv.negative !== 0) { inv.negative = 0; return this.imod(inv).redNeg(); } else { return this.imod(inv); } }; Red.prototype.pow = function pow(a2, num) { if (num.isZero()) return new BN2(1).toRed(this); if (num.cmpn(1) === 0) return a2.clone(); var windowSize = 4; var wnd = new Array(1 << windowSize); wnd[0] = new BN2(1).toRed(this); wnd[1] = a2; for (var i2 = 2; i2 < wnd.length; i2++) { wnd[i2] = this.mul(wnd[i2 - 1], a2); } var res = wnd[0]; var current = 0; var currentLen = 0; var start = num.bitLength() % 26; if (start === 0) { start = 26; } for (i2 = num.length - 1; i2 >= 0; i2--) { var word = num.words[i2]; for (var j2 = start - 1; j2 >= 0; j2--) { var bit = word >> j2 & 1; if (res !== wnd[0]) { res = this.sqr(res); } if (bit === 0 && current === 0) { currentLen = 0; continue; } current <<= 1; current |= bit; currentLen++; if (currentLen !== windowSize && (i2 !== 0 || j2 !== 0)) continue; res = this.mul(res, wnd[current]); currentLen = 0; current = 0; } start = 26; } return res; }; Red.prototype.convertTo = function convertTo(num) { var r2 = num.umod(this.m); return r2 === num ? r2.clone() : r2; }; Red.prototype.convertFrom = function convertFrom(num) { var res = num.clone(); res.red = null; return res; }; BN2.mont = function mont(num) { return new Mont(num); }; function Mont(m2) { Red.call(this, m2); this.shift = this.m.bitLength(); if (this.shift % 26 !== 0) { this.shift += 26 - this.shift % 26; } this.r = new BN2(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); } inherits2(Mont, Red); Mont.prototype.convertTo = function convertTo(num) { return this.imod(num.ushln(this.shift)); }; Mont.prototype.convertFrom = function convertFrom(num) { var r2 = this.imod(num.mul(this.rinv)); r2.red = null; return r2; }; Mont.prototype.imul = function imul(a2, b2) { if (a2.isZero() || b2.isZero()) { a2.words[0] = 0; a2.length = 1; return a2; } var t2 = a2.imul(b2); var c2 = t2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); var u2 = t2.isub(c2).iushrn(this.shift); var res = u2; if (u2.cmp(this.m) >= 0) { res = u2.isub(this.m); } else if (u2.cmpn(0) < 0) { res = u2.iadd(this.m); } return res._forceRed(this); }; Mont.prototype.mul = function mul(a2, b2) { if (a2.isZero() || b2.isZero()) return new BN2(0)._forceRed(this); var t2 = a2.mul(b2); var c2 = t2.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); var u2 = t2.isub(c2).iushrn(this.shift); var res = u2; if (u2.cmp(this.m) >= 0) { res = u2.isub(this.m); } else if (u2.cmpn(0) < 0) { res = u2.iadd(this.m); } return res._forceRed(this); }; Mont.prototype.invm = function invm(a2) { var res = this.imod(a2._invmp(this.m).mul(this.r2)); return res._forceRed(this); }; })(module2, commonjsGlobal); })(bn); var bnExports = bn.exports; var error = {}; var constants$3 = {}; Object.defineProperty(constants$3, "__esModule", { value: true }); constants$3.errorValues = constants$3.standardErrorCodes = void 0; constants$3.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 } }; constants$3.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 errors$1 = {}; var utils$1 = {}; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.serialize = exports3.getErrorCode = exports3.isValidCode = exports3.getMessageFromCode = exports3.JSON_RPC_SERVER_ERROR_MESSAGE = void 0; const constants_12 = constants$3; const FALLBACK_MESSAGE = "Unspecified error message."; exports3.JSON_RPC_SERVER_ERROR_MESSAGE = "Unspecified server error."; function getMessageFromCode(code2, fallbackMessage = FALLBACK_MESSAGE) { if (code2 && Number.isInteger(code2)) { const codeString = code2.toString(); if (hasKey(constants_12.errorValues, codeString)) { return constants_12.errorValues[codeString].message; } if (isJsonRpcServerError(code2)) { return exports3.JSON_RPC_SERVER_ERROR_MESSAGE; } } return fallbackMessage; } exports3.getMessageFromCode = getMessageFromCode; function isValidCode(code2) { if (!Number.isInteger(code2)) { return false; } const codeString = code2.toString(); if (constants_12.errorValues[codeString]) { return true; } if (isJsonRpcServerError(code2)) { return true; } return false; } exports3.isValidCode = isValidCode; function getErrorCode(error2) { var _a2; if (typeof error2 === "number") { return error2; } else if (isErrorWithCode(error2)) { return (_a2 = error2.code) !== null && _a2 !== void 0 ? _a2 : error2.errorCode; } return void 0; } exports3.getErrorCode = getErrorCode; function isErrorWithCode(error2) { return typeof error2 === "object" && error2 !== null && (typeof error2.code === "number" || typeof error2.errorCode === "number"); } function serialize2(error2, { shouldIncludeStack = false } = {}) { const serialized = {}; if (error2 && typeof error2 === "object" && !Array.isArray(error2) && hasKey(error2, "code") && isValidCode(error2.code)) { const _error = error2; serialized.code = _error.code; if (_error.message && typeof _error.message === "string") { serialized.message = _error.message; if (hasKey(_error, "data")) { serialized.data = _error.data; } } else { serialized.message = getMessageFromCode(serialized.code); serialized.data = { originalError: assignOriginalError(error2) }; } } else { serialized.code = constants_12.standardErrorCodes.rpc.internal; serialized.message = hasStringProperty(error2, "message") ? error2.message : FALLBACK_MESSAGE; serialized.data = { originalError: assignOriginalError(error2) }; } if (shouldIncludeStack) { serialized.stack = hasStringProperty(error2, "stack") ? error2.stack : void 0; } return serialized; } exports3.serialize = serialize2; function isJsonRpcServerError(code2) { return code2 >= -32099 && code2 <= -32e3; } function assignOriginalError(error2) { if (error2 && typeof error2 === "object" && !Array.isArray(error2)) { return Object.assign({}, error2); } return error2; } function hasKey(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); } function hasStringProperty(obj, prop) { return typeof obj === "object" && obj !== null && prop in obj && typeof obj[prop] === "string"; } })(utils$1); Object.defineProperty(errors$1, "__esModule", { value: true }); errors$1.standardErrors = void 0; const constants_1$2 = constants$3; const utils_1$2 = utils$1; errors$1.standardErrors = { rpc: { parse: (arg) => getEthJsonRpcError$1(constants_1$2.standardErrorCodes.rpc.parse, arg), invalidRequest: (arg) => getEthJsonRpcError$1(constants_1$2.standardErrorCodes.rpc.invalidRequest, arg), invalidParams: (arg) => getEthJsonRpcError$1(constants_1$2.standardErrorCodes.rpc.invalidParams, arg), methodNotFound: (arg) => getEthJsonRpcError$1(constants_1$2.standardErrorCodes.rpc.methodNotFound, arg), internal: (arg) => getEthJsonRpcError$1(constants_1$2.standardErrorCodes.rpc.internal, arg), server: (opts) => { if (!opts || typeof opts !== "object" || Array.isArray(opts)) { throw new Error("Ethereum RPC Server errors must provide single object argument."); } const { code: code2 } = opts; if (!Number.isInteger(code2) || code2 > -32005 || code2 < -32099) { throw new Error('"code" must be an integer such that: -32099 <= code <= -32005'); } return getEthJsonRpcError$1(code2, opts); }, invalidInput: (arg) => getEthJsonRpcError$1(constants_1$2.standardErrorCodes.rpc.invalidInput, arg), resourceNotFound: (arg) => getEthJsonRpcError$1(constants_1$2.standardErrorCodes.rpc.resourceNotFound, arg), resourceUnavailable: (arg) => getEthJsonRpcError$1(constants_1$2.standardErrorCodes.rpc.resourceUnavailable, arg), transactionRejected: (arg) => getEthJsonRpcError$1(constants_1$2.standardErrorCodes.rpc.transactionRejected, arg), methodNotSupported: (arg) => getEthJsonRpcError$1(constants_1$2.standardErrorCodes.rpc.methodNotSupported, arg), limitExceeded: (arg) => getEthJsonRpcError$1(constants_1$2.standardErrorCodes.rpc.limitExceeded, arg) }, provider: { userRejectedRequest: (arg) => { return getEthProviderError$1(constants_1$2.standardErrorCodes.provider.userRejectedRequest, arg); }, unauthorized: (arg) => { return getEthProviderError$1(constants_1$2.standardErrorCodes.provider.unauthorized, arg); }, unsupportedMethod: (arg) => { return getEthProviderError$1(constants_1$2.standardErrorCodes.provider.unsupportedMethod, arg); }, disconnected: (arg) => { return getEthProviderError$1(constants_1$2.standardErrorCodes.provider.disconnected, arg); }, chainDisconnected: (arg) => { return getEthProviderError$1(constants_1$2.standardErrorCodes.provider.chainDisconnected, arg); }, unsupportedChain: (arg) => { return getEthProviderError$1(constants_1$2.standardErrorCodes.provider.unsupportedChain, arg); }, custom: (opts) => { if (!opts || typeof opts !== "object" || Array.isArray(opts)) { throw new Error("Ethereum Provider custom errors must provide single object argument."); } const { code: code2, message, data: data2 } = opts; if (!message || typeof message !== "string") { throw new Error('"message" must be a nonempty string'); } return new EthereumProviderError$1(code2, message, data2); } } }; function getEthJsonRpcError$1(code2, arg) { const [message, data2] = parseOpts$1(arg); return new EthereumRpcError$1(code2, message || (0, utils_1$2.getMessageFromCode)(code2), data2); } function getEthProviderError$1(code2, arg) { const [message, data2] = parseOpts$1(arg); return new EthereumProviderError$1(code2, message || (0, utils_1$2.getMessageFromCode)(code2), data2); } function parseOpts$1(arg) { if (arg) { if (typeof arg === "string") { return [arg]; } else if (typeof arg === "object" && !Array.isArray(arg)) { const { message, data: data2 } = arg; if (message && typeof message !== "string") { throw new Error("Must specify string message."); } return [message || void 0, data2]; } } return []; } let EthereumRpcError$1 = class EthereumRpcError extends Error { constructor(code2, message, data2) { if (!Number.isInteger(code2)) { throw new Error('"code" must be an integer.'); } if (!message || typeof message !== "string") { throw new Error('"message" must be a nonempty string.'); } super(message); this.code = code2; if (data2 !== void 0) { this.data = data2; } } }; let EthereumProviderError$1 = class EthereumProviderError extends EthereumRpcError$1 { /** * Create an Ethereum Provider JSON-RPC error. * `code` must be an integer in the 1000 <= 4999 range. */ constructor(code2, message, data2) { if (!isValidEthProviderCode$1(code2)) { throw new Error('"code" must be an integer such that: 1000 <= code <= 4999'); } super(code2, message, data2); } }; function isValidEthProviderCode$1(code2) { return Number.isInteger(code2) && code2 >= 1e3 && code2 <= 4999; } var serialize = {}; var Web3Response = {}; Object.defineProperty(Web3Response, "__esModule", { value: true }); Web3Response.isErrorResponse = void 0; function isErrorResponse(response) { return response.errorMessage !== void 0; } Web3Response.isErrorResponse = isErrorResponse; var version = {}; Object.defineProperty(version, "__esModule", { value: true }); version.LIB_VERSION = void 0; version.LIB_VERSION = "3.9.3"; Object.defineProperty(serialize, "__esModule", { value: true }); serialize.serializeError = void 0; const Web3Response_1$2 = Web3Response; const version_1$2 = version; const constants_1$1 = constants$3; const utils_1$1 = utils$1; function serializeError(error2, requestOrMethod) { const serialized = (0, utils_1$1.serialize)(getErrorObject(error2), { shouldIncludeStack: true }); const docUrl = new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors"); docUrl.searchParams.set("version", version_1$2.LIB_VERSION); docUrl.searchParams.set("code", serialized.code.toString()); const method = getMethod(serialized.data, requestOrMethod); if (method) { docUrl.searchParams.set("method", method); } docUrl.searchParams.set("message", serialized.message); return Object.assign(Object.assign({}, serialized), { docUrl: docUrl.href }); } serialize.serializeError = serializeError; function getErrorObject(error2) { if (typeof error2 === "string") { return { message: error2, code: constants_1$1.standardErrorCodes.rpc.internal }; } else if ((0, Web3Response_1$2.isErrorResponse)(error2)) { return Object.assign(Object.assign({}, error2), { message: error2.errorMessage, code: error2.errorCode, data: { method: error2.method } }); } return error2; } function getMethod(serializedData, request) { const methodInData = serializedData === null || serializedData === void 0 ? void 0 : serializedData.method; if (methodInData) { return methodInData; } if (request === void 0) { return void 0; } else if (typeof request === "string") { return request; } else if (!Array.isArray(request)) { return request.method; } else if (request.length > 0) { return request[0].method; } return void 0; } (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.standardErrors = exports3.standardErrorCodes = exports3.serializeError = exports3.getMessageFromCode = exports3.getErrorCode = void 0; const constants_12 = constants$3; Object.defineProperty(exports3, "standardErrorCodes", { enumerable: true, get: function() { return constants_12.standardErrorCodes; } }); const errors_1 = errors$1; Object.defineProperty(exports3, "standardErrors", { enumerable: true, get: function() { return errors_1.standardErrors; } }); const serialize_1 = serialize; Object.defineProperty(exports3, "serializeError", { enumerable: true, get: function() { return serialize_1.serializeError; } }); const utils_12 = utils$1; Object.defineProperty(exports3, "getErrorCode", { enumerable: true, get: function() { return utils_12.getErrorCode; } }); Object.defineProperty(exports3, "getMessageFromCode", { enumerable: true, get: function() { return utils_12.getMessageFromCode; } }); })(error); var type$1 = {}; Object.defineProperty(type$1, "__esModule", { value: true }); type$1.ProviderType = type$1.RegExpString = type$1.IntNumber = type$1.BigIntString = type$1.AddressString = type$1.HexString = type$1.OpaqueType = void 0; function OpaqueType() { return (value) => value; } type$1.OpaqueType = OpaqueType; type$1.HexString = OpaqueType(); type$1.AddressString = OpaqueType(); type$1.BigIntString = OpaqueType(); function IntNumber(num) { return Math.floor(num); } type$1.IntNumber = IntNumber; type$1.RegExpString = OpaqueType(); var ProviderType; (function(ProviderType2) { ProviderType2["CoinbaseWallet"] = "CoinbaseWallet"; ProviderType2["MetaMask"] = "MetaMask"; ProviderType2["Unselected"] = ""; })(ProviderType || (type$1.ProviderType = ProviderType = {})); var __importDefault$e = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(util$3, "__esModule", { value: true }); util$3.isMobileWeb = util$3.getLocation = util$3.isInIFrame = util$3.createQrUrl = util$3.getFavicon = util$3.range = util$3.isBigNumber = util$3.ensureParsedJSONObject = util$3.ensureBN = util$3.ensureRegExpString = util$3.ensureIntNumber = util$3.ensureBuffer = util$3.ensureAddressString = util$3.ensureEvenLengthHexString = util$3.ensureHexString = util$3.isHexString = util$3.prepend0x = util$3.strip0x = util$3.has0xPrefix = util$3.hexStringFromIntNumber = util$3.intNumberFromHexString = util$3.bigIntStringFromBN = util$3.hexStringFromBuffer = util$3.hexStringToUint8Array = util$3.uint8ArrayToHex = util$3.randomBytesHex = void 0; const bn_js_1$1 = __importDefault$e(bnExports); const error_1$3 = error; const type_1$3 = type$1; const INT_STRING_REGEX = /^[0-9]*$/; const HEXADECIMAL_STRING_REGEX = /^[a-f0-9]*$/; function randomBytesHex(length) { return uint8ArrayToHex(crypto.getRandomValues(new Uint8Array(length))); } util$3.randomBytesHex = randomBytesHex; function uint8ArrayToHex(value) { return [...value].map((b2) => b2.toString(16).padStart(2, "0")).join(""); } util$3.uint8ArrayToHex = uint8ArrayToHex; function hexStringToUint8Array(hexString) { return new Uint8Array(hexString.match(/.{1,2}/g).map((byte2) => parseInt(byte2, 16))); } util$3.hexStringToUint8Array = hexStringToUint8Array; function hexStringFromBuffer(buf, includePrefix = false) { const hex2 = buf.toString("hex"); return (0, type_1$3.HexString)(includePrefix ? `0x${hex2}` : hex2); } util$3.hexStringFromBuffer = hexStringFromBuffer; function bigIntStringFromBN(bn2) { return (0, type_1$3.BigIntString)(bn2.toString(10)); } util$3.bigIntStringFromBN = bigIntStringFromBN; function intNumberFromHexString(hex2) { return (0, type_1$3.IntNumber)(new bn_js_1$1.default(ensureEvenLengthHexString(hex2, false), 16).toNumber()); } util$3.intNumberFromHexString = intNumberFromHexString; function hexStringFromIntNumber(num) { return (0, type_1$3.HexString)(`0x${new bn_js_1$1.default(num).toString(16)}`); } util$3.hexStringFromIntNumber = hexStringFromIntNumber; function has0xPrefix(str) { return str.startsWith("0x") || str.startsWith("0X"); } util$3.has0xPrefix = has0xPrefix; function strip0x(hex2) { if (has0xPrefix(hex2)) { return hex2.slice(2); } return hex2; } util$3.strip0x = strip0x; function prepend0x(hex2) { if (has0xPrefix(hex2)) { return `0x${hex2.slice(2)}`; } return `0x${hex2}`; } util$3.prepend0x = prepend0x; function isHexString$1(hex2) { if (typeof hex2 !== "string") { return false; } const s2 = strip0x(hex2).toLowerCase(); return HEXADECIMAL_STRING_REGEX.test(s2); } util$3.isHexString = isHexString$1; function ensureHexString(hex2, includePrefix = false) { if (typeof hex2 === "string") { const s2 = strip0x(hex2).toLowerCase(); if (HEXADECIMAL_STRING_REGEX.test(s2)) { return (0, type_1$3.HexString)(includePrefix ? `0x${s2}` : s2); } } throw error_1$3.standardErrors.rpc.invalidParams(`"${String(hex2)}" is not a hexadecimal string`); } util$3.ensureHexString = ensureHexString; function ensureEvenLengthHexString(hex2, includePrefix = false) { let h2 = ensureHexString(hex2, false); if (h2.length % 2 === 1) { h2 = (0, type_1$3.HexString)(`0${h2}`); } return includePrefix ? (0, type_1$3.HexString)(`0x${h2}`) : h2; } util$3.ensureEvenLengthHexString = ensureEvenLengthHexString; function ensureAddressString(str) { if (typeof str === "string") { const s2 = strip0x(str).toLowerCase(); if (isHexString$1(s2) && s2.length === 40) { return (0, type_1$3.AddressString)(prepend0x(s2)); } } throw error_1$3.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(str)}`); } util$3.ensureAddressString = ensureAddressString; function ensureBuffer(str) { if (Buffer.isBuffer(str)) { return str; } if (typeof str === "string") { if (isHexString$1(str)) { const s2 = ensureEvenLengthHexString(str, false); return Buffer.from(s2, "hex"); } return Buffer.from(str, "utf8"); } throw error_1$3.standardErrors.rpc.invalidParams(`Not binary data: ${String(str)}`); } util$3.ensureBuffer = ensureBuffer; function ensureIntNumber(num) { if (typeof num === "number" && Number.isInteger(num)) { return (0, type_1$3.IntNumber)(num); } if (typeof num === "string") { if (INT_STRING_REGEX.test(num)) { return (0, type_1$3.IntNumber)(Number(num)); } if (isHexString$1(num)) { return (0, type_1$3.IntNumber)(new bn_js_1$1.default(ensureEvenLengthHexString(num, false), 16).toNumber()); } } throw error_1$3.standardErrors.rpc.invalidParams(`Not an integer: ${String(num)}`); } util$3.ensureIntNumber = ensureIntNumber; function ensureRegExpString(regExp) { if (regExp instanceof RegExp) { return (0, type_1$3.RegExpString)(regExp.toString()); } throw error_1$3.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(regExp)}`); } util$3.ensureRegExpString = ensureRegExpString; function ensureBN(val) { if (val !== null && (bn_js_1$1.default.isBN(val) || isBigNumber(val))) { return new bn_js_1$1.default(val.toString(10), 10); } if (typeof val === "number") { return new bn_js_1$1.default(ensureIntNumber(val)); } if (typeof val === "string") { if (INT_STRING_REGEX.test(val)) { return new bn_js_1$1.default(val, 10); } if (isHexString$1(val)) { return new bn_js_1$1.default(ensureEvenLengthHexString(val, false), 16); } } throw error_1$3.standardErrors.rpc.invalidParams(`Not an integer: ${String(val)}`); } util$3.ensureBN = ensureBN; function ensureParsedJSONObject(val) { if (typeof val === "string") { return JSON.parse(val); } if (typeof val === "object") { return val; } throw error_1$3.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(val)}`); } util$3.ensureParsedJSONObject = ensureParsedJSONObject; function isBigNumber(val) { if (val == null || typeof val.constructor !== "function") { return false; } const { constructor } = val; return typeof constructor.config === "function" && typeof constructor.EUCLID === "number"; } util$3.isBigNumber = isBigNumber; function range$1(start, stop) { return Array.from({ length: stop - start }, (_2, i2) => start + i2); } util$3.range = range$1; function getFavicon() { const el = document.querySelector('link[sizes="192x192"]') || document.querySelector('link[sizes="180x180"]') || document.querySelector('link[rel="icon"]') || document.querySelector('link[rel="shortcut icon"]'); const { protocol, host } = document.location; const href = el ? el.getAttribute("href") : null; if (!href || href.startsWith("javascript:") || href.startsWith("vbscript:")) { return null; } if (href.startsWith("http://") || href.startsWith("https://") || href.startsWith("data:")) { return href; } if (href.startsWith("//")) { return protocol + href; } return `${protocol}//${host}${href}`; } util$3.getFavicon = getFavicon; function createQrUrl(sessionId, sessionSecret, serverUrl, isParentConnection, version2, chainId) { const sessionIdKey = isParentConnection ? "parent-id" : "id"; const query2 = new URLSearchParams({ [sessionIdKey]: sessionId, secret: sessionSecret, server: serverUrl, v: version2, chainId: chainId.toString() }).toString(); const qrUrl = `${serverUrl}/#/link?${query2}`; return qrUrl; } util$3.createQrUrl = createQrUrl; function isInIFrame() { try { return window.frameElement !== null; } catch (e2) { return false; } } util$3.isInIFrame = isInIFrame; function getLocation() { try { if (isInIFrame() && window.top) { return window.top.location; } return window.location; } catch (e2) { return window.location; } } util$3.getLocation = getLocation; function isMobileWeb() { var _a2; return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((_a2 = window === null || window === void 0 ? void 0 : window.navigator) === null || _a2 === void 0 ? void 0 : _a2.userAgent); } util$3.isMobileWeb = isMobileWeb; var ScopedLocalStorage$1 = {}; Object.defineProperty(ScopedLocalStorage$1, "__esModule", { value: true }); ScopedLocalStorage$1.ScopedLocalStorage = void 0; class ScopedLocalStorage { // eslint-disable-next-line no-useless-constructor constructor(scope) { this.scope = scope; } setItem(key, value) { localStorage.setItem(this.scopedKey(key), value); } getItem(key) { return localStorage.getItem(this.scopedKey(key)); } removeItem(key) { localStorage.removeItem(this.scopedKey(key)); } clear() { const prefix = this.scopedKey(""); const keysToRemove = []; for (let i2 = 0; i2 < localStorage.length; i2++) { const key = localStorage.key(i2); if (typeof key === "string" && key.startsWith(prefix)) { keysToRemove.push(key); } } keysToRemove.forEach((key) => localStorage.removeItem(key)); } scopedKey(key) { return `${this.scope}:${key}`; } } ScopedLocalStorage$1.ScopedLocalStorage = ScopedLocalStorage; var CoinbaseWalletProvider$1 = {}; var eventemitter3 = { exports: {} }; (function(module2) { var has = Object.prototype.hasOwnProperty, prefix = "~"; function Events() { } if (Object.create) { Events.prototype = /* @__PURE__ */ Object.create(null); if (!new Events().__proto__) prefix = false; } function EE(fn2, context, once2) { this.fn = fn2; this.context = context; this.once = once2 || false; } function addListener(emitter, event, fn2, context, once2) { if (typeof fn2 !== "function") { throw new TypeError("The listener must be a function"); } var listener = new EE(fn2, context || emitter, once2), evt = prefix ? prefix + event : event; if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); else emitter._events[evt] = [emitter._events[evt], listener]; return emitter; } function clearEvent(emitter, evt) { if (--emitter._eventsCount === 0) emitter._events = new Events(); else delete emitter._events[evt]; } function EventEmitter2() { this._events = new Events(); this._eventsCount = 0; } EventEmitter2.prototype.eventNames = function eventNames() { var names = [], events2, name2; if (this._eventsCount === 0) return names; for (name2 in events2 = this._events) { if (has.call(events2, name2)) names.push(prefix ? name2.slice(1) : name2); } if (Object.getOwnPropertySymbols) { return names.concat(Object.getOwnPropertySymbols(events2)); } return names; }; EventEmitter2.prototype.listeners = function listeners(event) { var evt = prefix ? prefix + event : event, handlers = this._events[evt]; if (!handlers) return []; if (handlers.fn) return [handlers.fn]; for (var i2 = 0, l2 = handlers.length, ee2 = new Array(l2); i2 < l2; i2++) { ee2[i2] = handlers[i2].fn; } return ee2; }; EventEmitter2.prototype.listenerCount = function listenerCount2(event) { var evt = prefix ? prefix + event : event, listeners = this._events[evt]; if (!listeners) return 0; if (listeners.fn) return 1; return listeners.length; }; EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return false; var listeners = this._events[evt], len2 = arguments.length, args, i2; if (listeners.fn) { if (listeners.once) this.removeListener(event, listeners.fn, void 0, true); switch (len2) { case 1: return listeners.fn.call(listeners.context), true; case 2: return listeners.fn.call(listeners.context, a1), true; case 3: return listeners.fn.call(listeners.context, a1, a2), true; case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } for (i2 = 1, args = new Array(len2 - 1); i2 < len2; i2++) { args[i2 - 1] = arguments[i2]; } listeners.fn.apply(listeners.context, args); } else { var length = listeners.length, j2; for (i2 = 0; i2 < length; i2++) { if (listeners[i2].once) this.removeListener(event, listeners[i2].fn, void 0, true); switch (len2) { case 1: listeners[i2].fn.call(listeners[i2].context); break; case 2: listeners[i2].fn.call(listeners[i2].context, a1); break; case 3: listeners[i2].fn.call(listeners[i2].context, a1, a2); break; case 4: listeners[i2].fn.call(listeners[i2].context, a1, a2, a3); break; default: if (!args) for (j2 = 1, args = new Array(len2 - 1); j2 < len2; j2++) { args[j2 - 1] = arguments[j2]; } listeners[i2].fn.apply(listeners[i2].context, args); } } } return true; }; EventEmitter2.prototype.on = function on2(event, fn2, context) { return addListener(this, event, fn2, context, false); }; EventEmitter2.prototype.once = function once2(event, fn2, context) { return addListener(this, event, fn2, context, true); }; EventEmitter2.prototype.removeListener = function removeListener(event, fn2, context, once2) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return this; if (!fn2) { clearEvent(this, evt); return this; } var listeners = this._events[evt]; if (listeners.fn) { if (listeners.fn === fn2 && (!once2 || listeners.once) && (!context || listeners.context === context)) { clearEvent(this, evt); } } else { for (var i2 = 0, events2 = [], length = listeners.length; i2 < length; i2++) { if (listeners[i2].fn !== fn2 || once2 && !listeners[i2].once || context && listeners[i2].context !== context) { events2.push(listeners[i2]); } } if (events2.length) this._events[evt] = events2.length === 1 ? events2[0] : events2; else clearEvent(this, evt); } return this; }; EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) { var evt; if (event) { evt = prefix ? prefix + event : event; if (this._events[evt]) clearEvent(this, evt); } else { this._events = new Events(); this._eventsCount = 0; } return this; }; EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener; EventEmitter2.prototype.addListener = EventEmitter2.prototype.on; EventEmitter2.prefixed = prefix; EventEmitter2.EventEmitter = EventEmitter2; { module2.exports = EventEmitter2; } })(eventemitter3); var eventemitter3Exports = eventemitter3.exports; var MobileRelay$1 = {}; var WalletLinkRelay$1 = {}; var DiagnosticLogger = {}; Object.defineProperty(DiagnosticLogger, "__esModule", { value: true }); DiagnosticLogger.EVENTS = void 0; DiagnosticLogger.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 RelayAbstract$1 = {}; Object.defineProperty(RelayAbstract$1, "__esModule", { value: true }); RelayAbstract$1.RelayAbstract = RelayAbstract$1.APP_VERSION_KEY = RelayAbstract$1.LOCAL_STORAGE_ADDRESSES_KEY = RelayAbstract$1.WALLET_USER_NAME_KEY = void 0; const error_1$2 = error; RelayAbstract$1.WALLET_USER_NAME_KEY = "walletUsername"; RelayAbstract$1.LOCAL_STORAGE_ADDRESSES_KEY = "Addresses"; RelayAbstract$1.APP_VERSION_KEY = "AppVersion"; class RelayAbstract { async makeEthereumJSONRPCRequest(request, jsonRpcUrl) { if (!jsonRpcUrl) throw new Error("Error: No jsonRpcUrl provided"); return window.fetch(jsonRpcUrl, { method: "POST", body: JSON.stringify(request), mode: "cors", headers: { "Content-Type": "application/json" } }).then((res) => res.json()).then((json2) => { if (!json2) { throw error_1$2.standardErrors.rpc.parse({}); } const response = json2; const { error: error2 } = response; if (error2) { throw (0, error_1$2.serializeError)(error2, request.method); } return response; }); } } RelayAbstract$1.RelayAbstract = RelayAbstract; var Session$1 = {}; var sha_js = { exports: {} }; var inherits_browser = { exports: {} }; if (typeof Object.create === "function") { inherits_browser.exports = function inherits2(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); } }; } else { inherits_browser.exports = function inherits2(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor; var TempCtor = function() { }; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; } }; } var inherits_browserExports = inherits_browser.exports; var safeBuffer = { exports: {} }; /*! safe-buffer. MIT License. Feross Aboukhadijeh */ (function(module2, exports3) { var buffer$12 = buffer; var Buffer2 = buffer$12.Buffer; function copyProps(src2, dst) { for (var key in src2) { dst[key] = src2[key]; } } if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { module2.exports = buffer$12; } else { copyProps(buffer$12, exports3); exports3.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { return Buffer2(arg, encodingOrOffset, length); } SafeBuffer.prototype = Object.create(Buffer2.prototype); copyProps(Buffer2, SafeBuffer); SafeBuffer.from = function(arg, encodingOrOffset, length) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } return Buffer2(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function(size2, fill, encoding) { if (typeof size2 !== "number") { throw new TypeError("Argument must be a number"); } var buf = Buffer2(size2); if (fill !== void 0) { if (typeof encoding === "string") { buf.fill(fill, encoding); } else { buf.fill(fill); } } else { buf.fill(0); } return buf; }; SafeBuffer.allocUnsafe = function(size2) { if (typeof size2 !== "number") { throw new TypeError("Argument must be a number"); } return Buffer2(size2); }; SafeBuffer.allocUnsafeSlow = function(size2) { if (typeof size2 !== "number") { throw new TypeError("Argument must be a number"); } return buffer$12.SlowBuffer(size2); }; })(safeBuffer, safeBuffer.exports); var safeBufferExports = safeBuffer.exports; var Buffer$7 = safeBufferExports.Buffer; function Hash$6(blockSize, finalSize) { this._block = Buffer$7.alloc(blockSize); this._finalSize = finalSize; this._blockSize = blockSize; this._len = 0; } Hash$6.prototype.update = function(data2, enc) { if (typeof data2 === "string") { enc = enc || "utf8"; data2 = Buffer$7.from(data2, enc); } var block = this._block; var blockSize = this._blockSize; var length = data2.length; var accum = this._len; for (var offset = 0; offset < length; ) { var assigned = accum % blockSize; var remainder = Math.min(length - offset, blockSize - assigned); for (var i2 = 0; i2 < remainder; i2++) { block[assigned + i2] = data2[offset + i2]; } accum += remainder; offset += remainder; if (accum % blockSize === 0) { this._update(block); } } this._len += length; return this; }; Hash$6.prototype.digest = function(enc) { var rem = this._len % this._blockSize; this._block[rem] = 128; this._block.fill(0, rem + 1); if (rem >= this._finalSize) { this._update(this._block); this._block.fill(0); } var bits = this._len * 8; if (bits <= 4294967295) { this._block.writeUInt32BE(bits, this._blockSize - 4); } else { var lowBits = (bits & 4294967295) >>> 0; var highBits = (bits - lowBits) / 4294967296; this._block.writeUInt32BE(highBits, this._blockSize - 8); this._block.writeUInt32BE(lowBits, this._blockSize - 4); } this._update(this._block); var hash2 = this._hash(); return enc ? hash2.toString(enc) : hash2; }; Hash$6.prototype._update = function() { throw new Error("_update must be implemented by subclass"); }; var hash = Hash$6; var inherits$5 = inherits_browserExports; var Hash$5 = hash; var Buffer$6 = safeBufferExports.Buffer; var K$6 = [ 1518500249, 1859775393, 2400959708 | 0, 3395469782 | 0 ]; var W$8 = new Array(80); function Sha() { this.init(); this._w = W$8; Hash$5.call(this, 64, 56); } inherits$5(Sha, Hash$5); Sha.prototype.init = function() { this._a = 1732584193; this._b = 4023233417; this._c = 2562383102; this._d = 271733878; this._e = 3285377520; return this; }; function rotl5$1(num) { return num << 5 | num >>> 27; } function rotl30$1(num) { return num << 30 | num >>> 2; } function ft$4(s2, b2, c2, d2) { if (s2 === 0) return b2 & c2 | ~b2 & d2; if (s2 === 2) return b2 & c2 | b2 & d2 | c2 & d2; return b2 ^ c2 ^ d2; } Sha.prototype._update = function(M2) { var W2 = this._w; var a2 = this._a | 0; var b2 = this._b | 0; var c2 = this._c | 0; var d2 = this._d | 0; var e2 = this._e | 0; for (var i2 = 0; i2 < 16; ++i2) W2[i2] = M2.readInt32BE(i2 * 4); for (; i2 < 80; ++i2) W2[i2] = W2[i2 - 3] ^ W2[i2 - 8] ^ W2[i2 - 14] ^ W2[i2 - 16]; for (var j2 = 0; j2 < 80; ++j2) { var s2 = ~~(j2 / 20); var t2 = rotl5$1(a2) + ft$4(s2, b2, c2, d2) + e2 + W2[j2] + K$6[s2] | 0; e2 = d2; d2 = c2; c2 = rotl30$1(b2); b2 = a2; a2 = t2; } this._a = a2 + this._a | 0; this._b = b2 + this._b | 0; this._c = c2 + this._c | 0; this._d = d2 + this._d | 0; this._e = e2 + this._e | 0; }; Sha.prototype._hash = function() { var H2 = Buffer$6.allocUnsafe(20); H2.writeInt32BE(this._a | 0, 0); H2.writeInt32BE(this._b | 0, 4); H2.writeInt32BE(this._c | 0, 8); H2.writeInt32BE(this._d | 0, 12); H2.writeInt32BE(this._e | 0, 16); return H2; }; var sha = Sha; var inherits$4 = inherits_browserExports; var Hash$4 = hash; var Buffer$5 = safeBufferExports.Buffer; var K$5 = [ 1518500249, 1859775393, 2400959708 | 0, 3395469782 | 0 ]; var W$7 = new Array(80); function Sha1() { this.init(); this._w = W$7; Hash$4.call(this, 64, 56); } inherits$4(Sha1, Hash$4); Sha1.prototype.init = function() { this._a = 1732584193; this._b = 4023233417; this._c = 2562383102; this._d = 271733878; this._e = 3285377520; return this; }; function rotl1(num) { return num << 1 | num >>> 31; } function rotl5(num) { return num << 5 | num >>> 27; } function rotl30(num) { return num << 30 | num >>> 2; } function ft$3(s2, b2, c2, d2) { if (s2 === 0) return b2 & c2 | ~b2 & d2; if (s2 === 2) return b2 & c2 | b2 & d2 | c2 & d2; return b2 ^ c2 ^ d2; } Sha1.prototype._update = function(M2) { var W2 = this._w; var a2 = this._a | 0; var b2 = this._b | 0; var c2 = this._c | 0; var d2 = this._d | 0; var e2 = this._e | 0; for (var i2 = 0; i2 < 16; ++i2) W2[i2] = M2.readInt32BE(i2 * 4); for (; i2 < 80; ++i2) W2[i2] = rotl1(W2[i2 - 3] ^ W2[i2 - 8] ^ W2[i2 - 14] ^ W2[i2 - 16]); for (var j2 = 0; j2 < 80; ++j2) { var s2 = ~~(j2 / 20); var t2 = rotl5(a2) + ft$3(s2, b2, c2, d2) + e2 + W2[j2] + K$5[s2] | 0; e2 = d2; d2 = c2; c2 = rotl30(b2); b2 = a2; a2 = t2; } this._a = a2 + this._a | 0; this._b = b2 + this._b | 0; this._c = c2 + this._c | 0; this._d = d2 + this._d | 0; this._e = e2 + this._e | 0; }; Sha1.prototype._hash = function() { var H2 = Buffer$5.allocUnsafe(20); H2.writeInt32BE(this._a | 0, 0); H2.writeInt32BE(this._b | 0, 4); H2.writeInt32BE(this._c | 0, 8); H2.writeInt32BE(this._d | 0, 12); H2.writeInt32BE(this._e | 0, 16); return H2; }; var sha1 = Sha1; var inherits$3 = inherits_browserExports; var Hash$3 = hash; var Buffer$4 = safeBufferExports.Buffer; var K$4 = [ 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 ]; var W$6 = new Array(64); function Sha256$1() { this.init(); this._w = W$6; Hash$3.call(this, 64, 56); } inherits$3(Sha256$1, Hash$3); Sha256$1.prototype.init = function() { this._a = 1779033703; this._b = 3144134277; this._c = 1013904242; this._d = 2773480762; this._e = 1359893119; this._f = 2600822924; this._g = 528734635; this._h = 1541459225; return this; }; function ch(x2, y2, z2) { return z2 ^ x2 & (y2 ^ z2); } function maj$1(x2, y2, z2) { return x2 & y2 | z2 & (x2 | y2); } function sigma0$1(x2) { return (x2 >>> 2 | x2 << 30) ^ (x2 >>> 13 | x2 << 19) ^ (x2 >>> 22 | x2 << 10); } function sigma1$1(x2) { return (x2 >>> 6 | x2 << 26) ^ (x2 >>> 11 | x2 << 21) ^ (x2 >>> 25 | x2 << 7); } function gamma0(x2) { return (x2 >>> 7 | x2 << 25) ^ (x2 >>> 18 | x2 << 14) ^ x2 >>> 3; } function gamma1(x2) { return (x2 >>> 17 | x2 << 15) ^ (x2 >>> 19 | x2 << 13) ^ x2 >>> 10; } Sha256$1.prototype._update = function(M2) { var W2 = this._w; var a2 = this._a | 0; var b2 = this._b | 0; var c2 = this._c | 0; var d2 = this._d | 0; var e2 = this._e | 0; var f2 = this._f | 0; var g2 = this._g | 0; var h2 = this._h | 0; for (var i2 = 0; i2 < 16; ++i2) W2[i2] = M2.readInt32BE(i2 * 4); for (; i2 < 64; ++i2) W2[i2] = gamma1(W2[i2 - 2]) + W2[i2 - 7] + gamma0(W2[i2 - 15]) + W2[i2 - 16] | 0; for (var j2 = 0; j2 < 64; ++j2) { var T12 = h2 + sigma1$1(e2) + ch(e2, f2, g2) + K$4[j2] + W2[j2] | 0; var T2 = sigma0$1(a2) + maj$1(a2, b2, c2) | 0; h2 = g2; g2 = f2; f2 = e2; e2 = d2 + T12 | 0; d2 = c2; c2 = b2; b2 = a2; a2 = T12 + T2 | 0; } this._a = a2 + this._a | 0; this._b = b2 + this._b | 0; this._c = c2 + this._c | 0; this._d = d2 + this._d | 0; this._e = e2 + this._e | 0; this._f = f2 + this._f | 0; this._g = g2 + this._g | 0; this._h = h2 + this._h | 0; }; Sha256$1.prototype._hash = function() { var H2 = Buffer$4.allocUnsafe(32); H2.writeInt32BE(this._a, 0); H2.writeInt32BE(this._b, 4); H2.writeInt32BE(this._c, 8); H2.writeInt32BE(this._d, 12); H2.writeInt32BE(this._e, 16); H2.writeInt32BE(this._f, 20); H2.writeInt32BE(this._g, 24); H2.writeInt32BE(this._h, 28); return H2; }; var sha256 = Sha256$1; var inherits$2 = inherits_browserExports; var Sha256 = sha256; var Hash$2 = hash; var Buffer$3 = safeBufferExports.Buffer; var W$5 = new Array(64); function Sha224() { this.init(); this._w = W$5; Hash$2.call(this, 64, 56); } inherits$2(Sha224, Sha256); Sha224.prototype.init = function() { this._a = 3238371032; this._b = 914150663; this._c = 812702999; this._d = 4144912697; this._e = 4290775857; this._f = 1750603025; this._g = 1694076839; this._h = 3204075428; return this; }; Sha224.prototype._hash = function() { var H2 = Buffer$3.allocUnsafe(28); H2.writeInt32BE(this._a, 0); H2.writeInt32BE(this._b, 4); H2.writeInt32BE(this._c, 8); H2.writeInt32BE(this._d, 12); H2.writeInt32BE(this._e, 16); H2.writeInt32BE(this._f, 20); H2.writeInt32BE(this._g, 24); return H2; }; var sha224 = Sha224; var inherits$1 = inherits_browserExports; var Hash$1 = hash; var Buffer$2 = safeBufferExports.Buffer; var K$3 = [ 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 ]; var W$4 = new Array(160); function Sha512() { this.init(); this._w = W$4; Hash$1.call(this, 128, 112); } inherits$1(Sha512, Hash$1); Sha512.prototype.init = function() { 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; return this; }; function Ch(x2, y2, z2) { return z2 ^ x2 & (y2 ^ z2); } function maj(x2, y2, z2) { return x2 & y2 | z2 & (x2 | y2); } function sigma0(x2, xl) { return (x2 >>> 28 | xl << 4) ^ (xl >>> 2 | x2 << 30) ^ (xl >>> 7 | x2 << 25); } function sigma1(x2, xl) { return (x2 >>> 14 | xl << 18) ^ (x2 >>> 18 | xl << 14) ^ (xl >>> 9 | x2 << 23); } function Gamma0(x2, xl) { return (x2 >>> 1 | xl << 31) ^ (x2 >>> 8 | xl << 24) ^ x2 >>> 7; } function Gamma0l(x2, xl) { return (x2 >>> 1 | xl << 31) ^ (x2 >>> 8 | xl << 24) ^ (x2 >>> 7 | xl << 25); } function Gamma1(x2, xl) { return (x2 >>> 19 | xl << 13) ^ (xl >>> 29 | x2 << 3) ^ x2 >>> 6; } function Gamma1l(x2, xl) { return (x2 >>> 19 | xl << 13) ^ (xl >>> 29 | x2 << 3) ^ (x2 >>> 6 | xl << 26); } function getCarry(a2, b2) { return a2 >>> 0 < b2 >>> 0 ? 1 : 0; } Sha512.prototype._update = function(M2) { var W2 = this._w; var ah = this._ah | 0; var bh = this._bh | 0; var ch2 = this._ch | 0; var dh = this._dh | 0; var eh = this._eh | 0; var fh = this._fh | 0; var gh = this._gh | 0; var hh = this._hh | 0; var al = this._al | 0; var bl = this._bl | 0; var cl = this._cl | 0; var dl = this._dl | 0; var el = this._el | 0; var fl = this._fl | 0; var gl = this._gl | 0; var hl = this._hl | 0; for (var i2 = 0; i2 < 32; i2 += 2) { W2[i2] = M2.readInt32BE(i2 * 4); W2[i2 + 1] = M2.readInt32BE(i2 * 4 + 4); } for (; i2 < 160; i2 += 2) { var xh = W2[i2 - 15 * 2]; var xl = W2[i2 - 15 * 2 + 1]; var gamma02 = Gamma0(xh, xl); var gamma0l = Gamma0l(xl, xh); xh = W2[i2 - 2 * 2]; xl = W2[i2 - 2 * 2 + 1]; var gamma12 = Gamma1(xh, xl); var gamma1l = Gamma1l(xl, xh); var Wi7h = W2[i2 - 7 * 2]; var Wi7l = W2[i2 - 7 * 2 + 1]; var Wi16h = W2[i2 - 16 * 2]; var Wi16l = W2[i2 - 16 * 2 + 1]; var Wil = gamma0l + Wi7l | 0; var Wih = gamma02 + Wi7h + getCarry(Wil, gamma0l) | 0; Wil = Wil + gamma1l | 0; Wih = Wih + gamma12 + getCarry(Wil, gamma1l) | 0; Wil = Wil + Wi16l | 0; Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0; W2[i2] = Wih; W2[i2 + 1] = Wil; } for (var j2 = 0; j2 < 160; j2 += 2) { Wih = W2[j2]; Wil = W2[j2 + 1]; var majh = maj(ah, bh, ch2); var majl = maj(al, bl, cl); var sigma0h = sigma0(ah, al); var sigma0l = sigma0(al, ah); var sigma1h = sigma1(eh, el); var sigma1l = sigma1(el, eh); var Kih = K$3[j2]; var Kil = K$3[j2 + 1]; var chh = Ch(eh, fh, gh); var chl = Ch(el, fl, gl); var t1l = hl + sigma1l | 0; var t1h = hh + sigma1h + getCarry(t1l, hl) | 0; t1l = t1l + chl | 0; t1h = t1h + chh + getCarry(t1l, chl) | 0; t1l = t1l + Kil | 0; t1h = t1h + Kih + getCarry(t1l, Kil) | 0; t1l = t1l + Wil | 0; t1h = t1h + Wih + getCarry(t1l, Wil) | 0; var t2l = sigma0l + majl | 0; var t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0; hh = gh; hl = gl; gh = fh; gl = fl; fh = eh; fl = el; el = dl + t1l | 0; eh = dh + t1h + getCarry(el, dl) | 0; dh = ch2; dl = cl; ch2 = bh; cl = bl; bh = ah; bl = al; al = t1l + t2l | 0; ah = t1h + t2h + getCarry(al, t1l) | 0; } this._al = this._al + al | 0; this._bl = this._bl + bl | 0; this._cl = this._cl + cl | 0; this._dl = this._dl + dl | 0; this._el = this._el + el | 0; this._fl = this._fl + fl | 0; this._gl = this._gl + gl | 0; this._hl = this._hl + hl | 0; this._ah = this._ah + ah + getCarry(this._al, al) | 0; this._bh = this._bh + bh + getCarry(this._bl, bl) | 0; this._ch = this._ch + ch2 + getCarry(this._cl, cl) | 0; this._dh = this._dh + dh + getCarry(this._dl, dl) | 0; this._eh = this._eh + eh + getCarry(this._el, el) | 0; this._fh = this._fh + fh + getCarry(this._fl, fl) | 0; this._gh = this._gh + gh + getCarry(this._gl, gl) | 0; this._hh = this._hh + hh + getCarry(this._hl, hl) | 0; }; Sha512.prototype._hash = function() { var H2 = Buffer$2.allocUnsafe(64); function writeInt64BE(h2, l2, offset) { H2.writeInt32BE(h2, offset); H2.writeInt32BE(l2, offset + 4); } writeInt64BE(this._ah, this._al, 0); writeInt64BE(this._bh, this._bl, 8); writeInt64BE(this._ch, this._cl, 16); writeInt64BE(this._dh, this._dl, 24); writeInt64BE(this._eh, this._el, 32); writeInt64BE(this._fh, this._fl, 40); writeInt64BE(this._gh, this._gl, 48); writeInt64BE(this._hh, this._hl, 56); return H2; }; var sha512$1 = Sha512; var inherits = inherits_browserExports; var SHA512 = sha512$1; var Hash = hash; var Buffer$1 = safeBufferExports.Buffer; var W$3 = new Array(160); function Sha384() { this.init(); this._w = W$3; Hash.call(this, 128, 112); } inherits(Sha384, SHA512); Sha384.prototype.init = function() { 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; return this; }; Sha384.prototype._hash = function() { var H2 = Buffer$1.allocUnsafe(48); function writeInt64BE(h2, l2, offset) { H2.writeInt32BE(h2, offset); H2.writeInt32BE(l2, offset + 4); } writeInt64BE(this._ah, this._al, 0); writeInt64BE(this._bh, this._bl, 8); writeInt64BE(this._ch, this._cl, 16); writeInt64BE(this._dh, this._dl, 24); writeInt64BE(this._eh, this._el, 32); writeInt64BE(this._fh, this._fl, 40); return H2; }; var sha384 = Sha384; var exports$1 = sha_js.exports = function SHA(algorithm) { algorithm = algorithm.toLowerCase(); var Algorithm = exports$1[algorithm]; if (!Algorithm) throw new Error(algorithm + " is not supported (we accept pull requests)"); return new Algorithm(); }; exports$1.sha = sha; exports$1.sha1 = sha1; exports$1.sha224 = sha224; exports$1.sha256 = sha256; exports$1.sha384 = sha384; exports$1.sha512 = sha512$1; var sha_jsExports = sha_js.exports; Object.defineProperty(Session$1, "__esModule", { value: true }); Session$1.Session = void 0; const sha_js_1 = sha_jsExports; const util_1$8 = util$3; const STORAGE_KEY_SESSION_ID = "session:id"; const STORAGE_KEY_SESSION_SECRET = "session:secret"; const STORAGE_KEY_SESSION_LINKED = "session:linked"; class Session { constructor(storage, id2, secret, linked) { this._storage = storage; this._id = id2 || (0, util_1$8.randomBytesHex)(16); this._secret = secret || (0, util_1$8.randomBytesHex)(32); this._key = new sha_js_1.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"); this._linked = !!linked; } static load(storage) { const id2 = storage.getItem(STORAGE_KEY_SESSION_ID); const linked = storage.getItem(STORAGE_KEY_SESSION_LINKED); const secret = storage.getItem(STORAGE_KEY_SESSION_SECRET); if (id2 && secret) { return new Session(storage, id2, secret, linked === "1"); } return null; } /** * Takes in a session ID and returns the sha256 hash of it. * @param sessionId session ID */ static hash(sessionId) { return new sha_js_1.sha256().update(sessionId).digest("hex"); } get id() { return this._id; } get secret() { return this._secret; } get key() { return this._key; } get linked() { return this._linked; } set linked(val) { this._linked = val; this.persistLinked(); } save() { this._storage.setItem(STORAGE_KEY_SESSION_ID, this._id); this._storage.setItem(STORAGE_KEY_SESSION_SECRET, this._secret); this.persistLinked(); return this; } persistLinked() { this._storage.setItem(STORAGE_KEY_SESSION_LINKED, this._linked ? "1" : "0"); } } Session$1.Session = Session; var WalletLinkConnection$1 = {}; var Cipher$1 = {}; Object.defineProperty(Cipher$1, "__esModule", { value: true }); Cipher$1.Cipher = void 0; const util_1$7 = util$3; class Cipher { // @param secret hex representation of 32-byte secret constructor(secret) { this.secret = secret; } /** * * @param plainText string to be encrypted * returns hex string representation of bytes in the order: initialization vector (iv), * auth tag, encrypted plaintext. IV is 12 bytes. Auth tag is 16 bytes. Remaining bytes are the * encrypted plainText. */ async encrypt(plainText) { const secret = this.secret; if (secret.length !== 64) throw Error(`secret must be 256 bits`); const ivBytes = crypto.getRandomValues(new Uint8Array(12)); const secretKey = await crypto.subtle.importKey("raw", (0, util_1$7.hexStringToUint8Array)(secret), { name: "aes-gcm" }, false, ["encrypt", "decrypt"]); const enc = new TextEncoder(); const encryptedResult = await window.crypto.subtle.encrypt({ name: "AES-GCM", iv: ivBytes }, secretKey, enc.encode(plainText)); const tagLength = 16; const authTag = encryptedResult.slice(encryptedResult.byteLength - tagLength); const encryptedPlaintext = encryptedResult.slice(0, encryptedResult.byteLength - tagLength); const authTagBytes = new Uint8Array(authTag); const encryptedPlaintextBytes = new Uint8Array(encryptedPlaintext); const concatted = new Uint8Array([...ivBytes, ...authTagBytes, ...encryptedPlaintextBytes]); return (0, util_1$7.uint8ArrayToHex)(concatted); } /** * * @param cipherText hex string representation of bytes in the order: initialization vector (iv), * auth tag, encrypted plaintext. IV is 12 bytes. Auth tag is 16 bytes. */ async decrypt(cipherText) { const secret = this.secret; if (secret.length !== 64) throw Error(`secret must be 256 bits`); return new Promise((resolve, reject) => { void async function() { const secretKey = await crypto.subtle.importKey("raw", (0, util_1$7.hexStringToUint8Array)(secret), { name: "aes-gcm" }, false, ["encrypt", "decrypt"]); const encrypted = (0, util_1$7.hexStringToUint8Array)(cipherText); const ivBytes = encrypted.slice(0, 12); const authTagBytes = encrypted.slice(12, 28); const encryptedPlaintextBytes = encrypted.slice(28); const concattedBytes = new Uint8Array([...encryptedPlaintextBytes, ...authTagBytes]); const algo = { name: "AES-GCM", iv: new Uint8Array(ivBytes) }; try { const decrypted = await window.crypto.subtle.decrypt(algo, secretKey, concattedBytes); const decoder = new TextDecoder(); resolve(decoder.decode(decrypted)); } catch (err) { reject(err); } }(); }); } } Cipher$1.Cipher = Cipher; var WalletLinkHTTP$1 = {}; Object.defineProperty(WalletLinkHTTP$1, "__esModule", { value: true }); WalletLinkHTTP$1.WalletLinkHTTP = void 0; class WalletLinkHTTP { constructor(linkAPIUrl, sessionId, sessionKey) { this.linkAPIUrl = linkAPIUrl; this.sessionId = sessionId; const credentials = `${sessionId}:${sessionKey}`; this.auth = `Basic ${btoa(credentials)}`; } // mark unseen events as seen async markUnseenEventsAsSeen(events2) { return Promise.all(events2.map((e2) => fetch(`${this.linkAPIUrl}/events/${e2.eventId}/seen`, { method: "POST", headers: { Authorization: this.auth } }))).catch((error2) => console.error("Unabled to mark event as failed:", error2)); } async fetchUnseenEvents() { var _a2; const response = await fetch(`${this.linkAPIUrl}/events?unseen=true`, { headers: { Authorization: this.auth } }); if (response.ok) { const { events: events2, error: error2 } = await response.json(); if (error2) { throw new Error(`Check unseen events failed: ${error2}`); } const responseEvents = (_a2 = events2 === null || events2 === void 0 ? void 0 : events2.filter((e2) => e2.event === "Web3Response").map((e2) => ({ type: "Event", sessionId: this.sessionId, eventId: e2.id, event: e2.event, data: e2.data }))) !== null && _a2 !== void 0 ? _a2 : []; this.markUnseenEventsAsSeen(responseEvents); return responseEvents; } throw new Error(`Check unseen events failed: ${response.status}`); } } WalletLinkHTTP$1.WalletLinkHTTP = WalletLinkHTTP; var WalletLinkWebSocket$1 = {}; Object.defineProperty(WalletLinkWebSocket$1, "__esModule", { value: true }); WalletLinkWebSocket$1.WalletLinkWebSocket = WalletLinkWebSocket$1.ConnectionState = void 0; var ConnectionState; (function(ConnectionState2) { ConnectionState2[ConnectionState2["DISCONNECTED"] = 0] = "DISCONNECTED"; ConnectionState2[ConnectionState2["CONNECTING"] = 1] = "CONNECTING"; ConnectionState2[ConnectionState2["CONNECTED"] = 2] = "CONNECTED"; })(ConnectionState || (WalletLinkWebSocket$1.ConnectionState = ConnectionState = {})); class WalletLinkWebSocket { setConnectionStateListener(listener) { this.connectionStateListener = listener; } setIncomingDataListener(listener) { this.incomingDataListener = listener; } /** * Constructor * @param url WebSocket server URL * @param [WebSocketClass] Custom WebSocket implementation */ constructor(url, WebSocketClass = WebSocket) { this.WebSocketClass = WebSocketClass; this.webSocket = null; this.pendingData = []; this.url = url.replace(/^http/, "ws"); } /** * Make a websocket connection * @returns a Promise that resolves when connected */ async connect() { if (this.webSocket) { throw new Error("webSocket object is not null"); } return new Promise((resolve, reject) => { var _a2; let webSocket2; try { this.webSocket = webSocket2 = new this.WebSocketClass(this.url); } catch (err) { reject(err); return; } (_a2 = this.connectionStateListener) === null || _a2 === void 0 ? void 0 : _a2.call(this, ConnectionState.CONNECTING); webSocket2.onclose = (evt) => { var _a3; this.clearWebSocket(); reject(new Error(`websocket error ${evt.code}: ${evt.reason}`)); (_a3 = this.connectionStateListener) === null || _a3 === void 0 ? void 0 : _a3.call(this, ConnectionState.DISCONNECTED); }; webSocket2.onopen = (_2) => { var _a3; resolve(); (_a3 = this.connectionStateListener) === null || _a3 === void 0 ? void 0 : _a3.call(this, ConnectionState.CONNECTED); if (this.pendingData.length > 0) { const pending = [...this.pendingData]; pending.forEach((data2) => this.sendData(data2)); this.pendingData = []; } }; webSocket2.onmessage = (evt) => { var _a3, _b2; if (evt.data === "h") { (_a3 = this.incomingDataListener) === null || _a3 === void 0 ? void 0 : _a3.call(this, { type: "Heartbeat" }); } else { try { const message = JSON.parse(evt.data); (_b2 = this.incomingDataListener) === null || _b2 === void 0 ? void 0 : _b2.call(this, message); } catch (_c2) { } } }; }); } /** * Disconnect from server */ disconnect() { var _a2; const { webSocket: webSocket2 } = this; if (!webSocket2) { return; } this.clearWebSocket(); (_a2 = this.connectionStateListener) === null || _a2 === void 0 ? void 0 : _a2.call(this, ConnectionState.DISCONNECTED); this.connectionStateListener = void 0; this.incomingDataListener = void 0; try { webSocket2.close(); } catch (_b2) { } } /** * Send data to server * @param data text to send */ sendData(data2) { const { webSocket: webSocket2 } = this; if (!webSocket2) { this.pendingData.push(data2); this.connect(); return; } webSocket2.send(data2); } clearWebSocket() { const { webSocket: webSocket2 } = this; if (!webSocket2) { return; } this.webSocket = null; webSocket2.onclose = null; webSocket2.onerror = null; webSocket2.onmessage = null; webSocket2.onopen = null; } } WalletLinkWebSocket$1.WalletLinkWebSocket = WalletLinkWebSocket; Object.defineProperty(WalletLinkConnection$1, "__esModule", { value: true }); WalletLinkConnection$1.WalletLinkConnection = void 0; const type_1$2 = type$1; const Cipher_1 = Cipher$1; const DiagnosticLogger_1$2 = DiagnosticLogger; const RelayAbstract_1$2 = RelayAbstract$1; const Session_1$2 = Session$1; const WalletLinkHTTP_1 = WalletLinkHTTP$1; const WalletLinkWebSocket_1 = WalletLinkWebSocket$1; const HEARTBEAT_INTERVAL = 1e4; const REQUEST_TIMEOUT = 6e4; class WalletLinkConnection { /** * Constructor * @param session Session * @param linkAPIUrl Coinbase Wallet link server URL * @param listener WalletLinkConnectionUpdateListener * @param [WebSocketClass] Custom WebSocket implementation */ constructor({ session, linkAPIUrl, listener, diagnostic, WebSocketClass = WebSocket }) { this.destroyed = false; this.lastHeartbeatResponse = 0; this.nextReqId = (0, type_1$2.IntNumber)(1); this._connected = false; this._linked = false; this.shouldFetchUnseenEventsOnConnect = false; this.requestResolutions = /* @__PURE__ */ new Map(); this.handleSessionMetadataUpdated = (metadata2) => { if (!metadata2) return; const handlers = /* @__PURE__ */ new Map([ ["__destroyed", this.handleDestroyed], ["EthereumAddress", this.handleAccountUpdated], ["WalletUsername", this.handleWalletUsernameUpdated], ["AppVersion", this.handleAppVersionUpdated], [ "ChainId", (v2) => metadata2.JsonRpcUrl && this.handleChainUpdated(v2, metadata2.JsonRpcUrl) ] ]); handlers.forEach((handler, key) => { const value = metadata2[key]; if (value === void 0) return; handler(value); }); }; this.handleDestroyed = (__destroyed) => { var _a2, _b2; if (__destroyed !== "1") return; (_a2 = this.listener) === null || _a2 === void 0 ? void 0 : _a2.resetAndReload(); (_b2 = this.diagnostic) === null || _b2 === void 0 ? void 0 : _b2.log(DiagnosticLogger_1$2.EVENTS.METADATA_DESTROYED, { alreadyDestroyed: this.isDestroyed, sessionIdHash: Session_1$2.Session.hash(this.session.id) }); }; this.handleAccountUpdated = async (encryptedEthereumAddress) => { var _a2, _b2; try { const address = await this.cipher.decrypt(encryptedEthereumAddress); (_a2 = this.listener) === null || _a2 === void 0 ? void 0 : _a2.accountUpdated(address); } catch (_c2) { (_b2 = this.diagnostic) === null || _b2 === void 0 ? void 0 : _b2.log(DiagnosticLogger_1$2.EVENTS.GENERAL_ERROR, { message: "Had error decrypting", value: "selectedAddress" }); } }; this.handleMetadataUpdated = async (key, encryptedMetadataValue) => { var _a2, _b2; try { const decryptedValue = await this.cipher.decrypt(encryptedMetadataValue); (_a2 = this.listener) === null || _a2 === void 0 ? void 0 : _a2.metadataUpdated(key, decryptedValue); } catch (_c2) { (_b2 = this.diagnostic) === null || _b2 === void 0 ? void 0 : _b2.log(DiagnosticLogger_1$2.EVENTS.GENERAL_ERROR, { message: "Had error decrypting", value: key }); } }; this.handleWalletUsernameUpdated = async (walletUsername) => { this.handleMetadataUpdated(RelayAbstract_1$2.WALLET_USER_NAME_KEY, walletUsername); }; this.handleAppVersionUpdated = async (appVersion) => { this.handleMetadataUpdated(RelayAbstract_1$2.APP_VERSION_KEY, appVersion); }; this.handleChainUpdated = async (encryptedChainId, encryptedJsonRpcUrl) => { var _a2, _b2; try { const chainId = await this.cipher.decrypt(encryptedChainId); const jsonRpcUrl = await this.cipher.decrypt(encryptedJsonRpcUrl); (_a2 = this.listener) === null || _a2 === void 0 ? void 0 : _a2.chainUpdated(chainId, jsonRpcUrl); } catch (_c2) { (_b2 = this.diagnostic) === null || _b2 === void 0 ? void 0 : _b2.log(DiagnosticLogger_1$2.EVENTS.GENERAL_ERROR, { message: "Had error decrypting", value: "chainId|jsonRpcUrl" }); } }; this.session = session; this.cipher = new Cipher_1.Cipher(session.secret); this.diagnostic = diagnostic; this.listener = listener; const ws2 = new WalletLinkWebSocket_1.WalletLinkWebSocket(`${linkAPIUrl}/rpc`, WebSocketClass); ws2.setConnectionStateListener(async (state2) => { var _a2; (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1$2.EVENTS.CONNECTED_STATE_CHANGE, { state: state2, sessionIdHash: Session_1$2.Session.hash(session.id) }); let connected = false; switch (state2) { case WalletLinkWebSocket_1.ConnectionState.DISCONNECTED: if (!this.destroyed) { const connect2 = async () => { await new Promise((resolve) => setTimeout(resolve, 5e3)); if (!this.destroyed) { ws2.connect().catch(() => { connect2(); }); } }; connect2(); } break; case WalletLinkWebSocket_1.ConnectionState.CONNECTED: try { await this.authenticate(); this.sendIsLinked(); this.sendGetSessionConfig(); connected = true; } catch (_b2) { } this.updateLastHeartbeat(); setInterval(() => { this.heartbeat(); }, HEARTBEAT_INTERVAL); if (this.shouldFetchUnseenEventsOnConnect) { this.fetchUnseenEventsAPI(); } break; case WalletLinkWebSocket_1.ConnectionState.CONNECTING: break; } if (this.connected !== connected) { this.connected = connected; } }); ws2.setIncomingDataListener((m2) => { var _a2, _b2, _c2; switch (m2.type) { case "Heartbeat": this.updateLastHeartbeat(); return; case "IsLinkedOK": case "Linked": { const linked = m2.type === "IsLinkedOK" ? m2.linked : void 0; (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1$2.EVENTS.LINKED, { sessionIdHash: Session_1$2.Session.hash(session.id), linked, type: m2.type, onlineGuests: m2.onlineGuests }); this.linked = linked || m2.onlineGuests > 0; break; } case "GetSessionConfigOK": case "SessionConfigUpdated": { (_b2 = this.diagnostic) === null || _b2 === void 0 ? void 0 : _b2.log(DiagnosticLogger_1$2.EVENTS.SESSION_CONFIG_RECEIVED, { sessionIdHash: Session_1$2.Session.hash(session.id), metadata_keys: m2 && m2.metadata ? Object.keys(m2.metadata) : void 0 }); this.handleSessionMetadataUpdated(m2.metadata); break; } case "Event": { this.handleIncomingEvent(m2); break; } } if (m2.id !== void 0) { (_c2 = this.requestResolutions.get(m2.id)) === null || _c2 === void 0 ? void 0 : _c2(m2); } }); this.ws = ws2; this.http = new WalletLinkHTTP_1.WalletLinkHTTP(linkAPIUrl, session.id, session.key); } /** * Make a connection to the server */ connect() { var _a2; if (this.destroyed) { throw new Error("instance is destroyed"); } (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1$2.EVENTS.STARTED_CONNECTING, { sessionIdHash: Session_1$2.Session.hash(this.session.id) }); this.ws.connect(); } /** * Terminate connection, and mark as destroyed. To reconnect, create a new * instance of WalletSDKConnection */ destroy() { var _a2; this.destroyed = true; this.ws.disconnect(); (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1$2.EVENTS.DISCONNECTED, { sessionIdHash: Session_1$2.Session.hash(this.session.id) }); this.listener = void 0; } get isDestroyed() { return this.destroyed; } get connected() { return this._connected; } set connected(connected) { var _a2, _b2; this._connected = connected; if (connected) (_a2 = this.onceConnected) === null || _a2 === void 0 ? void 0 : _a2.call(this); (_b2 = this.listener) === null || _b2 === void 0 ? void 0 : _b2.connectedUpdated(connected); } setOnceConnected(callback) { return new Promise((resolve) => { if (this.connected) { callback().then(resolve); } else { this.onceConnected = () => { callback().then(resolve); this.onceConnected = void 0; }; } }); } get linked() { return this._linked; } set linked(linked) { var _a2, _b2; this._linked = linked; if (linked) (_a2 = this.onceLinked) === null || _a2 === void 0 ? void 0 : _a2.call(this); (_b2 = this.listener) === null || _b2 === void 0 ? void 0 : _b2.linkedUpdated(linked); } setOnceLinked(callback) { return new Promise((resolve) => { if (this.linked) { callback().then(resolve); } else { this.onceLinked = () => { callback().then(resolve); this.onceLinked = void 0; }; } }); } async handleIncomingEvent(m2) { var _a2, _b2; if (m2.type !== "Event" || m2.event !== "Web3Response") { return; } try { const decryptedData = await this.cipher.decrypt(m2.data); const message = JSON.parse(decryptedData); if (message.type !== "WEB3_RESPONSE") return; (_a2 = this.listener) === null || _a2 === void 0 ? void 0 : _a2.handleWeb3ResponseMessage(message); } catch (_c2) { (_b2 = this.diagnostic) === null || _b2 === void 0 ? void 0 : _b2.log(DiagnosticLogger_1$2.EVENTS.GENERAL_ERROR, { message: "Had error decrypting", value: "incomingEvent" }); } } async checkUnseenEvents() { if (!this.connected) { this.shouldFetchUnseenEventsOnConnect = true; return; } await new Promise((resolve) => setTimeout(resolve, 250)); try { await this.fetchUnseenEventsAPI(); } catch (e2) { console.error("Unable to check for unseen events", e2); } } async fetchUnseenEventsAPI() { this.shouldFetchUnseenEventsOnConnect = false; const responseEvents = await this.http.fetchUnseenEvents(); responseEvents.forEach((e2) => this.handleIncomingEvent(e2)); } /** * Set session metadata in SessionConfig object * @param key * @param value * @returns a Promise that completes when successful */ async setSessionMetadata(key, value) { const message = { type: "SetSessionConfig", id: (0, type_1$2.IntNumber)(this.nextReqId++), sessionId: this.session.id, metadata: { [key]: value } }; return this.setOnceConnected(async () => { const res = await this.makeRequest(message); if (res.type === "Fail") { throw new Error(res.error || "failed to set session metadata"); } }); } /** * Publish an event and emit event ID when successful * @param event event name * @param unencryptedData unencrypted event data * @param callWebhook whether the webhook should be invoked * @returns a Promise that emits event ID when successful */ async publishEvent(event, unencryptedData, callWebhook = false) { const data2 = await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({}, unencryptedData), { origin: location.origin, relaySource: window.coinbaseWalletExtension ? "injected_sdk" : "sdk" }))); const message = { type: "PublishEvent", id: (0, type_1$2.IntNumber)(this.nextReqId++), sessionId: this.session.id, event, data: data2, callWebhook }; return this.setOnceLinked(async () => { const res = await this.makeRequest(message); if (res.type === "Fail") { throw new Error(res.error || "failed to publish event"); } return res.eventId; }); } sendData(message) { this.ws.sendData(JSON.stringify(message)); } updateLastHeartbeat() { this.lastHeartbeatResponse = Date.now(); } heartbeat() { if (Date.now() - this.lastHeartbeatResponse > HEARTBEAT_INTERVAL * 2) { this.ws.disconnect(); return; } try { this.ws.sendData("h"); } catch (_a2) { } } async makeRequest(message, timeout2 = REQUEST_TIMEOUT) { const reqId = message.id; this.sendData(message); let timeoutId; return Promise.race([ new Promise((_2, reject) => { timeoutId = window.setTimeout(() => { reject(new Error(`request ${reqId} timed out`)); }, timeout2); }), new Promise((resolve) => { this.requestResolutions.set(reqId, (m2) => { clearTimeout(timeoutId); resolve(m2); this.requestResolutions.delete(reqId); }); }) ]); } async authenticate() { const m2 = { type: "HostSession", id: (0, type_1$2.IntNumber)(this.nextReqId++), sessionId: this.session.id, sessionKey: this.session.key }; const res = await this.makeRequest(m2); if (res.type === "Fail") { throw new Error(res.error || "failed to authentcate"); } } sendIsLinked() { const m2 = { type: "IsLinked", id: (0, type_1$2.IntNumber)(this.nextReqId++), sessionId: this.session.id }; this.sendData(m2); } sendGetSessionConfig() { const m2 = { type: "GetSessionConfig", id: (0, type_1$2.IntNumber)(this.nextReqId++), sessionId: this.session.id }; this.sendData(m2); } } WalletLinkConnection$1.WalletLinkConnection = WalletLinkConnection; var WalletLinkRelayUI$1 = {}; var cssReset = {}; var cssResetCss = {}; Object.defineProperty(cssResetCss, "__esModule", { value: true }); cssResetCss.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 __importDefault$d = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(cssReset, "__esModule", { value: true }); cssReset.injectCssReset = void 0; const cssReset_css_1 = __importDefault$d(cssResetCss); function injectCssReset() { const styleEl = document.createElement("style"); styleEl.type = "text/css"; styleEl.appendChild(document.createTextNode(cssReset_css_1.default)); document.documentElement.appendChild(styleEl); } cssReset.injectCssReset = injectCssReset; var LinkFlow$1 = {}; var n$9, l$7, u$5, t$7, i$7, o$8, r$7, f$6, e$8, c$8, s$5, a$6, h$7 = {}, p$7 = [], v$8 = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, y$7 = Array.isArray; function d$7(n2, l2) { for (var u2 in l2) n2[u2] = l2[u2]; return n2; } function w$8(n2) { var l2 = n2.parentNode; l2 && l2.removeChild(n2); } function _$7(l2, u2, t2) { var i2, o2, r2, f2 = {}; for (r2 in u2) "key" == r2 ? i2 = u2[r2] : "ref" == r2 ? o2 = u2[r2] : f2[r2] = u2[r2]; if (arguments.length > 2 && (f2.children = arguments.length > 3 ? n$9.call(arguments, 2) : t2), "function" == typeof l2 && null != l2.defaultProps) for (r2 in l2.defaultProps) void 0 === f2[r2] && (f2[r2] = l2.defaultProps[r2]); return g$9(l2, f2, i2, o2, null); } function g$9(n2, t2, i2, o2, r2) { var f2 = { type: n2, props: t2, key: i2, ref: o2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: null == r2 ? ++u$5 : r2, __i: -1, __u: 0 }; return null == r2 && null != l$7.vnode && l$7.vnode(f2), f2; } function m$4() { return { current: null }; } function k$5(n2) { return n2.children; } function b$6(n2, l2) { this.props = n2, this.context = l2; } function x$4(n2, l2) { if (null == l2) return n2.__ ? x$4(n2.__, n2.__i + 1) : null; for (var u2; l2 < n2.__k.length; l2++) if (null != (u2 = n2.__k[l2]) && null != u2.__e) return u2.__e; return "function" == typeof n2.type ? x$4(n2) : null; } function C$3(n2) { var l2, u2; if (null != (n2 = n2.__) && null != n2.__c) { for (n2.__e = n2.__c.base = null, l2 = 0; l2 < n2.__k.length; l2++) if (null != (u2 = n2.__k[l2]) && null != u2.__e) { n2.__e = n2.__c.base = u2.__e; break; } return C$3(n2); } } function M$4(n2) { (!n2.__d && (n2.__d = true) && i$7.push(n2) && !P$5.__r++ || o$8 !== l$7.debounceRendering) && ((o$8 = l$7.debounceRendering) || r$7)(P$5); } function P$5() { var n2, u2, t2, o2, r2, e2, c2, s2; for (i$7.sort(f$6); n2 = i$7.shift(); ) n2.__d && (u2 = i$7.length, o2 = void 0, e2 = (r2 = (t2 = n2).__v).__e, c2 = [], s2 = [], t2.__P && ((o2 = d$7({}, r2)).__v = r2.__v + 1, l$7.vnode && l$7.vnode(o2), O$5(t2.__P, o2, r2, t2.__n, t2.__P.namespaceURI, 32 & r2.__u ? [e2] : null, c2, null == e2 ? x$4(r2) : e2, !!(32 & r2.__u), s2), o2.__v = r2.__v, o2.__.__k[o2.__i] = o2, j$7(c2, o2, s2), o2.__e != e2 && C$3(o2)), i$7.length > u2 && i$7.sort(f$6)); P$5.__r = 0; } function S$7(n2, l2, u2, t2, i2, o2, r2, f2, e2, c2, s2) { var a2, v2, y2, d2, w2, _2 = t2 && t2.__k || p$7, g2 = l2.length; for (u2.__d = e2, $$4(u2, l2, _2), e2 = u2.__d, a2 = 0; a2 < g2; a2++) null != (y2 = u2.__k[a2]) && "boolean" != typeof y2 && "function" != typeof y2 && (v2 = -1 === y2.__i ? h$7 : _2[y2.__i] || h$7, y2.__i = a2, O$5(n2, y2, v2, i2, o2, r2, f2, e2, c2, s2), d2 = y2.__e, y2.ref && v2.ref != y2.ref && (v2.ref && N$4(v2.ref, null, y2), s2.push(y2.ref, y2.__c || d2, y2)), null == w2 && null != d2 && (w2 = d2), 65536 & y2.__u || v2.__k === y2.__k ? (e2 && !e2.isConnected && (e2 = x$4(v2)), e2 = I$3(y2, e2, n2)) : "function" == typeof y2.type && void 0 !== y2.__d ? e2 = y2.__d : d2 && (e2 = d2.nextSibling), y2.__d = void 0, y2.__u &= -196609); u2.__d = e2, u2.__e = w2; } function $$4(n2, l2, u2) { var t2, i2, o2, r2, f2, e2 = l2.length, c2 = u2.length, s2 = c2, a2 = 0; for (n2.__k = [], t2 = 0; t2 < e2; t2++) r2 = t2 + a2, null != (i2 = n2.__k[t2] = null == (i2 = l2[t2]) || "boolean" == typeof i2 || "function" == typeof i2 ? null : "string" == typeof i2 || "number" == typeof i2 || "bigint" == typeof i2 || i2.constructor == String ? g$9(null, i2, null, null, null) : y$7(i2) ? g$9(k$5, { children: i2 }, null, null, null) : void 0 === i2.constructor && i2.__b > 0 ? g$9(i2.type, i2.props, i2.key, i2.ref ? i2.ref : null, i2.__v) : i2) ? (i2.__ = n2, i2.__b = n2.__b + 1, f2 = L$5(i2, u2, r2, s2), i2.__i = f2, o2 = null, -1 !== f2 && (s2--, (o2 = u2[f2]) && (o2.__u |= 131072)), null == o2 || null === o2.__v ? (-1 == f2 && a2--, "function" != typeof i2.type && (i2.__u |= 65536)) : f2 !== r2 && (f2 === r2 + 1 ? a2++ : f2 > r2 ? s2 > e2 - r2 ? a2 += f2 - r2 : a2-- : f2 < r2 ? f2 == r2 - 1 && (a2 = f2 - r2) : a2 = 0, f2 !== t2 + a2 && (i2.__u |= 65536))) : (o2 = u2[r2]) && null == o2.key && o2.__e && 0 == (131072 & o2.__u) && (o2.__e == n2.__d && (n2.__d = x$4(o2)), V$5(o2, o2, false), u2[r2] = null, s2--); if (s2) for (t2 = 0; t2 < c2; t2++) null != (o2 = u2[t2]) && 0 == (131072 & o2.__u) && (o2.__e == n2.__d && (n2.__d = x$4(o2)), V$5(o2, o2)); } function I$3(n2, l2, u2) { var t2, i2; if ("function" == typeof n2.type) { for (t2 = n2.__k, i2 = 0; t2 && i2 < t2.length; i2++) t2[i2] && (t2[i2].__ = n2, l2 = I$3(t2[i2], l2, u2)); return l2; } n2.__e != l2 && (u2.insertBefore(n2.__e, l2 || null), l2 = n2.__e); do { l2 = l2 && l2.nextSibling; } while (null != l2 && 8 === l2.nodeType); return l2; } function H$3(n2, l2) { return l2 = l2 || [], null == n2 || "boolean" == typeof n2 || (y$7(n2) ? n2.some(function(n3) { H$3(n3, l2); }) : l2.push(n2)), l2; } function L$5(n2, l2, u2, t2) { var i2 = n2.key, o2 = n2.type, r2 = u2 - 1, f2 = u2 + 1, e2 = l2[u2]; if (null === e2 || e2 && i2 == e2.key && o2 === e2.type && 0 == (131072 & e2.__u)) return u2; if (t2 > (null != e2 && 0 == (131072 & e2.__u) ? 1 : 0)) for (; r2 >= 0 || f2 < l2.length; ) { if (r2 >= 0) { if ((e2 = l2[r2]) && 0 == (131072 & e2.__u) && i2 == e2.key && o2 === e2.type) return r2; r2--; } if (f2 < l2.length) { if ((e2 = l2[f2]) && 0 == (131072 & e2.__u) && i2 == e2.key && o2 === e2.type) return f2; f2++; } } return -1; } function T$6(n2, l2, u2) { "-" === l2[0] ? n2.setProperty(l2, null == u2 ? "" : u2) : n2[l2] = null == u2 ? "" : "number" != typeof u2 || v$8.test(l2) ? u2 : u2 + "px"; } function A$4(n2, l2, u2, t2, i2) { var o2; n: if ("style" === l2) if ("string" == typeof u2) n2.style.cssText = u2; else { if ("string" == typeof t2 && (n2.style.cssText = t2 = ""), t2) for (l2 in t2) u2 && l2 in u2 || T$6(n2.style, l2, ""); if (u2) for (l2 in u2) t2 && u2[l2] === t2[l2] || T$6(n2.style, l2, u2[l2]); } else if ("o" === l2[0] && "n" === l2[1]) o2 = l2 !== (l2 = l2.replace(/(PointerCapture)$|Capture$/i, "$1")), l2 = l2.toLowerCase() in n2 || "onFocusOut" === l2 || "onFocusIn" === l2 ? l2.toLowerCase().slice(2) : l2.slice(2), n2.l || (n2.l = {}), n2.l[l2 + o2] = u2, u2 ? t2 ? u2.u = t2.u : (u2.u = e$8, n2.addEventListener(l2, o2 ? s$5 : c$8, o2)) : n2.removeEventListener(l2, o2 ? s$5 : c$8, o2); else { if ("http://www.w3.org/2000/svg" == i2) l2 = l2.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s"); else if ("width" != l2 && "height" != l2 && "href" != l2 && "list" != l2 && "form" != l2 && "tabIndex" != l2 && "download" != l2 && "rowSpan" != l2 && "colSpan" != l2 && "role" != l2 && l2 in n2) try { n2[l2] = null == u2 ? "" : u2; break n; } catch (n3) { } "function" == typeof u2 || (null == u2 || false === u2 && "-" !== l2[4] ? n2.removeAttribute(l2) : n2.setAttribute(l2, u2)); } } function F$5(n2) { return function(u2) { if (this.l) { var t2 = this.l[u2.type + n2]; if (null == u2.t) u2.t = e$8++; else if (u2.t < t2.u) return; return t2(l$7.event ? l$7.event(u2) : u2); } }; } function O$5(n2, u2, t2, i2, o2, r2, f2, e2, c2, s2) { var a2, h2, p2, v2, w2, _2, g2, m2, x2, C2, M2, P2, $2, I2, H2, L2 = u2.type; if (void 0 !== u2.constructor) return null; 128 & t2.__u && (c2 = !!(32 & t2.__u), r2 = [e2 = u2.__e = t2.__e]), (a2 = l$7.__b) && a2(u2); n: if ("function" == typeof L2) try { if (m2 = u2.props, x2 = (a2 = L2.contextType) && i2[a2.__c], C2 = a2 ? x2 ? x2.props.value : a2.__ : i2, t2.__c ? g2 = (h2 = u2.__c = t2.__c).__ = h2.__E : ("prototype" in L2 && L2.prototype.render ? u2.__c = h2 = new L2(m2, C2) : (u2.__c = h2 = new b$6(m2, C2), h2.constructor = L2, h2.render = q$4), x2 && x2.sub(h2), h2.props = m2, h2.state || (h2.state = {}), h2.context = C2, h2.__n = i2, p2 = h2.__d = true, h2.__h = [], h2._sb = []), null == h2.__s && (h2.__s = h2.state), null != L2.getDerivedStateFromProps && (h2.__s == h2.state && (h2.__s = d$7({}, h2.__s)), d$7(h2.__s, L2.getDerivedStateFromProps(m2, h2.__s))), v2 = h2.props, w2 = h2.state, h2.__v = u2, p2) null == L2.getDerivedStateFromProps && null != h2.componentWillMount && h2.componentWillMount(), null != h2.componentDidMount && h2.__h.push(h2.componentDidMount); else { if (null == L2.getDerivedStateFromProps && m2 !== v2 && null != h2.componentWillReceiveProps && h2.componentWillReceiveProps(m2, C2), !h2.__e && (null != h2.shouldComponentUpdate && false === h2.shouldComponentUpdate(m2, h2.__s, C2) || u2.__v === t2.__v)) { for (u2.__v !== t2.__v && (h2.props = m2, h2.state = h2.__s, h2.__d = false), u2.__e = t2.__e, u2.__k = t2.__k, u2.__k.forEach(function(n3) { n3 && (n3.__ = u2); }), M2 = 0; M2 < h2._sb.length; M2++) h2.__h.push(h2._sb[M2]); h2._sb = [], h2.__h.length && f2.push(h2); break n; } null != h2.componentWillUpdate && h2.componentWillUpdate(m2, h2.__s, C2), null != h2.componentDidUpdate && h2.__h.push(function() { h2.componentDidUpdate(v2, w2, _2); }); } if (h2.context = C2, h2.props = m2, h2.__P = n2, h2.__e = false, P2 = l$7.__r, $2 = 0, "prototype" in L2 && L2.prototype.render) { for (h2.state = h2.__s, h2.__d = false, P2 && P2(u2), a2 = h2.render(h2.props, h2.state, h2.context), I2 = 0; I2 < h2._sb.length; I2++) h2.__h.push(h2._sb[I2]); h2._sb = []; } else do { h2.__d = false, P2 && P2(u2), a2 = h2.render(h2.props, h2.state, h2.context), h2.state = h2.__s; } while (h2.__d && ++$2 < 25); h2.state = h2.__s, null != h2.getChildContext && (i2 = d$7(d$7({}, i2), h2.getChildContext())), p2 || null == h2.getSnapshotBeforeUpdate || (_2 = h2.getSnapshotBeforeUpdate(v2, w2)), S$7(n2, y$7(H2 = null != a2 && a2.type === k$5 && null == a2.key ? a2.props.children : a2) ? H2 : [H2], u2, t2, i2, o2, r2, f2, e2, c2, s2), h2.base = u2.__e, u2.__u &= -161, h2.__h.length && f2.push(h2), g2 && (h2.__E = h2.__ = null); } catch (n3) { u2.__v = null, c2 || null != r2 ? (u2.__e = e2, u2.__u |= c2 ? 160 : 32, r2[r2.indexOf(e2)] = null) : (u2.__e = t2.__e, u2.__k = t2.__k), l$7.__e(n3, u2, t2); } else null == r2 && u2.__v === t2.__v ? (u2.__k = t2.__k, u2.__e = t2.__e) : u2.__e = z$6(t2.__e, u2, t2, i2, o2, r2, f2, c2, s2); (a2 = l$7.diffed) && a2(u2); } function j$7(n2, u2, t2) { u2.__d = void 0; for (var i2 = 0; i2 < t2.length; i2++) N$4(t2[i2], t2[++i2], t2[++i2]); l$7.__c && l$7.__c(u2, n2), n2.some(function(u3) { try { n2 = u3.__h, u3.__h = [], n2.some(function(n3) { n3.call(u3); }); } catch (n3) { l$7.__e(n3, u3.__v); } }); } function z$6(l2, u2, t2, i2, o2, r2, f2, e2, c2) { var s2, a2, p2, v2, d2, _2, g2, m2 = t2.props, k2 = u2.props, b2 = u2.type; if ("svg" === b2 ? o2 = "http://www.w3.org/2000/svg" : "math" === b2 ? o2 = "http://www.w3.org/1998/Math/MathML" : o2 || (o2 = "http://www.w3.org/1999/xhtml"), null != r2) { for (s2 = 0; s2 < r2.length; s2++) if ((d2 = r2[s2]) && "setAttribute" in d2 == !!b2 && (b2 ? d2.localName === b2 : 3 === d2.nodeType)) { l2 = d2, r2[s2] = null; break; } } if (null == l2) { if (null === b2) return document.createTextNode(k2); l2 = document.createElementNS(o2, b2, k2.is && k2), r2 = null, e2 = false; } if (null === b2) m2 === k2 || e2 && l2.data === k2 || (l2.data = k2); else { if (r2 = r2 && n$9.call(l2.childNodes), m2 = t2.props || h$7, !e2 && null != r2) for (m2 = {}, s2 = 0; s2 < l2.attributes.length; s2++) m2[(d2 = l2.attributes[s2]).name] = d2.value; for (s2 in m2) if (d2 = m2[s2], "children" == s2) ; else if ("dangerouslySetInnerHTML" == s2) p2 = d2; else if ("key" !== s2 && !(s2 in k2)) { if ("value" == s2 && "defaultValue" in k2 || "checked" == s2 && "defaultChecked" in k2) continue; A$4(l2, s2, null, d2, o2); } for (s2 in k2) d2 = k2[s2], "children" == s2 ? v2 = d2 : "dangerouslySetInnerHTML" == s2 ? a2 = d2 : "value" == s2 ? _2 = d2 : "checked" == s2 ? g2 = d2 : "key" === s2 || e2 && "function" != typeof d2 || m2[s2] === d2 || A$4(l2, s2, d2, m2[s2], o2); if (a2) e2 || p2 && (a2.__html === p2.__html || a2.__html === l2.innerHTML) || (l2.innerHTML = a2.__html), u2.__k = []; else if (p2 && (l2.innerHTML = ""), S$7(l2, y$7(v2) ? v2 : [v2], u2, t2, i2, "foreignObject" === b2 ? "http://www.w3.org/1999/xhtml" : o2, r2, f2, r2 ? r2[0] : t2.__k && x$4(t2, 0), e2, c2), null != r2) for (s2 = r2.length; s2--; ) null != r2[s2] && w$8(r2[s2]); e2 || (s2 = "value", void 0 !== _2 && (_2 !== l2[s2] || "progress" === b2 && !_2 || "option" === b2 && _2 !== m2[s2]) && A$4(l2, s2, _2, m2[s2], o2), s2 = "checked", void 0 !== g2 && g2 !== l2[s2] && A$4(l2, s2, g2, m2[s2], o2)); } return l2; } function N$4(n2, u2, t2) { try { "function" == typeof n2 ? n2(u2) : n2.current = u2; } catch (n3) { l$7.__e(n3, t2); } } function V$5(n2, u2, t2) { var i2, o2; if (l$7.unmount && l$7.unmount(n2), (i2 = n2.ref) && (i2.current && i2.current !== n2.__e || N$4(i2, null, u2)), null != (i2 = n2.__c)) { if (i2.componentWillUnmount) try { i2.componentWillUnmount(); } catch (n3) { l$7.__e(n3, u2); } i2.base = i2.__P = null; } if (i2 = n2.__k) for (o2 = 0; o2 < i2.length; o2++) i2[o2] && V$5(i2[o2], u2, t2 || "function" != typeof n2.type); t2 || null == n2.__e || w$8(n2.__e), n2.__c = n2.__ = n2.__e = n2.__d = void 0; } function q$4(n2, l2, u2) { return this.constructor(n2, u2); } function B$5(u2, t2, i2) { var o2, r2, f2, e2; l$7.__ && l$7.__(u2, t2), r2 = (o2 = "function" == typeof i2) ? null : i2 && i2.__k || t2.__k, f2 = [], e2 = [], O$5(t2, u2 = (!o2 && i2 || t2).__k = _$7(k$5, null, [u2]), r2 || h$7, h$7, t2.namespaceURI, !o2 && i2 ? [i2] : r2 ? null : t2.firstChild ? n$9.call(t2.childNodes) : null, f2, !o2 && i2 ? i2 : r2 ? r2.__e : t2.firstChild, o2, e2), j$7(f2, u2, e2); } function D$7(n2, l2) { B$5(n2, l2, D$7); } function E$7(l2, u2, t2) { var i2, o2, r2, f2, e2 = d$7({}, l2.props); for (r2 in l2.type && l2.type.defaultProps && (f2 = l2.type.defaultProps), u2) "key" == r2 ? i2 = u2[r2] : "ref" == r2 ? o2 = u2[r2] : e2[r2] = void 0 === u2[r2] && void 0 !== f2 ? f2[r2] : u2[r2]; return arguments.length > 2 && (e2.children = arguments.length > 3 ? n$9.call(arguments, 2) : t2), g$9(l2.type, e2, i2 || l2.key, o2 || l2.ref, null); } function G$4(n2, l2) { var u2 = { __c: l2 = "__cC" + a$6++, __: n2, Consumer: function(n3, l3) { return n3.children(l3); }, Provider: function(n3) { var u3, t2; return this.getChildContext || (u3 = [], (t2 = {})[l2] = this, this.getChildContext = function() { return t2; }, this.shouldComponentUpdate = function(n4) { this.props.value !== n4.value && u3.some(function(n5) { n5.__e = true, M$4(n5); }); }, this.sub = function(n4) { u3.push(n4); var l3 = n4.componentWillUnmount; n4.componentWillUnmount = function() { u3.splice(u3.indexOf(n4), 1), l3 && l3.call(n4); }; }), n3.children; } }; return u2.Provider.__ = u2.Consumer.contextType = u2; } n$9 = p$7.slice, l$7 = { __e: function(n2, l2, u2, t2) { for (var i2, o2, r2; l2 = l2.__; ) if ((i2 = l2.__c) && !i2.__) try { if ((o2 = i2.constructor) && null != o2.getDerivedStateFromError && (i2.setState(o2.getDerivedStateFromError(n2)), r2 = i2.__d), null != i2.componentDidCatch && (i2.componentDidCatch(n2, t2 || {}), r2 = i2.__d), r2) return i2.__E = i2; } catch (l3) { n2 = l3; } throw n2; } }, u$5 = 0, t$7 = function(n2) { return null != n2 && null == n2.constructor; }, b$6.prototype.setState = function(n2, l2) { var u2; u2 = null != this.__s && this.__s !== this.state ? this.__s : this.__s = d$7({}, this.state), "function" == typeof n2 && (n2 = n2(d$7({}, u2), this.props)), n2 && d$7(u2, n2), null != n2 && this.__v && (l2 && this._sb.push(l2), M$4(this)); }, b$6.prototype.forceUpdate = function(n2) { this.__v && (this.__e = true, n2 && this.__h.push(n2), M$4(this)); }, b$6.prototype.render = k$5, i$7 = [], r$7 = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, f$6 = function(n2, l2) { return n2.__v.__b - l2.__v.__b; }, P$5.__r = 0, e$8 = 0, c$8 = F$5(false), s$5 = F$5(true), a$6 = 0; const preact_module = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, Component: b$6, Fragment: k$5, cloneElement: E$7, createContext: G$4, createElement: _$7, createRef: m$4, h: _$7, hydrate: D$7, get isValidElement() { return t$7; }, get options() { return l$7; }, render: B$5, toChildArray: H$3 }, Symbol.toStringTag, { value: "Module" })); const require$$1$1 = /* @__PURE__ */ getAugmentedNamespace(preact_module); var ConnectDialog$1 = {}; function r$6(e2) { var t2, f2, n2 = ""; if ("string" == typeof e2 || "number" == typeof e2) n2 += e2; else if ("object" == typeof e2) if (Array.isArray(e2)) for (t2 = 0; t2 < e2.length; t2++) e2[t2] && (f2 = r$6(e2[t2])) && (n2 && (n2 += " "), n2 += f2); else for (t2 in e2) e2[t2] && (n2 && (n2 += " "), n2 += t2); return n2; } function clsx() { for (var e2, t2, f2 = 0, n2 = ""; f2 < arguments.length; ) (e2 = arguments[f2++]) && (t2 = r$6(e2)) && (n2 && (n2 += " "), n2 += t2); return n2; } const clsx_m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, clsx, default: clsx }, Symbol.toStringTag, { value: "Module" })); const require$$0$3 = /* @__PURE__ */ getAugmentedNamespace(clsx_m); var t$6, r$5, u$4, i$6, o$7 = 0, f$5 = [], c$7 = [], e$7 = l$7, a$5 = e$7.__b, v$7 = e$7.__r, l$6 = e$7.diffed, m$3 = e$7.__c, s$4 = e$7.unmount, d$6 = e$7.__; function h$6(n2, t2) { e$7.__h && e$7.__h(r$5, n2, o$7 || t2), o$7 = 0; var u2 = r$5.__H || (r$5.__H = { __: [], __h: [] }); return n2 >= u2.__.length && u2.__.push({ __V: c$7 }), u2.__[n2]; } function p$6(n2) { return o$7 = 1, y$6(D$6, n2); } function y$6(n2, u2, i2) { var o2 = h$6(t$6++, 2); if (o2.t = n2, !o2.__c && (o2.__ = [i2 ? i2(u2) : D$6(void 0, u2), function(n3) { var t2 = o2.__N ? o2.__N[0] : o2.__[0], r2 = o2.t(t2, n3); t2 !== r2 && (o2.__N = [r2, o2.__[1]], o2.__c.setState({})); }], o2.__c = r$5, !r$5.u)) { var f2 = function(n3, t2, r2) { if (!o2.__c.__H) return true; var u3 = o2.__c.__H.__.filter(function(n4) { return !!n4.__c; }); if (u3.every(function(n4) { return !n4.__N; })) return !c2 || c2.call(this, n3, t2, r2); var i3 = false; return u3.forEach(function(n4) { if (n4.__N) { var t3 = n4.__[0]; n4.__ = n4.__N, n4.__N = void 0, t3 !== n4.__[0] && (i3 = true); } }), !(!i3 && o2.__c.props === n3) && (!c2 || c2.call(this, n3, t2, r2)); }; r$5.u = true; var c2 = r$5.shouldComponentUpdate, e2 = r$5.componentWillUpdate; r$5.componentWillUpdate = function(n3, t2, r2) { if (this.__e) { var u3 = c2; c2 = void 0, f2(n3, t2, r2), c2 = u3; } e2 && e2.call(this, n3, t2, r2); }, r$5.shouldComponentUpdate = f2; } return o2.__N || o2.__; } function _$6(n2, u2) { var i2 = h$6(t$6++, 3); !e$7.__s && C$2(i2.__H, u2) && (i2.__ = n2, i2.i = u2, r$5.__H.__h.push(i2)); } function A$3(n2, u2) { var i2 = h$6(t$6++, 4); !e$7.__s && C$2(i2.__H, u2) && (i2.__ = n2, i2.i = u2, r$5.__h.push(i2)); } function F$4(n2) { return o$7 = 5, q$3(function() { return { current: n2 }; }, []); } function T$5(n2, t2, r2) { o$7 = 6, A$3(function() { return "function" == typeof n2 ? (n2(t2()), function() { return n2(null); }) : n2 ? (n2.current = t2(), function() { return n2.current = null; }) : void 0; }, null == r2 ? r2 : r2.concat(n2)); } function q$3(n2, r2) { var u2 = h$6(t$6++, 7); return C$2(u2.__H, r2) ? (u2.__V = n2(), u2.i = r2, u2.__h = n2, u2.__V) : u2.__; } function x$3(n2, t2) { return o$7 = 8, q$3(function() { return n2; }, t2); } function P$4(n2) { var u2 = r$5.context[n2.__c], i2 = h$6(t$6++, 9); return i2.c = n2, u2 ? (null == i2.__ && (i2.__ = true, u2.sub(r$5)), u2.props.value) : n2.__; } function V$4(n2, t2) { e$7.useDebugValue && e$7.useDebugValue(t2 ? t2(n2) : n2); } function b$5(n2) { var u2 = h$6(t$6++, 10), i2 = p$6(); return u2.__ = n2, r$5.componentDidCatch || (r$5.componentDidCatch = function(n3, t2) { u2.__ && u2.__(n3, t2), i2[1](n3); }), [i2[0], function() { i2[1](void 0); }]; } function g$8() { var n2 = h$6(t$6++, 11); if (!n2.__) { for (var u2 = r$5.__v; null !== u2 && !u2.__m && null !== u2.__; ) u2 = u2.__; var i2 = u2.__m || (u2.__m = [0, 0]); n2.__ = "P" + i2[0] + "-" + i2[1]++; } return n2.__; } function j$6() { for (var n2; n2 = f$5.shift(); ) if (n2.__P && n2.__H) try { n2.__H.__h.forEach(z$5), n2.__H.__h.forEach(B$4), n2.__H.__h = []; } catch (t2) { n2.__H.__h = [], e$7.__e(t2, n2.__v); } } e$7.__b = function(n2) { r$5 = null, a$5 && a$5(n2); }, e$7.__ = function(n2, t2) { n2 && t2.__k && t2.__k.__m && (n2.__m = t2.__k.__m), d$6 && d$6(n2, t2); }, e$7.__r = function(n2) { v$7 && v$7(n2), t$6 = 0; var i2 = (r$5 = n2.__c).__H; i2 && (u$4 === r$5 ? (i2.__h = [], r$5.__h = [], i2.__.forEach(function(n3) { n3.__N && (n3.__ = n3.__N), n3.__V = c$7, n3.__N = n3.i = void 0; })) : (i2.__h.forEach(z$5), i2.__h.forEach(B$4), i2.__h = [], t$6 = 0)), u$4 = r$5; }, e$7.diffed = function(n2) { l$6 && l$6(n2); var t2 = n2.__c; t2 && t2.__H && (t2.__H.__h.length && (1 !== f$5.push(t2) && i$6 === e$7.requestAnimationFrame || ((i$6 = e$7.requestAnimationFrame) || w$7)(j$6)), t2.__H.__.forEach(function(n3) { n3.i && (n3.__H = n3.i), n3.__V !== c$7 && (n3.__ = n3.__V), n3.i = void 0, n3.__V = c$7; })), u$4 = r$5 = null; }, e$7.__c = function(n2, t2) { t2.some(function(n3) { try { n3.__h.forEach(z$5), n3.__h = n3.__h.filter(function(n4) { return !n4.__ || B$4(n4); }); } catch (r2) { t2.some(function(n4) { n4.__h && (n4.__h = []); }), t2 = [], e$7.__e(r2, n3.__v); } }), m$3 && m$3(n2, t2); }, e$7.unmount = function(n2) { s$4 && s$4(n2); var t2, r2 = n2.__c; r2 && r2.__H && (r2.__H.__.forEach(function(n3) { try { z$5(n3); } catch (n4) { t2 = n4; } }), r2.__H = void 0, t2 && e$7.__e(t2, r2.__v)); }; var k$4 = "function" == typeof requestAnimationFrame; function w$7(n2) { var t2, r2 = function() { clearTimeout(u2), k$4 && cancelAnimationFrame(t2), setTimeout(n2); }, u2 = setTimeout(r2, 100); k$4 && (t2 = requestAnimationFrame(r2)); } function z$5(n2) { var t2 = r$5, u2 = n2.__c; "function" == typeof u2 && (n2.__c = void 0, u2()), r$5 = t2; } function B$4(n2) { var t2 = r$5; n2.__c = n2.__(), r$5 = t2; } function C$2(n2, t2) { return !n2 || n2.length !== t2.length || t2.some(function(t3, r2) { return t3 !== n2[r2]; }); } function D$6(n2, t2) { return "function" == typeof t2 ? t2(n2) : t2; } const hooks_module = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, useCallback: x$3, useContext: P$4, useDebugValue: V$4, useEffect: _$6, useErrorBoundary: b$5, useId: g$8, useImperativeHandle: T$5, useLayoutEffect: A$3, useMemo: q$3, useReducer: y$6, useRef: F$4, useState: p$6 }, Symbol.toStringTag, { value: "Module" })); const require$$2 = /* @__PURE__ */ getAugmentedNamespace(hooks_module); var ConnectContent$1 = {}; var CloseIcon$1 = {}; Object.defineProperty(CloseIcon$1, "__esModule", { value: true }); CloseIcon$1.CloseIcon = void 0; const preact_1$c = require$$1$1; function CloseIcon(props) { return (0, preact_1$c.h)( "svg", Object.assign({ width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props), (0, preact_1$c.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" }) ); } CloseIcon$1.CloseIcon = CloseIcon; var CoinbaseWalletRound$1 = {}; Object.defineProperty(CoinbaseWalletRound$1, "__esModule", { value: true }); CoinbaseWalletRound$1.CoinbaseWalletRound = void 0; const preact_1$b = require$$1$1; function CoinbaseWalletRound(props) { return (0, preact_1$b.h)( "svg", Object.assign({ width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props), (0, preact_1$b.h)("circle", { cx: "14", cy: "14", r: "14", fill: "#0052FF" }), (0, preact_1$b.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, preact_1$b.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" }) ); } CoinbaseWalletRound$1.CoinbaseWalletRound = CoinbaseWalletRound; var QRCodeIcon$1 = {}; Object.defineProperty(QRCodeIcon$1, "__esModule", { value: true }); QRCodeIcon$1.QRCodeIcon = void 0; const preact_1$a = require$$1$1; function QRCodeIcon(props) { return (0, preact_1$a.h)( "svg", Object.assign({ width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, props), (0, preact_1$a.h)("path", { d: "M3 3V8.99939L5 8.99996V5H9V3H3Z" }), (0, preact_1$a.h)("path", { d: "M15 21L21 21V15.0006L19 15V19L15 19V21Z" }), (0, preact_1$a.h)("path", { d: "M21 9H19V5H15.0006L15 3H21V9Z" }), (0, preact_1$a.h)("path", { d: "M3 15V21H8.99939L8.99996 19H5L5 15H3Z" }) ); } QRCodeIcon$1.QRCodeIcon = QRCodeIcon; var QRCode$2 = {}; function QR8bitByte(data2) { this.mode = QRMode.MODE_8BIT_BYTE; this.data = data2; this.parsedData = []; for (var i2 = 0, l2 = this.data.length; i2 < l2; i2++) { var byteArray = []; var code2 = this.data.charCodeAt(i2); if (code2 > 65536) { byteArray[0] = 240 | (code2 & 1835008) >>> 18; byteArray[1] = 128 | (code2 & 258048) >>> 12; byteArray[2] = 128 | (code2 & 4032) >>> 6; byteArray[3] = 128 | code2 & 63; } else if (code2 > 2048) { byteArray[0] = 224 | (code2 & 61440) >>> 12; byteArray[1] = 128 | (code2 & 4032) >>> 6; byteArray[2] = 128 | code2 & 63; } else if (code2 > 128) { byteArray[0] = 192 | (code2 & 1984) >>> 6; byteArray[1] = 128 | code2 & 63; } else { byteArray[0] = code2; } this.parsedData.push(byteArray); } this.parsedData = Array.prototype.concat.apply([], this.parsedData); if (this.parsedData.length != this.data.length) { this.parsedData.unshift(191); this.parsedData.unshift(187); this.parsedData.unshift(239); } } QR8bitByte.prototype = { getLength: function(buffer2) { return this.parsedData.length; }, write: function(buffer2) { for (var i2 = 0, l2 = this.parsedData.length; i2 < l2; i2++) { buffer2.put(this.parsedData[i2], 8); } } }; function QRCodeModel(typeNumber, errorCorrectLevel) { this.typeNumber = typeNumber; this.errorCorrectLevel = errorCorrectLevel; this.modules = null; this.moduleCount = 0; this.dataCache = null; this.dataList = []; } QRCodeModel.prototype = { addData: function(data2) { var newData = new QR8bitByte(data2); this.dataList.push(newData); this.dataCache = null; }, isDark: function(row, col) { if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) { throw new Error(row + "," + col); } return this.modules[row][col]; }, getModuleCount: function() { return this.moduleCount; }, make: function() { this.makeImpl(false, this.getBestMaskPattern()); }, makeImpl: function(test, maskPattern2) { this.moduleCount = this.typeNumber * 4 + 17; this.modules = new Array(this.moduleCount); for (var row = 0; row < this.moduleCount; row++) { this.modules[row] = new Array(this.moduleCount); for (var col = 0; col < this.moduleCount; col++) { this.modules[row][col] = null; } } this.setupPositionProbePattern(0, 0); this.setupPositionProbePattern(this.moduleCount - 7, 0); this.setupPositionProbePattern(0, this.moduleCount - 7); this.setupPositionAdjustPattern(); this.setupTimingPattern(); this.setupTypeInfo(test, maskPattern2); if (this.typeNumber >= 7) { this.setupTypeNumber(test); } if (this.dataCache == null) { this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList); } this.mapData(this.dataCache, maskPattern2); }, setupPositionProbePattern: function(row, col) { for (var r2 = -1; r2 <= 7; r2++) { if (row + r2 <= -1 || this.moduleCount <= row + r2) continue; for (var c2 = -1; c2 <= 7; c2++) { if (col + c2 <= -1 || this.moduleCount <= col + c2) continue; if (0 <= r2 && r2 <= 6 && (c2 == 0 || c2 == 6) || 0 <= c2 && c2 <= 6 && (r2 == 0 || r2 == 6) || 2 <= r2 && r2 <= 4 && 2 <= c2 && c2 <= 4) { this.modules[row + r2][col + c2] = true; } else { this.modules[row + r2][col + c2] = false; } } } }, getBestMaskPattern: function() { var minLostPoint = 0; var pattern2 = 0; for (var i2 = 0; i2 < 8; i2++) { this.makeImpl(true, i2); var lostPoint = QRUtil.getLostPoint(this); if (i2 == 0 || minLostPoint > lostPoint) { minLostPoint = lostPoint; pattern2 = i2; } } return pattern2; }, createMovieClip: function(target_mc, instance_name, depth) { var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth); var cs2 = 1; this.make(); for (var row = 0; row < this.modules.length; row++) { var y2 = row * cs2; for (var col = 0; col < this.modules[row].length; col++) { var x2 = col * cs2; var dark = this.modules[row][col]; if (dark) { qr_mc.beginFill(0, 100); qr_mc.moveTo(x2, y2); qr_mc.lineTo(x2 + cs2, y2); qr_mc.lineTo(x2 + cs2, y2 + cs2); qr_mc.lineTo(x2, y2 + cs2); qr_mc.endFill(); } } } return qr_mc; }, setupTimingPattern: function() { for (var r2 = 8; r2 < this.moduleCount - 8; r2++) { if (this.modules[r2][6] != null) { continue; } this.modules[r2][6] = r2 % 2 == 0; } for (var c2 = 8; c2 < this.moduleCount - 8; c2++) { if (this.modules[6][c2] != null) { continue; } this.modules[6][c2] = c2 % 2 == 0; } }, setupPositionAdjustPattern: function() { var pos = QRUtil.getPatternPosition(this.typeNumber); for (var i2 = 0; i2 < pos.length; i2++) { for (var j2 = 0; j2 < pos.length; j2++) { var row = pos[i2]; var col = pos[j2]; if (this.modules[row][col] != null) { continue; } for (var r2 = -2; r2 <= 2; r2++) { for (var c2 = -2; c2 <= 2; c2++) { if (r2 == -2 || r2 == 2 || c2 == -2 || c2 == 2 || r2 == 0 && c2 == 0) { this.modules[row + r2][col + c2] = true; } else { this.modules[row + r2][col + c2] = false; } } } } } }, setupTypeNumber: function(test) { var bits = QRUtil.getBCHTypeNumber(this.typeNumber); for (var i2 = 0; i2 < 18; i2++) { var mod = !test && (bits >> i2 & 1) == 1; this.modules[Math.floor(i2 / 3)][i2 % 3 + this.moduleCount - 8 - 3] = mod; } for (var i2 = 0; i2 < 18; i2++) { var mod = !test && (bits >> i2 & 1) == 1; this.modules[i2 % 3 + this.moduleCount - 8 - 3][Math.floor(i2 / 3)] = mod; } }, setupTypeInfo: function(test, maskPattern2) { var data2 = this.errorCorrectLevel << 3 | maskPattern2; var bits = QRUtil.getBCHTypeInfo(data2); for (var i2 = 0; i2 < 15; i2++) { var mod = !test && (bits >> i2 & 1) == 1; if (i2 < 6) { this.modules[i2][8] = mod; } else if (i2 < 8) { this.modules[i2 + 1][8] = mod; } else { this.modules[this.moduleCount - 15 + i2][8] = mod; } } for (var i2 = 0; i2 < 15; i2++) { var mod = !test && (bits >> i2 & 1) == 1; if (i2 < 8) { this.modules[8][this.moduleCount - i2 - 1] = mod; } else if (i2 < 9) { this.modules[8][15 - i2 - 1 + 1] = mod; } else { this.modules[8][15 - i2 - 1] = mod; } } this.modules[this.moduleCount - 8][8] = !test; }, mapData: function(data2, maskPattern2) { var inc2 = -1; var row = this.moduleCount - 1; var bitIndex = 7; var byteIndex = 0; for (var col = this.moduleCount - 1; col > 0; col -= 2) { if (col == 6) col--; while (true) { for (var c2 = 0; c2 < 2; c2++) { if (this.modules[row][col - c2] == null) { var dark = false; if (byteIndex < data2.length) { dark = (data2[byteIndex] >>> bitIndex & 1) == 1; } var mask2 = QRUtil.getMask(maskPattern2, row, col - c2); if (mask2) { dark = !dark; } this.modules[row][col - c2] = dark; bitIndex--; if (bitIndex == -1) { byteIndex++; bitIndex = 7; } } } row += inc2; if (row < 0 || this.moduleCount <= row) { row -= inc2; inc2 = -inc2; break; } } } } }; QRCodeModel.PAD0 = 236; QRCodeModel.PAD1 = 17; QRCodeModel.createData = function(typeNumber, errorCorrectLevel, dataList) { var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel); var buffer2 = new QRBitBuffer(); for (var i2 = 0; i2 < dataList.length; i2++) { var data2 = dataList[i2]; buffer2.put(data2.mode, 4); buffer2.put(data2.getLength(), QRUtil.getLengthInBits(data2.mode, typeNumber)); data2.write(buffer2); } var totalDataCount = 0; for (var i2 = 0; i2 < rsBlocks.length; i2++) { totalDataCount += rsBlocks[i2].dataCount; } if (buffer2.getLengthInBits() > totalDataCount * 8) { throw new Error("code length overflow. (" + buffer2.getLengthInBits() + ">" + totalDataCount * 8 + ")"); } if (buffer2.getLengthInBits() + 4 <= totalDataCount * 8) { buffer2.put(0, 4); } while (buffer2.getLengthInBits() % 8 != 0) { buffer2.putBit(false); } while (true) { if (buffer2.getLengthInBits() >= totalDataCount * 8) { break; } buffer2.put(QRCodeModel.PAD0, 8); if (buffer2.getLengthInBits() >= totalDataCount * 8) { break; } buffer2.put(QRCodeModel.PAD1, 8); } return QRCodeModel.createBytes(buffer2, rsBlocks); }; QRCodeModel.createBytes = function(buffer2, rsBlocks) { var offset = 0; var maxDcCount = 0; var maxEcCount = 0; var dcdata = new Array(rsBlocks.length); var ecdata = new Array(rsBlocks.length); for (var r2 = 0; r2 < rsBlocks.length; r2++) { var dcCount = rsBlocks[r2].dataCount; var ecCount = rsBlocks[r2].totalCount - dcCount; maxDcCount = Math.max(maxDcCount, dcCount); maxEcCount = Math.max(maxEcCount, ecCount); dcdata[r2] = new Array(dcCount); for (var i2 = 0; i2 < dcdata[r2].length; i2++) { dcdata[r2][i2] = 255 & buffer2.buffer[i2 + offset]; } offset += dcCount; var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); var rawPoly = new QRPolynomial(dcdata[r2], rsPoly.getLength() - 1); var modPoly = rawPoly.mod(rsPoly); ecdata[r2] = new Array(rsPoly.getLength() - 1); for (var i2 = 0; i2 < ecdata[r2].length; i2++) { var modIndex = i2 + modPoly.getLength() - ecdata[r2].length; ecdata[r2][i2] = modIndex >= 0 ? modPoly.get(modIndex) : 0; } } var totalCodeCount = 0; for (var i2 = 0; i2 < rsBlocks.length; i2++) { totalCodeCount += rsBlocks[i2].totalCount; } var data2 = new Array(totalCodeCount); var index2 = 0; for (var i2 = 0; i2 < maxDcCount; i2++) { for (var r2 = 0; r2 < rsBlocks.length; r2++) { if (i2 < dcdata[r2].length) { data2[index2++] = dcdata[r2][i2]; } } } for (var i2 = 0; i2 < maxEcCount; i2++) { for (var r2 = 0; r2 < rsBlocks.length; r2++) { if (i2 < ecdata[r2].length) { data2[index2++] = ecdata[r2][i2]; } } } return data2; }; var QRMode = { MODE_NUMBER: 1 << 0, MODE_ALPHA_NUM: 1 << 1, MODE_8BIT_BYTE: 1 << 2, MODE_KANJI: 1 << 3 }; var QRErrorCorrectLevel = { L: 1, M: 0, Q: 3, H: 2 }; var QRMaskPattern = { PATTERN000: 0, PATTERN001: 1, PATTERN010: 2, PATTERN011: 3, PATTERN100: 4, PATTERN101: 5, PATTERN110: 6, PATTERN111: 7 }; var QRUtil = { 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: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0, G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0, G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1, getBCHTypeInfo: function(data2) { var d2 = data2 << 10; while (QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) { d2 ^= QRUtil.G15 << QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G15); } return (data2 << 10 | d2) ^ QRUtil.G15_MASK; }, getBCHTypeNumber: function(data2) { var d2 = data2 << 12; while (QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) { d2 ^= QRUtil.G18 << QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G18); } return data2 << 12 | d2; }, getBCHDigit: function(data2) { var digit = 0; while (data2 != 0) { digit++; data2 >>>= 1; } return digit; }, getPatternPosition: function(typeNumber) { return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1]; }, getMask: function(maskPattern2, i2, j2) { switch (maskPattern2) { case QRMaskPattern.PATTERN000: return (i2 + j2) % 2 == 0; case QRMaskPattern.PATTERN001: return i2 % 2 == 0; case QRMaskPattern.PATTERN010: return j2 % 3 == 0; case QRMaskPattern.PATTERN011: return (i2 + j2) % 3 == 0; case QRMaskPattern.PATTERN100: return (Math.floor(i2 / 2) + Math.floor(j2 / 3)) % 2 == 0; case QRMaskPattern.PATTERN101: return i2 * j2 % 2 + i2 * j2 % 3 == 0; case QRMaskPattern.PATTERN110: return (i2 * j2 % 2 + i2 * j2 % 3) % 2 == 0; case QRMaskPattern.PATTERN111: return (i2 * j2 % 3 + (i2 + j2) % 2) % 2 == 0; default: throw new Error("bad maskPattern:" + maskPattern2); } }, getErrorCorrectPolynomial: function(errorCorrectLength) { var a2 = new QRPolynomial([1], 0); for (var i2 = 0; i2 < errorCorrectLength; i2++) { a2 = a2.multiply(new QRPolynomial([1, QRMath.gexp(i2)], 0)); } return a2; }, getLengthInBits: function(mode2, type2) { if (1 <= type2 && type2 < 10) { switch (mode2) { case QRMode.MODE_NUMBER: return 10; case QRMode.MODE_ALPHA_NUM: return 9; case QRMode.MODE_8BIT_BYTE: return 8; case QRMode.MODE_KANJI: return 8; default: throw new Error("mode:" + mode2); } } else if (type2 < 27) { switch (mode2) { case QRMode.MODE_NUMBER: return 12; case QRMode.MODE_ALPHA_NUM: return 11; case QRMode.MODE_8BIT_BYTE: return 16; case QRMode.MODE_KANJI: return 10; default: throw new Error("mode:" + mode2); } } else if (type2 < 41) { switch (mode2) { case QRMode.MODE_NUMBER: return 14; case QRMode.MODE_ALPHA_NUM: return 13; case QRMode.MODE_8BIT_BYTE: return 16; case QRMode.MODE_KANJI: return 12; default: throw new Error("mode:" + mode2); } } else { throw new Error("type:" + type2); } }, getLostPoint: function(qrCode) { var moduleCount = qrCode.getModuleCount(); var lostPoint = 0; for (var row = 0; row < moduleCount; row++) { for (var col = 0; col < moduleCount; col++) { var sameCount = 0; var dark = qrCode.isDark(row, col); for (var r2 = -1; r2 <= 1; r2++) { if (row + r2 < 0 || moduleCount <= row + r2) { continue; } for (var c2 = -1; c2 <= 1; c2++) { if (col + c2 < 0 || moduleCount <= col + c2) { continue; } if (r2 == 0 && c2 == 0) { continue; } if (dark == qrCode.isDark(row + r2, col + c2)) { sameCount++; } } } if (sameCount > 5) { lostPoint += 3 + sameCount - 5; } } } for (var row = 0; row < moduleCount - 1; row++) { for (var col = 0; col < moduleCount - 1; col++) { var count = 0; if (qrCode.isDark(row, col)) count++; if (qrCode.isDark(row + 1, col)) count++; if (qrCode.isDark(row, col + 1)) count++; if (qrCode.isDark(row + 1, col + 1)) count++; if (count == 0 || count == 4) { lostPoint += 3; } } } for (var row = 0; row < moduleCount; row++) { for (var col = 0; col < moduleCount - 6; col++) { if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) { lostPoint += 40; } } } for (var col = 0; col < moduleCount; col++) { for (var row = 0; row < moduleCount - 6; row++) { if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) { lostPoint += 40; } } } var darkCount = 0; for (var col = 0; col < moduleCount; col++) { for (var row = 0; row < moduleCount; row++) { if (qrCode.isDark(row, col)) { darkCount++; } } } var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5; lostPoint += ratio * 10; return lostPoint; } }; var QRMath = { glog: function(n2) { if (n2 < 1) { throw new Error("glog(" + n2 + ")"); } return QRMath.LOG_TABLE[n2]; }, gexp: function(n2) { while (n2 < 0) { n2 += 255; } while (n2 >= 256) { n2 -= 255; } return QRMath.EXP_TABLE[n2]; }, EXP_TABLE: new Array(256), LOG_TABLE: new Array(256) }; for (var i$5 = 0; i$5 < 8; i$5++) { QRMath.EXP_TABLE[i$5] = 1 << i$5; } for (var i$5 = 8; i$5 < 256; i$5++) { QRMath.EXP_TABLE[i$5] = QRMath.EXP_TABLE[i$5 - 4] ^ QRMath.EXP_TABLE[i$5 - 5] ^ QRMath.EXP_TABLE[i$5 - 6] ^ QRMath.EXP_TABLE[i$5 - 8]; } for (var i$5 = 0; i$5 < 255; i$5++) { QRMath.LOG_TABLE[QRMath.EXP_TABLE[i$5]] = i$5; } function QRPolynomial(num, shift) { if (num.length == void 0) { throw new Error(num.length + "/" + shift); } var offset = 0; while (offset < num.length && num[offset] == 0) { offset++; } this.num = new Array(num.length - offset + shift); for (var i2 = 0; i2 < num.length - offset; i2++) { this.num[i2] = num[i2 + offset]; } } QRPolynomial.prototype = { get: function(index2) { return this.num[index2]; }, getLength: function() { return this.num.length; }, multiply: function(e2) { var num = new Array(this.getLength() + e2.getLength() - 1); for (var i2 = 0; i2 < this.getLength(); i2++) { for (var j2 = 0; j2 < e2.getLength(); j2++) { num[i2 + j2] ^= QRMath.gexp(QRMath.glog(this.get(i2)) + QRMath.glog(e2.get(j2))); } } return new QRPolynomial(num, 0); }, mod: function(e2) { if (this.getLength() - e2.getLength() < 0) { return this; } var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e2.get(0)); var num = new Array(this.getLength()); for (var i2 = 0; i2 < this.getLength(); i2++) { num[i2] = this.get(i2); } for (var i2 = 0; i2 < e2.getLength(); i2++) { num[i2] ^= QRMath.gexp(QRMath.glog(e2.get(i2)) + ratio); } return new QRPolynomial(num, 0).mod(e2); } }; function QRRSBlock(totalCount, dataCount) { this.totalCount = totalCount; this.dataCount = dataCount; } QRRSBlock.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]]; QRRSBlock.getRSBlocks = function(typeNumber, errorCorrectLevel) { var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel); if (rsBlock == void 0) { throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel); } var length = rsBlock.length / 3; var list = []; for (var i2 = 0; i2 < length; i2++) { var count = rsBlock[i2 * 3 + 0]; var totalCount = rsBlock[i2 * 3 + 1]; var dataCount = rsBlock[i2 * 3 + 2]; for (var j2 = 0; j2 < count; j2++) { list.push(new QRRSBlock(totalCount, dataCount)); } } return list; }; QRRSBlock.getRsBlockTable = function(typeNumber, errorCorrectLevel) { switch (errorCorrectLevel) { case QRErrorCorrectLevel.L: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; case QRErrorCorrectLevel.M: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; case QRErrorCorrectLevel.Q: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; case QRErrorCorrectLevel.H: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; default: return void 0; } }; function QRBitBuffer() { this.buffer = []; this.length = 0; } QRBitBuffer.prototype = { get: function(index2) { var bufIndex = Math.floor(index2 / 8); return (this.buffer[bufIndex] >>> 7 - index2 % 8 & 1) == 1; }, put: function(num, length) { for (var i2 = 0; i2 < length; i2++) { this.putBit((num >>> length - i2 - 1 & 1) == 1); } }, getLengthInBits: function() { return this.length; }, putBit: function(bit) { var bufIndex = Math.floor(this.length / 8); if (this.buffer.length <= bufIndex) { this.buffer.push(0); } if (bit) { this.buffer[bufIndex] |= 128 >>> this.length % 8; } this.length++; } }; var QRCodeLimitLength = [[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 QRCode$1(options) { this.options = { padding: 4, width: 256, height: 256, typeNumber: 4, color: "#000000", background: "#ffffff", ecl: "M", image: { svg: "", width: 0, height: 0 } }; if (typeof options === "string") { options = { content: options }; } if (options) { for (var i2 in options) { this.options[i2] = options[i2]; } } 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 _getErrorCorrectLevel(ecl2) { switch (ecl2) { case "L": return QRErrorCorrectLevel.L; case "M": return QRErrorCorrectLevel.M; case "Q": return QRErrorCorrectLevel.Q; case "H": return QRErrorCorrectLevel.H; default: throw new Error("Unknwon error correction level: " + ecl2); } } function _getTypeNumber(content2, ecl2) { var length = _getUTF8Length(content2); var type3 = 1; var limit = 0; for (var i3 = 0, len2 = QRCodeLimitLength.length; i3 <= len2; i3++) { var table = QRCodeLimitLength[i3]; if (!table) { throw new Error("Content too long: expected " + limit + " but got " + length); } switch (ecl2) { case "L": limit = table[0]; break; case "M": limit = table[1]; break; case "Q": limit = table[2]; break; case "H": limit = table[3]; break; default: throw new Error("Unknwon error correction level: " + ecl2); } if (length <= limit) { break; } type3++; } if (type3 > QRCodeLimitLength.length) { throw new Error("Content too long"); } return type3; } function _getUTF8Length(content2) { var result = encodeURI(content2).toString().replace(/\%[0-9a-fA-F]{2}/g, "a"); return result.length + (result.length != content2 ? 3 : 0); } var content = this.options.content; var type2 = _getTypeNumber(content, this.options.ecl); var ecl = _getErrorCorrectLevel(this.options.ecl); this.qrcode = new QRCodeModel(type2, ecl); this.qrcode.addData(content); this.qrcode.make(); } QRCode$1.prototype.svg = function(opt) { var options = this.options || {}; var modules = this.qrcode.modules; if (typeof opt == "undefined") { opt = { container: options.container || "svg" }; } var pretty = typeof options.pretty != "undefined" ? !!options.pretty : true; var indent = pretty ? " " : ""; var EOL = pretty ? "\r\n" : ""; var width = options.width; var height = options.height; var length = modules.length; var xsize = width / (length + 2 * options.padding); var ysize = height / (length + 2 * options.padding); var join = typeof options.join != "undefined" ? !!options.join : false; var swap = typeof options.swap != "undefined" ? !!options.swap : false; var xmlDeclaration = typeof options.xmlDeclaration != "undefined" ? !!options.xmlDeclaration : true; var predefined = typeof options.predefined != "undefined" ? !!options.predefined : false; var defs = predefined ? indent + '' + EOL : ""; var bgrect = indent + '' + EOL; var modrect = ""; var pathdata = ""; for (var y2 = 0; y2 < length; y2++) { for (var x2 = 0; x2 < length; x2++) { var module2 = modules[x2][y2]; if (module2) { var px = x2 * xsize + options.padding * xsize; var py = y2 * ysize + options.padding * ysize; if (swap) { var t2 = px; px = py; py = t2; } if (join) { var w2 = xsize + px; var h2 = ysize + py; px = Number.isInteger(px) ? Number(px) : px.toFixed(2); py = Number.isInteger(py) ? Number(py) : py.toFixed(2); w2 = Number.isInteger(w2) ? Number(w2) : w2.toFixed(2); h2 = Number.isInteger(h2) ? Number(h2) : h2.toFixed(2); pathdata += "M" + px + "," + py + " V" + h2 + " H" + w2 + " V" + py + " H" + px + " Z "; } else if (predefined) { modrect += indent + '' + EOL; } else { modrect += indent + '' + EOL; } } } } if (join) { modrect = indent + ''; } let imgSvg = ""; if (this.options.image !== void 0 && this.options.image.svg) { const imgWidth = width * this.options.image.width / 100; const imgHeight = height * this.options.image.height / 100; const imgX = width / 2 - imgWidth / 2; const imgY = height / 2 - imgHeight / 2; imgSvg += ``; imgSvg += this.options.image.svg + EOL; imgSvg += ""; } var svg = ""; switch (opt.container) { case "svg": if (xmlDeclaration) { svg += '' + EOL; } svg += '' + EOL; svg += defs + bgrect + modrect; svg += imgSvg; svg += ""; break; case "svg-viewbox": if (xmlDeclaration) { svg += '' + EOL; } svg += '' + EOL; svg += defs + bgrect + modrect; svg += imgSvg; svg += ""; break; case "g": svg += '' + EOL; svg += defs + bgrect + modrect; svg += imgSvg; svg += ""; break; default: svg += (defs + bgrect + modrect + imgSvg).replace(/^\s+/, ""); break; } return svg; }; var qrcodeSvg = QRCode$1; var __importDefault$c = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(QRCode$2, "__esModule", { value: true }); QRCode$2.QRCode = void 0; const preact_1$9 = require$$1$1; const hooks_1$2 = require$$2; const qrcode_svg_1 = __importDefault$c(qrcodeSvg); const QRCode = (props) => { const [svg, setSvg] = (0, hooks_1$2.useState)(""); (0, hooks_1$2.useEffect)(() => { var _a2, _b2; const qrcode2 = new qrcode_svg_1.default({ content: props.content, background: props.bgColor || "#ffffff", color: props.fgColor || "#000000", container: "svg", ecl: "M", width: (_a2 = props.width) !== null && _a2 !== void 0 ? _a2 : 256, height: (_b2 = props.height) !== null && _b2 !== void 0 ? _b2 : 256, padding: 0, image: props.image }); const base642 = Buffer.from(qrcode2.svg(), "utf8").toString("base64"); setSvg(`data:image/svg+xml;base64,${base642}`); }, [props.bgColor, props.content, props.fgColor, props.height, props.image, props.width]); return svg ? (0, preact_1$9.h)("img", { src: svg, alt: "QR Code" }) : null; }; QRCode$2.QRCode = QRCode; var Spinner$1 = {}; var SpinnerCss = {}; Object.defineProperty(SpinnerCss, "__esModule", { value: true }); SpinnerCss.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 __importDefault$b = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(Spinner$1, "__esModule", { value: true }); Spinner$1.Spinner = void 0; const preact_1$8 = require$$1$1; const Spinner_css_1 = __importDefault$b(SpinnerCss); const Spinner = (props) => { var _a2; const size2 = (_a2 = props.size) !== null && _a2 !== void 0 ? _a2 : 64; const color = props.color || "#000"; return (0, preact_1$8.h)( "div", { class: "-cbwsdk-spinner" }, (0, preact_1$8.h)("style", null, Spinner_css_1.default), (0, preact_1$8.h)( "svg", { viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg", style: { width: size2, height: size2 } }, (0, preact_1$8.h)("circle", { style: { cx: 50, cy: 50, r: 45, stroke: color } }) ) ); }; Spinner$1.Spinner = Spinner; var ConnectContentCss = {}; Object.defineProperty(ConnectContentCss, "__esModule", { value: true }); ConnectContentCss.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 __importDefault$a = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(ConnectContent$1, "__esModule", { value: true }); ConnectContent$1.CoinbaseWalletSteps = ConnectContent$1.ConnectContent = void 0; const clsx_1$3 = __importDefault$a(require$$0$3); const preact_1$7 = require$$1$1; const util_1$6 = util$3; const version_1$1 = version; const CloseIcon_1 = CloseIcon$1; const CoinbaseWalletRound_1 = CoinbaseWalletRound$1; const QRCodeIcon_1 = QRCodeIcon$1; const QRCode_1 = QRCode$2; const Spinner_1 = Spinner$1; const ConnectContent_css_1 = __importDefault$a(ConnectContentCss); const wallet = { title: "Coinbase Wallet app", description: "Connect with your self-custody wallet", steps: CoinbaseWalletSteps }; const makeIconColor = (theme) => { return theme === "light" ? "#FFFFFF" : "#0A0B0D"; }; function ConnectContent(props) { const { theme } = props; const qrUrl = (0, util_1$6.createQrUrl)(props.sessionId, props.sessionSecret, props.linkAPIUrl, props.isParentConnection, props.version, props.chainId); const WalletSteps = wallet.steps; return (0, preact_1$7.h)( "div", { "data-testid": "connect-content", className: (0, clsx_1$3.default)("-cbwsdk-connect-content", theme) }, (0, preact_1$7.h)("style", null, ConnectContent_css_1.default), (0, preact_1$7.h)( "div", { className: "-cbwsdk-connect-content-header" }, (0, preact_1$7.h)("h2", { className: (0, clsx_1$3.default)("-cbwsdk-connect-content-heading", theme) }, "Scan to connect with our mobile app"), props.onCancel && (0, preact_1$7.h)( "button", { type: "button", className: "-cbwsdk-cancel-button", onClick: props.onCancel }, (0, preact_1$7.h)(CloseIcon_1.CloseIcon, { fill: theme === "light" ? "#0A0B0D" : "#FFFFFF" }) ) ), (0, preact_1$7.h)( "div", { className: "-cbwsdk-connect-content-layout" }, (0, preact_1$7.h)( "div", { className: "-cbwsdk-connect-content-column-left" }, (0, preact_1$7.h)(ConnectItem, { title: wallet.title, description: wallet.description, theme }) ), (0, preact_1$7.h)( "div", { className: "-cbwsdk-connect-content-column-right" }, (0, preact_1$7.h)( "div", { className: "-cbwsdk-connect-content-qr-wrapper" }, (0, preact_1$7.h)(QRCode_1.QRCode, { content: qrUrl, width: 200, height: 200, fgColor: "#000", bgColor: "transparent" }), (0, preact_1$7.h)("input", { type: "hidden", name: "cbw-cbwsdk-version", value: version_1$1.LIB_VERSION }), (0, preact_1$7.h)("input", { type: "hidden", value: qrUrl }) ), (0, preact_1$7.h)(WalletSteps, { theme }), !props.isConnected && (0, preact_1$7.h)( "div", { "data-testid": "connecting-spinner", className: (0, clsx_1$3.default)("-cbwsdk-connect-content-qr-connecting", theme) }, (0, preact_1$7.h)(Spinner_1.Spinner, { size: 36, color: theme === "dark" ? "#FFF" : "#000" }), (0, preact_1$7.h)("p", null, "Connecting...") ) ) ) ); } ConnectContent$1.ConnectContent = ConnectContent; function ConnectItem({ title, description, theme }) { return (0, preact_1$7.h)( "div", { className: (0, clsx_1$3.default)("-cbwsdk-connect-item", theme) }, (0, preact_1$7.h)( "div", null, (0, preact_1$7.h)(CoinbaseWalletRound_1.CoinbaseWalletRound, null) ), (0, preact_1$7.h)( "div", { className: "-cbwsdk-connect-item-copy-wrapper" }, (0, preact_1$7.h)("h3", { className: "-cbwsdk-connect-item-title" }, title), (0, preact_1$7.h)("p", { className: "-cbwsdk-connect-item-description" }, description) ) ); } function CoinbaseWalletSteps({ theme }) { return (0, preact_1$7.h)( "ol", { className: "-cbwsdk-wallet-steps" }, (0, preact_1$7.h)( "li", { className: (0, clsx_1$3.default)("-cbwsdk-wallet-steps-item", theme) }, (0, preact_1$7.h)("div", { className: "-cbwsdk-wallet-steps-item-wrapper" }, "Open Coinbase Wallet app") ), (0, preact_1$7.h)( "li", { className: (0, clsx_1$3.default)("-cbwsdk-wallet-steps-item", theme) }, (0, preact_1$7.h)( "div", { className: "-cbwsdk-wallet-steps-item-wrapper" }, (0, preact_1$7.h)( "span", null, "Tap ", (0, preact_1$7.h)("strong", null, "Scan"), " " ), (0, preact_1$7.h)( "span", { className: (0, clsx_1$3.default)("-cbwsdk-wallet-steps-pad-left", "-cbwsdk-wallet-steps-icon", theme) }, (0, preact_1$7.h)(QRCodeIcon_1.QRCodeIcon, { fill: makeIconColor(theme) }) ) ) ) ); } ConnectContent$1.CoinbaseWalletSteps = CoinbaseWalletSteps; var TryExtensionContent$1 = {}; var ArrowLeftIcon$1 = {}; Object.defineProperty(ArrowLeftIcon$1, "__esModule", { value: true }); ArrowLeftIcon$1.ArrowLeftIcon = void 0; const preact_1$6 = require$$1$1; function ArrowLeftIcon(props) { return (0, preact_1$6.h)( "svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" }, props), (0, preact_1$6.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" }) ); } ArrowLeftIcon$1.ArrowLeftIcon = ArrowLeftIcon; var LaptopIcon$1 = {}; Object.defineProperty(LaptopIcon$1, "__esModule", { value: true }); LaptopIcon$1.LaptopIcon = void 0; const preact_1$5 = require$$1$1; function LaptopIcon(props) { return (0, preact_1$5.h)( "svg", Object.assign({ width: "14", height: "14", viewBox: "0 0 14 14", xmlns: "http://www.w3.org/2000/svg" }, props), (0, preact_1$5.h)("path", { d: "M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z" }), (0, preact_1$5.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" }) ); } LaptopIcon$1.LaptopIcon = LaptopIcon; var SafeIcon$1 = {}; Object.defineProperty(SafeIcon$1, "__esModule", { value: true }); SafeIcon$1.SafeIcon = void 0; const preact_1$4 = require$$1$1; function SafeIcon(props) { return (0, preact_1$4.h)( "svg", Object.assign({ width: "14", height: "14", viewBox: "0 0 14 14", xmlns: "http://www.w3.org/2000/svg" }, props), (0, preact_1$4.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" }) ); } SafeIcon$1.SafeIcon = SafeIcon; var TryExtensionContentCss = {}; Object.defineProperty(TryExtensionContentCss, "__esModule", { value: true }); TryExtensionContentCss.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 __importDefault$9 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(TryExtensionContent$1, "__esModule", { value: true }); TryExtensionContent$1.TryExtensionContent = void 0; const clsx_1$2 = __importDefault$9(require$$0$3); const preact_1$3 = require$$1$1; const hooks_1$1 = require$$2; const ArrowLeftIcon_1 = ArrowLeftIcon$1; const LaptopIcon_1 = LaptopIcon$1; const SafeIcon_1 = SafeIcon$1; const TryExtensionContent_css_1 = __importDefault$9(TryExtensionContentCss); function TryExtensionContent({ theme }) { const [clicked, setClicked] = (0, hooks_1$1.useState)(false); const handleInstallClick = (0, hooks_1$1.useCallback)(() => { window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome", "_blank"); }, []); const handleClick = (0, hooks_1$1.useCallback)(() => { if (clicked) { window.location.reload(); } else { handleInstallClick(); setClicked(true); } }, [handleInstallClick, clicked]); return (0, preact_1$3.h)( "div", { class: (0, clsx_1$2.default)("-cbwsdk-try-extension", theme) }, (0, preact_1$3.h)("style", null, TryExtensionContent_css_1.default), (0, preact_1$3.h)( "div", { class: "-cbwsdk-try-extension-column-half" }, (0, preact_1$3.h)("h3", { class: (0, clsx_1$2.default)("-cbwsdk-try-extension-heading", theme) }, "Or try the Coinbase Wallet browser extension"), (0, preact_1$3.h)( "div", { class: "-cbwsdk-try-extension-cta-wrapper" }, (0, preact_1$3.h)("button", { class: (0, clsx_1$2.default)("-cbwsdk-try-extension-cta", theme), onClick: handleClick }, clicked ? "Refresh" : "Install"), (0, preact_1$3.h)("div", null, !clicked && (0, preact_1$3.h)(ArrowLeftIcon_1.ArrowLeftIcon, { class: "-cbwsdk-try-extension-cta-icon", fill: theme === "light" ? "#0052FF" : "#588AF5" })) ) ), (0, preact_1$3.h)( "div", { class: "-cbwsdk-try-extension-column-half" }, (0, preact_1$3.h)( "ul", { class: "-cbwsdk-try-extension-list" }, (0, preact_1$3.h)( "li", { class: "-cbwsdk-try-extension-list-item" }, (0, preact_1$3.h)( "div", { class: "-cbwsdk-try-extension-list-item-icon-wrapper" }, (0, preact_1$3.h)( "span", { class: (0, clsx_1$2.default)("-cbwsdk-try-extension-list-item-icon", theme) }, (0, preact_1$3.h)(LaptopIcon_1.LaptopIcon, { fill: theme === "light" ? "#0A0B0D" : "#FFFFFF" }) ) ), (0, preact_1$3.h)("div", { class: (0, clsx_1$2.default)("-cbwsdk-try-extension-list-item-copy", theme) }, "Connect with dapps with just one click on your desktop browser") ), (0, preact_1$3.h)( "li", { class: "-cbwsdk-try-extension-list-item" }, (0, preact_1$3.h)( "div", { class: "-cbwsdk-try-extension-list-item-icon-wrapper" }, (0, preact_1$3.h)( "span", { class: (0, clsx_1$2.default)("-cbwsdk-try-extension-list-item-icon", theme) }, (0, preact_1$3.h)(SafeIcon_1.SafeIcon, { fill: theme === "light" ? "#0A0B0D" : "#FFFFFF" }) ) ), (0, preact_1$3.h)("div", { class: (0, clsx_1$2.default)("-cbwsdk-try-extension-list-item-copy", theme) }, "Add an additional layer of security by using a supported Ledger hardware wallet") ) ) ) ); } TryExtensionContent$1.TryExtensionContent = TryExtensionContent; var ConnectDialogCss = {}; Object.defineProperty(ConnectDialogCss, "__esModule", { value: true }); ConnectDialogCss.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 __importDefault$8 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(ConnectDialog$1, "__esModule", { value: true }); ConnectDialog$1.ConnectDialog = void 0; const clsx_1$1 = __importDefault$8(require$$0$3); const preact_1$2 = require$$1$1; const hooks_1 = require$$2; const ConnectContent_1 = ConnectContent$1; const TryExtensionContent_1 = TryExtensionContent$1; const ConnectDialog_css_1 = __importDefault$8(ConnectDialogCss); const ConnectDialog = (props) => { const { isOpen, darkMode } = props; const [containerHidden, setContainerHidden] = (0, hooks_1.useState)(!isOpen); const [dialogHidden, setDialogHidden] = (0, hooks_1.useState)(!isOpen); (0, hooks_1.useEffect)(() => { const timers = [ window.setTimeout(() => { setDialogHidden(!isOpen); }, 10) ]; if (isOpen) { setContainerHidden(false); } else { timers.push(window.setTimeout(() => { setContainerHidden(true); }, 360)); } return () => { timers.forEach(window.clearTimeout); }; }, [isOpen]); const theme = darkMode ? "dark" : "light"; return (0, preact_1$2.h)( "div", { class: (0, clsx_1$1.default)("-cbwsdk-connect-dialog-container", containerHidden && "-cbwsdk-connect-dialog-container-hidden") }, (0, preact_1$2.h)("style", null, ConnectDialog_css_1.default), (0, preact_1$2.h)("div", { class: (0, clsx_1$1.default)("-cbwsdk-connect-dialog-backdrop", theme, dialogHidden && "-cbwsdk-connect-dialog-backdrop-hidden") }), (0, preact_1$2.h)( "div", { class: "-cbwsdk-connect-dialog" }, (0, preact_1$2.h)( "div", { class: (0, clsx_1$1.default)("-cbwsdk-connect-dialog-box", dialogHidden && "-cbwsdk-connect-dialog-box-hidden") }, !props.connectDisabled ? (0, preact_1$2.h)(ConnectContent_1.ConnectContent, { theme, version: props.version, sessionId: props.sessionId, sessionSecret: props.sessionSecret, linkAPIUrl: props.linkAPIUrl, isConnected: props.isConnected, isParentConnection: props.isParentConnection, chainId: props.chainId, onCancel: props.onCancel }) : null, (0, preact_1$2.h)(TryExtensionContent_1.TryExtensionContent, { theme }) ) ) ); }; ConnectDialog$1.ConnectDialog = ConnectDialog; Object.defineProperty(LinkFlow$1, "__esModule", { value: true }); LinkFlow$1.LinkFlow = void 0; const preact_1$1 = require$$1$1; const ConnectDialog_1 = ConnectDialog$1; class LinkFlow { constructor(options) { this.connected = false; this.chainId = 1; this.isOpen = false; this.onCancel = null; this.root = null; this.connectDisabled = false; this.darkMode = options.darkMode; this.version = options.version; this.sessionId = options.sessionId; this.sessionSecret = options.sessionSecret; this.linkAPIUrl = options.linkAPIUrl; this.isParentConnection = options.isParentConnection; } attach(el) { this.root = document.createElement("div"); this.root.className = "-cbwsdk-link-flow-root"; el.appendChild(this.root); this.render(); } setConnected(v2) { if (this.connected !== v2) { this.connected = v2; this.render(); } } setChainId(chainId) { if (this.chainId !== chainId) { this.chainId = chainId; this.render(); } } detach() { var _a2; if (!this.root) { return; } (0, preact_1$1.render)(null, this.root); (_a2 = this.root.parentElement) === null || _a2 === void 0 ? void 0 : _a2.removeChild(this.root); } setConnectDisabled(connectDisabled) { this.connectDisabled = connectDisabled; } open(options) { this.isOpen = true; this.onCancel = options.onCancel; this.render(); } close() { this.isOpen = false; this.onCancel = null; this.render(); } render() { if (!this.root) { return; } (0, preact_1$1.render)((0, preact_1$1.h)(ConnectDialog_1.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); } } LinkFlow$1.LinkFlow = LinkFlow; var Snackbar$1 = {}; var SnackbarCss = {}; Object.defineProperty(SnackbarCss, "__esModule", { value: true }); SnackbarCss.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(exports3) { var __importDefault2 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports3, "__esModule", { value: true }); exports3.SnackbarInstance = exports3.SnackbarContainer = exports3.Snackbar = void 0; const clsx_12 = __importDefault2(require$$0$3); const preact_12 = require$$1$1; const hooks_12 = require$$2; const Snackbar_css_1 = __importDefault2(SnackbarCss); const cblogo = `data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+`; const gearIcon = `data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=`; class Snackbar2 { constructor(options) { this.items = /* @__PURE__ */ new Map(); this.nextItemKey = 0; this.root = null; this.darkMode = options.darkMode; } attach(el) { this.root = document.createElement("div"); this.root.className = "-cbwsdk-snackbar-root"; el.appendChild(this.root); this.render(); } presentItem(itemProps) { const key = this.nextItemKey++; this.items.set(key, itemProps); this.render(); return () => { this.items.delete(key); this.render(); }; } clear() { this.items.clear(); this.render(); } render() { if (!this.root) { return; } (0, preact_12.render)((0, preact_12.h)( "div", null, (0, preact_12.h)(exports3.SnackbarContainer, { darkMode: this.darkMode }, Array.from(this.items.entries()).map(([key, itemProps]) => (0, preact_12.h)(exports3.SnackbarInstance, Object.assign({}, itemProps, { key })))) ), this.root); } } exports3.Snackbar = Snackbar2; const SnackbarContainer = (props) => (0, preact_12.h)( "div", { class: (0, clsx_12.default)("-cbwsdk-snackbar-container") }, (0, preact_12.h)("style", null, Snackbar_css_1.default), (0, preact_12.h)("div", { class: "-cbwsdk-snackbar" }, props.children) ); exports3.SnackbarContainer = SnackbarContainer; const SnackbarInstance = ({ autoExpand, message, menuItems }) => { const [hidden, setHidden] = (0, hooks_12.useState)(true); const [expanded, setExpanded] = (0, hooks_12.useState)(autoExpand !== null && autoExpand !== void 0 ? autoExpand : false); (0, hooks_12.useEffect)(() => { const timers = [ window.setTimeout(() => { setHidden(false); }, 1), window.setTimeout(() => { setExpanded(true); }, 1e4) ]; return () => { timers.forEach(window.clearTimeout); }; }); const toggleExpanded = () => { setExpanded(!expanded); }; return (0, preact_12.h)( "div", { class: (0, clsx_12.default)("-cbwsdk-snackbar-instance", hidden && "-cbwsdk-snackbar-instance-hidden", expanded && "-cbwsdk-snackbar-instance-expanded") }, (0, preact_12.h)( "div", { class: "-cbwsdk-snackbar-instance-header", onClick: toggleExpanded }, (0, preact_12.h)("img", { src: cblogo, class: "-cbwsdk-snackbar-instance-header-cblogo" }), " ", (0, preact_12.h)("div", { class: "-cbwsdk-snackbar-instance-header-message" }, message), (0, preact_12.h)( "div", { class: "-gear-container" }, !expanded && (0, preact_12.h)( "svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, (0, preact_12.h)("circle", { cx: "12", cy: "12", r: "12", fill: "#F5F7F8" }) ), (0, preact_12.h)("img", { src: gearIcon, class: "-gear-icon", title: "Expand" }) ) ), menuItems && menuItems.length > 0 && (0, preact_12.h)("div", { class: "-cbwsdk-snackbar-instance-menu" }, menuItems.map((action, i2) => (0, preact_12.h)( "div", { class: (0, clsx_12.default)("-cbwsdk-snackbar-instance-menu-item", action.isRed && "-cbwsdk-snackbar-instance-menu-item-is-red"), onClick: action.onClick, key: i2 }, (0, preact_12.h)( "svg", { width: action.svgWidth, height: action.svgHeight, viewBox: "0 0 10 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, (0, preact_12.h)("path", { "fill-rule": action.defaultFillRule, "clip-rule": action.defaultClipRule, d: action.path, fill: "#AAAAAA" }) ), (0, preact_12.h)("span", { class: (0, clsx_12.default)("-cbwsdk-snackbar-instance-menu-item-info", action.isRed && "-cbwsdk-snackbar-instance-menu-item-info-is-red") }, action.info) ))) ); }; exports3.SnackbarInstance = SnackbarInstance; })(Snackbar$1); Object.defineProperty(WalletLinkRelayUI$1, "__esModule", { value: true }); WalletLinkRelayUI$1.WalletLinkRelayUI = void 0; const cssReset_1$1 = cssReset; const LinkFlow_1 = LinkFlow$1; const Snackbar_1$1 = Snackbar$1; class WalletLinkRelayUI { constructor(options) { this.standalone = null; this.attached = false; this.snackbar = new Snackbar_1$1.Snackbar({ darkMode: options.darkMode }); this.linkFlow = new LinkFlow_1.LinkFlow({ darkMode: options.darkMode, version: options.version, sessionId: options.session.id, sessionSecret: options.session.secret, linkAPIUrl: options.linkAPIUrl, isParentConnection: false }); } attach() { if (this.attached) { throw new Error("Coinbase Wallet SDK UI is already attached"); } const el = document.documentElement; const container = document.createElement("div"); container.className = "-cbwsdk-css-reset"; el.appendChild(container); this.linkFlow.attach(container); this.snackbar.attach(container); this.attached = true; (0, cssReset_1$1.injectCssReset)(); } setConnected(connected) { this.linkFlow.setConnected(connected); } setChainId(chainId) { this.linkFlow.setChainId(chainId); } setConnectDisabled(connectDisabled) { this.linkFlow.setConnectDisabled(connectDisabled); } /* istanbul ignore next */ addEthereumChain() { } // no-op /* istanbul ignore next */ watchAsset() { } // no-op /* istanbul ignore next */ switchEthereumChain() { } // no-op requestEthereumAccounts(options) { this.linkFlow.open({ onCancel: options.onCancel }); } hideRequestEthereumAccounts() { this.linkFlow.close(); } /* istanbul ignore next */ signEthereumMessage() { } // no-op /* istanbul ignore next */ signEthereumTransaction() { } // no-op /* istanbul ignore next */ submitEthereumTransaction() { } // no-op /* istanbul ignore next */ ethereumAddressFromSignedMessage() { } // no-op showConnecting(options) { let snackbarProps; if (options.isUnlinkedErrorState) { snackbarProps = { autoExpand: true, message: "Connection lost", menuItems: [ { isRed: false, 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: options.onResetConnection } ] }; } else { snackbarProps = { message: "Confirm on phone", menuItems: [ { isRed: true, 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: options.onCancel }, { isRed: false, 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: options.onResetConnection } ] }; } return this.snackbar.presentItem(snackbarProps); } /* istanbul ignore next */ reloadUI() { document.location.reload(); } /* istanbul ignore next */ inlineAccountsResponse() { return false; } /* istanbul ignore next */ inlineAddEthereumChain() { return false; } /* istanbul ignore next */ inlineWatchAsset() { return false; } /* istanbul ignore next */ inlineSwitchEthereumChain() { return false; } /* istanbul ignore next */ setStandalone(status) { this.standalone = status; } /* istanbul ignore next */ isStandalone() { var _a2; return (_a2 = this.standalone) !== null && _a2 !== void 0 ? _a2 : false; } } WalletLinkRelayUI$1.WalletLinkRelayUI = WalletLinkRelayUI; Object.defineProperty(WalletLinkRelay$1, "__esModule", { value: true }); WalletLinkRelay$1.WalletLinkRelay = void 0; const error_1$1 = error; const type_1$1 = type$1; const util_1$5 = util$3; const DiagnosticLogger_1$1 = DiagnosticLogger; const RelayAbstract_1$1 = RelayAbstract$1; const Session_1$1 = Session$1; const WalletLinkConnection_1 = WalletLinkConnection$1; const Web3Response_1$1 = Web3Response; const WalletLinkRelayUI_1$1 = WalletLinkRelayUI$1; class WalletLinkRelay extends RelayAbstract_1$1.RelayAbstract { constructor(options) { var _a2; super(); this.accountsCallback = null; this.chainCallbackParams = { chainId: "", jsonRpcUrl: "" }; this.chainCallback = null; this.dappDefaultChain = 1; this.appName = ""; this.appLogoUrl = null; this.linkedUpdated = (linked) => { var _a3; this.isLinked = linked; const cachedAddresses = this.storage.getItem(RelayAbstract_1$1.LOCAL_STORAGE_ADDRESSES_KEY); if (linked) { this.session.linked = linked; } this.isUnlinkedErrorState = false; if (cachedAddresses) { const addresses = cachedAddresses.split(" "); const wasConnectedViaStandalone = this.storage.getItem("IsStandaloneSigning") === "true"; if (addresses[0] !== "" && !linked && this.session.linked && !wasConnectedViaStandalone) { this.isUnlinkedErrorState = true; const sessionIdHash = this.getSessionIdHash(); (_a3 = this.diagnostic) === null || _a3 === void 0 ? void 0 : _a3.log(DiagnosticLogger_1$1.EVENTS.UNLINKED_ERROR_STATE, { sessionIdHash }); } } }; this.metadataUpdated = (key, value) => { this.storage.setItem(key, value); }; this.chainUpdated = (chainId, jsonRpcUrl) => { if (this.chainCallbackParams.chainId === chainId && this.chainCallbackParams.jsonRpcUrl === jsonRpcUrl) { return; } this.chainCallbackParams = { chainId, jsonRpcUrl }; if (this.chainCallback) { this.chainCallback(chainId, jsonRpcUrl); } }; this.accountUpdated = (selectedAddress) => { if (this.accountsCallback) { this.accountsCallback([selectedAddress]); } if (WalletLinkRelay.accountRequestCallbackIds.size > 0) { Array.from(WalletLinkRelay.accountRequestCallbackIds.values()).forEach((id2) => { const message = { type: "WEB3_RESPONSE", id: id2, response: { method: "requestEthereumAccounts", result: [selectedAddress] } }; this.invokeCallback(Object.assign(Object.assign({}, message), { id: id2 })); }); WalletLinkRelay.accountRequestCallbackIds.clear(); } }; this.connectedUpdated = (connected) => { this.ui.setConnected(connected); }; this.resetAndReload = this.resetAndReload.bind(this); this.linkAPIUrl = options.linkAPIUrl; this.storage = options.storage; this.options = options; const { session, ui, connection } = this.subscribe(); this._session = session; this.connection = connection; this.relayEventManager = options.relayEventManager; this.diagnostic = options.diagnosticLogger; this._reloadOnDisconnect = (_a2 = options.reloadOnDisconnect) !== null && _a2 !== void 0 ? _a2 : true; this.ui = ui; } subscribe() { const session = Session_1$1.Session.load(this.storage) || new Session_1$1.Session(this.storage).save(); const { linkAPIUrl, diagnostic } = this; const connection = new WalletLinkConnection_1.WalletLinkConnection({ session, linkAPIUrl, diagnostic, listener: this }); const { version: version2, darkMode } = this.options; const ui = this.options.uiConstructor({ linkAPIUrl, version: version2, darkMode, session }); connection.connect(); return { session, ui, connection }; } attachUI() { this.ui.attach(); } resetAndReload() { Promise.race([ this.connection.setSessionMetadata("__destroyed", "1"), new Promise((resolve) => setTimeout(() => resolve(null), 1e3)) ]).then(() => { var _a2, _b2; const isStandalone = this.ui.isStandalone(); (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1$1.EVENTS.SESSION_STATE_CHANGE, { method: "relay::resetAndReload", sessionMetadataChange: "__destroyed, 1", sessionIdHash: this.getSessionIdHash() }); this.connection.destroy(); const storedSession = Session_1$1.Session.load(this.storage); if ((storedSession === null || storedSession === void 0 ? void 0 : storedSession.id) === this._session.id) { this.storage.clear(); } else if (storedSession) { (_b2 = this.diagnostic) === null || _b2 === void 0 ? void 0 : _b2.log(DiagnosticLogger_1$1.EVENTS.SKIPPED_CLEARING_SESSION, { sessionIdHash: this.getSessionIdHash(), storedSessionIdHash: Session_1$1.Session.hash(storedSession.id) }); } if (this._reloadOnDisconnect) { this.ui.reloadUI(); return; } if (this.accountsCallback) { this.accountsCallback([], true); } const { session, ui, connection } = this.subscribe(); this._session = session; this.connection = connection; this.ui = ui; if (isStandalone && this.ui.setStandalone) this.ui.setStandalone(true); if (!this.options.headlessMode) this.attachUI(); }).catch((err) => { var _a2; (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1$1.EVENTS.FAILURE, { method: "relay::resetAndReload", message: `failed to reset and reload with ${err}`, sessionIdHash: this.getSessionIdHash() }); }); } setAppInfo(appName, appLogoUrl) { this.appName = appName; this.appLogoUrl = appLogoUrl; } getStorageItem(key) { return this.storage.getItem(key); } get session() { return this._session; } setStorageItem(key, value) { this.storage.setItem(key, value); } signEthereumMessage(message, address, addPrefix, typedDataJson) { return this.sendRequest({ method: "signEthereumMessage", params: { message: (0, util_1$5.hexStringFromBuffer)(message, true), address, addPrefix, typedDataJson: typedDataJson || null } }); } ethereumAddressFromSignedMessage(message, signature, addPrefix) { return this.sendRequest({ method: "ethereumAddressFromSignedMessage", params: { message: (0, util_1$5.hexStringFromBuffer)(message, true), signature: (0, util_1$5.hexStringFromBuffer)(signature, true), addPrefix } }); } signEthereumTransaction(params) { return this.sendRequest({ method: "signEthereumTransaction", params: { fromAddress: params.fromAddress, toAddress: params.toAddress, weiValue: (0, util_1$5.bigIntStringFromBN)(params.weiValue), data: (0, util_1$5.hexStringFromBuffer)(params.data, true), nonce: params.nonce, gasPriceInWei: params.gasPriceInWei ? (0, util_1$5.bigIntStringFromBN)(params.gasPriceInWei) : null, maxFeePerGas: params.gasPriceInWei ? (0, util_1$5.bigIntStringFromBN)(params.gasPriceInWei) : null, maxPriorityFeePerGas: params.gasPriceInWei ? (0, util_1$5.bigIntStringFromBN)(params.gasPriceInWei) : null, gasLimit: params.gasLimit ? (0, util_1$5.bigIntStringFromBN)(params.gasLimit) : null, chainId: params.chainId, shouldSubmit: false } }); } signAndSubmitEthereumTransaction(params) { return this.sendRequest({ method: "signEthereumTransaction", params: { fromAddress: params.fromAddress, toAddress: params.toAddress, weiValue: (0, util_1$5.bigIntStringFromBN)(params.weiValue), data: (0, util_1$5.hexStringFromBuffer)(params.data, true), nonce: params.nonce, gasPriceInWei: params.gasPriceInWei ? (0, util_1$5.bigIntStringFromBN)(params.gasPriceInWei) : null, maxFeePerGas: params.maxFeePerGas ? (0, util_1$5.bigIntStringFromBN)(params.maxFeePerGas) : null, maxPriorityFeePerGas: params.maxPriorityFeePerGas ? (0, util_1$5.bigIntStringFromBN)(params.maxPriorityFeePerGas) : null, gasLimit: params.gasLimit ? (0, util_1$5.bigIntStringFromBN)(params.gasLimit) : null, chainId: params.chainId, shouldSubmit: true } }); } submitEthereumTransaction(signedTransaction, chainId) { return this.sendRequest({ method: "submitEthereumTransaction", params: { signedTransaction: (0, util_1$5.hexStringFromBuffer)(signedTransaction, true), chainId } }); } scanQRCode(regExp) { return this.sendRequest({ method: "scanQRCode", params: { regExp } }); } getQRCodeUrl() { return (0, util_1$5.createQrUrl)(this._session.id, this._session.secret, this.linkAPIUrl, false, this.options.version, this.dappDefaultChain); } genericRequest(data2, action) { return this.sendRequest({ method: "generic", params: { action, data: data2 } }); } sendGenericMessage(request) { return this.sendRequest(request); } sendRequest(request) { let hideSnackbarItem = null; const id2 = (0, util_1$5.randomBytesHex)(8); const cancel = (error2) => { this.publishWeb3RequestCanceledEvent(id2); this.handleErrorResponse(id2, request.method, error2); hideSnackbarItem === null || hideSnackbarItem === void 0 ? void 0 : hideSnackbarItem(); }; const promise = new Promise((resolve, reject) => { if (!this.ui.isStandalone()) { hideSnackbarItem = this.ui.showConnecting({ isUnlinkedErrorState: this.isUnlinkedErrorState, onCancel: cancel, onResetConnection: this.resetAndReload // eslint-disable-line @typescript-eslint/unbound-method }); } this.relayEventManager.callbacks.set(id2, (response) => { hideSnackbarItem === null || hideSnackbarItem === void 0 ? void 0 : hideSnackbarItem(); if ((0, Web3Response_1$1.isErrorResponse)(response)) { return reject(new Error(response.errorMessage)); } resolve(response); }); if (this.ui.isStandalone()) { this.sendRequestStandalone(id2, request); } else { this.publishWeb3RequestEvent(id2, request); } }); return { promise, cancel }; } setConnectDisabled(disabled) { this.ui.setConnectDisabled(disabled); } setAccountsCallback(accountsCallback) { this.accountsCallback = accountsCallback; } setChainCallback(chainCallback) { this.chainCallback = chainCallback; } setDappDefaultChainCallback(chainId) { this.dappDefaultChain = chainId; if (this.ui instanceof WalletLinkRelayUI_1$1.WalletLinkRelayUI) { this.ui.setChainId(chainId); } } publishWeb3RequestEvent(id2, request) { var _a2; const message = { type: "WEB3_REQUEST", id: id2, request }; const storedSession = Session_1$1.Session.load(this.storage); (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1$1.EVENTS.WEB3_REQUEST, { eventId: message.id, method: `relay::${request.method}`, sessionIdHash: this.getSessionIdHash(), storedSessionIdHash: storedSession ? Session_1$1.Session.hash(storedSession.id) : "", isSessionMismatched: ((storedSession === null || storedSession === void 0 ? void 0 : storedSession.id) !== this._session.id).toString() }); this.publishEvent("Web3Request", message, true).then((_2) => { var _a3; (_a3 = this.diagnostic) === null || _a3 === void 0 ? void 0 : _a3.log(DiagnosticLogger_1$1.EVENTS.WEB3_REQUEST_PUBLISHED, { eventId: message.id, method: `relay::${request.method}`, sessionIdHash: this.getSessionIdHash(), storedSessionIdHash: storedSession ? Session_1$1.Session.hash(storedSession.id) : "", isSessionMismatched: ((storedSession === null || storedSession === void 0 ? void 0 : storedSession.id) !== this._session.id).toString() }); }).catch((err) => { this.handleWeb3ResponseMessage({ type: "WEB3_RESPONSE", id: message.id, response: { method: request.method, errorMessage: err.message } }); }); } publishWeb3RequestCanceledEvent(id2) { const message = { type: "WEB3_REQUEST_CANCELED", id: id2 }; this.publishEvent("Web3RequestCanceled", message, false).then(); } publishEvent(event, message, callWebhook) { return this.connection.publishEvent(event, message, callWebhook); } handleWeb3ResponseMessage(message) { var _a2; const { response } = message; (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1$1.EVENTS.WEB3_RESPONSE, { eventId: message.id, method: `relay::${response.method}`, sessionIdHash: this.getSessionIdHash() }); if (response.method === "requestEthereumAccounts") { WalletLinkRelay.accountRequestCallbackIds.forEach((id2) => this.invokeCallback(Object.assign(Object.assign({}, message), { id: id2 }))); WalletLinkRelay.accountRequestCallbackIds.clear(); return; } this.invokeCallback(message); } handleErrorResponse(id2, method, error2, errorCode) { var _a2; const errorMessage = (_a2 = error2 === null || error2 === void 0 ? void 0 : error2.message) !== null && _a2 !== void 0 ? _a2 : (0, error_1$1.getMessageFromCode)(errorCode); this.handleWeb3ResponseMessage({ type: "WEB3_RESPONSE", id: id2, response: { method, errorMessage, errorCode } }); } invokeCallback(message) { const callback = this.relayEventManager.callbacks.get(message.id); if (callback) { callback(message.response); this.relayEventManager.callbacks.delete(message.id); } } requestEthereumAccounts() { const request = { method: "requestEthereumAccounts", params: { appName: this.appName, appLogoUrl: this.appLogoUrl || null } }; const id2 = (0, util_1$5.randomBytesHex)(8); const cancel = (error2) => { this.publishWeb3RequestCanceledEvent(id2); this.handleErrorResponse(id2, request.method, error2); }; const promise = new Promise((resolve, reject) => { this.relayEventManager.callbacks.set(id2, (response) => { this.ui.hideRequestEthereumAccounts(); if ((0, Web3Response_1$1.isErrorResponse)(response)) { return reject(new Error(response.errorMessage)); } resolve(response); }); if (this.ui.inlineAccountsResponse()) { const onAccounts = (accounts) => { this.handleWeb3ResponseMessage({ type: "WEB3_RESPONSE", id: id2, response: { method: "requestEthereumAccounts", result: accounts } }); }; this.ui.requestEthereumAccounts({ onCancel: cancel, onAccounts }); } else { const err = error_1$1.standardErrors.provider.userRejectedRequest("User denied account authorization"); this.ui.requestEthereumAccounts({ onCancel: () => cancel(err) }); } WalletLinkRelay.accountRequestCallbackIds.add(id2); if (!this.ui.inlineAccountsResponse() && !this.ui.isStandalone()) { this.publishWeb3RequestEvent(id2, request); } }); return { promise, cancel }; } selectProvider(providerOptions) { const request = { method: "selectProvider", params: { providerOptions } }; const id2 = (0, util_1$5.randomBytesHex)(8); const cancel = (error2) => { this.publishWeb3RequestCanceledEvent(id2); this.handleErrorResponse(id2, request.method, error2); }; const promise = new Promise((resolve, reject) => { this.relayEventManager.callbacks.set(id2, (response) => { if ((0, Web3Response_1$1.isErrorResponse)(response)) { return reject(new Error(response.errorMessage)); } resolve(response); }); const _cancel = (_error) => { this.handleWeb3ResponseMessage({ type: "WEB3_RESPONSE", id: id2, response: { method: "selectProvider", result: type_1$1.ProviderType.Unselected } }); }; const approve = (selectedProviderKey) => { this.handleWeb3ResponseMessage({ type: "WEB3_RESPONSE", id: id2, response: { method: "selectProvider", result: selectedProviderKey } }); }; if (this.ui.selectProvider) this.ui.selectProvider({ onApprove: approve, onCancel: _cancel, providerOptions }); }); return { cancel, promise }; } watchAsset(type2, address, symbol, decimals, image, chainId) { const request = { method: "watchAsset", params: { type: type2, options: { address, symbol, decimals, image }, chainId } }; let hideSnackbarItem = null; const id2 = (0, util_1$5.randomBytesHex)(8); const cancel = (error2) => { this.publishWeb3RequestCanceledEvent(id2); this.handleErrorResponse(id2, request.method, error2); hideSnackbarItem === null || hideSnackbarItem === void 0 ? void 0 : hideSnackbarItem(); }; if (!this.ui.inlineWatchAsset()) { hideSnackbarItem = this.ui.showConnecting({ isUnlinkedErrorState: this.isUnlinkedErrorState, onCancel: cancel, onResetConnection: this.resetAndReload // eslint-disable-line @typescript-eslint/unbound-method }); } const promise = new Promise((resolve, reject) => { this.relayEventManager.callbacks.set(id2, (response) => { hideSnackbarItem === null || hideSnackbarItem === void 0 ? void 0 : hideSnackbarItem(); if ((0, Web3Response_1$1.isErrorResponse)(response)) { return reject(new Error(response.errorMessage)); } resolve(response); }); const _cancel = (_error) => { this.handleWeb3ResponseMessage({ type: "WEB3_RESPONSE", id: id2, response: { method: "watchAsset", result: false } }); }; const approve = () => { this.handleWeb3ResponseMessage({ type: "WEB3_RESPONSE", id: id2, response: { method: "watchAsset", result: true } }); }; if (this.ui.inlineWatchAsset()) { this.ui.watchAsset({ onApprove: approve, onCancel: _cancel, type: type2, address, symbol, decimals, image, chainId }); } if (!this.ui.inlineWatchAsset() && !this.ui.isStandalone()) { this.publishWeb3RequestEvent(id2, request); } }); return { cancel, promise }; } addEthereumChain(chainId, rpcUrls, iconUrls, blockExplorerUrls, chainName, nativeCurrency) { const request = { method: "addEthereumChain", params: { chainId, rpcUrls, blockExplorerUrls, chainName, iconUrls, nativeCurrency } }; let hideSnackbarItem = null; const id2 = (0, util_1$5.randomBytesHex)(8); const cancel = (error2) => { this.publishWeb3RequestCanceledEvent(id2); this.handleErrorResponse(id2, request.method, error2); hideSnackbarItem === null || hideSnackbarItem === void 0 ? void 0 : hideSnackbarItem(); }; if (!this.ui.inlineAddEthereumChain(chainId)) { hideSnackbarItem = this.ui.showConnecting({ isUnlinkedErrorState: this.isUnlinkedErrorState, onCancel: cancel, onResetConnection: this.resetAndReload // eslint-disable-line @typescript-eslint/unbound-method }); } const promise = new Promise((resolve, reject) => { this.relayEventManager.callbacks.set(id2, (response) => { hideSnackbarItem === null || hideSnackbarItem === void 0 ? void 0 : hideSnackbarItem(); if ((0, Web3Response_1$1.isErrorResponse)(response)) { return reject(new Error(response.errorMessage)); } resolve(response); }); const _cancel = (_error) => { this.handleWeb3ResponseMessage({ type: "WEB3_RESPONSE", id: id2, response: { method: "addEthereumChain", result: { isApproved: false, rpcUrl: "" } } }); }; const approve = (rpcUrl) => { this.handleWeb3ResponseMessage({ type: "WEB3_RESPONSE", id: id2, response: { method: "addEthereumChain", result: { isApproved: true, rpcUrl } } }); }; if (this.ui.inlineAddEthereumChain(chainId)) { this.ui.addEthereumChain({ onCancel: _cancel, onApprove: approve, chainId: request.params.chainId, rpcUrls: request.params.rpcUrls, blockExplorerUrls: request.params.blockExplorerUrls, chainName: request.params.chainName, iconUrls: request.params.iconUrls, nativeCurrency: request.params.nativeCurrency }); } if (!this.ui.inlineAddEthereumChain(chainId) && !this.ui.isStandalone()) { this.publishWeb3RequestEvent(id2, request); } }); return { promise, cancel }; } switchEthereumChain(chainId, address) { const request = { method: "switchEthereumChain", params: Object.assign({ chainId }, { address }) }; const id2 = (0, util_1$5.randomBytesHex)(8); const cancel = (error2) => { this.publishWeb3RequestCanceledEvent(id2); this.handleErrorResponse(id2, request.method, error2); }; const promise = new Promise((resolve, reject) => { this.relayEventManager.callbacks.set(id2, (response) => { if ((0, Web3Response_1$1.isErrorResponse)(response) && response.errorCode) { return reject(error_1$1.standardErrors.provider.custom({ code: response.errorCode, message: `Unrecognized chain ID. Try adding the chain using addEthereumChain first.` })); } else if ((0, Web3Response_1$1.isErrorResponse)(response)) { return reject(new Error(response.errorMessage)); } resolve(response); }); const _cancel = (error2) => { var _a2; if (error2) { const errorCode = (_a2 = (0, error_1$1.getErrorCode)(error2)) !== null && _a2 !== void 0 ? _a2 : error_1$1.standardErrorCodes.provider.unsupportedChain; this.handleErrorResponse(id2, "switchEthereumChain", error2 instanceof Error ? error2 : error_1$1.standardErrors.provider.unsupportedChain(chainId), errorCode); } else { this.handleWeb3ResponseMessage({ type: "WEB3_RESPONSE", id: id2, response: { method: "switchEthereumChain", result: { isApproved: false, rpcUrl: "" } } }); } }; const approve = (rpcUrl) => { this.handleWeb3ResponseMessage({ type: "WEB3_RESPONSE", id: id2, response: { method: "switchEthereumChain", result: { isApproved: true, rpcUrl } } }); }; this.ui.switchEthereumChain({ onCancel: _cancel, onApprove: approve, chainId: request.params.chainId, address: request.params.address }); if (!this.ui.inlineSwitchEthereumChain() && !this.ui.isStandalone()) { this.publishWeb3RequestEvent(id2, request); } }); return { promise, cancel }; } inlineAddEthereumChain(chainId) { return this.ui.inlineAddEthereumChain(chainId); } getSessionIdHash() { return Session_1$1.Session.hash(this._session.id); } sendRequestStandalone(id2, request) { const _cancel = (error2) => { this.handleErrorResponse(id2, request.method, error2); }; const onSuccess = (response) => { this.handleWeb3ResponseMessage({ type: "WEB3_RESPONSE", id: id2, response }); }; switch (request.method) { case "signEthereumMessage": this.ui.signEthereumMessage({ request, onSuccess, onCancel: _cancel }); break; case "signEthereumTransaction": this.ui.signEthereumTransaction({ request, onSuccess, onCancel: _cancel }); break; case "submitEthereumTransaction": this.ui.submitEthereumTransaction({ request, onSuccess, onCancel: _cancel }); break; case "ethereumAddressFromSignedMessage": this.ui.ethereumAddressFromSignedMessage({ request, onSuccess }); break; default: _cancel(); break; } } } WalletLinkRelay$1.WalletLinkRelay = WalletLinkRelay; WalletLinkRelay.accountRequestCallbackIds = /* @__PURE__ */ new Set(); var MobileRelayUI$1 = {}; var RedirectDialog$1 = {}; var Snackbar = {}; (function(exports3) { var __createBinding2 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; var desc = Object.getOwnPropertyDescriptor(m2, k2); if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m2[k2]; } }; } Object.defineProperty(o2, k22, desc); } : function(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; o2[k22] = m2[k2]; }); var __exportStar2 = commonjsGlobal && commonjsGlobal.__exportStar || function(m2, exports4) { for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports4, p2)) __createBinding2(exports4, m2, p2); }; Object.defineProperty(exports3, "__esModule", { value: true }); __exportStar2(Snackbar$1, exports3); })(Snackbar); var RedirectDialogCss = {}; Object.defineProperty(RedirectDialogCss, "__esModule", { value: true }); RedirectDialogCss.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 __importDefault$7 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(RedirectDialog$1, "__esModule", { value: true }); RedirectDialog$1.RedirectDialog = void 0; const clsx_1 = __importDefault$7(require$$0$3); const preact_1 = require$$1$1; const cssReset_1 = cssReset; const Snackbar_1 = Snackbar; const RedirectDialog_css_1 = __importDefault$7(RedirectDialogCss); class RedirectDialog { constructor() { this.root = null; } attach() { const el = document.documentElement; this.root = document.createElement("div"); this.root.className = "-cbwsdk-css-reset"; el.appendChild(this.root); (0, cssReset_1.injectCssReset)(); } present(props) { this.render(props); } clear() { this.render(null); } render(props) { if (!this.root) return; (0, preact_1.render)(null, this.root); if (!props) return; (0, preact_1.render)((0, preact_1.h)(RedirectDialogContent, Object.assign({}, props, { onDismiss: () => { this.clear(); } })), this.root); } } RedirectDialog$1.RedirectDialog = RedirectDialog; const RedirectDialogContent = ({ title, buttonText, darkMode, onButtonClick, onDismiss }) => { const theme = darkMode ? "dark" : "light"; return (0, preact_1.h)( Snackbar_1.SnackbarContainer, { darkMode }, (0, preact_1.h)( "div", { class: "-cbwsdk-redirect-dialog" }, (0, preact_1.h)("style", null, RedirectDialog_css_1.default), (0, preact_1.h)("div", { class: "-cbwsdk-redirect-dialog-backdrop", onClick: onDismiss }), (0, preact_1.h)( "div", { class: (0, clsx_1.default)("-cbwsdk-redirect-dialog-box", theme) }, (0, preact_1.h)("p", null, title), (0, preact_1.h)("button", { onClick: onButtonClick }, buttonText) ) ) ); }; Object.defineProperty(MobileRelayUI$1, "__esModule", { value: true }); MobileRelayUI$1.MobileRelayUI = void 0; const RedirectDialog_1 = RedirectDialog$1; class MobileRelayUI { constructor(options) { this.attached = false; this.darkMode = false; this.redirectDialog = new RedirectDialog_1.RedirectDialog(); this.darkMode = options.darkMode; } attach() { if (this.attached) { throw new Error("Coinbase Wallet SDK UI is already attached"); } this.redirectDialog.attach(); this.attached = true; } setConnected(_connected) { } // no-op redirectToCoinbaseWallet(walletLinkUrl) { const url = new URL("https://go.cb-w.com/walletlink"); url.searchParams.append("redirect_url", window.location.href); if (walletLinkUrl) { url.searchParams.append("wl_url", walletLinkUrl); } const anchorTag = document.createElement("a"); anchorTag.target = "cbw-opener"; anchorTag.href = url.href; anchorTag.rel = "noreferrer noopener"; anchorTag.click(); } openCoinbaseWalletDeeplink(walletLinkUrl) { this.redirectDialog.present({ title: "Redirecting to Coinbase Wallet...", buttonText: "Open", darkMode: this.darkMode, onButtonClick: () => { this.redirectToCoinbaseWallet(walletLinkUrl); } }); setTimeout(() => { this.redirectToCoinbaseWallet(walletLinkUrl); }, 99); } showConnecting(_options) { return () => { this.redirectDialog.clear(); }; } hideRequestEthereumAccounts() { this.redirectDialog.clear(); } // -- Methods below are not needed for mobile requestEthereumAccounts() { } // no-op addEthereumChain() { } // no-op watchAsset() { } // no-op selectProvider() { } // no-op switchEthereumChain() { } // no-op signEthereumMessage() { } // no-op signEthereumTransaction() { } // no-op submitEthereumTransaction() { } // no-op ethereumAddressFromSignedMessage() { } // no-op reloadUI() { } // no-op setStandalone() { } // no-op setConnectDisabled() { } // no-op inlineAccountsResponse() { return false; } inlineAddEthereumChain() { return false; } inlineWatchAsset() { return false; } inlineSwitchEthereumChain() { return false; } isStandalone() { return false; } } MobileRelayUI$1.MobileRelayUI = MobileRelayUI; Object.defineProperty(MobileRelay$1, "__esModule", { value: true }); MobileRelay$1.MobileRelay = void 0; const util_1$4 = util$3; const WalletLinkRelay_1$1 = WalletLinkRelay$1; const MobileRelayUI_1$1 = MobileRelayUI$1; class MobileRelay extends WalletLinkRelay_1$1.WalletLinkRelay { constructor(options) { var _a2; super(options); this._enableMobileWalletLink = (_a2 = options.enableMobileWalletLink) !== null && _a2 !== void 0 ? _a2 : false; } // override requestEthereumAccounts() { if (this._enableMobileWalletLink) { return super.requestEthereumAccounts(); } return { promise: new Promise(() => { const location2 = (0, util_1$4.getLocation)(); location2.href = `https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(location2.href)}`; }), cancel: () => { } }; } // override publishWeb3RequestEvent(id2, request) { super.publishWeb3RequestEvent(id2, request); if (!(this._enableMobileWalletLink && this.ui instanceof MobileRelayUI_1$1.MobileRelayUI)) return; let navigatedToCBW = false; switch (request.method) { case "requestEthereumAccounts": case "connectAndSignIn": navigatedToCBW = true; this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl()); break; case "switchEthereumChain": return; default: navigatedToCBW = true; this.ui.openCoinbaseWalletDeeplink(); break; } if (navigatedToCBW) { window.addEventListener("blur", () => { window.addEventListener("focus", () => { this.connection.checkUnseenEvents(); }, { once: true }); }, { once: true }); } } // override handleWeb3ResponseMessage(message) { super.handleWeb3ResponseMessage(message); } connectAndSignIn(params) { 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: params.nonce, iat: (/* @__PURE__ */ new Date()).toISOString(), chainId: `eip155:${this.dappDefaultChain}`, statement: params.statement, resources: params.resources } }); } } MobileRelay$1.MobileRelay = MobileRelay; var readableBrowser = { exports: {} }; var events = { exports: {} }; var R$3 = typeof Reflect === "object" ? Reflect : null; var ReflectApply = R$3 && typeof R$3.apply === "function" ? R$3.apply : function ReflectApply2(target, receiver, args) { return Function.prototype.apply.call(target, receiver, args); }; var ReflectOwnKeys; if (R$3 && typeof R$3.ownKeys === "function") { ReflectOwnKeys = R$3.ownKeys; } else if (Object.getOwnPropertySymbols) { ReflectOwnKeys = function ReflectOwnKeys2(target) { return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target)); }; } else { ReflectOwnKeys = function ReflectOwnKeys2(target) { return Object.getOwnPropertyNames(target); }; } function ProcessEmitWarning(warning) { if (console && console.warn) console.warn(warning); } var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) { return value !== value; }; function EventEmitter() { EventEmitter.init.call(this); } events.exports = EventEmitter; events.exports.once = once$2; EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = void 0; EventEmitter.prototype._eventsCount = 0; EventEmitter.prototype._maxListeners = void 0; var defaultMaxListeners = 10; function checkListener(listener) { if (typeof listener !== "function") { throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); } } Object.defineProperty(EventEmitter, "defaultMaxListeners", { enumerable: true, get: function() { return defaultMaxListeners; }, set: function(arg) { if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) { throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + "."); } defaultMaxListeners = arg; } }); EventEmitter.init = function() { if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) { this._events = /* @__PURE__ */ Object.create(null); this._eventsCount = 0; } this._maxListeners = this._maxListeners || void 0; }; EventEmitter.prototype.setMaxListeners = function setMaxListeners(n2) { if (typeof n2 !== "number" || n2 < 0 || NumberIsNaN(n2)) { throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n2 + "."); } this._maxListeners = n2; return this; }; function _getMaxListeners(that) { if (that._maxListeners === void 0) return EventEmitter.defaultMaxListeners; return that._maxListeners; } EventEmitter.prototype.getMaxListeners = function getMaxListeners() { return _getMaxListeners(this); }; EventEmitter.prototype.emit = function emit(type2) { var args = []; for (var i2 = 1; i2 < arguments.length; i2++) args.push(arguments[i2]); var doError = type2 === "error"; var events2 = this._events; if (events2 !== void 0) doError = doError && events2.error === void 0; else if (!doError) return false; if (doError) { var er2; if (args.length > 0) er2 = args[0]; if (er2 instanceof Error) { throw er2; } var err = new Error("Unhandled error." + (er2 ? " (" + er2.message + ")" : "")); err.context = er2; throw err; } var handler = events2[type2]; if (handler === void 0) return false; if (typeof handler === "function") { ReflectApply(handler, this, args); } else { var len2 = handler.length; var listeners = arrayClone$2(handler, len2); for (var i2 = 0; i2 < len2; ++i2) ReflectApply(listeners[i2], this, args); } return true; }; function _addListener(target, type2, listener, prepend) { var m2; var events2; var existing; checkListener(listener); events2 = target._events; if (events2 === void 0) { events2 = target._events = /* @__PURE__ */ Object.create(null); target._eventsCount = 0; } else { if (events2.newListener !== void 0) { target.emit( "newListener", type2, listener.listener ? listener.listener : listener ); events2 = target._events; } existing = events2[type2]; } if (existing === void 0) { existing = events2[type2] = listener; ++target._eventsCount; } else { if (typeof existing === "function") { existing = events2[type2] = prepend ? [listener, existing] : [existing, listener]; } else if (prepend) { existing.unshift(listener); } else { existing.push(listener); } m2 = _getMaxListeners(target); if (m2 > 0 && existing.length > m2 && !existing.warned) { existing.warned = true; var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type2) + " listeners added. Use emitter.setMaxListeners() to increase limit"); w2.name = "MaxListenersExceededWarning"; w2.emitter = target; w2.type = type2; w2.count = existing.length; ProcessEmitWarning(w2); } } return target; } EventEmitter.prototype.addListener = function addListener(type2, listener) { return _addListener(this, type2, listener, false); }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.prependListener = function prependListener(type2, listener) { return _addListener(this, type2, listener, true); }; function onceWrapper() { if (!this.fired) { this.target.removeListener(this.type, this.wrapFn); this.fired = true; if (arguments.length === 0) return this.listener.call(this.target); return this.listener.apply(this.target, arguments); } } function _onceWrap(target, type2, listener) { var state2 = { fired: false, wrapFn: void 0, target, type: type2, listener }; var wrapped = onceWrapper.bind(state2); wrapped.listener = listener; state2.wrapFn = wrapped; return wrapped; } EventEmitter.prototype.once = function once2(type2, listener) { checkListener(listener); this.on(type2, _onceWrap(this, type2, listener)); return this; }; EventEmitter.prototype.prependOnceListener = function prependOnceListener(type2, listener) { checkListener(listener); this.prependListener(type2, _onceWrap(this, type2, listener)); return this; }; EventEmitter.prototype.removeListener = function removeListener(type2, listener) { var list, events2, position, i2, originalListener; checkListener(listener); events2 = this._events; if (events2 === void 0) return this; list = events2[type2]; if (list === void 0) return this; if (list === listener || list.listener === listener) { if (--this._eventsCount === 0) this._events = /* @__PURE__ */ Object.create(null); else { delete events2[type2]; if (events2.removeListener) this.emit("removeListener", type2, list.listener || listener); } } else if (typeof list !== "function") { position = -1; for (i2 = list.length - 1; i2 >= 0; i2--) { if (list[i2] === listener || list[i2].listener === listener) { originalListener = list[i2].listener; position = i2; break; } } if (position < 0) return this; if (position === 0) list.shift(); else { spliceOne(list, position); } if (list.length === 1) events2[type2] = list[0]; if (events2.removeListener !== void 0) this.emit("removeListener", type2, originalListener || listener); } return this; }; EventEmitter.prototype.off = EventEmitter.prototype.removeListener; EventEmitter.prototype.removeAllListeners = function removeAllListeners(type2) { var listeners, events2, i2; events2 = this._events; if (events2 === void 0) return this; if (events2.removeListener === void 0) { if (arguments.length === 0) { this._events = /* @__PURE__ */ Object.create(null); this._eventsCount = 0; } else if (events2[type2] !== void 0) { if (--this._eventsCount === 0) this._events = /* @__PURE__ */ Object.create(null); else delete events2[type2]; } return this; } if (arguments.length === 0) { var keys2 = Object.keys(events2); var key; for (i2 = 0; i2 < keys2.length; ++i2) { key = keys2[i2]; if (key === "removeListener") continue; this.removeAllListeners(key); } this.removeAllListeners("removeListener"); this._events = /* @__PURE__ */ Object.create(null); this._eventsCount = 0; return this; } listeners = events2[type2]; if (typeof listeners === "function") { this.removeListener(type2, listeners); } else if (listeners !== void 0) { for (i2 = listeners.length - 1; i2 >= 0; i2--) { this.removeListener(type2, listeners[i2]); } } return this; }; function _listeners(target, type2, unwrap) { var events2 = target._events; if (events2 === void 0) return []; var evlistener = events2[type2]; if (evlistener === void 0) return []; if (typeof evlistener === "function") return unwrap ? [evlistener.listener || evlistener] : [evlistener]; return unwrap ? unwrapListeners(evlistener) : arrayClone$2(evlistener, evlistener.length); } EventEmitter.prototype.listeners = function listeners(type2) { return _listeners(this, type2, true); }; EventEmitter.prototype.rawListeners = function rawListeners(type2) { return _listeners(this, type2, false); }; EventEmitter.listenerCount = function(emitter, type2) { if (typeof emitter.listenerCount === "function") { return emitter.listenerCount(type2); } else { return listenerCount.call(emitter, type2); } }; EventEmitter.prototype.listenerCount = listenerCount; function listenerCount(type2) { var events2 = this._events; if (events2 !== void 0) { var evlistener = events2[type2]; if (typeof evlistener === "function") { return 1; } else if (evlistener !== void 0) { return evlistener.length; } } return 0; } EventEmitter.prototype.eventNames = function eventNames() { return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; }; function arrayClone$2(arr2, n2) { var copy = new Array(n2); for (var i2 = 0; i2 < n2; ++i2) copy[i2] = arr2[i2]; return copy; } function spliceOne(list, index2) { for (; index2 + 1 < list.length; index2++) list[index2] = list[index2 + 1]; list.pop(); } function unwrapListeners(arr2) { var ret = new Array(arr2.length); for (var i2 = 0; i2 < ret.length; ++i2) { ret[i2] = arr2[i2].listener || arr2[i2]; } return ret; } function once$2(emitter, name2) { return new Promise(function(resolve, reject) { function errorListener(err) { emitter.removeListener(name2, resolver); reject(err); } function resolver() { if (typeof emitter.removeListener === "function") { emitter.removeListener("error", errorListener); } resolve([].slice.call(arguments)); } eventTargetAgnosticAddListener(emitter, name2, resolver, { once: true }); if (name2 !== "error") { addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); } }); } function addErrorHandlerIfEventEmitter(emitter, handler, flags) { if (typeof emitter.on === "function") { eventTargetAgnosticAddListener(emitter, "error", handler, flags); } } function eventTargetAgnosticAddListener(emitter, name2, listener, flags) { if (typeof emitter.on === "function") { if (flags.once) { emitter.once(name2, listener); } else { emitter.on(name2, listener); } } else if (typeof emitter.addEventListener === "function") { emitter.addEventListener(name2, function wrapListener(arg) { if (flags.once) { emitter.removeEventListener(name2, wrapListener); } listener(arg); }); } else { throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); } } var eventsExports = events.exports; const $g = /* @__PURE__ */ getDefaultExportFromCjs(eventsExports); var streamBrowser = eventsExports.EventEmitter; var buffer_list; var hasRequiredBuffer_list; function requireBuffer_list() { if (hasRequiredBuffer_list) return buffer_list; hasRequiredBuffer_list = 1; function ownKeys(object2, enumerableOnly) { var keys2 = Object.keys(object2); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object2); enumerableOnly && (symbols = symbols.filter(function(sym) { return Object.getOwnPropertyDescriptor(object2, sym).enumerable; })), keys2.push.apply(keys2, symbols); } return keys2; } function _objectSpread(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = null != arguments[i2] ? arguments[i2] : {}; i2 % 2 ? ownKeys(Object(source), true).forEach(function(key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance2, Constructor) { if (!(instance2 instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i2 = 0; i2 < props.length; i2++) { var descriptor = props[i2]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } var _require = buffer, Buffer2 = _require.Buffer; var _require2 = require$$3, inspect = _require2.inspect; var custom2 = inspect && inspect.custom || "inspect"; function copyBuffer(src2, target, offset) { Buffer2.prototype.copy.call(src2, target, offset); } buffer_list = /* @__PURE__ */ function() { function BufferList() { _classCallCheck(this, BufferList); this.head = null; this.tail = null; this.length = 0; } _createClass(BufferList, [{ key: "push", value: function push(v2) { var entry = { data: v2, next: null }; if (this.length > 0) this.tail.next = entry; else this.head = entry; this.tail = entry; ++this.length; } }, { key: "unshift", value: function unshift(v2) { var entry = { data: v2, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; } }, { key: "shift", value: function shift() { if (this.length === 0) return; var ret = this.head.data; if (this.length === 1) this.head = this.tail = null; else this.head = this.head.next; --this.length; return ret; } }, { key: "clear", value: function clear2() { this.head = this.tail = null; this.length = 0; } }, { key: "join", value: function join(s2) { if (this.length === 0) return ""; var p2 = this.head; var ret = "" + p2.data; while (p2 = p2.next) ret += s2 + p2.data; return ret; } }, { key: "concat", value: function concat2(n2) { if (this.length === 0) return Buffer2.alloc(0); var ret = Buffer2.allocUnsafe(n2 >>> 0); var p2 = this.head; var i2 = 0; while (p2) { copyBuffer(p2.data, ret, i2); i2 += p2.data.length; p2 = p2.next; } return ret; } // Consumes a specified amount of bytes or characters from the buffered data. }, { key: "consume", value: function consume(n2, hasStrings) { var ret; if (n2 < this.head.data.length) { ret = this.head.data.slice(0, n2); this.head.data = this.head.data.slice(n2); } else if (n2 === this.head.data.length) { ret = this.shift(); } else { ret = hasStrings ? this._getString(n2) : this._getBuffer(n2); } return ret; } }, { key: "first", value: function first() { return this.head.data; } // Consumes a specified amount of characters from the buffered data. }, { key: "_getString", value: function _getString(n2) { var p2 = this.head; var c2 = 1; var ret = p2.data; n2 -= ret.length; while (p2 = p2.next) { var str = p2.data; var nb = n2 > str.length ? str.length : n2; if (nb === str.length) ret += str; else ret += str.slice(0, n2); n2 -= nb; if (n2 === 0) { if (nb === str.length) { ++c2; if (p2.next) this.head = p2.next; else this.head = this.tail = null; } else { this.head = p2; p2.data = str.slice(nb); } break; } ++c2; } this.length -= c2; return ret; } // Consumes a specified amount of bytes from the buffered data. }, { key: "_getBuffer", value: function _getBuffer(n2) { var ret = Buffer2.allocUnsafe(n2); var p2 = this.head; var c2 = 1; p2.data.copy(ret); n2 -= p2.data.length; while (p2 = p2.next) { var buf = p2.data; var nb = n2 > buf.length ? buf.length : n2; buf.copy(ret, ret.length - n2, 0, nb); n2 -= nb; if (n2 === 0) { if (nb === buf.length) { ++c2; if (p2.next) this.head = p2.next; else this.head = this.tail = null; } else { this.head = p2; p2.data = buf.slice(nb); } break; } ++c2; } this.length -= c2; return ret; } // Make sure the linked list only shows the minimal necessary information. }, { key: custom2, value: function value(_2, options) { return inspect(this, _objectSpread(_objectSpread({}, options), {}, { // Only inspect one level. depth: 0, // It should not recurse. customInspect: false })); } }]); return BufferList; }(); return buffer_list; } function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!this._writableState) { process.nextTick(emitErrorNT, this, err); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; process.nextTick(emitErrorNT, this, err); } } return this; } if (this._readableState) { this._readableState.destroyed = true; } if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function(err2) { if (!cb && err2) { if (!_this._writableState) { process.nextTick(emitErrorAndCloseNT, _this, err2); } else if (!_this._writableState.errorEmitted) { _this._writableState.errorEmitted = true; process.nextTick(emitErrorAndCloseNT, _this, err2); } else { process.nextTick(emitCloseNT, _this); } } else if (cb) { process.nextTick(emitCloseNT, _this); cb(err2); } else { process.nextTick(emitCloseNT, _this); } }); return this; } function emitErrorAndCloseNT(self2, err) { emitErrorNT(self2, err); emitCloseNT(self2); } function emitCloseNT(self2) { if (self2._writableState && !self2._writableState.emitClose) return; if (self2._readableState && !self2._readableState.emitClose) return; self2.emit("close"); } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finalCalled = false; this._writableState.prefinished = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self2, err) { self2.emit("error", err); } function errorOrDestroy(stream2, err) { var rState = stream2._readableState; var wState = stream2._writableState; if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream2.destroy(err); else stream2.emit("error", err); } var destroy_1 = { destroy, undestroy, errorOrDestroy }; var errorsBrowser = {}; function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } var codes = {}; function createErrorType(code2, message, Base) { if (!Base) { Base = Error; } function getMessage(arg1, arg2, arg3) { if (typeof message === "string") { return message; } else { return message(arg1, arg2, arg3); } } var NodeError = /* @__PURE__ */ function(_Base) { _inheritsLoose(NodeError2, _Base); function NodeError2(arg1, arg2, arg3) { return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; } return NodeError2; }(Base); NodeError.prototype.name = Base.name; NodeError.prototype.code = code2; codes[code2] = NodeError; } function oneOf(expected, thing) { if (Array.isArray(expected)) { var len2 = expected.length; expected = expected.map(function(i2) { return String(i2); }); if (len2 > 2) { return "one of ".concat(thing, " ").concat(expected.slice(0, len2 - 1).join(", "), ", or ") + expected[len2 - 1]; } else if (len2 === 2) { return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); } else { return "of ".concat(thing, " ").concat(expected[0]); } } else { return "of ".concat(thing, " ").concat(String(expected)); } } function startsWith(str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } function endsWith(str, search, this_len) { if (this_len === void 0 || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } function includes(str, search, start) { if (typeof start !== "number") { start = 0; } if (start + search.length > str.length) { return false; } else { return str.indexOf(search, start) !== -1; } } createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value) { return 'The value "' + value + '" is invalid for option "' + name2 + '"'; }, TypeError); createErrorType("ERR_INVALID_ARG_TYPE", function(name2, expected, actual) { var determiner; if (typeof expected === "string" && startsWith(expected, "not ")) { determiner = "must not be"; expected = expected.replace(/^not /, ""); } else { determiner = "must be"; } var msg; if (endsWith(name2, " argument")) { msg = "The ".concat(name2, " ").concat(determiner, " ").concat(oneOf(expected, "type")); } else { var type2 = includes(name2, ".") ? "property" : "argument"; msg = 'The "'.concat(name2, '" ').concat(type2, " ").concat(determiner, " ").concat(oneOf(expected, "type")); } msg += ". Received type ".concat(typeof actual); return msg; }, TypeError); createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name2) { return "The " + name2 + " method is not implemented"; }); createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); createErrorType("ERR_STREAM_DESTROYED", function(name2) { return "Cannot call " + name2 + " after a stream was destroyed"; }); createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { return "Unknown encoding: " + arg; }, TypeError); createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); errorsBrowser.codes = codes; var ERR_INVALID_OPT_VALUE = errorsBrowser.codes.ERR_INVALID_OPT_VALUE; function highWaterMarkFrom(options, isDuplex, duplexKey) { return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } function getHighWaterMark(state2, options, duplexKey, isDuplex) { var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); if (hwm != null) { if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { var name2 = isDuplex ? duplexKey : "highWaterMark"; throw new ERR_INVALID_OPT_VALUE(name2, hwm); } return Math.floor(hwm); } return state2.objectMode ? 16 : 16 * 1024; } var state = { getHighWaterMark }; var browser$3 = deprecate; function deprecate(fn2, msg) { if (config("noDeprecation")) { return fn2; } var warned = false; function deprecated2() { if (!warned) { if (config("throwDeprecation")) { throw new Error(msg); } else if (config("traceDeprecation")) { console.trace(msg); } else { console.warn(msg); } warned = true; } return fn2.apply(this, arguments); } return deprecated2; } function config(name2) { try { if (!commonjsGlobal.localStorage) return false; } catch (_2) { return false; } var val = commonjsGlobal.localStorage[name2]; if (null == val) return false; return String(val).toLowerCase() === "true"; } var _stream_writable; var hasRequired_stream_writable; function require_stream_writable() { if (hasRequired_stream_writable) return _stream_writable; hasRequired_stream_writable = 1; _stream_writable = Writable; function CorkedRequest(state2) { var _this = this; this.next = null; this.entry = null; this.finish = function() { onCorkedFinish(_this, state2); }; } var Duplex2; Writable.WritableState = WritableState; var internalUtil = { deprecate: browser$3 }; var Stream = streamBrowser; var Buffer2 = buffer.Buffer; var OurUint8Array = (typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { }; function _uint8ArrayToBuffer(chunk) { return Buffer2.from(chunk); } function _isUint8Array(obj) { return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; } var destroyImpl = destroy_1; var _require = state, getHighWaterMark2 = _require.getHighWaterMark; var _require$codes2 = errorsBrowser.codes, ERR_INVALID_ARG_TYPE = _require$codes2.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED2 = _require$codes2.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK2 = _require$codes2.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes2.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED2 = _require$codes2.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes2.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes2.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes2.ERR_UNKNOWN_ENCODING; var errorOrDestroy2 = destroyImpl.errorOrDestroy; inherits_browserExports(Writable, Stream); function nop() { } function WritableState(options, stream2, isDuplex) { Duplex2 = Duplex2 || require_stream_duplex(); options = options || {}; if (typeof isDuplex !== "boolean") isDuplex = stream2 instanceof Duplex2; this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; this.highWaterMark = getHighWaterMark2(this, options, "writableHighWaterMark", isDuplex); this.finalCalled = false; this.needDrain = false; this.ending = false; this.ended = false; this.finished = false; this.destroyed = false; var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; this.defaultEncoding = options.defaultEncoding || "utf8"; this.length = 0; this.writing = false; this.corked = 0; this.sync = true; this.bufferProcessing = false; this.onwrite = function(er2) { onwrite(stream2, er2); }; this.writecb = null; this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; this.pendingcb = 0; this.prefinished = false; this.errorEmitted = false; this.emitClose = options.emitClose !== false; this.autoDestroy = !!options.autoDestroy; this.bufferedRequestCount = 0; this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function() { try { Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate(function writableStateBufferGetter() { return this.getBuffer(); }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); } catch (_2) { } })(); var realHasInstance; if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { value: function value(object2) { if (realHasInstance.call(this, object2)) return true; if (this !== Writable) return false; return object2 && object2._writableState instanceof WritableState; } }); } else { realHasInstance = function realHasInstance2(object2) { return object2 instanceof this; }; } function Writable(options) { Duplex2 = Duplex2 || require_stream_duplex(); var isDuplex = this instanceof Duplex2; if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); this._writableState = new WritableState(options, this, isDuplex); this.writable = true; if (options) { if (typeof options.write === "function") this._write = options.write; if (typeof options.writev === "function") this._writev = options.writev; if (typeof options.destroy === "function") this._destroy = options.destroy; if (typeof options.final === "function") this._final = options.final; } Stream.call(this); } Writable.prototype.pipe = function() { errorOrDestroy2(this, new ERR_STREAM_CANNOT_PIPE()); }; function writeAfterEnd(stream2, cb) { var er2 = new ERR_STREAM_WRITE_AFTER_END(); errorOrDestroy2(stream2, er2); process.nextTick(cb, er2); } function validChunk(stream2, state2, chunk, cb) { var er2; if (chunk === null) { er2 = new ERR_STREAM_NULL_VALUES(); } else if (typeof chunk !== "string" && !state2.objectMode) { er2 = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk); } if (er2) { errorOrDestroy2(stream2, er2); process.nextTick(cb, er2); return false; } return true; } Writable.prototype.write = function(chunk, encoding, cb) { var state2 = this._writableState; var ret = false; var isBuf = !state2.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer2.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === "function") { cb = encoding; encoding = null; } if (isBuf) encoding = "buffer"; else if (!encoding) encoding = state2.defaultEncoding; if (typeof cb !== "function") cb = nop; if (state2.ending) writeAfterEnd(this, cb); else if (isBuf || validChunk(this, state2, chunk, cb)) { state2.pendingcb++; ret = writeOrBuffer(this, state2, isBuf, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function() { this._writableState.corked++; }; Writable.prototype.uncork = function() { var state2 = this._writableState; if (state2.corked) { state2.corked--; if (!state2.writing && !state2.corked && !state2.bufferProcessing && state2.bufferedRequest) clearBuffer(this, state2); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { if (typeof encoding === "string") encoding = encoding.toLowerCase(); if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); this._writableState.defaultEncoding = encoding; return this; }; Object.defineProperty(Writable.prototype, "writableBuffer", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { return this._writableState && this._writableState.getBuffer(); } }); function decodeChunk(state2, chunk, encoding) { if (!state2.objectMode && state2.decodeStrings !== false && typeof chunk === "string") { chunk = Buffer2.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, "writableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { return this._writableState.highWaterMark; } }); function writeOrBuffer(stream2, state2, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state2, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = "buffer"; chunk = newChunk; } } var len2 = state2.objectMode ? 1 : chunk.length; state2.length += len2; var ret = state2.length < state2.highWaterMark; if (!ret) state2.needDrain = true; if (state2.writing || state2.corked) { var last = state2.lastBufferedRequest; state2.lastBufferedRequest = { chunk, encoding, isBuf, callback: cb, next: null }; if (last) { last.next = state2.lastBufferedRequest; } else { state2.bufferedRequest = state2.lastBufferedRequest; } state2.bufferedRequestCount += 1; } else { doWrite(stream2, state2, false, len2, chunk, encoding, cb); } return ret; } function doWrite(stream2, state2, writev, len2, chunk, encoding, cb) { state2.writelen = len2; state2.writecb = cb; state2.writing = true; state2.sync = true; if (state2.destroyed) state2.onwrite(new ERR_STREAM_DESTROYED2("write")); else if (writev) stream2._writev(chunk, state2.onwrite); else stream2._write(chunk, encoding, state2.onwrite); state2.sync = false; } function onwriteError(stream2, state2, sync, er2, cb) { --state2.pendingcb; if (sync) { process.nextTick(cb, er2); process.nextTick(finishMaybe, stream2, state2); stream2._writableState.errorEmitted = true; errorOrDestroy2(stream2, er2); } else { cb(er2); stream2._writableState.errorEmitted = true; errorOrDestroy2(stream2, er2); finishMaybe(stream2, state2); } } function onwriteStateUpdate(state2) { state2.writing = false; state2.writecb = null; state2.length -= state2.writelen; state2.writelen = 0; } function onwrite(stream2, er2) { var state2 = stream2._writableState; var sync = state2.sync; var cb = state2.writecb; if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK2(); onwriteStateUpdate(state2); if (er2) onwriteError(stream2, state2, sync, er2, cb); else { var finished = needFinish(state2) || stream2.destroyed; if (!finished && !state2.corked && !state2.bufferProcessing && state2.bufferedRequest) { clearBuffer(stream2, state2); } if (sync) { process.nextTick(afterWrite, stream2, state2, finished, cb); } else { afterWrite(stream2, state2, finished, cb); } } } function afterWrite(stream2, state2, finished, cb) { if (!finished) onwriteDrain(stream2, state2); state2.pendingcb--; cb(); finishMaybe(stream2, state2); } function onwriteDrain(stream2, state2) { if (state2.length === 0 && state2.needDrain) { state2.needDrain = false; stream2.emit("drain"); } } function clearBuffer(stream2, state2) { state2.bufferProcessing = true; var entry = state2.bufferedRequest; if (stream2._writev && entry && entry.next) { var l2 = state2.bufferedRequestCount; var buffer2 = new Array(l2); var holder = state2.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer2[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer2.allBuffers = allBuffers; doWrite(stream2, state2, true, state2.length, buffer2, "", holder.finish); state2.pendingcb++; state2.lastBufferedRequest = null; if (holder.next) { state2.corkedRequestsFree = holder.next; holder.next = null; } else { state2.corkedRequestsFree = new CorkedRequest(state2); } state2.bufferedRequestCount = 0; } else { while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len2 = state2.objectMode ? 1 : chunk.length; doWrite(stream2, state2, false, len2, chunk, encoding, cb); entry = entry.next; state2.bufferedRequestCount--; if (state2.writing) { break; } } if (entry === null) state2.lastBufferedRequest = null; } state2.bufferedRequest = entry; state2.bufferProcessing = false; } Writable.prototype._write = function(chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED2("_write()")); }; Writable.prototype._writev = null; Writable.prototype.end = function(chunk, encoding, cb) { var state2 = this._writableState; if (typeof chunk === "function") { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === "function") { cb = encoding; encoding = null; } if (chunk !== null && chunk !== void 0) this.write(chunk, encoding); if (state2.corked) { state2.corked = 1; this.uncork(); } if (!state2.ending) endWritable(this, state2, cb); return this; }; Object.defineProperty(Writable.prototype, "writableLength", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { return this._writableState.length; } }); function needFinish(state2) { return state2.ending && state2.length === 0 && state2.bufferedRequest === null && !state2.finished && !state2.writing; } function callFinal(stream2, state2) { stream2._final(function(err) { state2.pendingcb--; if (err) { errorOrDestroy2(stream2, err); } state2.prefinished = true; stream2.emit("prefinish"); finishMaybe(stream2, state2); }); } function prefinish2(stream2, state2) { if (!state2.prefinished && !state2.finalCalled) { if (typeof stream2._final === "function" && !state2.destroyed) { state2.pendingcb++; state2.finalCalled = true; process.nextTick(callFinal, stream2, state2); } else { state2.prefinished = true; stream2.emit("prefinish"); } } } function finishMaybe(stream2, state2) { var need = needFinish(state2); if (need) { prefinish2(stream2, state2); if (state2.pendingcb === 0) { state2.finished = true; stream2.emit("finish"); if (state2.autoDestroy) { var rState = stream2._readableState; if (!rState || rState.autoDestroy && rState.endEmitted) { stream2.destroy(); } } } } return need; } function endWritable(stream2, state2, cb) { state2.ending = true; finishMaybe(stream2, state2); if (cb) { if (state2.finished) process.nextTick(cb); else stream2.once("finish", cb); } state2.ended = true; stream2.writable = false; } function onCorkedFinish(corkReq, state2, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state2.pendingcb--; cb(err); entry = entry.next; } state2.corkedRequestsFree.next = corkReq; } Object.defineProperty(Writable.prototype, "destroyed", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { if (this._writableState === void 0) { return false; } return this._writableState.destroyed; }, set: function set2(value) { if (!this._writableState) { return; } this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function(err, cb) { cb(err); }; return _stream_writable; } var _stream_duplex; var hasRequired_stream_duplex; function require_stream_duplex() { if (hasRequired_stream_duplex) return _stream_duplex; hasRequired_stream_duplex = 1; var objectKeys = Object.keys || function(obj) { var keys3 = []; for (var key in obj) keys3.push(key); return keys3; }; _stream_duplex = Duplex2; var Readable = require_stream_readable(); var Writable = require_stream_writable(); inherits_browserExports(Duplex2, Readable); { var keys2 = objectKeys(Writable.prototype); for (var v2 = 0; v2 < keys2.length; v2++) { var method = keys2[v2]; if (!Duplex2.prototype[method]) Duplex2.prototype[method] = Writable.prototype[method]; } } function Duplex2(options) { if (!(this instanceof Duplex2)) return new Duplex2(options); Readable.call(this, options); Writable.call(this, options); this.allowHalfOpen = true; if (options) { if (options.readable === false) this.readable = false; if (options.writable === false) this.writable = false; if (options.allowHalfOpen === false) { this.allowHalfOpen = false; this.once("end", onend); } } } Object.defineProperty(Duplex2.prototype, "writableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { return this._writableState.highWaterMark; } }); Object.defineProperty(Duplex2.prototype, "writableBuffer", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { return this._writableState && this._writableState.getBuffer(); } }); Object.defineProperty(Duplex2.prototype, "writableLength", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { return this._writableState.length; } }); function onend() { if (this._writableState.ended) return; process.nextTick(onEndNT, this); } function onEndNT(self2) { self2.end(); } Object.defineProperty(Duplex2.prototype, "destroyed", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { if (this._readableState === void 0 || this._writableState === void 0) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function set2(value) { if (this._readableState === void 0 || this._writableState === void 0) { return; } this._readableState.destroyed = value; this._writableState.destroyed = value; } }); return _stream_duplex; } var string_decoder = {}; var hasRequiredString_decoder; function requireString_decoder() { if (hasRequiredString_decoder) return string_decoder; hasRequiredString_decoder = 1; var Buffer2 = safeBufferExports.Buffer; var isEncoding = Buffer2.isEncoding || function(encoding) { encoding = "" + encoding; switch (encoding && encoding.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 true; default: return false; } }; function _normalizeEncoding(enc) { if (!enc) return "utf8"; var retried; while (true) { switch (enc) { 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 enc; default: if (retried) return; enc = ("" + enc).toLowerCase(); retried = true; } } } function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); return nenc || enc; } string_decoder.StringDecoder = StringDecoder; function StringDecoder(encoding) { this.encoding = normalizeEncoding(encoding); var nb; switch (this.encoding) { case "utf16le": this.text = utf16Text; this.end = utf16End; nb = 4; break; case "utf8": this.fillLast = utf8FillLast; nb = 4; break; case "base64": this.text = base64Text; this.end = base64End; nb = 3; break; default: this.write = simpleWrite; this.end = simpleEnd; return; } this.lastNeed = 0; this.lastTotal = 0; this.lastChar = Buffer2.allocUnsafe(nb); } StringDecoder.prototype.write = function(buf) { if (buf.length === 0) return ""; var r2; var i2; if (this.lastNeed) { r2 = this.fillLast(buf); if (r2 === void 0) return ""; i2 = this.lastNeed; this.lastNeed = 0; } else { i2 = 0; } if (i2 < buf.length) return r2 ? r2 + this.text(buf, i2) : this.text(buf, i2); return r2 || ""; }; StringDecoder.prototype.end = utf8End; StringDecoder.prototype.text = utf8Text; StringDecoder.prototype.fillLast = function(buf) { if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); this.lastNeed -= buf.length; }; function utf8CheckByte(byte2) { if (byte2 <= 127) return 0; else if (byte2 >> 5 === 6) return 2; else if (byte2 >> 4 === 14) return 3; else if (byte2 >> 3 === 30) return 4; return byte2 >> 6 === 2 ? -1 : -2; } function utf8CheckIncomplete(self2, buf, i2) { var j2 = buf.length - 1; if (j2 < i2) return 0; var nb = utf8CheckByte(buf[j2]); if (nb >= 0) { if (nb > 0) self2.lastNeed = nb - 1; return nb; } if (--j2 < i2 || nb === -2) return 0; nb = utf8CheckByte(buf[j2]); if (nb >= 0) { if (nb > 0) self2.lastNeed = nb - 2; return nb; } if (--j2 < i2 || nb === -2) return 0; nb = utf8CheckByte(buf[j2]); if (nb >= 0) { if (nb > 0) { if (nb === 2) nb = 0; else self2.lastNeed = nb - 3; } return nb; } return 0; } function utf8CheckExtraBytes(self2, buf, p2) { if ((buf[0] & 192) !== 128) { self2.lastNeed = 0; return "�"; } if (self2.lastNeed > 1 && buf.length > 1) { if ((buf[1] & 192) !== 128) { self2.lastNeed = 1; return "�"; } if (self2.lastNeed > 2 && buf.length > 2) { if ((buf[2] & 192) !== 128) { self2.lastNeed = 2; return "�"; } } } } function utf8FillLast(buf) { var p2 = this.lastTotal - this.lastNeed; var r2 = utf8CheckExtraBytes(this, buf); if (r2 !== void 0) return r2; if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, p2, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, p2, 0, buf.length); this.lastNeed -= buf.length; } function utf8Text(buf, i2) { var total = utf8CheckIncomplete(this, buf, i2); if (!this.lastNeed) return buf.toString("utf8", i2); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); buf.copy(this.lastChar, 0, end); return buf.toString("utf8", i2, end); } function utf8End(buf) { var r2 = buf && buf.length ? this.write(buf) : ""; if (this.lastNeed) return r2 + "�"; return r2; } function utf16Text(buf, i2) { if ((buf.length - i2) % 2 === 0) { var r2 = buf.toString("utf16le", i2); if (r2) { var c2 = r2.charCodeAt(r2.length - 1); if (c2 >= 55296 && c2 <= 56319) { this.lastNeed = 2; this.lastTotal = 4; this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; return r2.slice(0, -1); } } return r2; } this.lastNeed = 1; this.lastTotal = 2; this.lastChar[0] = buf[buf.length - 1]; return buf.toString("utf16le", i2, buf.length - 1); } function utf16End(buf) { var r2 = buf && buf.length ? this.write(buf) : ""; if (this.lastNeed) { var end = this.lastTotal - this.lastNeed; return r2 + this.lastChar.toString("utf16le", 0, end); } return r2; } function base64Text(buf, i2) { var n2 = (buf.length - i2) % 3; if (n2 === 0) return buf.toString("base64", i2); this.lastNeed = 3 - n2; this.lastTotal = 3; if (n2 === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } return buf.toString("base64", i2, buf.length - n2); } function base64End(buf) { var r2 = buf && buf.length ? this.write(buf) : ""; if (this.lastNeed) return r2 + this.lastChar.toString("base64", 0, 3 - this.lastNeed); return r2; } function simpleWrite(buf) { return buf.toString(this.encoding); } function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ""; } return string_decoder; } var ERR_STREAM_PREMATURE_CLOSE = errorsBrowser.codes.ERR_STREAM_PREMATURE_CLOSE; function once$1(callback) { var called = false; return function() { if (called) return; called = true; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } callback.apply(this, args); }; } function noop$4() { } function isRequest$1(stream2) { return stream2.setHeader && typeof stream2.abort === "function"; } function eos$1(stream2, opts, callback) { if (typeof opts === "function") return eos$1(stream2, null, opts); if (!opts) opts = {}; callback = once$1(callback || noop$4); var readable = opts.readable || opts.readable !== false && stream2.readable; var writable = opts.writable || opts.writable !== false && stream2.writable; var onlegacyfinish = function onlegacyfinish2() { if (!stream2.writable) onfinish(); }; var writableEnded = stream2._writableState && stream2._writableState.finished; var onfinish = function onfinish2() { writable = false; writableEnded = true; if (!readable) callback.call(stream2); }; var readableEnded = stream2._readableState && stream2._readableState.endEmitted; var onend = function onend2() { readable = false; readableEnded = true; if (!writable) callback.call(stream2); }; var onerror = function onerror2(err) { callback.call(stream2, err); }; var onclose = function onclose2() { var err; if (readable && !readableEnded) { if (!stream2._readableState || !stream2._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream2, err); } if (writable && !writableEnded) { if (!stream2._writableState || !stream2._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream2, err); } }; var onrequest = function onrequest2() { stream2.req.on("finish", onfinish); }; if (isRequest$1(stream2)) { stream2.on("complete", onfinish); stream2.on("abort", onclose); if (stream2.req) onrequest(); else stream2.on("request", onrequest); } else if (writable && !stream2._writableState) { stream2.on("end", onlegacyfinish); stream2.on("close", onlegacyfinish); } stream2.on("end", onend); stream2.on("finish", onfinish); if (opts.error !== false) stream2.on("error", onerror); stream2.on("close", onclose); return function() { stream2.removeListener("complete", onfinish); stream2.removeListener("abort", onclose); stream2.removeListener("request", onrequest); if (stream2.req) stream2.req.removeListener("finish", onfinish); stream2.removeListener("end", onlegacyfinish); stream2.removeListener("close", onlegacyfinish); stream2.removeListener("finish", onfinish); stream2.removeListener("end", onend); stream2.removeListener("error", onerror); stream2.removeListener("close", onclose); }; } var endOfStream = eos$1; var async_iterator; var hasRequiredAsync_iterator; function requireAsync_iterator() { if (hasRequiredAsync_iterator) return async_iterator; hasRequiredAsync_iterator = 1; var _Object$setPrototypeO; function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } var finished = endOfStream; var kLastResolve = Symbol("lastResolve"); var kLastReject = Symbol("lastReject"); var kError = Symbol("error"); var kEnded = Symbol("ended"); var kLastPromise = Symbol("lastPromise"); var kHandlePromise = Symbol("handlePromise"); var kStream = Symbol("stream"); function createIterResult(value, done2) { return { value, done: done2 }; } function readAndResolve(iter) { var resolve = iter[kLastResolve]; if (resolve !== null) { var data2 = iter[kStream].read(); if (data2 !== null) { iter[kLastPromise] = null; iter[kLastResolve] = null; iter[kLastReject] = null; resolve(createIterResult(data2, false)); } } } function onReadable(iter) { process.nextTick(readAndResolve, iter); } function wrapForNext(lastPromise, iter) { return function(resolve, reject) { lastPromise.then(function() { if (iter[kEnded]) { resolve(createIterResult(void 0, true)); return; } iter[kHandlePromise](resolve, reject); }, reject); }; } var AsyncIteratorPrototype = Object.getPrototypeOf(function() { }); var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { get stream() { return this[kStream]; }, next: function next() { var _this = this; var error2 = this[kError]; if (error2 !== null) { return Promise.reject(error2); } if (this[kEnded]) { return Promise.resolve(createIterResult(void 0, true)); } if (this[kStream].destroyed) { return new Promise(function(resolve, reject) { process.nextTick(function() { if (_this[kError]) { reject(_this[kError]); } else { resolve(createIterResult(void 0, true)); } }); }); } var lastPromise = this[kLastPromise]; var promise; if (lastPromise) { promise = new Promise(wrapForNext(lastPromise, this)); } else { var data2 = this[kStream].read(); if (data2 !== null) { return Promise.resolve(createIterResult(data2, false)); } promise = new Promise(this[kHandlePromise]); } this[kLastPromise] = promise; return promise; } }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { return this; }), _defineProperty(_Object$setPrototypeO, "return", function _return() { var _this2 = this; return new Promise(function(resolve, reject) { _this2[kStream].destroy(null, function(err) { if (err) { reject(err); return; } resolve(createIterResult(void 0, true)); }); }); }), _Object$setPrototypeO), AsyncIteratorPrototype); var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream2) { var _Object$create; var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { value: stream2, writable: true }), _defineProperty(_Object$create, kLastResolve, { value: null, writable: true }), _defineProperty(_Object$create, kLastReject, { value: null, writable: true }), _defineProperty(_Object$create, kError, { value: null, writable: true }), _defineProperty(_Object$create, kEnded, { value: stream2._readableState.endEmitted, writable: true }), _defineProperty(_Object$create, kHandlePromise, { value: function value(resolve, reject) { var data2 = iterator[kStream].read(); if (data2) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(data2, false)); } else { iterator[kLastResolve] = resolve; iterator[kLastReject] = reject; } }, writable: true }), _Object$create)); iterator[kLastPromise] = null; finished(stream2, function(err) { if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { var reject = iterator[kLastReject]; if (reject !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; reject(err); } iterator[kError] = err; return; } var resolve = iterator[kLastResolve]; if (resolve !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(void 0, true)); } iterator[kEnded] = true; }); stream2.on("readable", onReadable.bind(null, iterator)); return iterator; }; async_iterator = createReadableStreamAsyncIterator; return async_iterator; } var fromBrowser; var hasRequiredFromBrowser; function requireFromBrowser() { if (hasRequiredFromBrowser) return fromBrowser; hasRequiredFromBrowser = 1; fromBrowser = function() { throw new Error("Readable.from is not available in the browser"); }; return fromBrowser; } var _stream_readable; var hasRequired_stream_readable; function require_stream_readable() { if (hasRequired_stream_readable) return _stream_readable; hasRequired_stream_readable = 1; _stream_readable = Readable; var Duplex2; Readable.ReadableState = ReadableState; eventsExports.EventEmitter; var EElistenerCount = function EElistenerCount2(emitter, type2) { return emitter.listeners(type2).length; }; var Stream = streamBrowser; var Buffer2 = buffer.Buffer; var OurUint8Array = (typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { }; function _uint8ArrayToBuffer(chunk) { return Buffer2.from(chunk); } function _isUint8Array(obj) { return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; } var debugUtil = require$$3; var debug2; if (debugUtil && debugUtil.debuglog) { debug2 = debugUtil.debuglog("stream"); } else { debug2 = function debug3() { }; } var BufferList = requireBuffer_list(); var destroyImpl = destroy_1; var _require = state, getHighWaterMark2 = _require.getHighWaterMark; var _require$codes2 = errorsBrowser.codes, ERR_INVALID_ARG_TYPE = _require$codes2.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes2.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED2 = _require$codes2.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes2.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; var StringDecoder; var createReadableStreamAsyncIterator; var from2; inherits_browserExports(Readable, Stream); var errorOrDestroy2 = destroyImpl.errorOrDestroy; var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; function prependListener(emitter, event, fn2) { if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn2); if (!emitter._events || !emitter._events[event]) emitter.on(event, fn2); else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn2); else emitter._events[event] = [fn2, emitter._events[event]]; } function ReadableState(options, stream2, isDuplex) { Duplex2 = Duplex2 || require_stream_duplex(); options = options || {}; if (typeof isDuplex !== "boolean") isDuplex = stream2 instanceof Duplex2; this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; this.highWaterMark = getHighWaterMark2(this, options, "readableHighWaterMark", isDuplex); this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; this.sync = true; this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; this.paused = true; this.emitClose = options.emitClose !== false; this.autoDestroy = !!options.autoDestroy; this.destroyed = false; this.defaultEncoding = options.defaultEncoding || "utf8"; this.awaitDrain = 0; this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = requireString_decoder().StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex2 = Duplex2 || require_stream_duplex(); if (!(this instanceof Readable)) return new Readable(options); var isDuplex = this instanceof Duplex2; this._readableState = new ReadableState(options, this, isDuplex); this.readable = true; if (options) { if (typeof options.read === "function") this._read = options.read; if (typeof options.destroy === "function") this._destroy = options.destroy; } Stream.call(this); } Object.defineProperty(Readable.prototype, "destroyed", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { if (this._readableState === void 0) { return false; } return this._readableState.destroyed; }, set: function set2(value) { if (!this._readableState) { return; } this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function(err, cb) { cb(err); }; Readable.prototype.push = function(chunk, encoding) { var state2 = this._readableState; var skipChunkCheck; if (!state2.objectMode) { if (typeof chunk === "string") { encoding = encoding || state2.defaultEncoding; if (encoding !== state2.encoding) { chunk = Buffer2.from(chunk, encoding); encoding = ""; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; Readable.prototype.unshift = function(chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream2, chunk, encoding, addToFront, skipChunkCheck) { debug2("readableAddChunk", chunk); var state2 = stream2._readableState; if (chunk === null) { state2.reading = false; onEofChunk(stream2, state2); } else { var er2; if (!skipChunkCheck) er2 = chunkInvalid(state2, chunk); if (er2) { errorOrDestroy2(stream2, er2); } else if (state2.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== "string" && !state2.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state2.endEmitted) errorOrDestroy2(stream2, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); else addChunk(stream2, state2, chunk, true); } else if (state2.ended) { errorOrDestroy2(stream2, new ERR_STREAM_PUSH_AFTER_EOF()); } else if (state2.destroyed) { return false; } else { state2.reading = false; if (state2.decoder && !encoding) { chunk = state2.decoder.write(chunk); if (state2.objectMode || chunk.length !== 0) addChunk(stream2, state2, chunk, false); else maybeReadMore(stream2, state2); } else { addChunk(stream2, state2, chunk, false); } } } else if (!addToFront) { state2.reading = false; maybeReadMore(stream2, state2); } } return !state2.ended && (state2.length < state2.highWaterMark || state2.length === 0); } function addChunk(stream2, state2, chunk, addToFront) { if (state2.flowing && state2.length === 0 && !state2.sync) { state2.awaitDrain = 0; stream2.emit("data", chunk); } else { state2.length += state2.objectMode ? 1 : chunk.length; if (addToFront) state2.buffer.unshift(chunk); else state2.buffer.push(chunk); if (state2.needReadable) emitReadable(stream2); } maybeReadMore(stream2, state2); } function chunkInvalid(state2, chunk) { var er2; if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state2.objectMode) { er2 = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk); } return er2; } Readable.prototype.isPaused = function() { return this._readableState.flowing === false; }; Readable.prototype.setEncoding = function(enc) { if (!StringDecoder) StringDecoder = requireString_decoder().StringDecoder; var decoder = new StringDecoder(enc); this._readableState.decoder = decoder; this._readableState.encoding = this._readableState.decoder.encoding; var p2 = this._readableState.buffer.head; var content = ""; while (p2 !== null) { content += decoder.write(p2.data); p2 = p2.next; } this._readableState.buffer.clear(); if (content !== "") this._readableState.buffer.push(content); this._readableState.length = content.length; return this; }; var MAX_HWM = 1073741824; function computeNewHighWaterMark(n2) { if (n2 >= MAX_HWM) { n2 = MAX_HWM; } else { n2--; n2 |= n2 >>> 1; n2 |= n2 >>> 2; n2 |= n2 >>> 4; n2 |= n2 >>> 8; n2 |= n2 >>> 16; n2++; } return n2; } function howMuchToRead(n2, state2) { if (n2 <= 0 || state2.length === 0 && state2.ended) return 0; if (state2.objectMode) return 1; if (n2 !== n2) { if (state2.flowing && state2.length) return state2.buffer.head.data.length; else return state2.length; } if (n2 > state2.highWaterMark) state2.highWaterMark = computeNewHighWaterMark(n2); if (n2 <= state2.length) return n2; if (!state2.ended) { state2.needReadable = true; return 0; } return state2.length; } Readable.prototype.read = function(n2) { debug2("read", n2); n2 = parseInt(n2, 10); var state2 = this._readableState; var nOrig = n2; if (n2 !== 0) state2.emittedReadable = false; if (n2 === 0 && state2.needReadable && ((state2.highWaterMark !== 0 ? state2.length >= state2.highWaterMark : state2.length > 0) || state2.ended)) { debug2("read: emitReadable", state2.length, state2.ended); if (state2.length === 0 && state2.ended) endReadable(this); else emitReadable(this); return null; } n2 = howMuchToRead(n2, state2); if (n2 === 0 && state2.ended) { if (state2.length === 0) endReadable(this); return null; } var doRead = state2.needReadable; debug2("need readable", doRead); if (state2.length === 0 || state2.length - n2 < state2.highWaterMark) { doRead = true; debug2("length less than watermark", doRead); } if (state2.ended || state2.reading) { doRead = false; debug2("reading or ended", doRead); } else if (doRead) { debug2("do read"); state2.reading = true; state2.sync = true; if (state2.length === 0) state2.needReadable = true; this._read(state2.highWaterMark); state2.sync = false; if (!state2.reading) n2 = howMuchToRead(nOrig, state2); } var ret; if (n2 > 0) ret = fromList(n2, state2); else ret = null; if (ret === null) { state2.needReadable = state2.length <= state2.highWaterMark; n2 = 0; } else { state2.length -= n2; state2.awaitDrain = 0; } if (state2.length === 0) { if (!state2.ended) state2.needReadable = true; if (nOrig !== n2 && state2.ended) endReadable(this); } if (ret !== null) this.emit("data", ret); return ret; }; function onEofChunk(stream2, state2) { debug2("onEofChunk"); if (state2.ended) return; if (state2.decoder) { var chunk = state2.decoder.end(); if (chunk && chunk.length) { state2.buffer.push(chunk); state2.length += state2.objectMode ? 1 : chunk.length; } } state2.ended = true; if (state2.sync) { emitReadable(stream2); } else { state2.needReadable = false; if (!state2.emittedReadable) { state2.emittedReadable = true; emitReadable_(stream2); } } } function emitReadable(stream2) { var state2 = stream2._readableState; debug2("emitReadable", state2.needReadable, state2.emittedReadable); state2.needReadable = false; if (!state2.emittedReadable) { debug2("emitReadable", state2.flowing); state2.emittedReadable = true; process.nextTick(emitReadable_, stream2); } } function emitReadable_(stream2) { var state2 = stream2._readableState; debug2("emitReadable_", state2.destroyed, state2.length, state2.ended); if (!state2.destroyed && (state2.length || state2.ended)) { stream2.emit("readable"); state2.emittedReadable = false; } state2.needReadable = !state2.flowing && !state2.ended && state2.length <= state2.highWaterMark; flow(stream2); } function maybeReadMore(stream2, state2) { if (!state2.readingMore) { state2.readingMore = true; process.nextTick(maybeReadMore_, stream2, state2); } } function maybeReadMore_(stream2, state2) { while (!state2.reading && !state2.ended && (state2.length < state2.highWaterMark || state2.flowing && state2.length === 0)) { var len2 = state2.length; debug2("maybeReadMore read 0"); stream2.read(0); if (len2 === state2.length) break; } state2.readingMore = false; } Readable.prototype._read = function(n2) { errorOrDestroy2(this, new ERR_METHOD_NOT_IMPLEMENTED2("_read()")); }; Readable.prototype.pipe = function(dest, pipeOpts) { var src2 = this; var state2 = this._readableState; switch (state2.pipesCount) { case 0: state2.pipes = dest; break; case 1: state2.pipes = [state2.pipes, dest]; break; default: state2.pipes.push(dest); break; } state2.pipesCount += 1; debug2("pipe count=%d opts=%j", state2.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state2.endEmitted) process.nextTick(endFn); else src2.once("end", endFn); dest.on("unpipe", onunpipe); function onunpipe(readable, unpipeInfo) { debug2("onunpipe"); if (readable === src2) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup(); } } } function onend() { debug2("onend"); dest.end(); } var ondrain = pipeOnDrain(src2); dest.on("drain", ondrain); var cleanedUp = false; function cleanup() { debug2("cleanup"); dest.removeListener("close", onclose); dest.removeListener("finish", onfinish); dest.removeListener("drain", ondrain); dest.removeListener("error", onerror); dest.removeListener("unpipe", onunpipe); src2.removeListener("end", onend); src2.removeListener("end", unpipe); src2.removeListener("data", ondata); cleanedUp = true; if (state2.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } src2.on("data", ondata); function ondata(chunk) { debug2("ondata"); var ret = dest.write(chunk); debug2("dest.write", ret); if (ret === false) { if ((state2.pipesCount === 1 && state2.pipes === dest || state2.pipesCount > 1 && indexOf(state2.pipes, dest) !== -1) && !cleanedUp) { debug2("false write response, pause", state2.awaitDrain); state2.awaitDrain++; } src2.pause(); } } function onerror(er2) { debug2("onerror", er2); unpipe(); dest.removeListener("error", onerror); if (EElistenerCount(dest, "error") === 0) errorOrDestroy2(dest, er2); } prependListener(dest, "error", onerror); function onclose() { dest.removeListener("finish", onfinish); unpipe(); } dest.once("close", onclose); function onfinish() { debug2("onfinish"); dest.removeListener("close", onclose); unpipe(); } dest.once("finish", onfinish); function unpipe() { debug2("unpipe"); src2.unpipe(dest); } dest.emit("pipe", src2); if (!state2.flowing) { debug2("pipe resume"); src2.resume(); } return dest; }; function pipeOnDrain(src2) { return function pipeOnDrainFunctionResult() { var state2 = src2._readableState; debug2("pipeOnDrain", state2.awaitDrain); if (state2.awaitDrain) state2.awaitDrain--; if (state2.awaitDrain === 0 && EElistenerCount(src2, "data")) { state2.flowing = true; flow(src2); } }; } Readable.prototype.unpipe = function(dest) { var state2 = this._readableState; var unpipeInfo = { hasUnpiped: false }; if (state2.pipesCount === 0) return this; if (state2.pipesCount === 1) { if (dest && dest !== state2.pipes) return this; if (!dest) dest = state2.pipes; state2.pipes = null; state2.pipesCount = 0; state2.flowing = false; if (dest) dest.emit("unpipe", this, unpipeInfo); return this; } if (!dest) { var dests = state2.pipes; var len2 = state2.pipesCount; state2.pipes = null; state2.pipesCount = 0; state2.flowing = false; for (var i2 = 0; i2 < len2; i2++) dests[i2].emit("unpipe", this, { hasUnpiped: false }); return this; } var index2 = indexOf(state2.pipes, dest); if (index2 === -1) return this; state2.pipes.splice(index2, 1); state2.pipesCount -= 1; if (state2.pipesCount === 1) state2.pipes = state2.pipes[0]; dest.emit("unpipe", this, unpipeInfo); return this; }; Readable.prototype.on = function(ev2, fn2) { var res = Stream.prototype.on.call(this, ev2, fn2); var state2 = this._readableState; if (ev2 === "data") { state2.readableListening = this.listenerCount("readable") > 0; if (state2.flowing !== false) this.resume(); } else if (ev2 === "readable") { if (!state2.endEmitted && !state2.readableListening) { state2.readableListening = state2.needReadable = true; state2.flowing = false; state2.emittedReadable = false; debug2("on readable", state2.length, state2.reading); if (state2.length) { emitReadable(this); } else if (!state2.reading) { process.nextTick(nReadingNextTick, this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; Readable.prototype.removeListener = function(ev2, fn2) { var res = Stream.prototype.removeListener.call(this, ev2, fn2); if (ev2 === "readable") { process.nextTick(updateReadableListening, this); } return res; }; Readable.prototype.removeAllListeners = function(ev2) { var res = Stream.prototype.removeAllListeners.apply(this, arguments); if (ev2 === "readable" || ev2 === void 0) { process.nextTick(updateReadableListening, this); } return res; }; function updateReadableListening(self2) { var state2 = self2._readableState; state2.readableListening = self2.listenerCount("readable") > 0; if (state2.resumeScheduled && !state2.paused) { state2.flowing = true; } else if (self2.listenerCount("data") > 0) { self2.resume(); } } function nReadingNextTick(self2) { debug2("readable nexttick read 0"); self2.read(0); } Readable.prototype.resume = function() { var state2 = this._readableState; if (!state2.flowing) { debug2("resume"); state2.flowing = !state2.readableListening; resume(this, state2); } state2.paused = false; return this; }; function resume(stream2, state2) { if (!state2.resumeScheduled) { state2.resumeScheduled = true; process.nextTick(resume_, stream2, state2); } } function resume_(stream2, state2) { debug2("resume", state2.reading); if (!state2.reading) { stream2.read(0); } state2.resumeScheduled = false; stream2.emit("resume"); flow(stream2); if (state2.flowing && !state2.reading) stream2.read(0); } Readable.prototype.pause = function() { debug2("call pause flowing=%j", this._readableState.flowing); if (this._readableState.flowing !== false) { debug2("pause"); this._readableState.flowing = false; this.emit("pause"); } this._readableState.paused = true; return this; }; function flow(stream2) { var state2 = stream2._readableState; debug2("flow", state2.flowing); while (state2.flowing && stream2.read() !== null) ; } Readable.prototype.wrap = function(stream2) { var _this = this; var state2 = this._readableState; var paused = false; stream2.on("end", function() { debug2("wrapped end"); if (state2.decoder && !state2.ended) { var chunk = state2.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream2.on("data", function(chunk) { debug2("wrapped data"); if (state2.decoder) chunk = state2.decoder.write(chunk); if (state2.objectMode && (chunk === null || chunk === void 0)) return; else if (!state2.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); if (!ret) { paused = true; stream2.pause(); } }); for (var i2 in stream2) { if (this[i2] === void 0 && typeof stream2[i2] === "function") { this[i2] = function methodWrap(method) { return function methodWrapReturnFunction() { return stream2[method].apply(stream2, arguments); }; }(i2); } } for (var n2 = 0; n2 < kProxyEvents.length; n2++) { stream2.on(kProxyEvents[n2], this.emit.bind(this, kProxyEvents[n2])); } this._read = function(n3) { debug2("wrapped _read", n3); if (paused) { paused = false; stream2.resume(); } }; return this; }; if (typeof Symbol === "function") { Readable.prototype[Symbol.asyncIterator] = function() { if (createReadableStreamAsyncIterator === void 0) { createReadableStreamAsyncIterator = requireAsync_iterator(); } return createReadableStreamAsyncIterator(this); }; } Object.defineProperty(Readable.prototype, "readableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { return this._readableState.highWaterMark; } }); Object.defineProperty(Readable.prototype, "readableBuffer", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { return this._readableState && this._readableState.buffer; } }); Object.defineProperty(Readable.prototype, "readableFlowing", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { return this._readableState.flowing; }, set: function set2(state2) { if (this._readableState) { this._readableState.flowing = state2; } } }); Readable._fromList = fromList; Object.defineProperty(Readable.prototype, "readableLength", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get2() { return this._readableState.length; } }); function fromList(n2, state2) { if (state2.length === 0) return null; var ret; if (state2.objectMode) ret = state2.buffer.shift(); else if (!n2 || n2 >= state2.length) { if (state2.decoder) ret = state2.buffer.join(""); else if (state2.buffer.length === 1) ret = state2.buffer.first(); else ret = state2.buffer.concat(state2.length); state2.buffer.clear(); } else { ret = state2.buffer.consume(n2, state2.decoder); } return ret; } function endReadable(stream2) { var state2 = stream2._readableState; debug2("endReadable", state2.endEmitted); if (!state2.endEmitted) { state2.ended = true; process.nextTick(endReadableNT, state2, stream2); } } function endReadableNT(state2, stream2) { debug2("endReadableNT", state2.endEmitted, state2.length); if (!state2.endEmitted && state2.length === 0) { state2.endEmitted = true; stream2.readable = false; stream2.emit("end"); if (state2.autoDestroy) { var wState = stream2._writableState; if (!wState || wState.autoDestroy && wState.finished) { stream2.destroy(); } } } } if (typeof Symbol === "function") { Readable.from = function(iterable, opts) { if (from2 === void 0) { from2 = requireFromBrowser(); } return from2(Readable, iterable, opts); }; } function indexOf(xs2, x2) { for (var i2 = 0, l2 = xs2.length; i2 < l2; i2++) { if (xs2[i2] === x2) return i2; } return -1; } return _stream_readable; } var _stream_transform = Transform$3; var _require$codes$1 = errorsBrowser.codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes$1.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes$1.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes$1.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes$1.ERR_TRANSFORM_WITH_LENGTH_0; var Duplex = require_stream_duplex(); inherits_browserExports(Transform$3, Duplex); function afterTransform(er2, data2) { var ts2 = this._transformState; ts2.transforming = false; var cb = ts2.writecb; if (cb === null) { return this.emit("error", new ERR_MULTIPLE_CALLBACK()); } ts2.writechunk = null; ts2.writecb = null; if (data2 != null) this.push(data2); cb(er2); var rs2 = this._readableState; rs2.reading = false; if (rs2.needReadable || rs2.length < rs2.highWaterMark) { this._read(rs2.highWaterMark); } } function Transform$3(options) { if (!(this instanceof Transform$3)) return new Transform$3(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; this._readableState.needReadable = true; this._readableState.sync = false; if (options) { if (typeof options.transform === "function") this._transform = options.transform; if (typeof options.flush === "function") this._flush = options.flush; } this.on("prefinish", prefinish); } function prefinish() { var _this = this; if (typeof this._flush === "function" && !this._readableState.destroyed) { this._flush(function(er2, data2) { done(_this, er2, data2); }); } else { done(this, null, null); } } Transform$3.prototype.push = function(chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; Transform$3.prototype._transform = function(chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); }; Transform$3.prototype._write = function(chunk, encoding, cb) { var ts2 = this._transformState; ts2.writecb = cb; ts2.writechunk = chunk; ts2.writeencoding = encoding; if (!ts2.transforming) { var rs2 = this._readableState; if (ts2.needTransform || rs2.needReadable || rs2.length < rs2.highWaterMark) this._read(rs2.highWaterMark); } }; Transform$3.prototype._read = function(n2) { var ts2 = this._transformState; if (ts2.writechunk !== null && !ts2.transforming) { ts2.transforming = true; this._transform(ts2.writechunk, ts2.writeencoding, ts2.afterTransform); } else { ts2.needTransform = true; } }; Transform$3.prototype._destroy = function(err, cb) { Duplex.prototype._destroy.call(this, err, function(err2) { cb(err2); }); }; function done(stream2, er2, data2) { if (er2) return stream2.emit("error", er2); if (data2 != null) stream2.push(data2); if (stream2._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); if (stream2._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream2.push(null); } var _stream_passthrough = PassThrough; var Transform$2 = _stream_transform; inherits_browserExports(PassThrough, Transform$2); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform$2.call(this, options); } PassThrough.prototype._transform = function(chunk, encoding, cb) { cb(null, chunk); }; var eos; function once(callback) { var called = false; return function() { if (called) return; called = true; callback.apply(void 0, arguments); }; } var _require$codes = errorsBrowser.codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; function noop$3(err) { if (err) throw err; } function isRequest(stream2) { return stream2.setHeader && typeof stream2.abort === "function"; } function destroyer(stream2, reading, writing, callback) { callback = once(callback); var closed = false; stream2.on("close", function() { closed = true; }); if (eos === void 0) eos = endOfStream; eos(stream2, { readable: reading, writable: writing }, function(err) { if (err) return callback(err); closed = true; callback(); }); var destroyed = false; return function(err) { if (closed) return; if (destroyed) return; destroyed = true; if (isRequest(stream2)) return stream2.abort(); if (typeof stream2.destroy === "function") return stream2.destroy(); callback(err || new ERR_STREAM_DESTROYED("pipe")); }; } function call(fn2) { fn2(); } function pipe(from2, to2) { return from2.pipe(to2); } function popCallback(streams) { if (!streams.length) return noop$3; if (typeof streams[streams.length - 1] !== "function") return noop$3; return streams.pop(); } function pipeline() { for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { streams[_key] = arguments[_key]; } var callback = popCallback(streams); if (Array.isArray(streams[0])) streams = streams[0]; if (streams.length < 2) { throw new ERR_MISSING_ARGS("streams"); } var error2; var destroys = streams.map(function(stream2, i2) { var reading = i2 < streams.length - 1; var writing = i2 > 0; return destroyer(stream2, reading, writing, function(err) { if (!error2) error2 = err; if (err) destroys.forEach(call); if (reading) return; destroys.forEach(call); callback(error2); }); }); return streams.reduce(pipe); } var pipeline_1 = pipeline; (function(module2, exports3) { exports3 = module2.exports = require_stream_readable(); exports3.Stream = exports3; exports3.Readable = exports3; exports3.Writable = require_stream_writable(); exports3.Duplex = require_stream_duplex(); exports3.Transform = _stream_transform; exports3.PassThrough = _stream_passthrough; exports3.finished = endOfStream; exports3.pipeline = pipeline_1; })(readableBrowser, readableBrowser.exports); var readableBrowserExports = readableBrowser.exports; const { Transform: Transform$1 } = readableBrowserExports; var keccak$2 = (KeccakState) => class Keccak2 extends Transform$1 { constructor(rate, capacity, delimitedSuffix, hashBitLength, options) { super(options); this._rate = rate; this._capacity = capacity; this._delimitedSuffix = delimitedSuffix; this._hashBitLength = hashBitLength; this._options = options; this._state = new KeccakState(); this._state.initialize(rate, capacity); this._finalized = false; } _transform(chunk, encoding, callback) { let error2 = null; try { this.update(chunk, encoding); } catch (err) { error2 = err; } callback(error2); } _flush(callback) { let error2 = null; try { this.push(this.digest()); } catch (err) { error2 = err; } callback(error2); } update(data2, encoding) { if (!Buffer.isBuffer(data2) && typeof data2 !== "string") throw new TypeError("Data must be a string or a buffer"); if (this._finalized) throw new Error("Digest already called"); if (!Buffer.isBuffer(data2)) data2 = Buffer.from(data2, encoding); this._state.absorb(data2); return this; } digest(encoding) { if (this._finalized) throw new Error("Digest already called"); this._finalized = true; if (this._delimitedSuffix) this._state.absorbLastFewBits(this._delimitedSuffix); let digest = this._state.squeeze(this._hashBitLength / 8); if (encoding !== void 0) digest = digest.toString(encoding); this._resetState(); return digest; } // remove result from memory _resetState() { this._state.initialize(this._rate, this._capacity); return this; } // because sometimes we need hash right now and little later _clone() { const clone = new Keccak2(this._rate, this._capacity, this._delimitedSuffix, this._hashBitLength, this._options); this._state.copy(clone._state); clone._finalized = this._finalized; return clone; } }; const { Transform } = readableBrowserExports; var shake = (KeccakState) => class Shake extends Transform { constructor(rate, capacity, delimitedSuffix, options) { super(options); this._rate = rate; this._capacity = capacity; this._delimitedSuffix = delimitedSuffix; this._options = options; this._state = new KeccakState(); this._state.initialize(rate, capacity); this._finalized = false; } _transform(chunk, encoding, callback) { let error2 = null; try { this.update(chunk, encoding); } catch (err) { error2 = err; } callback(error2); } _flush() { } _read(size2) { this.push(this.squeeze(size2)); } update(data2, encoding) { if (!Buffer.isBuffer(data2) && typeof data2 !== "string") throw new TypeError("Data must be a string or a buffer"); if (this._finalized) throw new Error("Squeeze already called"); if (!Buffer.isBuffer(data2)) data2 = Buffer.from(data2, encoding); this._state.absorb(data2); return this; } squeeze(dataByteLength, encoding) { if (!this._finalized) { this._finalized = true; this._state.absorbLastFewBits(this._delimitedSuffix); } let data2 = this._state.squeeze(dataByteLength); if (encoding !== void 0) data2 = data2.toString(encoding); return data2; } _resetState() { this._state.initialize(this._rate, this._capacity); return this; } _clone() { const clone = new Shake(this._rate, this._capacity, this._delimitedSuffix, this._options); this._state.copy(clone._state); clone._finalized = this._finalized; return clone; } }; const createKeccak = keccak$2; const createShake = shake; var api = function(KeccakState) { const Keccak2 = createKeccak(KeccakState); const Shake = createShake(KeccakState); return function(algorithm, options) { const hash2 = typeof algorithm === "string" ? algorithm.toLowerCase() : algorithm; switch (hash2) { case "keccak224": return new Keccak2(1152, 448, null, 224, options); case "keccak256": return new Keccak2(1088, 512, null, 256, options); case "keccak384": return new Keccak2(832, 768, null, 384, options); case "keccak512": return new Keccak2(576, 1024, null, 512, options); case "sha3-224": return new Keccak2(1152, 448, 6, 224, options); case "sha3-256": return new Keccak2(1088, 512, 6, 256, options); case "sha3-384": return new Keccak2(832, 768, 6, 384, options); case "sha3-512": return new Keccak2(576, 1024, 6, 512, options); case "shake128": return new Shake(1344, 256, 31, options); case "shake256": return new Shake(1088, 512, 31, options); default: throw new Error("Invald algorithm: " + algorithm); } }; }; var keccakStateUnroll = {}; const P1600_ROUND_CONSTANTS = [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]; keccakStateUnroll.p1600 = function(s2) { for (let round = 0; round < 24; ++round) { const lo0 = s2[0] ^ s2[10] ^ s2[20] ^ s2[30] ^ s2[40]; const hi0 = s2[1] ^ s2[11] ^ s2[21] ^ s2[31] ^ s2[41]; const lo1 = s2[2] ^ s2[12] ^ s2[22] ^ s2[32] ^ s2[42]; const hi1 = s2[3] ^ s2[13] ^ s2[23] ^ s2[33] ^ s2[43]; const lo2 = s2[4] ^ s2[14] ^ s2[24] ^ s2[34] ^ s2[44]; const hi2 = s2[5] ^ s2[15] ^ s2[25] ^ s2[35] ^ s2[45]; const lo3 = s2[6] ^ s2[16] ^ s2[26] ^ s2[36] ^ s2[46]; const hi3 = s2[7] ^ s2[17] ^ s2[27] ^ s2[37] ^ s2[47]; const lo4 = s2[8] ^ s2[18] ^ s2[28] ^ s2[38] ^ s2[48]; const hi4 = s2[9] ^ s2[19] ^ s2[29] ^ s2[39] ^ s2[49]; let lo5 = lo4 ^ (lo1 << 1 | hi1 >>> 31); let hi = hi4 ^ (hi1 << 1 | lo1 >>> 31); const t1slo0 = s2[0] ^ lo5; const t1shi0 = s2[1] ^ hi; const t1slo5 = s2[10] ^ lo5; const t1shi5 = s2[11] ^ hi; const t1slo10 = s2[20] ^ lo5; const t1shi10 = s2[21] ^ hi; const t1slo15 = s2[30] ^ lo5; const t1shi15 = s2[31] ^ hi; const t1slo20 = s2[40] ^ lo5; const t1shi20 = s2[41] ^ hi; lo5 = lo0 ^ (lo2 << 1 | hi2 >>> 31); hi = hi0 ^ (hi2 << 1 | lo2 >>> 31); const t1slo1 = s2[2] ^ lo5; const t1shi1 = s2[3] ^ hi; const t1slo6 = s2[12] ^ lo5; const t1shi6 = s2[13] ^ hi; const t1slo11 = s2[22] ^ lo5; const t1shi11 = s2[23] ^ hi; const t1slo16 = s2[32] ^ lo5; const t1shi16 = s2[33] ^ hi; const t1slo21 = s2[42] ^ lo5; const t1shi21 = s2[43] ^ hi; lo5 = lo1 ^ (lo3 << 1 | hi3 >>> 31); hi = hi1 ^ (hi3 << 1 | lo3 >>> 31); const t1slo2 = s2[4] ^ lo5; const t1shi2 = s2[5] ^ hi; const t1slo7 = s2[14] ^ lo5; const t1shi7 = s2[15] ^ hi; const t1slo12 = s2[24] ^ lo5; const t1shi12 = s2[25] ^ hi; const t1slo17 = s2[34] ^ lo5; const t1shi17 = s2[35] ^ hi; const t1slo22 = s2[44] ^ lo5; const t1shi22 = s2[45] ^ hi; lo5 = lo2 ^ (lo4 << 1 | hi4 >>> 31); hi = hi2 ^ (hi4 << 1 | lo4 >>> 31); const t1slo3 = s2[6] ^ lo5; const t1shi3 = s2[7] ^ hi; const t1slo8 = s2[16] ^ lo5; const t1shi8 = s2[17] ^ hi; const t1slo13 = s2[26] ^ lo5; const t1shi13 = s2[27] ^ hi; const t1slo18 = s2[36] ^ lo5; const t1shi18 = s2[37] ^ hi; const t1slo23 = s2[46] ^ lo5; const t1shi23 = s2[47] ^ hi; lo5 = lo3 ^ (lo0 << 1 | hi0 >>> 31); hi = hi3 ^ (hi0 << 1 | lo0 >>> 31); const t1slo4 = s2[8] ^ lo5; const t1shi4 = s2[9] ^ hi; const t1slo9 = s2[18] ^ lo5; const t1shi9 = s2[19] ^ hi; const t1slo14 = s2[28] ^ lo5; const t1shi14 = s2[29] ^ hi; const t1slo19 = s2[38] ^ lo5; const t1shi19 = s2[39] ^ hi; const t1slo24 = s2[48] ^ lo5; const t1shi24 = s2[49] ^ hi; const t2slo0 = t1slo0; const t2shi0 = t1shi0; const t2slo16 = t1shi5 << 4 | t1slo5 >>> 28; const t2shi16 = t1slo5 << 4 | t1shi5 >>> 28; const t2slo7 = t1slo10 << 3 | t1shi10 >>> 29; const t2shi7 = t1shi10 << 3 | t1slo10 >>> 29; const t2slo23 = t1shi15 << 9 | t1slo15 >>> 23; const t2shi23 = t1slo15 << 9 | t1shi15 >>> 23; const t2slo14 = t1slo20 << 18 | t1shi20 >>> 14; const t2shi14 = t1shi20 << 18 | t1slo20 >>> 14; const t2slo10 = t1slo1 << 1 | t1shi1 >>> 31; const t2shi10 = t1shi1 << 1 | t1slo1 >>> 31; const t2slo1 = t1shi6 << 12 | t1slo6 >>> 20; const t2shi1 = t1slo6 << 12 | t1shi6 >>> 20; const t2slo17 = t1slo11 << 10 | t1shi11 >>> 22; const t2shi17 = t1shi11 << 10 | t1slo11 >>> 22; const t2slo8 = t1shi16 << 13 | t1slo16 >>> 19; const t2shi8 = t1slo16 << 13 | t1shi16 >>> 19; const t2slo24 = t1slo21 << 2 | t1shi21 >>> 30; const t2shi24 = t1shi21 << 2 | t1slo21 >>> 30; const t2slo20 = t1shi2 << 30 | t1slo2 >>> 2; const t2shi20 = t1slo2 << 30 | t1shi2 >>> 2; const t2slo11 = t1slo7 << 6 | t1shi7 >>> 26; const t2shi11 = t1shi7 << 6 | t1slo7 >>> 26; const t2slo2 = t1shi12 << 11 | t1slo12 >>> 21; const t2shi2 = t1slo12 << 11 | t1shi12 >>> 21; const t2slo18 = t1slo17 << 15 | t1shi17 >>> 17; const t2shi18 = t1shi17 << 15 | t1slo17 >>> 17; const t2slo9 = t1shi22 << 29 | t1slo22 >>> 3; const t2shi9 = t1slo22 << 29 | t1shi22 >>> 3; const t2slo5 = t1slo3 << 28 | t1shi3 >>> 4; const t2shi5 = t1shi3 << 28 | t1slo3 >>> 4; const t2slo21 = t1shi8 << 23 | t1slo8 >>> 9; const t2shi21 = t1slo8 << 23 | t1shi8 >>> 9; const t2slo12 = t1slo13 << 25 | t1shi13 >>> 7; const t2shi12 = t1shi13 << 25 | t1slo13 >>> 7; const t2slo3 = t1slo18 << 21 | t1shi18 >>> 11; const t2shi3 = t1shi18 << 21 | t1slo18 >>> 11; const t2slo19 = t1shi23 << 24 | t1slo23 >>> 8; const t2shi19 = t1slo23 << 24 | t1shi23 >>> 8; const t2slo15 = t1slo4 << 27 | t1shi4 >>> 5; const t2shi15 = t1shi4 << 27 | t1slo4 >>> 5; const t2slo6 = t1slo9 << 20 | t1shi9 >>> 12; const t2shi6 = t1shi9 << 20 | t1slo9 >>> 12; const t2slo22 = t1shi14 << 7 | t1slo14 >>> 25; const t2shi22 = t1slo14 << 7 | t1shi14 >>> 25; const t2slo13 = t1slo19 << 8 | t1shi19 >>> 24; const t2shi13 = t1shi19 << 8 | t1slo19 >>> 24; const t2slo4 = t1slo24 << 14 | t1shi24 >>> 18; const t2shi4 = t1shi24 << 14 | t1slo24 >>> 18; s2[0] = t2slo0 ^ ~t2slo1 & t2slo2; s2[1] = t2shi0 ^ ~t2shi1 & t2shi2; s2[10] = t2slo5 ^ ~t2slo6 & t2slo7; s2[11] = t2shi5 ^ ~t2shi6 & t2shi7; s2[20] = t2slo10 ^ ~t2slo11 & t2slo12; s2[21] = t2shi10 ^ ~t2shi11 & t2shi12; s2[30] = t2slo15 ^ ~t2slo16 & t2slo17; s2[31] = t2shi15 ^ ~t2shi16 & t2shi17; s2[40] = t2slo20 ^ ~t2slo21 & t2slo22; s2[41] = t2shi20 ^ ~t2shi21 & t2shi22; s2[2] = t2slo1 ^ ~t2slo2 & t2slo3; s2[3] = t2shi1 ^ ~t2shi2 & t2shi3; s2[12] = t2slo6 ^ ~t2slo7 & t2slo8; s2[13] = t2shi6 ^ ~t2shi7 & t2shi8; s2[22] = t2slo11 ^ ~t2slo12 & t2slo13; s2[23] = t2shi11 ^ ~t2shi12 & t2shi13; s2[32] = t2slo16 ^ ~t2slo17 & t2slo18; s2[33] = t2shi16 ^ ~t2shi17 & t2shi18; s2[42] = t2slo21 ^ ~t2slo22 & t2slo23; s2[43] = t2shi21 ^ ~t2shi22 & t2shi23; s2[4] = t2slo2 ^ ~t2slo3 & t2slo4; s2[5] = t2shi2 ^ ~t2shi3 & t2shi4; s2[14] = t2slo7 ^ ~t2slo8 & t2slo9; s2[15] = t2shi7 ^ ~t2shi8 & t2shi9; s2[24] = t2slo12 ^ ~t2slo13 & t2slo14; s2[25] = t2shi12 ^ ~t2shi13 & t2shi14; s2[34] = t2slo17 ^ ~t2slo18 & t2slo19; s2[35] = t2shi17 ^ ~t2shi18 & t2shi19; s2[44] = t2slo22 ^ ~t2slo23 & t2slo24; s2[45] = t2shi22 ^ ~t2shi23 & t2shi24; s2[6] = t2slo3 ^ ~t2slo4 & t2slo0; s2[7] = t2shi3 ^ ~t2shi4 & t2shi0; s2[16] = t2slo8 ^ ~t2slo9 & t2slo5; s2[17] = t2shi8 ^ ~t2shi9 & t2shi5; s2[26] = t2slo13 ^ ~t2slo14 & t2slo10; s2[27] = t2shi13 ^ ~t2shi14 & t2shi10; s2[36] = t2slo18 ^ ~t2slo19 & t2slo15; s2[37] = t2shi18 ^ ~t2shi19 & t2shi15; s2[46] = t2slo23 ^ ~t2slo24 & t2slo20; s2[47] = t2shi23 ^ ~t2shi24 & t2shi20; s2[8] = t2slo4 ^ ~t2slo0 & t2slo1; s2[9] = t2shi4 ^ ~t2shi0 & t2shi1; s2[18] = t2slo9 ^ ~t2slo5 & t2slo6; s2[19] = t2shi9 ^ ~t2shi5 & t2shi6; s2[28] = t2slo14 ^ ~t2slo10 & t2slo11; s2[29] = t2shi14 ^ ~t2shi10 & t2shi11; s2[38] = t2slo19 ^ ~t2slo15 & t2slo16; s2[39] = t2shi19 ^ ~t2shi15 & t2shi16; s2[48] = t2slo24 ^ ~t2slo20 & t2slo21; s2[49] = t2shi24 ^ ~t2shi20 & t2shi21; s2[0] ^= P1600_ROUND_CONSTANTS[round * 2]; s2[1] ^= P1600_ROUND_CONSTANTS[round * 2 + 1]; } }; const keccakState = keccakStateUnroll; function Keccak() { 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 = false; } Keccak.prototype.initialize = function(rate, capacity) { for (let i2 = 0; i2 < 50; ++i2) this.state[i2] = 0; this.blockSize = rate / 8; this.count = 0; this.squeezing = false; }; Keccak.prototype.absorb = function(data2) { for (let i2 = 0; i2 < data2.length; ++i2) { this.state[~~(this.count / 4)] ^= data2[i2] << 8 * (this.count % 4); this.count += 1; if (this.count === this.blockSize) { keccakState.p1600(this.state); this.count = 0; } } }; Keccak.prototype.absorbLastFewBits = function(bits) { this.state[~~(this.count / 4)] ^= bits << 8 * (this.count % 4); if ((bits & 128) !== 0 && this.count === this.blockSize - 1) keccakState.p1600(this.state); this.state[~~((this.blockSize - 1) / 4)] ^= 128 << 8 * ((this.blockSize - 1) % 4); keccakState.p1600(this.state); this.count = 0; this.squeezing = true; }; Keccak.prototype.squeeze = function(length) { if (!this.squeezing) this.absorbLastFewBits(1); const output2 = Buffer.alloc(length); for (let i2 = 0; i2 < length; ++i2) { output2[i2] = this.state[~~(this.count / 4)] >>> 8 * (this.count % 4) & 255; this.count += 1; if (this.count === this.blockSize) { keccakState.p1600(this.state); this.count = 0; } } return output2; }; Keccak.prototype.copy = function(dest) { for (let i2 = 0; i2 < 50; ++i2) dest.state[i2] = this.state[i2]; dest.blockSize = this.blockSize; dest.count = this.count; dest.squeezing = this.squeezing; }; var keccak$1 = Keccak; var js$1 = api(keccak$1); const createKeccakHash = js$1; const BN$1 = bnExports; function zeros(bytes2) { return Buffer.allocUnsafe(bytes2).fill(0); } function setLength(msg, length, right) { const buf = zeros(length); msg = toBuffer(msg); if (right) { if (msg.length < length) { msg.copy(buf); return buf; } return msg.slice(0, length); } else { if (msg.length < length) { msg.copy(buf, length - msg.length); return buf; } return msg.slice(-length); } } function setLengthRight(msg, length) { return setLength(msg, length, true); } function toBuffer(v2) { if (!Buffer.isBuffer(v2)) { if (Array.isArray(v2)) { v2 = Buffer.from(v2); } else if (typeof v2 === "string") { if (isHexString(v2)) { v2 = Buffer.from(padToEven(stripHexPrefix(v2)), "hex"); } else { v2 = Buffer.from(v2); } } else if (typeof v2 === "number") { v2 = intToBuffer(v2); } else if (v2 === null || v2 === void 0) { v2 = Buffer.allocUnsafe(0); } else if (BN$1.isBN(v2)) { v2 = v2.toArrayLike(Buffer); } else if (v2.toArray) { v2 = Buffer.from(v2.toArray()); } else { throw new Error("invalid type"); } } return v2; } function bufferToHex(buf) { buf = toBuffer(buf); return "0x" + buf.toString("hex"); } function keccak(a2, bits) { a2 = toBuffer(a2); if (!bits) bits = 256; return createKeccakHash("keccak" + bits).update(a2).digest(); } function padToEven(str) { return str.length % 2 ? "0" + str : str; } function isHexString(str) { return typeof str === "string" && str.match(/^0x[0-9A-Fa-f]*$/); } function stripHexPrefix(str) { if (typeof str === "string" && str.startsWith("0x")) { return str.slice(2); } return str; } var util$2 = { zeros, setLength, setLengthRight, isHexString, stripHexPrefix, toBuffer, bufferToHex, keccak }; const util$1 = util$2; const BN = bnExports; function elementaryName(name2) { if (name2.startsWith("int[")) { return "int256" + name2.slice(3); } else if (name2 === "int") { return "int256"; } else if (name2.startsWith("uint[")) { return "uint256" + name2.slice(4); } else if (name2 === "uint") { return "uint256"; } else if (name2.startsWith("fixed[")) { return "fixed128x128" + name2.slice(5); } else if (name2 === "fixed") { return "fixed128x128"; } else if (name2.startsWith("ufixed[")) { return "ufixed128x128" + name2.slice(6); } else if (name2 === "ufixed") { return "ufixed128x128"; } return name2; } function parseTypeN(type2) { return parseInt(/^\D+(\d+)$/.exec(type2)[1], 10); } function parseTypeNxM(type2) { var tmp = /^\D+(\d+)x(\d+)$/.exec(type2); return [parseInt(tmp[1], 10), parseInt(tmp[2], 10)]; } function parseTypeArray(type2) { var tmp = type2.match(/(.*)\[(.*?)\]$/); if (tmp) { return tmp[2] === "" ? "dynamic" : parseInt(tmp[2], 10); } return null; } function parseNumber(arg) { var type2 = typeof arg; if (type2 === "string") { if (util$1.isHexString(arg)) { return new BN(util$1.stripHexPrefix(arg), 16); } else { return new BN(arg, 10); } } else if (type2 === "number") { return new BN(arg); } else if (arg.toArray) { return arg; } else { throw new Error("Argument is not a number"); } } function encodeSingle(type2, arg) { var size2, num, ret, i2; if (type2 === "address") { return encodeSingle("uint160", parseNumber(arg)); } else if (type2 === "bool") { return encodeSingle("uint8", arg ? 1 : 0); } else if (type2 === "string") { return encodeSingle("bytes", new Buffer(arg, "utf8")); } else if (isArray(type2)) { if (typeof arg.length === "undefined") { throw new Error("Not an array?"); } size2 = parseTypeArray(type2); if (size2 !== "dynamic" && size2 !== 0 && arg.length > size2) { throw new Error("Elements exceed array size: " + size2); } ret = []; type2 = type2.slice(0, type2.lastIndexOf("[")); if (typeof arg === "string") { arg = JSON.parse(arg); } for (i2 in arg) { ret.push(encodeSingle(type2, arg[i2])); } if (size2 === "dynamic") { var length = encodeSingle("uint256", arg.length); ret.unshift(length); } return Buffer.concat(ret); } else if (type2 === "bytes") { arg = new Buffer(arg); ret = Buffer.concat([encodeSingle("uint256", arg.length), arg]); if (arg.length % 32 !== 0) { ret = Buffer.concat([ret, util$1.zeros(32 - arg.length % 32)]); } return ret; } else if (type2.startsWith("bytes")) { size2 = parseTypeN(type2); if (size2 < 1 || size2 > 32) { throw new Error("Invalid bytes width: " + size2); } return util$1.setLengthRight(arg, 32); } else if (type2.startsWith("uint")) { size2 = parseTypeN(type2); if (size2 % 8 || size2 < 8 || size2 > 256) { throw new Error("Invalid uint width: " + size2); } num = parseNumber(arg); if (num.bitLength() > size2) { throw new Error("Supplied uint exceeds width: " + size2 + " vs " + num.bitLength()); } if (num < 0) { throw new Error("Supplied uint is negative"); } return num.toArrayLike(Buffer, "be", 32); } else if (type2.startsWith("int")) { size2 = parseTypeN(type2); if (size2 % 8 || size2 < 8 || size2 > 256) { throw new Error("Invalid int width: " + size2); } num = parseNumber(arg); if (num.bitLength() > size2) { throw new Error("Supplied int exceeds width: " + size2 + " vs " + num.bitLength()); } return num.toTwos(256).toArrayLike(Buffer, "be", 32); } else if (type2.startsWith("ufixed")) { size2 = parseTypeNxM(type2); num = parseNumber(arg); if (num < 0) { throw new Error("Supplied ufixed is negative"); } return encodeSingle("uint256", num.mul(new BN(2).pow(new BN(size2[1])))); } else if (type2.startsWith("fixed")) { size2 = parseTypeNxM(type2); return encodeSingle("int256", parseNumber(arg).mul(new BN(2).pow(new BN(size2[1])))); } throw new Error("Unsupported or invalid type: " + type2); } function isDynamic(type2) { return type2 === "string" || type2 === "bytes" || parseTypeArray(type2) === "dynamic"; } function isArray(type2) { return type2.lastIndexOf("]") === type2.length - 1; } function rawEncode(types2, values) { var output2 = []; var data2 = []; var headLength = 32 * types2.length; for (var i2 in types2) { var type2 = elementaryName(types2[i2]); var value = values[i2]; var cur = encodeSingle(type2, value); if (isDynamic(type2)) { output2.push(encodeSingle("uint256", headLength)); data2.push(cur); headLength += cur.length; } else { output2.push(cur); } } return Buffer.concat(output2.concat(data2)); } function solidityPack(types2, values) { if (types2.length !== values.length) { throw new Error("Number of types are not matching the values"); } var size2, num; var ret = []; for (var i2 = 0; i2 < types2.length; i2++) { var type2 = elementaryName(types2[i2]); var value = values[i2]; if (type2 === "bytes") { ret.push(value); } else if (type2 === "string") { ret.push(new Buffer(value, "utf8")); } else if (type2 === "bool") { ret.push(new Buffer(value ? "01" : "00", "hex")); } else if (type2 === "address") { ret.push(util$1.setLength(value, 20)); } else if (type2.startsWith("bytes")) { size2 = parseTypeN(type2); if (size2 < 1 || size2 > 32) { throw new Error("Invalid bytes width: " + size2); } ret.push(util$1.setLengthRight(value, size2)); } else if (type2.startsWith("uint")) { size2 = parseTypeN(type2); if (size2 % 8 || size2 < 8 || size2 > 256) { throw new Error("Invalid uint width: " + size2); } num = parseNumber(value); if (num.bitLength() > size2) { throw new Error("Supplied uint exceeds width: " + size2 + " vs " + num.bitLength()); } ret.push(num.toArrayLike(Buffer, "be", size2 / 8)); } else if (type2.startsWith("int")) { size2 = parseTypeN(type2); if (size2 % 8 || size2 < 8 || size2 > 256) { throw new Error("Invalid int width: " + size2); } num = parseNumber(value); if (num.bitLength() > size2) { throw new Error("Supplied int exceeds width: " + size2 + " vs " + num.bitLength()); } ret.push(num.toTwos(size2).toArrayLike(Buffer, "be", size2 / 8)); } else { throw new Error("Unsupported or invalid type: " + type2); } } return Buffer.concat(ret); } function soliditySHA3(types2, values) { return util$1.keccak(solidityPack(types2, values)); } var abi$1 = { rawEncode, solidityPack, soliditySHA3 }; const util = util$2; const abi = abi$1; const TYPED_MESSAGE_SCHEMA = { 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"] }; const TypedDataUtils = { /** * Encodes an object by encoding and concatenating each of its members * * @param {string} primaryType - Root type * @param {Object} data - Object to encode * @param {Object} types - Type definitions * @returns {string} - Encoded representation of an object */ encodeData(primaryType, data2, types2, useV4 = true) { const encodedTypes = ["bytes32"]; const encodedValues = [this.hashType(primaryType, types2)]; if (useV4) { const encodeField2 = (name2, type2, value) => { if (types2[type2] !== void 0) { return ["bytes32", value == null ? "0x0000000000000000000000000000000000000000000000000000000000000000" : util.keccak(this.encodeData(type2, value, types2, useV4))]; } if (value === void 0) throw new Error(`missing value for field ${name2} of type ${type2}`); if (type2 === "bytes") { return ["bytes32", util.keccak(value)]; } if (type2 === "string") { if (typeof value === "string") { value = Buffer.from(value, "utf8"); } return ["bytes32", util.keccak(value)]; } if (type2.lastIndexOf("]") === type2.length - 1) { const parsedType = type2.slice(0, type2.lastIndexOf("[")); const typeValuePairs = value.map((item) => encodeField2(name2, parsedType, item)); return ["bytes32", util.keccak(abi.rawEncode( typeValuePairs.map(([type3]) => type3), typeValuePairs.map(([, value2]) => value2) ))]; } return [type2, value]; }; for (const field of types2[primaryType]) { const [type2, value] = encodeField2(field.name, field.type, data2[field.name]); encodedTypes.push(type2); encodedValues.push(value); } } else { for (const field of types2[primaryType]) { let value = data2[field.name]; if (value !== void 0) { if (field.type === "bytes") { encodedTypes.push("bytes32"); value = util.keccak(value); encodedValues.push(value); } else if (field.type === "string") { encodedTypes.push("bytes32"); if (typeof value === "string") { value = Buffer.from(value, "utf8"); } value = util.keccak(value); encodedValues.push(value); } else if (types2[field.type] !== void 0) { encodedTypes.push("bytes32"); value = util.keccak(this.encodeData(field.type, value, types2, useV4)); encodedValues.push(value); } else if (field.type.lastIndexOf("]") === field.type.length - 1) { throw new Error("Arrays currently unimplemented in encodeData"); } else { encodedTypes.push(field.type); encodedValues.push(value); } } } } return abi.rawEncode(encodedTypes, encodedValues); }, /** * Encodes the type of an object by encoding a comma delimited list of its members * * @param {string} primaryType - Root type to encode * @param {Object} types - Type definitions * @returns {string} - Encoded representation of the type of an object */ encodeType(primaryType, types2) { let result = ""; let deps = this.findTypeDependencies(primaryType, types2).filter((dep) => dep !== primaryType); deps = [primaryType].concat(deps.sort()); for (const type2 of deps) { const children = types2[type2]; if (!children) { throw new Error("No type definition specified: " + type2); } result += type2 + "(" + types2[type2].map(({ name: name2, type: type3 }) => type3 + " " + name2).join(",") + ")"; } return result; }, /** * Finds all types within a type defintion object * * @param {string} primaryType - Root type * @param {Object} types - Type definitions * @param {Array} results - current set of accumulated types * @returns {Array} - Set of all types found in the type definition */ findTypeDependencies(primaryType, types2, results2 = []) { primaryType = primaryType.match(/^\w*/)[0]; if (results2.includes(primaryType) || types2[primaryType] === void 0) { return results2; } results2.push(primaryType); for (const field of types2[primaryType]) { for (const dep of this.findTypeDependencies(field.type, types2, results2)) { !results2.includes(dep) && results2.push(dep); } } return results2; }, /** * Hashes an object * * @param {string} primaryType - Root type * @param {Object} data - Object to hash * @param {Object} types - Type definitions * @returns {Buffer} - Hash of an object */ hashStruct(primaryType, data2, types2, useV4 = true) { return util.keccak(this.encodeData(primaryType, data2, types2, useV4)); }, /** * Hashes the type of an object * * @param {string} primaryType - Root type to hash * @param {Object} types - Type definitions * @returns {string} - Hash of an object */ hashType(primaryType, types2) { return util.keccak(this.encodeType(primaryType, types2)); }, /** * Removes properties from a message object that are not defined per EIP-712 * * @param {Object} data - typed message object * @returns {Object} - typed message object with only allowed fields */ sanitizeData(data2) { const sanitizedData = {}; for (const key in TYPED_MESSAGE_SCHEMA.properties) { data2[key] && (sanitizedData[key] = data2[key]); } if (sanitizedData.types) { sanitizedData.types = Object.assign({ EIP712Domain: [] }, sanitizedData.types); } return sanitizedData; }, /** * Returns the hash of a typed message as per EIP-712 for signing * * @param {Object} typedData - Types message data to sign * @returns {string} - sha3 hash for signing */ hash(typedData, useV4 = true) { const sanitizedData = this.sanitizeData(typedData); const parts = [Buffer.from("1901", "hex")]; parts.push(this.hashStruct("EIP712Domain", sanitizedData.domain, sanitizedData.types, useV4)); if (sanitizedData.primaryType !== "EIP712Domain") { parts.push(this.hashStruct(sanitizedData.primaryType, sanitizedData.message, sanitizedData.types, useV4)); } return util.keccak(Buffer.concat(parts)); } }; var ethEip712Util = { TYPED_MESSAGE_SCHEMA, TypedDataUtils, hashForSignTypedDataLegacy: function(msgParams) { return typedSignatureHashLegacy(msgParams.data); }, hashForSignTypedData_v3: function(msgParams) { return TypedDataUtils.hash(msgParams.data, false); }, hashForSignTypedData_v4: function(msgParams) { return TypedDataUtils.hash(msgParams.data); } }; function typedSignatureHashLegacy(typedData) { const error2 = new Error("Expect argument to be non-empty array"); if (typeof typedData !== "object" || !typedData.length) throw error2; const data2 = typedData.map(function(e2) { return e2.type === "bytes" ? util.toBuffer(e2.value) : e2.value; }); const types2 = typedData.map(function(e2) { return e2.type; }); const schema = typedData.map(function(e2) { if (!e2.name) throw error2; return e2.type + " " + e2.name; }); return abi.soliditySHA3( ["bytes32", "bytes32"], [ abi.soliditySHA3(new Array(typedData.length).fill("string"), schema), abi.soliditySHA3(types2, data2) ] ); } var FilterPolyfill$1 = {}; Object.defineProperty(FilterPolyfill$1, "__esModule", { value: true }); FilterPolyfill$1.filterFromParam = FilterPolyfill$1.FilterPolyfill = void 0; const type_1 = type$1; const util_1$3 = util$3; const TIMEOUT = 5 * 60 * 1e3; const JSONRPC_TEMPLATE = { jsonrpc: "2.0", id: 0 }; class FilterPolyfill { constructor(provider) { this.logFilters = /* @__PURE__ */ new Map(); this.blockFilters = /* @__PURE__ */ new Set(); this.pendingTransactionFilters = /* @__PURE__ */ new Set(); this.cursors = /* @__PURE__ */ new Map(); this.timeouts = /* @__PURE__ */ new Map(); this.nextFilterId = (0, type_1.IntNumber)(1); this.REQUEST_THROTTLE_INTERVAL = 1e3; this.lastFetchTimestamp = /* @__PURE__ */ new Date(0); this.resolvers = []; this.provider = provider; } async newFilter(param) { const filter = filterFromParam(param); const id2 = this.makeFilterId(); const cursor = await this.setInitialCursorPosition(id2, filter.fromBlock); console.info(`Installing new log filter(${id2}):`, filter, "initial cursor position:", cursor); this.logFilters.set(id2, filter); this.setFilterTimeout(id2); return (0, util_1$3.hexStringFromIntNumber)(id2); } async newBlockFilter() { const id2 = this.makeFilterId(); const cursor = await this.setInitialCursorPosition(id2, "latest"); console.info(`Installing new block filter (${id2}) with initial cursor position:`, cursor); this.blockFilters.add(id2); this.setFilterTimeout(id2); return (0, util_1$3.hexStringFromIntNumber)(id2); } async newPendingTransactionFilter() { const id2 = this.makeFilterId(); const cursor = await this.setInitialCursorPosition(id2, "latest"); console.info(`Installing new block filter (${id2}) with initial cursor position:`, cursor); this.pendingTransactionFilters.add(id2); this.setFilterTimeout(id2); return (0, util_1$3.hexStringFromIntNumber)(id2); } uninstallFilter(filterId) { const id2 = (0, util_1$3.intNumberFromHexString)(filterId); console.info(`Uninstalling filter (${id2})`); this.deleteFilter(id2); return true; } getFilterChanges(filterId) { const id2 = (0, util_1$3.intNumberFromHexString)(filterId); if (this.timeouts.has(id2)) { this.setFilterTimeout(id2); } if (this.logFilters.has(id2)) { return this.getLogFilterChanges(id2); } else if (this.blockFilters.has(id2)) { return this.getBlockFilterChanges(id2); } else if (this.pendingTransactionFilters.has(id2)) { return this.getPendingTransactionFilterChanges(id2); } return Promise.resolve(filterNotFoundError()); } async getFilterLogs(filterId) { const id2 = (0, util_1$3.intNumberFromHexString)(filterId); const filter = this.logFilters.get(id2); if (!filter) { return filterNotFoundError(); } return this.sendAsyncPromise(Object.assign(Object.assign({}, JSONRPC_TEMPLATE), { method: "eth_getLogs", params: [paramFromFilter(filter)] })); } makeFilterId() { return (0, type_1.IntNumber)(++this.nextFilterId); } sendAsyncPromise(request) { return new Promise((resolve, reject) => { this.provider.sendAsync(request, (err, response) => { if (err) { return reject(err); } if (Array.isArray(response) || response == null) { return reject(new Error(`unexpected response received: ${JSON.stringify(response)}`)); } resolve(response); }); }); } deleteFilter(id2) { console.info(`Deleting filter (${id2})`); this.logFilters.delete(id2); this.blockFilters.delete(id2); this.pendingTransactionFilters.delete(id2); this.cursors.delete(id2); this.timeouts.delete(id2); } async getLogFilterChanges(id2) { const filter = this.logFilters.get(id2); const cursorPosition = this.cursors.get(id2); if (!cursorPosition || !filter) { return filterNotFoundError(); } const currentBlockHeight = await this.getCurrentBlockHeight(); const toBlock = filter.toBlock === "latest" ? currentBlockHeight : filter.toBlock; if (cursorPosition > currentBlockHeight) { return emptyResult(); } if (cursorPosition > Number(filter.toBlock)) { return emptyResult(); } console.info(`Fetching logs from ${cursorPosition} to ${toBlock} for filter ${id2}`); const response = await this.sendAsyncPromise(Object.assign(Object.assign({}, JSONRPC_TEMPLATE), { method: "eth_getLogs", params: [ paramFromFilter(Object.assign(Object.assign({}, filter), { fromBlock: cursorPosition, toBlock })) ] })); if (Array.isArray(response.result)) { const blocks = response.result.map((log2) => (0, util_1$3.intNumberFromHexString)(log2.blockNumber || "0x0")); const highestBlock = Math.max(...blocks); if (highestBlock && highestBlock > cursorPosition) { const newCursorPosition = (0, type_1.IntNumber)(highestBlock + 1); console.info(`Moving cursor position for filter (${id2}) from ${cursorPosition} to ${newCursorPosition}`); this.cursors.set(id2, newCursorPosition); } } return response; } async getBlockFilterChanges(id2) { const cursorPosition = this.cursors.get(id2); if (!cursorPosition) { return filterNotFoundError(); } const currentBlockHeight = await this.getCurrentBlockHeight(); if (cursorPosition > currentBlockHeight) { return emptyResult(); } console.info(`Fetching blocks from ${cursorPosition} to ${currentBlockHeight} for filter (${id2})`); const blocks = (await Promise.all( // eslint-disable-next-line @typescript-eslint/restrict-plus-operands (0, util_1$3.range)(cursorPosition, currentBlockHeight + 1).map((i2) => this.getBlockHashByNumber((0, type_1.IntNumber)(i2))) )).filter((hash2) => !!hash2); const newCursorPosition = (0, type_1.IntNumber)(cursorPosition + blocks.length); console.info(`Moving cursor position for filter (${id2}) from ${cursorPosition} to ${newCursorPosition}`); this.cursors.set(id2, newCursorPosition); return Object.assign(Object.assign({}, JSONRPC_TEMPLATE), { result: blocks }); } async getPendingTransactionFilterChanges(_id) { return Promise.resolve(emptyResult()); } async setInitialCursorPosition(id2, startBlock) { const currentBlockHeight = await this.getCurrentBlockHeight(); const initialCursorPosition = typeof startBlock === "number" && startBlock > currentBlockHeight ? startBlock : currentBlockHeight; this.cursors.set(id2, initialCursorPosition); return initialCursorPosition; } setFilterTimeout(id2) { const existing = this.timeouts.get(id2); if (existing) { window.clearTimeout(existing); } const timeout2 = window.setTimeout(() => { console.info(`Filter (${id2}) timed out`); this.deleteFilter(id2); }, TIMEOUT); this.timeouts.set(id2, timeout2); } // throttle eth_blockNumber requests async getCurrentBlockHeight() { const now = /* @__PURE__ */ new Date(); if (now.getTime() - this.lastFetchTimestamp.getTime() > this.REQUEST_THROTTLE_INTERVAL) { this.lastFetchTimestamp = now; const height = await this._getCurrentBlockHeight(); this.currentBlockHeight = height; this.resolvers.forEach((resolve) => resolve(height)); this.resolvers = []; } if (!this.currentBlockHeight) { return new Promise((resolve) => this.resolvers.push(resolve)); } return this.currentBlockHeight; } async _getCurrentBlockHeight() { const { result } = await this.sendAsyncPromise(Object.assign(Object.assign({}, JSONRPC_TEMPLATE), { method: "eth_blockNumber", params: [] })); return (0, util_1$3.intNumberFromHexString)((0, util_1$3.ensureHexString)(result)); } async getBlockHashByNumber(blockNumber) { const response = await this.sendAsyncPromise(Object.assign(Object.assign({}, JSONRPC_TEMPLATE), { method: "eth_getBlockByNumber", params: [(0, util_1$3.hexStringFromIntNumber)(blockNumber), false] })); if (response.result && typeof response.result.hash === "string") { return (0, util_1$3.ensureHexString)(response.result.hash); } return null; } } FilterPolyfill$1.FilterPolyfill = FilterPolyfill; function filterFromParam(param) { return { fromBlock: intBlockHeightFromHexBlockHeight(param.fromBlock), toBlock: intBlockHeightFromHexBlockHeight(param.toBlock), addresses: param.address === void 0 ? null : Array.isArray(param.address) ? param.address : [param.address], topics: param.topics || [] }; } FilterPolyfill$1.filterFromParam = filterFromParam; function paramFromFilter(filter) { const param = { fromBlock: hexBlockHeightFromIntBlockHeight(filter.fromBlock), toBlock: hexBlockHeightFromIntBlockHeight(filter.toBlock), topics: filter.topics }; if (filter.addresses !== null) { param.address = filter.addresses; } return param; } function intBlockHeightFromHexBlockHeight(value) { if (value === void 0 || value === "latest" || value === "pending") { return "latest"; } else if (value === "earliest") { return (0, type_1.IntNumber)(0); } else if ((0, util_1$3.isHexString)(value)) { return (0, util_1$3.intNumberFromHexString)(value); } throw new Error(`Invalid block option: ${String(value)}`); } function hexBlockHeightFromIntBlockHeight(value) { if (value === "latest") { return value; } return (0, util_1$3.hexStringFromIntNumber)(value); } function filterNotFoundError() { return Object.assign(Object.assign({}, JSONRPC_TEMPLATE), { error: { code: -32e3, message: "filter not found" } }); } function emptyResult() { return Object.assign(Object.assign({}, JSONRPC_TEMPLATE), { result: [] }); } var SubscriptionManager$1 = {}; var dist$4 = {}; var PollingBlockTracker$1 = {}; var jsonRpcRandomId = IdIterator; function IdIterator(opts) { opts = opts || {}; var max2 = opts.max || Number.MAX_SAFE_INTEGER; var idCounter2 = typeof opts.start !== "undefined" ? opts.start : Math.floor(Math.random() * max2); return function createRandomId2() { idCounter2 = idCounter2 % max2; return idCounter2++; }; } const processFn$1 = (fn2, opts) => function() { const P2 = opts.promiseModule; const args = new Array(arguments.length); for (let i2 = 0; i2 < arguments.length; i2++) { args[i2] = arguments[i2]; } return new P2((resolve, reject) => { if (opts.errorFirst) { args.push(function(err, result) { if (opts.multiArgs) { const results2 = new Array(arguments.length - 1); for (let i2 = 1; i2 < arguments.length; i2++) { results2[i2 - 1] = arguments[i2]; } if (err) { results2.unshift(err); reject(results2); } else { resolve(results2); } } else if (err) { reject(err); } else { resolve(result); } }); } else { args.push(function(result) { if (opts.multiArgs) { const results2 = new Array(arguments.length - 1); for (let i2 = 0; i2 < arguments.length; i2++) { results2[i2] = arguments[i2]; } resolve(results2); } else { resolve(result); } }); } fn2.apply(this, args); }); }; var pify$2 = (obj, opts) => { opts = Object.assign({ exclude: [/.+(Sync|Stream)$/], errorFirst: true, promiseModule: Promise }, opts); const filter = (key) => { const match = (pattern2) => typeof pattern2 === "string" ? key === pattern2 : pattern2.test(key); return opts.include ? opts.include.some(match) : !opts.exclude.some(match); }; let ret; if (typeof obj === "function") { ret = function() { if (opts.excludeMain) { return obj.apply(this, arguments); } return processFn$1(obj, opts).apply(this, arguments); }; } else { ret = Object.create(Object.getPrototypeOf(obj)); } for (const key in obj) { const x2 = obj[key]; ret[key] = typeof x2 === "function" && filter(key) ? processFn$1(x2, opts) : x2; } return ret; }; var BaseBlockTracker$1 = {}; var cjs$2 = {}; Object.defineProperty(cjs$2, "__esModule", { value: true }); const events_1$1 = eventsExports; function safeApply$1(handler, context, args) { try { Reflect.apply(handler, context, args); } catch (err) { setTimeout(() => { throw err; }); } } function arrayClone$1(arr2) { const n2 = arr2.length; const copy = new Array(n2); for (let i2 = 0; i2 < n2; i2 += 1) { copy[i2] = arr2[i2]; } return copy; } let SafeEventEmitter$3 = class SafeEventEmitter extends events_1$1.EventEmitter { emit(type2, ...args) { let doError = type2 === "error"; const events2 = this._events; if (events2 !== void 0) { doError = doError && events2.error === void 0; } else if (!doError) { return false; } if (doError) { let er2; if (args.length > 0) { [er2] = args; } if (er2 instanceof Error) { throw er2; } const err = new Error(`Unhandled error.${er2 ? ` (${er2.message})` : ""}`); err.context = er2; throw err; } const handler = events2[type2]; if (handler === void 0) { return false; } if (typeof handler === "function") { safeApply$1(handler, this, args); } else { const len2 = handler.length; const listeners = arrayClone$1(handler); for (let i2 = 0; i2 < len2; i2 += 1) { safeApply$1(listeners[i2], this, args); } } return true; } }; cjs$2.default = SafeEventEmitter$3; var __importDefault$6 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(BaseBlockTracker$1, "__esModule", { value: true }); BaseBlockTracker$1.BaseBlockTracker = void 0; const safe_event_emitter_1$1 = __importDefault$6(cjs$2); const sec$1 = 1e3; const calculateSum = (accumulator, currentValue) => accumulator + currentValue; const blockTrackerEvents = ["sync", "latest"]; class BaseBlockTracker extends safe_event_emitter_1$1.default { constructor(opts) { super(); this._blockResetDuration = opts.blockResetDuration || 20 * sec$1; this._usePastBlocks = opts.usePastBlocks || false; this._currentBlock = null; this._isRunning = false; 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() { if (this._currentBlock) { return this._currentBlock; } const latestBlock = await new Promise((resolve) => this.once("latest", resolve)); return latestBlock; } // dont allow module consumer to remove our internal event listeners removeAllListeners(eventName) { if (eventName) { super.removeAllListeners(eventName); } else { super.removeAllListeners(); } this._setupInternalEvents(); this._onRemoveListener(); return this; } _setupInternalEvents() { this.removeListener("newListener", this._onNewListener); this.removeListener("removeListener", this._onRemoveListener); this.on("newListener", this._onNewListener); this.on("removeListener", this._onRemoveListener); } _onNewListener(eventName) { if (blockTrackerEvents.includes(eventName)) { this._maybeStart(); } } _onRemoveListener() { if (this._getBlockTrackerEventCount() > 0) { return; } this._maybeEnd(); } async _maybeStart() { if (this._isRunning) { return; } this._isRunning = true; this._cancelBlockResetTimeout(); await this._start(); this.emit("_started"); } async _maybeEnd() { if (!this._isRunning) { return; } this._isRunning = false; this._setupBlockResetTimeout(); await this._end(); this.emit("_ended"); } _getBlockTrackerEventCount() { return blockTrackerEvents.map((eventName) => this.listenerCount(eventName)).reduce(calculateSum); } _shouldUseNewBlock(newBlock) { const currentBlock = this._currentBlock; if (!currentBlock) { return true; } const newBlockInt = hexToInt$4(newBlock); const currentBlockInt = hexToInt$4(currentBlock); return this._usePastBlocks && newBlockInt < currentBlockInt || newBlockInt > currentBlockInt; } _newPotentialLatest(newBlock) { if (!this._shouldUseNewBlock(newBlock)) { return; } this._setCurrentBlock(newBlock); } _setCurrentBlock(newBlock) { const oldBlock = this._currentBlock; this._currentBlock = newBlock; this.emit("latest", newBlock); this.emit("sync", { oldBlock, newBlock }); } _setupBlockResetTimeout() { this._cancelBlockResetTimeout(); this._blockResetTimeout = setTimeout(this._resetCurrentBlock, this._blockResetDuration); if (this._blockResetTimeout.unref) { this._blockResetTimeout.unref(); } } _cancelBlockResetTimeout() { if (this._blockResetTimeout) { clearTimeout(this._blockResetTimeout); } } _resetCurrentBlock() { this._currentBlock = null; } } BaseBlockTracker$1.BaseBlockTracker = BaseBlockTracker; function hexToInt$4(hexInt) { return Number.parseInt(hexInt, 16); } var loggingUtils = {}; var dist$3 = {}; var assert$2 = {}; class StructError extends TypeError { constructor(failure, failures) { let cached; const { message, explanation, ...rest } = failure; const { path } = failure; const msg = path.length === 0 ? message : `At path: ${path.join(".")} -- ${message}`; super(explanation ?? msg); if (explanation != null) this.cause = msg; Object.assign(this, rest); this.name = this.constructor.name; this.failures = () => { return cached ?? (cached = [failure, ...failures()]); }; } } function isIterable(x2) { return isObject(x2) && typeof x2[Symbol.iterator] === "function"; } function isObject(x2) { return typeof x2 === "object" && x2 != null; } function isPlainObject(x2) { if (Object.prototype.toString.call(x2) !== "[object Object]") { return false; } const prototype = Object.getPrototypeOf(x2); return prototype === null || prototype === Object.prototype; } function print(value) { if (typeof value === "symbol") { return value.toString(); } return typeof value === "string" ? JSON.stringify(value) : `${value}`; } function shiftIterator(input) { const { done: done2, value } = input.next(); return done2 ? void 0 : value; } function toFailure(result, context, struct2, value) { if (result === true) { return; } else if (result === false) { result = {}; } else if (typeof result === "string") { result = { message: result }; } const { path, branch } = context; const { type: type2 } = struct2; const { refinement, message = `Expected a value of type \`${type2}\`${refinement ? ` with refinement \`${refinement}\`` : ""}, but received: \`${print(value)}\`` } = result; return { value, type: type2, refinement, key: path[path.length - 1], path, branch, ...result, message }; } function* toFailures(result, context, struct2, value) { if (!isIterable(result)) { result = [result]; } for (const r2 of result) { const failure = toFailure(r2, context, struct2, value); if (failure) { yield failure; } } } function* run(value, struct2, options = {}) { const { path = [], branch = [value], coerce: coerce2 = false, mask: mask2 = false } = options; const ctx = { path, branch }; if (coerce2) { value = struct2.coercer(value, ctx); if (mask2 && struct2.type !== "type" && isObject(struct2.schema) && isObject(value) && !Array.isArray(value)) { for (const key in value) { if (struct2.schema[key] === void 0) { delete value[key]; } } } } let status = "valid"; for (const failure of struct2.validator(value, ctx)) { failure.explanation = options.message; status = "not_valid"; yield [failure, void 0]; } for (let [k2, v2, s2] of struct2.entries(value, ctx)) { const ts2 = run(v2, s2, { path: k2 === void 0 ? path : [...path, k2], branch: k2 === void 0 ? branch : [...branch, v2], coerce: coerce2, mask: mask2, message: options.message }); for (const t2 of ts2) { if (t2[0]) { status = t2[0].refinement != null ? "not_refined" : "not_valid"; yield [t2[0], void 0]; } else if (coerce2) { v2 = t2[1]; if (k2 === void 0) { value = v2; } else if (value instanceof Map) { value.set(k2, v2); } else if (value instanceof Set) { value.add(v2); } else if (isObject(value)) { if (v2 !== void 0 || k2 in value) value[k2] = v2; } } } } if (status !== "not_valid") { for (const failure of struct2.refiner(value, ctx)) { failure.explanation = options.message; status = "not_refined"; yield [failure, void 0]; } } if (status === "valid") { yield [void 0, value]; } } class Struct { constructor(props) { const { type: type2, schema, validator, refiner, coercer = (value) => value, entries: entries2 = function* () { } } = props; this.type = type2; this.schema = schema; this.entries = entries2; this.coercer = coercer; if (validator) { this.validator = (value, context) => { const result = validator(value, context); return toFailures(result, context, this, value); }; } else { this.validator = () => []; } if (refiner) { this.refiner = (value, context) => { const result = refiner(value, context); return toFailures(result, context, this, value); }; } else { this.refiner = () => []; } } /** * Assert that a value passes the struct's validation, throwing if it doesn't. */ assert(value, message) { return assert$1(value, this, message); } /** * Create a value with the struct's coercion logic, then validate it. */ create(value, message) { return create(value, this, message); } /** * Check if a value passes the struct's validation. */ is(value) { return is$1(value, this); } /** * Mask a value, coercing and validating it, but returning only the subset of * properties defined by the struct's schema. */ mask(value, message) { return mask(value, this, message); } /** * Validate a value with the struct's validation logic, returning a tuple * representing the result. * * You may optionally pass `true` for the `withCoercion` argument to coerce * the value before attempting to validate it. If you do, the result will * contain the coerced result when successful. */ validate(value, options = {}) { return validate(value, this, options); } } function assert$1(value, struct2, message) { const result = validate(value, struct2, { message }); if (result[0]) { throw result[0]; } } function create(value, struct2, message) { const result = validate(value, struct2, { coerce: true, message }); if (result[0]) { throw result[0]; } else { return result[1]; } } function mask(value, struct2, message) { const result = validate(value, struct2, { coerce: true, mask: true, message }); if (result[0]) { throw result[0]; } else { return result[1]; } } function is$1(value, struct2) { const result = validate(value, struct2); return !result[0]; } function validate(value, struct2, options = {}) { const tuples = run(value, struct2, options); const tuple2 = shiftIterator(tuples); if (tuple2[0]) { const error2 = new StructError(tuple2[0], function* () { for (const t2 of tuples) { if (t2[0]) { yield t2[0]; } } }); return [error2, void 0]; } else { const v2 = tuple2[1]; return [void 0, v2]; } } function assign(...Structs) { const isType = Structs[0].type === "type"; const schemas = Structs.map((s2) => s2.schema); const schema = Object.assign({}, ...schemas); return isType ? type(schema) : object(schema); } function define2(name2, validator) { return new Struct({ type: name2, schema: null, validator }); } function deprecated(struct2, log2) { return new Struct({ ...struct2, refiner: (value, ctx) => value === void 0 || struct2.refiner(value, ctx), validator(value, ctx) { if (value === void 0) { return true; } else { log2(value, ctx); return struct2.validator(value, ctx); } } }); } function dynamic(fn2) { return new Struct({ type: "dynamic", schema: null, *entries(value, ctx) { const struct2 = fn2(value, ctx); yield* struct2.entries(value, ctx); }, validator(value, ctx) { const struct2 = fn2(value, ctx); return struct2.validator(value, ctx); }, coercer(value, ctx) { const struct2 = fn2(value, ctx); return struct2.coercer(value, ctx); }, refiner(value, ctx) { const struct2 = fn2(value, ctx); return struct2.refiner(value, ctx); } }); } function lazy(fn2) { let struct2; return new Struct({ type: "lazy", schema: null, *entries(value, ctx) { struct2 ?? (struct2 = fn2()); yield* struct2.entries(value, ctx); }, validator(value, ctx) { struct2 ?? (struct2 = fn2()); return struct2.validator(value, ctx); }, coercer(value, ctx) { struct2 ?? (struct2 = fn2()); return struct2.coercer(value, ctx); }, refiner(value, ctx) { struct2 ?? (struct2 = fn2()); return struct2.refiner(value, ctx); } }); } function omit(struct2, keys2) { const { schema } = struct2; const subschema = { ...schema }; for (const key of keys2) { delete subschema[key]; } switch (struct2.type) { case "type": return type(subschema); default: return object(subschema); } } function partial(struct2) { const isStruct = struct2 instanceof Struct; const schema = isStruct ? { ...struct2.schema } : { ...struct2 }; for (const key in schema) { schema[key] = optional(schema[key]); } if (isStruct && struct2.type === "type") { return type(schema); } return object(schema); } function pick(struct2, keys2) { const { schema } = struct2; const subschema = {}; for (const key of keys2) { subschema[key] = schema[key]; } switch (struct2.type) { case "type": return type(subschema); default: return object(subschema); } } function struct(name2, validator) { console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."); return define2(name2, validator); } function any() { return define2("any", () => true); } function array(Element2) { return new Struct({ type: "array", schema: Element2, *entries(value) { if (Element2 && Array.isArray(value)) { for (const [i2, v2] of value.entries()) { yield [i2, v2, Element2]; } } }, coercer(value) { return Array.isArray(value) ? value.slice() : value; }, validator(value) { return Array.isArray(value) || `Expected an array value, but received: ${print(value)}`; } }); } function bigint() { return define2("bigint", (value) => { return typeof value === "bigint"; }); } function boolean() { return define2("boolean", (value) => { return typeof value === "boolean"; }); } function date() { return define2("date", (value) => { return value instanceof Date && !isNaN(value.getTime()) || `Expected a valid \`Date\` object, but received: ${print(value)}`; }); } function enums(values) { const schema = {}; const description = values.map((v2) => print(v2)).join(); for (const key of values) { schema[key] = key; } return new Struct({ type: "enums", schema, validator(value) { return values.includes(value) || `Expected one of \`${description}\`, but received: ${print(value)}`; } }); } function func() { return define2("func", (value) => { return typeof value === "function" || `Expected a function, but received: ${print(value)}`; }); } function instance(Class) { return define2("instance", (value) => { return value instanceof Class || `Expected a \`${Class.name}\` instance, but received: ${print(value)}`; }); } function integer() { return define2("integer", (value) => { return typeof value === "number" && !isNaN(value) && Number.isInteger(value) || `Expected an integer, but received: ${print(value)}`; }); } function intersection(Structs) { return new Struct({ type: "intersection", schema: null, *entries(value, ctx) { for (const S2 of Structs) { yield* S2.entries(value, ctx); } }, *validator(value, ctx) { for (const S2 of Structs) { yield* S2.validator(value, ctx); } }, *refiner(value, ctx) { for (const S2 of Structs) { yield* S2.refiner(value, ctx); } } }); } function literal(constant) { const description = print(constant); const t2 = typeof constant; return new Struct({ type: "literal", schema: t2 === "string" || t2 === "number" || t2 === "boolean" ? constant : null, validator(value) { return value === constant || `Expected the literal \`${description}\`, but received: ${print(value)}`; } }); } function map(Key, Value) { return new Struct({ type: "map", schema: null, *entries(value) { if (Key && Value && value instanceof Map) { for (const [k2, v2] of value.entries()) { yield [k2, k2, Key]; yield [k2, v2, Value]; } } }, coercer(value) { return value instanceof Map ? new Map(value) : value; }, validator(value) { return value instanceof Map || `Expected a \`Map\` object, but received: ${print(value)}`; } }); } function never() { return define2("never", () => false); } function nullable(struct2) { return new Struct({ ...struct2, validator: (value, ctx) => value === null || struct2.validator(value, ctx), refiner: (value, ctx) => value === null || struct2.refiner(value, ctx) }); } function number$1() { return define2("number", (value) => { return typeof value === "number" && !isNaN(value) || `Expected a number, but received: ${print(value)}`; }); } function object(schema) { const knowns = schema ? Object.keys(schema) : []; const Never = never(); return new Struct({ type: "object", schema: schema ? schema : null, *entries(value) { if (schema && isObject(value)) { const unknowns = new Set(Object.keys(value)); for (const key of knowns) { unknowns.delete(key); yield [key, value[key], schema[key]]; } for (const key of unknowns) { yield [key, value[key], Never]; } } }, validator(value) { return isObject(value) || `Expected an object, but received: ${print(value)}`; }, coercer(value) { return isObject(value) ? { ...value } : value; } }); } function optional(struct2) { return new Struct({ ...struct2, validator: (value, ctx) => value === void 0 || struct2.validator(value, ctx), refiner: (value, ctx) => value === void 0 || struct2.refiner(value, ctx) }); } function record(Key, Value) { return new Struct({ type: "record", schema: null, *entries(value) { if (isObject(value)) { for (const k2 in value) { const v2 = value[k2]; yield [k2, k2, Key]; yield [k2, v2, Value]; } } }, validator(value) { return isObject(value) || `Expected an object, but received: ${print(value)}`; } }); } function regexp() { return define2("regexp", (value) => { return value instanceof RegExp; }); } function set$2(Element2) { return new Struct({ type: "set", schema: null, *entries(value) { if (Element2 && value instanceof Set) { for (const v2 of value) { yield [v2, v2, Element2]; } } }, coercer(value) { return value instanceof Set ? new Set(value) : value; }, validator(value) { return value instanceof Set || `Expected a \`Set\` object, but received: ${print(value)}`; } }); } function string() { return define2("string", (value) => { return typeof value === "string" || `Expected a string, but received: ${print(value)}`; }); } function tuple(Structs) { const Never = never(); return new Struct({ type: "tuple", schema: null, *entries(value) { if (Array.isArray(value)) { const length = Math.max(Structs.length, value.length); for (let i2 = 0; i2 < length; i2++) { yield [i2, value[i2], Structs[i2] || Never]; } } }, validator(value) { return Array.isArray(value) || `Expected an array, but received: ${print(value)}`; } }); } function type(schema) { const keys2 = Object.keys(schema); return new Struct({ type: "type", schema, *entries(value) { if (isObject(value)) { for (const k2 of keys2) { yield [k2, value[k2], schema[k2]]; } } }, validator(value) { return isObject(value) || `Expected an object, but received: ${print(value)}`; }, coercer(value) { return isObject(value) ? { ...value } : value; } }); } function union(Structs) { const description = Structs.map((s2) => s2.type).join(" | "); return new Struct({ type: "union", schema: null, coercer(value) { for (const S2 of Structs) { const [error2, coerced] = S2.validate(value, { coerce: true }); if (!error2) { return coerced; } } return value; }, validator(value, ctx) { const failures = []; for (const S2 of Structs) { const [...tuples] = run(value, S2, ctx); const [first] = tuples; if (!first[0]) { return []; } else { for (const [failure] of tuples) { if (failure) { failures.push(failure); } } } } return [ `Expected the value to satisfy a union of \`${description}\`, but received: ${print(value)}`, ...failures ]; } }); } function unknown() { return define2("unknown", () => true); } function coerce$2(struct2, condition, coercer) { return new Struct({ ...struct2, coercer: (value, ctx) => { return is$1(value, condition) ? struct2.coercer(coercer(value, ctx), ctx) : struct2.coercer(value, ctx); } }); } function defaulted(struct2, fallback2, options = {}) { return coerce$2(struct2, unknown(), (x2) => { const f2 = typeof fallback2 === "function" ? fallback2() : fallback2; if (x2 === void 0) { return f2; } if (!options.strict && isPlainObject(x2) && isPlainObject(f2)) { const ret = { ...x2 }; let changed = false; for (const key in f2) { if (ret[key] === void 0) { ret[key] = f2[key]; changed = true; } } if (changed) { return ret; } } return x2; }); } function trimmed(struct2) { return coerce$2(struct2, string(), (x2) => x2.trim()); } function empty(struct2) { return refine(struct2, "empty", (value) => { const size2 = getSize(value); return size2 === 0 || `Expected an empty ${struct2.type} but received one with a size of \`${size2}\``; }); } function getSize(value) { if (value instanceof Map || value instanceof Set) { return value.size; } else { return value.length; } } function max(struct2, threshold, options = {}) { const { exclusive } = options; return refine(struct2, "max", (value) => { return exclusive ? value < threshold : value <= threshold || `Expected a ${struct2.type} less than ${exclusive ? "" : "or equal to "}${threshold} but received \`${value}\``; }); } function min(struct2, threshold, options = {}) { const { exclusive } = options; return refine(struct2, "min", (value) => { return exclusive ? value > threshold : value >= threshold || `Expected a ${struct2.type} greater than ${exclusive ? "" : "or equal to "}${threshold} but received \`${value}\``; }); } function nonempty(struct2) { return refine(struct2, "nonempty", (value) => { const size2 = getSize(value); return size2 > 0 || `Expected a nonempty ${struct2.type} but received an empty one`; }); } function pattern(struct2, regexp2) { return refine(struct2, "pattern", (value) => { return regexp2.test(value) || `Expected a ${struct2.type} matching \`/${regexp2.source}/\` but received "${value}"`; }); } function size(struct2, min2, max2 = min2) { const expected = `Expected a ${struct2.type}`; const of = min2 === max2 ? `of \`${min2}\`` : `between \`${min2}\` and \`${max2}\``; return refine(struct2, "size", (value) => { if (typeof value === "number" || value instanceof Date) { return min2 <= value && value <= max2 || `${expected} ${of} but received \`${value}\``; } else if (value instanceof Map || value instanceof Set) { const { size: size2 } = value; return min2 <= size2 && size2 <= max2 || `${expected} with a size ${of} but received one with a size of \`${size2}\``; } else { const { length } = value; return min2 <= length && length <= max2 || `${expected} with a length ${of} but received one with a length of \`${length}\``; } }); } function refine(struct2, name2, refiner) { return new Struct({ ...struct2, *refiner(value, ctx) { yield* struct2.refiner(value, ctx); const result = refiner(value, ctx); const failures = toFailures(result, ctx, struct2, value); for (const failure of failures) { yield { ...failure, refinement: name2 }; } } }); } const dist$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, Struct, StructError, any, array, assert: assert$1, assign, bigint, boolean, coerce: coerce$2, create, date, defaulted, define: define2, deprecated, dynamic, empty, enums, func, instance, integer, intersection, is: is$1, lazy, literal, map, mask, max, min, never, nonempty, nullable, number: number$1, object, omit, optional, partial, pattern, pick, record, refine, regexp, set: set$2, size, string, struct, trimmed, tuple, type, union, unknown, validate }, Symbol.toStringTag, { value: "Module" })); const require$$1 = /* @__PURE__ */ getAugmentedNamespace(dist$2); Object.defineProperty(assert$2, "__esModule", { value: true }); assert$2.assertExhaustive = assert$2.assertStruct = assert$2.assert = assert$2.AssertionError = void 0; const superstruct_1$3 = require$$1; function isErrorWithMessage(error2) { return typeof error2 === "object" && error2 !== null && "message" in error2; } function isConstructable(fn2) { var _a2, _b2; return Boolean(typeof ((_b2 = (_a2 = fn2 === null || fn2 === void 0 ? void 0 : fn2.prototype) === null || _a2 === void 0 ? void 0 : _a2.constructor) === null || _b2 === void 0 ? void 0 : _b2.name) === "string"); } function getErrorMessage(error2) { const message = isErrorWithMessage(error2) ? error2.message : String(error2); if (message.endsWith(".")) { return message.slice(0, -1); } return message; } function getError$1(ErrorWrapper, message) { if (isConstructable(ErrorWrapper)) { return new ErrorWrapper({ message }); } return ErrorWrapper({ message }); } class AssertionError extends Error { constructor(options) { super(options.message); this.code = "ERR_ASSERTION"; } } assert$2.AssertionError = AssertionError; function assert(value, message = "Assertion failed.", ErrorWrapper = AssertionError) { if (!value) { if (message instanceof Error) { throw message; } throw getError$1(ErrorWrapper, message); } } assert$2.assert = assert; function assertStruct(value, struct2, errorPrefix = "Assertion failed", ErrorWrapper = AssertionError) { try { (0, superstruct_1$3.assert)(value, struct2); } catch (error2) { throw getError$1(ErrorWrapper, `${errorPrefix}: ${getErrorMessage(error2)}.`); } } assert$2.assertStruct = assertStruct; function assertExhaustive(_object) { throw new Error("Invalid branch reached. Should be detected during compilation."); } assert$2.assertExhaustive = assertExhaustive; var base64$1 = {}; Object.defineProperty(base64$1, "__esModule", { value: true }); base64$1.base64 = void 0; const superstruct_1$2 = require$$1; const assert_1$3 = assert$2; const base64 = (struct2, options = {}) => { var _a2, _b2; const paddingRequired = (_a2 = options.paddingRequired) !== null && _a2 !== void 0 ? _a2 : false; const characterSet = (_b2 = options.characterSet) !== null && _b2 !== void 0 ? _b2 : "base64"; let letters; if (characterSet === "base64") { letters = String.raw`[A-Za-z0-9+\/]`; } else { (0, assert_1$3.assert)(characterSet === "base64url"); letters = String.raw`[-_A-Za-z0-9]`; } let re2; if (paddingRequired) { re2 = new RegExp(`^(?:${letters}{4})*(?:${letters}{3}=|${letters}{2}==)?$`, "u"); } else { re2 = new RegExp(`^(?:${letters}{4})*(?:${letters}{2,3}|${letters}{3}=|${letters}{2}==)?$`, "u"); } return (0, superstruct_1$2.pattern)(struct2, re2); }; base64$1.base64 = base64; var bytes = {}; var hex = {}; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.remove0x = exports3.add0x = exports3.assertIsStrictHexString = exports3.assertIsHexString = exports3.isStrictHexString = exports3.isHexString = exports3.StrictHexStruct = exports3.HexStruct = void 0; const superstruct_12 = require$$1; const assert_12 = assert$2; exports3.HexStruct = (0, superstruct_12.pattern)((0, superstruct_12.string)(), /^(?:0x)?[0-9a-f]+$/iu); exports3.StrictHexStruct = (0, superstruct_12.pattern)((0, superstruct_12.string)(), /^0x[0-9a-f]+$/iu); function isHexString2(value) { return (0, superstruct_12.is)(value, exports3.HexStruct); } exports3.isHexString = isHexString2; function isStrictHexString(value) { return (0, superstruct_12.is)(value, exports3.StrictHexStruct); } exports3.isStrictHexString = isStrictHexString; function assertIsHexString(value) { (0, assert_12.assert)(isHexString2(value), "Value must be a hexadecimal string."); } exports3.assertIsHexString = assertIsHexString; function assertIsStrictHexString(value) { (0, assert_12.assert)(isStrictHexString(value), 'Value must be a hexadecimal string, starting with "0x".'); } exports3.assertIsStrictHexString = assertIsStrictHexString; function add0x(hexadecimal) { if (hexadecimal.startsWith("0x")) { return hexadecimal; } if (hexadecimal.startsWith("0X")) { return `0x${hexadecimal.substring(2)}`; } return `0x${hexadecimal}`; } exports3.add0x = add0x; function remove0x(hexadecimal) { if (hexadecimal.startsWith("0x") || hexadecimal.startsWith("0X")) { return hexadecimal.substring(2); } return hexadecimal; } exports3.remove0x = remove0x; })(hex); Object.defineProperty(bytes, "__esModule", { value: true }); bytes.createDataView = bytes.concatBytes = bytes.valueToBytes = bytes.stringToBytes = bytes.numberToBytes = bytes.signedBigIntToBytes = bytes.bigIntToBytes = bytes.hexToBytes = bytes.bytesToString = bytes.bytesToNumber = bytes.bytesToSignedBigInt = bytes.bytesToBigInt = bytes.bytesToHex = bytes.assertIsBytes = bytes.isBytes = void 0; const assert_1$2 = assert$2; const hex_1$2 = hex; const HEX_MINIMUM_NUMBER_CHARACTER = 48; const HEX_MAXIMUM_NUMBER_CHARACTER = 58; const HEX_CHARACTER_OFFSET = 87; function getPrecomputedHexValuesBuilder() { const lookupTable = []; return () => { if (lookupTable.length === 0) { for (let i2 = 0; i2 < 256; i2++) { lookupTable.push(i2.toString(16).padStart(2, "0")); } } return lookupTable; }; } const getPrecomputedHexValues = getPrecomputedHexValuesBuilder(); function isBytes(value) { return value instanceof Uint8Array; } bytes.isBytes = isBytes; function assertIsBytes(value) { (0, assert_1$2.assert)(isBytes(value), "Value must be a Uint8Array."); } bytes.assertIsBytes = assertIsBytes; function bytesToHex(bytes2) { assertIsBytes(bytes2); if (bytes2.length === 0) { return "0x"; } const lookupTable = getPrecomputedHexValues(); const hexadecimal = new Array(bytes2.length); for (let i2 = 0; i2 < bytes2.length; i2++) { hexadecimal[i2] = lookupTable[bytes2[i2]]; } return (0, hex_1$2.add0x)(hexadecimal.join("")); } bytes.bytesToHex = bytesToHex; function bytesToBigInt(bytes2) { assertIsBytes(bytes2); const hexadecimal = bytesToHex(bytes2); return BigInt(hexadecimal); } bytes.bytesToBigInt = bytesToBigInt; function bytesToSignedBigInt(bytes2) { assertIsBytes(bytes2); let value = BigInt(0); for (const byte2 of bytes2) { value = (value << BigInt(8)) + BigInt(byte2); } return BigInt.asIntN(bytes2.length * 8, value); } bytes.bytesToSignedBigInt = bytesToSignedBigInt; function bytesToNumber(bytes2) { assertIsBytes(bytes2); const bigint2 = bytesToBigInt(bytes2); (0, assert_1$2.assert)(bigint2 <= BigInt(Number.MAX_SAFE_INTEGER), "Number is not a safe integer. Use `bytesToBigInt` instead."); return Number(bigint2); } bytes.bytesToNumber = bytesToNumber; function bytesToString(bytes2) { assertIsBytes(bytes2); return new TextDecoder().decode(bytes2); } bytes.bytesToString = bytesToString; function hexToBytes(value) { var _a2; if (((_a2 = value === null || value === void 0 ? void 0 : value.toLowerCase) === null || _a2 === void 0 ? void 0 : _a2.call(value)) === "0x") { return new Uint8Array(); } (0, hex_1$2.assertIsHexString)(value); const strippedValue = (0, hex_1$2.remove0x)(value).toLowerCase(); const normalizedValue = strippedValue.length % 2 === 0 ? strippedValue : `0${strippedValue}`; const bytes2 = new Uint8Array(normalizedValue.length / 2); for (let i2 = 0; i2 < bytes2.length; i2++) { const c1 = normalizedValue.charCodeAt(i2 * 2); const c2 = normalizedValue.charCodeAt(i2 * 2 + 1); const n1 = c1 - (c1 < HEX_MAXIMUM_NUMBER_CHARACTER ? HEX_MINIMUM_NUMBER_CHARACTER : HEX_CHARACTER_OFFSET); const n2 = c2 - (c2 < HEX_MAXIMUM_NUMBER_CHARACTER ? HEX_MINIMUM_NUMBER_CHARACTER : HEX_CHARACTER_OFFSET); bytes2[i2] = n1 * 16 + n2; } return bytes2; } bytes.hexToBytes = hexToBytes; function bigIntToBytes(value) { (0, assert_1$2.assert)(typeof value === "bigint", "Value must be a bigint."); (0, assert_1$2.assert)(value >= BigInt(0), "Value must be a non-negative bigint."); const hexadecimal = value.toString(16); return hexToBytes(hexadecimal); } bytes.bigIntToBytes = bigIntToBytes; function bigIntFits(value, bytes2) { (0, assert_1$2.assert)(bytes2 > 0); const mask2 = value >> BigInt(31); return !((~value & mask2) + (value & ~mask2) >> BigInt(bytes2 * 8 + ~0)); } function signedBigIntToBytes(value, byteLength2) { (0, assert_1$2.assert)(typeof value === "bigint", "Value must be a bigint."); (0, assert_1$2.assert)(typeof byteLength2 === "number", "Byte length must be a number."); (0, assert_1$2.assert)(byteLength2 > 0, "Byte length must be greater than 0."); (0, assert_1$2.assert)(bigIntFits(value, byteLength2), "Byte length is too small to represent the given value."); let numberValue = value; const bytes2 = new Uint8Array(byteLength2); for (let i2 = 0; i2 < bytes2.length; i2++) { bytes2[i2] = Number(BigInt.asUintN(8, numberValue)); numberValue >>= BigInt(8); } return bytes2.reverse(); } bytes.signedBigIntToBytes = signedBigIntToBytes; function numberToBytes(value) { (0, assert_1$2.assert)(typeof value === "number", "Value must be a number."); (0, assert_1$2.assert)(value >= 0, "Value must be a non-negative number."); (0, assert_1$2.assert)(Number.isSafeInteger(value), "Value is not a safe integer. Use `bigIntToBytes` instead."); const hexadecimal = value.toString(16); return hexToBytes(hexadecimal); } bytes.numberToBytes = numberToBytes; function stringToBytes(value) { (0, assert_1$2.assert)(typeof value === "string", "Value must be a string."); return new TextEncoder().encode(value); } bytes.stringToBytes = stringToBytes; function valueToBytes(value) { if (typeof value === "bigint") { return bigIntToBytes(value); } if (typeof value === "number") { return numberToBytes(value); } if (typeof value === "string") { if (value.startsWith("0x")) { return hexToBytes(value); } return stringToBytes(value); } if (isBytes(value)) { return value; } throw new TypeError(`Unsupported value type: "${typeof value}".`); } bytes.valueToBytes = valueToBytes; function concatBytes(values) { const normalizedValues = new Array(values.length); let byteLength2 = 0; for (let i2 = 0; i2 < values.length; i2++) { const value = valueToBytes(values[i2]); normalizedValues[i2] = value; byteLength2 += value.length; } const bytes2 = new Uint8Array(byteLength2); for (let i2 = 0, offset = 0; i2 < normalizedValues.length; i2++) { bytes2.set(normalizedValues[i2], offset); offset += normalizedValues[i2].length; } return bytes2; } bytes.concatBytes = concatBytes; function createDataView(bytes2) { if (typeof Buffer !== "undefined" && bytes2 instanceof Buffer) { const buffer2 = bytes2.buffer.slice(bytes2.byteOffset, bytes2.byteOffset + bytes2.byteLength); return new DataView(buffer2); } return new DataView(bytes2.buffer, bytes2.byteOffset, bytes2.byteLength); } bytes.createDataView = createDataView; var checksum = {}; Object.defineProperty(checksum, "__esModule", { value: true }); checksum.ChecksumStruct = void 0; const superstruct_1$1 = require$$1; const base64_1 = base64$1; checksum.ChecksumStruct = (0, superstruct_1$1.size)((0, base64_1.base64)((0, superstruct_1$1.string)(), { paddingRequired: true }), 44, 44); var coercers = {}; Object.defineProperty(coercers, "__esModule", { value: true }); coercers.createHex = coercers.createBytes = coercers.createBigInt = coercers.createNumber = void 0; const superstruct_1 = require$$1; const assert_1$1 = assert$2; const bytes_1 = bytes; const hex_1$1 = hex; const NumberLikeStruct = (0, superstruct_1.union)([(0, superstruct_1.number)(), (0, superstruct_1.bigint)(), (0, superstruct_1.string)(), hex_1$1.StrictHexStruct]); const NumberCoercer = (0, superstruct_1.coerce)((0, superstruct_1.number)(), NumberLikeStruct, Number); const BigIntCoercer = (0, superstruct_1.coerce)((0, superstruct_1.bigint)(), NumberLikeStruct, BigInt); (0, superstruct_1.union)([hex_1$1.StrictHexStruct, (0, superstruct_1.instance)(Uint8Array)]); const BytesCoercer = (0, superstruct_1.coerce)((0, superstruct_1.instance)(Uint8Array), (0, superstruct_1.union)([hex_1$1.StrictHexStruct]), bytes_1.hexToBytes); const HexCoercer = (0, superstruct_1.coerce)(hex_1$1.StrictHexStruct, (0, superstruct_1.instance)(Uint8Array), bytes_1.bytesToHex); function createNumber(value) { try { const result = (0, superstruct_1.create)(value, NumberCoercer); (0, assert_1$1.assert)(Number.isFinite(result), `Expected a number-like value, got "${value}".`); return result; } catch (error2) { if (error2 instanceof superstruct_1.StructError) { throw new Error(`Expected a number-like value, got "${value}".`); } throw error2; } } coercers.createNumber = createNumber; function createBigInt(value) { try { return (0, superstruct_1.create)(value, BigIntCoercer); } catch (error2) { if (error2 instanceof superstruct_1.StructError) { throw new Error(`Expected a number-like value, got "${String(error2.value)}".`); } throw error2; } } coercers.createBigInt = createBigInt; function createBytes(value) { if (typeof value === "string" && value.toLowerCase() === "0x") { return new Uint8Array(); } try { return (0, superstruct_1.create)(value, BytesCoercer); } catch (error2) { if (error2 instanceof superstruct_1.StructError) { throw new Error(`Expected a bytes-like value, got "${String(error2.value)}".`); } throw error2; } } coercers.createBytes = createBytes; function createHex(value) { if (value instanceof Uint8Array && value.length === 0 || typeof value === "string" && value.toLowerCase() === "0x") { return "0x"; } try { return (0, superstruct_1.create)(value, HexCoercer); } catch (error2) { if (error2 instanceof superstruct_1.StructError) { throw new Error(`Expected a bytes-like value, got "${String(error2.value)}".`); } throw error2; } } coercers.createHex = createHex; var collections = {}; var __classPrivateFieldSet$1 = commonjsGlobal && commonjsGlobal.__classPrivateFieldSet || function(receiver, state2, value, kind, f2) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f2) throw new TypeError("Private accessor was defined without a setter"); if (typeof state2 === "function" ? receiver !== state2 || !f2 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return kind === "a" ? f2.call(receiver, value) : f2 ? f2.value = value : state2.set(receiver, value), value; }; var __classPrivateFieldGet$1 = commonjsGlobal && commonjsGlobal.__classPrivateFieldGet || function(receiver, state2, kind, f2) { if (kind === "a" && !f2) throw new TypeError("Private accessor was defined without a getter"); if (typeof state2 === "function" ? receiver !== state2 || !f2 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f2 : kind === "a" ? f2.call(receiver) : f2 ? f2.value : state2.get(receiver); }; var _FrozenMap_map, _FrozenSet_set; Object.defineProperty(collections, "__esModule", { value: true }); collections.FrozenSet = collections.FrozenMap = void 0; class FrozenMap { constructor(entries2) { _FrozenMap_map.set(this, void 0); __classPrivateFieldSet$1(this, _FrozenMap_map, new Map(entries2), "f"); Object.freeze(this); } get size() { return __classPrivateFieldGet$1(this, _FrozenMap_map, "f").size; } [(_FrozenMap_map = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() { return __classPrivateFieldGet$1(this, _FrozenMap_map, "f")[Symbol.iterator](); } entries() { return __classPrivateFieldGet$1(this, _FrozenMap_map, "f").entries(); } forEach(callbackfn, thisArg) { return __classPrivateFieldGet$1(this, _FrozenMap_map, "f").forEach((value, key, _map) => callbackfn.call(thisArg, value, key, this)); } get(key) { return __classPrivateFieldGet$1(this, _FrozenMap_map, "f").get(key); } has(key) { return __classPrivateFieldGet$1(this, _FrozenMap_map, "f").has(key); } keys() { return __classPrivateFieldGet$1(this, _FrozenMap_map, "f").keys(); } values() { return __classPrivateFieldGet$1(this, _FrozenMap_map, "f").values(); } toString() { return `FrozenMap(${this.size}) {${this.size > 0 ? ` ${[...this.entries()].map(([key, value]) => `${String(key)} => ${String(value)}`).join(", ")} ` : ""}}`; } } collections.FrozenMap = FrozenMap; class FrozenSet { constructor(values) { _FrozenSet_set.set(this, void 0); __classPrivateFieldSet$1(this, _FrozenSet_set, new Set(values), "f"); Object.freeze(this); } get size() { return __classPrivateFieldGet$1(this, _FrozenSet_set, "f").size; } [(_FrozenSet_set = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() { return __classPrivateFieldGet$1(this, _FrozenSet_set, "f")[Symbol.iterator](); } entries() { return __classPrivateFieldGet$1(this, _FrozenSet_set, "f").entries(); } forEach(callbackfn, thisArg) { return __classPrivateFieldGet$1(this, _FrozenSet_set, "f").forEach((value, value2, _set) => callbackfn.call(thisArg, value, value2, this)); } has(value) { return __classPrivateFieldGet$1(this, _FrozenSet_set, "f").has(value); } keys() { return __classPrivateFieldGet$1(this, _FrozenSet_set, "f").keys(); } values() { return __classPrivateFieldGet$1(this, _FrozenSet_set, "f").values(); } toString() { return `FrozenSet(${this.size}) {${this.size > 0 ? ` ${[...this.values()].map((member) => String(member)).join(", ")} ` : ""}}`; } } collections.FrozenSet = FrozenSet; Object.freeze(FrozenMap); Object.freeze(FrozenMap.prototype); Object.freeze(FrozenSet); Object.freeze(FrozenSet.prototype); var encryptionTypes = {}; Object.defineProperty(encryptionTypes, "__esModule", { value: true }); var json = {}; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.getJsonRpcIdValidator = exports3.assertIsJsonRpcError = exports3.isJsonRpcError = exports3.assertIsJsonRpcFailure = exports3.isJsonRpcFailure = exports3.assertIsJsonRpcSuccess = exports3.isJsonRpcSuccess = exports3.assertIsJsonRpcResponse = exports3.isJsonRpcResponse = exports3.assertIsPendingJsonRpcResponse = exports3.isPendingJsonRpcResponse = exports3.JsonRpcResponseStruct = exports3.JsonRpcFailureStruct = exports3.JsonRpcSuccessStruct = exports3.PendingJsonRpcResponseStruct = exports3.assertIsJsonRpcRequest = exports3.isJsonRpcRequest = exports3.assertIsJsonRpcNotification = exports3.isJsonRpcNotification = exports3.JsonRpcNotificationStruct = exports3.JsonRpcRequestStruct = exports3.JsonRpcParamsStruct = exports3.JsonRpcErrorStruct = exports3.JsonRpcIdStruct = exports3.JsonRpcVersionStruct = exports3.jsonrpc2 = exports3.getJsonSize = exports3.isValidJson = exports3.JsonStruct = exports3.UnsafeJsonStruct = void 0; const superstruct_12 = require$$1; const assert_12 = assert$2; const finiteNumber = () => (0, superstruct_12.define)("finite number", (value) => { return (0, superstruct_12.is)(value, (0, superstruct_12.number)()) && Number.isFinite(value); }); exports3.UnsafeJsonStruct = (0, superstruct_12.union)([ (0, superstruct_12.literal)(null), (0, superstruct_12.boolean)(), finiteNumber(), (0, superstruct_12.string)(), (0, superstruct_12.array)((0, superstruct_12.lazy)(() => exports3.UnsafeJsonStruct)), (0, superstruct_12.record)((0, superstruct_12.string)(), (0, superstruct_12.lazy)(() => exports3.UnsafeJsonStruct)) ]); exports3.JsonStruct = (0, superstruct_12.define)("Json", (value, context) => { function checkStruct(innerValue, struct2) { const iterator = struct2.validator(innerValue, context); const errors2 = [...iterator]; if (errors2.length > 0) { return errors2; } return true; } try { const unsafeResult = checkStruct(value, exports3.UnsafeJsonStruct); if (unsafeResult !== true) { return unsafeResult; } return checkStruct(JSON.parse(JSON.stringify(value)), exports3.UnsafeJsonStruct); } catch (error2) { if (error2 instanceof RangeError) { return "Circular reference detected"; } return false; } }); function isValidJson(value) { return (0, superstruct_12.is)(value, exports3.JsonStruct); } exports3.isValidJson = isValidJson; function getJsonSize(value) { (0, assert_12.assertStruct)(value, exports3.JsonStruct, "Invalid JSON value"); const json2 = JSON.stringify(value); return new TextEncoder().encode(json2).byteLength; } exports3.getJsonSize = getJsonSize; exports3.jsonrpc2 = "2.0"; exports3.JsonRpcVersionStruct = (0, superstruct_12.literal)(exports3.jsonrpc2); exports3.JsonRpcIdStruct = (0, superstruct_12.nullable)((0, superstruct_12.union)([(0, superstruct_12.number)(), (0, superstruct_12.string)()])); exports3.JsonRpcErrorStruct = (0, superstruct_12.object)({ code: (0, superstruct_12.integer)(), message: (0, superstruct_12.string)(), data: (0, superstruct_12.optional)(exports3.JsonStruct), stack: (0, superstruct_12.optional)((0, superstruct_12.string)()) }); exports3.JsonRpcParamsStruct = (0, superstruct_12.optional)((0, superstruct_12.union)([(0, superstruct_12.record)((0, superstruct_12.string)(), exports3.JsonStruct), (0, superstruct_12.array)(exports3.JsonStruct)])); exports3.JsonRpcRequestStruct = (0, superstruct_12.object)({ id: exports3.JsonRpcIdStruct, jsonrpc: exports3.JsonRpcVersionStruct, method: (0, superstruct_12.string)(), params: exports3.JsonRpcParamsStruct }); exports3.JsonRpcNotificationStruct = (0, superstruct_12.omit)(exports3.JsonRpcRequestStruct, ["id"]); function isJsonRpcNotification(value) { return (0, superstruct_12.is)(value, exports3.JsonRpcNotificationStruct); } exports3.isJsonRpcNotification = isJsonRpcNotification; function assertIsJsonRpcNotification(value, ErrorWrapper) { (0, assert_12.assertStruct)(value, exports3.JsonRpcNotificationStruct, "Invalid JSON-RPC notification", ErrorWrapper); } exports3.assertIsJsonRpcNotification = assertIsJsonRpcNotification; function isJsonRpcRequest2(value) { return (0, superstruct_12.is)(value, exports3.JsonRpcRequestStruct); } exports3.isJsonRpcRequest = isJsonRpcRequest2; function assertIsJsonRpcRequest(value, ErrorWrapper) { (0, assert_12.assertStruct)(value, exports3.JsonRpcRequestStruct, "Invalid JSON-RPC request", ErrorWrapper); } exports3.assertIsJsonRpcRequest = assertIsJsonRpcRequest; exports3.PendingJsonRpcResponseStruct = (0, superstruct_12.object)({ id: exports3.JsonRpcIdStruct, jsonrpc: exports3.JsonRpcVersionStruct, result: (0, superstruct_12.optional)((0, superstruct_12.unknown)()), error: (0, superstruct_12.optional)(exports3.JsonRpcErrorStruct) }); exports3.JsonRpcSuccessStruct = (0, superstruct_12.object)({ id: exports3.JsonRpcIdStruct, jsonrpc: exports3.JsonRpcVersionStruct, result: exports3.JsonStruct }); exports3.JsonRpcFailureStruct = (0, superstruct_12.object)({ id: exports3.JsonRpcIdStruct, jsonrpc: exports3.JsonRpcVersionStruct, error: exports3.JsonRpcErrorStruct }); exports3.JsonRpcResponseStruct = (0, superstruct_12.union)([ exports3.JsonRpcSuccessStruct, exports3.JsonRpcFailureStruct ]); function isPendingJsonRpcResponse(response) { return (0, superstruct_12.is)(response, exports3.PendingJsonRpcResponseStruct); } exports3.isPendingJsonRpcResponse = isPendingJsonRpcResponse; function assertIsPendingJsonRpcResponse(response, ErrorWrapper) { (0, assert_12.assertStruct)(response, exports3.PendingJsonRpcResponseStruct, "Invalid pending JSON-RPC response", ErrorWrapper); } exports3.assertIsPendingJsonRpcResponse = assertIsPendingJsonRpcResponse; function isJsonRpcResponse2(response) { return (0, superstruct_12.is)(response, exports3.JsonRpcResponseStruct); } exports3.isJsonRpcResponse = isJsonRpcResponse2; function assertIsJsonRpcResponse(value, ErrorWrapper) { (0, assert_12.assertStruct)(value, exports3.JsonRpcResponseStruct, "Invalid JSON-RPC response", ErrorWrapper); } exports3.assertIsJsonRpcResponse = assertIsJsonRpcResponse; function isJsonRpcSuccess(value) { return (0, superstruct_12.is)(value, exports3.JsonRpcSuccessStruct); } exports3.isJsonRpcSuccess = isJsonRpcSuccess; function assertIsJsonRpcSuccess(value, ErrorWrapper) { (0, assert_12.assertStruct)(value, exports3.JsonRpcSuccessStruct, "Invalid JSON-RPC success response", ErrorWrapper); } exports3.assertIsJsonRpcSuccess = assertIsJsonRpcSuccess; function isJsonRpcFailure(value) { return (0, superstruct_12.is)(value, exports3.JsonRpcFailureStruct); } exports3.isJsonRpcFailure = isJsonRpcFailure; function assertIsJsonRpcFailure(value, ErrorWrapper) { (0, assert_12.assertStruct)(value, exports3.JsonRpcFailureStruct, "Invalid JSON-RPC failure response", ErrorWrapper); } exports3.assertIsJsonRpcFailure = assertIsJsonRpcFailure; function isJsonRpcError2(value) { return (0, superstruct_12.is)(value, exports3.JsonRpcErrorStruct); } exports3.isJsonRpcError = isJsonRpcError2; function assertIsJsonRpcError(value, ErrorWrapper) { (0, assert_12.assertStruct)(value, exports3.JsonRpcErrorStruct, "Invalid JSON-RPC error", ErrorWrapper); } exports3.assertIsJsonRpcError = assertIsJsonRpcError; function getJsonRpcIdValidator(options) { const { permitEmptyString, permitFractions, permitNull } = Object.assign({ permitEmptyString: true, permitFractions: false, permitNull: true }, options); const isValidJsonRpcId = (id2) => { return Boolean(typeof id2 === "number" && (permitFractions || Number.isInteger(id2)) || typeof id2 === "string" && (permitEmptyString || id2.length > 0) || permitNull && id2 === null); }; return isValidJsonRpcId; } exports3.getJsonRpcIdValidator = getJsonRpcIdValidator; })(json); var keyring = {}; Object.defineProperty(keyring, "__esModule", { value: true }); var logging = {}; var browser$2 = { exports: {} }; var ms$1; var hasRequiredMs; function requireMs() { if (hasRequiredMs) return ms$1; hasRequiredMs = 1; var s2 = 1e3; var m2 = s2 * 60; var h2 = m2 * 60; var d2 = h2 * 24; var w2 = d2 * 7; var y2 = d2 * 365.25; ms$1 = function(val, options) { options = options || {}; var type2 = typeof val; if (type2 === "string" && val.length > 0) { return parse2(val); } else if (type2 === "number" && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) ); }; function parse2(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n2 = parseFloat(match[1]); var type2 = (match[2] || "ms").toLowerCase(); switch (type2) { case "years": case "year": case "yrs": case "yr": case "y": return n2 * y2; case "weeks": case "week": case "w": return n2 * w2; case "days": case "day": case "d": return n2 * d2; case "hours": case "hour": case "hrs": case "hr": case "h": return n2 * h2; case "minutes": case "minute": case "mins": case "min": case "m": return n2 * m2; case "seconds": case "second": case "secs": case "sec": case "s": return n2 * s2; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": return n2; default: return void 0; } } function fmtShort(ms2) { var msAbs = Math.abs(ms2); if (msAbs >= d2) { return Math.round(ms2 / d2) + "d"; } if (msAbs >= h2) { return Math.round(ms2 / h2) + "h"; } if (msAbs >= m2) { return Math.round(ms2 / m2) + "m"; } if (msAbs >= s2) { return Math.round(ms2 / s2) + "s"; } return ms2 + "ms"; } function fmtLong(ms2) { var msAbs = Math.abs(ms2); if (msAbs >= d2) { return plural(ms2, msAbs, d2, "day"); } if (msAbs >= h2) { return plural(ms2, msAbs, h2, "hour"); } if (msAbs >= m2) { return plural(ms2, msAbs, m2, "minute"); } if (msAbs >= s2) { return plural(ms2, msAbs, s2, "second"); } return ms2 + " ms"; } function plural(ms2, msAbs, n2, name2) { var isPlural = msAbs >= n2 * 1.5; return Math.round(ms2 / n2) + " " + name2 + (isPlural ? "s" : ""); } return ms$1; } function setup(env2) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce2; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = requireMs(); createDebug.destroy = destroy2; Object.keys(env2).forEach((key) => { createDebug[key] = env2[key]; }); createDebug.names = []; createDebug.skips = []; createDebug.formatters = {}; function selectColor(namespace) { let hash2 = 0; for (let i2 = 0; i2 < namespace.length; i2++) { hash2 = (hash2 << 5) - hash2 + namespace.charCodeAt(i2); hash2 |= 0; } return createDebug.colors[Math.abs(hash2) % createDebug.colors.length]; } createDebug.selectColor = selectColor; function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug2(...args) { if (!debug2.enabled) { return; } const self2 = debug2; const curr = Number(/* @__PURE__ */ new Date()); const ms2 = curr - (prevTime || curr); self2.diff = ms2; self2.prev = prevTime; self2.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== "string") { args.unshift("%O"); } let index2 = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format2) => { if (match === "%%") { return "%"; } index2++; const formatter = createDebug.formatters[format2]; if (typeof formatter === "function") { const val = args[index2]; match = formatter.call(self2, val); args.splice(index2, 1); index2--; } return match; }); createDebug.formatArgs.call(self2, args); const logFn = self2.log || createDebug.log; logFn.apply(self2, args); } debug2.namespace = namespace; debug2.useColors = createDebug.useColors(); debug2.color = createDebug.selectColor(namespace); debug2.extend = extend2; debug2.destroy = createDebug.destroy; Object.defineProperty(debug2, "enabled", { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug.namespaces) { namespacesCache = createDebug.namespaces; enabledCache = createDebug.enabled(namespace); } return enabledCache; }, set: (v2) => { enableOverride = v2; } }); if (typeof createDebug.init === "function") { createDebug.init(debug2); } return debug2; } function extend2(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); newDebug.log = this.log; return newDebug; } function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; let i2; const split2 = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); const len2 = split2.length; for (i2 = 0; i2 < len2; i2++) { if (!split2[i2]) { continue; } namespaces = split2[i2].replace(/\*/g, ".*?"); if (namespaces[0] === "-") { createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")); } else { createDebug.names.push(new RegExp("^" + namespaces + "$")); } } } function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace) ].join(","); createDebug.enable(""); return namespaces; } function enabled(name2) { if (name2[name2.length - 1] === "*") { return true; } let i2; let len2; for (i2 = 0, len2 = createDebug.skips.length; i2 < len2; i2++) { if (createDebug.skips[i2].test(name2)) { return false; } } for (i2 = 0, len2 = createDebug.names.length; i2 < len2; i2++) { if (createDebug.names[i2].test(name2)) { return true; } } return false; } function toNamespace(regexp2) { return regexp2.toString().substring(2, regexp2.toString().length - 2).replace(/\.\*\?$/, "*"); } function coerce2(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } function destroy2() { console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } createDebug.enable(createDebug.load()); return createDebug; } var common = setup; (function(module2, exports3) { exports3.formatArgs = formatArgs; exports3.save = save; exports3.load = load; exports3.useColors = useColors; exports3.storage = localstorage(); exports3.destroy = (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } }; })(); exports3.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 useColors() { if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { return true; } if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } function formatArgs(args) { args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); if (!this.useColors) { return; } const c2 = "color: " + this.color; args.splice(1, 0, c2, "color: inherit"); let index2 = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, (match) => { if (match === "%%") { return; } index2++; if (match === "%c") { lastC = index2; } }); args.splice(lastC, 0, c2); } exports3.log = console.debug || console.log || (() => { }); function save(namespaces) { try { if (namespaces) { exports3.storage.setItem("debug", namespaces); } else { exports3.storage.removeItem("debug"); } } catch (error2) { } } function load() { let r2; try { r2 = exports3.storage.getItem("debug"); } catch (error2) { } if (!r2 && typeof process !== "undefined" && "env" in process) { r2 = process.env.DEBUG; } return r2; } function localstorage() { try { return localStorage; } catch (error2) { } } module2.exports = common(exports3); const { formatters } = module2.exports; formatters.j = function(v2) { try { return JSON.stringify(v2); } catch (error2) { return "[UnexpectedJSONParseError]: " + error2.message; } }; })(browser$2, browser$2.exports); var browserExports = browser$2.exports; var __importDefault$5 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(logging, "__esModule", { value: true }); logging.createModuleLogger = logging.createProjectLogger = void 0; const debug_1$1 = __importDefault$5(browserExports); const globalLogger = (0, debug_1$1.default)("metamask"); function createProjectLogger(projectName) { return globalLogger.extend(projectName); } logging.createProjectLogger = createProjectLogger; function createModuleLogger(projectLogger, moduleName) { return projectLogger.extend(moduleName); } logging.createModuleLogger = createModuleLogger; var misc = {}; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.calculateNumberSize = exports3.calculateStringSize = exports3.isASCII = exports3.isPlainObject = exports3.ESCAPE_CHARACTERS_REGEXP = exports3.JsonSize = exports3.hasProperty = exports3.isObject = exports3.isNullOrUndefined = exports3.isNonEmptyArray = void 0; function isNonEmptyArray(value) { return Array.isArray(value) && value.length > 0; } exports3.isNonEmptyArray = isNonEmptyArray; function isNullOrUndefined(value) { return value === null || value === void 0; } exports3.isNullOrUndefined = isNullOrUndefined; function isObject2(value) { return Boolean(value) && typeof value === "object" && !Array.isArray(value); } exports3.isObject = isObject2; const hasProperty = (objectToCheck, name2) => Object.hasOwnProperty.call(objectToCheck, name2); exports3.hasProperty = hasProperty; (function(JsonSize) { JsonSize[JsonSize["Null"] = 4] = "Null"; JsonSize[JsonSize["Comma"] = 1] = "Comma"; JsonSize[JsonSize["Wrapper"] = 1] = "Wrapper"; JsonSize[JsonSize["True"] = 4] = "True"; JsonSize[JsonSize["False"] = 5] = "False"; JsonSize[JsonSize["Quote"] = 1] = "Quote"; JsonSize[JsonSize["Colon"] = 1] = "Colon"; JsonSize[JsonSize["Date"] = 24] = "Date"; })(exports3.JsonSize || (exports3.JsonSize = {})); exports3.ESCAPE_CHARACTERS_REGEXP = /"|\\|\n|\r|\t/gu; function isPlainObject2(value) { if (typeof value !== "object" || value === null) { return false; } try { let proto = value; while (Object.getPrototypeOf(proto) !== null) { proto = Object.getPrototypeOf(proto); } return Object.getPrototypeOf(value) === proto; } catch (_2) { return false; } } exports3.isPlainObject = isPlainObject2; function isASCII(character) { return character.charCodeAt(0) <= 127; } exports3.isASCII = isASCII; function calculateStringSize(value) { var _a2; const size2 = value.split("").reduce((total, character) => { if (isASCII(character)) { return total + 1; } return total + 2; }, 0); return size2 + ((_a2 = value.match(exports3.ESCAPE_CHARACTERS_REGEXP)) !== null && _a2 !== void 0 ? _a2 : []).length; } exports3.calculateStringSize = calculateStringSize; function calculateNumberSize(value) { return value.toString().length; } exports3.calculateNumberSize = calculateNumberSize; })(misc); var number = {}; Object.defineProperty(number, "__esModule", { value: true }); number.hexToBigInt = number.hexToNumber = number.bigIntToHex = number.numberToHex = void 0; const assert_1 = assert$2; const hex_1 = hex; const numberToHex = (value) => { (0, assert_1.assert)(typeof value === "number", "Value must be a number."); (0, assert_1.assert)(value >= 0, "Value must be a non-negative number."); (0, assert_1.assert)(Number.isSafeInteger(value), "Value is not a safe integer. Use `bigIntToHex` instead."); return (0, hex_1.add0x)(value.toString(16)); }; number.numberToHex = numberToHex; const bigIntToHex = (value) => { (0, assert_1.assert)(typeof value === "bigint", "Value must be a bigint."); (0, assert_1.assert)(value >= 0, "Value must be a non-negative bigint."); return (0, hex_1.add0x)(value.toString(16)); }; number.bigIntToHex = bigIntToHex; const hexToNumber = (value) => { (0, hex_1.assertIsHexString)(value); const numberValue = parseInt(value, 16); (0, assert_1.assert)(Number.isSafeInteger(numberValue), "Value is not a safe integer. Use `hexToBigInt` instead."); return numberValue; }; number.hexToNumber = hexToNumber; const hexToBigInt = (value) => { (0, hex_1.assertIsHexString)(value); return BigInt((0, hex_1.add0x)(value)); }; number.hexToBigInt = hexToBigInt; var opaque = {}; Object.defineProperty(opaque, "__esModule", { value: true }); var time$1 = {}; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.timeSince = exports3.inMilliseconds = exports3.Duration = void 0; (function(Duration) { Duration[Duration["Millisecond"] = 1] = "Millisecond"; Duration[Duration["Second"] = 1e3] = "Second"; Duration[Duration["Minute"] = 6e4] = "Minute"; Duration[Duration["Hour"] = 36e5] = "Hour"; Duration[Duration["Day"] = 864e5] = "Day"; Duration[Duration["Week"] = 6048e5] = "Week"; Duration[Duration["Year"] = 31536e6] = "Year"; })(exports3.Duration || (exports3.Duration = {})); const isNonNegativeInteger = (number2) => Number.isInteger(number2) && number2 >= 0; const assertIsNonNegativeInteger = (number2, name2) => { if (!isNonNegativeInteger(number2)) { throw new Error(`"${name2}" must be a non-negative integer. Received: "${number2}".`); } }; function inMilliseconds(count, duration) { assertIsNonNegativeInteger(count, "count"); return count * duration; } exports3.inMilliseconds = inMilliseconds; function timeSince(timestamp) { assertIsNonNegativeInteger(timestamp, "timestamp"); return Date.now() - timestamp; } exports3.timeSince = timeSince; })(time$1); var transactionTypes = {}; Object.defineProperty(transactionTypes, "__esModule", { value: true }); var versions = {}; var re$3 = { exports: {} }; const SEMVER_SPEC_VERSION = "2.0.0"; const MAX_LENGTH$1 = 256; const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991; const MAX_SAFE_COMPONENT_LENGTH = 16; const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6; const RELEASE_TYPES = [ "major", "premajor", "minor", "preminor", "patch", "prepatch", "prerelease" ]; var constants$2 = { MAX_LENGTH: MAX_LENGTH$1, MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1, RELEASE_TYPES, SEMVER_SPEC_VERSION, FLAG_INCLUDE_PRERELEASE: 1, FLAG_LOOSE: 2 }; const debug$1 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { }; var debug_1 = debug$1; (function(module2, exports3) { const { MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH2, MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH2, MAX_LENGTH: MAX_LENGTH2 } = constants$2; const debug2 = debug_1; exports3 = module2.exports = {}; const re2 = exports3.re = []; const safeRe = exports3.safeRe = []; const src2 = exports3.src = []; const t2 = exports3.t = {}; let R2 = 0; const LETTERDASHNUMBER = "[a-zA-Z0-9-]"; const safeRegexReplacements = [ ["\\s", 1], ["\\d", MAX_LENGTH2], [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH2] ]; const makeSafeRegex = (value) => { for (const [token2, max2] of safeRegexReplacements) { value = value.split(`${token2}*`).join(`${token2}{0,${max2}}`).split(`${token2}+`).join(`${token2}{1,${max2}}`); } return value; }; const createToken = (name2, value, isGlobal) => { const safe = makeSafeRegex(value); const index2 = R2++; debug2(name2, index2, value); t2[name2] = index2; src2[index2] = value; re2[index2] = new RegExp(value, isGlobal ? "g" : void 0); safeRe[index2] = new RegExp(safe, isGlobal ? "g" : void 0); }; createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); createToken("MAINVERSION", `(${src2[t2.NUMERICIDENTIFIER]})\\.(${src2[t2.NUMERICIDENTIFIER]})\\.(${src2[t2.NUMERICIDENTIFIER]})`); createToken("MAINVERSIONLOOSE", `(${src2[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src2[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src2[t2.NUMERICIDENTIFIERLOOSE]})`); createToken("PRERELEASEIDENTIFIER", `(?:${src2[t2.NUMERICIDENTIFIER]}|${src2[t2.NONNUMERICIDENTIFIER]})`); createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src2[t2.NUMERICIDENTIFIERLOOSE]}|${src2[t2.NONNUMERICIDENTIFIER]})`); createToken("PRERELEASE", `(?:-(${src2[t2.PRERELEASEIDENTIFIER]}(?:\\.${src2[t2.PRERELEASEIDENTIFIER]})*))`); createToken("PRERELEASELOOSE", `(?:-?(${src2[t2.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src2[t2.PRERELEASEIDENTIFIERLOOSE]})*))`); createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); createToken("BUILD", `(?:\\+(${src2[t2.BUILDIDENTIFIER]}(?:\\.${src2[t2.BUILDIDENTIFIER]})*))`); createToken("FULLPLAIN", `v?${src2[t2.MAINVERSION]}${src2[t2.PRERELEASE]}?${src2[t2.BUILD]}?`); createToken("FULL", `^${src2[t2.FULLPLAIN]}$`); createToken("LOOSEPLAIN", `[v=\\s]*${src2[t2.MAINVERSIONLOOSE]}${src2[t2.PRERELEASELOOSE]}?${src2[t2.BUILD]}?`); createToken("LOOSE", `^${src2[t2.LOOSEPLAIN]}$`); createToken("GTLT", "((?:<|>)?=?)"); createToken("XRANGEIDENTIFIERLOOSE", `${src2[t2.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); createToken("XRANGEIDENTIFIER", `${src2[t2.NUMERICIDENTIFIER]}|x|X|\\*`); createToken("XRANGEPLAIN", `[v=\\s]*(${src2[t2.XRANGEIDENTIFIER]})(?:\\.(${src2[t2.XRANGEIDENTIFIER]})(?:\\.(${src2[t2.XRANGEIDENTIFIER]})(?:${src2[t2.PRERELEASE]})?${src2[t2.BUILD]}?)?)?`); createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src2[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src2[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src2[t2.XRANGEIDENTIFIERLOOSE]})(?:${src2[t2.PRERELEASELOOSE]})?${src2[t2.BUILD]}?)?)?`); createToken("XRANGE", `^${src2[t2.GTLT]}\\s*${src2[t2.XRANGEPLAIN]}$`); createToken("XRANGELOOSE", `^${src2[t2.GTLT]}\\s*${src2[t2.XRANGEPLAINLOOSE]}$`); createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH2}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH2}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH2}}))?`); createToken("COERCE", `${src2[t2.COERCEPLAIN]}(?:$|[^\\d])`); createToken("COERCEFULL", src2[t2.COERCEPLAIN] + `(?:${src2[t2.PRERELEASE]})?(?:${src2[t2.BUILD]})?(?:$|[^\\d])`); createToken("COERCERTL", src2[t2.COERCE], true); createToken("COERCERTLFULL", src2[t2.COERCEFULL], true); createToken("LONETILDE", "(?:~>?)"); createToken("TILDETRIM", `(\\s*)${src2[t2.LONETILDE]}\\s+`, true); exports3.tildeTrimReplace = "$1~"; createToken("TILDE", `^${src2[t2.LONETILDE]}${src2[t2.XRANGEPLAIN]}$`); createToken("TILDELOOSE", `^${src2[t2.LONETILDE]}${src2[t2.XRANGEPLAINLOOSE]}$`); createToken("LONECARET", "(?:\\^)"); createToken("CARETTRIM", `(\\s*)${src2[t2.LONECARET]}\\s+`, true); exports3.caretTrimReplace = "$1^"; createToken("CARET", `^${src2[t2.LONECARET]}${src2[t2.XRANGEPLAIN]}$`); createToken("CARETLOOSE", `^${src2[t2.LONECARET]}${src2[t2.XRANGEPLAINLOOSE]}$`); createToken("COMPARATORLOOSE", `^${src2[t2.GTLT]}\\s*(${src2[t2.LOOSEPLAIN]})$|^$`); createToken("COMPARATOR", `^${src2[t2.GTLT]}\\s*(${src2[t2.FULLPLAIN]})$|^$`); createToken("COMPARATORTRIM", `(\\s*)${src2[t2.GTLT]}\\s*(${src2[t2.LOOSEPLAIN]}|${src2[t2.XRANGEPLAIN]})`, true); exports3.comparatorTrimReplace = "$1$2$3"; createToken("HYPHENRANGE", `^\\s*(${src2[t2.XRANGEPLAIN]})\\s+-\\s+(${src2[t2.XRANGEPLAIN]})\\s*$`); createToken("HYPHENRANGELOOSE", `^\\s*(${src2[t2.XRANGEPLAINLOOSE]})\\s+-\\s+(${src2[t2.XRANGEPLAINLOOSE]})\\s*$`); createToken("STAR", "(<|>)?=?\\s*\\*"); createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); })(re$3, re$3.exports); var reExports = re$3.exports; const looseOption = Object.freeze({ loose: true }); const emptyOpts = Object.freeze({}); const parseOptions$1 = (options) => { if (!options) { return emptyOpts; } if (typeof options !== "object") { return looseOption; } return options; }; var parseOptions_1 = parseOptions$1; const numeric = /^[0-9]+$/; const compareIdentifiers$1 = (a2, b2) => { const anum = numeric.test(a2); const bnum = numeric.test(b2); if (anum && bnum) { a2 = +a2; b2 = +b2; } return a2 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b2 ? -1 : 1; }; const rcompareIdentifiers = (a2, b2) => compareIdentifiers$1(b2, a2); var identifiers$1 = { compareIdentifiers: compareIdentifiers$1, rcompareIdentifiers }; const debug = debug_1; const { MAX_LENGTH, MAX_SAFE_INTEGER } = constants$2; const { safeRe: re$2, t: t$5 } = reExports; const parseOptions = parseOptions_1; const { compareIdentifiers } = identifiers$1; let SemVer$d = class SemVer2 { constructor(version2, options) { options = parseOptions(options); if (version2 instanceof SemVer2) { if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) { return version2; } else { version2 = version2.version; } } else if (typeof version2 !== "string") { throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`); } if (version2.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ); } debug("SemVer", version2, options); this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; const m2 = version2.trim().match(options.loose ? re$2[t$5.LOOSE] : re$2[t$5.FULL]); if (!m2) { throw new TypeError(`Invalid Version: ${version2}`); } this.raw = version2; this.major = +m2[1]; this.minor = +m2[2]; this.patch = +m2[3]; if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError("Invalid major version"); } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError("Invalid minor version"); } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError("Invalid patch version"); } if (!m2[4]) { this.prerelease = []; } else { this.prerelease = m2[4].split(".").map((id2) => { if (/^[0-9]+$/.test(id2)) { const num = +id2; if (num >= 0 && num < MAX_SAFE_INTEGER) { return num; } } return id2; }); } this.build = m2[5] ? m2[5].split(".") : []; this.format(); } format() { this.version = `${this.major}.${this.minor}.${this.patch}`; if (this.prerelease.length) { this.version += `-${this.prerelease.join(".")}`; } return this.version; } toString() { return this.version; } compare(other) { debug("SemVer.compare", this.version, this.options, other); if (!(other instanceof SemVer2)) { if (typeof other === "string" && other === this.version) { return 0; } other = new SemVer2(other, this.options); } if (other.version === this.version) { return 0; } return this.compareMain(other) || this.comparePre(other); } compareMain(other) { if (!(other instanceof SemVer2)) { other = new SemVer2(other, this.options); } return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); } comparePre(other) { if (!(other instanceof SemVer2)) { other = new SemVer2(other, this.options); } if (this.prerelease.length && !other.prerelease.length) { return -1; } else if (!this.prerelease.length && other.prerelease.length) { return 1; } else if (!this.prerelease.length && !other.prerelease.length) { return 0; } let i2 = 0; do { const a2 = this.prerelease[i2]; const b2 = other.prerelease[i2]; debug("prerelease compare", i2, a2, b2); if (a2 === void 0 && b2 === void 0) { return 0; } else if (b2 === void 0) { return 1; } else if (a2 === void 0) { return -1; } else if (a2 === b2) { continue; } else { return compareIdentifiers(a2, b2); } } while (++i2); } compareBuild(other) { if (!(other instanceof SemVer2)) { other = new SemVer2(other, this.options); } let i2 = 0; do { const a2 = this.build[i2]; const b2 = other.build[i2]; debug("build compare", i2, a2, b2); if (a2 === void 0 && b2 === void 0) { return 0; } else if (b2 === void 0) { return 1; } else if (a2 === void 0) { return -1; } else if (a2 === b2) { continue; } else { return compareIdentifiers(a2, b2); } } while (++i2); } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. inc(release, identifier, identifierBase) { switch (release) { case "premajor": this.prerelease.length = 0; this.patch = 0; this.minor = 0; this.major++; this.inc("pre", identifier, identifierBase); break; case "preminor": this.prerelease.length = 0; this.patch = 0; this.minor++; this.inc("pre", identifier, identifierBase); break; case "prepatch": this.prerelease.length = 0; this.inc("patch", identifier, identifierBase); this.inc("pre", identifier, identifierBase); break; case "prerelease": if (this.prerelease.length === 0) { this.inc("patch", identifier, identifierBase); } this.inc("pre", identifier, identifierBase); break; case "major": if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { this.major++; } this.minor = 0; this.patch = 0; this.prerelease = []; break; case "minor": if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++; } this.patch = 0; this.prerelease = []; break; case "patch": if (this.prerelease.length === 0) { this.patch++; } this.prerelease = []; break; case "pre": { const base3 = Number(identifierBase) ? 1 : 0; if (!identifier && identifierBase === false) { throw new Error("invalid increment argument: identifier is empty"); } if (this.prerelease.length === 0) { this.prerelease = [base3]; } else { let i2 = this.prerelease.length; while (--i2 >= 0) { if (typeof this.prerelease[i2] === "number") { this.prerelease[i2]++; i2 = -2; } } if (i2 === -1) { if (identifier === this.prerelease.join(".") && identifierBase === false) { throw new Error("invalid increment argument: identifier already exists"); } this.prerelease.push(base3); } } if (identifier) { let prerelease2 = [identifier, base3]; if (identifierBase === false) { prerelease2 = [identifier]; } if (compareIdentifiers(this.prerelease[0], identifier) === 0) { if (isNaN(this.prerelease[1])) { this.prerelease = prerelease2; } } else { this.prerelease = prerelease2; } } break; } default: throw new Error(`invalid increment argument: ${release}`); } this.raw = this.format(); if (this.build.length) { this.raw += `+${this.build.join(".")}`; } return this; } }; var semver$1 = SemVer$d; const SemVer$c = semver$1; const parse$6 = (version2, options, throwErrors = false) => { if (version2 instanceof SemVer$c) { return version2; } try { return new SemVer$c(version2, options); } catch (er2) { if (!throwErrors) { return null; } throw er2; } }; var parse_1 = parse$6; const parse$5 = parse_1; const valid$2 = (version2, options) => { const v2 = parse$5(version2, options); return v2 ? v2.version : null; }; var valid_1 = valid$2; const parse$4 = parse_1; const clean$1 = (version2, options) => { const s2 = parse$4(version2.trim().replace(/^[=v]+/, ""), options); return s2 ? s2.version : null; }; var clean_1 = clean$1; const SemVer$b = semver$1; const inc$1 = (version2, release, options, identifier, identifierBase) => { if (typeof options === "string") { identifierBase = identifier; identifier = options; options = void 0; } try { return new SemVer$b( version2 instanceof SemVer$b ? version2.version : version2, options ).inc(release, identifier, identifierBase).version; } catch (er2) { return null; } }; var inc_1 = inc$1; const parse$3 = parse_1; const diff$1 = (version1, version2) => { const v1 = parse$3(version1, null, true); const v2 = parse$3(version2, null, true); const comparison = v1.compare(v2); if (comparison === 0) { return null; } const v1Higher = comparison > 0; const highVersion = v1Higher ? v1 : v2; const lowVersion = v1Higher ? v2 : v1; const highHasPre = !!highVersion.prerelease.length; const lowHasPre = !!lowVersion.prerelease.length; if (lowHasPre && !highHasPre) { if (!lowVersion.patch && !lowVersion.minor) { return "major"; } if (highVersion.patch) { return "patch"; } if (highVersion.minor) { return "minor"; } return "major"; } const prefix = highHasPre ? "pre" : ""; if (v1.major !== v2.major) { return prefix + "major"; } if (v1.minor !== v2.minor) { return prefix + "minor"; } if (v1.patch !== v2.patch) { return prefix + "patch"; } return "prerelease"; }; var diff_1 = diff$1; const SemVer$a = semver$1; const major$1 = (a2, loose) => new SemVer$a(a2, loose).major; var major_1 = major$1; const SemVer$9 = semver$1; const minor$1 = (a2, loose) => new SemVer$9(a2, loose).minor; var minor_1 = minor$1; const SemVer$8 = semver$1; const patch$1 = (a2, loose) => new SemVer$8(a2, loose).patch; var patch_1 = patch$1; const parse$2 = parse_1; const prerelease$1 = (version2, options) => { const parsed = parse$2(version2, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; }; var prerelease_1 = prerelease$1; const SemVer$7 = semver$1; const compare$b = (a2, b2, loose) => new SemVer$7(a2, loose).compare(new SemVer$7(b2, loose)); var compare_1 = compare$b; const compare$a = compare_1; const rcompare$1 = (a2, b2, loose) => compare$a(b2, a2, loose); var rcompare_1 = rcompare$1; const compare$9 = compare_1; const compareLoose$1 = (a2, b2) => compare$9(a2, b2, true); var compareLoose_1 = compareLoose$1; const SemVer$6 = semver$1; const compareBuild$3 = (a2, b2, loose) => { const versionA = new SemVer$6(a2, loose); const versionB = new SemVer$6(b2, loose); return versionA.compare(versionB) || versionA.compareBuild(versionB); }; var compareBuild_1 = compareBuild$3; const compareBuild$2 = compareBuild_1; const sort$1 = (list, loose) => list.sort((a2, b2) => compareBuild$2(a2, b2, loose)); var sort_1 = sort$1; const compareBuild$1 = compareBuild_1; const rsort$1 = (list, loose) => list.sort((a2, b2) => compareBuild$1(b2, a2, loose)); var rsort_1 = rsort$1; const compare$8 = compare_1; const gt$6 = (a2, b2, loose) => compare$8(a2, b2, loose) > 0; var gt_1 = gt$6; const compare$7 = compare_1; const lt$5 = (a2, b2, loose) => compare$7(a2, b2, loose) < 0; var lt_1 = lt$5; const compare$6 = compare_1; const eq$2 = (a2, b2, loose) => compare$6(a2, b2, loose) === 0; var eq_1 = eq$2; const compare$5 = compare_1; const neq$2 = (a2, b2, loose) => compare$5(a2, b2, loose) !== 0; var neq_1 = neq$2; const compare$4 = compare_1; const gte$3 = (a2, b2, loose) => compare$4(a2, b2, loose) >= 0; var gte_1 = gte$3; const compare$3 = compare_1; const lte$3 = (a2, b2, loose) => compare$3(a2, b2, loose) <= 0; var lte_1 = lte$3; const eq$1 = eq_1; const neq$1 = neq_1; const gt$5 = gt_1; const gte$2 = gte_1; const lt$4 = lt_1; const lte$2 = lte_1; const cmp$1 = (a2, op, b2, loose) => { switch (op) { case "===": if (typeof a2 === "object") { a2 = a2.version; } if (typeof b2 === "object") { b2 = b2.version; } return a2 === b2; case "!==": if (typeof a2 === "object") { a2 = a2.version; } if (typeof b2 === "object") { b2 = b2.version; } return a2 !== b2; case "": case "=": case "==": return eq$1(a2, b2, loose); case "!=": return neq$1(a2, b2, loose); case ">": return gt$5(a2, b2, loose); case ">=": return gte$2(a2, b2, loose); case "<": return lt$4(a2, b2, loose); case "<=": return lte$2(a2, b2, loose); default: throw new TypeError(`Invalid operator: ${op}`); } }; var cmp_1 = cmp$1; const SemVer$5 = semver$1; const parse$1 = parse_1; const { safeRe: re$1, t: t$4 } = reExports; const coerce$1 = (version2, options) => { if (version2 instanceof SemVer$5) { return version2; } if (typeof version2 === "number") { version2 = String(version2); } if (typeof version2 !== "string") { return null; } options = options || {}; let match = null; if (!options.rtl) { match = version2.match(options.includePrerelease ? re$1[t$4.COERCEFULL] : re$1[t$4.COERCE]); } else { const coerceRtlRegex = options.includePrerelease ? re$1[t$4.COERCERTLFULL] : re$1[t$4.COERCERTL]; let next; while ((next = coerceRtlRegex.exec(version2)) && (!match || match.index + match[0].length !== version2.length)) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next; } coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length; } coerceRtlRegex.lastIndex = -1; } if (match === null) { return null; } const major2 = match[2]; const minor2 = match[3] || "0"; const patch2 = match[4] || "0"; const prerelease2 = options.includePrerelease && match[5] ? `-${match[5]}` : ""; const build = options.includePrerelease && match[6] ? `+${match[6]}` : ""; return parse$1(`${major2}.${minor2}.${patch2}${prerelease2}${build}`, options); }; var coerce_1 = coerce$1; class LRUCache { constructor() { this.max = 1e3; this.map = /* @__PURE__ */ new Map(); } get(key) { const value = this.map.get(key); if (value === void 0) { return void 0; } else { this.map.delete(key); this.map.set(key, value); return value; } } delete(key) { return this.map.delete(key); } set(key, value) { const deleted = this.delete(key); if (!deleted && value !== void 0) { if (this.map.size >= this.max) { const firstKey = this.map.keys().next().value; this.delete(firstKey); } this.map.set(key, value); } return this; } } var lrucache = LRUCache; var range; var hasRequiredRange; function requireRange() { if (hasRequiredRange) return range; hasRequiredRange = 1; class Range2 { constructor(range2, options) { options = parseOptions2(options); if (range2 instanceof Range2) { if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) { return range2; } else { return new Range2(range2.raw, options); } } if (range2 instanceof Comparator2) { this.raw = range2.value; this.set = [[range2]]; this.format(); return this; } this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; this.raw = range2.trim().split(/\s+/).join(" "); this.set = this.raw.split("||").map((r2) => this.parseRange(r2.trim())).filter((c2) => c2.length); if (!this.set.length) { throw new TypeError(`Invalid SemVer Range: ${this.raw}`); } if (this.set.length > 1) { const first = this.set[0]; this.set = this.set.filter((c2) => !isNullSet(c2[0])); if (this.set.length === 0) { this.set = [first]; } else if (this.set.length > 1) { for (const c2 of this.set) { if (c2.length === 1 && isAny(c2[0])) { this.set = [c2]; break; } } } } this.format(); } format() { this.range = this.set.map((comps) => comps.join(" ").trim()).join("||").trim(); return this.range; } toString() { return this.range; } parseRange(range2) { const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); const memoKey = memoOpts + ":" + range2; const cached = cache.get(memoKey); if (cached) { return cached; } const loose = this.options.loose; const hr2 = loose ? re2[t2.HYPHENRANGELOOSE] : re2[t2.HYPHENRANGE]; range2 = range2.replace(hr2, hyphenReplace(this.options.includePrerelease)); debug2("hyphen replace", range2); range2 = range2.replace(re2[t2.COMPARATORTRIM], comparatorTrimReplace); debug2("comparator trim", range2); range2 = range2.replace(re2[t2.TILDETRIM], tildeTrimReplace); debug2("tilde trim", range2); range2 = range2.replace(re2[t2.CARETTRIM], caretTrimReplace); debug2("caret trim", range2); let rangeList = range2.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); if (loose) { rangeList = rangeList.filter((comp) => { debug2("loose invalid filter", comp, this.options); return !!comp.match(re2[t2.COMPARATORLOOSE]); }); } debug2("range list", rangeList); const rangeMap = /* @__PURE__ */ new Map(); const comparators = rangeList.map((comp) => new Comparator2(comp, this.options)); for (const comp of comparators) { if (isNullSet(comp)) { return [comp]; } rangeMap.set(comp.value, comp); } if (rangeMap.size > 1 && rangeMap.has("")) { rangeMap.delete(""); } const result = [...rangeMap.values()]; cache.set(memoKey, result); return result; } intersects(range2, options) { if (!(range2 instanceof Range2)) { throw new TypeError("a Range is required"); } return this.set.some((thisComparators) => { return isSatisfiable(thisComparators, options) && range2.set.some((rangeComparators) => { return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { return rangeComparators.every((rangeComparator) => { return thisComparator.intersects(rangeComparator, options); }); }); }); }); } // if ANY of the sets match ALL of its comparators, then pass test(version2) { if (!version2) { return false; } if (typeof version2 === "string") { try { version2 = new SemVer2(version2, this.options); } catch (er2) { return false; } } for (let i2 = 0; i2 < this.set.length; i2++) { if (testSet(this.set[i2], version2, this.options)) { return true; } } return false; } } range = Range2; const LRU = lrucache; const cache = new LRU(); const parseOptions2 = parseOptions_1; const Comparator2 = requireComparator(); const debug2 = debug_1; const SemVer2 = semver$1; const { safeRe: re2, t: t2, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = reExports; const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = constants$2; const isNullSet = (c2) => c2.value === "<0.0.0-0"; const isAny = (c2) => c2.value === ""; const isSatisfiable = (comparators, options) => { let result = true; const remainingComparators = comparators.slice(); let testComparator = remainingComparators.pop(); while (result && remainingComparators.length) { result = remainingComparators.every((otherComparator) => { return testComparator.intersects(otherComparator, options); }); testComparator = remainingComparators.pop(); } return result; }; const parseComparator = (comp, options) => { debug2("comp", comp, options); comp = replaceCarets(comp, options); debug2("caret", comp); comp = replaceTildes(comp, options); debug2("tildes", comp); comp = replaceXRanges(comp, options); debug2("xrange", comp); comp = replaceStars(comp, options); debug2("stars", comp); return comp; }; const isX = (id2) => !id2 || id2.toLowerCase() === "x" || id2 === "*"; const replaceTildes = (comp, options) => { return comp.trim().split(/\s+/).map((c2) => replaceTilde(c2, options)).join(" "); }; const replaceTilde = (comp, options) => { const r2 = options.loose ? re2[t2.TILDELOOSE] : re2[t2.TILDE]; return comp.replace(r2, (_2, M2, m2, p2, pr2) => { debug2("tilde", comp, _2, M2, m2, p2, pr2); let ret; if (isX(M2)) { ret = ""; } else if (isX(m2)) { ret = `>=${M2}.0.0 <${+M2 + 1}.0.0-0`; } else if (isX(p2)) { ret = `>=${M2}.${m2}.0 <${M2}.${+m2 + 1}.0-0`; } else if (pr2) { debug2("replaceTilde pr", pr2); ret = `>=${M2}.${m2}.${p2}-${pr2} <${M2}.${+m2 + 1}.0-0`; } else { ret = `>=${M2}.${m2}.${p2} <${M2}.${+m2 + 1}.0-0`; } debug2("tilde return", ret); return ret; }); }; const replaceCarets = (comp, options) => { return comp.trim().split(/\s+/).map((c2) => replaceCaret(c2, options)).join(" "); }; const replaceCaret = (comp, options) => { debug2("caret", comp, options); const r2 = options.loose ? re2[t2.CARETLOOSE] : re2[t2.CARET]; const z2 = options.includePrerelease ? "-0" : ""; return comp.replace(r2, (_2, M2, m2, p2, pr2) => { debug2("caret", comp, _2, M2, m2, p2, pr2); let ret; if (isX(M2)) { ret = ""; } else if (isX(m2)) { ret = `>=${M2}.0.0${z2} <${+M2 + 1}.0.0-0`; } else if (isX(p2)) { if (M2 === "0") { ret = `>=${M2}.${m2}.0${z2} <${M2}.${+m2 + 1}.0-0`; } else { ret = `>=${M2}.${m2}.0${z2} <${+M2 + 1}.0.0-0`; } } else if (pr2) { debug2("replaceCaret pr", pr2); if (M2 === "0") { if (m2 === "0") { ret = `>=${M2}.${m2}.${p2}-${pr2} <${M2}.${m2}.${+p2 + 1}-0`; } else { ret = `>=${M2}.${m2}.${p2}-${pr2} <${M2}.${+m2 + 1}.0-0`; } } else { ret = `>=${M2}.${m2}.${p2}-${pr2} <${+M2 + 1}.0.0-0`; } } else { debug2("no pr"); if (M2 === "0") { if (m2 === "0") { ret = `>=${M2}.${m2}.${p2}${z2} <${M2}.${m2}.${+p2 + 1}-0`; } else { ret = `>=${M2}.${m2}.${p2}${z2} <${M2}.${+m2 + 1}.0-0`; } } else { ret = `>=${M2}.${m2}.${p2} <${+M2 + 1}.0.0-0`; } } debug2("caret return", ret); return ret; }); }; const replaceXRanges = (comp, options) => { debug2("replaceXRanges", comp, options); return comp.split(/\s+/).map((c2) => replaceXRange(c2, options)).join(" "); }; const replaceXRange = (comp, options) => { comp = comp.trim(); const r2 = options.loose ? re2[t2.XRANGELOOSE] : re2[t2.XRANGE]; return comp.replace(r2, (ret, gtlt, M2, m2, p2, pr2) => { debug2("xRange", comp, ret, gtlt, M2, m2, p2, pr2); const xM = isX(M2); const xm = xM || isX(m2); const xp = xm || isX(p2); const anyX = xp; if (gtlt === "=" && anyX) { gtlt = ""; } pr2 = options.includePrerelease ? "-0" : ""; if (xM) { if (gtlt === ">" || gtlt === "<") { ret = "<0.0.0-0"; } else { ret = "*"; } } else if (gtlt && anyX) { if (xm) { m2 = 0; } p2 = 0; if (gtlt === ">") { gtlt = ">="; if (xm) { M2 = +M2 + 1; m2 = 0; p2 = 0; } else { m2 = +m2 + 1; p2 = 0; } } else if (gtlt === "<=") { gtlt = "<"; if (xm) { M2 = +M2 + 1; } else { m2 = +m2 + 1; } } if (gtlt === "<") { pr2 = "-0"; } ret = `${gtlt + M2}.${m2}.${p2}${pr2}`; } else if (xm) { ret = `>=${M2}.0.0${pr2} <${+M2 + 1}.0.0-0`; } else if (xp) { ret = `>=${M2}.${m2}.0${pr2} <${M2}.${+m2 + 1}.0-0`; } debug2("xRange return", ret); return ret; }); }; const replaceStars = (comp, options) => { debug2("replaceStars", comp, options); return comp.trim().replace(re2[t2.STAR], ""); }; const replaceGTE0 = (comp, options) => { debug2("replaceGTE0", comp, options); return comp.trim().replace(re2[options.includePrerelease ? t2.GTE0PRE : t2.GTE0], ""); }; const hyphenReplace = (incPr) => ($0, from2, fM, fm, fp, fpr, fb, to2, tM, tm, tp, tpr) => { if (isX(fM)) { from2 = ""; } else if (isX(fm)) { from2 = `>=${fM}.0.0${incPr ? "-0" : ""}`; } else if (isX(fp)) { from2 = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; } else if (fpr) { from2 = `>=${from2}`; } else { from2 = `>=${from2}${incPr ? "-0" : ""}`; } if (isX(tM)) { to2 = ""; } else if (isX(tm)) { to2 = `<${+tM + 1}.0.0-0`; } else if (isX(tp)) { to2 = `<${tM}.${+tm + 1}.0-0`; } else if (tpr) { to2 = `<=${tM}.${tm}.${tp}-${tpr}`; } else if (incPr) { to2 = `<${tM}.${tm}.${+tp + 1}-0`; } else { to2 = `<=${to2}`; } return `${from2} ${to2}`.trim(); }; const testSet = (set2, version2, options) => { for (let i2 = 0; i2 < set2.length; i2++) { if (!set2[i2].test(version2)) { return false; } } if (version2.prerelease.length && !options.includePrerelease) { for (let i2 = 0; i2 < set2.length; i2++) { debug2(set2[i2].semver); if (set2[i2].semver === Comparator2.ANY) { continue; } if (set2[i2].semver.prerelease.length > 0) { const allowed = set2[i2].semver; if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) { return true; } } } return false; } return true; }; return range; } var comparator; var hasRequiredComparator; function requireComparator() { if (hasRequiredComparator) return comparator; hasRequiredComparator = 1; const ANY2 = Symbol("SemVer ANY"); class Comparator2 { static get ANY() { return ANY2; } constructor(comp, options) { options = parseOptions2(options); if (comp instanceof Comparator2) { if (comp.loose === !!options.loose) { return comp; } else { comp = comp.value; } } comp = comp.trim().split(/\s+/).join(" "); debug2("comparator", comp, options); this.options = options; this.loose = !!options.loose; this.parse(comp); if (this.semver === ANY2) { this.value = ""; } else { this.value = this.operator + this.semver.version; } debug2("comp", this); } parse(comp) { const r2 = this.options.loose ? re2[t2.COMPARATORLOOSE] : re2[t2.COMPARATOR]; const m2 = comp.match(r2); if (!m2) { throw new TypeError(`Invalid comparator: ${comp}`); } this.operator = m2[1] !== void 0 ? m2[1] : ""; if (this.operator === "=") { this.operator = ""; } if (!m2[2]) { this.semver = ANY2; } else { this.semver = new SemVer2(m2[2], this.options.loose); } } toString() { return this.value; } test(version2) { debug2("Comparator.test", version2, this.options.loose); if (this.semver === ANY2 || version2 === ANY2) { return true; } if (typeof version2 === "string") { try { version2 = new SemVer2(version2, this.options); } catch (er2) { return false; } } return cmp2(version2, this.operator, this.semver, this.options); } intersects(comp, options) { if (!(comp instanceof Comparator2)) { throw new TypeError("a Comparator is required"); } if (this.operator === "") { if (this.value === "") { return true; } return new Range2(comp.value, options).test(this.value); } else if (comp.operator === "") { if (comp.value === "") { return true; } return new Range2(this.value, options).test(comp.semver); } options = parseOptions2(options); if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) { return false; } if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) { return false; } if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { return true; } if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { return true; } if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { return true; } if (cmp2(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { return true; } if (cmp2(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { return true; } return false; } } comparator = Comparator2; const parseOptions2 = parseOptions_1; const { safeRe: re2, t: t2 } = reExports; const cmp2 = cmp_1; const debug2 = debug_1; const SemVer2 = semver$1; const Range2 = requireRange(); return comparator; } const Range$9 = requireRange(); const satisfies$4 = (version2, range2, options) => { try { range2 = new Range$9(range2, options); } catch (er2) { return false; } return range2.test(version2); }; var satisfies_1 = satisfies$4; const Range$8 = requireRange(); const toComparators$1 = (range2, options) => new Range$8(range2, options).set.map((comp) => comp.map((c2) => c2.value).join(" ").trim().split(" ")); var toComparators_1 = toComparators$1; const SemVer$4 = semver$1; const Range$7 = requireRange(); const maxSatisfying$1 = (versions2, range2, options) => { let max2 = null; let maxSV = null; let rangeObj = null; try { rangeObj = new Range$7(range2, options); } catch (er2) { return null; } versions2.forEach((v2) => { if (rangeObj.test(v2)) { if (!max2 || maxSV.compare(v2) === -1) { max2 = v2; maxSV = new SemVer$4(max2, options); } } }); return max2; }; var maxSatisfying_1 = maxSatisfying$1; const SemVer$3 = semver$1; const Range$6 = requireRange(); const minSatisfying$1 = (versions2, range2, options) => { let min2 = null; let minSV = null; let rangeObj = null; try { rangeObj = new Range$6(range2, options); } catch (er2) { return null; } versions2.forEach((v2) => { if (rangeObj.test(v2)) { if (!min2 || minSV.compare(v2) === 1) { min2 = v2; minSV = new SemVer$3(min2, options); } } }); return min2; }; var minSatisfying_1 = minSatisfying$1; const SemVer$2 = semver$1; const Range$5 = requireRange(); const gt$4 = gt_1; const minVersion$1 = (range2, loose) => { range2 = new Range$5(range2, loose); let minver = new SemVer$2("0.0.0"); if (range2.test(minver)) { return minver; } minver = new SemVer$2("0.0.0-0"); if (range2.test(minver)) { return minver; } minver = null; for (let i2 = 0; i2 < range2.set.length; ++i2) { const comparators = range2.set[i2]; let setMin = null; comparators.forEach((comparator2) => { const compver = new SemVer$2(comparator2.semver.version); switch (comparator2.operator) { case ">": if (compver.prerelease.length === 0) { compver.patch++; } else { compver.prerelease.push(0); } compver.raw = compver.format(); case "": case ">=": if (!setMin || gt$4(compver, setMin)) { setMin = compver; } break; case "<": case "<=": break; default: throw new Error(`Unexpected operation: ${comparator2.operator}`); } }); if (setMin && (!minver || gt$4(minver, setMin))) { minver = setMin; } } if (minver && range2.test(minver)) { return minver; } return null; }; var minVersion_1 = minVersion$1; const Range$4 = requireRange(); const validRange$1 = (range2, options) => { try { return new Range$4(range2, options).range || "*"; } catch (er2) { return null; } }; var valid$1 = validRange$1; const SemVer$1 = semver$1; const Comparator$2 = requireComparator(); const { ANY: ANY$1 } = Comparator$2; const Range$3 = requireRange(); const satisfies$3 = satisfies_1; const gt$3 = gt_1; const lt$3 = lt_1; const lte$1 = lte_1; const gte$1 = gte_1; const outside$3 = (version2, range2, hilo, options) => { version2 = new SemVer$1(version2, options); range2 = new Range$3(range2, options); let gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { case ">": gtfn = gt$3; ltefn = lte$1; ltfn = lt$3; comp = ">"; ecomp = ">="; break; case "<": gtfn = lt$3; ltefn = gte$1; ltfn = gt$3; comp = "<"; ecomp = "<="; break; default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } if (satisfies$3(version2, range2, options)) { return false; } for (let i2 = 0; i2 < range2.set.length; ++i2) { const comparators = range2.set[i2]; let high = null; let low = null; comparators.forEach((comparator2) => { if (comparator2.semver === ANY$1) { comparator2 = new Comparator$2(">=0.0.0"); } high = high || comparator2; low = low || comparator2; if (gtfn(comparator2.semver, high.semver, options)) { high = comparator2; } else if (ltfn(comparator2.semver, low.semver, options)) { low = comparator2; } }); if (high.operator === comp || high.operator === ecomp) { return false; } if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) { return false; } else if (low.operator === ecomp && ltfn(version2, low.semver)) { return false; } } return true; }; var outside_1 = outside$3; const outside$2 = outside_1; const gtr$1 = (version2, range2, options) => outside$2(version2, range2, ">", options); var gtr_1 = gtr$1; const outside$1 = outside_1; const ltr$1 = (version2, range2, options) => outside$1(version2, range2, "<", options); var ltr_1 = ltr$1; const Range$2 = requireRange(); const intersects$1 = (r1, r2, options) => { r1 = new Range$2(r1, options); r2 = new Range$2(r2, options); return r1.intersects(r2, options); }; var intersects_1 = intersects$1; const satisfies$2 = satisfies_1; const compare$2 = compare_1; var simplify = (versions2, range2, options) => { const set2 = []; let first = null; let prev = null; const v2 = versions2.sort((a2, b2) => compare$2(a2, b2, options)); for (const version2 of v2) { const included = satisfies$2(version2, range2, options); if (included) { prev = version2; if (!first) { first = version2; } } else { if (prev) { set2.push([first, prev]); } prev = null; first = null; } } if (first) { set2.push([first, null]); } const ranges = []; for (const [min2, max2] of set2) { if (min2 === max2) { ranges.push(min2); } else if (!max2 && min2 === v2[0]) { ranges.push("*"); } else if (!max2) { ranges.push(`>=${min2}`); } else if (min2 === v2[0]) { ranges.push(`<=${max2}`); } else { ranges.push(`${min2} - ${max2}`); } } const simplified = ranges.join(" || "); const original = typeof range2.raw === "string" ? range2.raw : String(range2); return simplified.length < original.length ? simplified : range2; }; const Range$1 = requireRange(); const Comparator$1 = requireComparator(); const { ANY } = Comparator$1; const satisfies$1 = satisfies_1; const compare$1 = compare_1; const subset$1 = (sub, dom, options = {}) => { if (sub === dom) { return true; } sub = new Range$1(sub, options); dom = new Range$1(dom, options); let sawNonNull = false; OUTER: for (const simpleSub of sub.set) { for (const simpleDom of dom.set) { const isSub = simpleSubset(simpleSub, simpleDom, options); sawNonNull = sawNonNull || isSub !== null; if (isSub) { continue OUTER; } } if (sawNonNull) { return false; } } return true; }; const minimumVersionWithPreRelease = [new Comparator$1(">=0.0.0-0")]; const minimumVersion = [new Comparator$1(">=0.0.0")]; const simpleSubset = (sub, dom, options) => { if (sub === dom) { return true; } if (sub.length === 1 && sub[0].semver === ANY) { if (dom.length === 1 && dom[0].semver === ANY) { return true; } else if (options.includePrerelease) { sub = minimumVersionWithPreRelease; } else { sub = minimumVersion; } } if (dom.length === 1 && dom[0].semver === ANY) { if (options.includePrerelease) { return true; } else { dom = minimumVersion; } } const eqSet = /* @__PURE__ */ new Set(); let gt2, lt2; for (const c2 of sub) { if (c2.operator === ">" || c2.operator === ">=") { gt2 = higherGT(gt2, c2, options); } else if (c2.operator === "<" || c2.operator === "<=") { lt2 = lowerLT(lt2, c2, options); } else { eqSet.add(c2.semver); } } if (eqSet.size > 1) { return null; } let gtltComp; if (gt2 && lt2) { gtltComp = compare$1(gt2.semver, lt2.semver, options); if (gtltComp > 0) { return null; } else if (gtltComp === 0 && (gt2.operator !== ">=" || lt2.operator !== "<=")) { return null; } } for (const eq2 of eqSet) { if (gt2 && !satisfies$1(eq2, String(gt2), options)) { return null; } if (lt2 && !satisfies$1(eq2, String(lt2), options)) { return null; } for (const c2 of dom) { if (!satisfies$1(eq2, String(c2), options)) { return false; } } return true; } let higher, lower; let hasDomLT, hasDomGT; let needDomLTPre = lt2 && !options.includePrerelease && lt2.semver.prerelease.length ? lt2.semver : false; let needDomGTPre = gt2 && !options.includePrerelease && gt2.semver.prerelease.length ? gt2.semver : false; if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt2.operator === "<" && needDomLTPre.prerelease[0] === 0) { needDomLTPre = false; } for (const c2 of dom) { hasDomGT = hasDomGT || c2.operator === ">" || c2.operator === ">="; hasDomLT = hasDomLT || c2.operator === "<" || c2.operator === "<="; if (gt2) { if (needDomGTPre) { if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomGTPre.major && c2.semver.minor === needDomGTPre.minor && c2.semver.patch === needDomGTPre.patch) { needDomGTPre = false; } } if (c2.operator === ">" || c2.operator === ">=") { higher = higherGT(gt2, c2, options); if (higher === c2 && higher !== gt2) { return false; } } else if (gt2.operator === ">=" && !satisfies$1(gt2.semver, String(c2), options)) { return false; } } if (lt2) { if (needDomLTPre) { if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomLTPre.major && c2.semver.minor === needDomLTPre.minor && c2.semver.patch === needDomLTPre.patch) { needDomLTPre = false; } } if (c2.operator === "<" || c2.operator === "<=") { lower = lowerLT(lt2, c2, options); if (lower === c2 && lower !== lt2) { return false; } } else if (lt2.operator === "<=" && !satisfies$1(lt2.semver, String(c2), options)) { return false; } } if (!c2.operator && (lt2 || gt2) && gtltComp !== 0) { return false; } } if (gt2 && hasDomLT && !lt2 && gtltComp !== 0) { return false; } if (lt2 && hasDomGT && !gt2 && gtltComp !== 0) { return false; } if (needDomGTPre || needDomLTPre) { return false; } return true; }; const higherGT = (a2, b2, options) => { if (!a2) { return b2; } const comp = compare$1(a2.semver, b2.semver, options); return comp > 0 ? a2 : comp < 0 ? b2 : b2.operator === ">" && a2.operator === ">=" ? b2 : a2; }; const lowerLT = (a2, b2, options) => { if (!a2) { return b2; } const comp = compare$1(a2.semver, b2.semver, options); return comp < 0 ? a2 : comp > 0 ? b2 : b2.operator === "<" && a2.operator === "<=" ? b2 : a2; }; var subset_1 = subset$1; const internalRe = reExports; const constants$1 = constants$2; const SemVer = semver$1; const identifiers = identifiers$1; const parse = parse_1; const valid = valid_1; const clean = clean_1; const inc = inc_1; const diff = diff_1; const major = major_1; const minor = minor_1; const patch = patch_1; const prerelease = prerelease_1; const compare = compare_1; const rcompare = rcompare_1; const compareLoose = compareLoose_1; const compareBuild = compareBuild_1; const sort = sort_1; const rsort = rsort_1; const gt$2 = gt_1; const lt$2 = lt_1; const eq = eq_1; const neq = neq_1; const gte = gte_1; const lte = lte_1; const cmp = cmp_1; const coerce = coerce_1; const Comparator = requireComparator(); const Range = requireRange(); const satisfies = satisfies_1; const toComparators = toComparators_1; const maxSatisfying = maxSatisfying_1; const minSatisfying = minSatisfying_1; const minVersion = minVersion_1; const validRange = valid$1; const outside = outside_1; const gtr = gtr_1; const ltr = ltr_1; const intersects = intersects_1; const simplifyRange = simplify; const subset = subset_1; var semver = { parse, valid, clean, inc, diff, major, minor, patch, prerelease, compare, rcompare, compareLoose, compareBuild, sort, rsort, gt: gt$2, lt: lt$2, eq, neq, gte, lte, cmp, coerce, Comparator, Range, satisfies, toComparators, maxSatisfying, minSatisfying, minVersion, validRange, outside, gtr, ltr, intersects, simplifyRange, subset, SemVer, re: internalRe.re, src: internalRe.src, tokens: internalRe.t, SEMVER_SPEC_VERSION: constants$1.SEMVER_SPEC_VERSION, RELEASE_TYPES: constants$1.RELEASE_TYPES, compareIdentifiers: identifiers.compareIdentifiers, rcompareIdentifiers: identifiers.rcompareIdentifiers }; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.satisfiesVersionRange = exports3.gtRange = exports3.gtVersion = exports3.assertIsSemVerRange = exports3.assertIsSemVerVersion = exports3.isValidSemVerRange = exports3.isValidSemVerVersion = exports3.VersionRangeStruct = exports3.VersionStruct = void 0; const semver_1 = semver; const superstruct_12 = require$$1; const assert_12 = assert$2; exports3.VersionStruct = (0, superstruct_12.refine)((0, superstruct_12.string)(), "Version", (value) => { if ((0, semver_1.valid)(value) === null) { return `Expected SemVer version, got "${value}"`; } return true; }); exports3.VersionRangeStruct = (0, superstruct_12.refine)((0, superstruct_12.string)(), "Version range", (value) => { if ((0, semver_1.validRange)(value) === null) { return `Expected SemVer range, got "${value}"`; } return true; }); function isValidSemVerVersion(version2) { return (0, superstruct_12.is)(version2, exports3.VersionStruct); } exports3.isValidSemVerVersion = isValidSemVerVersion; function isValidSemVerRange(versionRange) { return (0, superstruct_12.is)(versionRange, exports3.VersionRangeStruct); } exports3.isValidSemVerRange = isValidSemVerRange; function assertIsSemVerVersion(version2) { (0, assert_12.assertStruct)(version2, exports3.VersionStruct); } exports3.assertIsSemVerVersion = assertIsSemVerVersion; function assertIsSemVerRange(range2) { (0, assert_12.assertStruct)(range2, exports3.VersionRangeStruct); } exports3.assertIsSemVerRange = assertIsSemVerRange; function gtVersion(version1, version2) { return (0, semver_1.gt)(version1, version2); } exports3.gtVersion = gtVersion; function gtRange(version2, range2) { return (0, semver_1.gtr)(version2, range2); } exports3.gtRange = gtRange; function satisfiesVersionRange(version2, versionRange) { return (0, semver_1.satisfies)(version2, versionRange, { includePrerelease: true }); } exports3.satisfiesVersionRange = satisfiesVersionRange; })(versions); (function(exports3) { var __createBinding2 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; var desc = Object.getOwnPropertyDescriptor(m2, k2); if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m2[k2]; } }; } Object.defineProperty(o2, k22, desc); } : function(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; o2[k22] = m2[k2]; }); var __exportStar2 = commonjsGlobal && commonjsGlobal.__exportStar || function(m2, exports4) { for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports4, p2)) __createBinding2(exports4, m2, p2); }; Object.defineProperty(exports3, "__esModule", { value: true }); __exportStar2(assert$2, exports3); __exportStar2(base64$1, exports3); __exportStar2(bytes, exports3); __exportStar2(checksum, exports3); __exportStar2(coercers, exports3); __exportStar2(collections, exports3); __exportStar2(encryptionTypes, exports3); __exportStar2(hex, exports3); __exportStar2(json, exports3); __exportStar2(keyring, exports3); __exportStar2(logging, exports3); __exportStar2(misc, exports3); __exportStar2(number, exports3); __exportStar2(opaque, exports3); __exportStar2(time$1, exports3); __exportStar2(transactionTypes, exports3); __exportStar2(versions, exports3); })(dist$3); (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.createModuleLogger = exports3.projectLogger = void 0; const utils_12 = dist$3; Object.defineProperty(exports3, "createModuleLogger", { enumerable: true, get: function() { return utils_12.createModuleLogger; } }); exports3.projectLogger = (0, utils_12.createProjectLogger)("eth-block-tracker"); })(loggingUtils); var __importDefault$4 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(PollingBlockTracker$1, "__esModule", { value: true }); PollingBlockTracker$1.PollingBlockTracker = void 0; const json_rpc_random_id_1$1 = __importDefault$4(jsonRpcRandomId); const pify_1 = __importDefault$4(pify$2); const BaseBlockTracker_1$1 = BaseBlockTracker$1; const logging_utils_1 = loggingUtils; const log = (0, logging_utils_1.createModuleLogger)(logging_utils_1.projectLogger, "polling-block-tracker"); const createRandomId$2 = (0, json_rpc_random_id_1$1.default)(); const sec = 1e3; class PollingBlockTracker extends BaseBlockTracker_1$1.BaseBlockTracker { constructor(opts = {}) { var _a2; if (!opts.provider) { throw new Error("PollingBlockTracker - no provider specified."); } super(Object.assign(Object.assign({}, opts), { blockResetDuration: (_a2 = opts.blockResetDuration) !== null && _a2 !== void 0 ? _a2 : opts.pollingInterval })); this._provider = opts.provider; this._pollingInterval = opts.pollingInterval || 20 * sec; this._retryTimeout = opts.retryTimeout || this._pollingInterval / 10; this._keepEventLoopActive = opts.keepEventLoopActive === void 0 ? true : opts.keepEventLoopActive; this._setSkipCacheFlag = opts.setSkipCacheFlag || false; } // trigger block polling async checkForLatestBlock() { await this._updateLatestBlock(); return await this.getLatestBlock(); } async _start() { this._synchronize(); } async _end() { } async _synchronize() { var _a2; while (this._isRunning) { try { await this._updateLatestBlock(); const promise = timeout(this._pollingInterval, !this._keepEventLoopActive); this.emit("_waitingForNextIteration"); await promise; } catch (err) { const newErr = new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: ${(_a2 = err.stack) !== null && _a2 !== void 0 ? _a2 : err}`); try { this.emit("error", newErr); } catch (emitErr) { console.error(newErr); } const promise = timeout(this._retryTimeout, !this._keepEventLoopActive); this.emit("_waitingForNextIteration"); await promise; } } } async _updateLatestBlock() { const latestBlock = await this._fetchLatestBlock(); this._newPotentialLatest(latestBlock); } async _fetchLatestBlock() { const req = { jsonrpc: "2.0", id: createRandomId$2(), method: "eth_blockNumber", params: [] }; if (this._setSkipCacheFlag) { req.skipCache = true; } log("Making request", req); const res = await (0, pify_1.default)((cb) => this._provider.sendAsync(req, cb))(); log("Got response", res); if (res.error) { throw new Error(`PollingBlockTracker - encountered error fetching block: ${res.error.message}`); } return res.result; } } PollingBlockTracker$1.PollingBlockTracker = PollingBlockTracker; function timeout(duration, unref) { return new Promise((resolve) => { const timeoutRef = setTimeout(resolve, duration); if (timeoutRef.unref && unref) { timeoutRef.unref(); } }); } var SubscribeBlockTracker$1 = {}; var __importDefault$3 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(SubscribeBlockTracker$1, "__esModule", { value: true }); SubscribeBlockTracker$1.SubscribeBlockTracker = void 0; const json_rpc_random_id_1 = __importDefault$3(jsonRpcRandomId); const BaseBlockTracker_1 = BaseBlockTracker$1; const createRandomId$1 = (0, json_rpc_random_id_1.default)(); class SubscribeBlockTracker extends BaseBlockTracker_1.BaseBlockTracker { constructor(opts = {}) { if (!opts.provider) { throw new Error("SubscribeBlockTracker - no provider specified."); } super(opts); this._provider = opts.provider; this._subscriptionId = null; } async checkForLatestBlock() { return await this.getLatestBlock(); } async _start() { if (this._subscriptionId === void 0 || this._subscriptionId === null) { try { const blockNumber = await this._call("eth_blockNumber"); this._subscriptionId = await this._call("eth_subscribe", "newHeads"); this._provider.on("data", this._handleSubData.bind(this)); this._newPotentialLatest(blockNumber); } catch (e2) { this.emit("error", e2); } } } async _end() { if (this._subscriptionId !== null && this._subscriptionId !== void 0) { try { await this._call("eth_unsubscribe", this._subscriptionId); this._subscriptionId = null; } catch (e2) { this.emit("error", e2); } } } _call(method, ...params) { return new Promise((resolve, reject) => { this._provider.sendAsync({ id: createRandomId$1(), method, params, jsonrpc: "2.0" }, (err, res) => { if (err) { reject(err); } else { resolve(res.result); } }); }); } _handleSubData(_2, response) { var _a2; if (response.method === "eth_subscription" && ((_a2 = response.params) === null || _a2 === void 0 ? void 0 : _a2.subscription) === this._subscriptionId) { this._newPotentialLatest(response.params.result.number); } } } SubscribeBlockTracker$1.SubscribeBlockTracker = SubscribeBlockTracker; (function(exports3) { var __createBinding2 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; Object.defineProperty(o2, k22, { enumerable: true, get: function() { return m2[k2]; } }); } : function(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; o2[k22] = m2[k2]; }); var __exportStar2 = commonjsGlobal && commonjsGlobal.__exportStar || function(m2, exports4) { for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports4, p2)) __createBinding2(exports4, m2, p2); }; Object.defineProperty(exports3, "__esModule", { value: true }); __exportStar2(PollingBlockTracker$1, exports3); __exportStar2(SubscribeBlockTracker$1, exports3); })(dist$4); var dist$1 = {}; var idRemapMiddleware = {}; var getUniqueId$1 = {}; Object.defineProperty(getUniqueId$1, "__esModule", { value: true }); getUniqueId$1.getUniqueId = void 0; const MAX = 4294967295; let idCounter = Math.floor(Math.random() * MAX); function getUniqueId() { idCounter = (idCounter + 1) % MAX; return idCounter; } getUniqueId$1.getUniqueId = getUniqueId; Object.defineProperty(idRemapMiddleware, "__esModule", { value: true }); idRemapMiddleware.createIdRemapMiddleware = void 0; const getUniqueId_1 = getUniqueId$1; function createIdRemapMiddleware() { return (req, res, next, _end) => { const originalId = req.id; const newId = getUniqueId_1.getUniqueId(); req.id = newId; res.id = newId; next((done2) => { req.id = originalId; res.id = originalId; done2(); }); }; } idRemapMiddleware.createIdRemapMiddleware = createIdRemapMiddleware; var createAsyncMiddleware$3 = {}; Object.defineProperty(createAsyncMiddleware$3, "__esModule", { value: true }); createAsyncMiddleware$3.createAsyncMiddleware = void 0; function createAsyncMiddleware$2(asyncMiddleware) { return async (req, res, next, end) => { let resolveNextPromise; const nextPromise = new Promise((resolve) => { resolveNextPromise = resolve; }); let returnHandlerCallback = null; let nextWasCalled = false; const asyncNext = async () => { nextWasCalled = true; next((runReturnHandlersCallback) => { returnHandlerCallback = runReturnHandlersCallback; resolveNextPromise(); }); await nextPromise; }; try { await asyncMiddleware(req, res, asyncNext); if (nextWasCalled) { await nextPromise; returnHandlerCallback(null); } else { end(null); } } catch (error2) { if (returnHandlerCallback) { returnHandlerCallback(error2); } else { end(error2); } } }; } createAsyncMiddleware$3.createAsyncMiddleware = createAsyncMiddleware$2; var createScaffoldMiddleware$3 = {}; Object.defineProperty(createScaffoldMiddleware$3, "__esModule", { value: true }); createScaffoldMiddleware$3.createScaffoldMiddleware = void 0; function createScaffoldMiddleware$2(handlers) { return (req, res, next, end) => { const handler = handlers[req.method]; if (handler === void 0) { return next(); } if (typeof handler === "function") { return handler(req, res, next, end); } res.result = handler; return end(); }; } createScaffoldMiddleware$3.createScaffoldMiddleware = createScaffoldMiddleware$2; var JsonRpcEngine$1 = {}; var safeEventEmitter = {}; Object.defineProperty(safeEventEmitter, "__esModule", { value: true }); const events_1 = eventsExports; function safeApply(handler, context, args) { try { Reflect.apply(handler, context, args); } catch (err) { setTimeout(() => { throw err; }); } } function arrayClone(arr2) { const n2 = arr2.length; const copy = new Array(n2); for (let i2 = 0; i2 < n2; i2 += 1) { copy[i2] = arr2[i2]; } return copy; } let SafeEventEmitter$2 = class SafeEventEmitter extends events_1.EventEmitter { emit(type2, ...args) { let doError = type2 === "error"; const events2 = this._events; if (events2 !== void 0) { doError = doError && events2.error === void 0; } else if (!doError) { return false; } if (doError) { let er2; if (args.length > 0) { [er2] = args; } if (er2 instanceof Error) { throw er2; } const err = new Error(`Unhandled error.${er2 ? ` (${er2.message})` : ""}`); err.context = er2; throw err; } const handler = events2[type2]; if (handler === void 0) { return false; } if (typeof handler === "function") { safeApply(handler, this, args); } else { const len2 = handler.length; const listeners = arrayClone(handler); for (let i2 = 0; i2 < len2; i2 += 1) { safeApply(listeners[i2], this, args); } } return true; } }; safeEventEmitter.default = SafeEventEmitter$2; var dist = {}; var classes = {}; var fastSafeStringify = stringify$1; stringify$1.default = stringify$1; stringify$1.stable = deterministicStringify; stringify$1.stableStringify = deterministicStringify; var LIMIT_REPLACE_NODE = "[...]"; var CIRCULAR_REPLACE_NODE = "[Circular]"; var arr = []; var replacerStack = []; function defaultOptions() { return { depthLimit: Number.MAX_SAFE_INTEGER, edgesLimit: Number.MAX_SAFE_INTEGER }; } function stringify$1(obj, replacer, spacer, options) { if (typeof options === "undefined") { options = defaultOptions(); } decirc(obj, "", 0, [], void 0, 0, options); var res; try { if (replacerStack.length === 0) { res = JSON.stringify(obj, replacer, spacer); } else { res = JSON.stringify(obj, replaceGetterValues(replacer), spacer); } } catch (_2) { return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]"); } finally { while (arr.length !== 0) { var part = arr.pop(); if (part.length === 4) { Object.defineProperty(part[0], part[1], part[3]); } else { part[0][part[1]] = part[2]; } } } return res; } function setReplace(replace, val, k2, parent2) { var propertyDescriptor = Object.getOwnPropertyDescriptor(parent2, k2); if (propertyDescriptor.get !== void 0) { if (propertyDescriptor.configurable) { Object.defineProperty(parent2, k2, { value: replace }); arr.push([parent2, k2, val, propertyDescriptor]); } else { replacerStack.push([val, k2, replace]); } } else { parent2[k2] = replace; arr.push([parent2, k2, val]); } } function decirc(val, k2, edgeIndex, stack, parent2, depth, options) { depth += 1; var i2; if (typeof val === "object" && val !== null) { for (i2 = 0; i2 < stack.length; i2++) { if (stack[i2] === val) { setReplace(CIRCULAR_REPLACE_NODE, val, k2, parent2); return; } } if (typeof options.depthLimit !== "undefined" && depth > options.depthLimit) { setReplace(LIMIT_REPLACE_NODE, val, k2, parent2); return; } if (typeof options.edgesLimit !== "undefined" && edgeIndex + 1 > options.edgesLimit) { setReplace(LIMIT_REPLACE_NODE, val, k2, parent2); return; } stack.push(val); if (Array.isArray(val)) { for (i2 = 0; i2 < val.length; i2++) { decirc(val[i2], i2, i2, stack, val, depth, options); } } else { var keys2 = Object.keys(val); for (i2 = 0; i2 < keys2.length; i2++) { var key = keys2[i2]; decirc(val[key], key, i2, stack, val, depth, options); } } stack.pop(); } } function compareFunction(a2, b2) { if (a2 < b2) { return -1; } if (a2 > b2) { return 1; } return 0; } function deterministicStringify(obj, replacer, spacer, options) { if (typeof options === "undefined") { options = defaultOptions(); } var tmp = deterministicDecirc(obj, "", 0, [], void 0, 0, options) || obj; var res; try { if (replacerStack.length === 0) { res = JSON.stringify(tmp, replacer, spacer); } else { res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer); } } catch (_2) { return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]"); } finally { while (arr.length !== 0) { var part = arr.pop(); if (part.length === 4) { Object.defineProperty(part[0], part[1], part[3]); } else { part[0][part[1]] = part[2]; } } } return res; } function deterministicDecirc(val, k2, edgeIndex, stack, parent2, depth, options) { depth += 1; var i2; if (typeof val === "object" && val !== null) { for (i2 = 0; i2 < stack.length; i2++) { if (stack[i2] === val) { setReplace(CIRCULAR_REPLACE_NODE, val, k2, parent2); return; } } try { if (typeof val.toJSON === "function") { return; } } catch (_2) { return; } if (typeof options.depthLimit !== "undefined" && depth > options.depthLimit) { setReplace(LIMIT_REPLACE_NODE, val, k2, parent2); return; } if (typeof options.edgesLimit !== "undefined" && edgeIndex + 1 > options.edgesLimit) { setReplace(LIMIT_REPLACE_NODE, val, k2, parent2); return; } stack.push(val); if (Array.isArray(val)) { for (i2 = 0; i2 < val.length; i2++) { deterministicDecirc(val[i2], i2, i2, stack, val, depth, options); } } else { var tmp = {}; var keys2 = Object.keys(val).sort(compareFunction); for (i2 = 0; i2 < keys2.length; i2++) { var key = keys2[i2]; deterministicDecirc(val[key], key, i2, stack, val, depth, options); tmp[key] = val[key]; } if (typeof parent2 !== "undefined") { arr.push([parent2, k2, val]); parent2[k2] = tmp; } else { return tmp; } } stack.pop(); } } function replaceGetterValues(replacer) { replacer = typeof replacer !== "undefined" ? replacer : function(k2, v2) { return v2; }; return function(key, val) { if (replacerStack.length > 0) { for (var i2 = 0; i2 < replacerStack.length; i2++) { var part = replacerStack[i2]; if (part[1] === key && part[0] === val) { val = part[2]; replacerStack.splice(i2, 1); break; } } } return replacer.call(this, key, val); }; } Object.defineProperty(classes, "__esModule", { value: true }); classes.EthereumProviderError = classes.EthereumRpcError = void 0; const fast_safe_stringify_1 = fastSafeStringify; class EthereumRpcError extends Error { constructor(code2, message, data2) { if (!Number.isInteger(code2)) { throw new Error('"code" must be an integer.'); } if (!message || typeof message !== "string") { throw new Error('"message" must be a nonempty string.'); } super(message); this.code = code2; if (data2 !== void 0) { this.data = data2; } } /** * Returns a plain object with all public class properties. */ serialize() { const serialized = { code: this.code, message: this.message }; if (this.data !== void 0) { serialized.data = this.data; } if (this.stack) { serialized.stack = this.stack; } return serialized; } /** * Return a string representation of the serialized error, omitting * any circular references. */ toString() { return fast_safe_stringify_1.default(this.serialize(), stringifyReplacer, 2); } } classes.EthereumRpcError = EthereumRpcError; class EthereumProviderError extends EthereumRpcError { /** * Create an Ethereum Provider JSON-RPC error. * `code` must be an integer in the 1000 <= 4999 range. */ constructor(code2, message, data2) { if (!isValidEthProviderCode(code2)) { throw new Error('"code" must be an integer such that: 1000 <= code <= 4999'); } super(code2, message, data2); } } classes.EthereumProviderError = EthereumProviderError; function isValidEthProviderCode(code2) { return Number.isInteger(code2) && code2 >= 1e3 && code2 <= 4999; } function stringifyReplacer(_2, value) { if (value === "[Circular]") { return void 0; } return value; } var utils = {}; var errorConstants = {}; Object.defineProperty(errorConstants, "__esModule", { value: true }); errorConstants.errorValues = errorConstants.errorCodes = void 0; errorConstants.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 } }; errorConstants.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(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.serializeError = exports3.isValidCode = exports3.getMessageFromCode = exports3.JSON_RPC_SERVER_ERROR_MESSAGE = void 0; const error_constants_12 = errorConstants; const classes_12 = classes; const FALLBACK_ERROR_CODE = error_constants_12.errorCodes.rpc.internal; const FALLBACK_MESSAGE = "Unspecified error message. This is a bug, please report it."; const FALLBACK_ERROR = { code: FALLBACK_ERROR_CODE, message: getMessageFromCode(FALLBACK_ERROR_CODE) }; exports3.JSON_RPC_SERVER_ERROR_MESSAGE = "Unspecified server error."; function getMessageFromCode(code2, fallbackMessage = FALLBACK_MESSAGE) { if (Number.isInteger(code2)) { const codeString = code2.toString(); if (hasKey(error_constants_12.errorValues, codeString)) { return error_constants_12.errorValues[codeString].message; } if (isJsonRpcServerError(code2)) { return exports3.JSON_RPC_SERVER_ERROR_MESSAGE; } } return fallbackMessage; } exports3.getMessageFromCode = getMessageFromCode; function isValidCode(code2) { if (!Number.isInteger(code2)) { return false; } const codeString = code2.toString(); if (error_constants_12.errorValues[codeString]) { return true; } if (isJsonRpcServerError(code2)) { return true; } return false; } exports3.isValidCode = isValidCode; function serializeError2(error2, { fallbackError = FALLBACK_ERROR, shouldIncludeStack = false } = {}) { var _a2, _b2; if (!fallbackError || !Number.isInteger(fallbackError.code) || typeof fallbackError.message !== "string") { throw new Error("Must provide fallback error with integer number code and string message."); } if (error2 instanceof classes_12.EthereumRpcError) { return error2.serialize(); } const serialized = {}; if (error2 && typeof error2 === "object" && !Array.isArray(error2) && hasKey(error2, "code") && isValidCode(error2.code)) { const _error = error2; serialized.code = _error.code; if (_error.message && typeof _error.message === "string") { serialized.message = _error.message; if (hasKey(_error, "data")) { serialized.data = _error.data; } } else { serialized.message = getMessageFromCode(serialized.code); serialized.data = { originalError: assignOriginalError(error2) }; } } else { serialized.code = fallbackError.code; const message = (_a2 = error2) === null || _a2 === void 0 ? void 0 : _a2.message; serialized.message = message && typeof message === "string" ? message : fallbackError.message; serialized.data = { originalError: assignOriginalError(error2) }; } const stack = (_b2 = error2) === null || _b2 === void 0 ? void 0 : _b2.stack; if (shouldIncludeStack && error2 && stack && typeof stack === "string") { serialized.stack = stack; } return serialized; } exports3.serializeError = serializeError2; function isJsonRpcServerError(code2) { return code2 >= -32099 && code2 <= -32e3; } function assignOriginalError(error2) { if (error2 && typeof error2 === "object" && !Array.isArray(error2)) { return Object.assign({}, error2); } return error2; } function hasKey(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); } })(utils); var errors = {}; Object.defineProperty(errors, "__esModule", { value: true }); errors.ethErrors = void 0; const classes_1 = classes; const utils_1 = utils; const error_constants_1 = errorConstants; errors.ethErrors = { rpc: { /** * Get a JSON RPC 2.0 Parse (-32700) error. */ parse: (arg) => getEthJsonRpcError(error_constants_1.errorCodes.rpc.parse, arg), /** * Get a JSON RPC 2.0 Invalid Request (-32600) error. */ invalidRequest: (arg) => getEthJsonRpcError(error_constants_1.errorCodes.rpc.invalidRequest, arg), /** * Get a JSON RPC 2.0 Invalid Params (-32602) error. */ invalidParams: (arg) => getEthJsonRpcError(error_constants_1.errorCodes.rpc.invalidParams, arg), /** * Get a JSON RPC 2.0 Method Not Found (-32601) error. */ methodNotFound: (arg) => getEthJsonRpcError(error_constants_1.errorCodes.rpc.methodNotFound, arg), /** * Get a JSON RPC 2.0 Internal (-32603) error. */ internal: (arg) => getEthJsonRpcError(error_constants_1.errorCodes.rpc.internal, arg), /** * Get a JSON RPC 2.0 Server error. * Permits integer error codes in the [ -32099 <= -32005 ] range. * Codes -32000 through -32004 are reserved by EIP-1474. */ server: (opts) => { if (!opts || typeof opts !== "object" || Array.isArray(opts)) { throw new Error("Ethereum RPC Server errors must provide single object argument."); } const { code: code2 } = opts; if (!Number.isInteger(code2) || code2 > -32005 || code2 < -32099) { throw new Error('"code" must be an integer such that: -32099 <= code <= -32005'); } return getEthJsonRpcError(code2, opts); }, /** * Get an Ethereum JSON RPC Invalid Input (-32000) error. */ invalidInput: (arg) => getEthJsonRpcError(error_constants_1.errorCodes.rpc.invalidInput, arg), /** * Get an Ethereum JSON RPC Resource Not Found (-32001) error. */ resourceNotFound: (arg) => getEthJsonRpcError(error_constants_1.errorCodes.rpc.resourceNotFound, arg), /** * Get an Ethereum JSON RPC Resource Unavailable (-32002) error. */ resourceUnavailable: (arg) => getEthJsonRpcError(error_constants_1.errorCodes.rpc.resourceUnavailable, arg), /** * Get an Ethereum JSON RPC Transaction Rejected (-32003) error. */ transactionRejected: (arg) => getEthJsonRpcError(error_constants_1.errorCodes.rpc.transactionRejected, arg), /** * Get an Ethereum JSON RPC Method Not Supported (-32004) error. */ methodNotSupported: (arg) => getEthJsonRpcError(error_constants_1.errorCodes.rpc.methodNotSupported, arg), /** * Get an Ethereum JSON RPC Limit Exceeded (-32005) error. */ limitExceeded: (arg) => getEthJsonRpcError(error_constants_1.errorCodes.rpc.limitExceeded, arg) }, provider: { /** * Get an Ethereum Provider User Rejected Request (4001) error. */ userRejectedRequest: (arg) => { return getEthProviderError(error_constants_1.errorCodes.provider.userRejectedRequest, arg); }, /** * Get an Ethereum Provider Unauthorized (4100) error. */ unauthorized: (arg) => { return getEthProviderError(error_constants_1.errorCodes.provider.unauthorized, arg); }, /** * Get an Ethereum Provider Unsupported Method (4200) error. */ unsupportedMethod: (arg) => { return getEthProviderError(error_constants_1.errorCodes.provider.unsupportedMethod, arg); }, /** * Get an Ethereum Provider Not Connected (4900) error. */ disconnected: (arg) => { return getEthProviderError(error_constants_1.errorCodes.provider.disconnected, arg); }, /** * Get an Ethereum Provider Chain Not Connected (4901) error. */ chainDisconnected: (arg) => { return getEthProviderError(error_constants_1.errorCodes.provider.chainDisconnected, arg); }, /** * Get a custom Ethereum Provider error. */ custom: (opts) => { if (!opts || typeof opts !== "object" || Array.isArray(opts)) { throw new Error("Ethereum Provider custom errors must provide single object argument."); } const { code: code2, message, data: data2 } = opts; if (!message || typeof message !== "string") { throw new Error('"message" must be a nonempty string'); } return new classes_1.EthereumProviderError(code2, message, data2); } } }; function getEthJsonRpcError(code2, arg) { const [message, data2] = parseOpts(arg); return new classes_1.EthereumRpcError(code2, message || utils_1.getMessageFromCode(code2), data2); } function getEthProviderError(code2, arg) { const [message, data2] = parseOpts(arg); return new classes_1.EthereumProviderError(code2, message || utils_1.getMessageFromCode(code2), data2); } function parseOpts(arg) { if (arg) { if (typeof arg === "string") { return [arg]; } else if (typeof arg === "object" && !Array.isArray(arg)) { const { message, data: data2 } = arg; if (message && typeof message !== "string") { throw new Error("Must specify string message."); } return [message || void 0, data2]; } } return []; } (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.getMessageFromCode = exports3.serializeError = exports3.EthereumProviderError = exports3.EthereumRpcError = exports3.ethErrors = exports3.errorCodes = void 0; const classes_12 = classes; Object.defineProperty(exports3, "EthereumRpcError", { enumerable: true, get: function() { return classes_12.EthereumRpcError; } }); Object.defineProperty(exports3, "EthereumProviderError", { enumerable: true, get: function() { return classes_12.EthereumProviderError; } }); const utils_12 = utils; Object.defineProperty(exports3, "serializeError", { enumerable: true, get: function() { return utils_12.serializeError; } }); Object.defineProperty(exports3, "getMessageFromCode", { enumerable: true, get: function() { return utils_12.getMessageFromCode; } }); const errors_1 = errors; Object.defineProperty(exports3, "ethErrors", { enumerable: true, get: function() { return errors_1.ethErrors; } }); const error_constants_12 = errorConstants; Object.defineProperty(exports3, "errorCodes", { enumerable: true, get: function() { return error_constants_12.errorCodes; } }); })(dist); var __importDefault$2 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(JsonRpcEngine$1, "__esModule", { value: true }); JsonRpcEngine$1.JsonRpcEngine = void 0; const safe_event_emitter_1 = __importDefault$2(safeEventEmitter); const eth_rpc_errors_1 = dist; class JsonRpcEngine extends safe_event_emitter_1.default { constructor() { super(); this._middleware = []; } /** * Add a middleware function to the engine's middleware stack. * * @param middleware - The middleware function to add. */ push(middleware) { this._middleware.push(middleware); } handle(req, cb) { if (cb && typeof cb !== "function") { throw new Error('"callback" must be a function if provided.'); } if (Array.isArray(req)) { if (cb) { return this._handleBatch(req, cb); } return this._handleBatch(req); } if (cb) { return this._handle(req, cb); } return this._promiseHandle(req); } /** * Returns this engine as a middleware function that can be pushed to other * engines. * * @returns This engine as a middleware function. */ asMiddleware() { return async (req, res, next, end) => { try { const [middlewareError, isComplete, returnHandlers] = await JsonRpcEngine._runAllMiddleware(req, res, this._middleware); if (isComplete) { await JsonRpcEngine._runReturnHandlers(returnHandlers); return end(middlewareError); } return next(async (handlerCallback) => { try { await JsonRpcEngine._runReturnHandlers(returnHandlers); } catch (error2) { return handlerCallback(error2); } return handlerCallback(); }); } catch (error2) { return end(error2); } }; } async _handleBatch(reqs, cb) { try { const responses = await Promise.all( // 1. Begin executing each request in the order received reqs.map(this._promiseHandle.bind(this)) ); if (cb) { return cb(null, responses); } return responses; } catch (error2) { if (cb) { return cb(error2); } throw error2; } } /** * A promise-wrapped _handle. */ _promiseHandle(req) { return new Promise((resolve) => { this._handle(req, (_err, res) => { resolve(res); }); }); } /** * Ensures that the request object is valid, processes it, and passes any * error and the response object to the given callback. * * Does not reject. */ async _handle(callerReq, cb) { if (!callerReq || Array.isArray(callerReq) || typeof callerReq !== "object") { const error3 = new eth_rpc_errors_1.EthereumRpcError(eth_rpc_errors_1.errorCodes.rpc.invalidRequest, `Requests must be plain objects. Received: ${typeof callerReq}`, { request: callerReq }); return cb(error3, { id: void 0, jsonrpc: "2.0", error: error3 }); } if (typeof callerReq.method !== "string") { const error3 = new eth_rpc_errors_1.EthereumRpcError(eth_rpc_errors_1.errorCodes.rpc.invalidRequest, `Must specify a string method. Received: ${typeof callerReq.method}`, { request: callerReq }); return cb(error3, { id: callerReq.id, jsonrpc: "2.0", error: error3 }); } const req = Object.assign({}, callerReq); const res = { id: req.id, jsonrpc: req.jsonrpc }; let error2 = null; try { await this._processRequest(req, res); } catch (_error) { error2 = _error; } if (error2) { delete res.result; if (!res.error) { res.error = eth_rpc_errors_1.serializeError(error2); } } return cb(error2, res); } /** * For the given request and response, runs all middleware and their return * handlers, if any, and ensures that internal request processing semantics * are satisfied. */ async _processRequest(req, res) { const [error2, isComplete, returnHandlers] = await JsonRpcEngine._runAllMiddleware(req, res, this._middleware); JsonRpcEngine._checkForCompletion(req, res, isComplete); await JsonRpcEngine._runReturnHandlers(returnHandlers); if (error2) { throw error2; } } /** * Serially executes the given stack of middleware. * * @returns An array of any error encountered during middleware execution, * a boolean indicating whether the request was completed, and an array of * middleware-defined return handlers. */ static async _runAllMiddleware(req, res, middlewareStack) { const returnHandlers = []; let error2 = null; let isComplete = false; for (const middleware of middlewareStack) { [error2, isComplete] = await JsonRpcEngine._runMiddleware(req, res, middleware, returnHandlers); if (isComplete) { break; } } return [error2, isComplete, returnHandlers.reverse()]; } /** * Runs an individual middleware. * * @returns An array of any error encountered during middleware exection, * and a boolean indicating whether the request should end. */ static _runMiddleware(req, res, middleware, returnHandlers) { return new Promise((resolve) => { const end = (err) => { const error2 = err || res.error; if (error2) { res.error = eth_rpc_errors_1.serializeError(error2); } resolve([error2, true]); }; const next = (returnHandler) => { if (res.error) { end(res.error); } else { if (returnHandler) { if (typeof returnHandler !== "function") { end(new eth_rpc_errors_1.EthereumRpcError(eth_rpc_errors_1.errorCodes.rpc.internal, `JsonRpcEngine: "next" return handlers must be functions. Received "${typeof returnHandler}" for request: ${jsonify(req)}`, { request: req })); } returnHandlers.push(returnHandler); } resolve([null, false]); } }; try { middleware(req, res, next, end); } catch (error2) { end(error2); } }); } /** * Serially executes array of return handlers. The request and response are * assumed to be in their scope. */ static async _runReturnHandlers(handlers) { for (const handler of handlers) { await new Promise((resolve, reject) => { handler((err) => err ? reject(err) : resolve()); }); } } /** * Throws an error if the response has neither a result nor an error, or if * the "isComplete" flag is falsy. */ static _checkForCompletion(req, res, isComplete) { if (!("result" in res) && !("error" in res)) { throw new eth_rpc_errors_1.EthereumRpcError(eth_rpc_errors_1.errorCodes.rpc.internal, `JsonRpcEngine: Response has no error or result for request: ${jsonify(req)}`, { request: req }); } if (!isComplete) { throw new eth_rpc_errors_1.EthereumRpcError(eth_rpc_errors_1.errorCodes.rpc.internal, `JsonRpcEngine: Nothing ended request: ${jsonify(req)}`, { request: req }); } } } JsonRpcEngine$1.JsonRpcEngine = JsonRpcEngine; function jsonify(request) { return JSON.stringify(request, null, 2); } var mergeMiddleware$1 = {}; Object.defineProperty(mergeMiddleware$1, "__esModule", { value: true }); mergeMiddleware$1.mergeMiddleware = void 0; const JsonRpcEngine_1 = JsonRpcEngine$1; function mergeMiddleware(middlewareStack) { const engine = new JsonRpcEngine_1.JsonRpcEngine(); middlewareStack.forEach((middleware) => engine.push(middleware)); return engine.asMiddleware(); } mergeMiddleware$1.mergeMiddleware = mergeMiddleware; (function(exports3) { var __createBinding2 = commonjsGlobal && commonjsGlobal.__createBinding || (Object.create ? function(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; Object.defineProperty(o2, k22, { enumerable: true, get: function() { return m2[k2]; } }); } : function(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; o2[k22] = m2[k2]; }); var __exportStar2 = commonjsGlobal && commonjsGlobal.__exportStar || function(m2, exports4) { for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports4, p2)) __createBinding2(exports4, m2, p2); }; Object.defineProperty(exports3, "__esModule", { value: true }); __exportStar2(idRemapMiddleware, exports3); __exportStar2(createAsyncMiddleware$3, exports3); __exportStar2(createScaffoldMiddleware$3, exports3); __exportStar2(getUniqueId$1, exports3); __exportStar2(JsonRpcEngine$1, exports3); __exportStar2(mergeMiddleware$1, exports3); })(dist$1); var lib = {}; var Mutex$2 = {}; var extendStatics = function(d2, b2) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) { d3.__proto__ = b3; } || function(d3, b3) { for (var p2 in b3) if (Object.prototype.hasOwnProperty.call(b3, p2)) d3[p2] = b3[p2]; }; return extendStatics(d2, b2); }; function __extends(d2, b2) { if (typeof b2 !== "function" && b2 !== null) throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null"); extendStatics(d2, b2); function __() { this.constructor = d2; } d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign2(t2) { for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { s2 = arguments[i2]; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2]; } return t2; }; return __assign.apply(this, arguments); }; function __rest(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; } function __decorate(decorators, target, key, desc) { var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc); else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2; return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2; } function __param(paramIndex, decorator) { return function(target, key) { decorator(target, key, paramIndex); }; } function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { function accept(f2) { if (f2 !== void 0 && typeof f2 !== "function") throw new TypeError("Function expected"); return f2; } var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _2, done2 = false; for (var i2 = decorators.length - 1; i2 >= 0; i2--) { var context = {}; for (var p2 in contextIn) context[p2] = p2 === "access" ? {} : contextIn[p2]; for (var p2 in contextIn.access) context.access[p2] = contextIn.access[p2]; context.addInitializer = function(f2) { if (done2) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f2 || null)); }; var result = (0, decorators[i2])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); if (_2 = accept(result.get)) descriptor.get = _2; if (_2 = accept(result.set)) descriptor.set = _2; if (_2 = accept(result.init)) initializers.unshift(_2); } else if (_2 = accept(result)) { if (kind === "field") initializers.unshift(_2); else descriptor[key] = _2; } } if (target) Object.defineProperty(target, contextIn.name, descriptor); done2 = true; } function __runInitializers(thisArg, initializers, value) { var useValue = arguments.length > 2; for (var i2 = 0; i2 < initializers.length; i2++) { value = useValue ? initializers[i2].call(thisArg, value) : initializers[i2].call(thisArg); } return useValue ? value : void 0; } function __propKey(x2) { return typeof x2 === "symbol" ? x2 : "".concat(x2); } function __setFunctionName(f2, name2, prefix) { if (typeof name2 === "symbol") name2 = name2.description ? "[".concat(name2.description, "]") : ""; return Object.defineProperty(f2, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 }); } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P2, generator) { function adopt(value) { return value instanceof P2 ? value : new P2(function(resolve) { resolve(value); }); } return new (P2 || (P2 = Promise))(function(resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e2) { reject(e2); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e2) { reject(e2); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _2 = { label: 0, sent: function() { if (t2[0] & 1) throw t2[1]; return t2[1]; }, trys: [], ops: [] }, f2, y2, t2, g2; return g2 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g2[Symbol.iterator] = function() { return this; }), g2; function verb(n2) { return function(v2) { return step([n2, v2]); }; } function step(op) { if (f2) throw new TypeError("Generator is already executing."); while (g2 && (g2 = 0, op[0] && (_2 = 0)), _2) try { if (f2 = 1, y2 && (t2 = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t2 = y2["return"]) && t2.call(y2), 0) : y2.next) && !(t2 = t2.call(y2, op[1])).done) return t2; if (y2 = 0, t2) op = [op[0] & 2, t2.value]; switch (op[0]) { case 0: case 1: t2 = op; break; case 4: _2.label++; return { value: op[1], done: false }; case 5: _2.label++; y2 = op[1]; op = [0]; continue; case 7: op = _2.ops.pop(); _2.trys.pop(); continue; default: if (!(t2 = _2.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) { _2 = 0; continue; } if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) { _2.label = op[1]; break; } if (op[0] === 6 && _2.label < t2[1]) { _2.label = t2[1]; t2 = op; break; } if (t2 && _2.label < t2[2]) { _2.label = t2[2]; _2.ops.push(op); break; } if (t2[2]) _2.ops.pop(); _2.trys.pop(); continue; } op = body.call(thisArg, _2); } catch (e2) { op = [6, e2]; y2 = 0; } finally { f2 = t2 = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? function(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; var desc = Object.getOwnPropertyDescriptor(m2, k2); if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m2[k2]; } }; } Object.defineProperty(o2, k22, desc); } : function(o2, m2, k2, k22) { if (k22 === void 0) k22 = k2; o2[k22] = m2[k2]; }; function __exportStar(m2, o2) { for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(o2, p2)) __createBinding(o2, m2, p2); } function __values(o2) { var s2 = typeof Symbol === "function" && Symbol.iterator, m2 = s2 && o2[s2], i2 = 0; if (m2) return m2.call(o2); if (o2 && typeof o2.length === "number") return { next: function() { if (o2 && i2 >= o2.length) o2 = void 0; return { value: o2 && o2[i2++], done: !o2 }; } }; throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o2, n2) { var m2 = typeof Symbol === "function" && o2[Symbol.iterator]; if (!m2) return o2; var i2 = m2.call(o2), r2, ar2 = [], e2; try { while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done) ar2.push(r2.value); } catch (error2) { e2 = { error: error2 }; } finally { try { if (r2 && !r2.done && (m2 = i2["return"])) m2.call(i2); } finally { if (e2) throw e2.error; } } return ar2; } function __spread() { for (var ar2 = [], i2 = 0; i2 < arguments.length; i2++) ar2 = ar2.concat(__read(arguments[i2])); return ar2; } function __spreadArrays() { for (var s2 = 0, i2 = 0, il = arguments.length; i2 < il; i2++) s2 += arguments[i2].length; for (var r2 = Array(s2), k2 = 0, i2 = 0; i2 < il; i2++) for (var a2 = arguments[i2], j2 = 0, jl = a2.length; j2 < jl; j2++, k2++) r2[k2] = a2[j2]; return r2; } function __spreadArray(to2, from2, pack) { if (pack || arguments.length === 2) for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) { if (ar2 || !(i2 in from2)) { if (!ar2) ar2 = Array.prototype.slice.call(from2, 0, i2); ar2[i2] = from2[i2]; } } return to2.concat(ar2 || Array.prototype.slice.call(from2)); } function __await(v2) { return this instanceof __await ? (this.v = v2, this) : new __await(v2); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g2 = generator.apply(thisArg, _arguments || []), i2, q2 = []; return i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { return this; }, i2; function verb(n2) { if (g2[n2]) i2[n2] = function(v2) { return new Promise(function(a2, b2) { q2.push([n2, v2, a2, b2]) > 1 || resume(n2, v2); }); }; } function resume(n2, v2) { try { step(g2[n2](v2)); } catch (e2) { settle(q2[0][3], e2); } } function step(r2) { r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q2[0][2], r2); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f2, v2) { if (f2(v2), q2.shift(), q2.length) resume(q2[0][0], q2[0][1]); } } function __asyncDelegator(o2) { var i2, p2; return i2 = {}, verb("next"), verb("throw", function(e2) { throw e2; }), verb("return"), i2[Symbol.iterator] = function() { return this; }, i2; function verb(n2, f2) { i2[n2] = o2[n2] ? function(v2) { return (p2 = !p2) ? { value: __await(o2[n2](v2)), done: false } : f2 ? f2(v2) : v2; } : f2; } } function __asyncValues(o2) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m2 = o2[Symbol.asyncIterator], i2; return m2 ? m2.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { return this; }, i2); function verb(n2) { i2[n2] = o2[n2] && function(v2) { return new Promise(function(resolve, reject) { v2 = o2[n2](v2), settle(resolve, reject, v2.done, v2.value); }); }; } function settle(resolve, reject, d2, v2) { Promise.resolve(v2).then(function(v3) { resolve({ value: v3, done: d2 }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; } var __setModuleDefault = Object.create ? function(o2, v2) { Object.defineProperty(o2, "default", { enumerable: true, value: v2 }); } : function(o2, v2) { o2["default"] = v2; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k2 in mod) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2); } __setModuleDefault(result, mod); return result; } function __importDefault$1(mod) { return mod && mod.__esModule ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, state2, kind, f2) { if (kind === "a" && !f2) throw new TypeError("Private accessor was defined without a getter"); if (typeof state2 === "function" ? receiver !== state2 || !f2 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f2 : kind === "a" ? f2.call(receiver) : f2 ? f2.value : state2.get(receiver); } function __classPrivateFieldSet(receiver, state2, value, kind, f2) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f2) throw new TypeError("Private accessor was defined without a setter"); if (typeof state2 === "function" ? receiver !== state2 || !f2 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return kind === "a" ? f2.call(receiver, value) : f2 ? f2.value = value : state2.set(receiver, value), value; } function __classPrivateFieldIn(state2, receiver) { if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object"); return typeof state2 === "function" ? receiver === state2 : state2.has(receiver); } function __addDisposableResource(env2, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); var dispose2; if (async) { if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); dispose2 = value[Symbol.asyncDispose]; } if (dispose2 === void 0) { if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); dispose2 = value[Symbol.dispose]; } if (typeof dispose2 !== "function") throw new TypeError("Object not disposable."); env2.stack.push({ value, dispose: dispose2, async }); } else if (async) { env2.stack.push({ async: true }); } return value; } var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) { var e2 = new Error(message); return e2.name = "SuppressedError", e2.error = error2, e2.suppressed = suppressed, e2; }; function __disposeResources(env2) { function fail(e2) { env2.error = env2.hasError ? new _SuppressedError(e2, env2.error, "An error was suppressed during disposal.") : e2; env2.hasError = true; } function next() { while (env2.stack.length) { var rec = env2.stack.pop(); try { var result = rec.dispose && rec.dispose.call(rec.value); if (rec.async) return Promise.resolve(result).then(next, function(e2) { fail(e2); return next(); }); } catch (e2) { fail(e2); } } if (env2.hasError) throw env2.error; } return next(); } const tslib_es6 = { __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault: __importDefault$1, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources }; const tslib_es6$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, __addDisposableResource, get __assign() { return __assign; }, __asyncDelegator, __asyncGenerator, __asyncValues, __await, __awaiter, __classPrivateFieldGet, __classPrivateFieldIn, __classPrivateFieldSet, __createBinding, __decorate, __disposeResources, __esDecorate, __exportStar, __extends, __generator, __importDefault: __importDefault$1, __importStar, __makeTemplateObject, __metadata, __param, __propKey, __read, __rest, __runInitializers, __setFunctionName, __spread, __spreadArray, __spreadArrays, __values, default: tslib_es6 }, Symbol.toStringTag, { value: "Module" })); const require$$0$2 = /* @__PURE__ */ getAugmentedNamespace(tslib_es6$1); var Semaphore$1 = {}; Object.defineProperty(Semaphore$1, "__esModule", { value: true }); var tslib_1$2 = require$$0$2; var Semaphore = ( /** @class */ function() { function Semaphore2(_maxConcurrency) { this._maxConcurrency = _maxConcurrency; this._queue = []; if (_maxConcurrency <= 0) { throw new Error("semaphore must be initialized to a positive value"); } this._value = _maxConcurrency; } Semaphore2.prototype.acquire = function() { var _this = this; var locked = this.isLocked(); var ticket = new Promise(function(r2) { return _this._queue.push(r2); }); if (!locked) this._dispatch(); return ticket; }; Semaphore2.prototype.runExclusive = function(callback) { return tslib_1$2.__awaiter(this, void 0, void 0, function() { var _a2, value, release; return tslib_1$2.__generator(this, function(_b2) { switch (_b2.label) { case 0: return [4, this.acquire()]; case 1: _a2 = _b2.sent(), value = _a2[0], release = _a2[1]; _b2.label = 2; case 2: _b2.trys.push([2, , 4, 5]); return [4, callback(value)]; case 3: return [2, _b2.sent()]; case 4: release(); return [ 7 /*endfinally*/ ]; case 5: return [ 2 /*return*/ ]; } }); }); }; Semaphore2.prototype.isLocked = function() { return this._value <= 0; }; Semaphore2.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 releaser = this._currentReleaser; this._currentReleaser = void 0; releaser(); } }; Semaphore2.prototype._dispatch = function() { var _this = this; var nextConsumer = this._queue.shift(); if (!nextConsumer) return; var released = false; this._currentReleaser = function() { if (released) return; released = true; _this._value++; _this._dispatch(); }; nextConsumer([this._value--, this._currentReleaser]); }; return Semaphore2; }() ); Semaphore$1.default = Semaphore; Object.defineProperty(Mutex$2, "__esModule", { value: true }); var tslib_1$1 = require$$0$2; var Semaphore_1 = Semaphore$1; var Mutex$1 = ( /** @class */ function() { function Mutex2() { this._semaphore = new Semaphore_1.default(1); } Mutex2.prototype.acquire = function() { return tslib_1$1.__awaiter(this, void 0, void 0, function() { var _a2, releaser; return tslib_1$1.__generator(this, function(_b2) { switch (_b2.label) { case 0: return [4, this._semaphore.acquire()]; case 1: _a2 = _b2.sent(), releaser = _a2[1]; return [2, releaser]; } }); }); }; Mutex2.prototype.runExclusive = function(callback) { return this._semaphore.runExclusive(function() { return callback(); }); }; Mutex2.prototype.isLocked = function() { return this._semaphore.isLocked(); }; Mutex2.prototype.release = function() { this._semaphore.release(); }; return Mutex2; }() ); Mutex$2.default = Mutex$1; var withTimeout$1 = {}; Object.defineProperty(withTimeout$1, "__esModule", { value: true }); withTimeout$1.withTimeout = void 0; var tslib_1 = require$$0$2; function withTimeout(sync, timeout2, timeoutError) { var _this = this; if (timeoutError === void 0) { timeoutError = new Error("timeout"); } return { acquire: function() { return new Promise(function(resolve, reject) { return tslib_1.__awaiter(_this, void 0, void 0, function() { var isTimeout, ticket, release; return tslib_1.__generator(this, function(_a2) { switch (_a2.label) { case 0: isTimeout = false; setTimeout(function() { isTimeout = true; reject(timeoutError); }, timeout2); return [4, sync.acquire()]; case 1: ticket = _a2.sent(); if (isTimeout) { release = Array.isArray(ticket) ? ticket[1] : ticket; release(); } else { resolve(ticket); } return [ 2 /*return*/ ]; } }); }); }); }, runExclusive: function(callback) { return tslib_1.__awaiter(this, void 0, void 0, function() { var release, ticket; return tslib_1.__generator(this, function(_a2) { switch (_a2.label) { case 0: release = function() { return void 0; }; _a2.label = 1; case 1: _a2.trys.push([1, , 7, 8]); return [4, this.acquire()]; case 2: ticket = _a2.sent(); if (!Array.isArray(ticket)) return [3, 4]; release = ticket[1]; return [4, callback(ticket[0])]; case 3: return [2, _a2.sent()]; case 4: release = ticket; return [4, callback()]; case 5: return [2, _a2.sent()]; case 6: return [3, 8]; case 7: release(); return [ 7 /*endfinally*/ ]; case 8: return [ 2 /*return*/ ]; } }); }); }, release: function() { sync.release(); }, isLocked: function() { return sync.isLocked(); } }; } withTimeout$1.withTimeout = withTimeout; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.withTimeout = exports3.Semaphore = exports3.Mutex = void 0; var Mutex_1 = Mutex$2; Object.defineProperty(exports3, "Mutex", { enumerable: true, get: function() { return Mutex_1.default; } }); var Semaphore_12 = Semaphore$1; Object.defineProperty(exports3, "Semaphore", { enumerable: true, get: function() { return Semaphore_12.default; } }); var withTimeout_1 = withTimeout$1; Object.defineProperty(exports3, "withTimeout", { enumerable: true, get: function() { return withTimeout_1.withTimeout; } }); })(lib); var immutable = extend$1; var hasOwnProperty = Object.prototype.hasOwnProperty; function extend$1() { var target = {}; for (var i2 = 0; i2 < arguments.length; i2++) { var source = arguments[i2]; for (var key in source) { if (hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; } const extend = immutable; const createRandomId = jsonRpcRandomId(); var ethQuery = EthQuery$1; function EthQuery$1(provider) { const self2 = this; self2.currentProvider = provider; } EthQuery$1.prototype.getBalance = generateFnWithDefaultBlockFor(2, "eth_getBalance"); EthQuery$1.prototype.getCode = generateFnWithDefaultBlockFor(2, "eth_getCode"); EthQuery$1.prototype.getTransactionCount = generateFnWithDefaultBlockFor(2, "eth_getTransactionCount"); EthQuery$1.prototype.getStorageAt = generateFnWithDefaultBlockFor(3, "eth_getStorageAt"); EthQuery$1.prototype.call = generateFnWithDefaultBlockFor(2, "eth_call"); EthQuery$1.prototype.protocolVersion = generateFnFor("eth_protocolVersion"); EthQuery$1.prototype.syncing = generateFnFor("eth_syncing"); EthQuery$1.prototype.coinbase = generateFnFor("eth_coinbase"); EthQuery$1.prototype.mining = generateFnFor("eth_mining"); EthQuery$1.prototype.hashrate = generateFnFor("eth_hashrate"); EthQuery$1.prototype.gasPrice = generateFnFor("eth_gasPrice"); EthQuery$1.prototype.accounts = generateFnFor("eth_accounts"); EthQuery$1.prototype.blockNumber = generateFnFor("eth_blockNumber"); EthQuery$1.prototype.getBlockTransactionCountByHash = generateFnFor("eth_getBlockTransactionCountByHash"); EthQuery$1.prototype.getBlockTransactionCountByNumber = generateFnFor("eth_getBlockTransactionCountByNumber"); EthQuery$1.prototype.getUncleCountByBlockHash = generateFnFor("eth_getUncleCountByBlockHash"); EthQuery$1.prototype.getUncleCountByBlockNumber = generateFnFor("eth_getUncleCountByBlockNumber"); EthQuery$1.prototype.sign = generateFnFor("eth_sign"); EthQuery$1.prototype.sendTransaction = generateFnFor("eth_sendTransaction"); EthQuery$1.prototype.sendRawTransaction = generateFnFor("eth_sendRawTransaction"); EthQuery$1.prototype.estimateGas = generateFnFor("eth_estimateGas"); EthQuery$1.prototype.getBlockByHash = generateFnFor("eth_getBlockByHash"); EthQuery$1.prototype.getBlockByNumber = generateFnFor("eth_getBlockByNumber"); EthQuery$1.prototype.getTransactionByHash = generateFnFor("eth_getTransactionByHash"); EthQuery$1.prototype.getTransactionByBlockHashAndIndex = generateFnFor("eth_getTransactionByBlockHashAndIndex"); EthQuery$1.prototype.getTransactionByBlockNumberAndIndex = generateFnFor("eth_getTransactionByBlockNumberAndIndex"); EthQuery$1.prototype.getTransactionReceipt = generateFnFor("eth_getTransactionReceipt"); EthQuery$1.prototype.getUncleByBlockHashAndIndex = generateFnFor("eth_getUncleByBlockHashAndIndex"); EthQuery$1.prototype.getUncleByBlockNumberAndIndex = generateFnFor("eth_getUncleByBlockNumberAndIndex"); EthQuery$1.prototype.getCompilers = generateFnFor("eth_getCompilers"); EthQuery$1.prototype.compileLLL = generateFnFor("eth_compileLLL"); EthQuery$1.prototype.compileSolidity = generateFnFor("eth_compileSolidity"); EthQuery$1.prototype.compileSerpent = generateFnFor("eth_compileSerpent"); EthQuery$1.prototype.newFilter = generateFnFor("eth_newFilter"); EthQuery$1.prototype.newBlockFilter = generateFnFor("eth_newBlockFilter"); EthQuery$1.prototype.newPendingTransactionFilter = generateFnFor("eth_newPendingTransactionFilter"); EthQuery$1.prototype.uninstallFilter = generateFnFor("eth_uninstallFilter"); EthQuery$1.prototype.getFilterChanges = generateFnFor("eth_getFilterChanges"); EthQuery$1.prototype.getFilterLogs = generateFnFor("eth_getFilterLogs"); EthQuery$1.prototype.getLogs = generateFnFor("eth_getLogs"); EthQuery$1.prototype.getWork = generateFnFor("eth_getWork"); EthQuery$1.prototype.submitWork = generateFnFor("eth_submitWork"); EthQuery$1.prototype.submitHashrate = generateFnFor("eth_submitHashrate"); EthQuery$1.prototype.sendAsync = function(opts, cb) { const self2 = this; self2.currentProvider.sendAsync(createPayload(opts), function(err, response) { if (!err && response.error) err = new Error("EthQuery - RPC Error - " + response.error.message); if (err) return cb(err); cb(null, response.result); }); }; function generateFnFor(methodName) { return function() { const self2 = this; var args = [].slice.call(arguments); var cb = args.pop(); self2.sendAsync({ method: methodName, params: args }, cb); }; } function generateFnWithDefaultBlockFor(argCount, methodName) { return function() { const self2 = this; var args = [].slice.call(arguments); var cb = args.pop(); if (args.length < argCount) args.push("latest"); self2.sendAsync({ method: methodName, params: args }, cb); }; } function createPayload(data2) { return extend({ // defaults id: createRandomId(), jsonrpc: "2.0", params: [] // user-specified }, data2); } const processFn = (fn2, options, proxy2, unwrapped) => function(...arguments_) { const P2 = options.promiseModule; return new P2((resolve, reject) => { if (options.multiArgs) { arguments_.push((...result) => { if (options.errorFirst) { if (result[0]) { reject(result); } else { result.shift(); resolve(result); } } else { resolve(result); } }); } else if (options.errorFirst) { arguments_.push((error2, result) => { if (error2) { reject(error2); } else { resolve(result); } }); } else { arguments_.push(resolve); } const self2 = this === proxy2 ? unwrapped : this; Reflect.apply(fn2, self2, arguments_); }); }; const filterCache = /* @__PURE__ */ new WeakMap(); var pify$1 = (input, options) => { options = { exclude: [/.+(?:Sync|Stream)$/], errorFirst: true, promiseModule: Promise, ...options }; const objectType2 = typeof input; if (!(input !== null && (objectType2 === "object" || objectType2 === "function"))) { throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${input === null ? "null" : objectType2}\``); } const filter = (target, key) => { let cached = filterCache.get(target); if (!cached) { cached = {}; filterCache.set(target, cached); } if (key in cached) { return cached[key]; } const match = (pattern2) => typeof pattern2 === "string" || typeof key === "symbol" ? key === pattern2 : pattern2.test(key); const desc = Reflect.getOwnPropertyDescriptor(target, key); const writableOrConfigurableOwn = desc === void 0 || desc.writable || desc.configurable; const included = options.include ? options.include.some(match) : !options.exclude.some(match); const shouldFilter = included && writableOrConfigurableOwn; cached[key] = shouldFilter; return shouldFilter; }; const cache = /* @__PURE__ */ new WeakMap(); const proxy2 = new Proxy(input, { apply(target, thisArg, args) { const cached = cache.get(target); if (cached) { return Reflect.apply(cached, thisArg, args); } const pified = options.excludeMain ? target : processFn(target, options, proxy2, target); cache.set(target, pified); return Reflect.apply(pified, thisArg, args); }, get(target, key) { const property = target[key]; if (!filter(target, key) || property === Function.prototype[key]) { return property; } const cached = cache.get(property); if (cached) { return cached; } if (typeof property === "function") { const pified = processFn(property, options, proxy2, target); cache.set(property, pified); return pified; } return property; } }); return proxy2; }; const SafeEventEmitter$1 = cjs$2.default; let BaseFilter$3 = class BaseFilter extends SafeEventEmitter$1 { constructor() { super(); this.updates = []; } async initialize() { } async update() { throw new Error("BaseFilter - no update method specified"); } addResults(newResults) { this.updates = this.updates.concat(newResults); newResults.forEach((result) => this.emit("update", result)); } addInitialResults(newResults) { } getChangesAndClear() { const updates = this.updates; this.updates = []; return updates; } }; var baseFilter = BaseFilter$3; const BaseFilter$2 = baseFilter; let BaseFilterWithHistory$1 = class BaseFilterWithHistory extends BaseFilter$2 { constructor() { super(); this.allResults = []; } async update() { throw new Error("BaseFilterWithHistory - no update method specified"); } addResults(newResults) { this.allResults = this.allResults.concat(newResults); super.addResults(newResults); } addInitialResults(newResults) { this.allResults = this.allResults.concat(newResults); super.addInitialResults(newResults); } getAllResults() { return this.allResults; } }; var baseFilterHistory = BaseFilterWithHistory$1; var hexUtils = { minBlockRef: minBlockRef$1, maxBlockRef, sortBlockRefs, bnToHex: bnToHex$1, blockRefIsNumber: blockRefIsNumber$1, hexToInt: hexToInt$3, incrementHexInt: incrementHexInt$4, intToHex: intToHex$2, unsafeRandomBytes: unsafeRandomBytes$1 }; function minBlockRef$1(...refs) { const sortedRefs = sortBlockRefs(refs); return sortedRefs[0]; } function maxBlockRef(...refs) { const sortedRefs = sortBlockRefs(refs); return sortedRefs[sortedRefs.length - 1]; } function sortBlockRefs(refs) { return refs.sort((refA, refB) => { if (refA === "latest" || refB === "earliest") return 1; if (refB === "latest" || refA === "earliest") return -1; return hexToInt$3(refA) - hexToInt$3(refB); }); } function bnToHex$1(bn2) { return "0x" + bn2.toString(16); } function blockRefIsNumber$1(blockRef) { return blockRef && !["earliest", "latest", "pending"].includes(blockRef); } function hexToInt$3(hexString) { if (hexString === void 0 || hexString === null) return hexString; return Number.parseInt(hexString, 16); } function incrementHexInt$4(hexString) { if (hexString === void 0 || hexString === null) return hexString; const value = hexToInt$3(hexString); return intToHex$2(value + 1); } function intToHex$2(int2) { if (int2 === void 0 || int2 === null) return int2; let hexString = int2.toString(16); const needsLeftPad = hexString.length % 2; if (needsLeftPad) hexString = "0" + hexString; return "0x" + hexString; } function unsafeRandomBytes$1(byteCount) { let result = "0x"; for (let i2 = 0; i2 < byteCount; i2++) { result += unsafeRandomNibble(); result += unsafeRandomNibble(); } return result; } function unsafeRandomNibble() { return Math.floor(Math.random() * 16).toString(16); } const EthQuery = ethQuery; const pify = pify$1; const BaseFilterWithHistory = baseFilterHistory; const { bnToHex, hexToInt: hexToInt$2, incrementHexInt: incrementHexInt$3, minBlockRef, blockRefIsNumber } = hexUtils; let LogFilter$1 = class LogFilter extends BaseFilterWithHistory { constructor({ provider, params }) { super(); this.type = "log"; this.ethQuery = new EthQuery(provider); this.params = Object.assign({ fromBlock: "latest", toBlock: "latest", address: void 0, topics: [] }, params); if (this.params.address) { if (!Array.isArray(this.params.address)) { this.params.address = [this.params.address]; } this.params.address = this.params.address.map((address) => address.toLowerCase()); } } async initialize({ currentBlock }) { let fromBlock = this.params.fromBlock; if (["latest", "pending"].includes(fromBlock)) fromBlock = currentBlock; if ("earliest" === fromBlock) fromBlock = "0x0"; this.params.fromBlock = fromBlock; const toBlock = minBlockRef(this.params.toBlock, currentBlock); const params = Object.assign({}, this.params, { toBlock }); const newLogs = await this._fetchLogs(params); this.addInitialResults(newLogs); } async update({ oldBlock, newBlock }) { const toBlock = newBlock; let fromBlock; if (oldBlock) { fromBlock = incrementHexInt$3(oldBlock); } else { fromBlock = newBlock; } const params = Object.assign({}, this.params, { fromBlock, toBlock }); const newLogs = await this._fetchLogs(params); const matchingLogs = newLogs.filter((log2) => this.matchLog(log2)); this.addResults(matchingLogs); } async _fetchLogs(params) { const newLogs = await pify((cb) => this.ethQuery.getLogs(params, cb))(); return newLogs; } matchLog(log2) { if (hexToInt$2(this.params.fromBlock) >= hexToInt$2(log2.blockNumber)) return false; if (blockRefIsNumber(this.params.toBlock) && hexToInt$2(this.params.toBlock) <= hexToInt$2(log2.blockNumber)) return false; const normalizedLogAddress = log2.address && log2.address.toLowerCase(); if (this.params.address && normalizedLogAddress && !this.params.address.includes(normalizedLogAddress)) return false; const topicsMatch = this.params.topics.every((topicPattern, index2) => { let logTopic = log2.topics[index2]; if (!logTopic) return false; logTopic = logTopic.toLowerCase(); let subtopicsToMatch = Array.isArray(topicPattern) ? topicPattern : [topicPattern]; const subtopicsIncludeWildcard = subtopicsToMatch.includes(null); if (subtopicsIncludeWildcard) return true; subtopicsToMatch = subtopicsToMatch.map((topic) => topic.toLowerCase()); const topicDoesMatch = subtopicsToMatch.includes(logTopic); return topicDoesMatch; }); return topicsMatch; } }; var logFilter = LogFilter$1; var getBlocksForRange_1 = getBlocksForRange$3; async function getBlocksForRange$3({ provider, fromBlock, toBlock }) { if (!fromBlock) fromBlock = toBlock; const fromBlockNumber = hexToInt$1(fromBlock); const toBlockNumber = hexToInt$1(toBlock); const blockCountToQuery = toBlockNumber - fromBlockNumber + 1; const missingBlockNumbers = Array(blockCountToQuery).fill().map((_2, index2) => fromBlockNumber + index2).map(intToHex$1); let blockBodies = await Promise.all( missingBlockNumbers.map((blockNum) => query(provider, "eth_getBlockByNumber", [blockNum, false])) ); blockBodies = blockBodies.filter((block) => block !== null); return blockBodies; } function hexToInt$1(hexString) { if (hexString === void 0 || hexString === null) return hexString; return Number.parseInt(hexString, 16); } function intToHex$1(int2) { if (int2 === void 0 || int2 === null) return int2; const hexString = int2.toString(16); return "0x" + hexString; } function sendAsync(provider, request) { return new Promise((resolve, reject) => { provider.sendAsync(request, (error2, response) => { if (error2) { reject(error2); } else if (response.error) { reject(response.error); } else if (response.result) { resolve(response.result); } else { reject(new Error("Result was empty")); } }); }); } async function query(provider, method, params) { for (let i2 = 0; i2 < 3; i2++) { try { return await sendAsync(provider, { id: 1, jsonrpc: "2.0", method, params }); } catch (error2) { console.error( `provider.sendAsync failed: ${error2.stack || error2.message || error2}` ); } } return null; } const BaseFilter$1 = baseFilter; const getBlocksForRange$2 = getBlocksForRange_1; const { incrementHexInt: incrementHexInt$2 } = hexUtils; let BlockFilter$1 = class BlockFilter extends BaseFilter$1 { constructor({ provider, params }) { super(); this.type = "block"; this.provider = provider; } async update({ oldBlock, newBlock }) { const toBlock = newBlock; const fromBlock = incrementHexInt$2(oldBlock); const blockBodies = await getBlocksForRange$2({ provider: this.provider, fromBlock, toBlock }); const blockHashes = blockBodies.map((block) => block.hash); this.addResults(blockHashes); } }; var blockFilter = BlockFilter$1; const BaseFilter = baseFilter; const getBlocksForRange$1 = getBlocksForRange_1; const { incrementHexInt: incrementHexInt$1 } = hexUtils; let TxFilter$1 = class TxFilter extends BaseFilter { constructor({ provider }) { super(); this.type = "tx"; this.provider = provider; } async update({ oldBlock }) { const toBlock = oldBlock; const fromBlock = incrementHexInt$1(oldBlock); const blocks = await getBlocksForRange$1({ provider: this.provider, fromBlock, toBlock }); const blockTxHashes = []; for (const block of blocks) { blockTxHashes.push(...block.transactions); } this.addResults(blockTxHashes); } }; var txFilter = TxFilter$1; const Mutex = lib.Mutex; const { createAsyncMiddleware: createAsyncMiddleware$1, createScaffoldMiddleware: createScaffoldMiddleware$1 } = dist$1; const LogFilter = logFilter; const BlockFilter = blockFilter; const TxFilter = txFilter; const { intToHex, hexToInt } = hexUtils; var ethJsonRpcFilters = createEthFilterMiddleware; function createEthFilterMiddleware({ blockTracker, provider }) { let filterIndex = 0; let filters = {}; const mutex = new Mutex(); const waitForFree = mutexMiddlewareWrapper({ mutex }); const middleware = createScaffoldMiddleware$1({ // install filters eth_newFilter: waitForFree(toFilterCreationMiddleware(newLogFilter)), eth_newBlockFilter: waitForFree(toFilterCreationMiddleware(newBlockFilter)), eth_newPendingTransactionFilter: waitForFree(toFilterCreationMiddleware(newPendingTransactionFilter)), // uninstall filters eth_uninstallFilter: waitForFree(toAsyncRpcMiddleware(uninstallFilterHandler)), // checking filter changes eth_getFilterChanges: waitForFree(toAsyncRpcMiddleware(getFilterChanges2)), eth_getFilterLogs: waitForFree(toAsyncRpcMiddleware(getFilterLogs2)) }); const filterUpdater = async ({ oldBlock, newBlock }) => { if (filters.length === 0) return; const releaseLock = await mutex.acquire(); try { await Promise.all(objValues(filters).map(async (filter) => { try { await filter.update({ oldBlock, newBlock }); } catch (err) { console.error(err); } })); } catch (err) { console.error(err); } releaseLock(); }; middleware.newLogFilter = newLogFilter; middleware.newBlockFilter = newBlockFilter; middleware.newPendingTransactionFilter = newPendingTransactionFilter; middleware.uninstallFilter = uninstallFilterHandler; middleware.getFilterChanges = getFilterChanges2; middleware.getFilterLogs = getFilterLogs2; middleware.destroy = () => { uninstallAllFilters(); }; return middleware; async function newLogFilter(params) { const filter = new LogFilter({ provider, params }); await installFilter(filter); return filter; } async function newBlockFilter() { const filter = new BlockFilter({ provider }); await installFilter(filter); return filter; } async function newPendingTransactionFilter() { const filter = new TxFilter({ provider }); await installFilter(filter); return filter; } async function getFilterChanges2(filterIndexHex) { const filterIndex2 = hexToInt(filterIndexHex); const filter = filters[filterIndex2]; if (!filter) { throw new Error(`No filter for index "${filterIndex2}"`); } const results2 = filter.getChangesAndClear(); return results2; } async function getFilterLogs2(filterIndexHex) { const filterIndex2 = hexToInt(filterIndexHex); const filter = filters[filterIndex2]; if (!filter) { throw new Error(`No filter for index "${filterIndex2}"`); } let results2 = []; if (filter.type === "log") { results2 = filter.getAllResults(); } return results2; } async function uninstallFilterHandler(filterIndexHex) { const filterIndex2 = hexToInt(filterIndexHex); const filter = filters[filterIndex2]; const result = Boolean(filter); if (result) { await uninstallFilter2(filterIndex2); } return result; } async function installFilter(filter) { const prevFilterCount = objValues(filters).length; const currentBlock = await blockTracker.getLatestBlock(); await filter.initialize({ currentBlock }); filterIndex++; filters[filterIndex] = filter; filter.id = filterIndex; filter.idHex = intToHex(filterIndex); const newFilterCount = objValues(filters).length; updateBlockTrackerSubs({ prevFilterCount, newFilterCount }); return filterIndex; } async function uninstallFilter2(filterIndex2) { const prevFilterCount = objValues(filters).length; delete filters[filterIndex2]; const newFilterCount = objValues(filters).length; updateBlockTrackerSubs({ prevFilterCount, newFilterCount }); } async function uninstallAllFilters() { const prevFilterCount = objValues(filters).length; filters = {}; updateBlockTrackerSubs({ prevFilterCount, newFilterCount: 0 }); } function updateBlockTrackerSubs({ prevFilterCount, newFilterCount }) { if (prevFilterCount === 0 && newFilterCount > 0) { blockTracker.on("sync", filterUpdater); return; } if (prevFilterCount > 0 && newFilterCount === 0) { blockTracker.removeListener("sync", filterUpdater); return; } } } function toFilterCreationMiddleware(createFilterFn) { return toAsyncRpcMiddleware(async (...args) => { const filter = await createFilterFn(...args); const result = intToHex(filter.id); return result; }); } function toAsyncRpcMiddleware(asyncFn) { return createAsyncMiddleware$1(async (req, res) => { const result = await asyncFn.apply(null, req.params); res.result = result; }); } function mutexMiddlewareWrapper({ mutex }) { return (middleware) => { return async (req, res, next, end) => { const releaseLock = await mutex.acquire(); releaseLock(); middleware(req, res, next, end); }; }; } function objValues(obj, fn2) { const values = []; for (let key in obj) { values.push(obj[key]); } return values; } const SafeEventEmitter = cjs$2.default; const { createAsyncMiddleware, createScaffoldMiddleware } = dist$1; const createFilterMiddleware = ethJsonRpcFilters; const { unsafeRandomBytes, incrementHexInt } = hexUtils; const getBlocksForRange = getBlocksForRange_1; var subscriptionManager = createSubscriptionMiddleware; function createSubscriptionMiddleware({ blockTracker, provider }) { const subscriptions = {}; const filterManager = createFilterMiddleware({ blockTracker, provider }); let isDestroyed = false; const events2 = new SafeEventEmitter(); const middleware = createScaffoldMiddleware({ eth_subscribe: createAsyncMiddleware(subscribe2), eth_unsubscribe: createAsyncMiddleware(unsubscribe) }); middleware.destroy = destroy2; return { events: events2, middleware }; async function subscribe2(req, res) { if (isDestroyed) throw new Error( "SubscriptionManager - attempting to use after destroying" ); const subscriptionType = req.params[0]; const subId = unsafeRandomBytes(16); let sub; switch (subscriptionType) { case "newHeads": sub = createSubNewHeads({ subId }); break; case "logs": const filterParams = req.params[1]; const filter = await filterManager.newLogFilter(filterParams); sub = createSubFromFilter({ subId, filter }); break; default: throw new Error(`SubscriptionManager - unsupported subscription type "${subscriptionType}"`); } subscriptions[subId] = sub; res.result = subId; return; function createSubNewHeads({ subId: subId2 }) { const sub2 = { type: subscriptionType, destroy: async () => { blockTracker.removeListener("sync", sub2.update); }, update: async ({ oldBlock, newBlock }) => { const toBlock = newBlock; const fromBlock = incrementHexInt(oldBlock); const rawBlocks = await getBlocksForRange({ provider, fromBlock, toBlock }); const results2 = rawBlocks.map(normalizeBlock).filter((block) => block !== null); results2.forEach((value) => { _emitSubscriptionResult(subId2, value); }); } }; blockTracker.on("sync", sub2.update); return sub2; } function createSubFromFilter({ subId: subId2, filter }) { filter.on("update", (result) => _emitSubscriptionResult(subId2, result)); const sub2 = { type: subscriptionType, destroy: async () => { return await filterManager.uninstallFilter(filter.idHex); } }; return sub2; } } async function unsubscribe(req, res) { if (isDestroyed) throw new Error( "SubscriptionManager - attempting to use after destroying" ); const id2 = req.params[0]; const subscription = subscriptions[id2]; if (!subscription) { res.result = false; return; } delete subscriptions[id2]; await subscription.destroy(); res.result = true; } function _emitSubscriptionResult(filterIdHex, value) { events2.emit("notification", { jsonrpc: "2.0", method: "eth_subscription", params: { subscription: filterIdHex, result: value } }); } function destroy2() { events2.removeAllListeners(); for (const id2 in subscriptions) { subscriptions[id2].destroy(); delete subscriptions[id2]; } isDestroyed = true; } } function normalizeBlock(block) { if (block === null || block === void 0) { return null; } return { hash: block.hash, parentHash: block.parentHash, sha3Uncles: block.sha3Uncles, miner: block.miner, stateRoot: block.stateRoot, transactionsRoot: block.transactionsRoot, receiptsRoot: block.receiptsRoot, logsBloom: block.logsBloom, difficulty: block.difficulty, number: block.number, gasLimit: block.gasLimit, gasUsed: block.gasUsed, nonce: block.nonce, mixHash: block.mixHash, timestamp: block.timestamp, extraData: block.extraData }; } Object.defineProperty(SubscriptionManager$1, "__esModule", { value: true }); SubscriptionManager$1.SubscriptionManager = void 0; const eth_block_tracker_1 = dist$4; const createSubscriptionManager = subscriptionManager; const noop$2 = () => { }; class SubscriptionManager { constructor(provider) { const blockTracker = new eth_block_tracker_1.PollingBlockTracker({ provider, pollingInterval: 15e3, setSkipCacheFlag: true }); const { events: events2, middleware } = createSubscriptionManager({ blockTracker, provider }); this.events = events2; this.subscriptionMiddleware = middleware; } async handleRequest(request) { const result = {}; await this.subscriptionMiddleware(request, result, noop$2, noop$2); return result; } destroy() { this.subscriptionMiddleware.destroy(); } } SubscriptionManager$1.SubscriptionManager = SubscriptionManager; var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(CoinbaseWalletProvider$1, "__esModule", { value: true }); CoinbaseWalletProvider$1.CoinbaseWalletProvider = void 0; const bn_js_1 = __importDefault(bnExports); const eventemitter3_1 = eventemitter3Exports; const error_1 = error; const util_1$2 = util$3; const MobileRelay_1$1 = MobileRelay$1; const RelayAbstract_1 = RelayAbstract$1; const Session_1 = Session$1; const Web3Response_1 = Web3Response; const eth_eip712_util_1 = __importDefault(ethEip712Util); const DiagnosticLogger_1 = DiagnosticLogger; const FilterPolyfill_1 = FilterPolyfill$1; const SubscriptionManager_1 = SubscriptionManager$1; const DEFAULT_CHAIN_ID_KEY = "DefaultChainId"; const DEFAULT_JSON_RPC_URL = "DefaultJsonRpcUrl"; class CoinbaseWalletProvider extends eventemitter3_1.EventEmitter { constructor(options) { var _a2, _b2; super(); this._filterPolyfill = new FilterPolyfill_1.FilterPolyfill(this); this._subscriptionManager = new SubscriptionManager_1.SubscriptionManager(this); this._relay = null; this._addresses = []; this.hasMadeFirstChainChangedEmission = false; 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 = options.chainId; this._jsonRpcUrlFromOpts = options.jsonRpcUrl; this._overrideIsMetaMask = options.overrideIsMetaMask; this._relayProvider = options.relayProvider; this._storage = options.storage; this._relayEventManager = options.relayEventManager; this.diagnostic = options.diagnosticLogger; this.reloadOnDisconnect = true; this.isCoinbaseWallet = (_a2 = options.overrideIsCoinbaseWallet) !== null && _a2 !== void 0 ? _a2 : true; this.isCoinbaseBrowser = (_b2 = options.overrideIsCoinbaseBrowser) !== null && _b2 !== void 0 ? _b2 : false; this.qrUrl = options.qrUrl; const chainId = this.getChainId(); const chainIdStr = (0, util_1$2.prepend0x)(chainId.toString(16)); this.emit("connect", { chainIdStr }); const cachedAddresses = this._storage.getItem(RelayAbstract_1.LOCAL_STORAGE_ADDRESSES_KEY); if (cachedAddresses) { const addresses = cachedAddresses.split(" "); if (addresses[0] !== "") { this._addresses = addresses.map((address) => (0, util_1$2.ensureAddressString)(address)); this.emit("accountsChanged", addresses); } } this._subscriptionManager.events.on("notification", (notification) => { this.emit("message", { type: notification.method, data: notification.params }); }); if (this._isAuthorized()) { void this.initializeRelay(); } window.addEventListener("message", (event) => { var _a3; if (event.origin !== location.origin || event.source !== window) { return; } if (event.data.type !== "walletLinkMessage") return; if (event.data.data.action === "dappChainSwitched") { const _chainId = event.data.data.chainId; const jsonRpcUrl = (_a3 = event.data.data.jsonRpcUrl) !== null && _a3 !== void 0 ? _a3 : this.jsonRpcUrl; this.updateProviderInfo(jsonRpcUrl, Number(_chainId)); } }); } /** @deprecated Use `.request({ method: 'eth_accounts' })` instead. */ get selectedAddress() { return this._addresses[0] || void 0; } /** @deprecated Use the chain ID. If you still need the network ID, use `.request({ method: 'net_version' })`. */ get networkVersion() { return this.getChainId().toString(10); } /** @deprecated Use `.request({ method: 'eth_chainId' })` instead. */ get chainId() { return (0, util_1$2.prepend0x)(this.getChainId().toString(16)); } get isWalletLink() { return true; } /** * Some DApps (i.e. Alpha Homora) seem to require the window.ethereum object return * true for this method. */ get isMetaMask() { return this._overrideIsMetaMask; } get host() { return this.jsonRpcUrl; } get connected() { return true; } isConnected() { return true; } get jsonRpcUrl() { var _a2; return (_a2 = this._storage.getItem(DEFAULT_JSON_RPC_URL)) !== null && _a2 !== void 0 ? _a2 : this._jsonRpcUrlFromOpts; } set jsonRpcUrl(value) { this._storage.setItem(DEFAULT_JSON_RPC_URL, value); } disableReloadOnDisconnect() { this.reloadOnDisconnect = false; } setProviderInfo(jsonRpcUrl, chainId) { if (!this.isCoinbaseBrowser) { this._chainIdFromOpts = chainId; this._jsonRpcUrlFromOpts = jsonRpcUrl; } this.updateProviderInfo(this.jsonRpcUrl, this.getChainId()); } updateProviderInfo(jsonRpcUrl, chainId) { this.jsonRpcUrl = jsonRpcUrl; const originalChainId = this.getChainId(); this._storage.setItem(DEFAULT_CHAIN_ID_KEY, chainId.toString(10)); const chainChanged = (0, util_1$2.ensureIntNumber)(chainId) !== originalChainId; if (chainChanged || !this.hasMadeFirstChainChangedEmission) { this.emit("chainChanged", this.getChainId()); this.hasMadeFirstChainChangedEmission = true; } } async watchAsset(type2, address, symbol, decimals, image, chainId) { const relay = await this.initializeRelay(); const result = await relay.watchAsset(type2, address, symbol, decimals, image, chainId === null || chainId === void 0 ? void 0 : chainId.toString()).promise; if ((0, Web3Response_1.isErrorResponse)(result)) return false; return !!result.result; } async addEthereumChain(chainId, rpcUrls, blockExplorerUrls, chainName, iconUrls, nativeCurrency) { var _a2, _b2; if ((0, util_1$2.ensureIntNumber)(chainId) === this.getChainId()) { return false; } const relay = await this.initializeRelay(); const isWhitelistedNetworkOrStandalone = relay.inlineAddEthereumChain(chainId.toString()); if (!this._isAuthorized() && !isWhitelistedNetworkOrStandalone) { await relay.requestEthereumAccounts().promise; } const res = await relay.addEthereumChain(chainId.toString(), rpcUrls, iconUrls, blockExplorerUrls, chainName, nativeCurrency).promise; if ((0, Web3Response_1.isErrorResponse)(res)) return false; if (((_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.isApproved) === true) { this.updateProviderInfo(rpcUrls[0], chainId); } return ((_b2 = res.result) === null || _b2 === void 0 ? void 0 : _b2.isApproved) === true; } async switchEthereumChain(chainId) { const relay = await this.initializeRelay(); const res = await relay.switchEthereumChain(chainId.toString(10), this.selectedAddress || void 0).promise; if ((0, Web3Response_1.isErrorResponse)(res)) { if (!res.errorCode) return; if (res.errorCode === error_1.standardErrorCodes.provider.unsupportedChain) { throw error_1.standardErrors.provider.unsupportedChain(); } else { throw error_1.standardErrors.provider.custom({ message: res.errorMessage, code: res.errorCode }); } } const switchResponse = res.result; if (switchResponse.isApproved && switchResponse.rpcUrl.length > 0) { this.updateProviderInfo(switchResponse.rpcUrl, chainId); } } setAppInfo(appName, appLogoUrl) { void this.initializeRelay().then((relay) => relay.setAppInfo(appName, appLogoUrl)); } /** @deprecated Use `.request({ method: 'eth_requestAccounts' })` instead. */ async enable() { var _a2; (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1.EVENTS.ETH_ACCOUNTS_STATE, { method: "provider::enable", addresses_length: this._addresses.length, sessionIdHash: this._relay ? Session_1.Session.hash(this._relay.session.id) : void 0 }); if (this._isAuthorized()) { return [...this._addresses]; } return await this.send("eth_requestAccounts"); } async close() { const relay = await this.initializeRelay(); relay.resetAndReload(); } send(requestOrMethod, callbackOrParams) { try { const result = this._send(requestOrMethod, callbackOrParams); if (result instanceof Promise) { return result.catch((error2) => { throw (0, error_1.serializeError)(error2, requestOrMethod); }); } } catch (error2) { throw (0, error_1.serializeError)(error2, requestOrMethod); } } _send(requestOrMethod, callbackOrParams) { if (typeof requestOrMethod === "string") { const method = requestOrMethod; const params = Array.isArray(callbackOrParams) ? callbackOrParams : callbackOrParams !== void 0 ? [callbackOrParams] : []; const request = { jsonrpc: "2.0", id: 0, method, params }; return this._sendRequestAsync(request).then((res) => res.result); } if (typeof callbackOrParams === "function") { const request = requestOrMethod; const callback = callbackOrParams; return this._sendAsync(request, callback); } if (Array.isArray(requestOrMethod)) { const requests = requestOrMethod; return requests.map((r2) => this._sendRequest(r2)); } const req = requestOrMethod; return this._sendRequest(req); } async sendAsync(request, callback) { try { return this._sendAsync(request, callback).catch((error2) => { throw (0, error_1.serializeError)(error2, request); }); } catch (error2) { return Promise.reject((0, error_1.serializeError)(error2, request)); } } async _sendAsync(request, callback) { if (typeof callback !== "function") { throw new Error("callback is required"); } if (Array.isArray(request)) { const arrayCb = callback; this._sendMultipleRequestsAsync(request).then((responses) => arrayCb(null, responses)).catch((err) => arrayCb(err, null)); return; } const cb = callback; return this._sendRequestAsync(request).then((response) => cb(null, response)).catch((err) => cb(err, null)); } async request(args) { try { return this._request(args).catch((error2) => { throw (0, error_1.serializeError)(error2, args.method); }); } catch (error2) { return Promise.reject((0, error_1.serializeError)(error2, args.method)); } } async _request(args) { if (!args || typeof args !== "object" || Array.isArray(args)) { throw error_1.standardErrors.rpc.invalidRequest({ message: "Expected a single, non-array, object argument.", data: args }); } const { method, params } = args; if (typeof method !== "string" || method.length === 0) { throw error_1.standardErrors.rpc.invalidRequest({ message: "'args.method' must be a non-empty string.", data: args }); } if (params !== void 0 && !Array.isArray(params) && (typeof params !== "object" || params === null)) { throw error_1.standardErrors.rpc.invalidRequest({ message: "'args.params' must be an object or array if provided.", data: args }); } const newParams = params === void 0 ? [] : params; const id2 = this._relayEventManager.makeRequestId(); const result = await this._sendRequestAsync({ method, params: newParams, jsonrpc: "2.0", id: id2 }); return result.result; } async scanQRCode(match) { const relay = await this.initializeRelay(); const res = await relay.scanQRCode((0, util_1$2.ensureRegExpString)(match)).promise; if ((0, Web3Response_1.isErrorResponse)(res)) { throw (0, error_1.serializeError)(res.errorMessage, "scanQRCode"); } else if (typeof res.result !== "string") { throw (0, error_1.serializeError)("result was not a string", "scanQRCode"); } return res.result; } async genericRequest(data2, action) { const relay = await this.initializeRelay(); const res = await relay.genericRequest(data2, action).promise; if ((0, Web3Response_1.isErrorResponse)(res)) { throw (0, error_1.serializeError)(res.errorMessage, "generic"); } else if (typeof res.result !== "string") { throw (0, error_1.serializeError)("result was not a string", "generic"); } return res.result; } /** * @beta * This method is currently in beta. While it is available for use, please note that it is still under testing and may undergo significant changes. * * @remarks * IMPORTANT: Signature validation is not performed by this method. Users of this method are advised to perform their own signature validation. * Common web3 frontend libraries such as ethers.js and viem provide the `verifyMessage` utility function that can be used for signature validation. * * It combines `eth_requestAccounts` and "Sign-In with Ethereum" (EIP-4361) into a single call. * The returned account and signed message can be used to authenticate the user. * * @param {Object} params - An object with the following properties: * - `nonce` {string}: A unique string to prevent replay attacks. * - `statement` {string}: An optional human-readable ASCII assertion that the user will sign. * - `resources` {string[]}: An optional list of information the user wishes to have resolved as part of authentication by the relying party. * * @returns {Promise} A promise that resolves to an object with the following properties: * - `accounts` {string[]}: The Ethereum accounts of the user. * - `message` {string}: The overall message that the user signed. Hex encoded. * - `signature` {string}: The signature of the message, signed with the user's private key. Hex encoded. */ async connectAndSignIn(params) { var _a2; (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1.EVENTS.ETH_ACCOUNTS_STATE, { method: "provider::connectAndSignIn", sessionIdHash: this._relay ? Session_1.Session.hash(this._relay.session.id) : void 0 }); let res; try { const relay = await this.initializeRelay(); if (!(relay instanceof MobileRelay_1$1.MobileRelay)) { throw new Error("connectAndSignIn is only supported on mobile"); } res = await relay.connectAndSignIn(params).promise; if ((0, Web3Response_1.isErrorResponse)(res)) { throw new Error(res.errorMessage); } } catch (err) { if (typeof err.message === "string" && err.message.match(/(denied|rejected)/i)) { throw error_1.standardErrors.provider.userRejectedRequest("User denied account authorization"); } throw err; } if (!res.result) { throw new Error("accounts received is empty"); } const { accounts } = res.result; this._setAddresses(accounts); if (!this.isCoinbaseBrowser) { await this.switchEthereumChain(this.getChainId()); } return res.result; } async selectProvider(providerOptions) { const relay = await this.initializeRelay(); const res = await relay.selectProvider(providerOptions).promise; if ((0, Web3Response_1.isErrorResponse)(res)) { throw (0, error_1.serializeError)(res.errorMessage, "selectProvider"); } else if (typeof res.result !== "string") { throw (0, error_1.serializeError)("result was not a string", "selectProvider"); } return res.result; } supportsSubscriptions() { return false; } subscribe() { throw new Error("Subscriptions are not supported"); } unsubscribe() { throw new Error("Subscriptions are not supported"); } disconnect() { return true; } _sendRequest(request) { const response = { jsonrpc: "2.0", id: request.id }; const { method } = request; response.result = this._handleSynchronousMethods(request); if (response.result === void 0) { throw new Error(`Coinbase Wallet does not support calling ${method} synchronously without a callback. Please provide a callback parameter to call ${method} asynchronously.`); } return response; } _setAddresses(addresses, _2) { if (!Array.isArray(addresses)) { throw new Error("addresses is not an array"); } const newAddresses = addresses.map((address) => (0, util_1$2.ensureAddressString)(address)); if (JSON.stringify(newAddresses) === JSON.stringify(this._addresses)) { return; } this._addresses = newAddresses; this.emit("accountsChanged", this._addresses); this._storage.setItem(RelayAbstract_1.LOCAL_STORAGE_ADDRESSES_KEY, newAddresses.join(" ")); } _sendRequestAsync(request) { return new Promise((resolve, reject) => { try { const syncResult = this._handleSynchronousMethods(request); if (syncResult !== void 0) { return resolve({ jsonrpc: "2.0", id: request.id, result: syncResult }); } const filterPromise = this._handleAsynchronousFilterMethods(request); if (filterPromise !== void 0) { filterPromise.then((res) => resolve(Object.assign(Object.assign({}, res), { id: request.id }))).catch((err) => reject(err)); return; } const subscriptionPromise = this._handleSubscriptionMethods(request); if (subscriptionPromise !== void 0) { subscriptionPromise.then((res) => resolve({ jsonrpc: "2.0", id: request.id, result: res.result })).catch((err) => reject(err)); return; } } catch (err) { return reject(err); } this._handleAsynchronousMethods(request).then((res) => res && resolve(Object.assign(Object.assign({}, res), { id: request.id }))).catch((err) => reject(err)); }); } _sendMultipleRequestsAsync(requests) { return Promise.all(requests.map((r2) => this._sendRequestAsync(r2))); } _handleSynchronousMethods(request) { const { method } = request; const params = request.params || []; switch (method) { case "eth_accounts": return this._eth_accounts(); case "eth_coinbase": return this._eth_coinbase(); case "eth_uninstallFilter": return this._eth_uninstallFilter(params); case "net_version": return this._net_version(); case "eth_chainId": return this._eth_chainId(); default: return void 0; } } async _handleAsynchronousMethods(request) { const { method } = request; const params = request.params || []; switch (method) { case "eth_requestAccounts": return this._eth_requestAccounts(); case "eth_sign": return this._eth_sign(params); case "eth_ecRecover": return this._eth_ecRecover(params); case "personal_sign": return this._personal_sign(params); case "personal_ecRecover": return this._personal_ecRecover(params); case "eth_signTransaction": return this._eth_signTransaction(params); case "eth_sendRawTransaction": return this._eth_sendRawTransaction(params); case "eth_sendTransaction": return this._eth_sendTransaction(params); case "eth_signTypedData_v1": return this._eth_signTypedData_v1(params); case "eth_signTypedData_v2": return this._throwUnsupportedMethodError(); case "eth_signTypedData_v3": return this._eth_signTypedData_v3(params); case "eth_signTypedData_v4": case "eth_signTypedData": return this._eth_signTypedData_v4(params); case "cbWallet_arbitrary": return this._cbwallet_arbitrary(params); case "wallet_addEthereumChain": return this._wallet_addEthereumChain(params); case "wallet_switchEthereumChain": return this._wallet_switchEthereumChain(params); case "wallet_watchAsset": return this._wallet_watchAsset(params); } const relay = await this.initializeRelay(); return relay.makeEthereumJSONRPCRequest(request, this.jsonRpcUrl).catch((err) => { var _a2; if (err.code === error_1.standardErrorCodes.rpc.methodNotFound || err.code === error_1.standardErrorCodes.rpc.methodNotSupported) { (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1.EVENTS.METHOD_NOT_IMPLEMENTED, { method: request.method, sessionIdHash: this._relay ? Session_1.Session.hash(this._relay.session.id) : void 0 }); } throw err; }); } _handleAsynchronousFilterMethods(request) { const { method } = request; const params = request.params || []; switch (method) { case "eth_newFilter": return this._eth_newFilter(params); case "eth_newBlockFilter": return this._eth_newBlockFilter(); case "eth_newPendingTransactionFilter": return this._eth_newPendingTransactionFilter(); case "eth_getFilterChanges": return this._eth_getFilterChanges(params); case "eth_getFilterLogs": return this._eth_getFilterLogs(params); } return void 0; } _handleSubscriptionMethods(request) { switch (request.method) { case "eth_subscribe": case "eth_unsubscribe": return this._subscriptionManager.handleRequest(request); } return void 0; } _isKnownAddress(addressString) { try { const addressStr = (0, util_1$2.ensureAddressString)(addressString); const lowercaseAddresses = this._addresses.map((address) => (0, util_1$2.ensureAddressString)(address)); return lowercaseAddresses.includes(addressStr); } catch (_a2) { } return false; } _ensureKnownAddress(addressString) { var _a2; if (!this._isKnownAddress(addressString)) { (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED); throw new Error("Unknown Ethereum address"); } } _prepareTransactionParams(tx) { const fromAddress = tx.from ? (0, util_1$2.ensureAddressString)(tx.from) : this.selectedAddress; if (!fromAddress) { throw new Error("Ethereum address is unavailable"); } this._ensureKnownAddress(fromAddress); const toAddress = tx.to ? (0, util_1$2.ensureAddressString)(tx.to) : null; const weiValue = tx.value != null ? (0, util_1$2.ensureBN)(tx.value) : new bn_js_1.default(0); const data2 = tx.data ? (0, util_1$2.ensureBuffer)(tx.data) : Buffer.alloc(0); const nonce = tx.nonce != null ? (0, util_1$2.ensureIntNumber)(tx.nonce) : null; const gasPriceInWei = tx.gasPrice != null ? (0, util_1$2.ensureBN)(tx.gasPrice) : null; const maxFeePerGas = tx.maxFeePerGas != null ? (0, util_1$2.ensureBN)(tx.maxFeePerGas) : null; const maxPriorityFeePerGas = tx.maxPriorityFeePerGas != null ? (0, util_1$2.ensureBN)(tx.maxPriorityFeePerGas) : null; const gasLimit = tx.gas != null ? (0, util_1$2.ensureBN)(tx.gas) : null; const chainId = tx.chainId ? (0, util_1$2.ensureIntNumber)(tx.chainId) : this.getChainId(); return { fromAddress, toAddress, weiValue, data: data2, nonce, gasPriceInWei, maxFeePerGas, maxPriorityFeePerGas, gasLimit, chainId }; } _isAuthorized() { return this._addresses.length > 0; } _requireAuthorization() { if (!this._isAuthorized()) { throw error_1.standardErrors.provider.unauthorized({}); } } _throwUnsupportedMethodError() { throw error_1.standardErrors.provider.unsupportedMethod({}); } async _signEthereumMessage(message, address, addPrefix, typedDataJson) { this._ensureKnownAddress(address); try { const relay = await this.initializeRelay(); const res = await relay.signEthereumMessage(message, address, addPrefix, typedDataJson).promise; if ((0, Web3Response_1.isErrorResponse)(res)) { throw new Error(res.errorMessage); } return { jsonrpc: "2.0", id: 0, result: res.result }; } catch (err) { if (typeof err.message === "string" && err.message.match(/(denied|rejected)/i)) { throw error_1.standardErrors.provider.userRejectedRequest("User denied message signature"); } throw err; } } async _ethereumAddressFromSignedMessage(message, signature, addPrefix) { const relay = await this.initializeRelay(); const res = await relay.ethereumAddressFromSignedMessage(message, signature, addPrefix).promise; if ((0, Web3Response_1.isErrorResponse)(res)) { throw new Error(res.errorMessage); } return { jsonrpc: "2.0", id: 0, result: res.result }; } _eth_accounts() { return [...this._addresses]; } _eth_coinbase() { return this.selectedAddress || null; } _net_version() { return this.getChainId().toString(10); } _eth_chainId() { return (0, util_1$2.hexStringFromIntNumber)(this.getChainId()); } getChainId() { const chainIdStr = this._storage.getItem(DEFAULT_CHAIN_ID_KEY); if (!chainIdStr) { return (0, util_1$2.ensureIntNumber)(this._chainIdFromOpts); } const chainId = parseInt(chainIdStr, 10); return (0, util_1$2.ensureIntNumber)(chainId); } async _eth_requestAccounts() { var _a2; (_a2 = this.diagnostic) === null || _a2 === void 0 ? void 0 : _a2.log(DiagnosticLogger_1.EVENTS.ETH_ACCOUNTS_STATE, { method: "provider::_eth_requestAccounts", addresses_length: this._addresses.length, sessionIdHash: this._relay ? Session_1.Session.hash(this._relay.session.id) : void 0 }); if (this._isAuthorized()) { return Promise.resolve({ jsonrpc: "2.0", id: 0, result: this._addresses }); } let res; try { const relay = await this.initializeRelay(); res = await relay.requestEthereumAccounts().promise; if ((0, Web3Response_1.isErrorResponse)(res)) { throw new Error(res.errorMessage); } } catch (err) { if (typeof err.message === "string" && err.message.match(/(denied|rejected)/i)) { throw error_1.standardErrors.provider.userRejectedRequest("User denied account authorization"); } throw err; } if (!res.result) { throw new Error("accounts received is empty"); } this._setAddresses(res.result); if (!this.isCoinbaseBrowser) { await this.switchEthereumChain(this.getChainId()); } return { jsonrpc: "2.0", id: 0, result: this._addresses }; } _eth_sign(params) { this._requireAuthorization(); const address = (0, util_1$2.ensureAddressString)(params[0]); const message = (0, util_1$2.ensureBuffer)(params[1]); return this._signEthereumMessage(message, address, false); } _eth_ecRecover(params) { const message = (0, util_1$2.ensureBuffer)(params[0]); const signature = (0, util_1$2.ensureBuffer)(params[1]); return this._ethereumAddressFromSignedMessage(message, signature, false); } _personal_sign(params) { this._requireAuthorization(); const message = (0, util_1$2.ensureBuffer)(params[0]); const address = (0, util_1$2.ensureAddressString)(params[1]); return this._signEthereumMessage(message, address, true); } _personal_ecRecover(params) { const message = (0, util_1$2.ensureBuffer)(params[0]); const signature = (0, util_1$2.ensureBuffer)(params[1]); return this._ethereumAddressFromSignedMessage(message, signature, true); } async _eth_signTransaction(params) { this._requireAuthorization(); const tx = this._prepareTransactionParams(params[0] || {}); try { const relay = await this.initializeRelay(); const res = await relay.signEthereumTransaction(tx).promise; if ((0, Web3Response_1.isErrorResponse)(res)) { throw new Error(res.errorMessage); } return { jsonrpc: "2.0", id: 0, result: res.result }; } catch (err) { if (typeof err.message === "string" && err.message.match(/(denied|rejected)/i)) { throw error_1.standardErrors.provider.userRejectedRequest("User denied transaction signature"); } throw err; } } async _eth_sendRawTransaction(params) { const signedTransaction = (0, util_1$2.ensureBuffer)(params[0]); const relay = await this.initializeRelay(); const res = await relay.submitEthereumTransaction(signedTransaction, this.getChainId()).promise; if ((0, Web3Response_1.isErrorResponse)(res)) { throw new Error(res.errorMessage); } return { jsonrpc: "2.0", id: 0, result: res.result }; } async _eth_sendTransaction(params) { this._requireAuthorization(); const tx = this._prepareTransactionParams(params[0] || {}); try { const relay = await this.initializeRelay(); const res = await relay.signAndSubmitEthereumTransaction(tx).promise; if ((0, Web3Response_1.isErrorResponse)(res)) { throw new Error(res.errorMessage); } return { jsonrpc: "2.0", id: 0, result: res.result }; } catch (err) { if (typeof err.message === "string" && err.message.match(/(denied|rejected)/i)) { throw error_1.standardErrors.provider.userRejectedRequest("User denied transaction signature"); } throw err; } } async _eth_signTypedData_v1(params) { this._requireAuthorization(); const typedData = (0, util_1$2.ensureParsedJSONObject)(params[0]); const address = (0, util_1$2.ensureAddressString)(params[1]); this._ensureKnownAddress(address); const message = eth_eip712_util_1.default.hashForSignTypedDataLegacy({ data: typedData }); const typedDataJSON = JSON.stringify(typedData, null, 2); return this._signEthereumMessage(message, address, false, typedDataJSON); } async _eth_signTypedData_v3(params) { this._requireAuthorization(); const address = (0, util_1$2.ensureAddressString)(params[0]); const typedData = (0, util_1$2.ensureParsedJSONObject)(params[1]); this._ensureKnownAddress(address); const message = eth_eip712_util_1.default.hashForSignTypedData_v3({ data: typedData }); const typedDataJSON = JSON.stringify(typedData, null, 2); return this._signEthereumMessage(message, address, false, typedDataJSON); } async _eth_signTypedData_v4(params) { this._requireAuthorization(); const address = (0, util_1$2.ensureAddressString)(params[0]); const typedData = (0, util_1$2.ensureParsedJSONObject)(params[1]); this._ensureKnownAddress(address); const message = eth_eip712_util_1.default.hashForSignTypedData_v4({ data: typedData }); const typedDataJSON = JSON.stringify(typedData, null, 2); return this._signEthereumMessage(message, address, false, typedDataJSON); } /** @deprecated */ async _cbwallet_arbitrary(params) { const action = params[0]; const data2 = params[1]; if (typeof data2 !== "string") { throw new Error("parameter must be a string"); } if (typeof action !== "object" || action === null) { throw new Error("parameter must be an object"); } const result = await this.genericRequest(action, data2); return { jsonrpc: "2.0", id: 0, result }; } async _wallet_addEthereumChain(params) { var _a2, _b2, _c2, _d; const request = params[0]; if (((_a2 = request.rpcUrls) === null || _a2 === void 0 ? void 0 : _a2.length) === 0) { return { jsonrpc: "2.0", id: 0, error: { code: 2, message: `please pass in at least 1 rpcUrl` } }; } if (!request.chainName || request.chainName.trim() === "") { throw error_1.standardErrors.rpc.invalidParams("chainName is a required field"); } if (!request.nativeCurrency) { throw error_1.standardErrors.rpc.invalidParams("nativeCurrency is a required field"); } const chainIdNumber = parseInt(request.chainId, 16); const success = await this.addEthereumChain(chainIdNumber, (_b2 = request.rpcUrls) !== null && _b2 !== void 0 ? _b2 : [], (_c2 = request.blockExplorerUrls) !== null && _c2 !== void 0 ? _c2 : [], request.chainName, (_d = request.iconUrls) !== null && _d !== void 0 ? _d : [], request.nativeCurrency); if (success) { return { jsonrpc: "2.0", id: 0, result: null }; } return { jsonrpc: "2.0", id: 0, error: { code: 2, message: `unable to add ethereum chain` } }; } async _wallet_switchEthereumChain(params) { const request = params[0]; await this.switchEthereumChain(parseInt(request.chainId, 16)); return { jsonrpc: "2.0", id: 0, result: null }; } async _wallet_watchAsset(params) { const request = Array.isArray(params) ? params[0] : params; if (!request.type) { throw error_1.standardErrors.rpc.invalidParams("Type is required"); } if ((request === null || request === void 0 ? void 0 : request.type) !== "ERC20") { throw error_1.standardErrors.rpc.invalidParams(`Asset of type '${request.type}' is not supported`); } if (!(request === null || request === void 0 ? void 0 : request.options)) { throw error_1.standardErrors.rpc.invalidParams("Options are required"); } if (!(request === null || request === void 0 ? void 0 : request.options.address)) { throw error_1.standardErrors.rpc.invalidParams("Address is required"); } const chainId = this.getChainId(); const { address, symbol, image, decimals } = request.options; const res = await this.watchAsset(request.type, address, symbol, decimals, image, chainId); return { jsonrpc: "2.0", id: 0, result: res }; } _eth_uninstallFilter(params) { const filterId = (0, util_1$2.ensureHexString)(params[0]); return this._filterPolyfill.uninstallFilter(filterId); } async _eth_newFilter(params) { const param = params[0]; const filterId = await this._filterPolyfill.newFilter(param); return { jsonrpc: "2.0", id: 0, result: filterId }; } async _eth_newBlockFilter() { const filterId = await this._filterPolyfill.newBlockFilter(); return { jsonrpc: "2.0", id: 0, result: filterId }; } async _eth_newPendingTransactionFilter() { const filterId = await this._filterPolyfill.newPendingTransactionFilter(); return { jsonrpc: "2.0", id: 0, result: filterId }; } _eth_getFilterChanges(params) { const filterId = (0, util_1$2.ensureHexString)(params[0]); return this._filterPolyfill.getFilterChanges(filterId); } _eth_getFilterLogs(params) { const filterId = (0, util_1$2.ensureHexString)(params[0]); return this._filterPolyfill.getFilterLogs(filterId); } initializeRelay() { if (this._relay) { return Promise.resolve(this._relay); } return this._relayProvider().then((relay) => { relay.setAccountsCallback((accounts, isDisconnect) => this._setAddresses(accounts, isDisconnect)); relay.setChainCallback((chainId, jsonRpcUrl) => { this.updateProviderInfo(jsonRpcUrl, parseInt(chainId, 10)); }); relay.setDappDefaultChainCallback(this._chainIdFromOpts); this._relay = relay; return relay; }); } } CoinbaseWalletProvider$1.CoinbaseWalletProvider = CoinbaseWalletProvider; var RelayEventManager$1 = {}; Object.defineProperty(RelayEventManager$1, "__esModule", { value: true }); RelayEventManager$1.RelayEventManager = void 0; const util_1$1 = util$3; class RelayEventManager { constructor() { this._nextRequestId = 0; this.callbacks = /* @__PURE__ */ new Map(); } makeRequestId() { this._nextRequestId = (this._nextRequestId + 1) % 2147483647; const id2 = this._nextRequestId; const idStr = (0, util_1$1.prepend0x)(id2.toString(16)); const callback = this.callbacks.get(idStr); if (callback) { this.callbacks.delete(idStr); } return id2; } } RelayEventManager$1.RelayEventManager = RelayEventManager; Object.defineProperty(CoinbaseWalletSDK$1, "__esModule", { value: true }); CoinbaseWalletSDK$1.CoinbaseWalletSDK = void 0; const wallet_logo_1 = walletLogo$1; const constants_1 = constants$4; const util_1 = util$3; const ScopedLocalStorage_1 = ScopedLocalStorage$1; const CoinbaseWalletProvider_1 = CoinbaseWalletProvider$1; const MobileRelay_1 = MobileRelay$1; const MobileRelayUI_1 = MobileRelayUI$1; const RelayEventManager_1 = RelayEventManager$1; const WalletLinkRelayUI_1 = WalletLinkRelayUI$1; const WalletLinkRelay_1 = WalletLinkRelay$1; const version_1 = version; class CoinbaseWalletSDK { /** * Constructor * @param options Coinbase Wallet SDK constructor options */ constructor(options) { var _a2, _b2, _c2; this._appName = ""; this._appLogoUrl = null; this._relay = null; this._relayEventManager = null; const linkAPIUrl = options.linkAPIUrl || constants_1.LINK_API_URL; if (typeof options.overrideIsMetaMask === "undefined") { this._overrideIsMetaMask = false; } else { this._overrideIsMetaMask = options.overrideIsMetaMask; } this._overrideIsCoinbaseWallet = (_a2 = options.overrideIsCoinbaseWallet) !== null && _a2 !== void 0 ? _a2 : true; this._overrideIsCoinbaseBrowser = (_b2 = options.overrideIsCoinbaseBrowser) !== null && _b2 !== void 0 ? _b2 : false; this._diagnosticLogger = options.diagnosticLogger; this._reloadOnDisconnect = (_c2 = options.reloadOnDisconnect) !== null && _c2 !== void 0 ? _c2 : true; const url = new URL(linkAPIUrl); const origin = `${url.protocol}//${url.host}`; this._storage = new ScopedLocalStorage_1.ScopedLocalStorage(`-walletlink:${origin}`); this._storage.setItem("version", CoinbaseWalletSDK.VERSION); if (this.walletExtension || this.coinbaseBrowser) { return; } this._relayEventManager = new RelayEventManager_1.RelayEventManager(); const isMobile = (0, util_1.isMobileWeb)(); const uiConstructor = options.uiConstructor || ((opts) => isMobile ? new MobileRelayUI_1.MobileRelayUI(opts) : new WalletLinkRelayUI_1.WalletLinkRelayUI(opts)); const relayOption = { linkAPIUrl, version: version_1.LIB_VERSION, darkMode: !!options.darkMode, headlessMode: !!options.headlessMode, uiConstructor, storage: this._storage, relayEventManager: this._relayEventManager, diagnosticLogger: this._diagnosticLogger, reloadOnDisconnect: this._reloadOnDisconnect, enableMobileWalletLink: options.enableMobileWalletLink }; this._relay = isMobile ? new MobileRelay_1.MobileRelay(relayOption) : new WalletLinkRelay_1.WalletLinkRelay(relayOption); this.setAppInfo(options.appName, options.appLogoUrl); if (options.headlessMode) return; this._relay.attachUI(); } /** * Create a Web3 Provider object * @param jsonRpcUrl Ethereum JSON RPC URL (Default: "") * @param chainId Ethereum Chain ID (Default: 1) * @returns A Web3 Provider */ makeWeb3Provider(jsonRpcUrl = "", chainId = 1) { const extension = this.walletExtension; if (extension) { if (!this.isCipherProvider(extension)) { extension.setProviderInfo(jsonRpcUrl, chainId); } if (this._reloadOnDisconnect === false && typeof extension.disableReloadOnDisconnect === "function") extension.disableReloadOnDisconnect(); return extension; } const dappBrowser = this.coinbaseBrowser; if (dappBrowser) { return dappBrowser; } const relay = this._relay; if (!relay || !this._relayEventManager || !this._storage) { throw new Error("Relay not initialized, should never happen"); } if (!jsonRpcUrl) relay.setConnectDisabled(true); return new CoinbaseWalletProvider_1.CoinbaseWalletProvider({ relayProvider: () => Promise.resolve(relay), relayEventManager: this._relayEventManager, storage: this._storage, jsonRpcUrl, chainId, qrUrl: this.getQrUrl(), diagnosticLogger: this._diagnosticLogger, overrideIsMetaMask: this._overrideIsMetaMask, overrideIsCoinbaseWallet: this._overrideIsCoinbaseWallet, overrideIsCoinbaseBrowser: this._overrideIsCoinbaseBrowser }); } /** * Set application information * @param appName Application name * @param appLogoUrl Application logo image URL */ setAppInfo(appName, appLogoUrl) { var _a2; this._appName = appName || "DApp"; this._appLogoUrl = appLogoUrl || (0, util_1.getFavicon)(); const extension = this.walletExtension; if (extension) { if (!this.isCipherProvider(extension)) { extension.setAppInfo(this._appName, this._appLogoUrl); } } else { (_a2 = this._relay) === null || _a2 === void 0 ? void 0 : _a2.setAppInfo(this._appName, this._appLogoUrl); } } /** * Disconnect. After disconnecting, this will reload the web page to ensure * all potential stale state is cleared. */ disconnect() { var _a2; const extension = this === null || this === void 0 ? void 0 : this.walletExtension; if (extension) { void extension.close(); } else { (_a2 = this._relay) === null || _a2 === void 0 ? void 0 : _a2.resetAndReload(); } } /** * Return QR URL for mobile wallet connection, will return null if extension is installed */ getQrUrl() { var _a2, _b2; return (_b2 = (_a2 = this._relay) === null || _a2 === void 0 ? void 0 : _a2.getQRCodeUrl()) !== null && _b2 !== void 0 ? _b2 : null; } /** * Official Coinbase Wallet logo for developers to use on their frontend * @param type Type of wallet logo: "standard" | "circle" | "text" | "textWithLogo" | "textLight" | "textWithLogoLight" * @param width Width of the logo (Optional) * @returns SVG Data URI */ getCoinbaseWalletLogo(type2, width = 240) { return (0, wallet_logo_1.walletLogo)(type2, width); } get walletExtension() { var _a2; return (_a2 = window.coinbaseWalletExtension) !== null && _a2 !== void 0 ? _a2 : window.walletLinkExtension; } get coinbaseBrowser() { var _a2, _b2; try { const ethereum2 = (_a2 = window.ethereum) !== null && _a2 !== void 0 ? _a2 : (_b2 = window.top) === null || _b2 === void 0 ? void 0 : _b2.ethereum; if (!ethereum2) { return void 0; } if ("isCoinbaseBrowser" in ethereum2 && ethereum2.isCoinbaseBrowser) { return ethereum2; } return void 0; } catch (e2) { return void 0; } } isCipherProvider(provider) { return typeof provider.isCipher === "boolean" && provider.isCipher; } } CoinbaseWalletSDK$1.CoinbaseWalletSDK = CoinbaseWalletSDK; CoinbaseWalletSDK.VERSION = version_1.LIB_VERSION; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.CoinbaseWalletProvider = exports3.CoinbaseWalletSDK = void 0; const CoinbaseWalletSDK_1 = CoinbaseWalletSDK$1; const CoinbaseWalletProvider_12 = CoinbaseWalletProvider$1; var CoinbaseWalletSDK_2 = CoinbaseWalletSDK$1; Object.defineProperty(exports3, "CoinbaseWalletSDK", { enumerable: true, get: function() { return CoinbaseWalletSDK_2.CoinbaseWalletSDK; } }); var CoinbaseWalletProvider_2 = CoinbaseWalletProvider$1; Object.defineProperty(exports3, "CoinbaseWalletProvider", { enumerable: true, get: function() { return CoinbaseWalletProvider_2.CoinbaseWalletProvider; } }); exports3.default = CoinbaseWalletSDK_1.CoinbaseWalletSDK; if (typeof window !== "undefined") { window.CoinbaseWalletSDK = CoinbaseWalletSDK_1.CoinbaseWalletSDK; window.CoinbaseWalletProvider = CoinbaseWalletProvider_12.CoinbaseWalletProvider; window.WalletLink = CoinbaseWalletSDK_1.CoinbaseWalletSDK; window.WalletLinkProvider = CoinbaseWalletProvider_12.CoinbaseWalletProvider; } })(dist$5); const index$2 = /* @__PURE__ */ getDefaultExportFromCjs(dist$5); const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: index$2 }, Symbol.toStringTag, { value: "Module" })); const suspectProtoRx = /"(?:_|\\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*:/; const suspectConstructorRx = /"(?: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*:/; const JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/; function jsonParseTransform(key, value) { if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) { warnKeyDropped(key); return; } return value; } function warnKeyDropped(key) { console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`); } function destr(value, options = {}) { if (typeof value !== "string") { return value; } const _value = value.trim(); if ( // eslint-disable-next-line unicorn/prefer-at value[0] === '"' && value.endsWith('"') && !value.includes("\\") ) { return _value.slice(1, -1); } if (_value.length <= 9) { const _lval = _value.toLowerCase(); if (_lval === "true") { return true; } if (_lval === "false") { return false; } if (_lval === "undefined") { return void 0; } if (_lval === "null") { return null; } if (_lval === "nan") { return Number.NaN; } if (_lval === "infinity") { return Number.POSITIVE_INFINITY; } if (_lval === "-infinity") { return Number.NEGATIVE_INFINITY; } } if (!JsonSigRx.test(value)) { if (options.strict) { throw new SyntaxError("[destr] Invalid JSON"); } return value; } try { if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) { if (options.strict) { throw new Error("[destr] Possible prototype pollution"); } return JSON.parse(value, jsonParseTransform); } return JSON.parse(value); } catch (error2) { if (options.strict) { throw error2; } return value; } } function wrapToPromise(value) { if (!value || typeof value.then !== "function") { return Promise.resolve(value); } return value; } function asyncCall(function_, ...arguments_) { try { return wrapToPromise(function_(...arguments_)); } catch (error2) { return Promise.reject(error2); } } function isPrimitive(value) { const type2 = typeof value; return value === null || type2 !== "object" && type2 !== "function"; } function isPureObject(value) { const proto = Object.getPrototypeOf(value); return !proto || proto.isPrototypeOf(Object); } function stringify(value) { if (isPrimitive(value)) { return String(value); } if (isPureObject(value) || Array.isArray(value)) { return JSON.stringify(value); } if (typeof value.toJSON === "function") { return stringify(value.toJSON()); } throw new Error("[unstorage] Cannot stringify value!"); } function checkBufferSupport() { if (typeof Buffer === void 0) { throw new TypeError("[unstorage] Buffer is not supported!"); } } const BASE64_PREFIX = "base64:"; function serializeRaw(value) { if (typeof value === "string") { return value; } checkBufferSupport(); const base642 = Buffer.from(value).toString("base64"); return BASE64_PREFIX + base642; } function deserializeRaw(value) { if (typeof value !== "string") { return value; } if (!value.startsWith(BASE64_PREFIX)) { return value; } checkBufferSupport(); return Buffer.from(value.slice(BASE64_PREFIX.length), "base64"); } function normalizeKey(key) { if (!key) { return ""; } return key.split("?")[0].replace(/[/\\]/g, ":").replace(/:+/g, ":").replace(/^:|:$/g, ""); } function joinKeys(...keys2) { return normalizeKey(keys2.join(":")); } function normalizeBaseKey(base3) { base3 = normalizeKey(base3); return base3 ? base3 + ":" : ""; } function defineDriver(factory) { return factory; } const DRIVER_NAME = "memory"; const memory = defineDriver(() => { const data2 = /* @__PURE__ */ new Map(); return { name: DRIVER_NAME, options: {}, hasItem(key) { return data2.has(key); }, getItem(key) { return data2.get(key) ?? null; }, getItemRaw(key) { return data2.get(key) ?? null; }, setItem(key, value) { data2.set(key, value); }, setItemRaw(key, value) { data2.set(key, value); }, removeItem(key) { data2.delete(key); }, getKeys() { return Array.from(data2.keys()); }, clear() { data2.clear(); }, dispose() { data2.clear(); } }; }); function createStorage(options = {}) { const context = { mounts: { "": options.driver || memory() }, mountpoints: [""], watching: false, watchListeners: [], unwatch: {} }; const getMount = (key) => { for (const base3 of context.mountpoints) { if (key.startsWith(base3)) { return { base: base3, relativeKey: key.slice(base3.length), driver: context.mounts[base3] }; } } return { base: "", relativeKey: key, driver: context.mounts[""] }; }; const getMounts = (base3, includeParent) => { return context.mountpoints.filter( (mountpoint) => mountpoint.startsWith(base3) || includeParent && base3.startsWith(mountpoint) ).map((mountpoint) => ({ relativeBase: base3.length > mountpoint.length ? base3.slice(mountpoint.length) : void 0, mountpoint, driver: context.mounts[mountpoint] })); }; const onChange = (event, key) => { if (!context.watching) { return; } key = normalizeKey(key); for (const listener of context.watchListeners) { listener(event, key); } }; const startWatch = async () => { if (context.watching) { return; } context.watching = true; for (const mountpoint in context.mounts) { context.unwatch[mountpoint] = await watch( context.mounts[mountpoint], onChange, mountpoint ); } }; const stopWatch = async () => { if (!context.watching) { return; } for (const mountpoint in context.unwatch) { await context.unwatch[mountpoint](); } context.unwatch = {}; context.watching = false; }; const runBatch = (items, commonOptions, cb) => { const batches = /* @__PURE__ */ new Map(); const getBatch = (mount) => { let batch = batches.get(mount.base); if (!batch) { batch = { driver: mount.driver, base: mount.base, items: [] }; batches.set(mount.base, batch); } return batch; }; for (const item of items) { const isStringItem = typeof item === "string"; const key = normalizeKey(isStringItem ? item : item.key); const value = isStringItem ? void 0 : item.value; const options2 = isStringItem || !item.options ? commonOptions : { ...commonOptions, ...item.options }; const mount = getMount(key); getBatch(mount).items.push({ key, value, relativeKey: mount.relativeKey, options: options2 }); } return Promise.all([...batches.values()].map((batch) => cb(batch))).then( (r2) => r2.flat() ); }; const storage = { // Item hasItem(key, opts = {}) { key = normalizeKey(key); const { relativeKey, driver } = getMount(key); return asyncCall(driver.hasItem, relativeKey, opts); }, getItem(key, opts = {}) { key = normalizeKey(key); const { relativeKey, driver } = getMount(key); return asyncCall(driver.getItem, relativeKey, opts).then( (value) => destr(value) ); }, getItems(items, commonOptions) { return runBatch(items, commonOptions, (batch) => { if (batch.driver.getItems) { return asyncCall( batch.driver.getItems, batch.items.map((item) => ({ key: item.relativeKey, options: item.options })), commonOptions ).then( (r2) => r2.map((item) => ({ key: joinKeys(batch.base, item.key), value: destr(item.value) })) ); } return Promise.all( batch.items.map((item) => { return asyncCall( batch.driver.getItem, item.relativeKey, item.options ).then((value) => ({ key: item.key, value: destr(value) })); }) ); }); }, getItemRaw(key, opts = {}) { key = normalizeKey(key); const { relativeKey, driver } = getMount(key); if (driver.getItemRaw) { return asyncCall(driver.getItemRaw, relativeKey, opts); } return asyncCall(driver.getItem, relativeKey, opts).then( (value) => deserializeRaw(value) ); }, async setItem(key, value, opts = {}) { if (value === void 0) { return storage.removeItem(key); } key = normalizeKey(key); const { relativeKey, driver } = getMount(key); if (!driver.setItem) { return; } await asyncCall(driver.setItem, relativeKey, stringify(value), opts); if (!driver.watch) { onChange("update", key); } }, async setItems(items, commonOptions) { await runBatch(items, commonOptions, async (batch) => { if (batch.driver.setItems) { return asyncCall( batch.driver.setItems, batch.items.map((item) => ({ key: item.relativeKey, value: stringify(item.value), options: item.options })), commonOptions ); } if (!batch.driver.setItem) { return; } await Promise.all( batch.items.map((item) => { return asyncCall( batch.driver.setItem, item.relativeKey, stringify(item.value), item.options ); }) ); }); }, async setItemRaw(key, value, opts = {}) { if (value === void 0) { return storage.removeItem(key, opts); } key = normalizeKey(key); const { relativeKey, driver } = getMount(key); if (driver.setItemRaw) { await asyncCall(driver.setItemRaw, relativeKey, value, opts); } else if (driver.setItem) { await asyncCall(driver.setItem, relativeKey, serializeRaw(value), opts); } else { return; } if (!driver.watch) { onChange("update", key); } }, async removeItem(key, opts = {}) { if (typeof opts === "boolean") { opts = { removeMeta: opts }; } key = normalizeKey(key); const { relativeKey, driver } = getMount(key); if (!driver.removeItem) { return; } await asyncCall(driver.removeItem, relativeKey, opts); if (opts.removeMeta || opts.removeMata) { await asyncCall(driver.removeItem, relativeKey + "$", opts); } if (!driver.watch) { onChange("remove", key); } }, // Meta async getMeta(key, opts = {}) { if (typeof opts === "boolean") { opts = { nativeOnly: opts }; } key = normalizeKey(key); const { relativeKey, driver } = getMount(key); const meta = /* @__PURE__ */ Object.create(null); if (driver.getMeta) { Object.assign(meta, await asyncCall(driver.getMeta, relativeKey, opts)); } if (!opts.nativeOnly) { const value = await asyncCall( driver.getItem, relativeKey + "$", opts ).then((value_) => destr(value_)); if (value && typeof value === "object") { if (typeof value.atime === "string") { value.atime = new Date(value.atime); } if (typeof value.mtime === "string") { value.mtime = new Date(value.mtime); } Object.assign(meta, value); } } return meta; }, setMeta(key, value, opts = {}) { return this.setItem(key + "$", value, opts); }, removeMeta(key, opts = {}) { return this.removeItem(key + "$", opts); }, // Keys async getKeys(base3, opts = {}) { base3 = normalizeBaseKey(base3); const mounts = getMounts(base3, true); let maskedMounts = []; const allKeys = []; for (const mount of mounts) { const rawKeys = await asyncCall( mount.driver.getKeys, mount.relativeBase, opts ); const keys2 = rawKeys.map((key) => mount.mountpoint + normalizeKey(key)).filter((key) => !maskedMounts.some((p2) => key.startsWith(p2))); allKeys.push(...keys2); maskedMounts = [ mount.mountpoint, ...maskedMounts.filter((p2) => !p2.startsWith(mount.mountpoint)) ]; } return base3 ? allKeys.filter((key) => key.startsWith(base3) && !key.endsWith("$")) : allKeys.filter((key) => !key.endsWith("$")); }, // Utils async clear(base3, opts = {}) { base3 = normalizeBaseKey(base3); await Promise.all( getMounts(base3, false).map(async (m2) => { if (m2.driver.clear) { return asyncCall(m2.driver.clear, m2.relativeBase, opts); } if (m2.driver.removeItem) { const keys2 = await m2.driver.getKeys(m2.relativeBase || "", opts); return Promise.all( keys2.map((key) => m2.driver.removeItem(key, opts)) ); } }) ); }, async dispose() { await Promise.all( Object.values(context.mounts).map((driver) => dispose(driver)) ); }, async watch(callback) { await startWatch(); context.watchListeners.push(callback); return async () => { context.watchListeners = context.watchListeners.filter( (listener) => listener !== callback ); if (context.watchListeners.length === 0) { await stopWatch(); } }; }, async unwatch() { context.watchListeners = []; await stopWatch(); }, // Mount mount(base3, driver) { base3 = normalizeBaseKey(base3); if (base3 && context.mounts[base3]) { throw new Error(`already mounted at ${base3}`); } if (base3) { context.mountpoints.push(base3); context.mountpoints.sort((a2, b2) => b2.length - a2.length); } context.mounts[base3] = driver; if (context.watching) { Promise.resolve(watch(driver, onChange, base3)).then((unwatcher) => { context.unwatch[base3] = unwatcher; }).catch(console.error); } return storage; }, async unmount(base3, _dispose = true) { base3 = normalizeBaseKey(base3); if (!base3 || !context.mounts[base3]) { return; } if (context.watching && base3 in context.unwatch) { context.unwatch[base3](); delete context.unwatch[base3]; } if (_dispose) { await dispose(context.mounts[base3]); } context.mountpoints = context.mountpoints.filter((key) => key !== base3); delete context.mounts[base3]; }, getMount(key = "") { key = normalizeKey(key) + ":"; const m2 = getMount(key); return { driver: m2.driver, base: m2.base }; }, getMounts(base3 = "", opts = {}) { base3 = normalizeKey(base3); const mounts = getMounts(base3, opts.parents); return mounts.map((m2) => ({ driver: m2.driver, base: m2.mountpoint })); } }; return storage; } function watch(driver, onChange, base3) { return driver.watch ? driver.watch((event, key) => onChange(event, base3 + key)) : () => { }; } async function dispose(driver) { if (typeof driver.dispose === "function") { await asyncCall(driver.dispose); } } function promisifyRequest(request) { return new Promise((resolve, reject) => { request.oncomplete = request.onsuccess = () => resolve(request.result); request.onabort = request.onerror = () => reject(request.error); }); } function createStore(dbName, storeName) { const request = indexedDB.open(dbName); request.onupgradeneeded = () => request.result.createObjectStore(storeName); const dbp = promisifyRequest(request); return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName))); } let defaultGetStoreFunc; function defaultGetStore() { if (!defaultGetStoreFunc) { defaultGetStoreFunc = createStore("keyval-store", "keyval"); } return defaultGetStoreFunc; } function get(key, customStore = defaultGetStore()) { return customStore("readonly", (store) => promisifyRequest(store.get(key))); } function set$1(key, value, customStore = defaultGetStore()) { return customStore("readwrite", (store) => { store.put(value, key); return promisifyRequest(store.transaction); }); } function del(key, customStore = defaultGetStore()) { return customStore("readwrite", (store) => { store.delete(key); return promisifyRequest(store.transaction); }); } function clear(customStore = defaultGetStore()) { return customStore("readwrite", (store) => { store.clear(); return promisifyRequest(store.transaction); }); } function eachCursor(store, callback) { store.openCursor().onsuccess = function() { if (!this.result) return; callback(this.result); this.result.continue(); }; return promisifyRequest(store.transaction); } function keys(customStore = defaultGetStore()) { return customStore("readonly", (store) => { if (store.getAllKeys) { return promisifyRequest(store.getAllKeys()); } const items = []; return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items); }); } const JSONStringify = (data2) => JSON.stringify(data2, (_2, value) => typeof value === "bigint" ? value.toString() + "n" : value); const JSONParse = (json2) => { const numbersBiggerThanMaxInt = /([\[:])?(\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; const serializedData = json2.replace(numbersBiggerThanMaxInt, '$1"$2n"$3'); return JSON.parse(serializedData, (_2, value) => { const isCustomFormatBigInt = typeof value === "string" && value.match(/^\d+n$/); if (isCustomFormatBigInt) return BigInt(value.substring(0, value.length - 1)); return value; }); }; function safeJsonParse(value) { if (typeof value !== "string") { throw new Error(`Cannot safe json parse value of type ${typeof value}`); } try { return JSONParse(value); } catch (_a2) { return value; } } function safeJsonStringify(value) { return typeof value === "string" ? value : JSONStringify(value) || ""; } const x$2 = "idb-keyval"; var z$4 = (i2 = {}) => { const t2 = i2.base && i2.base.length > 0 ? `${i2.base}:` : "", e2 = (s2) => t2 + s2; let n2; return i2.dbName && i2.storeName && (n2 = createStore(i2.dbName, i2.storeName)), { name: x$2, options: i2, async hasItem(s2) { return !(typeof await get(e2(s2), n2) > "u"); }, async getItem(s2) { return await get(e2(s2), n2) ?? null; }, setItem(s2, a2) { return set$1(e2(s2), a2, n2); }, removeItem(s2) { return del(e2(s2), n2); }, getKeys() { return keys(n2); }, clear() { return clear(n2); } }; }; const D$5 = "WALLET_CONNECT_V2_INDEXED_DB", E$6 = "keyvaluestorage"; let _$5 = class _ { constructor() { this.indexedDb = createStorage({ driver: z$4({ dbName: D$5, storeName: E$6 }) }); } async getKeys() { return this.indexedDb.getKeys(); } async getEntries() { return (await this.indexedDb.getItems(await this.indexedDb.getKeys())).map((t2) => [t2.key, t2.value]); } async getItem(t2) { const e2 = await this.indexedDb.getItem(t2); if (e2 !== null) return e2; } async setItem(t2, e2) { await this.indexedDb.setItem(t2, safeJsonStringify(e2)); } async removeItem(t2) { await this.indexedDb.removeItem(t2); } }; var l$5 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, c$6 = { exports: {} }; (function() { let i2; function t2() { } i2 = t2, i2.prototype.getItem = function(e2) { return this.hasOwnProperty(e2) ? String(this[e2]) : null; }, i2.prototype.setItem = function(e2, n2) { this[e2] = String(n2); }, i2.prototype.removeItem = function(e2) { delete this[e2]; }, i2.prototype.clear = function() { const e2 = this; Object.keys(e2).forEach(function(n2) { e2[n2] = void 0, delete e2[n2]; }); }, i2.prototype.key = function(e2) { return e2 = e2 || 0, Object.keys(this)[e2]; }, i2.prototype.__defineGetter__("length", function() { return Object.keys(this).length; }), typeof l$5 < "u" && l$5.localStorage ? c$6.exports = l$5.localStorage : typeof window < "u" && window.localStorage ? c$6.exports = window.localStorage : c$6.exports = new t2(); })(); function k$3(i2) { var t2; return [i2[0], safeJsonParse((t2 = i2[1]) != null ? t2 : "")]; } let K$2 = class K { constructor() { this.localStorage = c$6.exports; } async getKeys() { return Object.keys(this.localStorage); } async getEntries() { return Object.entries(this.localStorage).map(k$3); } async getItem(t2) { const e2 = this.localStorage.getItem(t2); if (e2 !== null) return safeJsonParse(e2); } async setItem(t2, e2) { this.localStorage.setItem(t2, safeJsonStringify(e2)); } async removeItem(t2) { this.localStorage.removeItem(t2); } }; const N$3 = "wc_storage_version", y$5 = 1, O$4 = async (i2, t2, e2) => { const n2 = N$3, s2 = await t2.getItem(n2); if (s2 && s2 >= y$5) { e2(t2); return; } const a2 = await i2.getKeys(); if (!a2.length) { e2(t2); return; } const m2 = []; for (; a2.length; ) { const r2 = a2.shift(); if (!r2) continue; const o2 = r2.toLowerCase(); if (o2.includes("wc@") || o2.includes("walletconnect") || o2.includes("wc_") || o2.includes("wallet_connect")) { const f2 = await i2.getItem(r2); await t2.setItem(r2, f2), m2.push(r2); } } await t2.setItem(n2, y$5), e2(t2), j$5(i2, m2); }, j$5 = async (i2, t2) => { t2.length && t2.forEach(async (e2) => { await i2.removeItem(e2); }); }; let h$5 = class h { constructor() { this.initialized = false, this.setInitialized = (e2) => { this.storage = e2, this.initialized = true; }; const t2 = new K$2(); this.storage = t2; try { const e2 = new _$5(); O$4(t2, e2, this.setInitialized); } catch { this.initialized = true; } } async getKeys() { return await this.initialize(), this.storage.getKeys(); } async getEntries() { return await this.initialize(), this.storage.getEntries(); } async getItem(t2) { return await this.initialize(), this.storage.getItem(t2); } async setItem(t2, e2) { return await this.initialize(), this.storage.setItem(t2, e2); } async removeItem(t2) { return await this.initialize(), this.storage.removeItem(t2); } async initialize() { this.initialized || await new Promise((t2) => { const e2 = setInterval(() => { this.initialized && (clearInterval(e2), t2()); }, 20); }); } }; var cjs$1 = {}; var heartbeat$2 = {}; var types = {}; var heartbeat$1 = {}; class IEvents { } const esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, IEvents }, Symbol.toStringTag, { value: "Module" })); const require$$0$1 = /* @__PURE__ */ getAugmentedNamespace(esm); var hasRequiredHeartbeat$2; function requireHeartbeat$2() { if (hasRequiredHeartbeat$2) return heartbeat$1; hasRequiredHeartbeat$2 = 1; Object.defineProperty(heartbeat$1, "__esModule", { value: true }); heartbeat$1.IHeartBeat = void 0; const events_12 = require$$0$1; class IHeartBeat extends events_12.IEvents { constructor(opts) { super(); } } heartbeat$1.IHeartBeat = IHeartBeat; return heartbeat$1; } var hasRequiredTypes; function requireTypes() { if (hasRequiredTypes) return types; hasRequiredTypes = 1; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); const tslib_12 = require$$0$4; tslib_12.__exportStar(requireHeartbeat$2(), exports3); })(types); return types; } var constants = {}; var heartbeat = {}; var hasRequiredHeartbeat$1; function requireHeartbeat$1() { if (hasRequiredHeartbeat$1) return heartbeat; hasRequiredHeartbeat$1 = 1; Object.defineProperty(heartbeat, "__esModule", { value: true }); heartbeat.HEARTBEAT_EVENTS = heartbeat.HEARTBEAT_INTERVAL = void 0; const time_1 = cjs$5; heartbeat.HEARTBEAT_INTERVAL = time_1.FIVE_SECONDS; heartbeat.HEARTBEAT_EVENTS = { pulse: "heartbeat_pulse" }; return heartbeat; } var hasRequiredConstants; function requireConstants() { if (hasRequiredConstants) return constants; hasRequiredConstants = 1; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); const tslib_12 = require$$0$4; tslib_12.__exportStar(requireHeartbeat$1(), exports3); })(constants); return constants; } var hasRequiredHeartbeat; function requireHeartbeat() { if (hasRequiredHeartbeat) return heartbeat$2; hasRequiredHeartbeat = 1; Object.defineProperty(heartbeat$2, "__esModule", { value: true }); heartbeat$2.HeartBeat = void 0; const tslib_12 = require$$0$4; const events_12 = eventsExports; const time_1 = cjs$5; const types_1 = requireTypes(); const constants_12 = requireConstants(); class HeartBeat extends types_1.IHeartBeat { constructor(opts) { super(opts); this.events = new events_12.EventEmitter(); this.interval = constants_12.HEARTBEAT_INTERVAL; this.interval = (opts === null || opts === void 0 ? void 0 : opts.interval) || constants_12.HEARTBEAT_INTERVAL; } static init(opts) { return tslib_12.__awaiter(this, void 0, void 0, function* () { const heartbeat2 = new HeartBeat(opts); yield heartbeat2.init(); return heartbeat2; }); } init() { return tslib_12.__awaiter(this, void 0, void 0, function* () { yield this.initialize(); }); } stop() { clearInterval(this.intervalRef); } on(event, listener) { this.events.on(event, listener); } once(event, listener) { this.events.once(event, listener); } off(event, listener) { this.events.off(event, listener); } removeListener(event, listener) { this.events.removeListener(event, listener); } initialize() { return tslib_12.__awaiter(this, void 0, void 0, function* () { this.intervalRef = setInterval(() => this.pulse(), time_1.toMiliseconds(this.interval)); }); } pulse() { this.events.emit(constants_12.HEARTBEAT_EVENTS.pulse); } } heartbeat$2.HeartBeat = HeartBeat; return heartbeat$2; } (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); const tslib_12 = require$$0$4; tslib_12.__exportStar(requireHeartbeat(), exports3); tslib_12.__exportStar(requireTypes(), exports3); tslib_12.__exportStar(requireConstants(), exports3); })(cjs$1); function tryStringify(o2) { try { return JSON.stringify(o2); } catch (e2) { return '"[Circular]"'; } } var quickFormatUnescaped = format$1; function format$1(f2, args, opts) { var ss2 = opts && opts.stringify || tryStringify; var offset = 1; if (typeof f2 === "object" && f2 !== null) { var len2 = args.length + offset; if (len2 === 1) return f2; var objects = new Array(len2); objects[0] = ss2(f2); for (var index2 = 1; index2 < len2; index2++) { objects[index2] = ss2(args[index2]); } return objects.join(" "); } if (typeof f2 !== "string") { return f2; } var argLen = args.length; if (argLen === 0) return f2; var str = ""; var a2 = 1 - offset; var lastPos = -1; var flen = f2 && f2.length || 0; for (var i2 = 0; i2 < flen; ) { if (f2.charCodeAt(i2) === 37 && i2 + 1 < flen) { lastPos = lastPos > -1 ? lastPos : 0; switch (f2.charCodeAt(i2 + 1)) { case 100: case 102: if (a2 >= argLen) break; if (args[a2] == null) break; if (lastPos < i2) str += f2.slice(lastPos, i2); str += Number(args[a2]); lastPos = i2 + 2; i2++; break; case 105: if (a2 >= argLen) break; if (args[a2] == null) break; if (lastPos < i2) str += f2.slice(lastPos, i2); str += Math.floor(Number(args[a2])); lastPos = i2 + 2; i2++; break; case 79: case 111: case 106: if (a2 >= argLen) break; if (args[a2] === void 0) break; if (lastPos < i2) str += f2.slice(lastPos, i2); var type2 = typeof args[a2]; if (type2 === "string") { str += "'" + args[a2] + "'"; lastPos = i2 + 2; i2++; break; } if (type2 === "function") { str += args[a2].name || ""; lastPos = i2 + 2; i2++; break; } str += ss2(args[a2]); lastPos = i2 + 2; i2++; break; case 115: if (a2 >= argLen) break; if (lastPos < i2) str += f2.slice(lastPos, i2); str += String(args[a2]); lastPos = i2 + 2; i2++; break; case 37: if (lastPos < i2) str += f2.slice(lastPos, i2); str += "%"; lastPos = i2 + 2; i2++; a2--; break; } ++a2; } ++i2; } if (lastPos === -1) return f2; else if (lastPos < flen) { str += f2.slice(lastPos); } return str; } const format = quickFormatUnescaped; var browser$1 = pino; const _console = pfGlobalThisOrFallback().console || {}; const stdSerializers = { mapHttpRequest: mock, mapHttpResponse: mock, wrapRequestSerializer: passthrough, wrapResponseSerializer: passthrough, wrapErrorSerializer: passthrough, req: mock, res: mock, err: asErrValue }; function shouldSerialize(serialize2, serializers) { if (Array.isArray(serialize2)) { const hasToFilter = serialize2.filter(function(k2) { return k2 !== "!stdSerializers.err"; }); return hasToFilter; } else if (serialize2 === true) { return Object.keys(serializers); } return false; } function pino(opts) { opts = opts || {}; opts.browser = opts.browser || {}; const transmit2 = opts.browser.transmit; if (transmit2 && typeof transmit2.send !== "function") { throw Error("pino: transmit option must have a send function"); } const proto = opts.browser.write || _console; if (opts.browser.write) opts.browser.asObject = true; const serializers = opts.serializers || {}; const serialize2 = shouldSerialize(opts.browser.serialize, serializers); let stdErrSerialize = opts.browser.serialize; if (Array.isArray(opts.browser.serialize) && opts.browser.serialize.indexOf("!stdSerializers.err") > -1) stdErrSerialize = false; const levels = ["error", "fatal", "warn", "info", "debug", "trace"]; if (typeof proto === "function") { proto.error = proto.fatal = proto.warn = proto.info = proto.debug = proto.trace = proto; } if (opts.enabled === false) opts.level = "silent"; const level = opts.level || "info"; const logger = Object.create(proto); if (!logger.log) logger.log = noop$1; Object.defineProperty(logger, "levelVal", { get: getLevelVal }); Object.defineProperty(logger, "level", { get: getLevel, set: setLevel }); const setOpts = { transmit: transmit2, serialize: serialize2, asObject: opts.browser.asObject, levels, timestamp: getTimeFunction(opts) }; logger.levels = pino.levels; logger.level = level; logger.setMaxListeners = logger.getMaxListeners = logger.emit = logger.addListener = logger.on = logger.prependListener = logger.once = logger.prependOnceListener = logger.removeListener = logger.removeAllListeners = logger.listeners = logger.listenerCount = logger.eventNames = logger.write = logger.flush = noop$1; logger.serializers = serializers; logger._serialize = serialize2; logger._stdErrSerialize = stdErrSerialize; logger.child = child; if (transmit2) logger._logEvent = createLogEventShape(); function getLevelVal() { return this.level === "silent" ? Infinity : this.levels.values[this.level]; } function getLevel() { return this._level; } function setLevel(level2) { if (level2 !== "silent" && !this.levels.values[level2]) { throw Error("unknown level " + level2); } this._level = level2; set(setOpts, logger, "error", "log"); set(setOpts, logger, "fatal", "error"); set(setOpts, logger, "warn", "error"); set(setOpts, logger, "info", "log"); set(setOpts, logger, "debug", "log"); set(setOpts, logger, "trace", "log"); } function child(bindings, childOptions) { if (!bindings) { throw new Error("missing bindings for child Pino"); } childOptions = childOptions || {}; if (serialize2 && bindings.serializers) { childOptions.serializers = bindings.serializers; } const childOptionsSerializers = childOptions.serializers; if (serialize2 && childOptionsSerializers) { var childSerializers = Object.assign({}, serializers, childOptionsSerializers); var childSerialize = opts.browser.serialize === true ? Object.keys(childSerializers) : serialize2; delete bindings.serializers; applySerializers([bindings], childSerialize, childSerializers, this._stdErrSerialize); } function Child(parent2) { this._childLevel = (parent2._childLevel | 0) + 1; this.error = bind(parent2, bindings, "error"); this.fatal = bind(parent2, bindings, "fatal"); this.warn = bind(parent2, bindings, "warn"); this.info = bind(parent2, bindings, "info"); this.debug = bind(parent2, bindings, "debug"); this.trace = bind(parent2, bindings, "trace"); if (childSerializers) { this.serializers = childSerializers; this._serialize = childSerialize; } if (transmit2) { this._logEvent = createLogEventShape( [].concat(parent2._logEvent.bindings, bindings) ); } } Child.prototype = this; return new Child(this); } return logger; } pino.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" } }; pino.stdSerializers = stdSerializers; pino.stdTimeFunctions = Object.assign({}, { nullTime, epochTime, unixTime, isoTime }); function set(opts, logger, level, fallback2) { const proto = Object.getPrototypeOf(logger); logger[level] = logger.levelVal > logger.levels.values[level] ? noop$1 : proto[level] ? proto[level] : _console[level] || _console[fallback2] || noop$1; wrap$1(opts, logger, level); } function wrap$1(opts, logger, level) { if (!opts.transmit && logger[level] === noop$1) return; logger[level] = function(write) { return function LOG() { const ts2 = opts.timestamp(); const args = new Array(arguments.length); const proto = Object.getPrototypeOf && Object.getPrototypeOf(this) === _console ? _console : this; for (var i2 = 0; i2 < args.length; i2++) args[i2] = arguments[i2]; if (opts.serialize && !opts.asObject) { applySerializers(args, this._serialize, this.serializers, this._stdErrSerialize); } if (opts.asObject) write.call(proto, asObject(this, level, args, ts2)); else write.apply(proto, args); if (opts.transmit) { const transmitLevel = opts.transmit.level || logger.level; const transmitValue = pino.levels.values[transmitLevel]; const methodValue = pino.levels.values[level]; if (methodValue < transmitValue) return; transmit(this, { ts: ts2, methodLevel: level, methodValue, transmitLevel, transmitValue: pino.levels.values[opts.transmit.level || logger.level], send: opts.transmit.send, val: logger.levelVal }, args); } }; }(logger[level]); } function asObject(logger, level, args, ts2) { if (logger._serialize) applySerializers(args, logger._serialize, logger.serializers, logger._stdErrSerialize); const argsCloned = args.slice(); let msg = argsCloned[0]; const o2 = {}; if (ts2) { o2.time = ts2; } o2.level = pino.levels.values[level]; let lvl = (logger._childLevel | 0) + 1; if (lvl < 1) lvl = 1; if (msg !== null && typeof msg === "object") { while (lvl-- && typeof argsCloned[0] === "object") { Object.assign(o2, argsCloned.shift()); } msg = argsCloned.length ? format(argsCloned.shift(), argsCloned) : void 0; } else if (typeof msg === "string") msg = format(argsCloned.shift(), argsCloned); if (msg !== void 0) o2.msg = msg; return o2; } function applySerializers(args, serialize2, serializers, stdErrSerialize) { for (const i2 in args) { if (stdErrSerialize && args[i2] instanceof Error) { args[i2] = pino.stdSerializers.err(args[i2]); } else if (typeof args[i2] === "object" && !Array.isArray(args[i2])) { for (const k2 in args[i2]) { if (serialize2 && serialize2.indexOf(k2) > -1 && k2 in serializers) { args[i2][k2] = serializers[k2](args[i2][k2]); } } } } } function bind(parent2, bindings, level) { return function() { const args = new Array(1 + arguments.length); args[0] = bindings; for (var i2 = 1; i2 < args.length; i2++) { args[i2] = arguments[i2 - 1]; } return parent2[level].apply(this, args); }; } function transmit(logger, opts, args) { const send = opts.send; const ts2 = opts.ts; const methodLevel = opts.methodLevel; const methodValue = opts.methodValue; const val = opts.val; const bindings = logger._logEvent.bindings; applySerializers( args, logger._serialize || Object.keys(logger.serializers), logger.serializers, logger._stdErrSerialize === void 0 ? true : logger._stdErrSerialize ); logger._logEvent.ts = ts2; logger._logEvent.messages = args.filter(function(arg) { return bindings.indexOf(arg) === -1; }); logger._logEvent.level.label = methodLevel; logger._logEvent.level.value = methodValue; send(methodLevel, logger._logEvent, val); logger._logEvent = createLogEventShape(bindings); } function createLogEventShape(bindings) { return { ts: 0, messages: [], bindings: bindings || [], level: { label: "", value: 0 } }; } function asErrValue(err) { const obj = { type: err.constructor.name, msg: err.message, stack: err.stack }; for (const key in err) { if (obj[key] === void 0) { obj[key] = err[key]; } } return obj; } function getTimeFunction(opts) { if (typeof opts.timestamp === "function") { return opts.timestamp; } if (opts.timestamp === false) { return nullTime; } return epochTime; } function mock() { return {}; } function passthrough(a2) { return a2; } function noop$1() { } function nullTime() { return false; } function epochTime() { return Date.now(); } function unixTime() { return Math.round(Date.now() / 1e3); } function isoTime() { return new Date(Date.now()).toISOString(); } function pfGlobalThisOrFallback() { function defd(o2) { return typeof o2 !== "undefined" && o2; } try { if (typeof globalThis !== "undefined") return globalThis; Object.defineProperty(Object.prototype, "globalThis", { get: function() { delete Object.prototype.globalThis; return this.globalThis = this; }, configurable: true }); return globalThis; } catch (e2) { return defd(self) || defd(window) || defd(this) || {}; } } const Dg = /* @__PURE__ */ getDefaultExportFromCjs(browser$1); const c$5 = { level: "info" }, n$8 = "custom_context"; var x$1 = Object.defineProperty, S$6 = Object.defineProperties, _$4 = Object.getOwnPropertyDescriptors, p$5 = Object.getOwnPropertySymbols, T$4 = Object.prototype.hasOwnProperty, z$3 = Object.prototype.propertyIsEnumerable, f$4 = (r2, e2, t2) => e2 in r2 ? x$1(r2, e2, { enumerable: true, configurable: true, writable: true, value: t2 }) : r2[e2] = t2, i$4 = (r2, e2) => { for (var t2 in e2 || (e2 = {})) T$4.call(e2, t2) && f$4(r2, t2, e2[t2]); if (p$5) for (var t2 of p$5(e2)) z$3.call(e2, t2) && f$4(r2, t2, e2[t2]); return r2; }, g$7 = (r2, e2) => S$6(r2, _$4(e2)); function k$2(r2) { return g$7(i$4({}, r2), { level: (r2 == null ? void 0 : r2.level) || c$5.level }); } function v$6(r2, e2 = n$8) { return r2[e2] || ""; } function b$4(r2, e2, t2 = n$8) { return r2[t2] = e2, r2; } function y$4(r2, e2 = n$8) { let t2 = ""; return typeof r2.bindings > "u" ? t2 = v$6(r2, e2) : t2 = r2.bindings().context || "", t2; } function w$6(r2, e2, t2 = n$8) { const o2 = y$4(r2, t2); return o2.trim() ? `${o2}/${e2}` : e2; } function E$5(r2, e2, t2 = n$8) { const o2 = w$6(r2, e2, t2), a2 = r2.child({ context: o2 }); return b$4(a2, o2, t2); } let n$7 = class n extends IEvents { constructor(s2) { super(), this.opts = s2, this.protocol = "wc", this.version = 2; } }; let h$4 = class h extends IEvents { constructor(s2, t2) { super(), this.core = s2, this.logger = t2, this.records = /* @__PURE__ */ new Map(); } }; let a$4 = class a { constructor(s2, t2) { this.logger = s2, this.core = t2; } }; let u$3 = class u extends IEvents { constructor(s2, t2) { super(), this.relayer = s2, this.logger = t2; } }; let g$6 = class g extends IEvents { constructor(s2) { super(); } }; let p$4 = class p { constructor(s2, t2, o2, M2) { this.core = s2, this.logger = t2, this.name = o2; } }; let d$5 = class d extends IEvents { constructor(s2, t2) { super(), this.relayer = s2, this.logger = t2; } }; let E$4 = class E extends IEvents { constructor(s2, t2) { super(), this.core = s2, this.logger = t2; } }; let y$3 = class y { constructor(s2, t2) { this.projectId = s2, this.logger = t2; } }; let v$5 = class v { constructor(s2, t2) { this.projectId = s2, this.logger = t2; } }; let b$3 = class b { constructor(s2) { this.opts = s2, this.protocol = "wc", this.version = 2; } }; let w$5 = class w { constructor(s2) { this.client = s2; } }; var ed25519 = {}; var sha512 = {}; (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); var binary_12 = binary; var wipe_12 = wipe$1; exports3.DIGEST_LENGTH = 64; exports3.BLOCK_SIZE = 128; var SHA5122 = ( /** @class */ function() { function SHA5123() { this.digestLength = exports3.DIGEST_LENGTH; this.blockSize = exports3.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 = false; this.reset(); } SHA5123.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; }; SHA5123.prototype.reset = function() { this._initState(); this._bufferLength = 0; this._bytesHashed = 0; this._finished = false; return this; }; SHA5123.prototype.clean = function() { wipe_12.wipe(this._buffer); wipe_12.wipe(this._tempHi); wipe_12.wipe(this._tempLo); this.reset(); }; SHA5123.prototype.update = function(data2, dataLength) { if (dataLength === void 0) { dataLength = data2.length; } if (this._finished) { throw new Error("SHA512: can't update because hash was finished."); } var dataPos = 0; this._bytesHashed += dataLength; if (this._bufferLength > 0) { while (this._bufferLength < exports3.BLOCK_SIZE && dataLength > 0) { this._buffer[this._bufferLength++] = data2[dataPos++]; dataLength--; } if (this._bufferLength === this.blockSize) { hashBlocks(this._tempHi, this._tempLo, this._stateHi, this._stateLo, this._buffer, 0, this.blockSize); this._bufferLength = 0; } } if (dataLength >= this.blockSize) { dataPos = hashBlocks(this._tempHi, this._tempLo, this._stateHi, this._stateLo, data2, dataPos, dataLength); dataLength %= this.blockSize; } while (dataLength > 0) { this._buffer[this._bufferLength++] = data2[dataPos++]; dataLength--; } return this; }; SHA5123.prototype.finish = function(out) { if (!this._finished) { var bytesHashed = this._bytesHashed; var left = this._bufferLength; var bitLenHi = bytesHashed / 536870912 | 0; var bitLenLo = bytesHashed << 3; var padLength = bytesHashed % 128 < 112 ? 128 : 256; this._buffer[left] = 128; for (var i2 = left + 1; i2 < padLength - 8; i2++) { this._buffer[i2] = 0; } binary_12.writeUint32BE(bitLenHi, this._buffer, padLength - 8); binary_12.writeUint32BE(bitLenLo, this._buffer, padLength - 4); hashBlocks(this._tempHi, this._tempLo, this._stateHi, this._stateLo, this._buffer, 0, padLength); this._finished = true; } for (var i2 = 0; i2 < this.digestLength / 8; i2++) { binary_12.writeUint32BE(this._stateHi[i2], out, i2 * 8); binary_12.writeUint32BE(this._stateLo[i2], out, i2 * 8 + 4); } return this; }; SHA5123.prototype.digest = function() { var out = new Uint8Array(this.digestLength); this.finish(out); return out; }; SHA5123.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 }; }; SHA5123.prototype.restoreState = function(savedState) { this._stateHi.set(savedState.stateHi); this._stateLo.set(savedState.stateLo); this._bufferLength = savedState.bufferLength; if (savedState.buffer) { this._buffer.set(savedState.buffer); } this._bytesHashed = savedState.bytesHashed; this._finished = false; return this; }; SHA5123.prototype.cleanSavedState = function(savedState) { wipe_12.wipe(savedState.stateHi); wipe_12.wipe(savedState.stateLo); if (savedState.buffer) { wipe_12.wipe(savedState.buffer); } savedState.bufferLength = 0; savedState.bytesHashed = 0; }; return SHA5123; }() ); exports3.SHA512 = SHA5122; var K2 = 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 hashBlocks(wh, wl, hh, hl, m2, pos, len2) { var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7]; var h2, l2; var th, tl; var a2, b2, c2, d2; while (len2 >= 128) { for (var i2 = 0; i2 < 16; i2++) { var j2 = 8 * i2 + pos; wh[i2] = binary_12.readUint32BE(m2, j2); wl[i2] = binary_12.readUint32BE(m2, j2 + 4); } for (var i2 = 0; i2 < 80; i2++) { var bh0 = ah0; var bh1 = ah1; var bh2 = ah2; var bh3 = ah3; var bh4 = ah4; var bh5 = ah5; var bh6 = ah6; var bh7 = ah7; var bl0 = al0; var bl1 = al1; var bl2 = al2; var bl3 = al3; var bl4 = al4; var bl5 = al5; var bl6 = al6; var bl7 = al7; h2 = ah7; l2 = al7; a2 = l2 & 65535; b2 = l2 >>> 16; c2 = h2 & 65535; d2 = h2 >>> 16; h2 = (ah4 >>> 14 | al4 << 32 - 14) ^ (ah4 >>> 18 | al4 << 32 - 18) ^ (al4 >>> 41 - 32 | ah4 << 32 - (41 - 32)); l2 = (al4 >>> 14 | ah4 << 32 - 14) ^ (al4 >>> 18 | ah4 << 32 - 18) ^ (ah4 >>> 41 - 32 | al4 << 32 - (41 - 32)); a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; h2 = ah4 & ah5 ^ ~ah4 & ah6; l2 = al4 & al5 ^ ~al4 & al6; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; h2 = K2[i2 * 2]; l2 = K2[i2 * 2 + 1]; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; h2 = wh[i2 % 16]; l2 = wl[i2 % 16]; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; b2 += a2 >>> 16; c2 += b2 >>> 16; d2 += c2 >>> 16; th = c2 & 65535 | d2 << 16; tl = a2 & 65535 | b2 << 16; h2 = th; l2 = tl; a2 = l2 & 65535; b2 = l2 >>> 16; c2 = h2 & 65535; d2 = h2 >>> 16; h2 = (ah0 >>> 28 | al0 << 32 - 28) ^ (al0 >>> 34 - 32 | ah0 << 32 - (34 - 32)) ^ (al0 >>> 39 - 32 | ah0 << 32 - (39 - 32)); l2 = (al0 >>> 28 | ah0 << 32 - 28) ^ (ah0 >>> 34 - 32 | al0 << 32 - (34 - 32)) ^ (ah0 >>> 39 - 32 | al0 << 32 - (39 - 32)); a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; h2 = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2; l2 = al0 & al1 ^ al0 & al2 ^ al1 & al2; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; b2 += a2 >>> 16; c2 += b2 >>> 16; d2 += c2 >>> 16; bh7 = c2 & 65535 | d2 << 16; bl7 = a2 & 65535 | b2 << 16; h2 = bh3; l2 = bl3; a2 = l2 & 65535; b2 = l2 >>> 16; c2 = h2 & 65535; d2 = h2 >>> 16; h2 = th; l2 = tl; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; b2 += a2 >>> 16; c2 += b2 >>> 16; d2 += c2 >>> 16; bh3 = c2 & 65535 | d2 << 16; bl3 = a2 & 65535 | b2 << 16; ah1 = bh0; ah2 = bh1; ah3 = bh2; ah4 = bh3; ah5 = bh4; ah6 = bh5; ah7 = bh6; ah0 = bh7; al1 = bl0; al2 = bl1; al3 = bl2; al4 = bl3; al5 = bl4; al6 = bl5; al7 = bl6; al0 = bl7; if (i2 % 16 === 15) { for (var j2 = 0; j2 < 16; j2++) { h2 = wh[j2]; l2 = wl[j2]; a2 = l2 & 65535; b2 = l2 >>> 16; c2 = h2 & 65535; d2 = h2 >>> 16; h2 = wh[(j2 + 9) % 16]; l2 = wl[(j2 + 9) % 16]; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; th = wh[(j2 + 1) % 16]; tl = wl[(j2 + 1) % 16]; h2 = (th >>> 1 | tl << 32 - 1) ^ (th >>> 8 | tl << 32 - 8) ^ th >>> 7; l2 = (tl >>> 1 | th << 32 - 1) ^ (tl >>> 8 | th << 32 - 8) ^ (tl >>> 7 | th << 32 - 7); a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; th = wh[(j2 + 14) % 16]; tl = wl[(j2 + 14) % 16]; h2 = (th >>> 19 | tl << 32 - 19) ^ (tl >>> 61 - 32 | th << 32 - (61 - 32)) ^ th >>> 6; l2 = (tl >>> 19 | th << 32 - 19) ^ (th >>> 61 - 32 | tl << 32 - (61 - 32)) ^ (tl >>> 6 | th << 32 - 6); a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; b2 += a2 >>> 16; c2 += b2 >>> 16; d2 += c2 >>> 16; wh[j2] = c2 & 65535 | d2 << 16; wl[j2] = a2 & 65535 | b2 << 16; } } } h2 = ah0; l2 = al0; a2 = l2 & 65535; b2 = l2 >>> 16; c2 = h2 & 65535; d2 = h2 >>> 16; h2 = hh[0]; l2 = hl[0]; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; b2 += a2 >>> 16; c2 += b2 >>> 16; d2 += c2 >>> 16; hh[0] = ah0 = c2 & 65535 | d2 << 16; hl[0] = al0 = a2 & 65535 | b2 << 16; h2 = ah1; l2 = al1; a2 = l2 & 65535; b2 = l2 >>> 16; c2 = h2 & 65535; d2 = h2 >>> 16; h2 = hh[1]; l2 = hl[1]; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; b2 += a2 >>> 16; c2 += b2 >>> 16; d2 += c2 >>> 16; hh[1] = ah1 = c2 & 65535 | d2 << 16; hl[1] = al1 = a2 & 65535 | b2 << 16; h2 = ah2; l2 = al2; a2 = l2 & 65535; b2 = l2 >>> 16; c2 = h2 & 65535; d2 = h2 >>> 16; h2 = hh[2]; l2 = hl[2]; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; b2 += a2 >>> 16; c2 += b2 >>> 16; d2 += c2 >>> 16; hh[2] = ah2 = c2 & 65535 | d2 << 16; hl[2] = al2 = a2 & 65535 | b2 << 16; h2 = ah3; l2 = al3; a2 = l2 & 65535; b2 = l2 >>> 16; c2 = h2 & 65535; d2 = h2 >>> 16; h2 = hh[3]; l2 = hl[3]; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; b2 += a2 >>> 16; c2 += b2 >>> 16; d2 += c2 >>> 16; hh[3] = ah3 = c2 & 65535 | d2 << 16; hl[3] = al3 = a2 & 65535 | b2 << 16; h2 = ah4; l2 = al4; a2 = l2 & 65535; b2 = l2 >>> 16; c2 = h2 & 65535; d2 = h2 >>> 16; h2 = hh[4]; l2 = hl[4]; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; b2 += a2 >>> 16; c2 += b2 >>> 16; d2 += c2 >>> 16; hh[4] = ah4 = c2 & 65535 | d2 << 16; hl[4] = al4 = a2 & 65535 | b2 << 16; h2 = ah5; l2 = al5; a2 = l2 & 65535; b2 = l2 >>> 16; c2 = h2 & 65535; d2 = h2 >>> 16; h2 = hh[5]; l2 = hl[5]; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; b2 += a2 >>> 16; c2 += b2 >>> 16; d2 += c2 >>> 16; hh[5] = ah5 = c2 & 65535 | d2 << 16; hl[5] = al5 = a2 & 65535 | b2 << 16; h2 = ah6; l2 = al6; a2 = l2 & 65535; b2 = l2 >>> 16; c2 = h2 & 65535; d2 = h2 >>> 16; h2 = hh[6]; l2 = hl[6]; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; b2 += a2 >>> 16; c2 += b2 >>> 16; d2 += c2 >>> 16; hh[6] = ah6 = c2 & 65535 | d2 << 16; hl[6] = al6 = a2 & 65535 | b2 << 16; h2 = ah7; l2 = al7; a2 = l2 & 65535; b2 = l2 >>> 16; c2 = h2 & 65535; d2 = h2 >>> 16; h2 = hh[7]; l2 = hl[7]; a2 += l2 & 65535; b2 += l2 >>> 16; c2 += h2 & 65535; d2 += h2 >>> 16; b2 += a2 >>> 16; c2 += b2 >>> 16; d2 += c2 >>> 16; hh[7] = ah7 = c2 & 65535 | d2 << 16; hl[7] = al7 = a2 & 65535 | b2 << 16; pos += 128; len2 -= 128; } return pos; } function hash2(data2) { var h2 = new SHA5122(); h2.update(data2); var digest = h2.digest(); h2.clean(); return digest; } exports3.hash = hash2; })(sha512); (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); exports3.convertSecretKeyToX25519 = exports3.convertPublicKeyToX25519 = exports3.verify = exports3.sign = exports3.extractPublicKeyFromSecretKey = exports3.generateKeyPair = exports3.generateKeyPairFromSeed = exports3.SEED_LENGTH = exports3.SECRET_KEY_LENGTH = exports3.PUBLIC_KEY_LENGTH = exports3.SIGNATURE_LENGTH = void 0; const random_1 = random; const sha512_1 = sha512; const wipe_12 = wipe$1; exports3.SIGNATURE_LENGTH = 64; exports3.PUBLIC_KEY_LENGTH = 32; exports3.SECRET_KEY_LENGTH = 64; exports3.SEED_LENGTH = 32; function gf(init2) { const r2 = new Float64Array(16); if (init2) { for (let i2 = 0; i2 < init2.length; i2++) { r2[i2] = init2[i2]; } } return r2; } const _9 = new Uint8Array(32); _9[0] = 9; const gf0 = gf(); const gf1 = gf([1]); const D2 = gf([ 30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995 ]); const D22 = gf([ 61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222 ]); const X2 = gf([ 54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553 ]); const Y2 = gf([ 26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214 ]); const I2 = gf([ 41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139 ]); function set25519(r2, a2) { for (let i2 = 0; i2 < 16; i2++) { r2[i2] = a2[i2] | 0; } } function car25519(o2) { let c2 = 1; for (let i2 = 0; i2 < 16; i2++) { let v2 = o2[i2] + c2 + 65535; c2 = Math.floor(v2 / 65536); o2[i2] = v2 - c2 * 65536; } o2[0] += c2 - 1 + 37 * (c2 - 1); } function sel25519(p2, q2, b2) { const c2 = ~(b2 - 1); for (let i2 = 0; i2 < 16; i2++) { const t2 = c2 & (p2[i2] ^ q2[i2]); p2[i2] ^= t2; q2[i2] ^= t2; } } function pack25519(o2, n2) { const m2 = gf(); const t2 = gf(); for (let i2 = 0; i2 < 16; i2++) { t2[i2] = n2[i2]; } car25519(t2); car25519(t2); car25519(t2); for (let j2 = 0; j2 < 2; j2++) { m2[0] = t2[0] - 65517; for (let i2 = 1; i2 < 15; i2++) { m2[i2] = t2[i2] - 65535 - (m2[i2 - 1] >> 16 & 1); m2[i2 - 1] &= 65535; } m2[15] = t2[15] - 32767 - (m2[14] >> 16 & 1); const b2 = m2[15] >> 16 & 1; m2[14] &= 65535; sel25519(t2, m2, 1 - b2); } for (let i2 = 0; i2 < 16; i2++) { o2[2 * i2] = t2[i2] & 255; o2[2 * i2 + 1] = t2[i2] >> 8; } } function verify32(x2, y2) { let d2 = 0; for (let i2 = 0; i2 < 32; i2++) { d2 |= x2[i2] ^ y2[i2]; } return (1 & d2 - 1 >>> 8) - 1; } function neq25519(a2, b2) { const c2 = new Uint8Array(32); const d2 = new Uint8Array(32); pack25519(c2, a2); pack25519(d2, b2); return verify32(c2, d2); } function par25519(a2) { const d2 = new Uint8Array(32); pack25519(d2, a2); return d2[0] & 1; } function unpack25519(o2, n2) { for (let i2 = 0; i2 < 16; i2++) { o2[i2] = n2[2 * i2] + (n2[2 * i2 + 1] << 8); } o2[15] &= 32767; } function add(o2, a2, b2) { for (let i2 = 0; i2 < 16; i2++) { o2[i2] = a2[i2] + b2[i2]; } } function sub(o2, a2, b2) { for (let i2 = 0; i2 < 16; i2++) { o2[i2] = a2[i2] - b2[i2]; } } function mul(o2, a2, b2) { let v2, c2, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b2[0], b1 = b2[1], b22 = b2[2], b3 = b2[3], b4 = b2[4], b5 = b2[5], b6 = b2[6], b7 = b2[7], b8 = b2[8], b9 = b2[9], b10 = b2[10], b11 = b2[11], b12 = b2[12], b13 = b2[13], b14 = b2[14], b15 = b2[15]; v2 = a2[0]; t0 += v2 * b0; t1 += v2 * b1; t2 += v2 * b22; t3 += v2 * b3; t4 += v2 * b4; t5 += v2 * b5; t6 += v2 * b6; t7 += v2 * b7; t8 += v2 * b8; t9 += v2 * b9; t10 += v2 * b10; t11 += v2 * b11; t12 += v2 * b12; t13 += v2 * b13; t14 += v2 * b14; t15 += v2 * b15; v2 = a2[1]; t1 += v2 * b0; t2 += v2 * b1; t3 += v2 * b22; t4 += v2 * b3; t5 += v2 * b4; t6 += v2 * b5; t7 += v2 * b6; t8 += v2 * b7; t9 += v2 * b8; t10 += v2 * b9; t11 += v2 * b10; t12 += v2 * b11; t13 += v2 * b12; t14 += v2 * b13; t15 += v2 * b14; t16 += v2 * b15; v2 = a2[2]; t2 += v2 * b0; t3 += v2 * b1; t4 += v2 * b22; t5 += v2 * b3; t6 += v2 * b4; t7 += v2 * b5; t8 += v2 * b6; t9 += v2 * b7; t10 += v2 * b8; t11 += v2 * b9; t12 += v2 * b10; t13 += v2 * b11; t14 += v2 * b12; t15 += v2 * b13; t16 += v2 * b14; t17 += v2 * b15; v2 = a2[3]; t3 += v2 * b0; t4 += v2 * b1; t5 += v2 * b22; t6 += v2 * b3; t7 += v2 * b4; t8 += v2 * b5; t9 += v2 * b6; t10 += v2 * b7; t11 += v2 * b8; t12 += v2 * b9; t13 += v2 * b10; t14 += v2 * b11; t15 += v2 * b12; t16 += v2 * b13; t17 += v2 * b14; t18 += v2 * b15; v2 = a2[4]; t4 += v2 * b0; t5 += v2 * b1; t6 += v2 * b22; t7 += v2 * b3; t8 += v2 * b4; t9 += v2 * b5; t10 += v2 * b6; t11 += v2 * b7; t12 += v2 * b8; t13 += v2 * b9; t14 += v2 * b10; t15 += v2 * b11; t16 += v2 * b12; t17 += v2 * b13; t18 += v2 * b14; t19 += v2 * b15; v2 = a2[5]; t5 += v2 * b0; t6 += v2 * b1; t7 += v2 * b22; t8 += v2 * b3; t9 += v2 * b4; t10 += v2 * b5; t11 += v2 * b6; t12 += v2 * b7; t13 += v2 * b8; t14 += v2 * b9; t15 += v2 * b10; t16 += v2 * b11; t17 += v2 * b12; t18 += v2 * b13; t19 += v2 * b14; t20 += v2 * b15; v2 = a2[6]; t6 += v2 * b0; t7 += v2 * b1; t8 += v2 * b22; t9 += v2 * b3; t10 += v2 * b4; t11 += v2 * b5; t12 += v2 * b6; t13 += v2 * b7; t14 += v2 * b8; t15 += v2 * b9; t16 += v2 * b10; t17 += v2 * b11; t18 += v2 * b12; t19 += v2 * b13; t20 += v2 * b14; t21 += v2 * b15; v2 = a2[7]; t7 += v2 * b0; t8 += v2 * b1; t9 += v2 * b22; t10 += v2 * b3; t11 += v2 * b4; t12 += v2 * b5; t13 += v2 * b6; t14 += v2 * b7; t15 += v2 * b8; t16 += v2 * b9; t17 += v2 * b10; t18 += v2 * b11; t19 += v2 * b12; t20 += v2 * b13; t21 += v2 * b14; t22 += v2 * b15; v2 = a2[8]; t8 += v2 * b0; t9 += v2 * b1; t10 += v2 * b22; t11 += v2 * b3; t12 += v2 * b4; t13 += v2 * b5; t14 += v2 * b6; t15 += v2 * b7; t16 += v2 * b8; t17 += v2 * b9; t18 += v2 * b10; t19 += v2 * b11; t20 += v2 * b12; t21 += v2 * b13; t22 += v2 * b14; t23 += v2 * b15; v2 = a2[9]; t9 += v2 * b0; t10 += v2 * b1; t11 += v2 * b22; t12 += v2 * b3; t13 += v2 * b4; t14 += v2 * b5; t15 += v2 * b6; t16 += v2 * b7; t17 += v2 * b8; t18 += v2 * b9; t19 += v2 * b10; t20 += v2 * b11; t21 += v2 * b12; t22 += v2 * b13; t23 += v2 * b14; t24 += v2 * b15; v2 = a2[10]; t10 += v2 * b0; t11 += v2 * b1; t12 += v2 * b22; t13 += v2 * b3; t14 += v2 * b4; t15 += v2 * b5; t16 += v2 * b6; t17 += v2 * b7; t18 += v2 * b8; t19 += v2 * b9; t20 += v2 * b10; t21 += v2 * b11; t22 += v2 * b12; t23 += v2 * b13; t24 += v2 * b14; t25 += v2 * b15; v2 = a2[11]; t11 += v2 * b0; t12 += v2 * b1; t13 += v2 * b22; t14 += v2 * b3; t15 += v2 * b4; t16 += v2 * b5; t17 += v2 * b6; t18 += v2 * b7; t19 += v2 * b8; t20 += v2 * b9; t21 += v2 * b10; t22 += v2 * b11; t23 += v2 * b12; t24 += v2 * b13; t25 += v2 * b14; t26 += v2 * b15; v2 = a2[12]; t12 += v2 * b0; t13 += v2 * b1; t14 += v2 * b22; t15 += v2 * b3; t16 += v2 * b4; t17 += v2 * b5; t18 += v2 * b6; t19 += v2 * b7; t20 += v2 * b8; t21 += v2 * b9; t22 += v2 * b10; t23 += v2 * b11; t24 += v2 * b12; t25 += v2 * b13; t26 += v2 * b14; t27 += v2 * b15; v2 = a2[13]; t13 += v2 * b0; t14 += v2 * b1; t15 += v2 * b22; t16 += v2 * b3; t17 += v2 * b4; t18 += v2 * b5; t19 += v2 * b6; t20 += v2 * b7; t21 += v2 * b8; t22 += v2 * b9; t23 += v2 * b10; t24 += v2 * b11; t25 += v2 * b12; t26 += v2 * b13; t27 += v2 * b14; t28 += v2 * b15; v2 = a2[14]; t14 += v2 * b0; t15 += v2 * b1; t16 += v2 * b22; t17 += v2 * b3; t18 += v2 * b4; t19 += v2 * b5; t20 += v2 * b6; t21 += v2 * b7; t22 += v2 * b8; t23 += v2 * b9; t24 += v2 * b10; t25 += v2 * b11; t26 += v2 * b12; t27 += v2 * b13; t28 += v2 * b14; t29 += v2 * b15; v2 = a2[15]; t15 += v2 * b0; t16 += v2 * b1; t17 += v2 * b22; t18 += v2 * b3; t19 += v2 * b4; t20 += v2 * b5; t21 += v2 * b6; t22 += v2 * b7; t23 += v2 * b8; t24 += v2 * b9; t25 += v2 * b10; t26 += v2 * b11; t27 += v2 * b12; t28 += v2 * b13; t29 += v2 * b14; t30 += v2 * b15; t0 += 38 * t16; t1 += 38 * t17; t2 += 38 * t18; t3 += 38 * t19; t4 += 38 * t20; t5 += 38 * t21; t6 += 38 * t22; t7 += 38 * t23; t8 += 38 * t24; t9 += 38 * t25; t10 += 38 * t26; t11 += 38 * t27; t12 += 38 * t28; t13 += 38 * t29; t14 += 38 * t30; c2 = 1; v2 = t0 + c2 + 65535; c2 = Math.floor(v2 / 65536); t0 = v2 - c2 * 65536; v2 = t1 + c2 + 65535; c2 = Math.floor(v2 / 65536); t1 = v2 - c2 * 65536; v2 = t2 + c2 + 65535; c2 = Math.floor(v2 / 65536); t2 = v2 - c2 * 65536; v2 = t3 + c2 + 65535; c2 = Math.floor(v2 / 65536); t3 = v2 - c2 * 65536; v2 = t4 + c2 + 65535; c2 = Math.floor(v2 / 65536); t4 = v2 - c2 * 65536; v2 = t5 + c2 + 65535; c2 = Math.floor(v2 / 65536); t5 = v2 - c2 * 65536; v2 = t6 + c2 + 65535; c2 = Math.floor(v2 / 65536); t6 = v2 - c2 * 65536; v2 = t7 + c2 + 65535; c2 = Math.floor(v2 / 65536); t7 = v2 - c2 * 65536; v2 = t8 + c2 + 65535; c2 = Math.floor(v2 / 65536); t8 = v2 - c2 * 65536; v2 = t9 + c2 + 65535; c2 = Math.floor(v2 / 65536); t9 = v2 - c2 * 65536; v2 = t10 + c2 + 65535; c2 = Math.floor(v2 / 65536); t10 = v2 - c2 * 65536; v2 = t11 + c2 + 65535; c2 = Math.floor(v2 / 65536); t11 = v2 - c2 * 65536; v2 = t12 + c2 + 65535; c2 = Math.floor(v2 / 65536); t12 = v2 - c2 * 65536; v2 = t13 + c2 + 65535; c2 = Math.floor(v2 / 65536); t13 = v2 - c2 * 65536; v2 = t14 + c2 + 65535; c2 = Math.floor(v2 / 65536); t14 = v2 - c2 * 65536; v2 = t15 + c2 + 65535; c2 = Math.floor(v2 / 65536); t15 = v2 - c2 * 65536; t0 += c2 - 1 + 37 * (c2 - 1); c2 = 1; v2 = t0 + c2 + 65535; c2 = Math.floor(v2 / 65536); t0 = v2 - c2 * 65536; v2 = t1 + c2 + 65535; c2 = Math.floor(v2 / 65536); t1 = v2 - c2 * 65536; v2 = t2 + c2 + 65535; c2 = Math.floor(v2 / 65536); t2 = v2 - c2 * 65536; v2 = t3 + c2 + 65535; c2 = Math.floor(v2 / 65536); t3 = v2 - c2 * 65536; v2 = t4 + c2 + 65535; c2 = Math.floor(v2 / 65536); t4 = v2 - c2 * 65536; v2 = t5 + c2 + 65535; c2 = Math.floor(v2 / 65536); t5 = v2 - c2 * 65536; v2 = t6 + c2 + 65535; c2 = Math.floor(v2 / 65536); t6 = v2 - c2 * 65536; v2 = t7 + c2 + 65535; c2 = Math.floor(v2 / 65536); t7 = v2 - c2 * 65536; v2 = t8 + c2 + 65535; c2 = Math.floor(v2 / 65536); t8 = v2 - c2 * 65536; v2 = t9 + c2 + 65535; c2 = Math.floor(v2 / 65536); t9 = v2 - c2 * 65536; v2 = t10 + c2 + 65535; c2 = Math.floor(v2 / 65536); t10 = v2 - c2 * 65536; v2 = t11 + c2 + 65535; c2 = Math.floor(v2 / 65536); t11 = v2 - c2 * 65536; v2 = t12 + c2 + 65535; c2 = Math.floor(v2 / 65536); t12 = v2 - c2 * 65536; v2 = t13 + c2 + 65535; c2 = Math.floor(v2 / 65536); t13 = v2 - c2 * 65536; v2 = t14 + c2 + 65535; c2 = Math.floor(v2 / 65536); t14 = v2 - c2 * 65536; v2 = t15 + c2 + 65535; c2 = Math.floor(v2 / 65536); t15 = v2 - c2 * 65536; t0 += c2 - 1 + 37 * (c2 - 1); o2[0] = t0; o2[1] = t1; o2[2] = t2; o2[3] = t3; o2[4] = t4; o2[5] = t5; o2[6] = t6; o2[7] = t7; o2[8] = t8; o2[9] = t9; o2[10] = t10; o2[11] = t11; o2[12] = t12; o2[13] = t13; o2[14] = t14; o2[15] = t15; } function square(o2, a2) { mul(o2, a2, a2); } function inv25519(o2, i2) { const c2 = gf(); let a2; for (a2 = 0; a2 < 16; a2++) { c2[a2] = i2[a2]; } for (a2 = 253; a2 >= 0; a2--) { square(c2, c2); if (a2 !== 2 && a2 !== 4) { mul(c2, c2, i2); } } for (a2 = 0; a2 < 16; a2++) { o2[a2] = c2[a2]; } } function pow2523(o2, i2) { const c2 = gf(); let a2; for (a2 = 0; a2 < 16; a2++) { c2[a2] = i2[a2]; } for (a2 = 250; a2 >= 0; a2--) { square(c2, c2); if (a2 !== 1) { mul(c2, c2, i2); } } for (a2 = 0; a2 < 16; a2++) { o2[a2] = c2[a2]; } } function edadd(p2, q2) { const a2 = gf(), b2 = gf(), c2 = gf(), d2 = gf(), e2 = gf(), f2 = gf(), g2 = gf(), h2 = gf(), t2 = gf(); sub(a2, p2[1], p2[0]); sub(t2, q2[1], q2[0]); mul(a2, a2, t2); add(b2, p2[0], p2[1]); add(t2, q2[0], q2[1]); mul(b2, b2, t2); mul(c2, p2[3], q2[3]); mul(c2, c2, D22); mul(d2, p2[2], q2[2]); add(d2, d2, d2); sub(e2, b2, a2); sub(f2, d2, c2); add(g2, d2, c2); add(h2, b2, a2); mul(p2[0], e2, f2); mul(p2[1], h2, g2); mul(p2[2], g2, f2); mul(p2[3], e2, h2); } function cswap(p2, q2, b2) { for (let i2 = 0; i2 < 4; i2++) { sel25519(p2[i2], q2[i2], b2); } } function pack(r2, p2) { const tx = gf(), ty = gf(), zi = gf(); inv25519(zi, p2[2]); mul(tx, p2[0], zi); mul(ty, p2[1], zi); pack25519(r2, ty); r2[31] ^= par25519(tx) << 7; } function scalarmult(p2, q2, s2) { set25519(p2[0], gf0); set25519(p2[1], gf1); set25519(p2[2], gf1); set25519(p2[3], gf0); for (let i2 = 255; i2 >= 0; --i2) { const b2 = s2[i2 / 8 | 0] >> (i2 & 7) & 1; cswap(p2, q2, b2); edadd(q2, p2); edadd(p2, p2); cswap(p2, q2, b2); } } function scalarbase(p2, s2) { const q2 = [gf(), gf(), gf(), gf()]; set25519(q2[0], X2); set25519(q2[1], Y2); set25519(q2[2], gf1); mul(q2[3], X2, Y2); scalarmult(p2, q2, s2); } function generateKeyPairFromSeed(seed) { if (seed.length !== exports3.SEED_LENGTH) { throw new Error(`ed25519: seed must be ${exports3.SEED_LENGTH} bytes`); } const d2 = (0, sha512_1.hash)(seed); d2[0] &= 248; d2[31] &= 127; d2[31] |= 64; const publicKey = new Uint8Array(32); const p2 = [gf(), gf(), gf(), gf()]; scalarbase(p2, d2); pack(publicKey, p2); const secretKey = new Uint8Array(64); secretKey.set(seed); secretKey.set(publicKey, 32); return { publicKey, secretKey }; } exports3.generateKeyPairFromSeed = generateKeyPairFromSeed; function generateKeyPair2(prng) { const seed = (0, random_1.randomBytes)(32, prng); const result = generateKeyPairFromSeed(seed); (0, wipe_12.wipe)(seed); return result; } exports3.generateKeyPair = generateKeyPair2; function extractPublicKeyFromSecretKey(secretKey) { if (secretKey.length !== exports3.SECRET_KEY_LENGTH) { throw new Error(`ed25519: secret key must be ${exports3.SECRET_KEY_LENGTH} bytes`); } return new Uint8Array(secretKey.subarray(32)); } exports3.extractPublicKeyFromSecretKey = extractPublicKeyFromSecretKey; const L2 = 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 modL(r2, x2) { let carry; let i2; let j2; let k2; for (i2 = 63; i2 >= 32; --i2) { carry = 0; for (j2 = i2 - 32, k2 = i2 - 12; j2 < k2; ++j2) { x2[j2] += carry - 16 * x2[i2] * L2[j2 - (i2 - 32)]; carry = Math.floor((x2[j2] + 128) / 256); x2[j2] -= carry * 256; } x2[j2] += carry; x2[i2] = 0; } carry = 0; for (j2 = 0; j2 < 32; j2++) { x2[j2] += carry - (x2[31] >> 4) * L2[j2]; carry = x2[j2] >> 8; x2[j2] &= 255; } for (j2 = 0; j2 < 32; j2++) { x2[j2] -= carry * L2[j2]; } for (i2 = 0; i2 < 32; i2++) { x2[i2 + 1] += x2[i2] >> 8; r2[i2] = x2[i2] & 255; } } function reduce(r2) { const x2 = new Float64Array(64); for (let i2 = 0; i2 < 64; i2++) { x2[i2] = r2[i2]; } for (let i2 = 0; i2 < 64; i2++) { r2[i2] = 0; } modL(r2, x2); } function sign(secretKey, message) { const x2 = new Float64Array(64); const p2 = [gf(), gf(), gf(), gf()]; const d2 = (0, sha512_1.hash)(secretKey.subarray(0, 32)); d2[0] &= 248; d2[31] &= 127; d2[31] |= 64; const signature = new Uint8Array(64); signature.set(d2.subarray(32), 32); const hs2 = new sha512_1.SHA512(); hs2.update(signature.subarray(32)); hs2.update(message); const r2 = hs2.digest(); hs2.clean(); reduce(r2); scalarbase(p2, r2); pack(signature, p2); hs2.reset(); hs2.update(signature.subarray(0, 32)); hs2.update(secretKey.subarray(32)); hs2.update(message); const h2 = hs2.digest(); reduce(h2); for (let i2 = 0; i2 < 32; i2++) { x2[i2] = r2[i2]; } for (let i2 = 0; i2 < 32; i2++) { for (let j2 = 0; j2 < 32; j2++) { x2[i2 + j2] += h2[i2] * d2[j2]; } } modL(signature.subarray(32), x2); return signature; } exports3.sign = sign; function unpackneg(r2, p2) { const t2 = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); set25519(r2[2], gf1); unpack25519(r2[1], p2); square(num, r2[1]); mul(den, num, D2); sub(num, num, r2[2]); add(den, r2[2], den); square(den2, den); square(den4, den2); mul(den6, den4, den2); mul(t2, den6, num); mul(t2, t2, den); pow2523(t2, t2); mul(t2, t2, num); mul(t2, t2, den); mul(t2, t2, den); mul(r2[0], t2, den); square(chk, r2[0]); mul(chk, chk, den); if (neq25519(chk, num)) { mul(r2[0], r2[0], I2); } square(chk, r2[0]); mul(chk, chk, den); if (neq25519(chk, num)) { return -1; } if (par25519(r2[0]) === p2[31] >> 7) { sub(r2[0], gf0, r2[0]); } mul(r2[3], r2[0], r2[1]); return 0; } function verify(publicKey, message, signature) { const t2 = new Uint8Array(32); const p2 = [gf(), gf(), gf(), gf()]; const q2 = [gf(), gf(), gf(), gf()]; if (signature.length !== exports3.SIGNATURE_LENGTH) { throw new Error(`ed25519: signature must be ${exports3.SIGNATURE_LENGTH} bytes`); } if (unpackneg(q2, publicKey)) { return false; } const hs2 = new sha512_1.SHA512(); hs2.update(signature.subarray(0, 32)); hs2.update(publicKey); hs2.update(message); const h2 = hs2.digest(); reduce(h2); scalarmult(p2, q2, h2); scalarbase(q2, signature.subarray(32)); edadd(p2, q2); pack(t2, p2); if (verify32(signature, t2)) { return false; } return true; } exports3.verify = verify; function convertPublicKeyToX25519(publicKey) { let q2 = [gf(), gf(), gf(), gf()]; if (unpackneg(q2, publicKey)) { throw new Error("Ed25519: invalid public key"); } let a2 = gf(); let b2 = gf(); let y2 = q2[1]; add(a2, gf1, y2); sub(b2, gf1, y2); inv25519(b2, b2); mul(a2, a2, b2); let z2 = new Uint8Array(32); pack25519(z2, a2); return z2; } exports3.convertPublicKeyToX25519 = convertPublicKeyToX25519; function convertSecretKeyToX25519(secretKey) { const d2 = (0, sha512_1.hash)(secretKey.subarray(0, 32)); d2[0] &= 248; d2[31] &= 127; d2[31] |= 64; const o2 = new Uint8Array(d2.subarray(0, 32)); (0, wipe_12.wipe)(d2); return o2; } exports3.convertSecretKeyToX25519 = convertSecretKeyToX25519; })(ed25519); const JWT_IRIDIUM_ALG = "EdDSA"; const JWT_IRIDIUM_TYP = "JWT"; const JWT_DELIMITER = "."; const JWT_ENCODING = "base64url"; const JSON_ENCODING = "utf8"; const DATA_ENCODING = "utf8"; const DID_DELIMITER = ":"; const DID_PREFIX = "did"; const DID_METHOD = "key"; const MULTICODEC_ED25519_ENCODING = "base58btc"; const MULTICODEC_ED25519_BASE = "z"; const MULTICODEC_ED25519_HEADER = "K36"; const KEY_PAIR_SEED_LENGTH = 32; function encodeJSON(val) { return toString(fromString(safeJsonStringify(val), JSON_ENCODING), JWT_ENCODING); } function encodeIss(publicKey) { const header = fromString(MULTICODEC_ED25519_HEADER, MULTICODEC_ED25519_ENCODING); const multicodec = MULTICODEC_ED25519_BASE + toString(concat([header, publicKey]), MULTICODEC_ED25519_ENCODING); return [DID_PREFIX, DID_METHOD, multicodec].join(DID_DELIMITER); } function encodeSig(bytes2) { return toString(bytes2, JWT_ENCODING); } function encodeData(params) { return fromString([encodeJSON(params.header), encodeJSON(params.payload)].join(JWT_DELIMITER), DATA_ENCODING); } function encodeJWT(params) { return [ encodeJSON(params.header), encodeJSON(params.payload), encodeSig(params.signature) ].join(JWT_DELIMITER); } function generateKeyPair(seed = random.randomBytes(KEY_PAIR_SEED_LENGTH)) { return ed25519.generateKeyPairFromSeed(seed); } async function signJWT(sub, aud, ttl, keyPair, iat = cjs$5.fromMiliseconds(Date.now())) { const header = { alg: JWT_IRIDIUM_ALG, typ: JWT_IRIDIUM_TYP }; const iss = encodeIss(keyPair.publicKey); const exp = iat + ttl; const payload = { iss, sub, aud, iat, exp }; const data2 = encodeData({ header, payload }); const signature = ed25519.sign(keyPair.secretKey, data2); return encodeJWT({ header, payload, signature }); } const PARSE_ERROR = "PARSE_ERROR"; const INVALID_REQUEST = "INVALID_REQUEST"; const METHOD_NOT_FOUND = "METHOD_NOT_FOUND"; const INVALID_PARAMS = "INVALID_PARAMS"; const INTERNAL_ERROR = "INTERNAL_ERROR"; const SERVER_ERROR = "SERVER_ERROR"; const RESERVED_ERROR_CODES = [-32700, -32600, -32601, -32602, -32603]; const STANDARD_ERROR_MAP = { [PARSE_ERROR]: { code: -32700, message: "Parse error" }, [INVALID_REQUEST]: { code: -32600, message: "Invalid Request" }, [METHOD_NOT_FOUND]: { code: -32601, message: "Method not found" }, [INVALID_PARAMS]: { code: -32602, message: "Invalid params" }, [INTERNAL_ERROR]: { code: -32603, message: "Internal error" }, [SERVER_ERROR]: { code: -32e3, message: "Server error" } }; const DEFAULT_ERROR = SERVER_ERROR; function isReservedErrorCode(code2) { return RESERVED_ERROR_CODES.includes(code2); } function getError(type2) { if (!Object.keys(STANDARD_ERROR_MAP).includes(type2)) { return STANDARD_ERROR_MAP[DEFAULT_ERROR]; } return STANDARD_ERROR_MAP[type2]; } function getErrorByCode(code2) { const match = Object.values(STANDARD_ERROR_MAP).find((e2) => e2.code === code2); if (!match) { return STANDARD_ERROR_MAP[DEFAULT_ERROR]; } return match; } function parseConnectionError(e2, url, type2) { return e2.message.includes("getaddrinfo ENOTFOUND") || e2.message.includes("connect ECONNREFUSED") ? new Error(`Unavailable ${type2} RPC url at ${url}`) : e2; } var cjs = {}; var crypto$1 = {}; var hasRequiredCrypto; function requireCrypto() { if (hasRequiredCrypto) return crypto$1; hasRequiredCrypto = 1; Object.defineProperty(crypto$1, "__esModule", { value: true }); crypto$1.isBrowserCryptoAvailable = crypto$1.getSubtleCrypto = crypto$1.getBrowerCrypto = void 0; function getBrowerCrypto() { return (commonjsGlobal === null || commonjsGlobal === void 0 ? void 0 : commonjsGlobal.crypto) || (commonjsGlobal === null || commonjsGlobal === void 0 ? void 0 : commonjsGlobal.msCrypto) || {}; } crypto$1.getBrowerCrypto = getBrowerCrypto; function getSubtleCrypto() { const browserCrypto = getBrowerCrypto(); return browserCrypto.subtle || browserCrypto.webkitSubtle; } crypto$1.getSubtleCrypto = getSubtleCrypto; function isBrowserCryptoAvailable() { return !!getBrowerCrypto() && !!getSubtleCrypto(); } crypto$1.isBrowserCryptoAvailable = isBrowserCryptoAvailable; return crypto$1; } var env = {}; var hasRequiredEnv; function requireEnv() { if (hasRequiredEnv) return env; hasRequiredEnv = 1; Object.defineProperty(env, "__esModule", { value: true }); env.isBrowser = env.isNode = env.isReactNative = void 0; function isReactNative() { return typeof document === "undefined" && typeof navigator !== "undefined" && navigator.product === "ReactNative"; } env.isReactNative = isReactNative; function isNode() { return typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.versions.node !== "undefined"; } env.isNode = isNode; function isBrowser() { return !isReactNative() && !isNode(); } env.isBrowser = isBrowser; return env; } (function(exports3) { Object.defineProperty(exports3, "__esModule", { value: true }); const tslib_12 = require$$0$4; tslib_12.__exportStar(requireCrypto(), exports3); tslib_12.__exportStar(requireEnv(), exports3); })(cjs); function payloadId(entropy = 3) { const date2 = Date.now() * Math.pow(10, entropy); const extra = Math.floor(Math.random() * Math.pow(10, entropy)); return date2 + extra; } function getBigIntRpcId(entropy = 6) { return BigInt(payloadId(entropy)); } function formatJsonRpcRequest(method, params, id2) { return { id: id2 || payloadId(), jsonrpc: "2.0", method, params }; } function formatJsonRpcResult(id2, result) { return { id: id2, jsonrpc: "2.0", result }; } function formatJsonRpcError(id2, error2, data2) { return { id: id2, jsonrpc: "2.0", error: formatErrorMessage(error2, data2) }; } function formatErrorMessage(error2, data2) { if (typeof error2 === "undefined") { return getError(INTERNAL_ERROR); } if (typeof error2 === "string") { error2 = Object.assign(Object.assign({}, getError(SERVER_ERROR)), { message: error2 }); } if (typeof data2 !== "undefined") { error2.data = data2; } if (isReservedErrorCode(error2.code)) { error2 = getErrorByCode(error2.code); } return error2; } let e$6 = class e { }; let n$6 = class n extends e$6 { constructor() { super(); } }; let r$4 = class r extends n$6 { constructor(c2) { super(); } }; const HTTP_REGEX = "^https?:"; const WS_REGEX = "^wss?:"; function getUrlProtocol(url) { const matches = url.match(new RegExp(/^\w+:/, "gi")); if (!matches || !matches.length) return; return matches[0]; } function matchRegexProtocol(url, regex2) { const protocol = getUrlProtocol(url); if (typeof protocol === "undefined") return false; return new RegExp(regex2).test(protocol); } function isHttpUrl(url) { return matchRegexProtocol(url, HTTP_REGEX); } function isWsUrl(url) { return matchRegexProtocol(url, WS_REGEX); } function isLocalhostUrl(url) { return new RegExp("wss?://localhost(:d{2,5})?").test(url); } function isJsonRpcPayload(payload) { return typeof payload === "object" && "id" in payload && "jsonrpc" in payload && payload.jsonrpc === "2.0"; } function isJsonRpcRequest(payload) { return isJsonRpcPayload(payload) && "method" in payload; } function isJsonRpcResponse(payload) { return isJsonRpcPayload(payload) && (isJsonRpcResult(payload) || isJsonRpcError(payload)); } function isJsonRpcResult(payload) { return "result" in payload; } function isJsonRpcError(payload) { return "error" in payload; } class JsonRpcProvider extends r$4 { constructor(connection) { super(connection); this.events = new eventsExports.EventEmitter(); this.hasRegisteredEventListeners = false; this.connection = this.setConnection(connection); if (this.connection.connected) { this.registerEventListeners(); } } async connect(connection = this.connection) { await this.open(connection); } async disconnect() { await this.close(); } on(event, listener) { this.events.on(event, listener); } once(event, listener) { this.events.once(event, listener); } off(event, listener) { this.events.off(event, listener); } removeListener(event, listener) { this.events.removeListener(event, listener); } async request(request, context) { return this.requestStrict(formatJsonRpcRequest(request.method, request.params || [], request.id || getBigIntRpcId().toString()), context); } async requestStrict(request, context) { return new Promise(async (resolve, reject) => { if (!this.connection.connected) { try { await this.open(); } catch (e2) { reject(e2); } } this.events.on(`${request.id}`, (response) => { if (isJsonRpcError(response)) { reject(response.error); } else { resolve(response.result); } }); try { await this.connection.send(request, context); } catch (e2) { reject(e2); } }); } setConnection(connection = this.connection) { return connection; } onPayload(payload) { this.events.emit("payload", payload); if (isJsonRpcResponse(payload)) { this.events.emit(`${payload.id}`, payload); } else { this.events.emit("message", { type: payload.method, data: payload.params }); } } onClose(event) { if (event && event.code === 3e3) { this.events.emit("error", new Error(`WebSocket connection closed abnormally with code: ${event.code} ${event.reason ? `(${event.reason})` : ""}`)); } this.events.emit("disconnect"); } async open(connection = this.connection) { if (this.connection === connection && this.connection.connected) return; if (this.connection.connected) this.close(); if (typeof connection === "string") { await this.connection.open(connection); connection = this.connection; } this.connection = this.setConnection(connection); await this.connection.open(); this.registerEventListeners(); this.events.emit("connect"); } async close() { await this.connection.close(); } registerEventListeners() { if (this.hasRegisteredEventListeners) return; this.connection.on("payload", (payload) => this.onPayload(payload)); this.connection.on("close", (event) => this.onClose(event)); this.connection.on("error", (error2) => this.events.emit("error", error2)); this.connection.on("register_error", (error2) => this.onClose()); this.hasRegisteredEventListeners = true; } } const w$4 = () => 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"), b$2 = () => typeof WebSocket < "u" || typeof global < "u" && typeof global.WebSocket < "u" || typeof window < "u" && typeof window.WebSocket < "u" || typeof self < "u" && typeof self.WebSocket < "u", a$3 = (c2) => c2.split("?")[0], h$3 = 10, S$5 = w$4(); let f$3 = class f { constructor(e2) { if (this.url = e2, this.events = new eventsExports.EventEmitter(), this.registering = false, !isWsUrl(e2)) throw new Error(`Provided URL is not compatible with WebSocket connection: ${e2}`); this.url = e2; } get connected() { return typeof this.socket < "u"; } get connecting() { return this.registering; } on(e2, t2) { this.events.on(e2, t2); } once(e2, t2) { this.events.once(e2, t2); } off(e2, t2) { this.events.off(e2, t2); } removeListener(e2, t2) { this.events.removeListener(e2, t2); } async open(e2 = this.url) { await this.register(e2); } async close() { return new Promise((e2, t2) => { if (typeof this.socket > "u") { t2(new Error("Connection already closed")); return; } this.socket.onclose = (n2) => { this.onClose(n2), e2(); }, this.socket.close(); }); } async send(e2) { typeof this.socket > "u" && (this.socket = await this.register()); try { this.socket.send(safeJsonStringify(e2)); } catch (t2) { this.onError(e2.id, t2); } } register(e2 = this.url) { if (!isWsUrl(e2)) throw new Error(`Provided URL is not compatible with WebSocket connection: ${e2}`); if (this.registering) { const t2 = this.events.getMaxListeners(); return (this.events.listenerCount("register_error") >= t2 || this.events.listenerCount("open") >= t2) && this.events.setMaxListeners(t2 + 1), new Promise((n2, o2) => { this.events.once("register_error", (s2) => { this.resetMaxListeners(), o2(s2); }), this.events.once("open", () => { if (this.resetMaxListeners(), typeof this.socket > "u") return o2(new Error("WebSocket connection is missing or invalid")); n2(this.socket); }); }); } return this.url = e2, this.registering = true, new Promise((t2, n2) => { const o2 = new URLSearchParams(e2).get("origin"), s2 = cjs.isReactNative() ? { headers: { origin: o2 } } : { rejectUnauthorized: !isLocalhostUrl(e2) }, i2 = new S$5(e2, [], s2); b$2() ? i2.onerror = (r2) => { const l2 = r2; n2(this.emitError(l2.error)); } : i2.on("error", (r2) => { n2(this.emitError(r2)); }), i2.onopen = () => { this.onOpen(i2), t2(i2); }; }); } onOpen(e2) { e2.onmessage = (t2) => this.onPayload(t2), e2.onclose = (t2) => this.onClose(t2), this.socket = e2, this.registering = false, this.events.emit("open"); } onClose(e2) { this.socket = void 0, this.registering = false, this.events.emit("close", e2); } onPayload(e2) { if (typeof e2.data > "u") return; const t2 = typeof e2.data == "string" ? safeJsonParse(e2.data) : e2.data; this.events.emit("payload", t2); } onError(e2, t2) { const n2 = this.parseError(t2), o2 = n2.message || n2.toString(), s2 = formatJsonRpcError(e2, o2); this.events.emit("payload", s2); } parseError(e2, t2 = this.url) { return parseConnectionError(e2, a$3(t2), "WS"); } resetMaxListeners() { this.events.getMaxListeners() > h$3 && this.events.setMaxListeners(h$3); } emitError(e2) { const t2 = this.parseError(new Error((e2 == null ? void 0 : e2.message) || `WebSocket connection failed for host: ${a$3(this.url)}`)); return this.events.emit("register_error", t2), t2; } }; var lodash_isequal = { exports: {} }; lodash_isequal.exports; (function(module2, exports3) { var LARGE_ARRAY_SIZE = 200; var HASH_UNDEFINED = "__lodash_hash_undefined__"; var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; var MAX_SAFE_INTEGER2 = 9007199254740991; var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]"; var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reIsHostCtor = /^\[object .+?Constructor\]$/; var reIsUint = /^(?:0|[1-9]\d*)$/; var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; var freeSelf = typeof self == "object" && self && self.Object === Object && self; var root = freeGlobal || freeSelf || Function("return this")(); var freeExports = exports3 && !exports3.nodeType && exports3; var freeModule = freeExports && true && module2 && !module2.nodeType && module2; var moduleExports = freeModule && freeModule.exports === freeExports; var freeProcess = moduleExports && freeGlobal.process; var nodeUtil = function() { try { return freeProcess && freeProcess.binding && freeProcess.binding("util"); } catch (e2) { } }(); var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; function arrayFilter(array2, predicate) { var index2 = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result = []; while (++index2 < length) { var value = array2[index2]; if (predicate(value, index2, array2)) { result[resIndex++] = value; } } return result; } function arrayPush(array2, values) { var index2 = -1, length = values.length, offset = array2.length; while (++index2 < length) { array2[offset + index2] = values[index2]; } return array2; } function arraySome(array2, predicate) { var index2 = -1, length = array2 == null ? 0 : array2.length; while (++index2 < length) { if (predicate(array2[index2], index2, array2)) { return true; } } return false; } function baseTimes(n2, iteratee) { var index2 = -1, result = Array(n2); while (++index2 < n2) { result[index2] = iteratee(index2); } return result; } function baseUnary(func2) { return function(value) { return func2(value); }; } function cacheHas(cache, key) { return cache.has(key); } function getValue(object2, key) { return object2 == null ? void 0 : object2[key]; } function mapToArray(map2) { var index2 = -1, result = Array(map2.size); map2.forEach(function(value, key) { result[++index2] = [key, value]; }); return result; } function overArg(func2, transform) { return function(arg) { return func2(transform(arg)); }; } function setToArray(set2) { var index2 = -1, result = Array(set2.size); set2.forEach(function(value) { result[++index2] = value; }); return result; } var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; var coreJsData = root["__core-js_shared__"]; var funcToString = funcProto.toString; var hasOwnProperty2 = objectProto.hasOwnProperty; var maskSrcKey = function() { var uid2 = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); return uid2 ? "Symbol(src)_1." + uid2 : ""; }(); var nativeObjectToString = objectProto.toString; var reIsNative = RegExp( "^" + funcToString.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); var Buffer2 = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array2 = root.Uint8Array, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0; var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object); var DataView2 = getNative(root, "DataView"), Map2 = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set2 = getNative(root, "Set"), WeakMap2 = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create"); var dataViewCtorString = toSource(DataView2), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2); var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; function Hash2(entries2) { var index2 = -1, length = entries2 == null ? 0 : entries2.length; this.clear(); while (++index2 < length) { var entry = entries2[index2]; this.set(entry[0], entry[1]); } } function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } function hashGet(key) { var data2 = this.__data__; if (nativeCreate) { var result = data2[key]; return result === HASH_UNDEFINED ? void 0 : result; } return hasOwnProperty2.call(data2, key) ? data2[key] : void 0; } function hashHas(key) { var data2 = this.__data__; return nativeCreate ? data2[key] !== void 0 : hasOwnProperty2.call(data2, key); } function hashSet(key, value) { var data2 = this.__data__; this.size += this.has(key) ? 0 : 1; data2[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value; return this; } Hash2.prototype.clear = hashClear; Hash2.prototype["delete"] = hashDelete; Hash2.prototype.get = hashGet; Hash2.prototype.has = hashHas; Hash2.prototype.set = hashSet; function ListCache(entries2) { var index2 = -1, length = entries2 == null ? 0 : entries2.length; this.clear(); while (++index2 < length) { var entry = entries2[index2]; this.set(entry[0], entry[1]); } } function listCacheClear() { this.__data__ = []; this.size = 0; } function listCacheDelete(key) { var data2 = this.__data__, index2 = assocIndexOf(data2, key); if (index2 < 0) { return false; } var lastIndex = data2.length - 1; if (index2 == lastIndex) { data2.pop(); } else { splice.call(data2, index2, 1); } --this.size; return true; } function listCacheGet(key) { var data2 = this.__data__, index2 = assocIndexOf(data2, key); return index2 < 0 ? void 0 : data2[index2][1]; } function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } function listCacheSet(key, value) { var data2 = this.__data__, index2 = assocIndexOf(data2, key); if (index2 < 0) { ++this.size; data2.push([key, value]); } else { data2[index2][1] = value; } return this; } ListCache.prototype.clear = listCacheClear; ListCache.prototype["delete"] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; function MapCache(entries2) { var index2 = -1, length = entries2 == null ? 0 : entries2.length; this.clear(); while (++index2 < length) { var entry = entries2[index2]; this.set(entry[0], entry[1]); } } function mapCacheClear() { this.size = 0; this.__data__ = { "hash": new Hash2(), "map": new (Map2 || ListCache)(), "string": new Hash2() }; } function mapCacheDelete(key) { var result = getMapData(this, key)["delete"](key); this.size -= result ? 1 : 0; return result; } function mapCacheGet(key) { return getMapData(this, key).get(key); } function mapCacheHas(key) { return getMapData(this, key).has(key); } function mapCacheSet(key, value) { var data2 = getMapData(this, key), size2 = data2.size; data2.set(key, value); this.size += data2.size == size2 ? 0 : 1; return this; } MapCache.prototype.clear = mapCacheClear; MapCache.prototype["delete"] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; function SetCache(values) { var index2 = -1, length = values == null ? 0 : values.length; this.__data__ = new MapCache(); while (++index2 < length) { this.add(values[index2]); } } function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } function setCacheHas(value) { return this.__data__.has(value); } SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; function Stack(entries2) { var data2 = this.__data__ = new ListCache(entries2); this.size = data2.size; } function stackClear() { this.__data__ = new ListCache(); this.size = 0; } function stackDelete(key) { var data2 = this.__data__, result = data2["delete"](key); this.size = data2.size; return result; } function stackGet(key) { return this.__data__.get(key); } function stackHas(key) { return this.__data__.has(key); } function stackSet(key, value) { var data2 = this.__data__; if (data2 instanceof ListCache) { var pairs = data2.__data__; if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) { pairs.push([key, value]); this.size = ++data2.size; return this; } data2 = this.__data__ = new MapCache(pairs); } data2.set(key, value); this.size = data2.size; return this; } Stack.prototype.clear = stackClear; Stack.prototype["delete"] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; function arrayLikeKeys(value, inherited) { var isArr = isArray2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty2.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. isIndex(key, length)))) { result.push(key); } } return result; } function assocIndexOf(array2, key) { var length = array2.length; while (length--) { if (eq2(array2[length][0], key)) { return length; } } return -1; } function baseGetAllKeys(object2, keysFunc, symbolsFunc) { var result = keysFunc(object2); return isArray2(object2) ? result : arrayPush(result, symbolsFunc(object2)); } function baseGetTag(value) { if (value == null) { return value === void 0 ? undefinedTag : nullTag; } return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); } function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray2(object2), othIsArr = isArray2(other), objTag = objIsArr ? arrayTag : getTag(object2), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object2)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack()); return objIsArr || isTypedArray(object2) ? equalArrays(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag(object2, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty2.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty2.call(other, "__wrapped__"); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack()); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack()); return equalObjects(object2, other, bitmask, customizer, equalFunc, stack); } function baseIsNative(value) { if (!isObject2(value) || isMasked(value)) { return false; } var pattern2 = isFunction2(value) ? reIsNative : reIsHostCtor; return pattern2.test(toSource(value)); } function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } function baseKeys(object2) { if (!isPrototype(object2)) { return nativeKeys(object2); } var result = []; for (var key in Object(object2)) { if (hasOwnProperty2.call(object2, key) && key != "constructor") { result.push(key); } } return result; } function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array2.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } var stacked = stack.get(array2); if (stacked && stack.get(other)) { return stacked == other; } var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0; stack.set(array2, other); stack.set(other, array2); while (++index2 < arrLength) { var arrValue = array2[index2], othValue = other[index2]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index2, other, array2, stack) : customizer(arrValue, othValue, index2, array2, other, stack); } if (compared !== void 0) { if (compared) { continue; } result = false; break; } if (seen) { if (!arraySome(other, function(othValue2, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { result = false; break; } } stack["delete"](array2); stack["delete"](other); return result; } function equalByTag(object2, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if (object2.byteLength != other.byteLength || object2.byteOffset != other.byteOffset) { return false; } object2 = object2.buffer; other = other.buffer; case arrayBufferTag: if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object2), new Uint8Array2(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: return eq2(+object2, +other); case errorTag: return object2.name == other.name && object2.message == other.message; case regexpTag: case stringTag: return object2 == other + ""; case mapTag: var convert2 = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert2 || (convert2 = setToArray); if (object2.size != other.size && !isPartial) { return false; } var stacked = stack.get(object2); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; stack.set(object2, other); var result = equalArrays(convert2(object2), convert2(other), bitmask, customizer, equalFunc, stack); stack["delete"](object2); return result; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object2) == symbolValueOf.call(other); } } return false; } function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object2), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index2 = objLength; while (index2--) { var key = objProps[index2]; if (!(isPartial ? key in other : hasOwnProperty2.call(other, key))) { return false; } } var stacked = stack.get(object2); if (stacked && stack.get(other)) { return stacked == other; } var result = true; stack.set(object2, other); stack.set(other, object2); var skipCtor = isPartial; while (++index2 < objLength) { key = objProps[index2]; var objValue = object2[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object2, stack) : customizer(objValue, othValue, key, object2, other, stack); } if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { result = false; break; } skipCtor || (skipCtor = key == "constructor"); } if (result && !skipCtor) { var objCtor = object2.constructor, othCtor = other.constructor; if (objCtor != othCtor && ("constructor" in object2 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { result = false; } } stack["delete"](object2); stack["delete"](other); return result; } function getAllKeys(object2) { return baseGetAllKeys(object2, keys2, getSymbols); } function getMapData(map2, key) { var data2 = map2.__data__; return isKeyable(key) ? data2[typeof key == "string" ? "string" : "hash"] : data2.map; } function getNative(object2, key) { var value = getValue(object2, key); return baseIsNative(value) ? value : void 0; } function getRawTag(value) { var isOwn = hasOwnProperty2.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = void 0; var unmasked = true; } catch (e2) { } var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } var getSymbols = !nativeGetSymbols ? stubArray : function(object2) { if (object2 == null) { return []; } object2 = Object(object2); return arrayFilter(nativeGetSymbols(object2), function(symbol) { return propertyIsEnumerable.call(object2, symbol); }); }; var getTag = baseGetTag; if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : ""; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result; }; } function isIndex(value, length) { length = length == null ? MAX_SAFE_INTEGER2 : length; return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); } function isKeyable(value) { var type2 = typeof value; return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null; } function isMasked(func2) { return !!maskSrcKey && maskSrcKey in func2; } function isPrototype(value) { var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; return value === proto; } function objectToString(value) { return nativeObjectToString.call(value); } function toSource(func2) { if (func2 != null) { try { return funcToString.call(func2); } catch (e2) { } try { return func2 + ""; } catch (e2) { } } return ""; } function eq2(value, other) { return value === other || value !== value && other !== other; } var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty2.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); }; var isArray2 = Array.isArray; function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction2(value); } var isBuffer = nativeIsBuffer || stubFalse; function isEqual(value, other) { return baseIsEqual(value, other); } function isFunction2(value) { if (!isObject2(value)) { return false; } var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } function isLength(value) { return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2; } function isObject2(value) { var type2 = typeof value; return value != null && (type2 == "object" || type2 == "function"); } function isObjectLike(value) { return value != null && typeof value == "object"; } var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; function keys2(object2) { return isArrayLike(object2) ? arrayLikeKeys(object2) : baseKeys(object2); } function stubArray() { return []; } function stubFalse() { return false; } module2.exports = isEqual; })(lodash_isequal, lodash_isequal.exports); var lodash_isequalExports = lodash_isequal.exports; const Gi = /* @__PURE__ */ getDefaultExportFromCjs(lodash_isequalExports); function unfetch_module(e2, n2) { return n2 = n2 || {}, new Promise(function(t2, r2) { var s2 = new XMLHttpRequest(), o2 = [], u2 = [], i2 = {}, a2 = function() { return { ok: 2 == (s2.status / 100 | 0), statusText: s2.statusText, status: s2.status, url: s2.responseURL, text: function() { return Promise.resolve(s2.responseText); }, json: function() { return Promise.resolve(s2.responseText).then(JSON.parse); }, blob: function() { return Promise.resolve(new Blob([s2.response])); }, clone: a2, headers: { keys: function() { return o2; }, entries: function() { return u2; }, get: function(e3) { return i2[e3.toLowerCase()]; }, has: function(e3) { return e3.toLowerCase() in i2; } } }; }; for (var l2 in s2.open(n2.method || "get", e2, true), s2.onload = function() { s2.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(e3, n3, t3) { o2.push(n3 = n3.toLowerCase()), u2.push([n3, t3]), i2[n3] = i2[n3] ? i2[n3] + "," + t3 : t3; }), t2(a2()); }, s2.onerror = r2, s2.withCredentials = "include" == n2.credentials, n2.headers) s2.setRequestHeader(l2, n2.headers[l2]); s2.send(n2.body || null); }); } const unfetch_module$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: unfetch_module }, Symbol.toStringTag, { value: "Module" })); const require$$0 = /* @__PURE__ */ getAugmentedNamespace(unfetch_module$1); var browser = self.fetch || (self.fetch = require$$0.default || require$$0); const Yi = /* @__PURE__ */ getDefaultExportFromCjs(browser); function Hi(r2, e2) { if (r2.length >= 255) throw new TypeError("Alphabet too long"); for (var t2 = new Uint8Array(256), i2 = 0; i2 < t2.length; i2++) t2[i2] = 255; for (var s2 = 0; s2 < r2.length; s2++) { var n2 = r2.charAt(s2), o2 = n2.charCodeAt(0); if (t2[o2] !== 255) throw new TypeError(n2 + " is ambiguous"); t2[o2] = s2; } var a2 = r2.length, h2 = r2.charAt(0), l2 = Math.log(a2) / Math.log(256), d2 = Math.log(256) / Math.log(a2); function p2(u2) { if (u2 instanceof Uint8Array || (ArrayBuffer.isView(u2) ? u2 = new Uint8Array(u2.buffer, u2.byteOffset, u2.byteLength) : Array.isArray(u2) && (u2 = Uint8Array.from(u2))), !(u2 instanceof Uint8Array)) throw new TypeError("Expected Uint8Array"); if (u2.length === 0) return ""; for (var m2 = 0, z2 = 0, I2 = 0, _2 = u2.length; I2 !== _2 && u2[I2] === 0; ) I2++, m2++; for (var S2 = (_2 - I2) * d2 + 1 >>> 0, f2 = new Uint8Array(S2); I2 !== _2; ) { for (var T2 = u2[I2], A2 = 0, C2 = S2 - 1; (T2 !== 0 || A2 < z2) && C2 !== -1; C2--, A2++) T2 += 256 * f2[C2] >>> 0, f2[C2] = T2 % a2 >>> 0, T2 = T2 / a2 >>> 0; if (T2 !== 0) throw new Error("Non-zero carry"); z2 = A2, I2++; } for (var x2 = S2 - z2; x2 !== S2 && f2[x2] === 0; ) x2++; for (var q2 = h2.repeat(m2); x2 < S2; ++x2) q2 += r2.charAt(f2[x2]); return q2; } function y2(u2) { if (typeof u2 != "string") throw new TypeError("Expected String"); if (u2.length === 0) return new Uint8Array(); var m2 = 0; if (u2[m2] !== " ") { for (var z2 = 0, I2 = 0; u2[m2] === h2; ) z2++, m2++; for (var _2 = (u2.length - m2) * l2 + 1 >>> 0, S2 = new Uint8Array(_2); u2[m2]; ) { var f2 = t2[u2.charCodeAt(m2)]; if (f2 === 255) return; for (var T2 = 0, A2 = _2 - 1; (f2 !== 0 || T2 < I2) && A2 !== -1; A2--, T2++) f2 += a2 * S2[A2] >>> 0, S2[A2] = f2 % 256 >>> 0, f2 = f2 / 256 >>> 0; if (f2 !== 0) throw new Error("Non-zero carry"); I2 = T2, m2++; } if (u2[m2] !== " ") { for (var C2 = _2 - I2; C2 !== _2 && S2[C2] === 0; ) C2++; for (var x2 = new Uint8Array(z2 + (_2 - C2)), q2 = z2; C2 !== _2; ) x2[q2++] = S2[C2++]; return x2; } } } function M2(u2) { var m2 = y2(u2); if (m2) return m2; throw new Error(`Non-${e2} character`); } return { encode: p2, decodeUnsafe: y2, decode: M2 }; } var Ji = Hi, Xi = Ji; const Ne = (r2) => { if (r2 instanceof Uint8Array && r2.constructor.name === "Uint8Array") return r2; if (r2 instanceof ArrayBuffer) return new Uint8Array(r2); if (ArrayBuffer.isView(r2)) return new Uint8Array(r2.buffer, r2.byteOffset, r2.byteLength); throw new Error("Unknown type, must be binary type"); }, Wi$1 = (r2) => new TextEncoder().encode(r2), Qi = (r2) => new TextDecoder().decode(r2); class Zi { constructor(e2, t2, i2) { this.name = e2, this.prefix = t2, this.baseEncode = i2; } encode(e2) { if (e2 instanceof Uint8Array) return `${this.prefix}${this.baseEncode(e2)}`; throw Error("Unknown type, must be binary type"); } } class es { constructor(e2, t2, i2) { if (this.name = e2, this.prefix = t2, t2.codePointAt(0) === void 0) throw new Error("Invalid prefix character"); this.prefixCodePoint = t2.codePointAt(0), this.baseDecode = i2; } decode(e2) { if (typeof e2 == "string") { if (e2.codePointAt(0) !== this.prefixCodePoint) throw Error(`Unable to decode multibase string ${JSON.stringify(e2)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); return this.baseDecode(e2.slice(this.prefix.length)); } else throw Error("Can only multibase decode strings"); } or(e2) { return Ue$1(this, e2); } } class ts { constructor(e2) { this.decoders = e2; } or(e2) { return Ue$1(this, e2); } decode(e2) { const t2 = e2[0], i2 = this.decoders[t2]; if (i2) return i2.decode(e2); throw RangeError(`Unable to decode multibase string ${JSON.stringify(e2)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); } } const Ue$1 = (r2, e2) => new ts({ ...r2.decoders || { [r2.prefix]: r2 }, ...e2.decoders || { [e2.prefix]: e2 } }); class is { constructor(e2, t2, i2, s2) { this.name = e2, this.prefix = t2, this.baseEncode = i2, this.baseDecode = s2, this.encoder = new Zi(e2, t2, i2), this.decoder = new es(e2, t2, s2); } encode(e2) { return this.encoder.encode(e2); } decode(e2) { return this.decoder.decode(e2); } } const W$2 = ({ name: r2, prefix: e2, encode: t2, decode: i2 }) => new is(r2, e2, t2, i2), B$3 = ({ prefix: r2, name: e2, alphabet: t2 }) => { const { encode: i2, decode: s2 } = Xi(t2, e2); return W$2({ prefix: r2, name: e2, encode: i2, decode: (n2) => Ne(s2(n2)) }); }, ss = (r2, e2, t2, i2) => { const s2 = {}; for (let d2 = 0; d2 < e2.length; ++d2) s2[e2[d2]] = d2; let n2 = r2.length; for (; r2[n2 - 1] === "="; ) --n2; const o2 = new Uint8Array(n2 * t2 / 8 | 0); let a2 = 0, h2 = 0, l2 = 0; for (let d2 = 0; d2 < n2; ++d2) { const p2 = s2[r2[d2]]; if (p2 === void 0) throw new SyntaxError(`Non-${i2} character`); h2 = h2 << t2 | p2, a2 += t2, a2 >= 8 && (a2 -= 8, o2[l2++] = 255 & h2 >> a2); } if (a2 >= t2 || 255 & h2 << 8 - a2) throw new SyntaxError("Unexpected end of data"); return o2; }, rs = (r2, e2, t2) => { const i2 = e2[e2.length - 1] === "=", s2 = (1 << t2) - 1; let n2 = "", o2 = 0, a2 = 0; for (let h2 = 0; h2 < r2.length; ++h2) for (a2 = a2 << 8 | r2[h2], o2 += 8; o2 > t2; ) o2 -= t2, n2 += e2[s2 & a2 >> o2]; if (o2 && (n2 += e2[s2 & a2 << t2 - o2]), i2) for (; n2.length * t2 & 7; ) n2 += "="; return n2; }, g$5 = ({ name: r2, prefix: e2, bitsPerChar: t2, alphabet: i2 }) => W$2({ prefix: e2, name: r2, encode(s2) { return rs(s2, i2, t2); }, decode(s2) { return ss(s2, i2, t2, r2); } }), ns = W$2({ prefix: "\0", name: "identity", encode: (r2) => Qi(r2), decode: (r2) => Wi$1(r2) }); var os = Object.freeze({ __proto__: null, identity: ns }); const as$1 = g$5({ prefix: "0", name: "base2", alphabet: "01", bitsPerChar: 1 }); var hs$1 = Object.freeze({ __proto__: null, base2: as$1 }); const cs$1 = g$5({ prefix: "7", name: "base8", alphabet: "01234567", bitsPerChar: 3 }); var us$1 = Object.freeze({ __proto__: null, base8: cs$1 }); const ls$1 = B$3({ prefix: "9", name: "base10", alphabet: "0123456789" }); var ds$1 = Object.freeze({ __proto__: null, base10: ls$1 }); const gs$1 = g$5({ prefix: "f", name: "base16", alphabet: "0123456789abcdef", bitsPerChar: 4 }), ps$1 = g$5({ prefix: "F", name: "base16upper", alphabet: "0123456789ABCDEF", bitsPerChar: 4 }); var Ds = Object.freeze({ __proto__: null, base16: gs$1, base16upper: ps$1 }); const ys = g$5({ prefix: "b", name: "base32", alphabet: "abcdefghijklmnopqrstuvwxyz234567", bitsPerChar: 5 }), ms = g$5({ prefix: "B", name: "base32upper", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", bitsPerChar: 5 }), bs = g$5({ prefix: "c", name: "base32pad", alphabet: "abcdefghijklmnopqrstuvwxyz234567=", bitsPerChar: 5 }), fs = g$5({ prefix: "C", name: "base32padupper", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=", bitsPerChar: 5 }), Es = g$5({ prefix: "v", name: "base32hex", alphabet: "0123456789abcdefghijklmnopqrstuv", bitsPerChar: 5 }), ws = g$5({ prefix: "V", name: "base32hexupper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV", bitsPerChar: 5 }), vs = g$5({ prefix: "t", name: "base32hexpad", alphabet: "0123456789abcdefghijklmnopqrstuv=", bitsPerChar: 5 }), Is = g$5({ prefix: "T", name: "base32hexpadupper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=", bitsPerChar: 5 }), Cs = g$5({ prefix: "h", name: "base32z", alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769", bitsPerChar: 5 }); var Rs = Object.freeze({ __proto__: null, base32: ys, base32upper: ms, base32pad: bs, base32padupper: fs, base32hex: Es, base32hexupper: ws, base32hexpad: vs, base32hexpadupper: Is, base32z: Cs }); const _s = B$3({ prefix: "k", name: "base36", alphabet: "0123456789abcdefghijklmnopqrstuvwxyz" }), Ss = B$3({ prefix: "K", name: "base36upper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" }); var Ts = Object.freeze({ __proto__: null, base36: _s, base36upper: Ss }); const Ps = B$3({ name: "base58btc", prefix: "z", alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" }), xs = B$3({ name: "base58flickr", prefix: "Z", alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" }); var Os = Object.freeze({ __proto__: null, base58btc: Ps, base58flickr: xs }); const As = g$5({ prefix: "m", name: "base64", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", bitsPerChar: 6 }), zs = g$5({ prefix: "M", name: "base64pad", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", bitsPerChar: 6 }), Ns = g$5({ prefix: "u", name: "base64url", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", bitsPerChar: 6 }), Us = g$5({ prefix: "U", name: "base64urlpad", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=", bitsPerChar: 6 }); var Ls = Object.freeze({ __proto__: null, base64: As, base64pad: zs, base64url: Ns, base64urlpad: Us }); const Le$1 = Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"), Fs = Le$1.reduce((r2, e2, t2) => (r2[t2] = e2, r2), []), $s = Le$1.reduce((r2, e2, t2) => (r2[e2.codePointAt(0)] = t2, r2), []); function Ms(r2) { return r2.reduce((e2, t2) => (e2 += Fs[t2], e2), ""); } function ks(r2) { const e2 = []; for (const t2 of r2) { const i2 = $s[t2.codePointAt(0)]; if (i2 === void 0) throw new Error(`Non-base256emoji character: ${t2}`); e2.push(i2); } return new Uint8Array(e2); } const Ks = W$2({ prefix: "🚀", name: "base256emoji", encode: Ms, decode: ks }); var Bs = Object.freeze({ __proto__: null, base256emoji: Ks }), Vs = $e$1, Fe$1 = 128, js = 127, qs = ~js, Gs = Math.pow(2, 31); function $e$1(r2, e2, t2) { e2 = e2 || [], t2 = t2 || 0; for (var i2 = t2; r2 >= Gs; ) e2[t2++] = r2 & 255 | Fe$1, r2 /= 128; for (; r2 & qs; ) e2[t2++] = r2 & 255 | Fe$1, r2 >>>= 7; return e2[t2] = r2 | 0, $e$1.bytes = t2 - i2 + 1, e2; } var Ys = he$2, Hs = 128, Me$1 = 127; function he$2(r2, i2) { var t2 = 0, i2 = i2 || 0, s2 = 0, n2 = i2, o2, a2 = r2.length; do { if (n2 >= a2) throw he$2.bytes = 0, new RangeError("Could not decode varint"); o2 = r2[n2++], t2 += s2 < 28 ? (o2 & Me$1) << s2 : (o2 & Me$1) * Math.pow(2, s2), s2 += 7; } while (o2 >= Hs); return he$2.bytes = n2 - i2, t2; } var Js = Math.pow(2, 7), Xs = Math.pow(2, 14), Ws = Math.pow(2, 21), Qs = Math.pow(2, 28), Zs = Math.pow(2, 35), er$1 = Math.pow(2, 42), tr$1 = Math.pow(2, 49), ir$1 = Math.pow(2, 56), sr$1 = Math.pow(2, 63), rr$1 = function(r2) { return r2 < Js ? 1 : r2 < Xs ? 2 : r2 < Ws ? 3 : r2 < Qs ? 4 : r2 < Zs ? 5 : r2 < er$1 ? 6 : r2 < tr$1 ? 7 : r2 < ir$1 ? 8 : r2 < sr$1 ? 9 : 10; }, nr$1 = { encode: Vs, decode: Ys, encodingLength: rr$1 }, ke$1 = nr$1; const Ke$1 = (r2, e2, t2 = 0) => (ke$1.encode(r2, e2, t2), e2), Be$1 = (r2) => ke$1.encodingLength(r2), ce$2 = (r2, e2) => { const t2 = e2.byteLength, i2 = Be$1(r2), s2 = i2 + Be$1(t2), n2 = new Uint8Array(s2 + t2); return Ke$1(r2, n2, 0), Ke$1(t2, n2, i2), n2.set(e2, s2), new or$1(r2, t2, e2, n2); }; let or$1 = class or { constructor(e2, t2, i2, s2) { this.code = e2, this.size = t2, this.digest = i2, this.bytes = s2; } }; const Ve$1 = ({ name: r2, code: e2, encode: t2 }) => new ar$1(r2, e2, t2); let ar$1 = class ar { constructor(e2, t2, i2) { this.name = e2, this.code = t2, this.encode = i2; } digest(e2) { if (e2 instanceof Uint8Array) { const t2 = this.encode(e2); return t2 instanceof Uint8Array ? ce$2(this.code, t2) : t2.then((i2) => ce$2(this.code, i2)); } else throw Error("Unknown type, must be binary type"); } }; const je$1 = (r2) => async (e2) => new Uint8Array(await crypto.subtle.digest(r2, e2)), hr$2 = Ve$1({ name: "sha2-256", code: 18, encode: je$1("SHA-256") }), cr$2 = Ve$1({ name: "sha2-512", code: 19, encode: je$1("SHA-512") }); var ur = Object.freeze({ __proto__: null, sha256: hr$2, sha512: cr$2 }); const qe$1 = 0, lr$2 = "identity", Ge$1 = Ne, dr$1 = (r2) => ce$2(qe$1, Ge$1(r2)), gr = { code: qe$1, name: lr$2, encode: Ge$1, digest: dr$1 }; var pr = Object.freeze({ __proto__: null, identity: gr }); new TextEncoder(), new TextDecoder(); const Ye$1 = { ...os, ...hs$1, ...us$1, ...ds$1, ...Ds, ...Rs, ...Ts, ...Os, ...Ls, ...Bs }; ({ ...ur, ...pr }); function He$1(r2) { return globalThis.Buffer != null ? new Uint8Array(r2.buffer, r2.byteOffset, r2.byteLength) : r2; } function Dr(r2 = 0) { return globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null ? He$1(globalThis.Buffer.allocUnsafe(r2)) : new Uint8Array(r2); } function Je(r2, e2, t2, i2) { return { name: r2, prefix: e2, encoder: { name: r2, prefix: e2, encode: t2 }, decoder: { decode: i2 } }; } const Xe = Je("utf8", "u", (r2) => "u" + new TextDecoder("utf8").decode(r2), (r2) => new TextEncoder().encode(r2.substring(1))), ue$2 = Je("ascii", "a", (r2) => { let e2 = "a"; for (let t2 = 0; t2 < r2.length; t2++) e2 += String.fromCharCode(r2[t2]); return e2; }, (r2) => { r2 = r2.substring(1); const e2 = Dr(r2.length); for (let t2 = 0; t2 < r2.length; t2++) e2[t2] = r2.charCodeAt(t2); return e2; }), yr = { utf8: Xe, "utf-8": Xe, hex: Ye$1.base16, latin1: ue$2, ascii: ue$2, binary: ue$2, ...Ye$1 }; function mr$1(r2, e2 = "utf8") { const t2 = yr[e2]; if (!t2) throw new Error(`Unsupported encoding "${e2}"`); return (e2 === "utf8" || e2 === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null ? He$1(globalThis.Buffer.from(r2, "utf-8")) : t2.decoder.decode(`${t2.prefix}${r2}`); } const le$2 = "wc", We$1 = 2, Q$4 = "core", O$3 = `${le$2}@2:${Q$4}:`, Qe$1 = { name: Q$4, logger: "error" }, Ze = { database: ":memory:" }, et$1 = "crypto", de$2 = "client_ed25519_seed", tt$1 = cjs$5.ONE_DAY, it$1 = "keychain", st$1 = "0.3", rt$1 = "messages", nt$1 = "0.3", ot$1 = cjs$5.SIX_HOURS, at$1 = "publisher", ht$1 = "irn", ct$1 = "error", ge$1 = "wss://relay.walletconnect.com", pe$1 = "wss://relay.walletconnect.org", ut$1 = "relayer", D$4 = { 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" }, lt$1 = "_subscription", P$3 = { payload: "payload", connect: "connect", disconnect: "disconnect", error: "error" }, dt$1 = cjs$5.ONE_SECOND, gt$1 = "2.11.0", pt$1 = 1e4, Dt$1 = "0.3", yt$1 = "WALLETCONNECT_CLIENT_ID", w$3 = { created: "subscription_created", deleted: "subscription_deleted", expired: "subscription_expired", disabled: "subscription_disabled", sync: "subscription_sync", resubscribed: "subscription_resubscribed" }, mt$1 = "subscription", bt$1 = "0.3", ft$2 = cjs$5.FIVE_SECONDS * 1e3, Et$1 = "pairing", wt$1 = "0.3", F$3 = { wc_pairingDelete: { req: { ttl: cjs$5.ONE_DAY, prompt: false, tag: 1e3 }, res: { ttl: cjs$5.ONE_DAY, prompt: false, tag: 1001 } }, wc_pairingPing: { req: { ttl: cjs$5.THIRTY_SECONDS, prompt: false, tag: 1002 }, res: { ttl: cjs$5.THIRTY_SECONDS, prompt: false, tag: 1003 } }, unregistered_method: { req: { ttl: cjs$5.ONE_DAY, prompt: false, tag: 0 }, res: { ttl: cjs$5.ONE_DAY, prompt: false, tag: 0 } } }, V$3 = { create: "pairing_create", expire: "pairing_expire", delete: "pairing_delete", ping: "pairing_ping" }, R$2 = { created: "history_created", updated: "history_updated", deleted: "history_deleted", sync: "history_sync" }, vt$1 = "history", It$1 = "0.3", Ct$2 = "expirer", v$4 = { created: "expirer_created", deleted: "expirer_deleted", expired: "expirer_expired", sync: "expirer_sync" }, Rt$1 = "0.3", Z$3 = "verify-api", $$3 = "https://verify.walletconnect.com", ee$1 = "https://verify.walletconnect.org", _t$1 = [$$3, ee$1], St$1 = "echo", Tt$1 = "https://echo.walletconnect.com"; let Pt$1 = class Pt { constructor(e2, t2) { this.core = e2, this.logger = t2, this.keychain = /* @__PURE__ */ new Map(), this.name = it$1, this.version = st$1, this.initialized = false, this.storagePrefix = O$3, this.init = async () => { if (!this.initialized) { const i2 = await this.getKeyChain(); typeof i2 < "u" && (this.keychain = i2), this.initialized = true; } }, this.has = (i2) => (this.isInitialized(), this.keychain.has(i2)), this.set = async (i2, s2) => { this.isInitialized(), this.keychain.set(i2, s2), await this.persist(); }, this.get = (i2) => { this.isInitialized(); const s2 = this.keychain.get(i2); if (typeof s2 > "u") { const { message: n2 } = N$5("NO_MATCHING_KEY", `${this.name}: ${i2}`); throw new Error(n2); } return s2; }, this.del = async (i2) => { this.isInitialized(), this.keychain.delete(i2), await this.persist(); }, this.core = e2, this.logger = E$5(t2, this.name); } get context() { return y$4(this.logger); } get storageKey() { return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name; } async setKeyChain(e2) { await this.core.storage.setItem(this.storageKey, rt$2(e2)); } async getKeyChain() { const e2 = await this.core.storage.getItem(this.storageKey); return typeof e2 < "u" ? ot$2(e2) : void 0; } async persist() { await this.setKeyChain(this.keychain); } isInitialized() { if (!this.initialized) { const { message: e2 } = N$5("NOT_INITIALIZED", this.name); throw new Error(e2); } } }; let xt$1 = class xt { constructor(e2, t2, i2) { this.core = e2, this.logger = t2, this.name = et$1, this.initialized = false, this.init = async () => { this.initialized || (await this.keychain.init(), this.initialized = true); }, this.hasKeys = (s2) => (this.isInitialized(), this.keychain.has(s2)), this.getClientId = async () => { this.isInitialized(); const s2 = await this.getClientSeed(), n2 = generateKeyPair(s2); return encodeIss(n2.publicKey); }, this.generateKeyPair = () => { this.isInitialized(); const s2 = kn(); return this.setPrivateKey(s2.publicKey, s2.privateKey); }, this.signJWT = async (s2) => { this.isInitialized(); const n2 = await this.getClientSeed(), o2 = generateKeyPair(n2), a2 = Vn$1(), h2 = tt$1; return await signJWT(a2, s2, h2, o2); }, this.generateSharedKey = (s2, n2, o2) => { this.isInitialized(); const a2 = this.getPrivateKey(s2), h2 = Mn(a2, n2); return this.setSymKey(h2, o2); }, this.setSymKey = async (s2, n2) => { this.isInitialized(); const o2 = n2 || Kn(s2); return await this.keychain.set(o2, s2), o2; }, this.deleteKeyPair = async (s2) => { this.isInitialized(), await this.keychain.del(s2); }, this.deleteSymKey = async (s2) => { this.isInitialized(), await this.keychain.del(s2); }, this.encode = async (s2, n2, o2) => { this.isInitialized(); const a2 = Ae$1(o2), h2 = safeJsonStringify(n2); if (qn(a2)) { const y2 = a2.senderPublicKey, M2 = a2.receiverPublicKey; s2 = await this.generateSharedKey(y2, M2); } const l2 = this.getSymKey(s2), { type: d2, senderPublicKey: p2 } = a2; return xn({ type: d2, symKey: l2, message: h2, senderPublicKey: p2 }); }, this.decode = async (s2, n2, o2) => { this.isInitialized(); const a2 = Hn(n2, o2); if (qn(a2)) { const h2 = a2.receiverPublicKey, l2 = a2.senderPublicKey; s2 = await this.generateSharedKey(h2, l2); } try { const h2 = this.getSymKey(s2), l2 = Fn({ symKey: h2, encoded: n2 }); return safeJsonParse(l2); } catch (h2) { this.logger.error(`Failed to decode message from topic: '${s2}', clientId: '${await this.getClientId()}'`), this.logger.error(h2); } }, this.getPayloadType = (s2) => { const n2 = ee$2(s2); return $$5(n2.type); }, this.getPayloadSenderPublicKey = (s2) => { const n2 = ee$2(s2); return n2.senderPublicKey ? toString(n2.senderPublicKey, p$8) : void 0; }, this.core = e2, this.logger = E$5(t2, this.name), this.keychain = i2 || new Pt$1(this.core, this.logger); } get context() { return y$4(this.logger); } async setPrivateKey(e2, t2) { return await this.keychain.set(e2, t2), e2; } getPrivateKey(e2) { return this.keychain.get(e2); } async getClientSeed() { let e2 = ""; try { e2 = this.keychain.get(de$2); } catch { e2 = Vn$1(), await this.keychain.set(de$2, e2); } return mr$1(e2, "base16"); } getSymKey(e2) { return this.keychain.get(e2); } isInitialized() { if (!this.initialized) { const { message: e2 } = N$5("NOT_INITIALIZED", this.name); throw new Error(e2); } } }; let Ot$1 = class Ot extends a$4 { constructor(e2, t2) { super(e2, t2), this.logger = e2, this.core = t2, this.messages = /* @__PURE__ */ new Map(), this.name = rt$1, this.version = nt$1, this.initialized = false, this.storagePrefix = O$3, this.init = async () => { if (!this.initialized) { this.logger.trace("Initialized"); try { const i2 = await this.getRelayerMessages(); typeof i2 < "u" && (this.messages = i2), this.logger.debug(`Successfully Restored records for ${this.name}`), this.logger.trace({ type: "method", method: "restore", size: this.messages.size }); } catch (i2) { this.logger.debug(`Failed to Restore records for ${this.name}`), this.logger.error(i2); } finally { this.initialized = true; } } }, this.set = async (i2, s2) => { this.isInitialized(); const n2 = Ln(s2); let o2 = this.messages.get(i2); return typeof o2 > "u" && (o2 = {}), typeof o2[n2] < "u" || (o2[n2] = s2, this.messages.set(i2, o2), await this.persist()), n2; }, this.get = (i2) => { this.isInitialized(); let s2 = this.messages.get(i2); return typeof s2 > "u" && (s2 = {}), s2; }, this.has = (i2, s2) => { this.isInitialized(); const n2 = this.get(i2), o2 = Ln(s2); return typeof n2[o2] < "u"; }, this.del = async (i2) => { this.isInitialized(), this.messages.delete(i2), await this.persist(); }, this.logger = E$5(e2, this.name), this.core = t2; } get context() { return y$4(this.logger); } get storageKey() { return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name; } async setRelayerMessages(e2) { await this.core.storage.setItem(this.storageKey, rt$2(e2)); } async getRelayerMessages() { const e2 = await this.core.storage.getItem(this.storageKey); return typeof e2 < "u" ? ot$2(e2) : void 0; } async persist() { await this.setRelayerMessages(this.messages); } isInitialized() { if (!this.initialized) { const { message: e2 } = N$5("NOT_INITIALIZED", this.name); throw new Error(e2); } } }; class vr extends u$3 { constructor(e2, t2) { super(e2, t2), this.relayer = e2, this.logger = t2, this.events = new eventsExports.EventEmitter(), this.name = at$1, this.queue = /* @__PURE__ */ new Map(), this.publishTimeout = cjs$5.toMiliseconds(cjs$5.TEN_SECONDS), this.needsTransportRestart = false, this.publish = async (i2, s2, n2) => { var o2; this.logger.debug("Publishing Payload"), this.logger.trace({ type: "method", method: "publish", params: { topic: i2, message: s2, opts: n2 } }); try { const a2 = (n2 == null ? void 0 : n2.ttl) || ot$1, h2 = vt$2(n2), l2 = (n2 == null ? void 0 : n2.prompt) || false, d2 = (n2 == null ? void 0 : n2.tag) || 0, p2 = (n2 == null ? void 0 : n2.id) || getBigIntRpcId().toString(), y2 = { topic: i2, message: s2, opts: { ttl: a2, relay: h2, prompt: l2, tag: d2, id: p2 } }, M2 = setTimeout(() => this.queue.set(p2, y2), this.publishTimeout); try { await await ut$2(this.rpcPublish(i2, s2, a2, h2, l2, d2, p2), this.publishTimeout, "Failed to publish payload, please try again."), this.removeRequestFromQueue(p2), this.relayer.events.emit(D$4.publish, y2); } catch (u2) { if (this.logger.debug("Publishing Payload stalled"), this.needsTransportRestart = true, (o2 = n2 == null ? void 0 : n2.internal) != null && o2.throwOnFailedPublish) throw this.removeRequestFromQueue(p2), u2; return; } finally { clearTimeout(M2); } this.logger.debug("Successfully Published Payload"), this.logger.trace({ type: "method", method: "publish", params: { topic: i2, message: s2, opts: n2 } }); } catch (a2) { throw this.logger.debug("Failed to Publish Payload"), this.logger.error(a2), a2; } }, this.on = (i2, s2) => { this.events.on(i2, s2); }, this.once = (i2, s2) => { this.events.once(i2, s2); }, this.off = (i2, s2) => { this.events.off(i2, s2); }, this.removeListener = (i2, s2) => { this.events.removeListener(i2, s2); }, this.relayer = e2, this.logger = E$5(t2, this.name), this.registerEventListeners(); } get context() { return y$4(this.logger); } rpcPublish(e2, t2, i2, s2, n2, o2, a2) { var h2, l2, d2, p2; const y2 = { method: Et$2(s2.protocol).publish, params: { topic: e2, message: t2, ttl: i2, prompt: n2, tag: o2 }, id: a2 }; return w$9((h2 = y2.params) == null ? void 0 : h2.prompt) && ((l2 = y2.params) == null || delete l2.prompt), w$9((d2 = y2.params) == null ? void 0 : d2.tag) && ((p2 = y2.params) == null || delete p2.tag), this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "message", direction: "outgoing", request: y2 }), this.relayer.request(y2); } removeRequestFromQueue(e2) { this.queue.delete(e2); } checkQueue() { this.queue.forEach(async (e2) => { const { topic: t2, message: i2, opts: s2 } = e2; await this.publish(t2, i2, s2); }); } registerEventListeners() { this.relayer.core.heartbeat.on(cjs$1.HEARTBEAT_EVENTS.pulse, () => { if (this.needsTransportRestart) { this.needsTransportRestart = false, this.relayer.events.emit(D$4.connection_stalled); return; } this.checkQueue(); }), this.relayer.on(D$4.message_ack, (e2) => { this.removeRequestFromQueue(e2.id.toString()); }); } } class Ir { constructor() { this.map = /* @__PURE__ */ new Map(), this.set = (e2, t2) => { const i2 = this.get(e2); this.exists(e2, t2) || this.map.set(e2, [...i2, t2]); }, this.get = (e2) => this.map.get(e2) || [], this.exists = (e2, t2) => this.get(e2).includes(t2), this.delete = (e2, t2) => { if (typeof t2 > "u") { this.map.delete(e2); return; } if (!this.map.has(e2)) return; const i2 = this.get(e2); if (!this.exists(e2, t2)) return; const s2 = i2.filter((n2) => n2 !== t2); if (!s2.length) { this.map.delete(e2); return; } this.map.set(e2, s2); }, this.clear = () => { this.map.clear(); }; } get topics() { return Array.from(this.map.keys()); } } var Cr = Object.defineProperty, Rr = Object.defineProperties, _r = Object.getOwnPropertyDescriptors, At$1 = Object.getOwnPropertySymbols, Sr = Object.prototype.hasOwnProperty, Tr = Object.prototype.propertyIsEnumerable, zt$1 = (r2, e2, t2) => e2 in r2 ? Cr(r2, e2, { enumerable: true, configurable: true, writable: true, value: t2 }) : r2[e2] = t2, j$4 = (r2, e2) => { for (var t2 in e2 || (e2 = {})) Sr.call(e2, t2) && zt$1(r2, t2, e2[t2]); if (At$1) for (var t2 of At$1(e2)) Tr.call(e2, t2) && zt$1(r2, t2, e2[t2]); return r2; }, De$1 = (r2, e2) => Rr(r2, _r(e2)); let Nt$1 = class Nt extends d$5 { constructor(e2, t2) { super(e2, t2), this.relayer = e2, this.logger = t2, this.subscriptions = /* @__PURE__ */ new Map(), this.topicMap = new Ir(), this.events = new eventsExports.EventEmitter(), this.name = mt$1, this.version = bt$1, this.pending = /* @__PURE__ */ new Map(), this.cached = [], this.initialized = false, this.pendingSubscriptionWatchLabel = "pending_sub_watch_label", this.pollingInterval = 20, this.storagePrefix = O$3, this.subscribeTimeout = 1e4, this.restartInProgress = false, this.batchSubscribeTopicsLimit = 500, this.init = async () => { this.initialized || (this.logger.trace("Initialized"), this.registerEventListeners(), this.clientId = await this.relayer.core.crypto.getClientId()); }, this.subscribe = async (i2, s2) => { await this.restartToComplete(), this.isInitialized(), this.logger.debug("Subscribing Topic"), this.logger.trace({ type: "method", method: "subscribe", params: { topic: i2, opts: s2 } }); try { const n2 = vt$2(s2), o2 = { topic: i2, relay: n2 }; this.pending.set(i2, o2); const a2 = await this.rpcSubscribe(i2, n2); return this.onSubscribe(a2, o2), this.logger.debug("Successfully Subscribed Topic"), this.logger.trace({ type: "method", method: "subscribe", params: { topic: i2, opts: s2 } }), a2; } catch (n2) { throw this.logger.debug("Failed to Subscribe Topic"), this.logger.error(n2), n2; } }, this.unsubscribe = async (i2, s2) => { await this.restartToComplete(), this.isInitialized(), typeof (s2 == null ? void 0 : s2.id) < "u" ? await this.unsubscribeById(i2, s2.id, s2) : await this.unsubscribeByTopic(i2, s2); }, this.isSubscribed = async (i2) => this.topics.includes(i2) ? true : await new Promise((s2, n2) => { const o2 = new cjs$5.Watch(); o2.start(this.pendingSubscriptionWatchLabel); const a2 = setInterval(() => { !this.pending.has(i2) && this.topics.includes(i2) && (clearInterval(a2), o2.stop(this.pendingSubscriptionWatchLabel), s2(true)), o2.elapsed(this.pendingSubscriptionWatchLabel) >= ft$2 && (clearInterval(a2), o2.stop(this.pendingSubscriptionWatchLabel), n2(new Error("Subscription resolution timeout"))); }, this.pollingInterval); }).catch(() => false), this.on = (i2, s2) => { this.events.on(i2, s2); }, this.once = (i2, s2) => { this.events.once(i2, s2); }, this.off = (i2, s2) => { this.events.off(i2, s2); }, this.removeListener = (i2, s2) => { this.events.removeListener(i2, s2); }, this.restart = async () => { this.restartInProgress = true, await this.restore(), await this.reset(), this.restartInProgress = false; }, this.relayer = e2, this.logger = E$5(t2, this.name), this.clientId = ""; } get context() { return y$4(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(e2, t2) { let i2 = false; try { i2 = this.getSubscription(e2).topic === t2; } catch { } return i2; } onEnable() { this.cached = [], this.initialized = true; } onDisable() { this.cached = this.values, this.subscriptions.clear(), this.topicMap.clear(); } async unsubscribeByTopic(e2, t2) { const i2 = this.topicMap.get(e2); await Promise.all(i2.map(async (s2) => await this.unsubscribeById(e2, s2, t2))); } async unsubscribeById(e2, t2, i2) { this.logger.debug("Unsubscribing Topic"), this.logger.trace({ type: "method", method: "unsubscribe", params: { topic: e2, id: t2, opts: i2 } }); try { const s2 = vt$2(i2); await this.rpcUnsubscribe(e2, t2, s2); const n2 = U$3("USER_DISCONNECTED", `${this.name}, ${e2}`); await this.onUnsubscribe(e2, t2, n2), this.logger.debug("Successfully Unsubscribed Topic"), this.logger.trace({ type: "method", method: "unsubscribe", params: { topic: e2, id: t2, opts: i2 } }); } catch (s2) { throw this.logger.debug("Failed to Unsubscribe Topic"), this.logger.error(s2), s2; } } async rpcSubscribe(e2, t2) { const i2 = { method: Et$2(t2.protocol).subscribe, params: { topic: e2 } }; this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: i2 }); try { await await ut$2(this.relayer.request(i2), this.subscribeTimeout); } catch { this.logger.debug("Outgoing Relay Subscribe Payload stalled"), this.relayer.events.emit(D$4.connection_stalled); } return Ln(e2 + this.clientId); } async rpcBatchSubscribe(e2) { if (!e2.length) return; const t2 = e2[0].relay, i2 = { method: Et$2(t2.protocol).batchSubscribe, params: { topics: e2.map((s2) => s2.topic) } }; this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: i2 }); try { return await await ut$2(this.relayer.request(i2), this.subscribeTimeout); } catch { this.logger.debug("Outgoing Relay Payload stalled"), this.relayer.events.emit(D$4.connection_stalled); } } rpcUnsubscribe(e2, t2, i2) { const s2 = { method: Et$2(i2.protocol).unsubscribe, params: { topic: e2, id: t2 } }; return this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: s2 }), this.relayer.request(s2); } onSubscribe(e2, t2) { this.setSubscription(e2, De$1(j$4({}, t2), { id: e2 })), this.pending.delete(t2.topic); } onBatchSubscribe(e2) { e2.length && e2.forEach((t2) => { this.setSubscription(t2.id, j$4({}, t2)), this.pending.delete(t2.topic); }); } async onUnsubscribe(e2, t2, i2) { this.events.removeAllListeners(t2), this.hasSubscription(t2, e2) && this.deleteSubscription(t2, i2), await this.relayer.messages.del(e2); } async setRelayerSubscriptions(e2) { await this.relayer.core.storage.setItem(this.storageKey, e2); } async getRelayerSubscriptions() { return await this.relayer.core.storage.getItem(this.storageKey); } setSubscription(e2, t2) { this.subscriptions.has(e2) || (this.logger.debug("Setting subscription"), this.logger.trace({ type: "method", method: "setSubscription", id: e2, subscription: t2 }), this.addSubscription(e2, t2)); } addSubscription(e2, t2) { this.subscriptions.set(e2, j$4({}, t2)), this.topicMap.set(t2.topic, e2), this.events.emit(w$3.created, t2); } getSubscription(e2) { this.logger.debug("Getting subscription"), this.logger.trace({ type: "method", method: "getSubscription", id: e2 }); const t2 = this.subscriptions.get(e2); if (!t2) { const { message: i2 } = N$5("NO_MATCHING_KEY", `${this.name}: ${e2}`); throw new Error(i2); } return t2; } deleteSubscription(e2, t2) { this.logger.debug("Deleting subscription"), this.logger.trace({ type: "method", method: "deleteSubscription", id: e2, reason: t2 }); const i2 = this.getSubscription(e2); this.subscriptions.delete(e2), this.topicMap.delete(i2.topic, e2), this.events.emit(w$3.deleted, De$1(j$4({}, i2), { reason: t2 })); } async persist() { await this.setRelayerSubscriptions(this.values), this.events.emit(w$3.sync); } async reset() { if (this.cached.length) { const e2 = Math.ceil(this.cached.length / this.batchSubscribeTopicsLimit); for (let t2 = 0; t2 < e2; t2++) { const i2 = this.cached.splice(0, this.batchSubscribeTopicsLimit); await this.batchSubscribe(i2); } } this.events.emit(w$3.resubscribed); } async restore() { try { const e2 = await this.getRelayerSubscriptions(); if (typeof e2 > "u" || !e2.length) return; if (this.subscriptions.size) { const { message: t2 } = N$5("RESTORE_WILL_OVERRIDE", this.name); throw this.logger.error(t2), this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`), new Error(t2); } this.cached = e2, this.logger.debug(`Successfully Restored subscriptions for ${this.name}`), this.logger.trace({ type: "method", method: "restore", subscriptions: this.values }); } catch (e2) { this.logger.debug(`Failed to Restore subscriptions for ${this.name}`), this.logger.error(e2); } } async batchSubscribe(e2) { if (!e2.length) return; const t2 = await this.rpcBatchSubscribe(e2); k$6(t2) && this.onBatchSubscribe(t2.map((i2, s2) => De$1(j$4({}, e2[s2]), { id: i2 }))); } async onConnect() { this.restartInProgress || (await this.restart(), this.onEnable()); } onDisconnect() { this.onDisable(); } async checkPending() { if (!this.initialized || this.relayer.transportExplicitlyClosed) return; const e2 = []; this.pending.forEach((t2) => { e2.push(t2); }), await this.batchSubscribe(e2); } registerEventListeners() { this.relayer.core.heartbeat.on(cjs$1.HEARTBEAT_EVENTS.pulse, async () => { await this.checkPending(); }), this.relayer.on(D$4.connect, async () => { await this.onConnect(); }), this.relayer.on(D$4.disconnect, () => { this.onDisconnect(); }), this.events.on(w$3.created, async (e2) => { const t2 = w$3.created; this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, data: e2 }), await this.persist(); }), this.events.on(w$3.deleted, async (e2) => { const t2 = w$3.deleted; this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, data: e2 }), await this.persist(); }); } isInitialized() { if (!this.initialized) { const { message: e2 } = N$5("NOT_INITIALIZED", this.name); throw new Error(e2); } } async restartToComplete() { this.restartInProgress && await new Promise((e2) => { const t2 = setInterval(() => { this.restartInProgress || (clearInterval(t2), e2()); }, this.pollingInterval); }); } }; var Pr = Object.defineProperty, Ut$1 = Object.getOwnPropertySymbols, xr = Object.prototype.hasOwnProperty, Or = Object.prototype.propertyIsEnumerable, Lt$1 = (r2, e2, t2) => e2 in r2 ? Pr(r2, e2, { enumerable: true, configurable: true, writable: true, value: t2 }) : r2[e2] = t2, Ar = (r2, e2) => { for (var t2 in e2 || (e2 = {})) xr.call(e2, t2) && Lt$1(r2, t2, e2[t2]); if (Ut$1) for (var t2 of Ut$1(e2)) Or.call(e2, t2) && Lt$1(r2, t2, e2[t2]); return r2; }; let Ft$1 = class Ft extends g$6 { constructor(e2) { super(e2), this.protocol = "wc", this.version = 2, this.events = new eventsExports.EventEmitter(), this.name = ut$1, this.transportExplicitlyClosed = false, this.initialized = false, this.connectionAttemptInProgress = false, this.connectionStatusPollingInterval = 20, this.staleConnectionErrors = ["socket hang up", "socket stalled"], this.hasExperiencedNetworkDisruption = false, this.request = async (t2) => { this.logger.debug("Publishing Request Payload"); try { return await this.toEstablishConnection(), await this.provider.request(t2); } catch (i2) { throw this.logger.debug("Failed to Publish Request"), this.logger.error(i2), i2; } }, this.onPayloadHandler = (t2) => { this.onProviderPayload(t2); }, this.onConnectHandler = () => { this.events.emit(D$4.connect); }, this.onDisconnectHandler = () => { this.onProviderDisconnect(); }, this.onProviderErrorHandler = (t2) => { this.logger.error(t2), this.events.emit(D$4.error, t2), this.logger.info("Fatal socket error received, closing transport"), this.transportClose(); }, this.registerProviderListeners = () => { this.provider.on(P$3.payload, this.onPayloadHandler), this.provider.on(P$3.connect, this.onConnectHandler), this.provider.on(P$3.disconnect, this.onDisconnectHandler), this.provider.on(P$3.error, this.onProviderErrorHandler); }, this.core = e2.core, this.logger = typeof e2.logger < "u" && typeof e2.logger != "string" ? E$5(e2.logger, this.name) : Dg(k$2({ level: e2.logger || ct$1 })), this.messages = new Ot$1(this.logger, e2.core), this.subscriber = new Nt$1(this, this.logger), this.publisher = new vr(this, this.logger), this.relayUrl = (e2 == null ? void 0 : e2.relayUrl) || ge$1, this.projectId = e2.projectId, this.bundleId = Jn(), this.provider = {}; } async init() { this.logger.trace("Initialized"), this.registerEventListeners(), await this.createProvider(), await Promise.all([this.messages.init(), this.subscriber.init()]); try { await this.transportOpen(); } catch { this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${pe$1}...`), await this.restartTransport(pe$1); } this.initialized = true, setTimeout(async () => { this.subscriber.topics.length === 0 && (this.logger.info("No topics subscribed to after init, closing transport"), await this.transportClose(), this.transportExplicitlyClosed = false); }, pt$1); } get context() { return y$4(this.logger); } get connected() { return this.provider.connection.connected; } get connecting() { return this.provider.connection.connecting; } async publish(e2, t2, i2) { this.isInitialized(), await this.publisher.publish(e2, t2, i2), await this.recordMessageEvent({ topic: e2, message: t2, publishedAt: Date.now() }); } async subscribe(e2, t2) { var i2; this.isInitialized(); let s2 = ((i2 = this.subscriber.topicMap.get(e2)) == null ? void 0 : i2[0]) || ""; if (s2) return s2; let n2; const o2 = (a2) => { a2.topic === e2 && (this.subscriber.off(w$3.created, o2), n2()); }; return await Promise.all([new Promise((a2) => { n2 = a2, this.subscriber.on(w$3.created, o2); }), new Promise(async (a2) => { s2 = await this.subscriber.subscribe(e2, t2), a2(); })]), s2; } async unsubscribe(e2, t2) { this.isInitialized(), await this.subscriber.unsubscribe(e2, t2); } on(e2, t2) { this.events.on(e2, t2); } once(e2, t2) { this.events.once(e2, t2); } off(e2, t2) { this.events.off(e2, t2); } removeListener(e2, t2) { this.events.removeListener(e2, t2); } async transportClose() { this.transportExplicitlyClosed = true, this.hasExperiencedNetworkDisruption && this.connected ? await ut$2(this.provider.disconnect(), 1e3, "provider.disconnect()").catch(() => this.onProviderDisconnect()) : this.connected && await this.provider.disconnect(); } async transportOpen(e2) { if (this.transportExplicitlyClosed = false, await this.confirmOnlineStateOrThrow(), !this.connectionAttemptInProgress) { e2 && e2 !== this.relayUrl && (this.relayUrl = e2, await this.transportClose(), await this.createProvider()), this.connectionAttemptInProgress = true; try { await Promise.all([new Promise((t2) => { if (!this.initialized) return t2(); this.subscriber.once(w$3.resubscribed, () => { t2(); }); }), new Promise(async (t2, i2) => { try { await ut$2(this.provider.connect(), 1e4, `Socket stalled when trying to connect to ${this.relayUrl}`); } catch (s2) { i2(s2); return; } t2(); })]); } catch (t2) { this.logger.error(t2); const i2 = t2; if (!this.isConnectionStalled(i2.message)) throw t2; this.provider.events.emit(P$3.disconnect); } finally { this.connectionAttemptInProgress = false, this.hasExperiencedNetworkDisruption = false; } } } async restartTransport(e2) { await this.confirmOnlineStateOrThrow(), !this.connectionAttemptInProgress && (this.relayUrl = e2 || this.relayUrl, await this.transportClose(), await this.createProvider(), await this.transportOpen()); } async confirmOnlineStateOrThrow() { if (!await er$2()) throw new Error("No internet connection detected. Please restart your network and try again."); } isConnectionStalled(e2) { return this.staleConnectionErrors.some((t2) => e2.includes(t2)); } async createProvider() { this.provider.connection && this.unregisterProviderListeners(); const e2 = await this.core.crypto.signJWT(this.relayUrl); this.provider = new JsonRpcProvider(new f$3(Xn({ sdkVersion: gt$1, protocol: this.protocol, version: this.version, relayUrl: this.relayUrl, projectId: this.projectId, auth: e2, useOnCloseEvent: true, bundleId: this.bundleId }))), this.registerProviderListeners(); } async recordMessageEvent(e2) { const { topic: t2, message: i2 } = e2; await this.messages.set(t2, i2); } async shouldIgnoreMessageEvent(e2) { const { topic: t2, message: i2 } = e2; if (!i2 || i2.length === 0) return this.logger.debug(`Ignoring invalid/empty message: ${i2}`), true; if (!await this.subscriber.isSubscribed(t2)) return this.logger.debug(`Ignoring message for non-subscribed topic ${t2}`), true; const s2 = this.messages.has(t2, i2); return s2 && this.logger.debug(`Ignoring duplicate message: ${i2}`), s2; } async onProviderPayload(e2) { if (this.logger.debug("Incoming Relay Payload"), this.logger.trace({ type: "payload", direction: "incoming", payload: e2 }), isJsonRpcRequest(e2)) { if (!e2.method.endsWith(lt$1)) return; const t2 = e2.params, { topic: i2, message: s2, publishedAt: n2 } = t2.data, o2 = { topic: i2, message: s2, publishedAt: n2 }; this.logger.debug("Emitting Relayer Payload"), this.logger.trace(Ar({ type: "event", event: t2.id }, o2)), this.events.emit(t2.id, o2), await this.acknowledgePayload(e2), await this.onMessageEvent(o2); } else isJsonRpcResponse(e2) && this.events.emit(D$4.message_ack, e2); } async onMessageEvent(e2) { await this.shouldIgnoreMessageEvent(e2) || (this.events.emit(D$4.message, e2), await this.recordMessageEvent(e2)); } async acknowledgePayload(e2) { const t2 = formatJsonRpcResult(e2.id, true); await this.provider.connection.send(t2); } unregisterProviderListeners() { this.provider.off(P$3.payload, this.onPayloadHandler), this.provider.off(P$3.connect, this.onConnectHandler), this.provider.off(P$3.disconnect, this.onDisconnectHandler), this.provider.off(P$3.error, this.onProviderErrorHandler); } async registerEventListeners() { this.events.on(D$4.connection_stalled, () => { this.restartTransport().catch((t2) => this.logger.error(t2)); }); let e2 = await er$2(); nr$2(async (t2) => { this.initialized && e2 !== t2 && (e2 = t2, t2 ? await this.restartTransport().catch((i2) => this.logger.error(i2)) : (this.hasExperiencedNetworkDisruption = true, await this.transportClose().catch((i2) => this.logger.error(i2)))); }); } onProviderDisconnect() { this.events.emit(D$4.disconnect), this.attemptToReconnect(); } attemptToReconnect() { this.transportExplicitlyClosed || (this.logger.info("attemptToReconnect called. Connecting..."), setTimeout(async () => { await this.restartTransport().catch((e2) => this.logger.error(e2)); }, cjs$5.toMiliseconds(dt$1))); } isInitialized() { if (!this.initialized) { const { message: e2 } = N$5("NOT_INITIALIZED", this.name); throw new Error(e2); } } async toEstablishConnection() { if (await this.confirmOnlineStateOrThrow(), !this.connected) { if (this.connectionAttemptInProgress) return await new Promise((e2) => { const t2 = setInterval(() => { this.connected && (clearInterval(t2), e2()); }, this.connectionStatusPollingInterval); }); await this.restartTransport(); } } }; var zr = Object.defineProperty, $t$1 = Object.getOwnPropertySymbols, Nr = Object.prototype.hasOwnProperty, Ur = Object.prototype.propertyIsEnumerable, Mt$1 = (r2, e2, t2) => e2 in r2 ? zr(r2, e2, { enumerable: true, configurable: true, writable: true, value: t2 }) : r2[e2] = t2, kt$1 = (r2, e2) => { for (var t2 in e2 || (e2 = {})) Nr.call(e2, t2) && Mt$1(r2, t2, e2[t2]); if ($t$1) for (var t2 of $t$1(e2)) Ur.call(e2, t2) && Mt$1(r2, t2, e2[t2]); return r2; }; let Kt$1 = class Kt extends p$4 { constructor(e2, t2, i2, s2 = O$3, n2 = void 0) { super(e2, t2, i2, s2), this.core = e2, this.logger = t2, this.name = i2, this.map = /* @__PURE__ */ new Map(), this.version = Dt$1, this.cached = [], this.initialized = false, this.storagePrefix = O$3, this.init = async () => { this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((o2) => { this.getKey && o2 !== null && !w$9(o2) ? this.map.set(this.getKey(o2), o2) : Vt$2(o2) ? this.map.set(o2.id, o2) : Mt$2(o2) && this.map.set(o2.topic, o2); }), this.cached = [], this.initialized = true); }, this.set = async (o2, a2) => { this.isInitialized(), this.map.has(o2) ? await this.update(o2, a2) : (this.logger.debug("Setting value"), this.logger.trace({ type: "method", method: "set", key: o2, value: a2 }), this.map.set(o2, a2), await this.persist()); }, this.get = (o2) => (this.isInitialized(), this.logger.debug("Getting value"), this.logger.trace({ type: "method", method: "get", key: o2 }), this.getData(o2)), this.getAll = (o2) => (this.isInitialized(), o2 ? this.values.filter((a2) => Object.keys(o2).every((h2) => Gi(a2[h2], o2[h2]))) : this.values), this.update = async (o2, a2) => { this.isInitialized(), this.logger.debug("Updating value"), this.logger.trace({ type: "method", method: "update", key: o2, update: a2 }); const h2 = kt$1(kt$1({}, this.getData(o2)), a2); this.map.set(o2, h2), await this.persist(); }, this.delete = async (o2, a2) => { this.isInitialized(), this.map.has(o2) && (this.logger.debug("Deleting value"), this.logger.trace({ type: "method", method: "delete", key: o2, reason: a2 }), this.map.delete(o2), await this.persist()); }, this.logger = E$5(t2, this.name), this.storagePrefix = s2, this.getKey = n2; } get context() { return y$4(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()); } async setDataStore(e2) { await this.core.storage.setItem(this.storageKey, e2); } async getDataStore() { return await this.core.storage.getItem(this.storageKey); } getData(e2) { const t2 = this.map.get(e2); if (!t2) { const { message: i2 } = N$5("NO_MATCHING_KEY", `${this.name}: ${e2}`); throw this.logger.error(i2), new Error(i2); } return t2; } async persist() { await this.setDataStore(this.values); } async restore() { try { const e2 = await this.getDataStore(); if (typeof e2 > "u" || !e2.length) return; if (this.map.size) { const { message: t2 } = N$5("RESTORE_WILL_OVERRIDE", this.name); throw this.logger.error(t2), new Error(t2); } this.cached = e2, this.logger.debug(`Successfully Restored value for ${this.name}`), this.logger.trace({ type: "method", method: "restore", value: this.values }); } catch (e2) { this.logger.debug(`Failed to Restore value for ${this.name}`), this.logger.error(e2); } } isInitialized() { if (!this.initialized) { const { message: e2 } = N$5("NOT_INITIALIZED", this.name); throw new Error(e2); } } }; let Bt$1 = class Bt { constructor(e2, t2) { this.core = e2, this.logger = t2, this.name = Et$1, this.version = wt$1, this.events = new $g(), this.initialized = false, this.storagePrefix = O$3, this.ignoredPayloadTypes = [_$8], this.registeredMethods = [], this.init = async () => { this.initialized || (await this.pairings.init(), await this.cleanup(), this.registerRelayerEvents(), this.registerExpirerEvents(), this.initialized = true, this.logger.trace("Initialized")); }, this.register = ({ methods: i2 }) => { this.isInitialized(), this.registeredMethods = [.../* @__PURE__ */ new Set([...this.registeredMethods, ...i2])]; }, this.create = async () => { this.isInitialized(); const i2 = Vn$1(), s2 = await this.core.crypto.setSymKey(i2), n2 = pt$2(cjs$5.FIVE_MINUTES), o2 = { protocol: ht$1 }, a2 = { topic: s2, expiry: n2, relay: o2, active: false }, h2 = It$2({ protocol: this.core.protocol, version: this.core.version, topic: s2, symKey: i2, relay: o2 }); return await this.pairings.set(s2, a2), await this.core.relayer.subscribe(s2), this.core.expirer.set(s2, n2), { topic: s2, uri: h2 }; }, this.pair = async (i2) => { this.isInitialized(), this.isValidPair(i2); const { topic: s2, symKey: n2, relay: o2 } = wt$2(i2.uri); let a2; if (this.pairings.keys.includes(s2) && (a2 = this.pairings.get(s2), a2.active)) throw new Error(`Pairing already exists: ${s2}. Please try again with a new connection URI.`); const h2 = pt$2(cjs$5.FIVE_MINUTES), l2 = { topic: s2, relay: o2, expiry: h2, active: false }; return await this.pairings.set(s2, l2), this.core.expirer.set(s2, h2), i2.activatePairing && await this.activate({ topic: s2 }), this.events.emit(V$3.create, l2), this.core.crypto.keychain.has(s2) || (await this.core.crypto.setSymKey(n2, s2), await this.core.relayer.subscribe(s2, { relay: o2 })), l2; }, this.activate = async ({ topic: i2 }) => { this.isInitialized(); const s2 = pt$2(cjs$5.THIRTY_DAYS); await this.pairings.update(i2, { active: true, expiry: s2 }), this.core.expirer.set(i2, s2); }, this.ping = async (i2) => { this.isInitialized(), await this.isValidPing(i2); const { topic: s2 } = i2; if (this.pairings.keys.includes(s2)) { const n2 = await this.sendRequest(s2, "wc_pairingPing", {}), { done: o2, resolve: a2, reject: h2 } = at$2(); this.events.once(yt$2("pairing_ping", n2), ({ error: l2 }) => { l2 ? h2(l2) : a2(); }), await o2(); } }, this.updateExpiry = async ({ topic: i2, expiry: s2 }) => { this.isInitialized(), await this.pairings.update(i2, { expiry: s2 }); }, this.updateMetadata = async ({ topic: i2, metadata: s2 }) => { this.isInitialized(), await this.pairings.update(i2, { peerMetadata: s2 }); }, this.getPairings = () => (this.isInitialized(), this.pairings.values), this.disconnect = async (i2) => { this.isInitialized(), await this.isValidDisconnect(i2); const { topic: s2 } = i2; this.pairings.keys.includes(s2) && (await this.sendRequest(s2, "wc_pairingDelete", U$3("USER_DISCONNECTED")), await this.deletePairing(s2)); }, this.sendRequest = async (i2, s2, n2) => { const o2 = formatJsonRpcRequest(s2, n2), a2 = await this.core.crypto.encode(i2, o2), h2 = F$3[s2].req; return this.core.history.set(i2, o2), this.core.relayer.publish(i2, a2, h2), o2.id; }, this.sendResult = async (i2, s2, n2) => { const o2 = formatJsonRpcResult(i2, n2), a2 = await this.core.crypto.encode(s2, o2), h2 = await this.core.history.get(s2, i2), l2 = F$3[h2.request.method].res; await this.core.relayer.publish(s2, a2, l2), await this.core.history.resolve(o2); }, this.sendError = async (i2, s2, n2) => { const o2 = formatJsonRpcError(i2, n2), a2 = await this.core.crypto.encode(s2, o2), h2 = await this.core.history.get(s2, i2), l2 = F$3[h2.request.method] ? F$3[h2.request.method].res : F$3.unregistered_method.res; await this.core.relayer.publish(s2, a2, l2), await this.core.history.resolve(o2); }, this.deletePairing = async (i2, s2) => { await this.core.relayer.unsubscribe(i2), await Promise.all([this.pairings.delete(i2, U$3("USER_DISCONNECTED")), this.core.crypto.deleteSymKey(i2), s2 ? Promise.resolve() : this.core.expirer.del(i2)]); }, this.cleanup = async () => { const i2 = this.pairings.getAll().filter((s2) => mt$2(s2.expiry)); await Promise.all(i2.map((s2) => this.deletePairing(s2.topic))); }, this.onRelayEventRequest = (i2) => { const { topic: s2, payload: n2 } = i2; switch (n2.method) { case "wc_pairingPing": return this.onPairingPingRequest(s2, n2); case "wc_pairingDelete": return this.onPairingDeleteRequest(s2, n2); default: return this.onUnknownRpcMethodRequest(s2, n2); } }, this.onRelayEventResponse = async (i2) => { const { topic: s2, payload: n2 } = i2, o2 = (await this.core.history.get(s2, n2.id)).request.method; switch (o2) { case "wc_pairingPing": return this.onPairingPingResponse(s2, n2); default: return this.onUnknownRpcMethodResponse(o2); } }, this.onPairingPingRequest = async (i2, s2) => { const { id: n2 } = s2; try { this.isValidPing({ topic: i2 }), await this.sendResult(n2, i2, true), this.events.emit(V$3.ping, { id: n2, topic: i2 }); } catch (o2) { await this.sendError(n2, i2, o2), this.logger.error(o2); } }, this.onPairingPingResponse = (i2, s2) => { const { id: n2 } = s2; setTimeout(() => { isJsonRpcResult(s2) ? this.events.emit(yt$2("pairing_ping", n2), {}) : isJsonRpcError(s2) && this.events.emit(yt$2("pairing_ping", n2), { error: s2.error }); }, 500); }, this.onPairingDeleteRequest = async (i2, s2) => { const { id: n2 } = s2; try { this.isValidDisconnect({ topic: i2 }), await this.deletePairing(i2), this.events.emit(V$3.delete, { id: n2, topic: i2 }); } catch (o2) { await this.sendError(n2, i2, o2), this.logger.error(o2); } }, this.onUnknownRpcMethodRequest = async (i2, s2) => { const { id: n2, method: o2 } = s2; try { if (this.registeredMethods.includes(o2)) return; const a2 = U$3("WC_METHOD_UNSUPPORTED", o2); await this.sendError(n2, i2, a2), this.logger.error(a2); } catch (a2) { await this.sendError(n2, i2, a2), this.logger.error(a2); } }, this.onUnknownRpcMethodResponse = (i2) => { this.registeredMethods.includes(i2) || this.logger.error(U$3("WC_METHOD_UNSUPPORTED", i2)); }, this.isValidPair = (i2) => { var s2; if (!Ht$2(i2)) { const { message: o2 } = N$5("MISSING_OR_INVALID", `pair() params: ${i2}`); throw new Error(o2); } if (!kt$2(i2.uri)) { const { message: o2 } = N$5("MISSING_OR_INVALID", `pair() uri: ${i2.uri}`); throw new Error(o2); } const n2 = wt$2(i2.uri); if (!((s2 = n2 == null ? void 0 : n2.relay) != null && s2.protocol)) { const { message: o2 } = N$5("MISSING_OR_INVALID", "pair() uri#relay-protocol"); throw new Error(o2); } if (!(n2 != null && n2.symKey)) { const { message: o2 } = N$5("MISSING_OR_INVALID", "pair() uri#symKey"); throw new Error(o2); } }, this.isValidPing = async (i2) => { if (!Ht$2(i2)) { const { message: n2 } = N$5("MISSING_OR_INVALID", `ping() params: ${i2}`); throw new Error(n2); } const { topic: s2 } = i2; await this.isValidPairingTopic(s2); }, this.isValidDisconnect = async (i2) => { if (!Ht$2(i2)) { const { message: n2 } = N$5("MISSING_OR_INVALID", `disconnect() params: ${i2}`); throw new Error(n2); } const { topic: s2 } = i2; await this.isValidPairingTopic(s2); }, this.isValidPairingTopic = async (i2) => { if (!h$8(i2, false)) { const { message: s2 } = N$5("MISSING_OR_INVALID", `pairing topic should be a string: ${i2}`); throw new Error(s2); } if (!this.pairings.keys.includes(i2)) { const { message: s2 } = N$5("NO_MATCHING_KEY", `pairing topic doesn't exist: ${i2}`); throw new Error(s2); } if (mt$2(this.pairings.get(i2).expiry)) { await this.deletePairing(i2); const { message: s2 } = N$5("EXPIRED", `pairing topic: ${i2}`); throw new Error(s2); } }, this.core = e2, this.logger = E$5(t2, this.name), this.pairings = new Kt$1(this.core, this.logger, this.name, this.storagePrefix); } get context() { return y$4(this.logger); } isInitialized() { if (!this.initialized) { const { message: e2 } = N$5("NOT_INITIALIZED", this.name); throw new Error(e2); } } registerRelayerEvents() { this.core.relayer.on(D$4.message, async (e2) => { const { topic: t2, message: i2 } = e2; if (!this.pairings.keys.includes(t2) || this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i2))) return; const s2 = await this.core.crypto.decode(t2, i2); try { isJsonRpcRequest(s2) ? (this.core.history.set(t2, s2), this.onRelayEventRequest({ topic: t2, payload: s2 })) : isJsonRpcResponse(s2) && (await this.core.history.resolve(s2), await this.onRelayEventResponse({ topic: t2, payload: s2 }), this.core.history.delete(t2, s2.id)); } catch (n2) { this.logger.error(n2); } }); } registerExpirerEvents() { this.core.expirer.on(v$4.expired, async (e2) => { const { topic: t2 } = ft$5(e2.target); t2 && this.pairings.keys.includes(t2) && (await this.deletePairing(t2, true), this.events.emit(V$3.expire, { topic: t2 })); }); } }; let Vt$1 = class Vt extends h$4 { constructor(e2, t2) { super(e2, t2), this.core = e2, this.logger = t2, this.records = /* @__PURE__ */ new Map(), this.events = new eventsExports.EventEmitter(), this.name = vt$1, this.version = It$1, this.cached = [], this.initialized = false, this.storagePrefix = O$3, this.init = async () => { this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((i2) => this.records.set(i2.id, i2)), this.cached = [], this.registerEventListeners(), this.initialized = true); }, this.set = (i2, s2, n2) => { if (this.isInitialized(), this.logger.debug("Setting JSON-RPC request history record"), this.logger.trace({ type: "method", method: "set", topic: i2, request: s2, chainId: n2 }), this.records.has(s2.id)) return; const o2 = { id: s2.id, topic: i2, request: { method: s2.method, params: s2.params || null }, chainId: n2, expiry: pt$2(cjs$5.THIRTY_DAYS) }; this.records.set(o2.id, o2), this.events.emit(R$2.created, o2); }, this.resolve = async (i2) => { if (this.isInitialized(), this.logger.debug("Updating JSON-RPC response history record"), this.logger.trace({ type: "method", method: "update", response: i2 }), !this.records.has(i2.id)) return; const s2 = await this.getRecord(i2.id); typeof s2.response > "u" && (s2.response = isJsonRpcError(i2) ? { error: i2.error } : { result: i2.result }, this.records.set(s2.id, s2), this.events.emit(R$2.updated, s2)); }, this.get = async (i2, s2) => (this.isInitialized(), this.logger.debug("Getting record"), this.logger.trace({ type: "method", method: "get", topic: i2, id: s2 }), await this.getRecord(s2)), this.delete = (i2, s2) => { this.isInitialized(), this.logger.debug("Deleting record"), this.logger.trace({ type: "method", method: "delete", id: s2 }), this.values.forEach((n2) => { if (n2.topic === i2) { if (typeof s2 < "u" && n2.id !== s2) return; this.records.delete(n2.id), this.events.emit(R$2.deleted, n2); } }); }, this.exists = async (i2, s2) => (this.isInitialized(), this.records.has(s2) ? (await this.getRecord(s2)).topic === i2 : false), this.on = (i2, s2) => { this.events.on(i2, s2); }, this.once = (i2, s2) => { this.events.once(i2, s2); }, this.off = (i2, s2) => { this.events.off(i2, s2); }, this.removeListener = (i2, s2) => { this.events.removeListener(i2, s2); }, this.logger = E$5(t2, this.name); } get context() { return y$4(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 e2 = []; return this.values.forEach((t2) => { if (typeof t2.response < "u") return; const i2 = { topic: t2.topic, request: formatJsonRpcRequest(t2.request.method, t2.request.params, t2.id), chainId: t2.chainId }; return e2.push(i2); }), e2; } async setJsonRpcRecords(e2) { await this.core.storage.setItem(this.storageKey, e2); } async getJsonRpcRecords() { return await this.core.storage.getItem(this.storageKey); } getRecord(e2) { this.isInitialized(); const t2 = this.records.get(e2); if (!t2) { const { message: i2 } = N$5("NO_MATCHING_KEY", `${this.name}: ${e2}`); throw new Error(i2); } return t2; } async persist() { await this.setJsonRpcRecords(this.values), this.events.emit(R$2.sync); } async restore() { try { const e2 = await this.getJsonRpcRecords(); if (typeof e2 > "u" || !e2.length) return; if (this.records.size) { const { message: t2 } = N$5("RESTORE_WILL_OVERRIDE", this.name); throw this.logger.error(t2), new Error(t2); } this.cached = e2, this.logger.debug(`Successfully Restored records for ${this.name}`), this.logger.trace({ type: "method", method: "restore", records: this.values }); } catch (e2) { this.logger.debug(`Failed to Restore records for ${this.name}`), this.logger.error(e2); } } registerEventListeners() { this.events.on(R$2.created, (e2) => { const t2 = R$2.created; this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, record: e2 }), this.persist(); }), this.events.on(R$2.updated, (e2) => { const t2 = R$2.updated; this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, record: e2 }), this.persist(); }), this.events.on(R$2.deleted, (e2) => { const t2 = R$2.deleted; this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, record: e2 }), this.persist(); }), this.core.heartbeat.on(cjs$1.HEARTBEAT_EVENTS.pulse, () => { this.cleanup(); }); } cleanup() { try { this.records.forEach((e2) => { cjs$5.toMiliseconds(e2.expiry || 0) - Date.now() <= 0 && (this.logger.info(`Deleting expired history log: ${e2.id}`), this.delete(e2.topic, e2.id)); }); } catch (e2) { this.logger.warn(e2); } } isInitialized() { if (!this.initialized) { const { message: e2 } = N$5("NOT_INITIALIZED", this.name); throw new Error(e2); } } }; let jt$1 = class jt extends E$4 { constructor(e2, t2) { super(e2, t2), this.core = e2, this.logger = t2, this.expirations = /* @__PURE__ */ new Map(), this.events = new eventsExports.EventEmitter(), this.name = Ct$2, this.version = Rt$1, this.cached = [], this.initialized = false, this.storagePrefix = O$3, this.init = async () => { this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((i2) => this.expirations.set(i2.target, i2)), this.cached = [], this.registerEventListeners(), this.initialized = true); }, this.has = (i2) => { try { const s2 = this.formatTarget(i2); return typeof this.getExpiration(s2) < "u"; } catch { return false; } }, this.set = (i2, s2) => { this.isInitialized(); const n2 = this.formatTarget(i2), o2 = { target: n2, expiry: s2 }; this.expirations.set(n2, o2), this.checkExpiry(n2, o2), this.events.emit(v$4.created, { target: n2, expiration: o2 }); }, this.get = (i2) => { this.isInitialized(); const s2 = this.formatTarget(i2); return this.getExpiration(s2); }, this.del = (i2) => { if (this.isInitialized(), this.has(i2)) { const s2 = this.formatTarget(i2), n2 = this.getExpiration(s2); this.expirations.delete(s2), this.events.emit(v$4.deleted, { target: s2, expiration: n2 }); } }, this.on = (i2, s2) => { this.events.on(i2, s2); }, this.once = (i2, s2) => { this.events.once(i2, s2); }, this.off = (i2, s2) => { this.events.off(i2, s2); }, this.removeListener = (i2, s2) => { this.events.removeListener(i2, s2); }, this.logger = E$5(t2, this.name); } get context() { return y$4(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(e2) { if (typeof e2 == "string") return lt$6(e2); if (typeof e2 == "number") return dt$2(e2); const { message: t2 } = N$5("UNKNOWN_TYPE", `Target type: ${typeof e2}`); throw new Error(t2); } async setExpirations(e2) { await this.core.storage.setItem(this.storageKey, e2); } async getExpirations() { return await this.core.storage.getItem(this.storageKey); } async persist() { await this.setExpirations(this.values), this.events.emit(v$4.sync); } async restore() { try { const e2 = await this.getExpirations(); if (typeof e2 > "u" || !e2.length) return; if (this.expirations.size) { const { message: t2 } = N$5("RESTORE_WILL_OVERRIDE", this.name); throw this.logger.error(t2), new Error(t2); } this.cached = e2, this.logger.debug(`Successfully Restored expirations for ${this.name}`), this.logger.trace({ type: "method", method: "restore", expirations: this.values }); } catch (e2) { this.logger.debug(`Failed to Restore expirations for ${this.name}`), this.logger.error(e2); } } getExpiration(e2) { const t2 = this.expirations.get(e2); if (!t2) { const { message: i2 } = N$5("NO_MATCHING_KEY", `${this.name}: ${e2}`); throw this.logger.error(i2), new Error(i2); } return t2; } checkExpiry(e2, t2) { const { expiry: i2 } = t2; cjs$5.toMiliseconds(i2) - Date.now() <= 0 && this.expire(e2, t2); } expire(e2, t2) { this.expirations.delete(e2), this.events.emit(v$4.expired, { target: e2, expiration: t2 }); } checkExpirations() { this.core.relayer.connected && this.expirations.forEach((e2, t2) => this.checkExpiry(t2, e2)); } registerEventListeners() { this.core.heartbeat.on(cjs$1.HEARTBEAT_EVENTS.pulse, () => this.checkExpirations()), this.events.on(v$4.created, (e2) => { const t2 = v$4.created; this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, data: e2 }), this.persist(); }), this.events.on(v$4.expired, (e2) => { const t2 = v$4.expired; this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, data: e2 }), this.persist(); }), this.events.on(v$4.deleted, (e2) => { const t2 = v$4.deleted; this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, data: e2 }), this.persist(); }); } isInitialized() { if (!this.initialized) { const { message: e2 } = N$5("NOT_INITIALIZED", this.name); throw new Error(e2); } } }; let qt$1 = class qt extends y$3 { constructor(e2, t2) { super(e2, t2), this.projectId = e2, this.logger = t2, this.name = Z$3, this.initialized = false, this.queue = [], this.verifyDisabled = false, this.init = async (i2) => { if (this.verifyDisabled || C$4() || !D$8()) return; const s2 = this.getVerifyUrl(i2 == null ? void 0 : i2.verifyUrl); this.verifyUrl !== s2 && this.removeIframe(), this.verifyUrl = s2; try { await this.createIframe(); } catch (n2) { this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`), this.logger.info(n2); } if (!this.initialized) { this.removeIframe(), this.verifyUrl = ee$1; try { await this.createIframe(); } catch (n2) { this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`), this.logger.info(n2), this.verifyDisabled = true; } } }, this.register = async (i2) => { this.initialized ? this.sendPost(i2.attestationId) : (this.addToQueue(i2.attestationId), await this.init()); }, this.resolve = async (i2) => { if (this.isDevEnv) return ""; const s2 = this.getVerifyUrl(i2 == null ? void 0 : i2.verifyUrl); let n2; try { n2 = await this.fetchAttestation(i2.attestationId, s2); } catch (o2) { this.logger.info(`failed to resolve attestation: ${i2.attestationId} from url: ${s2}`), this.logger.info(o2), n2 = await this.fetchAttestation(i2.attestationId, ee$1); } return n2; }, this.fetchAttestation = async (i2, s2) => { this.logger.info(`resolving attestation: ${i2} from url: ${s2}`); const n2 = this.startAbortTimer(cjs$5.ONE_SECOND * 2), o2 = await fetch(`${s2}/attestation/${i2}`, { signal: this.abortController.signal }); return clearTimeout(n2), o2.status === 200 ? await o2.json() : void 0; }, this.addToQueue = (i2) => { this.queue.push(i2); }, this.processQueue = () => { this.queue.length !== 0 && (this.queue.forEach((i2) => this.sendPost(i2)), this.queue = []); }, this.sendPost = (i2) => { var s2; try { if (!this.iframe) return; (s2 = this.iframe.contentWindow) == null || s2.postMessage(i2, "*"), this.logger.info(`postMessage sent: ${i2} ${this.verifyUrl}`); } catch { } }, this.createIframe = async () => { let i2; const s2 = (n2) => { n2.data === "verify_ready" && (this.initialized = true, this.processQueue(), window.removeEventListener("message", s2), i2()); }; await Promise.race([new Promise((n2) => { if (document.getElementById(Z$3)) return n2(); window.addEventListener("message", s2); const o2 = document.createElement("iframe"); o2.id = Z$3, o2.src = `${this.verifyUrl}/${this.projectId}`, o2.style.display = "none", document.body.append(o2), this.iframe = o2, i2 = n2; }), new Promise((n2, o2) => setTimeout(() => { window.removeEventListener("message", s2), o2("verify iframe load timeout"); }, cjs$5.toMiliseconds(cjs$5.FIVE_SECONDS)))]); }, this.removeIframe = () => { this.iframe && (this.iframe.remove(), this.iframe = void 0, this.initialized = false); }, this.getVerifyUrl = (i2) => { let s2 = i2 || $$3; return _t$1.includes(s2) || (this.logger.info(`verify url: ${s2}, not included in trusted list, assigning default: ${$$3}`), s2 = $$3), s2; }, this.logger = E$5(t2, this.name), this.verifyUrl = $$3, this.abortController = new AbortController(), this.isDevEnv = te$3() && process.env.IS_VITEST; } get context() { return y$4(this.logger); } startAbortTimer(e2) { return this.abortController = new AbortController(), setTimeout(() => this.abortController.abort(), cjs$5.toMiliseconds(e2)); } }; let Gt$1 = class Gt extends v$5 { constructor(e2, t2) { super(e2, t2), this.projectId = e2, this.logger = t2, this.context = St$1, this.registerDeviceToken = async (i2) => { const { clientId: s2, token: n2, notificationType: o2, enableEncrypted: a2 = false } = i2, h2 = `${Tt$1}/${this.projectId}/clients`; await Yi(h2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ client_id: s2, type: o2, token: n2, always_raw: a2 }) }); }, this.logger = E$5(t2, this.context); } }; var Lr = Object.defineProperty, Yt$1 = Object.getOwnPropertySymbols, Fr = Object.prototype.hasOwnProperty, $r = Object.prototype.propertyIsEnumerable, Ht$1 = (r2, e2, t2) => e2 in r2 ? Lr(r2, e2, { enumerable: true, configurable: true, writable: true, value: t2 }) : r2[e2] = t2, Jt$1 = (r2, e2) => { for (var t2 in e2 || (e2 = {})) Fr.call(e2, t2) && Ht$1(r2, t2, e2[t2]); if (Yt$1) for (var t2 of Yt$1(e2)) $r.call(e2, t2) && Ht$1(r2, t2, e2[t2]); return r2; }; let te$2 = class te2 extends n$7 { constructor(e2) { super(e2), this.protocol = le$2, this.version = We$1, this.name = Q$4, this.events = new eventsExports.EventEmitter(), this.initialized = false, this.on = (i2, s2) => this.events.on(i2, s2), this.once = (i2, s2) => this.events.once(i2, s2), this.off = (i2, s2) => this.events.off(i2, s2), this.removeListener = (i2, s2) => this.events.removeListener(i2, s2), this.projectId = e2 == null ? void 0 : e2.projectId, this.relayUrl = (e2 == null ? void 0 : e2.relayUrl) || ge$1, this.customStoragePrefix = e2 != null && e2.customStoragePrefix ? `:${e2.customStoragePrefix}` : ""; const t2 = typeof (e2 == null ? void 0 : e2.logger) < "u" && typeof (e2 == null ? void 0 : e2.logger) != "string" ? e2.logger : Dg(k$2({ level: (e2 == null ? void 0 : e2.logger) || Qe$1.logger })); this.logger = E$5(t2, this.name), this.heartbeat = new cjs$1.HeartBeat(), this.crypto = new xt$1(this, this.logger, e2 == null ? void 0 : e2.keychain), this.history = new Vt$1(this, this.logger), this.expirer = new jt$1(this, this.logger), this.storage = e2 != null && e2.storage ? e2.storage : new h$5(Jt$1(Jt$1({}, Ze), e2 == null ? void 0 : e2.storageOptions)), this.relayer = new Ft$1({ core: this, logger: this.logger, relayUrl: this.relayUrl, projectId: this.projectId }), this.pairing = new Bt$1(this, this.logger), this.verify = new qt$1(this.projectId || "", this.logger), this.echoClient = new Gt$1(this.projectId || "", this.logger); } static async init(e2) { const t2 = new te2(e2); await t2.initialize(); const i2 = await t2.crypto.getClientId(); return await t2.storage.setItem(yt$1, i2), t2; } get context() { return y$4(this.logger); } async start() { this.initialized || await this.initialize(); } 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.initialized = true, this.logger.info("Core Initialization Success"); } catch (e2) { throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`, e2), this.logger.error(e2.message), e2; } } }; const Mr = te$2; const X$1 = "wc", F$2 = 2, H$2 = "client", G$3 = `${X$1}@${F$2}:${H$2}:`, M$3 = { name: H$2, logger: "error", controller: false, relayUrl: "wss://relay.walletconnect.com" }, W$1 = "WALLETCONNECT_DEEPLINK_CHOICE", ne$2 = "proposal", oe$2 = "Proposal expired", ae$1 = "session", A$2 = cjs$5.SEVEN_DAYS, ce$1 = "engine", V$2 = { wc_sessionPropose: { req: { ttl: cjs$5.FIVE_MINUTES, prompt: true, tag: 1100 }, res: { ttl: cjs$5.FIVE_MINUTES, prompt: false, tag: 1101 } }, wc_sessionSettle: { req: { ttl: cjs$5.FIVE_MINUTES, prompt: false, tag: 1102 }, res: { ttl: cjs$5.FIVE_MINUTES, prompt: false, tag: 1103 } }, wc_sessionUpdate: { req: { ttl: cjs$5.ONE_DAY, prompt: false, tag: 1104 }, res: { ttl: cjs$5.ONE_DAY, prompt: false, tag: 1105 } }, wc_sessionExtend: { req: { ttl: cjs$5.ONE_DAY, prompt: false, tag: 1106 }, res: { ttl: cjs$5.ONE_DAY, prompt: false, tag: 1107 } }, wc_sessionRequest: { req: { ttl: cjs$5.FIVE_MINUTES, prompt: true, tag: 1108 }, res: { ttl: cjs$5.FIVE_MINUTES, prompt: false, tag: 1109 } }, wc_sessionEvent: { req: { ttl: cjs$5.FIVE_MINUTES, prompt: true, tag: 1110 }, res: { ttl: cjs$5.FIVE_MINUTES, prompt: false, tag: 1111 } }, wc_sessionDelete: { req: { ttl: cjs$5.ONE_DAY, prompt: false, tag: 1112 }, res: { ttl: cjs$5.ONE_DAY, prompt: false, tag: 1113 } }, wc_sessionPing: { req: { ttl: cjs$5.THIRTY_SECONDS, prompt: false, tag: 1114 }, res: { ttl: cjs$5.THIRTY_SECONDS, prompt: false, tag: 1115 } } }, U$2 = { min: cjs$5.FIVE_MINUTES, max: cjs$5.SEVEN_DAYS }, I$2 = { idle: "IDLE", active: "ACTIVE" }, le$1 = "request", pe = ["wc_sessionPropose", "wc_sessionRequest", "wc_authRequest"]; var as = Object.defineProperty, cs = Object.defineProperties, ls = Object.getOwnPropertyDescriptors, he$1 = Object.getOwnPropertySymbols, ps = Object.prototype.hasOwnProperty, hs = Object.prototype.propertyIsEnumerable, de$1 = (m2, r2, e2) => r2 in m2 ? as(m2, r2, { enumerable: true, configurable: true, writable: true, value: e2 }) : m2[r2] = e2, g$4 = (m2, r2) => { for (var e2 in r2 || (r2 = {})) ps.call(r2, e2) && de$1(m2, e2, r2[e2]); if (he$1) for (var e2 of he$1(r2)) hs.call(r2, e2) && de$1(m2, e2, r2[e2]); return m2; }, b$1 = (m2, r2) => cs(m2, ls(r2)); class ds extends w$5 { constructor(r2) { super(r2), this.name = ce$1, this.events = new $g(), this.initialized = false, this.ignoredPayloadTypes = [_$8], this.requestQueue = { state: I$2.idle, queue: [] }, this.sessionRequestQueue = { state: I$2.idle, queue: [] }, this.requestQueueDelay = cjs$5.ONE_SECOND, this.init = async () => { this.initialized || (await this.cleanup(), this.registerRelayerEvents(), this.registerExpirerEvents(), this.registerPairingEvents(), this.client.core.pairing.register({ methods: Object.keys(V$2) }), this.initialized = true, setTimeout(() => { this.sessionRequestQueue.queue = this.getPendingSessionRequests(), this.processSessionRequestQueue(); }, cjs$5.toMiliseconds(this.requestQueueDelay))); }, this.connect = async (e2) => { await this.isInitialized(); const s2 = b$1(g$4({}, e2), { requiredNamespaces: e2.requiredNamespaces || {}, optionalNamespaces: e2.optionalNamespaces || {} }); await this.isValidConnect(s2); const { pairingTopic: t2, requiredNamespaces: i2, optionalNamespaces: n2, sessionProperties: o2, relays: a2 } = s2; let c2 = t2, p2, d2 = false; if (c2 && (d2 = this.client.core.pairing.pairings.get(c2).active), !c2 || !d2) { const { topic: v2, uri: S2 } = await this.client.core.pairing.create(); c2 = v2, p2 = S2; } const h2 = await this.client.core.crypto.generateKeyPair(), R2 = g$4({ requiredNamespaces: i2, optionalNamespaces: n2, relays: a2 ?? [{ protocol: ht$1 }], proposer: { publicKey: h2, metadata: this.client.metadata } }, o2 && { sessionProperties: o2 }), { reject: w2, resolve: T2, done: K2 } = at$2(cjs$5.FIVE_MINUTES, oe$2); if (this.events.once(yt$2("session_connect"), async ({ error: v2, session: S2 }) => { if (v2) w2(v2); else if (S2) { S2.self.publicKey = h2; const B2 = b$1(g$4({}, S2), { requiredNamespaces: S2.requiredNamespaces, optionalNamespaces: S2.optionalNamespaces }); await this.client.session.set(S2.topic, B2), await this.setExpiry(S2.topic, S2.expiry), c2 && await this.client.core.pairing.updateMetadata({ topic: c2, metadata: S2.peer.metadata }), T2(B2); } }), !c2) { const { message: v2 } = N$5("NO_MATCHING_KEY", `connect() pairing topic: ${c2}`); throw new Error(v2); } const L2 = await this.sendRequest({ topic: c2, method: "wc_sessionPropose", params: R2 }), ge2 = pt$2(cjs$5.FIVE_MINUTES); return await this.setProposal(L2, g$4({ id: L2, expiry: ge2 }, R2)), { uri: p2, approval: K2 }; }, this.pair = async (e2) => (await this.isInitialized(), await this.client.core.pairing.pair(e2)), this.approve = async (e2) => { await this.isInitialized(), await this.isValidApprove(e2); const { id: s2, relayProtocol: t2, namespaces: i2, sessionProperties: n2 } = e2, o2 = this.client.proposal.get(s2); let { pairingTopic: a2, proposer: c2, requiredNamespaces: p2, optionalNamespaces: d2 } = o2; a2 = a2 || "", B$6(p2) || (p2 = jt$2(i2, "approve()")); const h2 = await this.client.core.crypto.generateKeyPair(), R2 = c2.publicKey, w2 = await this.client.core.crypto.generateSharedKey(h2, R2); a2 && s2 && (await this.client.core.pairing.updateMetadata({ topic: a2, metadata: c2.metadata }), await this.sendResult({ id: s2, topic: a2, result: { relay: { protocol: t2 ?? "irn" }, responderPublicKey: h2 } }), await this.client.proposal.delete(s2, U$3("USER_DISCONNECTED")), await this.client.core.pairing.activate({ topic: a2 })); const T2 = g$4({ relay: { protocol: t2 ?? "irn" }, namespaces: i2, requiredNamespaces: p2, optionalNamespaces: d2, pairingTopic: a2, controller: { publicKey: h2, metadata: this.client.metadata }, expiry: pt$2(A$2) }, n2 && { sessionProperties: n2 }); await this.client.core.relayer.subscribe(w2), await this.sendRequest({ topic: w2, method: "wc_sessionSettle", params: T2, throwOnFailedPublish: true }); const K2 = b$1(g$4({}, T2), { topic: w2, pairingTopic: a2, acknowledged: false, self: T2.controller, peer: { publicKey: c2.publicKey, metadata: c2.metadata }, controller: h2 }); return await this.client.session.set(w2, K2), await this.setExpiry(w2, pt$2(A$2)), { topic: w2, acknowledged: () => new Promise((L2) => setTimeout(() => L2(this.client.session.get(w2)), 500)) }; }, this.reject = async (e2) => { await this.isInitialized(), await this.isValidReject(e2); const { id: s2, reason: t2 } = e2, { pairingTopic: i2 } = this.client.proposal.get(s2); i2 && (await this.sendError(s2, i2, t2), await this.client.proposal.delete(s2, U$3("USER_DISCONNECTED"))); }, this.update = async (e2) => { await this.isInitialized(), await this.isValidUpdate(e2); const { topic: s2, namespaces: t2 } = e2, i2 = await this.sendRequest({ topic: s2, method: "wc_sessionUpdate", params: { namespaces: t2 } }), { done: n2, resolve: o2, reject: a2 } = at$2(); return this.events.once(yt$2("session_update", i2), ({ error: c2 }) => { c2 ? a2(c2) : o2(); }), await this.client.session.update(s2, { namespaces: t2 }), { acknowledged: n2 }; }, this.extend = async (e2) => { await this.isInitialized(), await this.isValidExtend(e2); const { topic: s2 } = e2, t2 = await this.sendRequest({ topic: s2, method: "wc_sessionExtend", params: {} }), { done: i2, resolve: n2, reject: o2 } = at$2(); return this.events.once(yt$2("session_extend", t2), ({ error: a2 }) => { a2 ? o2(a2) : n2(); }), await this.setExpiry(s2, pt$2(A$2)), { acknowledged: i2 }; }, this.request = async (e2) => { await this.isInitialized(), await this.isValidRequest(e2); const { chainId: s2, request: t2, topic: i2, expiry: n2 } = e2, o2 = payloadId(), { done: a2, resolve: c2, reject: p2 } = at$2(n2, "Request expired. Please try again."); return this.events.once(yt$2("session_request", o2), ({ error: d2, result: h2 }) => { d2 ? p2(d2) : c2(h2); }), await Promise.all([new Promise(async (d2) => { await this.sendRequest({ clientRpcId: o2, topic: i2, method: "wc_sessionRequest", params: { request: t2, chainId: s2 }, expiry: n2, throwOnFailedPublish: true }).catch((h2) => p2(h2)), this.client.events.emit("session_request_sent", { topic: i2, request: t2, chainId: s2, id: o2 }), d2(); }), new Promise(async (d2) => { const h2 = await gt$7(this.client.core.storage, W$1); ht$2({ id: o2, topic: i2, wcDeepLink: h2 }), d2(); }), a2()]).then((d2) => d2[2]); }, this.respond = async (e2) => { await this.isInitialized(), await this.isValidRespond(e2); const { topic: s2, response: t2 } = e2, { id: i2 } = t2; isJsonRpcResult(t2) ? await this.sendResult({ id: i2, topic: s2, result: t2.result, throwOnFailedPublish: true }) : isJsonRpcError(t2) && await this.sendError(i2, s2, t2.error), this.cleanupAfterResponse(e2); }, this.ping = async (e2) => { await this.isInitialized(), await this.isValidPing(e2); const { topic: s2 } = e2; if (this.client.session.keys.includes(s2)) { const t2 = await this.sendRequest({ topic: s2, method: "wc_sessionPing", params: {} }), { done: i2, resolve: n2, reject: o2 } = at$2(); this.events.once(yt$2("session_ping", t2), ({ error: a2 }) => { a2 ? o2(a2) : n2(); }), await i2(); } else this.client.core.pairing.pairings.keys.includes(s2) && await this.client.core.pairing.ping({ topic: s2 }); }, this.emit = async (e2) => { await this.isInitialized(), await this.isValidEmit(e2); const { topic: s2, event: t2, chainId: i2 } = e2; await this.sendRequest({ topic: s2, method: "wc_sessionEvent", params: { event: t2, chainId: i2 } }); }, this.disconnect = async (e2) => { await this.isInitialized(), await this.isValidDisconnect(e2); const { topic: s2 } = e2; this.client.session.keys.includes(s2) ? (await this.sendRequest({ topic: s2, method: "wc_sessionDelete", params: U$3("USER_DISCONNECTED"), throwOnFailedPublish: true }), await this.deleteSession(s2)) : await this.client.core.pairing.disconnect({ topic: s2 }); }, this.find = (e2) => (this.isInitialized(), this.client.session.getAll().filter((s2) => Dt$2(s2, e2))), this.getPendingSessionRequests = () => (this.isInitialized(), this.client.pendingRequest.getAll()), this.cleanupDuplicatePairings = async (e2) => { if (e2.pairingTopic) try { const s2 = this.client.core.pairing.pairings.get(e2.pairingTopic), t2 = this.client.core.pairing.pairings.getAll().filter((i2) => { var n2, o2; return ((n2 = i2.peerMetadata) == null ? void 0 : n2.url) && ((o2 = i2.peerMetadata) == null ? void 0 : o2.url) === e2.peer.metadata.url && i2.topic && i2.topic !== s2.topic; }); if (t2.length === 0) return; this.client.logger.info(`Cleaning up ${t2.length} duplicate pairing(s)`), await Promise.all(t2.map((i2) => this.client.core.pairing.disconnect({ topic: i2.topic }))), this.client.logger.info("Duplicate pairings clean up finished"); } catch (s2) { this.client.logger.error(s2); } }, this.deleteSession = async (e2, s2) => { const { self: t2 } = this.client.session.get(e2); await this.client.core.relayer.unsubscribe(e2), this.client.session.delete(e2, U$3("USER_DISCONNECTED")), this.client.core.crypto.keychain.has(t2.publicKey) && await this.client.core.crypto.deleteKeyPair(t2.publicKey), this.client.core.crypto.keychain.has(e2) && await this.client.core.crypto.deleteSymKey(e2), s2 || this.client.core.expirer.del(e2), this.client.core.storage.removeItem(W$1).catch((i2) => this.client.logger.warn(i2)), this.getPendingSessionRequests().forEach((i2) => { i2.topic === e2 && this.deletePendingSessionRequest(i2.id, U$3("USER_DISCONNECTED")); }); }, this.deleteProposal = async (e2, s2) => { await Promise.all([this.client.proposal.delete(e2, U$3("USER_DISCONNECTED")), s2 ? Promise.resolve() : this.client.core.expirer.del(e2)]); }, this.deletePendingSessionRequest = async (e2, s2, t2 = false) => { await Promise.all([this.client.pendingRequest.delete(e2, s2), t2 ? Promise.resolve() : this.client.core.expirer.del(e2)]), this.sessionRequestQueue.queue = this.sessionRequestQueue.queue.filter((i2) => i2.id !== e2), t2 && (this.sessionRequestQueue.state = I$2.idle); }, this.setExpiry = async (e2, s2) => { this.client.session.keys.includes(e2) && await this.client.session.update(e2, { expiry: s2 }), this.client.core.expirer.set(e2, s2); }, this.setProposal = async (e2, s2) => { await this.client.proposal.set(e2, s2), this.client.core.expirer.set(e2, s2.expiry); }, this.setPendingSessionRequest = async (e2) => { const s2 = V$2.wc_sessionRequest.req.ttl, { id: t2, topic: i2, params: n2, verifyContext: o2 } = e2; await this.client.pendingRequest.set(t2, { id: t2, topic: i2, params: n2, verifyContext: o2 }), s2 && this.client.core.expirer.set(t2, pt$2(s2)); }, this.sendRequest = async (e2) => { const { topic: s2, method: t2, params: i2, expiry: n2, relayRpcId: o2, clientRpcId: a2, throwOnFailedPublish: c2 } = e2, p2 = formatJsonRpcRequest(t2, i2, a2); if (D$8() && pe.includes(t2)) { const R2 = Ln(JSON.stringify(p2)); this.client.core.verify.register({ attestationId: R2 }); } const d2 = await this.client.core.crypto.encode(s2, p2), h2 = V$2[t2].req; return n2 && (h2.ttl = n2), o2 && (h2.id = o2), this.client.core.history.set(s2, p2), c2 ? (h2.internal = b$1(g$4({}, h2.internal), { throwOnFailedPublish: true }), await this.client.core.relayer.publish(s2, d2, h2)) : this.client.core.relayer.publish(s2, d2, h2).catch((R2) => this.client.logger.error(R2)), p2.id; }, this.sendResult = async (e2) => { const { id: s2, topic: t2, result: i2, throwOnFailedPublish: n2 } = e2, o2 = formatJsonRpcResult(s2, i2), a2 = await this.client.core.crypto.encode(t2, o2), c2 = await this.client.core.history.get(t2, s2), p2 = V$2[c2.request.method].res; n2 ? (p2.internal = b$1(g$4({}, p2.internal), { throwOnFailedPublish: true }), await this.client.core.relayer.publish(t2, a2, p2)) : this.client.core.relayer.publish(t2, a2, p2).catch((d2) => this.client.logger.error(d2)), await this.client.core.history.resolve(o2); }, this.sendError = async (e2, s2, t2) => { const i2 = formatJsonRpcError(e2, t2), n2 = await this.client.core.crypto.encode(s2, i2), o2 = await this.client.core.history.get(s2, e2), a2 = V$2[o2.request.method].res; this.client.core.relayer.publish(s2, n2, a2), await this.client.core.history.resolve(i2); }, this.cleanup = async () => { const e2 = [], s2 = []; this.client.session.getAll().forEach((t2) => { mt$2(t2.expiry) && e2.push(t2.topic); }), this.client.proposal.getAll().forEach((t2) => { mt$2(t2.expiry) && s2.push(t2.id); }), await Promise.all([...e2.map((t2) => this.deleteSession(t2)), ...s2.map((t2) => this.deleteProposal(t2))]); }, this.onRelayEventRequest = async (e2) => { this.requestQueue.queue.push(e2), await this.processRequestsQueue(); }, this.processRequestsQueue = async () => { if (this.requestQueue.state === I$2.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 = I$2.active; const e2 = this.requestQueue.queue.shift(); if (e2) try { this.processRequest(e2), await new Promise((s2) => setTimeout(s2, 300)); } catch (s2) { this.client.logger.warn(s2); } } this.requestQueue.state = I$2.idle; }, this.processRequest = (e2) => { const { topic: s2, payload: t2 } = e2, i2 = t2.method; switch (i2) { case "wc_sessionPropose": return this.onSessionProposeRequest(s2, t2); case "wc_sessionSettle": return this.onSessionSettleRequest(s2, t2); case "wc_sessionUpdate": return this.onSessionUpdateRequest(s2, t2); case "wc_sessionExtend": return this.onSessionExtendRequest(s2, t2); case "wc_sessionPing": return this.onSessionPingRequest(s2, t2); case "wc_sessionDelete": return this.onSessionDeleteRequest(s2, t2); case "wc_sessionRequest": return this.onSessionRequest(s2, t2); case "wc_sessionEvent": return this.onSessionEventRequest(s2, t2); default: return this.client.logger.info(`Unsupported request method ${i2}`); } }, this.onRelayEventResponse = async (e2) => { const { topic: s2, payload: t2 } = e2, i2 = (await this.client.core.history.get(s2, t2.id)).request.method; switch (i2) { case "wc_sessionPropose": return this.onSessionProposeResponse(s2, t2); case "wc_sessionSettle": return this.onSessionSettleResponse(s2, t2); case "wc_sessionUpdate": return this.onSessionUpdateResponse(s2, t2); case "wc_sessionExtend": return this.onSessionExtendResponse(s2, t2); case "wc_sessionPing": return this.onSessionPingResponse(s2, t2); case "wc_sessionRequest": return this.onSessionRequestResponse(s2, t2); default: return this.client.logger.info(`Unsupported response method ${i2}`); } }, this.onRelayEventUnknownPayload = (e2) => { const { topic: s2 } = e2, { message: t2 } = N$5("MISSING_OR_INVALID", `Decoded payload on topic ${s2} is not identifiable as a JSON-RPC request or a response.`); throw new Error(t2); }, this.onSessionProposeRequest = async (e2, s2) => { const { params: t2, id: i2 } = s2; try { this.isValidConnect(g$4({}, s2.params)); const n2 = pt$2(cjs$5.FIVE_MINUTES), o2 = g$4({ id: i2, pairingTopic: e2, expiry: n2 }, t2); await this.setProposal(i2, o2); const a2 = Ln(JSON.stringify(s2)), c2 = await this.getVerifyContext(a2, o2.proposer.metadata); this.client.events.emit("session_proposal", { id: i2, params: o2, verifyContext: c2 }); } catch (n2) { await this.sendError(i2, e2, n2), this.client.logger.error(n2); } }, this.onSessionProposeResponse = async (e2, s2) => { const { id: t2 } = s2; if (isJsonRpcResult(s2)) { const { result: i2 } = s2; this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", result: i2 }); const n2 = this.client.proposal.get(t2); this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", proposal: n2 }); const o2 = n2.proposer.publicKey; this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", selfPublicKey: o2 }); const a2 = i2.responderPublicKey; this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", peerPublicKey: a2 }); const c2 = await this.client.core.crypto.generateSharedKey(o2, a2); this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", sessionTopic: c2 }); const p2 = await this.client.core.relayer.subscribe(c2); this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", subscriptionId: p2 }), await this.client.core.pairing.activate({ topic: e2 }); } else isJsonRpcError(s2) && (await this.client.proposal.delete(t2, U$3("USER_DISCONNECTED")), this.events.emit(yt$2("session_connect"), { error: s2.error })); }, this.onSessionSettleRequest = async (e2, s2) => { const { id: t2, params: i2 } = s2; try { this.isValidSessionSettleRequest(i2); const { relay: n2, controller: o2, expiry: a2, namespaces: c2, requiredNamespaces: p2, optionalNamespaces: d2, sessionProperties: h2, pairingTopic: R2 } = s2.params, w2 = g$4({ topic: e2, relay: n2, expiry: a2, namespaces: c2, acknowledged: true, pairingTopic: R2, requiredNamespaces: p2, optionalNamespaces: d2, controller: o2.publicKey, self: { publicKey: "", metadata: this.client.metadata }, peer: { publicKey: o2.publicKey, metadata: o2.metadata } }, h2 && { sessionProperties: h2 }); await this.sendResult({ id: s2.id, topic: e2, result: true }), this.events.emit(yt$2("session_connect"), { session: w2 }), this.cleanupDuplicatePairings(w2); } catch (n2) { await this.sendError(t2, e2, n2), this.client.logger.error(n2); } }, this.onSessionSettleResponse = async (e2, s2) => { const { id: t2 } = s2; isJsonRpcResult(s2) ? (await this.client.session.update(e2, { acknowledged: true }), this.events.emit(yt$2("session_approve", t2), {})) : isJsonRpcError(s2) && (await this.client.session.delete(e2, U$3("USER_DISCONNECTED")), this.events.emit(yt$2("session_approve", t2), { error: s2.error })); }, this.onSessionUpdateRequest = async (e2, s2) => { const { params: t2, id: i2 } = s2; try { const n2 = `${e2}_session_update`, o2 = tr$2.get(n2); if (o2 && this.isRequestOutOfSync(o2, i2)) { this.client.logger.info(`Discarding out of sync request - ${i2}`); return; } this.isValidUpdate(g$4({ topic: e2 }, t2)), await this.client.session.update(e2, { namespaces: t2.namespaces }), await this.sendResult({ id: i2, topic: e2, result: true }), this.client.events.emit("session_update", { id: i2, topic: e2, params: t2 }), tr$2.set(n2, i2); } catch (n2) { await this.sendError(i2, e2, n2), this.client.logger.error(n2); } }, this.isRequestOutOfSync = (e2, s2) => parseInt(s2.toString().slice(0, -3)) <= parseInt(e2.toString().slice(0, -3)), this.onSessionUpdateResponse = (e2, s2) => { const { id: t2 } = s2; isJsonRpcResult(s2) ? this.events.emit(yt$2("session_update", t2), {}) : isJsonRpcError(s2) && this.events.emit(yt$2("session_update", t2), { error: s2.error }); }, this.onSessionExtendRequest = async (e2, s2) => { const { id: t2 } = s2; try { this.isValidExtend({ topic: e2 }), await this.setExpiry(e2, pt$2(A$2)), await this.sendResult({ id: t2, topic: e2, result: true }), this.client.events.emit("session_extend", { id: t2, topic: e2 }); } catch (i2) { await this.sendError(t2, e2, i2), this.client.logger.error(i2); } }, this.onSessionExtendResponse = (e2, s2) => { const { id: t2 } = s2; isJsonRpcResult(s2) ? this.events.emit(yt$2("session_extend", t2), {}) : isJsonRpcError(s2) && this.events.emit(yt$2("session_extend", t2), { error: s2.error }); }, this.onSessionPingRequest = async (e2, s2) => { const { id: t2 } = s2; try { this.isValidPing({ topic: e2 }), await this.sendResult({ id: t2, topic: e2, result: true }), this.client.events.emit("session_ping", { id: t2, topic: e2 }); } catch (i2) { await this.sendError(t2, e2, i2), this.client.logger.error(i2); } }, this.onSessionPingResponse = (e2, s2) => { const { id: t2 } = s2; setTimeout(() => { isJsonRpcResult(s2) ? this.events.emit(yt$2("session_ping", t2), {}) : isJsonRpcError(s2) && this.events.emit(yt$2("session_ping", t2), { error: s2.error }); }, 500); }, this.onSessionDeleteRequest = async (e2, s2) => { const { id: t2 } = s2; try { this.isValidDisconnect({ topic: e2, reason: s2.params }), await Promise.all([new Promise((i2) => { this.client.core.relayer.once(D$4.publish, async () => { i2(await this.deleteSession(e2)); }); }), this.sendResult({ id: t2, topic: e2, result: true })]), this.client.events.emit("session_delete", { id: t2, topic: e2 }); } catch (i2) { this.client.logger.error(i2); } }, this.onSessionRequest = async (e2, s2) => { const { id: t2, params: i2 } = s2; try { this.isValidRequest(g$4({ topic: e2 }, i2)); const n2 = Ln(JSON.stringify(formatJsonRpcRequest("wc_sessionRequest", i2, t2))), o2 = this.client.session.get(e2), a2 = await this.getVerifyContext(n2, o2.peer.metadata), c2 = { id: t2, topic: e2, params: i2, verifyContext: a2 }; await this.setPendingSessionRequest(c2), this.addSessionRequestToSessionRequestQueue(c2), this.processSessionRequestQueue(); } catch (n2) { await this.sendError(t2, e2, n2), this.client.logger.error(n2); } }, this.onSessionRequestResponse = (e2, s2) => { const { id: t2 } = s2; isJsonRpcResult(s2) ? this.events.emit(yt$2("session_request", t2), { result: s2.result }) : isJsonRpcError(s2) && this.events.emit(yt$2("session_request", t2), { error: s2.error }); }, this.onSessionEventRequest = async (e2, s2) => { const { id: t2, params: i2 } = s2; try { const n2 = `${e2}_session_event_${i2.event.name}`, o2 = tr$2.get(n2); if (o2 && this.isRequestOutOfSync(o2, t2)) { this.client.logger.info(`Discarding out of sync request - ${t2}`); return; } this.isValidEmit(g$4({ topic: e2 }, i2)), this.client.events.emit("session_event", { id: t2, topic: e2, params: i2 }), tr$2.set(n2, t2); } catch (n2) { await this.sendError(t2, e2, n2), this.client.logger.error(n2); } }, this.addSessionRequestToSessionRequestQueue = (e2) => { this.sessionRequestQueue.queue.push(e2); }, this.cleanupAfterResponse = (e2) => { this.deletePendingSessionRequest(e2.response.id, { message: "fulfilled", code: 0 }), setTimeout(() => { this.sessionRequestQueue.state = I$2.idle, this.processSessionRequestQueue(); }, cjs$5.toMiliseconds(this.requestQueueDelay)); }, this.processSessionRequestQueue = () => { if (this.sessionRequestQueue.state === I$2.active) { this.client.logger.info("session request queue is already active."); return; } const e2 = this.sessionRequestQueue.queue[0]; if (!e2) { this.client.logger.info("session request queue is empty."); return; } try { this.sessionRequestQueue.state = I$2.active, this.client.events.emit("session_request", e2); } catch (s2) { this.client.logger.error(s2); } }, this.onPairingCreated = (e2) => { if (e2.active) return; const s2 = this.client.proposal.getAll().find((t2) => t2.pairingTopic === e2.topic); s2 && this.onSessionProposeRequest(e2.topic, formatJsonRpcRequest("wc_sessionPropose", { requiredNamespaces: s2.requiredNamespaces, optionalNamespaces: s2.optionalNamespaces, relays: s2.relays, proposer: s2.proposer, sessionProperties: s2.sessionProperties }, s2.id)); }, this.isValidConnect = async (e2) => { if (!Ht$2(e2)) { const { message: a2 } = N$5("MISSING_OR_INVALID", `connect() params: ${JSON.stringify(e2)}`); throw new Error(a2); } const { pairingTopic: s2, requiredNamespaces: t2, optionalNamespaces: i2, sessionProperties: n2, relays: o2 } = e2; if (w$9(s2) || await this.isValidPairingTopic(s2), !xt$2(o2, true)) { const { message: a2 } = N$5("MISSING_OR_INVALID", `connect() relays: ${o2}`); throw new Error(a2); } !w$9(t2) && B$6(t2) !== 0 && this.validateNamespaces(t2, "requiredNamespaces"), !w$9(i2) && B$6(i2) !== 0 && this.validateNamespaces(i2, "optionalNamespaces"), w$9(n2) || this.validateSessionProps(n2, "sessionProperties"); }, this.validateNamespaces = (e2, s2) => { const t2 = Lt$2(e2, "connect()", s2); if (t2) throw new Error(t2.message); }, this.isValidApprove = async (e2) => { if (!Ht$2(e2)) throw new Error(N$5("MISSING_OR_INVALID", `approve() params: ${e2}`).message); const { id: s2, namespaces: t2, relayProtocol: i2, sessionProperties: n2 } = e2; await this.isValidProposalId(s2); const o2 = this.client.proposal.get(s2), a2 = ln(t2, "approve()"); if (a2) throw new Error(a2.message); const c2 = fn(o2.requiredNamespaces, t2, "approve()"); if (c2) throw new Error(c2.message); if (!h$8(i2, true)) { const { message: p2 } = N$5("MISSING_OR_INVALID", `approve() relayProtocol: ${i2}`); throw new Error(p2); } w$9(n2) || this.validateSessionProps(n2, "sessionProperties"); }, this.isValidReject = async (e2) => { if (!Ht$2(e2)) { const { message: i2 } = N$5("MISSING_OR_INVALID", `reject() params: ${e2}`); throw new Error(i2); } const { id: s2, reason: t2 } = e2; if (await this.isValidProposalId(s2), !qt$2(t2)) { const { message: i2 } = N$5("MISSING_OR_INVALID", `reject() reason: ${JSON.stringify(t2)}`); throw new Error(i2); } }, this.isValidSessionSettleRequest = (e2) => { if (!Ht$2(e2)) { const { message: c2 } = N$5("MISSING_OR_INVALID", `onSessionSettleRequest() params: ${e2}`); throw new Error(c2); } const { relay: s2, controller: t2, namespaces: i2, expiry: n2 } = e2; if (!dn(s2)) { const { message: c2 } = N$5("MISSING_OR_INVALID", "onSessionSettleRequest() relay protocol should be a string"); throw new Error(c2); } const o2 = Kt$2(t2, "onSessionSettleRequest()"); if (o2) throw new Error(o2.message); const a2 = ln(i2, "onSessionSettleRequest()"); if (a2) throw new Error(a2.message); if (mt$2(n2)) { const { message: c2 } = N$5("EXPIRED", "onSessionSettleRequest()"); throw new Error(c2); } }, this.isValidUpdate = async (e2) => { if (!Ht$2(e2)) { const { message: a2 } = N$5("MISSING_OR_INVALID", `update() params: ${e2}`); throw new Error(a2); } const { topic: s2, namespaces: t2 } = e2; await this.isValidSessionTopic(s2); const i2 = this.client.session.get(s2), n2 = ln(t2, "update()"); if (n2) throw new Error(n2.message); const o2 = fn(i2.requiredNamespaces, t2, "update()"); if (o2) throw new Error(o2.message); }, this.isValidExtend = async (e2) => { if (!Ht$2(e2)) { const { message: t2 } = N$5("MISSING_OR_INVALID", `extend() params: ${e2}`); throw new Error(t2); } const { topic: s2 } = e2; await this.isValidSessionTopic(s2); }, this.isValidRequest = async (e2) => { if (!Ht$2(e2)) { const { message: a2 } = N$5("MISSING_OR_INVALID", `request() params: ${e2}`); throw new Error(a2); } const { topic: s2, request: t2, chainId: i2, expiry: n2 } = e2; await this.isValidSessionTopic(s2); const { namespaces: o2 } = this.client.session.get(s2); if (!zt$2(o2, i2)) { const { message: a2 } = N$5("MISSING_OR_INVALID", `request() chainId: ${i2}`); throw new Error(a2); } if (!Bt$2(t2)) { const { message: a2 } = N$5("MISSING_OR_INVALID", `request() ${JSON.stringify(t2)}`); throw new Error(a2); } if (!Yt$2(o2, i2, t2.method)) { const { message: a2 } = N$5("MISSING_OR_INVALID", `request() method: ${t2.method}`); throw new Error(a2); } if (n2 && !Xt$1(n2, U$2)) { const { message: a2 } = N$5("MISSING_OR_INVALID", `request() expiry: ${n2}. Expiry must be a number (in seconds) between ${U$2.min} and ${U$2.max}`); throw new Error(a2); } }, this.isValidRespond = async (e2) => { var s2; if (!Ht$2(e2)) { const { message: n2 } = N$5("MISSING_OR_INVALID", `respond() params: ${e2}`); throw new Error(n2); } const { topic: t2, response: i2 } = e2; try { await this.isValidSessionTopic(t2); } catch (n2) { throw (s2 = e2 == null ? void 0 : e2.response) != null && s2.id && this.cleanupAfterResponse(e2), n2; } if (!Gt$2(i2)) { const { message: n2 } = N$5("MISSING_OR_INVALID", `respond() response: ${JSON.stringify(i2)}`); throw new Error(n2); } }, this.isValidPing = async (e2) => { if (!Ht$2(e2)) { const { message: t2 } = N$5("MISSING_OR_INVALID", `ping() params: ${e2}`); throw new Error(t2); } const { topic: s2 } = e2; await this.isValidSessionOrPairingTopic(s2); }, this.isValidEmit = async (e2) => { if (!Ht$2(e2)) { const { message: o2 } = N$5("MISSING_OR_INVALID", `emit() params: ${e2}`); throw new Error(o2); } const { topic: s2, event: t2, chainId: i2 } = e2; await this.isValidSessionTopic(s2); const { namespaces: n2 } = this.client.session.get(s2); if (!zt$2(n2, i2)) { const { message: o2 } = N$5("MISSING_OR_INVALID", `emit() chainId: ${i2}`); throw new Error(o2); } if (!Wt$1(t2)) { const { message: o2 } = N$5("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(t2)}`); throw new Error(o2); } if (!Jt$2(n2, i2, t2.name)) { const { message: o2 } = N$5("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(t2)}`); throw new Error(o2); } }, this.isValidDisconnect = async (e2) => { if (!Ht$2(e2)) { const { message: t2 } = N$5("MISSING_OR_INVALID", `disconnect() params: ${e2}`); throw new Error(t2); } const { topic: s2 } = e2; await this.isValidSessionOrPairingTopic(s2); }, this.getVerifyContext = async (e2, s2) => { const t2 = { verified: { verifyUrl: s2.verifyUrl || $$3, validation: "UNKNOWN", origin: s2.url || "" } }; try { const i2 = await this.client.core.verify.resolve({ attestationId: e2, verifyUrl: s2.verifyUrl }); i2 && (t2.verified.origin = i2.origin, t2.verified.isScam = i2.isScam, t2.verified.validation = i2.origin === new URL(s2.url).origin ? "VALID" : "INVALID"); } catch (i2) { this.client.logger.info(i2); } return this.client.logger.info(`Verify context: ${JSON.stringify(t2)}`), t2; }, this.validateSessionProps = (e2, s2) => { Object.values(e2).forEach((t2) => { if (!h$8(t2, false)) { const { message: i2 } = N$5("MISSING_OR_INVALID", `${s2} must be in Record format. Received: ${JSON.stringify(t2)}`); throw new Error(i2); } }); }; } async isInitialized() { if (!this.initialized) { const { message: r2 } = N$5("NOT_INITIALIZED", this.name); throw new Error(r2); } await this.client.core.relayer.confirmOnlineStateOrThrow(); } registerRelayerEvents() { this.client.core.relayer.on(D$4.message, async (r2) => { const { topic: e2, message: s2 } = r2; if (this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(s2))) return; const t2 = await this.client.core.crypto.decode(e2, s2); try { isJsonRpcRequest(t2) ? (this.client.core.history.set(e2, t2), this.onRelayEventRequest({ topic: e2, payload: t2 })) : isJsonRpcResponse(t2) ? (await this.client.core.history.resolve(t2), await this.onRelayEventResponse({ topic: e2, payload: t2 }), this.client.core.history.delete(e2, t2.id)) : this.onRelayEventUnknownPayload({ topic: e2, payload: t2 }); } catch (i2) { this.client.logger.error(i2); } }); } registerExpirerEvents() { this.client.core.expirer.on(v$4.expired, async (r2) => { const { topic: e2, id: s2 } = ft$5(r2.target); if (s2 && this.client.pendingRequest.keys.includes(s2)) return await this.deletePendingSessionRequest(s2, N$5("EXPIRED"), true); e2 ? this.client.session.keys.includes(e2) && (await this.deleteSession(e2, true), this.client.events.emit("session_expire", { topic: e2 })) : s2 && (await this.deleteProposal(s2, true), this.client.events.emit("proposal_expire", { id: s2 })); }); } registerPairingEvents() { this.client.core.pairing.events.on(V$3.create, (r2) => this.onPairingCreated(r2)); } isValidPairingTopic(r2) { if (!h$8(r2, false)) { const { message: e2 } = N$5("MISSING_OR_INVALID", `pairing topic should be a string: ${r2}`); throw new Error(e2); } if (!this.client.core.pairing.pairings.keys.includes(r2)) { const { message: e2 } = N$5("NO_MATCHING_KEY", `pairing topic doesn't exist: ${r2}`); throw new Error(e2); } if (mt$2(this.client.core.pairing.pairings.get(r2).expiry)) { const { message: e2 } = N$5("EXPIRED", `pairing topic: ${r2}`); throw new Error(e2); } } async isValidSessionTopic(r2) { if (!h$8(r2, false)) { const { message: e2 } = N$5("MISSING_OR_INVALID", `session topic should be a string: ${r2}`); throw new Error(e2); } if (!this.client.session.keys.includes(r2)) { const { message: e2 } = N$5("NO_MATCHING_KEY", `session topic doesn't exist: ${r2}`); throw new Error(e2); } if (mt$2(this.client.session.get(r2).expiry)) { await this.deleteSession(r2); const { message: e2 } = N$5("EXPIRED", `session topic: ${r2}`); throw new Error(e2); } } async isValidSessionOrPairingTopic(r2) { if (this.client.session.keys.includes(r2)) await this.isValidSessionTopic(r2); else if (this.client.core.pairing.pairings.keys.includes(r2)) this.isValidPairingTopic(r2); else if (h$8(r2, false)) { const { message: e2 } = N$5("NO_MATCHING_KEY", `session or pairing topic doesn't exist: ${r2}`); throw new Error(e2); } else { const { message: e2 } = N$5("MISSING_OR_INVALID", `session or pairing topic should be a string: ${r2}`); throw new Error(e2); } } async isValidProposalId(r2) { if (!Ft$2(r2)) { const { message: e2 } = N$5("MISSING_OR_INVALID", `proposal id should be a number: ${r2}`); throw new Error(e2); } if (!this.client.proposal.keys.includes(r2)) { const { message: e2 } = N$5("NO_MATCHING_KEY", `proposal id doesn't exist: ${r2}`); throw new Error(e2); } if (mt$2(this.client.proposal.get(r2).expiry)) { await this.deleteProposal(r2); const { message: e2 } = N$5("EXPIRED", `proposal id: ${r2}`); throw new Error(e2); } } } class us extends Kt$1 { constructor(r2, e2) { super(r2, e2, ne$2, G$3), this.core = r2, this.logger = e2; } } let ue$1 = class ue extends Kt$1 { constructor(r2, e2) { super(r2, e2, ae$1, G$3), this.core = r2, this.logger = e2; } }; class gs extends Kt$1 { constructor(r2, e2) { super(r2, e2, le$1, G$3, (s2) => s2.id), this.core = r2, this.logger = e2; } } let Q$3 = class Q2 extends b$3 { constructor(r2) { super(r2), this.protocol = X$1, this.version = F$2, this.name = M$3.name, this.events = new eventsExports.EventEmitter(), this.on = (s2, t2) => this.events.on(s2, t2), this.once = (s2, t2) => this.events.once(s2, t2), this.off = (s2, t2) => this.events.off(s2, t2), this.removeListener = (s2, t2) => this.events.removeListener(s2, t2), this.removeAllListeners = (s2) => this.events.removeAllListeners(s2), this.connect = async (s2) => { try { return await this.engine.connect(s2); } catch (t2) { throw this.logger.error(t2.message), t2; } }, this.pair = async (s2) => { try { return await this.engine.pair(s2); } catch (t2) { throw this.logger.error(t2.message), t2; } }, this.approve = async (s2) => { try { return await this.engine.approve(s2); } catch (t2) { throw this.logger.error(t2.message), t2; } }, this.reject = async (s2) => { try { return await this.engine.reject(s2); } catch (t2) { throw this.logger.error(t2.message), t2; } }, this.update = async (s2) => { try { return await this.engine.update(s2); } catch (t2) { throw this.logger.error(t2.message), t2; } }, this.extend = async (s2) => { try { return await this.engine.extend(s2); } catch (t2) { throw this.logger.error(t2.message), t2; } }, this.request = async (s2) => { try { return await this.engine.request(s2); } catch (t2) { throw this.logger.error(t2.message), t2; } }, this.respond = async (s2) => { try { return await this.engine.respond(s2); } catch (t2) { throw this.logger.error(t2.message), t2; } }, this.ping = async (s2) => { try { return await this.engine.ping(s2); } catch (t2) { throw this.logger.error(t2.message), t2; } }, this.emit = async (s2) => { try { return await this.engine.emit(s2); } catch (t2) { throw this.logger.error(t2.message), t2; } }, this.disconnect = async (s2) => { try { return await this.engine.disconnect(s2); } catch (t2) { throw this.logger.error(t2.message), t2; } }, this.find = (s2) => { try { return this.engine.find(s2); } catch (t2) { throw this.logger.error(t2.message), t2; } }, this.getPendingSessionRequests = () => { try { return this.engine.getPendingSessionRequests(); } catch (s2) { throw this.logger.error(s2.message), s2; } }, this.name = (r2 == null ? void 0 : r2.name) || M$3.name, this.metadata = (r2 == null ? void 0 : r2.metadata) || Qn(); const e2 = typeof (r2 == null ? void 0 : r2.logger) < "u" && typeof (r2 == null ? void 0 : r2.logger) != "string" ? r2.logger : Dg(k$2({ level: (r2 == null ? void 0 : r2.logger) || M$3.logger })); this.core = (r2 == null ? void 0 : r2.core) || new Mr(r2), this.logger = E$5(e2, this.name), this.session = new ue$1(this.core, this.logger), this.proposal = new us(this.core, this.logger), this.pendingRequest = new gs(this.core, this.logger), this.engine = new ds(this); } static async init(r2) { const e2 = new Q2(r2); return await e2.initialize(), e2; } get context() { return y$4(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.engine.init(), this.core.verify.init({ verifyUrl: this.metadata.verifyUrl }), this.logger.info("SignClient Initialization Success"); } catch (r2) { throw this.logger.info("SignClient Initialization Failure"), this.logger.error(r2.message), r2; } } }; var browserPonyfill = { exports: {} }; (function(module2, exports3) { var global2 = typeof self !== "undefined" ? self : commonjsGlobal; var __self__ = function() { function F2() { this.fetch = false; this.DOMException = global2.DOMException; } F2.prototype = global2; return new F2(); }(); (function(self2) { (function(exports4) { var support = { searchParams: "URLSearchParams" in self2, iterable: "Symbol" in self2 && "iterator" in Symbol, blob: "FileReader" in self2 && "Blob" in self2 && function() { try { new Blob(); return true; } catch (e2) { return false; } }(), formData: "FormData" in self2, arrayBuffer: "ArrayBuffer" in self2 }; function isDataView(obj) { return obj && DataView.prototype.isPrototypeOf(obj); } if (support.arrayBuffer) { var viewClasses = [ "[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]" ]; var isArrayBufferView = ArrayBuffer.isView || function(obj) { return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1; }; } function normalizeName(name2) { if (typeof name2 !== "string") { name2 = String(name2); } if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name2)) { throw new TypeError("Invalid character in header field name"); } return name2.toLowerCase(); } function normalizeValue(value) { if (typeof value !== "string") { value = String(value); } return value; } function iteratorFor(items) { var iterator = { next: function() { var value = items.shift(); return { done: value === void 0, value }; } }; if (support.iterable) { iterator[Symbol.iterator] = function() { return iterator; }; } return iterator; } function Headers2(headers) { this.map = {}; if (headers instanceof Headers2) { headers.forEach(function(value, name2) { this.append(name2, value); }, this); } else if (Array.isArray(headers)) { headers.forEach(function(header) { this.append(header[0], header[1]); }, this); } else if (headers) { Object.getOwnPropertyNames(headers).forEach(function(name2) { this.append(name2, headers[name2]); }, this); } } Headers2.prototype.append = function(name2, value) { name2 = normalizeName(name2); value = normalizeValue(value); var oldValue = this.map[name2]; this.map[name2] = oldValue ? oldValue + ", " + value : value; }; Headers2.prototype["delete"] = function(name2) { delete this.map[normalizeName(name2)]; }; Headers2.prototype.get = function(name2) { name2 = normalizeName(name2); return this.has(name2) ? this.map[name2] : null; }; Headers2.prototype.has = function(name2) { return this.map.hasOwnProperty(normalizeName(name2)); }; Headers2.prototype.set = function(name2, value) { this.map[normalizeName(name2)] = normalizeValue(value); }; Headers2.prototype.forEach = function(callback, thisArg) { for (var name2 in this.map) { if (this.map.hasOwnProperty(name2)) { callback.call(thisArg, this.map[name2], name2, this); } } }; Headers2.prototype.keys = function() { var items = []; this.forEach(function(value, name2) { items.push(name2); }); return iteratorFor(items); }; Headers2.prototype.values = function() { var items = []; this.forEach(function(value) { items.push(value); }); return iteratorFor(items); }; Headers2.prototype.entries = function() { var items = []; this.forEach(function(value, name2) { items.push([name2, value]); }); return iteratorFor(items); }; if (support.iterable) { Headers2.prototype[Symbol.iterator] = Headers2.prototype.entries; } function consumed(body) { if (body.bodyUsed) { return Promise.reject(new TypeError("Already read")); } body.bodyUsed = true; } function fileReaderReady(reader) { return new Promise(function(resolve, reject) { reader.onload = function() { resolve(reader.result); }; reader.onerror = function() { reject(reader.error); }; }); } function readBlobAsArrayBuffer(blob) { var reader = new FileReader(); var promise = fileReaderReady(reader); reader.readAsArrayBuffer(blob); return promise; } function readBlobAsText(blob) { var reader = new FileReader(); var promise = fileReaderReady(reader); reader.readAsText(blob); return promise; } function readArrayBufferAsText(buf) { var view = new Uint8Array(buf); var chars = new Array(view.length); for (var i2 = 0; i2 < view.length; i2++) { chars[i2] = String.fromCharCode(view[i2]); } return chars.join(""); } function bufferClone(buf) { if (buf.slice) { return buf.slice(0); } else { var view = new Uint8Array(buf.byteLength); view.set(new Uint8Array(buf)); return view.buffer; } } function Body() { this.bodyUsed = false; this._initBody = function(body) { this._bodyInit = body; if (!body) { this._bodyText = ""; } else if (typeof body === "string") { this._bodyText = body; } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { this._bodyBlob = body; } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { this._bodyFormData = body; } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { this._bodyText = body.toString(); } else if (support.arrayBuffer && support.blob && isDataView(body)) { this._bodyArrayBuffer = bufferClone(body.buffer); this._bodyInit = new Blob([this._bodyArrayBuffer]); } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { this._bodyArrayBuffer = bufferClone(body); } else { this._bodyText = body = Object.prototype.toString.call(body); } if (!this.headers.get("content-type")) { if (typeof body === "string") { this.headers.set("content-type", "text/plain;charset=UTF-8"); } else if (this._bodyBlob && this._bodyBlob.type) { this.headers.set("content-type", this._bodyBlob.type); } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"); } } }; if (support.blob) { this.blob = function() { var rejected = consumed(this); if (rejected) { return rejected; } if (this._bodyBlob) { return Promise.resolve(this._bodyBlob); } else if (this._bodyArrayBuffer) { return Promise.resolve(new Blob([this._bodyArrayBuffer])); } else if (this._bodyFormData) { throw new Error("could not read FormData body as blob"); } else { return Promise.resolve(new Blob([this._bodyText])); } }; this.arrayBuffer = function() { if (this._bodyArrayBuffer) { return consumed(this) || Promise.resolve(this._bodyArrayBuffer); } else { return this.blob().then(readBlobAsArrayBuffer); } }; } this.text = function() { var rejected = consumed(this); if (rejected) { return rejected; } if (this._bodyBlob) { return readBlobAsText(this._bodyBlob); } else if (this._bodyArrayBuffer) { return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)); } else if (this._bodyFormData) { throw new Error("could not read FormData body as text"); } else { return Promise.resolve(this._bodyText); } }; if (support.formData) { this.formData = function() { return this.text().then(decode2); }; } this.json = function() { return this.text().then(JSON.parse); }; return this; } var methods = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"]; function normalizeMethod(method) { var upcased = method.toUpperCase(); return methods.indexOf(upcased) > -1 ? upcased : method; } function Request(input, options) { options = options || {}; var body = options.body; if (input instanceof Request) { if (input.bodyUsed) { throw new TypeError("Already read"); } this.url = input.url; this.credentials = input.credentials; if (!options.headers) { this.headers = new Headers2(input.headers); } this.method = input.method; this.mode = input.mode; this.signal = input.signal; if (!body && input._bodyInit != null) { body = input._bodyInit; input.bodyUsed = true; } } else { this.url = String(input); } this.credentials = options.credentials || this.credentials || "same-origin"; if (options.headers || !this.headers) { this.headers = new Headers2(options.headers); } this.method = normalizeMethod(options.method || this.method || "GET"); this.mode = options.mode || this.mode || null; this.signal = options.signal || this.signal; this.referrer = null; if ((this.method === "GET" || this.method === "HEAD") && body) { throw new TypeError("Body not allowed for GET or HEAD requests"); } this._initBody(body); } Request.prototype.clone = function() { return new Request(this, { body: this._bodyInit }); }; function decode2(body) { var form = new FormData(); body.trim().split("&").forEach(function(bytes2) { if (bytes2) { var split2 = bytes2.split("="); var name2 = split2.shift().replace(/\+/g, " "); var value = split2.join("=").replace(/\+/g, " "); form.append(decodeURIComponent(name2), decodeURIComponent(value)); } }); return form; } function parseHeaders(rawHeaders) { var headers = new Headers2(); var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " "); preProcessedHeaders.split(/\r?\n/).forEach(function(line) { var parts = line.split(":"); var key = parts.shift().trim(); if (key) { var value = parts.join(":").trim(); headers.append(key, value); } }); return headers; } Body.call(Request.prototype); function Response(bodyInit, options) { if (!options) { options = {}; } this.type = "default"; this.status = options.status === void 0 ? 200 : options.status; this.ok = this.status >= 200 && this.status < 300; this.statusText = "statusText" in options ? options.statusText : "OK"; this.headers = new Headers2(options.headers); this.url = options.url || ""; this._initBody(bodyInit); } Body.call(Response.prototype); Response.prototype.clone = function() { return new Response(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new Headers2(this.headers), url: this.url }); }; Response.error = function() { var response = new Response(null, { status: 0, statusText: "" }); response.type = "error"; return response; }; var redirectStatuses = [301, 302, 303, 307, 308]; Response.redirect = function(url, status) { if (redirectStatuses.indexOf(status) === -1) { throw new RangeError("Invalid status code"); } return new Response(null, { status, headers: { location: url } }); }; exports4.DOMException = self2.DOMException; try { new exports4.DOMException(); } catch (err) { exports4.DOMException = function(message, name2) { this.message = message; this.name = name2; var error2 = Error(message); this.stack = error2.stack; }; exports4.DOMException.prototype = Object.create(Error.prototype); exports4.DOMException.prototype.constructor = exports4.DOMException; } function fetch2(input, init2) { return new Promise(function(resolve, reject) { var request = new Request(input, init2); if (request.signal && request.signal.aborted) { return reject(new exports4.DOMException("Aborted", "AbortError")); } var xhr = new XMLHttpRequest(); function abortXhr() { xhr.abort(); } xhr.onload = function() { var options = { status: xhr.status, statusText: xhr.statusText, headers: parseHeaders(xhr.getAllResponseHeaders() || "") }; options.url = "responseURL" in xhr ? xhr.responseURL : options.headers.get("X-Request-URL"); var body = "response" in xhr ? xhr.response : xhr.responseText; resolve(new Response(body, options)); }; xhr.onerror = function() { reject(new TypeError("Network request failed")); }; xhr.ontimeout = function() { reject(new TypeError("Network request failed")); }; xhr.onabort = function() { reject(new exports4.DOMException("Aborted", "AbortError")); }; xhr.open(request.method, request.url, true); if (request.credentials === "include") { xhr.withCredentials = true; } else if (request.credentials === "omit") { xhr.withCredentials = false; } if ("responseType" in xhr && support.blob) { xhr.responseType = "blob"; } request.headers.forEach(function(value, name2) { xhr.setRequestHeader(name2, value); }); if (request.signal) { request.signal.addEventListener("abort", abortXhr); xhr.onreadystatechange = function() { if (xhr.readyState === 4) { request.signal.removeEventListener("abort", abortXhr); } }; } xhr.send(typeof request._bodyInit === "undefined" ? null : request._bodyInit); }); } fetch2.polyfill = true; if (!self2.fetch) { self2.fetch = fetch2; self2.Headers = Headers2; self2.Request = Request; self2.Response = Response; } exports4.Headers = Headers2; exports4.Request = Request; exports4.Response = Response; exports4.fetch = fetch2; Object.defineProperty(exports4, "__esModule", { value: true }); return exports4; })({}); })(__self__); __self__.fetch.ponyfill = true; delete __self__.fetch.polyfill; var ctx = __self__; exports3 = ctx.fetch; exports3.default = ctx.fetch; exports3.fetch = ctx.fetch; exports3.Headers = ctx.Headers; exports3.Request = ctx.Request; exports3.Response = ctx.Response; module2.exports = exports3; })(browserPonyfill, browserPonyfill.exports); var browserPonyfillExports = browserPonyfill.exports; const o$6 = /* @__PURE__ */ getDefaultExportFromCjs(browserPonyfillExports); var P$2 = Object.defineProperty, w$2 = Object.defineProperties, E$3 = Object.getOwnPropertyDescriptors, c$4 = Object.getOwnPropertySymbols, L$4 = Object.prototype.hasOwnProperty, O$2 = Object.prototype.propertyIsEnumerable, l$4 = (r2, t2, e2) => t2 in r2 ? P$2(r2, t2, { enumerable: true, configurable: true, writable: true, value: e2 }) : r2[t2] = e2, p$3 = (r2, t2) => { for (var e2 in t2 || (t2 = {})) L$4.call(t2, e2) && l$4(r2, e2, t2[e2]); if (c$4) for (var e2 of c$4(t2)) O$2.call(t2, e2) && l$4(r2, e2, t2[e2]); return r2; }, v$3 = (r2, t2) => w$2(r2, E$3(t2)); const j$3 = { Accept: "application/json", "Content-Type": "application/json" }, T$3 = "POST", d$4 = { headers: j$3, method: T$3 }, g$3 = 10; let f$2 = class f { constructor(t2, e2 = false) { if (this.url = t2, this.disableProviderPing = e2, this.events = new eventsExports.EventEmitter(), this.isAvailable = false, this.registering = false, !isHttpUrl(t2)) throw new Error(`Provided URL is not compatible with HTTP connection: ${t2}`); this.url = t2, this.disableProviderPing = e2; } get connected() { return this.isAvailable; } get connecting() { return this.registering; } on(t2, e2) { this.events.on(t2, e2); } once(t2, e2) { this.events.once(t2, e2); } off(t2, e2) { this.events.off(t2, e2); } removeListener(t2, e2) { this.events.removeListener(t2, e2); } async open(t2 = this.url) { await this.register(t2); } async close() { if (!this.isAvailable) throw new Error("Connection already closed"); this.onClose(); } async send(t2) { this.isAvailable || await this.register(); try { const e2 = safeJsonStringify(t2), s2 = await (await o$6(this.url, v$3(p$3({}, d$4), { body: e2 }))).json(); this.onPayload({ data: s2 }); } catch (e2) { this.onError(t2.id, e2); } } async register(t2 = this.url) { if (!isHttpUrl(t2)) throw new Error(`Provided URL is not compatible with HTTP connection: ${t2}`); if (this.registering) { const e2 = this.events.getMaxListeners(); return (this.events.listenerCount("register_error") >= e2 || this.events.listenerCount("open") >= e2) && this.events.setMaxListeners(e2 + 1), new Promise((s2, i2) => { this.events.once("register_error", (n2) => { this.resetMaxListeners(), i2(n2); }), this.events.once("open", () => { if (this.resetMaxListeners(), typeof this.isAvailable > "u") return i2(new Error("HTTP connection is missing or invalid")); s2(); }); }); } this.url = t2, this.registering = true; try { if (!this.disableProviderPing) { const e2 = safeJsonStringify({ id: 1, jsonrpc: "2.0", method: "test", params: [] }); await o$6(t2, v$3(p$3({}, d$4), { body: e2 })); } this.onOpen(); } catch (e2) { const s2 = this.parseError(e2); throw this.events.emit("register_error", s2), this.onClose(), s2; } } onOpen() { this.isAvailable = true, this.registering = false, this.events.emit("open"); } onClose() { this.isAvailable = false, this.registering = false, this.events.emit("close"); } onPayload(t2) { if (typeof t2.data > "u") return; const e2 = typeof t2.data == "string" ? safeJsonParse(t2.data) : t2.data; this.events.emit("payload", e2); } onError(t2, e2) { const s2 = this.parseError(e2), i2 = s2.message || s2.toString(), n2 = formatJsonRpcError(t2, i2); this.events.emit("payload", n2); } parseError(t2, e2 = this.url) { return parseConnectionError(t2, e2, "HTTP"); } resetMaxListeners() { this.events.getMaxListeners() > g$3 && this.events.setMaxListeners(g$3); } }; const Ia = "error", Wg = "wss://relay.walletconnect.com", Fg = "wc", Mg = "universal_provider", xa = `${Fg}@2:${Mg}:`, qg = "https://rpc.walletconnect.com/v1/", Vn = { DEFAULT_CHAIN_CHANGED: "default_chain_changed" }; var ge = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Ui = { exports: {} }; /** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ (function(C2, u2) { (function() { var i2, d2 = "4.17.21", P2 = 200, O2 = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", $2 = "Expected a function", En = "Invalid `variable` option passed into `_.template`", zt2 = "__lodash_hash_undefined__", pr2 = 500, It2 = "__lodash_placeholder__", Ln2 = 1, Fn2 = 2, xt2 = 4, Et2 = 1, ve2 = 2, vn2 = 1, ct2 = 2, qi = 4, Dn2 = 8, yt2 = 16, Hn2 = 32, St2 = 64, Mn2 = 128, Kt2 = 256, dr2 = 512, La = 30, Da = "...", Ha = 800, Na = 16, Bi = 1, $a = 2, Ua = 3, ht2 = 1 / 0, kn2 = 9007199254740991, Wa = 17976931348623157e292, _e2 = 0 / 0, Nn = 4294967295, Fa = Nn - 1, Ma = Nn >>> 1, qa = [["ary", Mn2], ["bind", vn2], ["bindKey", ct2], ["curry", Dn2], ["curryRight", yt2], ["flip", dr2], ["partial", Hn2], ["partialRight", St2], ["rearg", Kt2]], Ot2 = "[object Arguments]", me2 = "[object Array]", Ba = "[object AsyncFunction]", Yt2 = "[object Boolean]", Zt2 = "[object Date]", Ga = "[object DOMException]", we2 = "[object Error]", Pe2 = "[object Function]", Gi2 = "[object GeneratorFunction]", yn2 = "[object Map]", Jt2 = "[object Number]", za = "[object Null]", qn2 = "[object Object]", zi = "[object Promise]", Ka = "[object Proxy]", Xt2 = "[object RegExp]", Sn = "[object Set]", Qt2 = "[object String]", Ae2 = "[object Symbol]", Ya = "[object Undefined]", Vt2 = "[object WeakMap]", Za = "[object WeakSet]", kt2 = "[object ArrayBuffer]", Rt2 = "[object DataView]", gr2 = "[object Float32Array]", vr2 = "[object Float64Array]", _r2 = "[object Int8Array]", mr2 = "[object Int16Array]", wr = "[object Int32Array]", Pr2 = "[object Uint8Array]", Ar2 = "[object Uint8ClampedArray]", Cr2 = "[object Uint16Array]", Ir2 = "[object Uint32Array]", Ja = /\b__p \+= '';/g, Xa = /\b(__p \+=) '' \+/g, Qa = /(__e\(.*?\)|\b__t\)) \+\n'';/g, Ki = /&(?:amp|lt|gt|quot|#39);/g, Yi2 = /[&<>"']/g, Va = RegExp(Ki.source), ka = RegExp(Yi2.source), ja = /<%-([\s\S]+?)%>/g, no2 = /<%([\s\S]+?)%>/g, Zi2 = /<%=([\s\S]+?)%>/g, to2 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, eo2 = /^\w*$/, ro2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, xr2 = /[\\^$.*+?()[\]{}|]/g, io2 = RegExp(xr2.source), Er = /^\s+/, so2 = /\s/, uo2 = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, ao2 = /\{\n\/\* \[wrapped with (.+)\] \*/, oo2 = /,? & /, fo2 = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, co2 = /[()=,{}\[\]\/\s]/, ho2 = /\\(\\)?/g, lo2 = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Ji2 = /\w*$/, po2 = /^[-+]0x[0-9a-f]+$/i, go2 = /^0b[01]+$/i, vo2 = /^\[object .+?Constructor\]$/, _o2 = /^0o[0-7]+$/i, mo2 = /^(?:0|[1-9]\d*)$/, wo2 = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Ce2 = /($^)/, Po2 = /['\n\r\u2028\u2029\\]/g, Ie2 = "\\ud800-\\udfff", Ao2 = "\\u0300-\\u036f", Co2 = "\\ufe20-\\ufe2f", Io2 = "\\u20d0-\\u20ff", Xi2 = Ao2 + Co2 + Io2, Qi2 = "\\u2700-\\u27bf", Vi = "a-z\\xdf-\\xf6\\xf8-\\xff", xo2 = "\\xac\\xb1\\xd7\\xf7", Eo2 = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", yo2 = "\\u2000-\\u206f", So2 = " \\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", ki = "A-Z\\xc0-\\xd6\\xd8-\\xde", ji = "\\ufe0e\\ufe0f", ns2 = xo2 + Eo2 + yo2 + So2, yr2 = "['’]", Oo2 = "[" + Ie2 + "]", ts2 = "[" + ns2 + "]", xe2 = "[" + Xi2 + "]", es2 = "\\d+", Ro2 = "[" + Qi2 + "]", rs2 = "[" + Vi + "]", is2 = "[^" + Ie2 + ns2 + es2 + Qi2 + Vi + ki + "]", Sr2 = "\\ud83c[\\udffb-\\udfff]", bo2 = "(?:" + xe2 + "|" + Sr2 + ")", ss2 = "[^" + Ie2 + "]", Or2 = "(?:\\ud83c[\\udde6-\\uddff]){2}", Rr2 = "[\\ud800-\\udbff][\\udc00-\\udfff]", bt2 = "[" + ki + "]", us2 = "\\u200d", as2 = "(?:" + rs2 + "|" + is2 + ")", To2 = "(?:" + bt2 + "|" + is2 + ")", os2 = "(?:" + yr2 + "(?:d|ll|m|re|s|t|ve))?", fs2 = "(?:" + yr2 + "(?:D|LL|M|RE|S|T|VE))?", cs2 = bo2 + "?", hs2 = "[" + ji + "]?", Lo2 = "(?:" + us2 + "(?:" + [ss2, Or2, Rr2].join("|") + ")" + hs2 + cs2 + ")*", Do2 = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", Ho2 = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", ls2 = hs2 + cs2 + Lo2, No2 = "(?:" + [Ro2, Or2, Rr2].join("|") + ")" + ls2, $o2 = "(?:" + [ss2 + xe2 + "?", xe2, Or2, Rr2, Oo2].join("|") + ")", Uo2 = RegExp(yr2, "g"), Wo2 = RegExp(xe2, "g"), br = RegExp(Sr2 + "(?=" + Sr2 + ")|" + $o2 + ls2, "g"), Fo2 = RegExp([bt2 + "?" + rs2 + "+" + os2 + "(?=" + [ts2, bt2, "$"].join("|") + ")", To2 + "+" + fs2 + "(?=" + [ts2, bt2 + as2, "$"].join("|") + ")", bt2 + "?" + as2 + "+" + os2, bt2 + "+" + fs2, Ho2, Do2, es2, No2].join("|"), "g"), Mo2 = RegExp("[" + us2 + Ie2 + Xi2 + ji + "]"), qo2 = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, Bo2 = ["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"], Go2 = -1, B2 = {}; B2[gr2] = B2[vr2] = B2[_r2] = B2[mr2] = B2[wr] = B2[Pr2] = B2[Ar2] = B2[Cr2] = B2[Ir2] = true, B2[Ot2] = B2[me2] = B2[kt2] = B2[Yt2] = B2[Rt2] = B2[Zt2] = B2[we2] = B2[Pe2] = B2[yn2] = B2[Jt2] = B2[qn2] = B2[Xt2] = B2[Sn] = B2[Qt2] = B2[Vt2] = false; var q2 = {}; q2[Ot2] = q2[me2] = q2[kt2] = q2[Rt2] = q2[Yt2] = q2[Zt2] = q2[gr2] = q2[vr2] = q2[_r2] = q2[mr2] = q2[wr] = q2[yn2] = q2[Jt2] = q2[qn2] = q2[Xt2] = q2[Sn] = q2[Qt2] = q2[Ae2] = q2[Pr2] = q2[Ar2] = q2[Cr2] = q2[Ir2] = true, q2[we2] = q2[Pe2] = q2[Vt2] = false; var zo2 = { À: "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", ij: "ij", Œ: "Oe", œ: "oe", ʼn: "'n", ſ: "s" }, Ko2 = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Yo2 = { "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }, Zo2 = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }, Jo2 = parseFloat, Xo2 = parseInt, ps2 = typeof ge == "object" && ge && ge.Object === Object && ge, Qo2 = typeof self == "object" && self && self.Object === Object && self, k2 = ps2 || Qo2 || Function("return this")(), Tr2 = u2 && !u2.nodeType && u2, lt2 = Tr2 && true && C2 && !C2.nodeType && C2, ds2 = lt2 && lt2.exports === Tr2, Lr2 = ds2 && ps2.process, _n = function() { try { var h2 = lt2 && lt2.require && lt2.require("util").types; return h2 || Lr2 && Lr2.binding && Lr2.binding("util"); } catch { } }(), gs2 = _n && _n.isArrayBuffer, vs2 = _n && _n.isDate, _s2 = _n && _n.isMap, ms2 = _n && _n.isRegExp, ws2 = _n && _n.isSet, Ps2 = _n && _n.isTypedArray; function cn2(h2, g2, p2) { switch (p2.length) { case 0: return h2.call(g2); case 1: return h2.call(g2, p2[0]); case 2: return h2.call(g2, p2[0], p2[1]); case 3: return h2.call(g2, p2[0], p2[1], p2[2]); } return h2.apply(g2, p2); } function Vo2(h2, g2, p2, A2) { for (var S2 = -1, U2 = h2 == null ? 0 : h2.length; ++S2 < U2; ) { var X2 = h2[S2]; g2(A2, X2, p2(X2), h2); } return A2; } function mn2(h2, g2) { for (var p2 = -1, A2 = h2 == null ? 0 : h2.length; ++p2 < A2 && g2(h2[p2], p2, h2) !== false; ) ; return h2; } function ko2(h2, g2) { for (var p2 = h2 == null ? 0 : h2.length; p2-- && g2(h2[p2], p2, h2) !== false; ) ; return h2; } function As2(h2, g2) { for (var p2 = -1, A2 = h2 == null ? 0 : h2.length; ++p2 < A2; ) if (!g2(h2[p2], p2, h2)) return false; return true; } function jn(h2, g2) { for (var p2 = -1, A2 = h2 == null ? 0 : h2.length, S2 = 0, U2 = []; ++p2 < A2; ) { var X2 = h2[p2]; g2(X2, p2, h2) && (U2[S2++] = X2); } return U2; } function Ee2(h2, g2) { var p2 = h2 == null ? 0 : h2.length; return !!p2 && Tt2(h2, g2, 0) > -1; } function Dr2(h2, g2, p2) { for (var A2 = -1, S2 = h2 == null ? 0 : h2.length; ++A2 < S2; ) if (p2(g2, h2[A2])) return true; return false; } function G2(h2, g2) { for (var p2 = -1, A2 = h2 == null ? 0 : h2.length, S2 = Array(A2); ++p2 < A2; ) S2[p2] = g2(h2[p2], p2, h2); return S2; } function nt2(h2, g2) { for (var p2 = -1, A2 = g2.length, S2 = h2.length; ++p2 < A2; ) h2[S2 + p2] = g2[p2]; return h2; } function Hr(h2, g2, p2, A2) { var S2 = -1, U2 = h2 == null ? 0 : h2.length; for (A2 && U2 && (p2 = h2[++S2]); ++S2 < U2; ) p2 = g2(p2, h2[S2], S2, h2); return p2; } function jo2(h2, g2, p2, A2) { var S2 = h2 == null ? 0 : h2.length; for (A2 && S2 && (p2 = h2[--S2]); S2--; ) p2 = g2(p2, h2[S2], S2, h2); return p2; } function Nr2(h2, g2) { for (var p2 = -1, A2 = h2 == null ? 0 : h2.length; ++p2 < A2; ) if (g2(h2[p2], p2, h2)) return true; return false; } var nf = $r2("length"); function tf(h2) { return h2.split(""); } function ef(h2) { return h2.match(fo2) || []; } function Cs2(h2, g2, p2) { var A2; return p2(h2, function(S2, U2, X2) { if (g2(S2, U2, X2)) return A2 = U2, false; }), A2; } function ye2(h2, g2, p2, A2) { for (var S2 = h2.length, U2 = p2 + (A2 ? 1 : -1); A2 ? U2-- : ++U2 < S2; ) if (g2(h2[U2], U2, h2)) return U2; return -1; } function Tt2(h2, g2, p2) { return g2 === g2 ? gf(h2, g2, p2) : ye2(h2, Is2, p2); } function rf(h2, g2, p2, A2) { for (var S2 = p2 - 1, U2 = h2.length; ++S2 < U2; ) if (A2(h2[S2], g2)) return S2; return -1; } function Is2(h2) { return h2 !== h2; } function xs2(h2, g2) { var p2 = h2 == null ? 0 : h2.length; return p2 ? Wr(h2, g2) / p2 : _e2; } function $r2(h2) { return function(g2) { return g2 == null ? i2 : g2[h2]; }; } function Ur2(h2) { return function(g2) { return h2 == null ? i2 : h2[g2]; }; } function Es2(h2, g2, p2, A2, S2) { return S2(h2, function(U2, X2, M2) { p2 = A2 ? (A2 = false, U2) : g2(p2, U2, X2, M2); }), p2; } function sf(h2, g2) { var p2 = h2.length; for (h2.sort(g2); p2--; ) h2[p2] = h2[p2].value; return h2; } function Wr(h2, g2) { for (var p2, A2 = -1, S2 = h2.length; ++A2 < S2; ) { var U2 = g2(h2[A2]); U2 !== i2 && (p2 = p2 === i2 ? U2 : p2 + U2); } return p2; } function Fr2(h2, g2) { for (var p2 = -1, A2 = Array(h2); ++p2 < h2; ) A2[p2] = g2(p2); return A2; } function uf(h2, g2) { return G2(g2, function(p2) { return [p2, h2[p2]]; }); } function ys2(h2) { return h2 && h2.slice(0, bs2(h2) + 1).replace(Er, ""); } function hn2(h2) { return function(g2) { return h2(g2); }; } function Mr2(h2, g2) { return G2(g2, function(p2) { return h2[p2]; }); } function jt2(h2, g2) { return h2.has(g2); } function Ss2(h2, g2) { for (var p2 = -1, A2 = h2.length; ++p2 < A2 && Tt2(g2, h2[p2], 0) > -1; ) ; return p2; } function Os2(h2, g2) { for (var p2 = h2.length; p2-- && Tt2(g2, h2[p2], 0) > -1; ) ; return p2; } function af(h2, g2) { for (var p2 = h2.length, A2 = 0; p2--; ) h2[p2] === g2 && ++A2; return A2; } var of = Ur2(zo2), ff = Ur2(Ko2); function cf(h2) { return "\\" + Zo2[h2]; } function hf(h2, g2) { return h2 == null ? i2 : h2[g2]; } function Lt2(h2) { return Mo2.test(h2); } function lf(h2) { return qo2.test(h2); } function pf(h2) { for (var g2, p2 = []; !(g2 = h2.next()).done; ) p2.push(g2.value); return p2; } function qr(h2) { var g2 = -1, p2 = Array(h2.size); return h2.forEach(function(A2, S2) { p2[++g2] = [S2, A2]; }), p2; } function Rs2(h2, g2) { return function(p2) { return h2(g2(p2)); }; } function tt2(h2, g2) { for (var p2 = -1, A2 = h2.length, S2 = 0, U2 = []; ++p2 < A2; ) { var X2 = h2[p2]; (X2 === g2 || X2 === It2) && (h2[p2] = It2, U2[S2++] = p2); } return U2; } function Se(h2) { var g2 = -1, p2 = Array(h2.size); return h2.forEach(function(A2) { p2[++g2] = A2; }), p2; } function df(h2) { var g2 = -1, p2 = Array(h2.size); return h2.forEach(function(A2) { p2[++g2] = [A2, A2]; }), p2; } function gf(h2, g2, p2) { for (var A2 = p2 - 1, S2 = h2.length; ++A2 < S2; ) if (h2[A2] === g2) return A2; return -1; } function vf(h2, g2, p2) { for (var A2 = p2 + 1; A2--; ) if (h2[A2] === g2) return A2; return A2; } function Dt2(h2) { return Lt2(h2) ? mf(h2) : nf(h2); } function On(h2) { return Lt2(h2) ? wf(h2) : tf(h2); } function bs2(h2) { for (var g2 = h2.length; g2-- && so2.test(h2.charAt(g2)); ) ; return g2; } var _f = Ur2(Yo2); function mf(h2) { for (var g2 = br.lastIndex = 0; br.test(h2); ) ++g2; return g2; } function wf(h2) { return h2.match(br) || []; } function Pf(h2) { return h2.match(Fo2) || []; } var Af = function h2(g2) { g2 = g2 == null ? k2 : Ht2.defaults(k2.Object(), g2, Ht2.pick(k2, Bo2)); var p2 = g2.Array, A2 = g2.Date, S2 = g2.Error, U2 = g2.Function, X2 = g2.Math, M2 = g2.Object, Br = g2.RegExp, Cf = g2.String, wn = g2.TypeError, Oe2 = p2.prototype, If = U2.prototype, Nt2 = M2.prototype, Re2 = g2["__core-js_shared__"], be2 = If.toString, F2 = Nt2.hasOwnProperty, xf = 0, Ts2 = function() { var n2 = /[^.]+$/.exec(Re2 && Re2.keys && Re2.keys.IE_PROTO || ""); return n2 ? "Symbol(src)_1." + n2 : ""; }(), Te2 = Nt2.toString, Ef = be2.call(M2), yf = k2._, Sf = Br("^" + be2.call(F2).replace(xr2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), Le2 = ds2 ? g2.Buffer : i2, et2 = g2.Symbol, De2 = g2.Uint8Array, Ls2 = Le2 ? Le2.allocUnsafe : i2, He2 = Rs2(M2.getPrototypeOf, M2), Ds2 = M2.create, Hs2 = Nt2.propertyIsEnumerable, Ne2 = Oe2.splice, Ns2 = et2 ? et2.isConcatSpreadable : i2, ne2 = et2 ? et2.iterator : i2, pt2 = et2 ? et2.toStringTag : i2, $e2 = function() { try { var n2 = mt2(M2, "defineProperty"); return n2({}, "", {}), n2; } catch { } }(), Of = g2.clearTimeout !== k2.clearTimeout && g2.clearTimeout, Rf = A2 && A2.now !== k2.Date.now && A2.now, bf = g2.setTimeout !== k2.setTimeout && g2.setTimeout, Ue2 = X2.ceil, We2 = X2.floor, Gr = M2.getOwnPropertySymbols, Tf = Le2 ? Le2.isBuffer : i2, $s2 = g2.isFinite, Lf = Oe2.join, Df = Rs2(M2.keys, M2), Q2 = X2.max, nn2 = X2.min, Hf = A2.now, Nf = g2.parseInt, Us2 = X2.random, $f = Oe2.reverse, zr2 = mt2(g2, "DataView"), te2 = mt2(g2, "Map"), Kr = mt2(g2, "Promise"), $t2 = mt2(g2, "Set"), ee2 = mt2(g2, "WeakMap"), re2 = mt2(M2, "create"), Fe2 = ee2 && new ee2(), Ut2 = {}, Uf = wt2(zr2), Wf = wt2(te2), Ff = wt2(Kr), Mf = wt2($t2), qf = wt2(ee2), Me2 = et2 ? et2.prototype : i2, ie2 = Me2 ? Me2.valueOf : i2, Ws2 = Me2 ? Me2.toString : i2; function a2(n2) { if (Y2(n2) && !R2(n2) && !(n2 instanceof H2)) { if (n2 instanceof Pn) return n2; if (F2.call(n2, "__wrapped__")) return Fu(n2); } return new Pn(n2); } var Wt2 = function() { function n2() { } return function(t2) { if (!K2(t2)) return {}; if (Ds2) return Ds2(t2); n2.prototype = t2; var e2 = new n2(); return n2.prototype = i2, e2; }; }(); function qe2() { } function Pn(n2, t2) { this.__wrapped__ = n2, this.__actions__ = [], this.__chain__ = !!t2, this.__index__ = 0, this.__values__ = i2; } a2.templateSettings = { escape: ja, evaluate: no2, interpolate: Zi2, variable: "", imports: { _: a2 } }, a2.prototype = qe2.prototype, a2.prototype.constructor = a2, Pn.prototype = Wt2(qe2.prototype), Pn.prototype.constructor = Pn; function H2(n2) { this.__wrapped__ = n2, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = false, this.__iteratees__ = [], this.__takeCount__ = Nn, this.__views__ = []; } function Bf() { var n2 = new H2(this.__wrapped__); return n2.__actions__ = un2(this.__actions__), n2.__dir__ = this.__dir__, n2.__filtered__ = this.__filtered__, n2.__iteratees__ = un2(this.__iteratees__), n2.__takeCount__ = this.__takeCount__, n2.__views__ = un2(this.__views__), n2; } function Gf() { if (this.__filtered__) { var n2 = new H2(this); n2.__dir__ = -1, n2.__filtered__ = true; } else n2 = this.clone(), n2.__dir__ *= -1; return n2; } function zf() { var n2 = this.__wrapped__.value(), t2 = this.__dir__, e2 = R2(n2), r2 = t2 < 0, s2 = e2 ? n2.length : 0, o2 = eh(0, s2, this.__views__), f2 = o2.start, c2 = o2.end, l2 = c2 - f2, v2 = r2 ? c2 : f2 - 1, _2 = this.__iteratees__, m2 = _2.length, w2 = 0, I2 = nn2(l2, this.__takeCount__); if (!e2 || !r2 && s2 == l2 && I2 == l2) return ou(n2, this.__actions__); var E2 = []; n: for (; l2-- && w2 < I2; ) { v2 += t2; for (var T2 = -1, y2 = n2[v2]; ++T2 < m2; ) { var D2 = _2[T2], N2 = D2.iteratee, dn2 = D2.type, sn2 = N2(y2); if (dn2 == $a) y2 = sn2; else if (!sn2) { if (dn2 == Bi) continue n; break n; } } E2[w2++] = y2; } return E2; } H2.prototype = Wt2(qe2.prototype), H2.prototype.constructor = H2; function dt2(n2) { var t2 = -1, e2 = n2 == null ? 0 : n2.length; for (this.clear(); ++t2 < e2; ) { var r2 = n2[t2]; this.set(r2[0], r2[1]); } } function Kf() { this.__data__ = re2 ? re2(null) : {}, this.size = 0; } function Yf(n2) { var t2 = this.has(n2) && delete this.__data__[n2]; return this.size -= t2 ? 1 : 0, t2; } function Zf(n2) { var t2 = this.__data__; if (re2) { var e2 = t2[n2]; return e2 === zt2 ? i2 : e2; } return F2.call(t2, n2) ? t2[n2] : i2; } function Jf(n2) { var t2 = this.__data__; return re2 ? t2[n2] !== i2 : F2.call(t2, n2); } function Xf(n2, t2) { var e2 = this.__data__; return this.size += this.has(n2) ? 0 : 1, e2[n2] = re2 && t2 === i2 ? zt2 : t2, this; } dt2.prototype.clear = Kf, dt2.prototype.delete = Yf, dt2.prototype.get = Zf, dt2.prototype.has = Jf, dt2.prototype.set = Xf; function Bn2(n2) { var t2 = -1, e2 = n2 == null ? 0 : n2.length; for (this.clear(); ++t2 < e2; ) { var r2 = n2[t2]; this.set(r2[0], r2[1]); } } function Qf() { this.__data__ = [], this.size = 0; } function Vf(n2) { var t2 = this.__data__, e2 = Be2(t2, n2); if (e2 < 0) return false; var r2 = t2.length - 1; return e2 == r2 ? t2.pop() : Ne2.call(t2, e2, 1), --this.size, true; } function kf(n2) { var t2 = this.__data__, e2 = Be2(t2, n2); return e2 < 0 ? i2 : t2[e2][1]; } function jf(n2) { return Be2(this.__data__, n2) > -1; } function nc(n2, t2) { var e2 = this.__data__, r2 = Be2(e2, n2); return r2 < 0 ? (++this.size, e2.push([n2, t2])) : e2[r2][1] = t2, this; } Bn2.prototype.clear = Qf, Bn2.prototype.delete = Vf, Bn2.prototype.get = kf, Bn2.prototype.has = jf, Bn2.prototype.set = nc; function Gn2(n2) { var t2 = -1, e2 = n2 == null ? 0 : n2.length; for (this.clear(); ++t2 < e2; ) { var r2 = n2[t2]; this.set(r2[0], r2[1]); } } function tc() { this.size = 0, this.__data__ = { hash: new dt2(), map: new (te2 || Bn2)(), string: new dt2() }; } function ec(n2) { var t2 = nr2(this, n2).delete(n2); return this.size -= t2 ? 1 : 0, t2; } function rc(n2) { return nr2(this, n2).get(n2); } function ic(n2) { return nr2(this, n2).has(n2); } function sc(n2, t2) { var e2 = nr2(this, n2), r2 = e2.size; return e2.set(n2, t2), this.size += e2.size == r2 ? 0 : 1, this; } Gn2.prototype.clear = tc, Gn2.prototype.delete = ec, Gn2.prototype.get = rc, Gn2.prototype.has = ic, Gn2.prototype.set = sc; function gt2(n2) { var t2 = -1, e2 = n2 == null ? 0 : n2.length; for (this.__data__ = new Gn2(); ++t2 < e2; ) this.add(n2[t2]); } function uc(n2) { return this.__data__.set(n2, zt2), this; } function ac(n2) { return this.__data__.has(n2); } gt2.prototype.add = gt2.prototype.push = uc, gt2.prototype.has = ac; function Rn(n2) { var t2 = this.__data__ = new Bn2(n2); this.size = t2.size; } function oc() { this.__data__ = new Bn2(), this.size = 0; } function fc(n2) { var t2 = this.__data__, e2 = t2.delete(n2); return this.size = t2.size, e2; } function cc(n2) { return this.__data__.get(n2); } function hc(n2) { return this.__data__.has(n2); } function lc(n2, t2) { var e2 = this.__data__; if (e2 instanceof Bn2) { var r2 = e2.__data__; if (!te2 || r2.length < P2 - 1) return r2.push([n2, t2]), this.size = ++e2.size, this; e2 = this.__data__ = new Gn2(r2); } return e2.set(n2, t2), this.size = e2.size, this; } Rn.prototype.clear = oc, Rn.prototype.delete = fc, Rn.prototype.get = cc, Rn.prototype.has = hc, Rn.prototype.set = lc; function Fs2(n2, t2) { var e2 = R2(n2), r2 = !e2 && Pt2(n2), s2 = !e2 && !r2 && at2(n2), o2 = !e2 && !r2 && !s2 && Bt2(n2), f2 = e2 || r2 || s2 || o2, c2 = f2 ? Fr2(n2.length, Cf) : [], l2 = c2.length; for (var v2 in n2) (t2 || F2.call(n2, v2)) && !(f2 && (v2 == "length" || s2 && (v2 == "offset" || v2 == "parent") || o2 && (v2 == "buffer" || v2 == "byteLength" || v2 == "byteOffset") || Zn(v2, l2))) && c2.push(v2); return c2; } function Ms2(n2) { var t2 = n2.length; return t2 ? n2[ei(0, t2 - 1)] : i2; } function pc(n2, t2) { return tr2(un2(n2), vt2(t2, 0, n2.length)); } function dc(n2) { return tr2(un2(n2)); } function Yr(n2, t2, e2) { (e2 !== i2 && !bn2(n2[t2], e2) || e2 === i2 && !(t2 in n2)) && zn(n2, t2, e2); } function se2(n2, t2, e2) { var r2 = n2[t2]; (!(F2.call(n2, t2) && bn2(r2, e2)) || e2 === i2 && !(t2 in n2)) && zn(n2, t2, e2); } function Be2(n2, t2) { for (var e2 = n2.length; e2--; ) if (bn2(n2[e2][0], t2)) return e2; return -1; } function gc(n2, t2, e2, r2) { return rt2(n2, function(s2, o2, f2) { t2(r2, s2, e2(s2), f2); }), r2; } function qs2(n2, t2) { return n2 && Un2(t2, V2(t2), n2); } function vc(n2, t2) { return n2 && Un2(t2, on2(t2), n2); } function zn(n2, t2, e2) { t2 == "__proto__" && $e2 ? $e2(n2, t2, { configurable: true, enumerable: true, value: e2, writable: true }) : n2[t2] = e2; } function Zr(n2, t2) { for (var e2 = -1, r2 = t2.length, s2 = p2(r2), o2 = n2 == null; ++e2 < r2; ) s2[e2] = o2 ? i2 : Si(n2, t2[e2]); return s2; } function vt2(n2, t2, e2) { return n2 === n2 && (e2 !== i2 && (n2 = n2 <= e2 ? n2 : e2), t2 !== i2 && (n2 = n2 >= t2 ? n2 : t2)), n2; } function An(n2, t2, e2, r2, s2, o2) { var f2, c2 = t2 & Ln2, l2 = t2 & Fn2, v2 = t2 & xt2; if (e2 && (f2 = s2 ? e2(n2, r2, s2, o2) : e2(n2)), f2 !== i2) return f2; if (!K2(n2)) return n2; var _2 = R2(n2); if (_2) { if (f2 = ih(n2), !c2) return un2(n2, f2); } else { var m2 = tn2(n2), w2 = m2 == Pe2 || m2 == Gi2; if (at2(n2)) return hu(n2, c2); if (m2 == qn2 || m2 == Ot2 || w2 && !s2) { if (f2 = l2 || w2 ? {} : bu(n2), !c2) return l2 ? Zc(n2, vc(f2, n2)) : Yc(n2, qs2(f2, n2)); } else { if (!q2[m2]) return s2 ? n2 : {}; f2 = sh(n2, m2, c2); } } o2 || (o2 = new Rn()); var I2 = o2.get(n2); if (I2) return I2; o2.set(n2, f2), sa(n2) ? n2.forEach(function(y2) { f2.add(An(y2, t2, e2, y2, n2, o2)); }) : ra(n2) && n2.forEach(function(y2, D2) { f2.set(D2, An(y2, t2, e2, D2, n2, o2)); }); var E2 = v2 ? l2 ? pi : li : l2 ? on2 : V2, T2 = _2 ? i2 : E2(n2); return mn2(T2 || n2, function(y2, D2) { T2 && (D2 = y2, y2 = n2[D2]), se2(f2, D2, An(y2, t2, e2, D2, n2, o2)); }), f2; } function _c2(n2) { var t2 = V2(n2); return function(e2) { return Bs2(e2, n2, t2); }; } function Bs2(n2, t2, e2) { var r2 = e2.length; if (n2 == null) return !r2; for (n2 = M2(n2); r2--; ) { var s2 = e2[r2], o2 = t2[s2], f2 = n2[s2]; if (f2 === i2 && !(s2 in n2) || !o2(f2)) return false; } return true; } function Gs2(n2, t2, e2) { if (typeof n2 != "function") throw new wn($2); return le2(function() { n2.apply(i2, e2); }, t2); } function ue2(n2, t2, e2, r2) { var s2 = -1, o2 = Ee2, f2 = true, c2 = n2.length, l2 = [], v2 = t2.length; if (!c2) return l2; e2 && (t2 = G2(t2, hn2(e2))), r2 ? (o2 = Dr2, f2 = false) : t2.length >= P2 && (o2 = jt2, f2 = false, t2 = new gt2(t2)); n: for (; ++s2 < c2; ) { var _2 = n2[s2], m2 = e2 == null ? _2 : e2(_2); if (_2 = r2 || _2 !== 0 ? _2 : 0, f2 && m2 === m2) { for (var w2 = v2; w2--; ) if (t2[w2] === m2) continue n; l2.push(_2); } else o2(t2, m2, r2) || l2.push(_2); } return l2; } var rt2 = vu($n), zs2 = vu(Xr, true); function mc(n2, t2) { var e2 = true; return rt2(n2, function(r2, s2, o2) { return e2 = !!t2(r2, s2, o2), e2; }), e2; } function Ge2(n2, t2, e2) { for (var r2 = -1, s2 = n2.length; ++r2 < s2; ) { var o2 = n2[r2], f2 = t2(o2); if (f2 != null && (c2 === i2 ? f2 === f2 && !pn2(f2) : e2(f2, c2))) var c2 = f2, l2 = o2; } return l2; } function wc(n2, t2, e2, r2) { var s2 = n2.length; for (e2 = b2(e2), e2 < 0 && (e2 = -e2 > s2 ? 0 : s2 + e2), r2 = r2 === i2 || r2 > s2 ? s2 : b2(r2), r2 < 0 && (r2 += s2), r2 = e2 > r2 ? 0 : aa(r2); e2 < r2; ) n2[e2++] = t2; return n2; } function Ks2(n2, t2) { var e2 = []; return rt2(n2, function(r2, s2, o2) { t2(r2, s2, o2) && e2.push(r2); }), e2; } function j2(n2, t2, e2, r2, s2) { var o2 = -1, f2 = n2.length; for (e2 || (e2 = ah), s2 || (s2 = []); ++o2 < f2; ) { var c2 = n2[o2]; t2 > 0 && e2(c2) ? t2 > 1 ? j2(c2, t2 - 1, e2, r2, s2) : nt2(s2, c2) : r2 || (s2[s2.length] = c2); } return s2; } var Jr = _u(), Ys2 = _u(true); function $n(n2, t2) { return n2 && Jr(n2, t2, V2); } function Xr(n2, t2) { return n2 && Ys2(n2, t2, V2); } function ze2(n2, t2) { return jn(t2, function(e2) { return Jn2(n2[e2]); }); } function _t2(n2, t2) { t2 = st2(t2, n2); for (var e2 = 0, r2 = t2.length; n2 != null && e2 < r2; ) n2 = n2[Wn2(t2[e2++])]; return e2 && e2 == r2 ? n2 : i2; } function Zs2(n2, t2, e2) { var r2 = t2(n2); return R2(n2) ? r2 : nt2(r2, e2(n2)); } function en2(n2) { return n2 == null ? n2 === i2 ? Ya : za : pt2 && pt2 in M2(n2) ? th(n2) : dh(n2); } function Qr(n2, t2) { return n2 > t2; } function Pc(n2, t2) { return n2 != null && F2.call(n2, t2); } function Ac(n2, t2) { return n2 != null && t2 in M2(n2); } function Cc(n2, t2, e2) { return n2 >= nn2(t2, e2) && n2 < Q2(t2, e2); } function Vr(n2, t2, e2) { for (var r2 = e2 ? Dr2 : Ee2, s2 = n2[0].length, o2 = n2.length, f2 = o2, c2 = p2(o2), l2 = 1 / 0, v2 = []; f2--; ) { var _2 = n2[f2]; f2 && t2 && (_2 = G2(_2, hn2(t2))), l2 = nn2(_2.length, l2), c2[f2] = !e2 && (t2 || s2 >= 120 && _2.length >= 120) ? new gt2(f2 && _2) : i2; } _2 = n2[0]; var m2 = -1, w2 = c2[0]; n: for (; ++m2 < s2 && v2.length < l2; ) { var I2 = _2[m2], E2 = t2 ? t2(I2) : I2; if (I2 = e2 || I2 !== 0 ? I2 : 0, !(w2 ? jt2(w2, E2) : r2(v2, E2, e2))) { for (f2 = o2; --f2; ) { var T2 = c2[f2]; if (!(T2 ? jt2(T2, E2) : r2(n2[f2], E2, e2))) continue n; } w2 && w2.push(E2), v2.push(I2); } } return v2; } function Ic(n2, t2, e2, r2) { return $n(n2, function(s2, o2, f2) { t2(r2, e2(s2), o2, f2); }), r2; } function ae2(n2, t2, e2) { t2 = st2(t2, n2), n2 = Hu(n2, t2); var r2 = n2 == null ? n2 : n2[Wn2(In(t2))]; return r2 == null ? i2 : cn2(r2, n2, e2); } function Js2(n2) { return Y2(n2) && en2(n2) == Ot2; } function xc(n2) { return Y2(n2) && en2(n2) == kt2; } function Ec(n2) { return Y2(n2) && en2(n2) == Zt2; } function oe2(n2, t2, e2, r2, s2) { return n2 === t2 ? true : n2 == null || t2 == null || !Y2(n2) && !Y2(t2) ? n2 !== n2 && t2 !== t2 : yc(n2, t2, e2, r2, oe2, s2); } function yc(n2, t2, e2, r2, s2, o2) { var f2 = R2(n2), c2 = R2(t2), l2 = f2 ? me2 : tn2(n2), v2 = c2 ? me2 : tn2(t2); l2 = l2 == Ot2 ? qn2 : l2, v2 = v2 == Ot2 ? qn2 : v2; var _2 = l2 == qn2, m2 = v2 == qn2, w2 = l2 == v2; if (w2 && at2(n2)) { if (!at2(t2)) return false; f2 = true, _2 = false; } if (w2 && !_2) return o2 || (o2 = new Rn()), f2 || Bt2(n2) ? Su(n2, t2, e2, r2, s2, o2) : jc(n2, t2, l2, e2, r2, s2, o2); if (!(e2 & Et2)) { var I2 = _2 && F2.call(n2, "__wrapped__"), E2 = m2 && F2.call(t2, "__wrapped__"); if (I2 || E2) { var T2 = I2 ? n2.value() : n2, y2 = E2 ? t2.value() : t2; return o2 || (o2 = new Rn()), s2(T2, y2, e2, r2, o2); } } return w2 ? (o2 || (o2 = new Rn()), nh(n2, t2, e2, r2, s2, o2)) : false; } function Sc(n2) { return Y2(n2) && tn2(n2) == yn2; } function kr(n2, t2, e2, r2) { var s2 = e2.length, o2 = s2, f2 = !r2; if (n2 == null) return !o2; for (n2 = M2(n2); s2--; ) { var c2 = e2[s2]; if (f2 && c2[2] ? c2[1] !== n2[c2[0]] : !(c2[0] in n2)) return false; } for (; ++s2 < o2; ) { c2 = e2[s2]; var l2 = c2[0], v2 = n2[l2], _2 = c2[1]; if (f2 && c2[2]) { if (v2 === i2 && !(l2 in n2)) return false; } else { var m2 = new Rn(); if (r2) var w2 = r2(v2, _2, l2, n2, t2, m2); if (!(w2 === i2 ? oe2(_2, v2, Et2 | ve2, r2, m2) : w2)) return false; } } return true; } function Xs2(n2) { if (!K2(n2) || fh(n2)) return false; var t2 = Jn2(n2) ? Sf : vo2; return t2.test(wt2(n2)); } function Oc(n2) { return Y2(n2) && en2(n2) == Xt2; } function Rc(n2) { return Y2(n2) && tn2(n2) == Sn; } function bc(n2) { return Y2(n2) && ar2(n2.length) && !!B2[en2(n2)]; } function Qs2(n2) { return typeof n2 == "function" ? n2 : n2 == null ? fn2 : typeof n2 == "object" ? R2(n2) ? js2(n2[0], n2[1]) : ks2(n2) : ma(n2); } function jr(n2) { if (!he2(n2)) return Df(n2); var t2 = []; for (var e2 in M2(n2)) F2.call(n2, e2) && e2 != "constructor" && t2.push(e2); return t2; } function Tc(n2) { if (!K2(n2)) return ph(n2); var t2 = he2(n2), e2 = []; for (var r2 in n2) r2 == "constructor" && (t2 || !F2.call(n2, r2)) || e2.push(r2); return e2; } function ni(n2, t2) { return n2 < t2; } function Vs2(n2, t2) { var e2 = -1, r2 = an2(n2) ? p2(n2.length) : []; return rt2(n2, function(s2, o2, f2) { r2[++e2] = t2(s2, o2, f2); }), r2; } function ks2(n2) { var t2 = gi(n2); return t2.length == 1 && t2[0][2] ? Lu(t2[0][0], t2[0][1]) : function(e2) { return e2 === n2 || kr(e2, n2, t2); }; } function js2(n2, t2) { return _i(n2) && Tu(t2) ? Lu(Wn2(n2), t2) : function(e2) { var r2 = Si(e2, n2); return r2 === i2 && r2 === t2 ? Oi(e2, n2) : oe2(t2, r2, Et2 | ve2); }; } function Ke2(n2, t2, e2, r2, s2) { n2 !== t2 && Jr(t2, function(o2, f2) { if (s2 || (s2 = new Rn()), K2(o2)) Lc(n2, t2, f2, e2, Ke2, r2, s2); else { var c2 = r2 ? r2(wi(n2, f2), o2, f2 + "", n2, t2, s2) : i2; c2 === i2 && (c2 = o2), Yr(n2, f2, c2); } }, on2); } function Lc(n2, t2, e2, r2, s2, o2, f2) { var c2 = wi(n2, e2), l2 = wi(t2, e2), v2 = f2.get(l2); if (v2) { Yr(n2, e2, v2); return; } var _2 = o2 ? o2(c2, l2, e2 + "", n2, t2, f2) : i2, m2 = _2 === i2; if (m2) { var w2 = R2(l2), I2 = !w2 && at2(l2), E2 = !w2 && !I2 && Bt2(l2); _2 = l2, w2 || I2 || E2 ? R2(c2) ? _2 = c2 : Z2(c2) ? _2 = un2(c2) : I2 ? (m2 = false, _2 = hu(l2, true)) : E2 ? (m2 = false, _2 = lu(l2, true)) : _2 = [] : pe2(l2) || Pt2(l2) ? (_2 = c2, Pt2(c2) ? _2 = oa(c2) : (!K2(c2) || Jn2(c2)) && (_2 = bu(l2))) : m2 = false; } m2 && (f2.set(l2, _2), s2(_2, l2, r2, o2, f2), f2.delete(l2)), Yr(n2, e2, _2); } function nu(n2, t2) { var e2 = n2.length; if (e2) return t2 += t2 < 0 ? e2 : 0, Zn(t2, e2) ? n2[t2] : i2; } function tu(n2, t2, e2) { t2.length ? t2 = G2(t2, function(o2) { return R2(o2) ? function(f2) { return _t2(f2, o2.length === 1 ? o2[0] : o2); } : o2; }) : t2 = [fn2]; var r2 = -1; t2 = G2(t2, hn2(x2())); var s2 = Vs2(n2, function(o2, f2, c2) { var l2 = G2(t2, function(v2) { return v2(o2); }); return { criteria: l2, index: ++r2, value: o2 }; }); return sf(s2, function(o2, f2) { return Kc(o2, f2, e2); }); } function Dc(n2, t2) { return eu(n2, t2, function(e2, r2) { return Oi(n2, r2); }); } function eu(n2, t2, e2) { for (var r2 = -1, s2 = t2.length, o2 = {}; ++r2 < s2; ) { var f2 = t2[r2], c2 = _t2(n2, f2); e2(c2, f2) && fe2(o2, st2(f2, n2), c2); } return o2; } function Hc(n2) { return function(t2) { return _t2(t2, n2); }; } function ti(n2, t2, e2, r2) { var s2 = r2 ? rf : Tt2, o2 = -1, f2 = t2.length, c2 = n2; for (n2 === t2 && (t2 = un2(t2)), e2 && (c2 = G2(n2, hn2(e2))); ++o2 < f2; ) for (var l2 = 0, v2 = t2[o2], _2 = e2 ? e2(v2) : v2; (l2 = s2(c2, _2, l2, r2)) > -1; ) c2 !== n2 && Ne2.call(c2, l2, 1), Ne2.call(n2, l2, 1); return n2; } function ru(n2, t2) { for (var e2 = n2 ? t2.length : 0, r2 = e2 - 1; e2--; ) { var s2 = t2[e2]; if (e2 == r2 || s2 !== o2) { var o2 = s2; Zn(s2) ? Ne2.call(n2, s2, 1) : si(n2, s2); } } return n2; } function ei(n2, t2) { return n2 + We2(Us2() * (t2 - n2 + 1)); } function Nc(n2, t2, e2, r2) { for (var s2 = -1, o2 = Q2(Ue2((t2 - n2) / (e2 || 1)), 0), f2 = p2(o2); o2--; ) f2[r2 ? o2 : ++s2] = n2, n2 += e2; return f2; } function ri(n2, t2) { var e2 = ""; if (!n2 || t2 < 1 || t2 > kn2) return e2; do t2 % 2 && (e2 += n2), t2 = We2(t2 / 2), t2 && (n2 += n2); while (t2); return e2; } function L2(n2, t2) { return Pi(Du(n2, t2, fn2), n2 + ""); } function $c(n2) { return Ms2(Gt2(n2)); } function Uc(n2, t2) { var e2 = Gt2(n2); return tr2(e2, vt2(t2, 0, e2.length)); } function fe2(n2, t2, e2, r2) { if (!K2(n2)) return n2; t2 = st2(t2, n2); for (var s2 = -1, o2 = t2.length, f2 = o2 - 1, c2 = n2; c2 != null && ++s2 < o2; ) { var l2 = Wn2(t2[s2]), v2 = e2; if (l2 === "__proto__" || l2 === "constructor" || l2 === "prototype") return n2; if (s2 != f2) { var _2 = c2[l2]; v2 = r2 ? r2(_2, l2, c2) : i2, v2 === i2 && (v2 = K2(_2) ? _2 : Zn(t2[s2 + 1]) ? [] : {}); } se2(c2, l2, v2), c2 = c2[l2]; } return n2; } var iu = Fe2 ? function(n2, t2) { return Fe2.set(n2, t2), n2; } : fn2, Wc = $e2 ? function(n2, t2) { return $e2(n2, "toString", { configurable: true, enumerable: false, value: bi(t2), writable: true }); } : fn2; function Fc(n2) { return tr2(Gt2(n2)); } function Cn(n2, t2, e2) { var r2 = -1, s2 = n2.length; t2 < 0 && (t2 = -t2 > s2 ? 0 : s2 + t2), e2 = e2 > s2 ? s2 : e2, e2 < 0 && (e2 += s2), s2 = t2 > e2 ? 0 : e2 - t2 >>> 0, t2 >>>= 0; for (var o2 = p2(s2); ++r2 < s2; ) o2[r2] = n2[r2 + t2]; return o2; } function Mc(n2, t2) { var e2; return rt2(n2, function(r2, s2, o2) { return e2 = t2(r2, s2, o2), !e2; }), !!e2; } function Ye2(n2, t2, e2) { var r2 = 0, s2 = n2 == null ? r2 : n2.length; if (typeof t2 == "number" && t2 === t2 && s2 <= Ma) { for (; r2 < s2; ) { var o2 = r2 + s2 >>> 1, f2 = n2[o2]; f2 !== null && !pn2(f2) && (e2 ? f2 <= t2 : f2 < t2) ? r2 = o2 + 1 : s2 = o2; } return s2; } return ii(n2, t2, fn2, e2); } function ii(n2, t2, e2, r2) { var s2 = 0, o2 = n2 == null ? 0 : n2.length; if (o2 === 0) return 0; t2 = e2(t2); for (var f2 = t2 !== t2, c2 = t2 === null, l2 = pn2(t2), v2 = t2 === i2; s2 < o2; ) { var _2 = We2((s2 + o2) / 2), m2 = e2(n2[_2]), w2 = m2 !== i2, I2 = m2 === null, E2 = m2 === m2, T2 = pn2(m2); if (f2) var y2 = r2 || E2; else v2 ? y2 = E2 && (r2 || w2) : c2 ? y2 = E2 && w2 && (r2 || !I2) : l2 ? y2 = E2 && w2 && !I2 && (r2 || !T2) : I2 || T2 ? y2 = false : y2 = r2 ? m2 <= t2 : m2 < t2; y2 ? s2 = _2 + 1 : o2 = _2; } return nn2(o2, Fa); } function su(n2, t2) { for (var e2 = -1, r2 = n2.length, s2 = 0, o2 = []; ++e2 < r2; ) { var f2 = n2[e2], c2 = t2 ? t2(f2) : f2; if (!e2 || !bn2(c2, l2)) { var l2 = c2; o2[s2++] = f2 === 0 ? 0 : f2; } } return o2; } function uu(n2) { return typeof n2 == "number" ? n2 : pn2(n2) ? _e2 : +n2; } function ln2(n2) { if (typeof n2 == "string") return n2; if (R2(n2)) return G2(n2, ln2) + ""; if (pn2(n2)) return Ws2 ? Ws2.call(n2) : ""; var t2 = n2 + ""; return t2 == "0" && 1 / n2 == -ht2 ? "-0" : t2; } function it2(n2, t2, e2) { var r2 = -1, s2 = Ee2, o2 = n2.length, f2 = true, c2 = [], l2 = c2; if (e2) f2 = false, s2 = Dr2; else if (o2 >= P2) { var v2 = t2 ? null : Vc(n2); if (v2) return Se(v2); f2 = false, s2 = jt2, l2 = new gt2(); } else l2 = t2 ? [] : c2; n: for (; ++r2 < o2; ) { var _2 = n2[r2], m2 = t2 ? t2(_2) : _2; if (_2 = e2 || _2 !== 0 ? _2 : 0, f2 && m2 === m2) { for (var w2 = l2.length; w2--; ) if (l2[w2] === m2) continue n; t2 && l2.push(m2), c2.push(_2); } else s2(l2, m2, e2) || (l2 !== c2 && l2.push(m2), c2.push(_2)); } return c2; } function si(n2, t2) { return t2 = st2(t2, n2), n2 = Hu(n2, t2), n2 == null || delete n2[Wn2(In(t2))]; } function au(n2, t2, e2, r2) { return fe2(n2, t2, e2(_t2(n2, t2)), r2); } function Ze2(n2, t2, e2, r2) { for (var s2 = n2.length, o2 = r2 ? s2 : -1; (r2 ? o2-- : ++o2 < s2) && t2(n2[o2], o2, n2); ) ; return e2 ? Cn(n2, r2 ? 0 : o2, r2 ? o2 + 1 : s2) : Cn(n2, r2 ? o2 + 1 : 0, r2 ? s2 : o2); } function ou(n2, t2) { var e2 = n2; return e2 instanceof H2 && (e2 = e2.value()), Hr(t2, function(r2, s2) { return s2.func.apply(s2.thisArg, nt2([r2], s2.args)); }, e2); } function ui(n2, t2, e2) { var r2 = n2.length; if (r2 < 2) return r2 ? it2(n2[0]) : []; for (var s2 = -1, o2 = p2(r2); ++s2 < r2; ) for (var f2 = n2[s2], c2 = -1; ++c2 < r2; ) c2 != s2 && (o2[s2] = ue2(o2[s2] || f2, n2[c2], t2, e2)); return it2(j2(o2, 1), t2, e2); } function fu(n2, t2, e2) { for (var r2 = -1, s2 = n2.length, o2 = t2.length, f2 = {}; ++r2 < s2; ) { var c2 = r2 < o2 ? t2[r2] : i2; e2(f2, n2[r2], c2); } return f2; } function ai(n2) { return Z2(n2) ? n2 : []; } function oi(n2) { return typeof n2 == "function" ? n2 : fn2; } function st2(n2, t2) { return R2(n2) ? n2 : _i(n2, t2) ? [n2] : Wu(W2(n2)); } var qc = L2; function ut2(n2, t2, e2) { var r2 = n2.length; return e2 = e2 === i2 ? r2 : e2, !t2 && e2 >= r2 ? n2 : Cn(n2, t2, e2); } var cu = Of || function(n2) { return k2.clearTimeout(n2); }; function hu(n2, t2) { if (t2) return n2.slice(); var e2 = n2.length, r2 = Ls2 ? Ls2(e2) : new n2.constructor(e2); return n2.copy(r2), r2; } function fi(n2) { var t2 = new n2.constructor(n2.byteLength); return new De2(t2).set(new De2(n2)), t2; } function Bc(n2, t2) { var e2 = t2 ? fi(n2.buffer) : n2.buffer; return new n2.constructor(e2, n2.byteOffset, n2.byteLength); } function Gc(n2) { var t2 = new n2.constructor(n2.source, Ji2.exec(n2)); return t2.lastIndex = n2.lastIndex, t2; } function zc(n2) { return ie2 ? M2(ie2.call(n2)) : {}; } function lu(n2, t2) { var e2 = t2 ? fi(n2.buffer) : n2.buffer; return new n2.constructor(e2, n2.byteOffset, n2.length); } function pu(n2, t2) { if (n2 !== t2) { var e2 = n2 !== i2, r2 = n2 === null, s2 = n2 === n2, o2 = pn2(n2), f2 = t2 !== i2, c2 = t2 === null, l2 = t2 === t2, v2 = pn2(t2); if (!c2 && !v2 && !o2 && n2 > t2 || o2 && f2 && l2 && !c2 && !v2 || r2 && f2 && l2 || !e2 && l2 || !s2) return 1; if (!r2 && !o2 && !v2 && n2 < t2 || v2 && e2 && s2 && !r2 && !o2 || c2 && e2 && s2 || !f2 && s2 || !l2) return -1; } return 0; } function Kc(n2, t2, e2) { for (var r2 = -1, s2 = n2.criteria, o2 = t2.criteria, f2 = s2.length, c2 = e2.length; ++r2 < f2; ) { var l2 = pu(s2[r2], o2[r2]); if (l2) { if (r2 >= c2) return l2; var v2 = e2[r2]; return l2 * (v2 == "desc" ? -1 : 1); } } return n2.index - t2.index; } function du(n2, t2, e2, r2) { for (var s2 = -1, o2 = n2.length, f2 = e2.length, c2 = -1, l2 = t2.length, v2 = Q2(o2 - f2, 0), _2 = p2(l2 + v2), m2 = !r2; ++c2 < l2; ) _2[c2] = t2[c2]; for (; ++s2 < f2; ) (m2 || s2 < o2) && (_2[e2[s2]] = n2[s2]); for (; v2--; ) _2[c2++] = n2[s2++]; return _2; } function gu(n2, t2, e2, r2) { for (var s2 = -1, o2 = n2.length, f2 = -1, c2 = e2.length, l2 = -1, v2 = t2.length, _2 = Q2(o2 - c2, 0), m2 = p2(_2 + v2), w2 = !r2; ++s2 < _2; ) m2[s2] = n2[s2]; for (var I2 = s2; ++l2 < v2; ) m2[I2 + l2] = t2[l2]; for (; ++f2 < c2; ) (w2 || s2 < o2) && (m2[I2 + e2[f2]] = n2[s2++]); return m2; } function un2(n2, t2) { var e2 = -1, r2 = n2.length; for (t2 || (t2 = p2(r2)); ++e2 < r2; ) t2[e2] = n2[e2]; return t2; } function Un2(n2, t2, e2, r2) { var s2 = !e2; e2 || (e2 = {}); for (var o2 = -1, f2 = t2.length; ++o2 < f2; ) { var c2 = t2[o2], l2 = r2 ? r2(e2[c2], n2[c2], c2, e2, n2) : i2; l2 === i2 && (l2 = n2[c2]), s2 ? zn(e2, c2, l2) : se2(e2, c2, l2); } return e2; } function Yc(n2, t2) { return Un2(n2, vi(n2), t2); } function Zc(n2, t2) { return Un2(n2, Ou(n2), t2); } function Je2(n2, t2) { return function(e2, r2) { var s2 = R2(e2) ? Vo2 : gc, o2 = t2 ? t2() : {}; return s2(e2, n2, x2(r2, 2), o2); }; } function Ft2(n2) { return L2(function(t2, e2) { var r2 = -1, s2 = e2.length, o2 = s2 > 1 ? e2[s2 - 1] : i2, f2 = s2 > 2 ? e2[2] : i2; for (o2 = n2.length > 3 && typeof o2 == "function" ? (s2--, o2) : i2, f2 && rn2(e2[0], e2[1], f2) && (o2 = s2 < 3 ? i2 : o2, s2 = 1), t2 = M2(t2); ++r2 < s2; ) { var c2 = e2[r2]; c2 && n2(t2, c2, r2, o2); } return t2; }); } function vu(n2, t2) { return function(e2, r2) { if (e2 == null) return e2; if (!an2(e2)) return n2(e2, r2); for (var s2 = e2.length, o2 = t2 ? s2 : -1, f2 = M2(e2); (t2 ? o2-- : ++o2 < s2) && r2(f2[o2], o2, f2) !== false; ) ; return e2; }; } function _u(n2) { return function(t2, e2, r2) { for (var s2 = -1, o2 = M2(t2), f2 = r2(t2), c2 = f2.length; c2--; ) { var l2 = f2[n2 ? c2 : ++s2]; if (e2(o2[l2], l2, o2) === false) break; } return t2; }; } function Jc(n2, t2, e2) { var r2 = t2 & vn2, s2 = ce2(n2); function o2() { var f2 = this && this !== k2 && this instanceof o2 ? s2 : n2; return f2.apply(r2 ? e2 : this, arguments); } return o2; } function mu(n2) { return function(t2) { t2 = W2(t2); var e2 = Lt2(t2) ? On(t2) : i2, r2 = e2 ? e2[0] : t2.charAt(0), s2 = e2 ? ut2(e2, 1).join("") : t2.slice(1); return r2[n2]() + s2; }; } function Mt2(n2) { return function(t2) { return Hr(va(ga(t2).replace(Uo2, "")), n2, ""); }; } function ce2(n2) { return function() { var t2 = arguments; switch (t2.length) { case 0: return new n2(); case 1: return new n2(t2[0]); case 2: return new n2(t2[0], t2[1]); case 3: return new n2(t2[0], t2[1], t2[2]); case 4: return new n2(t2[0], t2[1], t2[2], t2[3]); case 5: return new n2(t2[0], t2[1], t2[2], t2[3], t2[4]); case 6: return new n2(t2[0], t2[1], t2[2], t2[3], t2[4], t2[5]); case 7: return new n2(t2[0], t2[1], t2[2], t2[3], t2[4], t2[5], t2[6]); } var e2 = Wt2(n2.prototype), r2 = n2.apply(e2, t2); return K2(r2) ? r2 : e2; }; } function Xc(n2, t2, e2) { var r2 = ce2(n2); function s2() { for (var o2 = arguments.length, f2 = p2(o2), c2 = o2, l2 = qt2(s2); c2--; ) f2[c2] = arguments[c2]; var v2 = o2 < 3 && f2[0] !== l2 && f2[o2 - 1] !== l2 ? [] : tt2(f2, l2); if (o2 -= v2.length, o2 < e2) return Iu(n2, t2, Xe2, s2.placeholder, i2, f2, v2, i2, i2, e2 - o2); var _2 = this && this !== k2 && this instanceof s2 ? r2 : n2; return cn2(_2, this, f2); } return s2; } function wu(n2) { return function(t2, e2, r2) { var s2 = M2(t2); if (!an2(t2)) { var o2 = x2(e2, 3); t2 = V2(t2), e2 = function(c2) { return o2(s2[c2], c2, s2); }; } var f2 = n2(t2, e2, r2); return f2 > -1 ? s2[o2 ? t2[f2] : f2] : i2; }; } function Pu(n2) { return Yn(function(t2) { var e2 = t2.length, r2 = e2, s2 = Pn.prototype.thru; for (n2 && t2.reverse(); r2--; ) { var o2 = t2[r2]; if (typeof o2 != "function") throw new wn($2); if (s2 && !f2 && je2(o2) == "wrapper") var f2 = new Pn([], true); } for (r2 = f2 ? r2 : e2; ++r2 < e2; ) { o2 = t2[r2]; var c2 = je2(o2), l2 = c2 == "wrapper" ? di(o2) : i2; l2 && mi(l2[0]) && l2[1] == (Mn2 | Dn2 | Hn2 | Kt2) && !l2[4].length && l2[9] == 1 ? f2 = f2[je2(l2[0])].apply(f2, l2[3]) : f2 = o2.length == 1 && mi(o2) ? f2[c2]() : f2.thru(o2); } return function() { var v2 = arguments, _2 = v2[0]; if (f2 && v2.length == 1 && R2(_2)) return f2.plant(_2).value(); for (var m2 = 0, w2 = e2 ? t2[m2].apply(this, v2) : _2; ++m2 < e2; ) w2 = t2[m2].call(this, w2); return w2; }; }); } function Xe2(n2, t2, e2, r2, s2, o2, f2, c2, l2, v2) { var _2 = t2 & Mn2, m2 = t2 & vn2, w2 = t2 & ct2, I2 = t2 & (Dn2 | yt2), E2 = t2 & dr2, T2 = w2 ? i2 : ce2(n2); function y2() { for (var D2 = arguments.length, N2 = p2(D2), dn2 = D2; dn2--; ) N2[dn2] = arguments[dn2]; if (I2) var sn2 = qt2(y2), gn2 = af(N2, sn2); if (r2 && (N2 = du(N2, r2, s2, I2)), o2 && (N2 = gu(N2, o2, f2, I2)), D2 -= gn2, I2 && D2 < v2) { var J2 = tt2(N2, sn2); return Iu(n2, t2, Xe2, y2.placeholder, e2, N2, J2, c2, l2, v2 - D2); } var Tn = m2 ? e2 : this, Qn2 = w2 ? Tn[n2] : n2; return D2 = N2.length, c2 ? N2 = gh(N2, c2) : E2 && D2 > 1 && N2.reverse(), _2 && l2 < D2 && (N2.length = l2), this && this !== k2 && this instanceof y2 && (Qn2 = T2 || ce2(Qn2)), Qn2.apply(Tn, N2); } return y2; } function Au(n2, t2) { return function(e2, r2) { return Ic(e2, n2, t2(r2), {}); }; } function Qe2(n2, t2) { return function(e2, r2) { var s2; if (e2 === i2 && r2 === i2) return t2; if (e2 !== i2 && (s2 = e2), r2 !== i2) { if (s2 === i2) return r2; typeof e2 == "string" || typeof r2 == "string" ? (e2 = ln2(e2), r2 = ln2(r2)) : (e2 = uu(e2), r2 = uu(r2)), s2 = n2(e2, r2); } return s2; }; } function ci(n2) { return Yn(function(t2) { return t2 = G2(t2, hn2(x2())), L2(function(e2) { var r2 = this; return n2(t2, function(s2) { return cn2(s2, r2, e2); }); }); }); } function Ve2(n2, t2) { t2 = t2 === i2 ? " " : ln2(t2); var e2 = t2.length; if (e2 < 2) return e2 ? ri(t2, n2) : t2; var r2 = ri(t2, Ue2(n2 / Dt2(t2))); return Lt2(t2) ? ut2(On(r2), 0, n2).join("") : r2.slice(0, n2); } function Qc(n2, t2, e2, r2) { var s2 = t2 & vn2, o2 = ce2(n2); function f2() { for (var c2 = -1, l2 = arguments.length, v2 = -1, _2 = r2.length, m2 = p2(_2 + l2), w2 = this && this !== k2 && this instanceof f2 ? o2 : n2; ++v2 < _2; ) m2[v2] = r2[v2]; for (; l2--; ) m2[v2++] = arguments[++c2]; return cn2(w2, s2 ? e2 : this, m2); } return f2; } function Cu(n2) { return function(t2, e2, r2) { return r2 && typeof r2 != "number" && rn2(t2, e2, r2) && (e2 = r2 = i2), t2 = Xn2(t2), e2 === i2 ? (e2 = t2, t2 = 0) : e2 = Xn2(e2), r2 = r2 === i2 ? t2 < e2 ? 1 : -1 : Xn2(r2), Nc(t2, e2, r2, n2); }; } function ke2(n2) { return function(t2, e2) { return typeof t2 == "string" && typeof e2 == "string" || (t2 = xn2(t2), e2 = xn2(e2)), n2(t2, e2); }; } function Iu(n2, t2, e2, r2, s2, o2, f2, c2, l2, v2) { var _2 = t2 & Dn2, m2 = _2 ? f2 : i2, w2 = _2 ? i2 : f2, I2 = _2 ? o2 : i2, E2 = _2 ? i2 : o2; t2 |= _2 ? Hn2 : St2, t2 &= ~(_2 ? St2 : Hn2), t2 & qi || (t2 &= ~(vn2 | ct2)); var T2 = [n2, t2, s2, I2, m2, E2, w2, c2, l2, v2], y2 = e2.apply(i2, T2); return mi(n2) && Nu(y2, T2), y2.placeholder = r2, $u(y2, n2, t2); } function hi(n2) { var t2 = X2[n2]; return function(e2, r2) { if (e2 = xn2(e2), r2 = r2 == null ? 0 : nn2(b2(r2), 292), r2 && $s2(e2)) { var s2 = (W2(e2) + "e").split("e"), o2 = t2(s2[0] + "e" + (+s2[1] + r2)); return s2 = (W2(o2) + "e").split("e"), +(s2[0] + "e" + (+s2[1] - r2)); } return t2(e2); }; } var Vc = $t2 && 1 / Se(new $t2([, -0]))[1] == ht2 ? function(n2) { return new $t2(n2); } : Di; function xu(n2) { return function(t2) { var e2 = tn2(t2); return e2 == yn2 ? qr(t2) : e2 == Sn ? df(t2) : uf(t2, n2(t2)); }; } function Kn2(n2, t2, e2, r2, s2, o2, f2, c2) { var l2 = t2 & ct2; if (!l2 && typeof n2 != "function") throw new wn($2); var v2 = r2 ? r2.length : 0; if (v2 || (t2 &= ~(Hn2 | St2), r2 = s2 = i2), f2 = f2 === i2 ? f2 : Q2(b2(f2), 0), c2 = c2 === i2 ? c2 : b2(c2), v2 -= s2 ? s2.length : 0, t2 & St2) { var _2 = r2, m2 = s2; r2 = s2 = i2; } var w2 = l2 ? i2 : di(n2), I2 = [n2, t2, e2, r2, s2, _2, m2, o2, f2, c2]; if (w2 && lh(I2, w2), n2 = I2[0], t2 = I2[1], e2 = I2[2], r2 = I2[3], s2 = I2[4], c2 = I2[9] = I2[9] === i2 ? l2 ? 0 : n2.length : Q2(I2[9] - v2, 0), !c2 && t2 & (Dn2 | yt2) && (t2 &= ~(Dn2 | yt2)), !t2 || t2 == vn2) var E2 = Jc(n2, t2, e2); else t2 == Dn2 || t2 == yt2 ? E2 = Xc(n2, t2, c2) : (t2 == Hn2 || t2 == (vn2 | Hn2)) && !s2.length ? E2 = Qc(n2, t2, e2, r2) : E2 = Xe2.apply(i2, I2); var T2 = w2 ? iu : Nu; return $u(T2(E2, I2), n2, t2); } function Eu(n2, t2, e2, r2) { return n2 === i2 || bn2(n2, Nt2[e2]) && !F2.call(r2, e2) ? t2 : n2; } function yu(n2, t2, e2, r2, s2, o2) { return K2(n2) && K2(t2) && (o2.set(t2, n2), Ke2(n2, t2, i2, yu, o2), o2.delete(t2)), n2; } function kc(n2) { return pe2(n2) ? i2 : n2; } function Su(n2, t2, e2, r2, s2, o2) { var f2 = e2 & Et2, c2 = n2.length, l2 = t2.length; if (c2 != l2 && !(f2 && l2 > c2)) return false; var v2 = o2.get(n2), _2 = o2.get(t2); if (v2 && _2) return v2 == t2 && _2 == n2; var m2 = -1, w2 = true, I2 = e2 & ve2 ? new gt2() : i2; for (o2.set(n2, t2), o2.set(t2, n2); ++m2 < c2; ) { var E2 = n2[m2], T2 = t2[m2]; if (r2) var y2 = f2 ? r2(T2, E2, m2, t2, n2, o2) : r2(E2, T2, m2, n2, t2, o2); if (y2 !== i2) { if (y2) continue; w2 = false; break; } if (I2) { if (!Nr2(t2, function(D2, N2) { if (!jt2(I2, N2) && (E2 === D2 || s2(E2, D2, e2, r2, o2))) return I2.push(N2); })) { w2 = false; break; } } else if (!(E2 === T2 || s2(E2, T2, e2, r2, o2))) { w2 = false; break; } } return o2.delete(n2), o2.delete(t2), w2; } function jc(n2, t2, e2, r2, s2, o2, f2) { switch (e2) { case Rt2: if (n2.byteLength != t2.byteLength || n2.byteOffset != t2.byteOffset) return false; n2 = n2.buffer, t2 = t2.buffer; case kt2: return !(n2.byteLength != t2.byteLength || !o2(new De2(n2), new De2(t2))); case Yt2: case Zt2: case Jt2: return bn2(+n2, +t2); case we2: return n2.name == t2.name && n2.message == t2.message; case Xt2: case Qt2: return n2 == t2 + ""; case yn2: var c2 = qr; case Sn: var l2 = r2 & Et2; if (c2 || (c2 = Se), n2.size != t2.size && !l2) return false; var v2 = f2.get(n2); if (v2) return v2 == t2; r2 |= ve2, f2.set(n2, t2); var _2 = Su(c2(n2), c2(t2), r2, s2, o2, f2); return f2.delete(n2), _2; case Ae2: if (ie2) return ie2.call(n2) == ie2.call(t2); } return false; } function nh(n2, t2, e2, r2, s2, o2) { var f2 = e2 & Et2, c2 = li(n2), l2 = c2.length, v2 = li(t2), _2 = v2.length; if (l2 != _2 && !f2) return false; for (var m2 = l2; m2--; ) { var w2 = c2[m2]; if (!(f2 ? w2 in t2 : F2.call(t2, w2))) return false; } var I2 = o2.get(n2), E2 = o2.get(t2); if (I2 && E2) return I2 == t2 && E2 == n2; var T2 = true; o2.set(n2, t2), o2.set(t2, n2); for (var y2 = f2; ++m2 < l2; ) { w2 = c2[m2]; var D2 = n2[w2], N2 = t2[w2]; if (r2) var dn2 = f2 ? r2(N2, D2, w2, t2, n2, o2) : r2(D2, N2, w2, n2, t2, o2); if (!(dn2 === i2 ? D2 === N2 || s2(D2, N2, e2, r2, o2) : dn2)) { T2 = false; break; } y2 || (y2 = w2 == "constructor"); } if (T2 && !y2) { var sn2 = n2.constructor, gn2 = t2.constructor; sn2 != gn2 && "constructor" in n2 && "constructor" in t2 && !(typeof sn2 == "function" && sn2 instanceof sn2 && typeof gn2 == "function" && gn2 instanceof gn2) && (T2 = false); } return o2.delete(n2), o2.delete(t2), T2; } function Yn(n2) { return Pi(Du(n2, i2, Bu), n2 + ""); } function li(n2) { return Zs2(n2, V2, vi); } function pi(n2) { return Zs2(n2, on2, Ou); } var di = Fe2 ? function(n2) { return Fe2.get(n2); } : Di; function je2(n2) { for (var t2 = n2.name + "", e2 = Ut2[t2], r2 = F2.call(Ut2, t2) ? e2.length : 0; r2--; ) { var s2 = e2[r2], o2 = s2.func; if (o2 == null || o2 == n2) return s2.name; } return t2; } function qt2(n2) { var t2 = F2.call(a2, "placeholder") ? a2 : n2; return t2.placeholder; } function x2() { var n2 = a2.iteratee || Ti; return n2 = n2 === Ti ? Qs2 : n2, arguments.length ? n2(arguments[0], arguments[1]) : n2; } function nr2(n2, t2) { var e2 = n2.__data__; return oh(t2) ? e2[typeof t2 == "string" ? "string" : "hash"] : e2.map; } function gi(n2) { for (var t2 = V2(n2), e2 = t2.length; e2--; ) { var r2 = t2[e2], s2 = n2[r2]; t2[e2] = [r2, s2, Tu(s2)]; } return t2; } function mt2(n2, t2) { var e2 = hf(n2, t2); return Xs2(e2) ? e2 : i2; } function th(n2) { var t2 = F2.call(n2, pt2), e2 = n2[pt2]; try { n2[pt2] = i2; var r2 = true; } catch { } var s2 = Te2.call(n2); return r2 && (t2 ? n2[pt2] = e2 : delete n2[pt2]), s2; } var vi = Gr ? function(n2) { return n2 == null ? [] : (n2 = M2(n2), jn(Gr(n2), function(t2) { return Hs2.call(n2, t2); })); } : Hi2, Ou = Gr ? function(n2) { for (var t2 = []; n2; ) nt2(t2, vi(n2)), n2 = He2(n2); return t2; } : Hi2, tn2 = en2; (zr2 && tn2(new zr2(new ArrayBuffer(1))) != Rt2 || te2 && tn2(new te2()) != yn2 || Kr && tn2(Kr.resolve()) != zi || $t2 && tn2(new $t2()) != Sn || ee2 && tn2(new ee2()) != Vt2) && (tn2 = function(n2) { var t2 = en2(n2), e2 = t2 == qn2 ? n2.constructor : i2, r2 = e2 ? wt2(e2) : ""; if (r2) switch (r2) { case Uf: return Rt2; case Wf: return yn2; case Ff: return zi; case Mf: return Sn; case qf: return Vt2; } return t2; }); function eh(n2, t2, e2) { for (var r2 = -1, s2 = e2.length; ++r2 < s2; ) { var o2 = e2[r2], f2 = o2.size; switch (o2.type) { case "drop": n2 += f2; break; case "dropRight": t2 -= f2; break; case "take": t2 = nn2(t2, n2 + f2); break; case "takeRight": n2 = Q2(n2, t2 - f2); break; } } return { start: n2, end: t2 }; } function rh(n2) { var t2 = n2.match(ao2); return t2 ? t2[1].split(oo2) : []; } function Ru(n2, t2, e2) { t2 = st2(t2, n2); for (var r2 = -1, s2 = t2.length, o2 = false; ++r2 < s2; ) { var f2 = Wn2(t2[r2]); if (!(o2 = n2 != null && e2(n2, f2))) break; n2 = n2[f2]; } return o2 || ++r2 != s2 ? o2 : (s2 = n2 == null ? 0 : n2.length, !!s2 && ar2(s2) && Zn(f2, s2) && (R2(n2) || Pt2(n2))); } function ih(n2) { var t2 = n2.length, e2 = new n2.constructor(t2); return t2 && typeof n2[0] == "string" && F2.call(n2, "index") && (e2.index = n2.index, e2.input = n2.input), e2; } function bu(n2) { return typeof n2.constructor == "function" && !he2(n2) ? Wt2(He2(n2)) : {}; } function sh(n2, t2, e2) { var r2 = n2.constructor; switch (t2) { case kt2: return fi(n2); case Yt2: case Zt2: return new r2(+n2); case Rt2: return Bc(n2, e2); case gr2: case vr2: case _r2: case mr2: case wr: case Pr2: case Ar2: case Cr2: case Ir2: return lu(n2, e2); case yn2: return new r2(); case Jt2: case Qt2: return new r2(n2); case Xt2: return Gc(n2); case Sn: return new r2(); case Ae2: return zc(n2); } } function uh(n2, t2) { var e2 = t2.length; if (!e2) return n2; var r2 = e2 - 1; return t2[r2] = (e2 > 1 ? "& " : "") + t2[r2], t2 = t2.join(e2 > 2 ? ", " : " "), n2.replace(uo2, `{ /* [wrapped with ` + t2 + `] */ `); } function ah(n2) { return R2(n2) || Pt2(n2) || !!(Ns2 && n2 && n2[Ns2]); } function Zn(n2, t2) { var e2 = typeof n2; return t2 = t2 ?? kn2, !!t2 && (e2 == "number" || e2 != "symbol" && mo2.test(n2)) && n2 > -1 && n2 % 1 == 0 && n2 < t2; } function rn2(n2, t2, e2) { if (!K2(e2)) return false; var r2 = typeof t2; return (r2 == "number" ? an2(e2) && Zn(t2, e2.length) : r2 == "string" && t2 in e2) ? bn2(e2[t2], n2) : false; } function _i(n2, t2) { if (R2(n2)) return false; var e2 = typeof n2; return e2 == "number" || e2 == "symbol" || e2 == "boolean" || n2 == null || pn2(n2) ? true : eo2.test(n2) || !to2.test(n2) || t2 != null && n2 in M2(t2); } function oh(n2) { var t2 = typeof n2; return t2 == "string" || t2 == "number" || t2 == "symbol" || t2 == "boolean" ? n2 !== "__proto__" : n2 === null; } function mi(n2) { var t2 = je2(n2), e2 = a2[t2]; if (typeof e2 != "function" || !(t2 in H2.prototype)) return false; if (n2 === e2) return true; var r2 = di(e2); return !!r2 && n2 === r2[0]; } function fh(n2) { return !!Ts2 && Ts2 in n2; } var ch2 = Re2 ? Jn2 : Ni; function he2(n2) { var t2 = n2 && n2.constructor, e2 = typeof t2 == "function" && t2.prototype || Nt2; return n2 === e2; } function Tu(n2) { return n2 === n2 && !K2(n2); } function Lu(n2, t2) { return function(e2) { return e2 == null ? false : e2[n2] === t2 && (t2 !== i2 || n2 in M2(e2)); }; } function hh(n2) { var t2 = sr2(n2, function(r2) { return e2.size === pr2 && e2.clear(), r2; }), e2 = t2.cache; return t2; } function lh(n2, t2) { var e2 = n2[1], r2 = t2[1], s2 = e2 | r2, o2 = s2 < (vn2 | ct2 | Mn2), f2 = r2 == Mn2 && e2 == Dn2 || r2 == Mn2 && e2 == Kt2 && n2[7].length <= t2[8] || r2 == (Mn2 | Kt2) && t2[7].length <= t2[8] && e2 == Dn2; if (!(o2 || f2)) return n2; r2 & vn2 && (n2[2] = t2[2], s2 |= e2 & vn2 ? 0 : qi); var c2 = t2[3]; if (c2) { var l2 = n2[3]; n2[3] = l2 ? du(l2, c2, t2[4]) : c2, n2[4] = l2 ? tt2(n2[3], It2) : t2[4]; } return c2 = t2[5], c2 && (l2 = n2[5], n2[5] = l2 ? gu(l2, c2, t2[6]) : c2, n2[6] = l2 ? tt2(n2[5], It2) : t2[6]), c2 = t2[7], c2 && (n2[7] = c2), r2 & Mn2 && (n2[8] = n2[8] == null ? t2[8] : nn2(n2[8], t2[8])), n2[9] == null && (n2[9] = t2[9]), n2[0] = t2[0], n2[1] = s2, n2; } function ph(n2) { var t2 = []; if (n2 != null) for (var e2 in M2(n2)) t2.push(e2); return t2; } function dh(n2) { return Te2.call(n2); } function Du(n2, t2, e2) { return t2 = Q2(t2 === i2 ? n2.length - 1 : t2, 0), function() { for (var r2 = arguments, s2 = -1, o2 = Q2(r2.length - t2, 0), f2 = p2(o2); ++s2 < o2; ) f2[s2] = r2[t2 + s2]; s2 = -1; for (var c2 = p2(t2 + 1); ++s2 < t2; ) c2[s2] = r2[s2]; return c2[t2] = e2(f2), cn2(n2, this, c2); }; } function Hu(n2, t2) { return t2.length < 2 ? n2 : _t2(n2, Cn(t2, 0, -1)); } function gh(n2, t2) { for (var e2 = n2.length, r2 = nn2(t2.length, e2), s2 = un2(n2); r2--; ) { var o2 = t2[r2]; n2[r2] = Zn(o2, e2) ? s2[o2] : i2; } return n2; } function wi(n2, t2) { if (!(t2 === "constructor" && typeof n2[t2] == "function") && t2 != "__proto__") return n2[t2]; } var Nu = Uu(iu), le2 = bf || function(n2, t2) { return k2.setTimeout(n2, t2); }, Pi = Uu(Wc); function $u(n2, t2, e2) { var r2 = t2 + ""; return Pi(n2, uh(r2, vh(rh(r2), e2))); } function Uu(n2) { var t2 = 0, e2 = 0; return function() { var r2 = Hf(), s2 = Na - (r2 - e2); if (e2 = r2, s2 > 0) { if (++t2 >= Ha) return arguments[0]; } else t2 = 0; return n2.apply(i2, arguments); }; } function tr2(n2, t2) { var e2 = -1, r2 = n2.length, s2 = r2 - 1; for (t2 = t2 === i2 ? r2 : t2; ++e2 < t2; ) { var o2 = ei(e2, s2), f2 = n2[o2]; n2[o2] = n2[e2], n2[e2] = f2; } return n2.length = t2, n2; } var Wu = hh(function(n2) { var t2 = []; return n2.charCodeAt(0) === 46 && t2.push(""), n2.replace(ro2, function(e2, r2, s2, o2) { t2.push(s2 ? o2.replace(ho2, "$1") : r2 || e2); }), t2; }); function Wn2(n2) { if (typeof n2 == "string" || pn2(n2)) return n2; var t2 = n2 + ""; return t2 == "0" && 1 / n2 == -ht2 ? "-0" : t2; } function wt2(n2) { if (n2 != null) { try { return be2.call(n2); } catch { } try { return n2 + ""; } catch { } } return ""; } function vh(n2, t2) { return mn2(qa, function(e2) { var r2 = "_." + e2[0]; t2 & e2[1] && !Ee2(n2, r2) && n2.push(r2); }), n2.sort(); } function Fu(n2) { if (n2 instanceof H2) return n2.clone(); var t2 = new Pn(n2.__wrapped__, n2.__chain__); return t2.__actions__ = un2(n2.__actions__), t2.__index__ = n2.__index__, t2.__values__ = n2.__values__, t2; } function _h(n2, t2, e2) { (e2 ? rn2(n2, t2, e2) : t2 === i2) ? t2 = 1 : t2 = Q2(b2(t2), 0); var r2 = n2 == null ? 0 : n2.length; if (!r2 || t2 < 1) return []; for (var s2 = 0, o2 = 0, f2 = p2(Ue2(r2 / t2)); s2 < r2; ) f2[o2++] = Cn(n2, s2, s2 += t2); return f2; } function mh(n2) { for (var t2 = -1, e2 = n2 == null ? 0 : n2.length, r2 = 0, s2 = []; ++t2 < e2; ) { var o2 = n2[t2]; o2 && (s2[r2++] = o2); } return s2; } function wh() { var n2 = arguments.length; if (!n2) return []; for (var t2 = p2(n2 - 1), e2 = arguments[0], r2 = n2; r2--; ) t2[r2 - 1] = arguments[r2]; return nt2(R2(e2) ? un2(e2) : [e2], j2(t2, 1)); } var Ph = L2(function(n2, t2) { return Z2(n2) ? ue2(n2, j2(t2, 1, Z2, true)) : []; }), Ah = L2(function(n2, t2) { var e2 = In(t2); return Z2(e2) && (e2 = i2), Z2(n2) ? ue2(n2, j2(t2, 1, Z2, true), x2(e2, 2)) : []; }), Ch2 = L2(function(n2, t2) { var e2 = In(t2); return Z2(e2) && (e2 = i2), Z2(n2) ? ue2(n2, j2(t2, 1, Z2, true), i2, e2) : []; }); function Ih(n2, t2, e2) { var r2 = n2 == null ? 0 : n2.length; return r2 ? (t2 = e2 || t2 === i2 ? 1 : b2(t2), Cn(n2, t2 < 0 ? 0 : t2, r2)) : []; } function xh(n2, t2, e2) { var r2 = n2 == null ? 0 : n2.length; return r2 ? (t2 = e2 || t2 === i2 ? 1 : b2(t2), t2 = r2 - t2, Cn(n2, 0, t2 < 0 ? 0 : t2)) : []; } function Eh(n2, t2) { return n2 && n2.length ? Ze2(n2, x2(t2, 3), true, true) : []; } function yh(n2, t2) { return n2 && n2.length ? Ze2(n2, x2(t2, 3), true) : []; } function Sh(n2, t2, e2, r2) { var s2 = n2 == null ? 0 : n2.length; return s2 ? (e2 && typeof e2 != "number" && rn2(n2, t2, e2) && (e2 = 0, r2 = s2), wc(n2, t2, e2, r2)) : []; } function Mu(n2, t2, e2) { var r2 = n2 == null ? 0 : n2.length; if (!r2) return -1; var s2 = e2 == null ? 0 : b2(e2); return s2 < 0 && (s2 = Q2(r2 + s2, 0)), ye2(n2, x2(t2, 3), s2); } function qu(n2, t2, e2) { var r2 = n2 == null ? 0 : n2.length; if (!r2) return -1; var s2 = r2 - 1; return e2 !== i2 && (s2 = b2(e2), s2 = e2 < 0 ? Q2(r2 + s2, 0) : nn2(s2, r2 - 1)), ye2(n2, x2(t2, 3), s2, true); } function Bu(n2) { var t2 = n2 == null ? 0 : n2.length; return t2 ? j2(n2, 1) : []; } function Oh(n2) { var t2 = n2 == null ? 0 : n2.length; return t2 ? j2(n2, ht2) : []; } function Rh(n2, t2) { var e2 = n2 == null ? 0 : n2.length; return e2 ? (t2 = t2 === i2 ? 1 : b2(t2), j2(n2, t2)) : []; } function bh(n2) { for (var t2 = -1, e2 = n2 == null ? 0 : n2.length, r2 = {}; ++t2 < e2; ) { var s2 = n2[t2]; r2[s2[0]] = s2[1]; } return r2; } function Gu(n2) { return n2 && n2.length ? n2[0] : i2; } function Th(n2, t2, e2) { var r2 = n2 == null ? 0 : n2.length; if (!r2) return -1; var s2 = e2 == null ? 0 : b2(e2); return s2 < 0 && (s2 = Q2(r2 + s2, 0)), Tt2(n2, t2, s2); } function Lh(n2) { var t2 = n2 == null ? 0 : n2.length; return t2 ? Cn(n2, 0, -1) : []; } var Dh = L2(function(n2) { var t2 = G2(n2, ai); return t2.length && t2[0] === n2[0] ? Vr(t2) : []; }), Hh = L2(function(n2) { var t2 = In(n2), e2 = G2(n2, ai); return t2 === In(e2) ? t2 = i2 : e2.pop(), e2.length && e2[0] === n2[0] ? Vr(e2, x2(t2, 2)) : []; }), Nh = L2(function(n2) { var t2 = In(n2), e2 = G2(n2, ai); return t2 = typeof t2 == "function" ? t2 : i2, t2 && e2.pop(), e2.length && e2[0] === n2[0] ? Vr(e2, i2, t2) : []; }); function $h(n2, t2) { return n2 == null ? "" : Lf.call(n2, t2); } function In(n2) { var t2 = n2 == null ? 0 : n2.length; return t2 ? n2[t2 - 1] : i2; } function Uh(n2, t2, e2) { var r2 = n2 == null ? 0 : n2.length; if (!r2) return -1; var s2 = r2; return e2 !== i2 && (s2 = b2(e2), s2 = s2 < 0 ? Q2(r2 + s2, 0) : nn2(s2, r2 - 1)), t2 === t2 ? vf(n2, t2, s2) : ye2(n2, Is2, s2, true); } function Wh(n2, t2) { return n2 && n2.length ? nu(n2, b2(t2)) : i2; } var Fh = L2(zu); function zu(n2, t2) { return n2 && n2.length && t2 && t2.length ? ti(n2, t2) : n2; } function Mh(n2, t2, e2) { return n2 && n2.length && t2 && t2.length ? ti(n2, t2, x2(e2, 2)) : n2; } function qh(n2, t2, e2) { return n2 && n2.length && t2 && t2.length ? ti(n2, t2, i2, e2) : n2; } var Bh = Yn(function(n2, t2) { var e2 = n2 == null ? 0 : n2.length, r2 = Zr(n2, t2); return ru(n2, G2(t2, function(s2) { return Zn(s2, e2) ? +s2 : s2; }).sort(pu)), r2; }); function Gh(n2, t2) { var e2 = []; if (!(n2 && n2.length)) return e2; var r2 = -1, s2 = [], o2 = n2.length; for (t2 = x2(t2, 3); ++r2 < o2; ) { var f2 = n2[r2]; t2(f2, r2, n2) && (e2.push(f2), s2.push(r2)); } return ru(n2, s2), e2; } function Ai(n2) { return n2 == null ? n2 : $f.call(n2); } function zh(n2, t2, e2) { var r2 = n2 == null ? 0 : n2.length; return r2 ? (e2 && typeof e2 != "number" && rn2(n2, t2, e2) ? (t2 = 0, e2 = r2) : (t2 = t2 == null ? 0 : b2(t2), e2 = e2 === i2 ? r2 : b2(e2)), Cn(n2, t2, e2)) : []; } function Kh(n2, t2) { return Ye2(n2, t2); } function Yh(n2, t2, e2) { return ii(n2, t2, x2(e2, 2)); } function Zh(n2, t2) { var e2 = n2 == null ? 0 : n2.length; if (e2) { var r2 = Ye2(n2, t2); if (r2 < e2 && bn2(n2[r2], t2)) return r2; } return -1; } function Jh(n2, t2) { return Ye2(n2, t2, true); } function Xh(n2, t2, e2) { return ii(n2, t2, x2(e2, 2), true); } function Qh(n2, t2) { var e2 = n2 == null ? 0 : n2.length; if (e2) { var r2 = Ye2(n2, t2, true) - 1; if (bn2(n2[r2], t2)) return r2; } return -1; } function Vh(n2) { return n2 && n2.length ? su(n2) : []; } function kh(n2, t2) { return n2 && n2.length ? su(n2, x2(t2, 2)) : []; } function jh(n2) { var t2 = n2 == null ? 0 : n2.length; return t2 ? Cn(n2, 1, t2) : []; } function nl(n2, t2, e2) { return n2 && n2.length ? (t2 = e2 || t2 === i2 ? 1 : b2(t2), Cn(n2, 0, t2 < 0 ? 0 : t2)) : []; } function tl(n2, t2, e2) { var r2 = n2 == null ? 0 : n2.length; return r2 ? (t2 = e2 || t2 === i2 ? 1 : b2(t2), t2 = r2 - t2, Cn(n2, t2 < 0 ? 0 : t2, r2)) : []; } function el(n2, t2) { return n2 && n2.length ? Ze2(n2, x2(t2, 3), false, true) : []; } function rl(n2, t2) { return n2 && n2.length ? Ze2(n2, x2(t2, 3)) : []; } var il = L2(function(n2) { return it2(j2(n2, 1, Z2, true)); }), sl = L2(function(n2) { var t2 = In(n2); return Z2(t2) && (t2 = i2), it2(j2(n2, 1, Z2, true), x2(t2, 2)); }), ul = L2(function(n2) { var t2 = In(n2); return t2 = typeof t2 == "function" ? t2 : i2, it2(j2(n2, 1, Z2, true), i2, t2); }); function al(n2) { return n2 && n2.length ? it2(n2) : []; } function ol(n2, t2) { return n2 && n2.length ? it2(n2, x2(t2, 2)) : []; } function fl(n2, t2) { return t2 = typeof t2 == "function" ? t2 : i2, n2 && n2.length ? it2(n2, i2, t2) : []; } function Ci(n2) { if (!(n2 && n2.length)) return []; var t2 = 0; return n2 = jn(n2, function(e2) { if (Z2(e2)) return t2 = Q2(e2.length, t2), true; }), Fr2(t2, function(e2) { return G2(n2, $r2(e2)); }); } function Ku(n2, t2) { if (!(n2 && n2.length)) return []; var e2 = Ci(n2); return t2 == null ? e2 : G2(e2, function(r2) { return cn2(t2, i2, r2); }); } var cl = L2(function(n2, t2) { return Z2(n2) ? ue2(n2, t2) : []; }), hl = L2(function(n2) { return ui(jn(n2, Z2)); }), ll = L2(function(n2) { var t2 = In(n2); return Z2(t2) && (t2 = i2), ui(jn(n2, Z2), x2(t2, 2)); }), pl = L2(function(n2) { var t2 = In(n2); return t2 = typeof t2 == "function" ? t2 : i2, ui(jn(n2, Z2), i2, t2); }), dl = L2(Ci); function gl(n2, t2) { return fu(n2 || [], t2 || [], se2); } function vl(n2, t2) { return fu(n2 || [], t2 || [], fe2); } var _l = L2(function(n2) { var t2 = n2.length, e2 = t2 > 1 ? n2[t2 - 1] : i2; return e2 = typeof e2 == "function" ? (n2.pop(), e2) : i2, Ku(n2, e2); }); function Yu(n2) { var t2 = a2(n2); return t2.__chain__ = true, t2; } function ml(n2, t2) { return t2(n2), n2; } function er2(n2, t2) { return t2(n2); } var wl = Yn(function(n2) { var t2 = n2.length, e2 = t2 ? n2[0] : 0, r2 = this.__wrapped__, s2 = function(o2) { return Zr(o2, n2); }; return t2 > 1 || this.__actions__.length || !(r2 instanceof H2) || !Zn(e2) ? this.thru(s2) : (r2 = r2.slice(e2, +e2 + (t2 ? 1 : 0)), r2.__actions__.push({ func: er2, args: [s2], thisArg: i2 }), new Pn(r2, this.__chain__).thru(function(o2) { return t2 && !o2.length && o2.push(i2), o2; })); }); function Pl() { return Yu(this); } function Al() { return new Pn(this.value(), this.__chain__); } function Cl() { this.__values__ === i2 && (this.__values__ = ua(this.value())); var n2 = this.__index__ >= this.__values__.length, t2 = n2 ? i2 : this.__values__[this.__index__++]; return { done: n2, value: t2 }; } function Il() { return this; } function xl(n2) { for (var t2, e2 = this; e2 instanceof qe2; ) { var r2 = Fu(e2); r2.__index__ = 0, r2.__values__ = i2, t2 ? s2.__wrapped__ = r2 : t2 = r2; var s2 = r2; e2 = e2.__wrapped__; } return s2.__wrapped__ = n2, t2; } function El() { var n2 = this.__wrapped__; if (n2 instanceof H2) { var t2 = n2; return this.__actions__.length && (t2 = new H2(this)), t2 = t2.reverse(), t2.__actions__.push({ func: er2, args: [Ai], thisArg: i2 }), new Pn(t2, this.__chain__); } return this.thru(Ai); } function yl() { return ou(this.__wrapped__, this.__actions__); } var Sl = Je2(function(n2, t2, e2) { F2.call(n2, e2) ? ++n2[e2] : zn(n2, e2, 1); }); function Ol(n2, t2, e2) { var r2 = R2(n2) ? As2 : mc; return e2 && rn2(n2, t2, e2) && (t2 = i2), r2(n2, x2(t2, 3)); } function Rl(n2, t2) { var e2 = R2(n2) ? jn : Ks2; return e2(n2, x2(t2, 3)); } var bl = wu(Mu), Tl = wu(qu); function Ll(n2, t2) { return j2(rr2(n2, t2), 1); } function Dl(n2, t2) { return j2(rr2(n2, t2), ht2); } function Hl(n2, t2, e2) { return e2 = e2 === i2 ? 1 : b2(e2), j2(rr2(n2, t2), e2); } function Zu(n2, t2) { var e2 = R2(n2) ? mn2 : rt2; return e2(n2, x2(t2, 3)); } function Ju(n2, t2) { var e2 = R2(n2) ? ko2 : zs2; return e2(n2, x2(t2, 3)); } var Nl = Je2(function(n2, t2, e2) { F2.call(n2, e2) ? n2[e2].push(t2) : zn(n2, e2, [t2]); }); function $l(n2, t2, e2, r2) { n2 = an2(n2) ? n2 : Gt2(n2), e2 = e2 && !r2 ? b2(e2) : 0; var s2 = n2.length; return e2 < 0 && (e2 = Q2(s2 + e2, 0)), or2(n2) ? e2 <= s2 && n2.indexOf(t2, e2) > -1 : !!s2 && Tt2(n2, t2, e2) > -1; } var Ul = L2(function(n2, t2, e2) { var r2 = -1, s2 = typeof t2 == "function", o2 = an2(n2) ? p2(n2.length) : []; return rt2(n2, function(f2) { o2[++r2] = s2 ? cn2(t2, f2, e2) : ae2(f2, t2, e2); }), o2; }), Wl = Je2(function(n2, t2, e2) { zn(n2, e2, t2); }); function rr2(n2, t2) { var e2 = R2(n2) ? G2 : Vs2; return e2(n2, x2(t2, 3)); } function Fl(n2, t2, e2, r2) { return n2 == null ? [] : (R2(t2) || (t2 = t2 == null ? [] : [t2]), e2 = r2 ? i2 : e2, R2(e2) || (e2 = e2 == null ? [] : [e2]), tu(n2, t2, e2)); } var Ml = Je2(function(n2, t2, e2) { n2[e2 ? 0 : 1].push(t2); }, function() { return [[], []]; }); function ql(n2, t2, e2) { var r2 = R2(n2) ? Hr : Es2, s2 = arguments.length < 3; return r2(n2, x2(t2, 4), e2, s2, rt2); } function Bl(n2, t2, e2) { var r2 = R2(n2) ? jo2 : Es2, s2 = arguments.length < 3; return r2(n2, x2(t2, 4), e2, s2, zs2); } function Gl(n2, t2) { var e2 = R2(n2) ? jn : Ks2; return e2(n2, ur2(x2(t2, 3))); } function zl(n2) { var t2 = R2(n2) ? Ms2 : $c; return t2(n2); } function Kl(n2, t2, e2) { (e2 ? rn2(n2, t2, e2) : t2 === i2) ? t2 = 1 : t2 = b2(t2); var r2 = R2(n2) ? pc : Uc; return r2(n2, t2); } function Yl(n2) { var t2 = R2(n2) ? dc : Fc; return t2(n2); } function Zl(n2) { if (n2 == null) return 0; if (an2(n2)) return or2(n2) ? Dt2(n2) : n2.length; var t2 = tn2(n2); return t2 == yn2 || t2 == Sn ? n2.size : jr(n2).length; } function Jl(n2, t2, e2) { var r2 = R2(n2) ? Nr2 : Mc; return e2 && rn2(n2, t2, e2) && (t2 = i2), r2(n2, x2(t2, 3)); } var Xl = L2(function(n2, t2) { if (n2 == null) return []; var e2 = t2.length; return e2 > 1 && rn2(n2, t2[0], t2[1]) ? t2 = [] : e2 > 2 && rn2(t2[0], t2[1], t2[2]) && (t2 = [t2[0]]), tu(n2, j2(t2, 1), []); }), ir2 = Rf || function() { return k2.Date.now(); }; function Ql(n2, t2) { if (typeof t2 != "function") throw new wn($2); return n2 = b2(n2), function() { if (--n2 < 1) return t2.apply(this, arguments); }; } function Xu(n2, t2, e2) { return t2 = e2 ? i2 : t2, t2 = n2 && t2 == null ? n2.length : t2, Kn2(n2, Mn2, i2, i2, i2, i2, t2); } function Qu(n2, t2) { var e2; if (typeof t2 != "function") throw new wn($2); return n2 = b2(n2), function() { return --n2 > 0 && (e2 = t2.apply(this, arguments)), n2 <= 1 && (t2 = i2), e2; }; } var Ii = L2(function(n2, t2, e2) { var r2 = vn2; if (e2.length) { var s2 = tt2(e2, qt2(Ii)); r2 |= Hn2; } return Kn2(n2, r2, t2, e2, s2); }), Vu = L2(function(n2, t2, e2) { var r2 = vn2 | ct2; if (e2.length) { var s2 = tt2(e2, qt2(Vu)); r2 |= Hn2; } return Kn2(t2, r2, n2, e2, s2); }); function ku(n2, t2, e2) { t2 = e2 ? i2 : t2; var r2 = Kn2(n2, Dn2, i2, i2, i2, i2, i2, t2); return r2.placeholder = ku.placeholder, r2; } function ju(n2, t2, e2) { t2 = e2 ? i2 : t2; var r2 = Kn2(n2, yt2, i2, i2, i2, i2, i2, t2); return r2.placeholder = ju.placeholder, r2; } function na(n2, t2, e2) { var r2, s2, o2, f2, c2, l2, v2 = 0, _2 = false, m2 = false, w2 = true; if (typeof n2 != "function") throw new wn($2); t2 = xn2(t2) || 0, K2(e2) && (_2 = !!e2.leading, m2 = "maxWait" in e2, o2 = m2 ? Q2(xn2(e2.maxWait) || 0, t2) : o2, w2 = "trailing" in e2 ? !!e2.trailing : w2); function I2(J2) { var Tn = r2, Qn2 = s2; return r2 = s2 = i2, v2 = J2, f2 = n2.apply(Qn2, Tn), f2; } function E2(J2) { return v2 = J2, c2 = le2(D2, t2), _2 ? I2(J2) : f2; } function T2(J2) { var Tn = J2 - l2, Qn2 = J2 - v2, wa = t2 - Tn; return m2 ? nn2(wa, o2 - Qn2) : wa; } function y2(J2) { var Tn = J2 - l2, Qn2 = J2 - v2; return l2 === i2 || Tn >= t2 || Tn < 0 || m2 && Qn2 >= o2; } function D2() { var J2 = ir2(); if (y2(J2)) return N2(J2); c2 = le2(D2, T2(J2)); } function N2(J2) { return c2 = i2, w2 && r2 ? I2(J2) : (r2 = s2 = i2, f2); } function dn2() { c2 !== i2 && cu(c2), v2 = 0, r2 = l2 = s2 = c2 = i2; } function sn2() { return c2 === i2 ? f2 : N2(ir2()); } function gn2() { var J2 = ir2(), Tn = y2(J2); if (r2 = arguments, s2 = this, l2 = J2, Tn) { if (c2 === i2) return E2(l2); if (m2) return cu(c2), c2 = le2(D2, t2), I2(l2); } return c2 === i2 && (c2 = le2(D2, t2)), f2; } return gn2.cancel = dn2, gn2.flush = sn2, gn2; } var Vl = L2(function(n2, t2) { return Gs2(n2, 1, t2); }), kl = L2(function(n2, t2, e2) { return Gs2(n2, xn2(t2) || 0, e2); }); function jl(n2) { return Kn2(n2, dr2); } function sr2(n2, t2) { if (typeof n2 != "function" || t2 != null && typeof t2 != "function") throw new wn($2); var e2 = function() { var r2 = arguments, s2 = t2 ? t2.apply(this, r2) : r2[0], o2 = e2.cache; if (o2.has(s2)) return o2.get(s2); var f2 = n2.apply(this, r2); return e2.cache = o2.set(s2, f2) || o2, f2; }; return e2.cache = new (sr2.Cache || Gn2)(), e2; } sr2.Cache = Gn2; function ur2(n2) { if (typeof n2 != "function") throw new wn($2); return function() { var t2 = arguments; switch (t2.length) { case 0: return !n2.call(this); case 1: return !n2.call(this, t2[0]); case 2: return !n2.call(this, t2[0], t2[1]); case 3: return !n2.call(this, t2[0], t2[1], t2[2]); } return !n2.apply(this, t2); }; } function np(n2) { return Qu(2, n2); } var tp = qc(function(n2, t2) { t2 = t2.length == 1 && R2(t2[0]) ? G2(t2[0], hn2(x2())) : G2(j2(t2, 1), hn2(x2())); var e2 = t2.length; return L2(function(r2) { for (var s2 = -1, o2 = nn2(r2.length, e2); ++s2 < o2; ) r2[s2] = t2[s2].call(this, r2[s2]); return cn2(n2, this, r2); }); }), xi = L2(function(n2, t2) { var e2 = tt2(t2, qt2(xi)); return Kn2(n2, Hn2, i2, t2, e2); }), ta = L2(function(n2, t2) { var e2 = tt2(t2, qt2(ta)); return Kn2(n2, St2, i2, t2, e2); }), ep = Yn(function(n2, t2) { return Kn2(n2, Kt2, i2, i2, i2, t2); }); function rp(n2, t2) { if (typeof n2 != "function") throw new wn($2); return t2 = t2 === i2 ? t2 : b2(t2), L2(n2, t2); } function ip(n2, t2) { if (typeof n2 != "function") throw new wn($2); return t2 = t2 == null ? 0 : Q2(b2(t2), 0), L2(function(e2) { var r2 = e2[t2], s2 = ut2(e2, 0, t2); return r2 && nt2(s2, r2), cn2(n2, this, s2); }); } function sp(n2, t2, e2) { var r2 = true, s2 = true; if (typeof n2 != "function") throw new wn($2); return K2(e2) && (r2 = "leading" in e2 ? !!e2.leading : r2, s2 = "trailing" in e2 ? !!e2.trailing : s2), na(n2, t2, { leading: r2, maxWait: t2, trailing: s2 }); } function up(n2) { return Xu(n2, 1); } function ap(n2, t2) { return xi(oi(t2), n2); } function op() { if (!arguments.length) return []; var n2 = arguments[0]; return R2(n2) ? n2 : [n2]; } function fp(n2) { return An(n2, xt2); } function cp(n2, t2) { return t2 = typeof t2 == "function" ? t2 : i2, An(n2, xt2, t2); } function hp(n2) { return An(n2, Ln2 | xt2); } function lp(n2, t2) { return t2 = typeof t2 == "function" ? t2 : i2, An(n2, Ln2 | xt2, t2); } function pp(n2, t2) { return t2 == null || Bs2(n2, t2, V2(t2)); } function bn2(n2, t2) { return n2 === t2 || n2 !== n2 && t2 !== t2; } var dp = ke2(Qr), gp = ke2(function(n2, t2) { return n2 >= t2; }), Pt2 = Js2(function() { return arguments; }()) ? Js2 : function(n2) { return Y2(n2) && F2.call(n2, "callee") && !Hs2.call(n2, "callee"); }, R2 = p2.isArray, vp = gs2 ? hn2(gs2) : xc; function an2(n2) { return n2 != null && ar2(n2.length) && !Jn2(n2); } function Z2(n2) { return Y2(n2) && an2(n2); } function _p(n2) { return n2 === true || n2 === false || Y2(n2) && en2(n2) == Yt2; } var at2 = Tf || Ni, mp = vs2 ? hn2(vs2) : Ec; function wp(n2) { return Y2(n2) && n2.nodeType === 1 && !pe2(n2); } function Pp(n2) { if (n2 == null) return true; if (an2(n2) && (R2(n2) || typeof n2 == "string" || typeof n2.splice == "function" || at2(n2) || Bt2(n2) || Pt2(n2))) return !n2.length; var t2 = tn2(n2); if (t2 == yn2 || t2 == Sn) return !n2.size; if (he2(n2)) return !jr(n2).length; for (var e2 in n2) if (F2.call(n2, e2)) return false; return true; } function Ap(n2, t2) { return oe2(n2, t2); } function Cp(n2, t2, e2) { e2 = typeof e2 == "function" ? e2 : i2; var r2 = e2 ? e2(n2, t2) : i2; return r2 === i2 ? oe2(n2, t2, i2, e2) : !!r2; } function Ei(n2) { if (!Y2(n2)) return false; var t2 = en2(n2); return t2 == we2 || t2 == Ga || typeof n2.message == "string" && typeof n2.name == "string" && !pe2(n2); } function Ip(n2) { return typeof n2 == "number" && $s2(n2); } function Jn2(n2) { if (!K2(n2)) return false; var t2 = en2(n2); return t2 == Pe2 || t2 == Gi2 || t2 == Ba || t2 == Ka; } function ea(n2) { return typeof n2 == "number" && n2 == b2(n2); } function ar2(n2) { return typeof n2 == "number" && n2 > -1 && n2 % 1 == 0 && n2 <= kn2; } function K2(n2) { var t2 = typeof n2; return n2 != null && (t2 == "object" || t2 == "function"); } function Y2(n2) { return n2 != null && typeof n2 == "object"; } var ra = _s2 ? hn2(_s2) : Sc; function xp(n2, t2) { return n2 === t2 || kr(n2, t2, gi(t2)); } function Ep(n2, t2, e2) { return e2 = typeof e2 == "function" ? e2 : i2, kr(n2, t2, gi(t2), e2); } function yp(n2) { return ia(n2) && n2 != +n2; } function Sp(n2) { if (ch2(n2)) throw new S2(O2); return Xs2(n2); } function Op(n2) { return n2 === null; } function Rp(n2) { return n2 == null; } function ia(n2) { return typeof n2 == "number" || Y2(n2) && en2(n2) == Jt2; } function pe2(n2) { if (!Y2(n2) || en2(n2) != qn2) return false; var t2 = He2(n2); if (t2 === null) return true; var e2 = F2.call(t2, "constructor") && t2.constructor; return typeof e2 == "function" && e2 instanceof e2 && be2.call(e2) == Ef; } var yi = ms2 ? hn2(ms2) : Oc; function bp(n2) { return ea(n2) && n2 >= -kn2 && n2 <= kn2; } var sa = ws2 ? hn2(ws2) : Rc; function or2(n2) { return typeof n2 == "string" || !R2(n2) && Y2(n2) && en2(n2) == Qt2; } function pn2(n2) { return typeof n2 == "symbol" || Y2(n2) && en2(n2) == Ae2; } var Bt2 = Ps2 ? hn2(Ps2) : bc; function Tp(n2) { return n2 === i2; } function Lp(n2) { return Y2(n2) && tn2(n2) == Vt2; } function Dp(n2) { return Y2(n2) && en2(n2) == Za; } var Hp = ke2(ni), Np = ke2(function(n2, t2) { return n2 <= t2; }); function ua(n2) { if (!n2) return []; if (an2(n2)) return or2(n2) ? On(n2) : un2(n2); if (ne2 && n2[ne2]) return pf(n2[ne2]()); var t2 = tn2(n2), e2 = t2 == yn2 ? qr : t2 == Sn ? Se : Gt2; return e2(n2); } function Xn2(n2) { if (!n2) return n2 === 0 ? n2 : 0; if (n2 = xn2(n2), n2 === ht2 || n2 === -ht2) { var t2 = n2 < 0 ? -1 : 1; return t2 * Wa; } return n2 === n2 ? n2 : 0; } function b2(n2) { var t2 = Xn2(n2), e2 = t2 % 1; return t2 === t2 ? e2 ? t2 - e2 : t2 : 0; } function aa(n2) { return n2 ? vt2(b2(n2), 0, Nn) : 0; } function xn2(n2) { if (typeof n2 == "number") return n2; if (pn2(n2)) return _e2; if (K2(n2)) { var t2 = typeof n2.valueOf == "function" ? n2.valueOf() : n2; n2 = K2(t2) ? t2 + "" : t2; } if (typeof n2 != "string") return n2 === 0 ? n2 : +n2; n2 = ys2(n2); var e2 = go2.test(n2); return e2 || _o2.test(n2) ? Xo2(n2.slice(2), e2 ? 2 : 8) : po2.test(n2) ? _e2 : +n2; } function oa(n2) { return Un2(n2, on2(n2)); } function $p(n2) { return n2 ? vt2(b2(n2), -kn2, kn2) : n2 === 0 ? n2 : 0; } function W2(n2) { return n2 == null ? "" : ln2(n2); } var Up = Ft2(function(n2, t2) { if (he2(t2) || an2(t2)) { Un2(t2, V2(t2), n2); return; } for (var e2 in t2) F2.call(t2, e2) && se2(n2, e2, t2[e2]); }), fa = Ft2(function(n2, t2) { Un2(t2, on2(t2), n2); }), fr = Ft2(function(n2, t2, e2, r2) { Un2(t2, on2(t2), n2, r2); }), Wp = Ft2(function(n2, t2, e2, r2) { Un2(t2, V2(t2), n2, r2); }), Fp = Yn(Zr); function Mp(n2, t2) { var e2 = Wt2(n2); return t2 == null ? e2 : qs2(e2, t2); } var qp = L2(function(n2, t2) { n2 = M2(n2); var e2 = -1, r2 = t2.length, s2 = r2 > 2 ? t2[2] : i2; for (s2 && rn2(t2[0], t2[1], s2) && (r2 = 1); ++e2 < r2; ) for (var o2 = t2[e2], f2 = on2(o2), c2 = -1, l2 = f2.length; ++c2 < l2; ) { var v2 = f2[c2], _2 = n2[v2]; (_2 === i2 || bn2(_2, Nt2[v2]) && !F2.call(n2, v2)) && (n2[v2] = o2[v2]); } return n2; }), Bp = L2(function(n2) { return n2.push(i2, yu), cn2(ca, i2, n2); }); function Gp(n2, t2) { return Cs2(n2, x2(t2, 3), $n); } function zp(n2, t2) { return Cs2(n2, x2(t2, 3), Xr); } function Kp(n2, t2) { return n2 == null ? n2 : Jr(n2, x2(t2, 3), on2); } function Yp(n2, t2) { return n2 == null ? n2 : Ys2(n2, x2(t2, 3), on2); } function Zp(n2, t2) { return n2 && $n(n2, x2(t2, 3)); } function Jp(n2, t2) { return n2 && Xr(n2, x2(t2, 3)); } function Xp(n2) { return n2 == null ? [] : ze2(n2, V2(n2)); } function Qp(n2) { return n2 == null ? [] : ze2(n2, on2(n2)); } function Si(n2, t2, e2) { var r2 = n2 == null ? i2 : _t2(n2, t2); return r2 === i2 ? e2 : r2; } function Vp(n2, t2) { return n2 != null && Ru(n2, t2, Pc); } function Oi(n2, t2) { return n2 != null && Ru(n2, t2, Ac); } var kp = Au(function(n2, t2, e2) { t2 != null && typeof t2.toString != "function" && (t2 = Te2.call(t2)), n2[t2] = e2; }, bi(fn2)), jp = Au(function(n2, t2, e2) { t2 != null && typeof t2.toString != "function" && (t2 = Te2.call(t2)), F2.call(n2, t2) ? n2[t2].push(e2) : n2[t2] = [e2]; }, x2), nd = L2(ae2); function V2(n2) { return an2(n2) ? Fs2(n2) : jr(n2); } function on2(n2) { return an2(n2) ? Fs2(n2, true) : Tc(n2); } function td(n2, t2) { var e2 = {}; return t2 = x2(t2, 3), $n(n2, function(r2, s2, o2) { zn(e2, t2(r2, s2, o2), r2); }), e2; } function ed(n2, t2) { var e2 = {}; return t2 = x2(t2, 3), $n(n2, function(r2, s2, o2) { zn(e2, s2, t2(r2, s2, o2)); }), e2; } var rd = Ft2(function(n2, t2, e2) { Ke2(n2, t2, e2); }), ca = Ft2(function(n2, t2, e2, r2) { Ke2(n2, t2, e2, r2); }), id2 = Yn(function(n2, t2) { var e2 = {}; if (n2 == null) return e2; var r2 = false; t2 = G2(t2, function(o2) { return o2 = st2(o2, n2), r2 || (r2 = o2.length > 1), o2; }), Un2(n2, pi(n2), e2), r2 && (e2 = An(e2, Ln2 | Fn2 | xt2, kc)); for (var s2 = t2.length; s2--; ) si(e2, t2[s2]); return e2; }); function sd(n2, t2) { return ha(n2, ur2(x2(t2))); } var ud = Yn(function(n2, t2) { return n2 == null ? {} : Dc(n2, t2); }); function ha(n2, t2) { if (n2 == null) return {}; var e2 = G2(pi(n2), function(r2) { return [r2]; }); return t2 = x2(t2), eu(n2, e2, function(r2, s2) { return t2(r2, s2[0]); }); } function ad(n2, t2, e2) { t2 = st2(t2, n2); var r2 = -1, s2 = t2.length; for (s2 || (s2 = 1, n2 = i2); ++r2 < s2; ) { var o2 = n2 == null ? i2 : n2[Wn2(t2[r2])]; o2 === i2 && (r2 = s2, o2 = e2), n2 = Jn2(o2) ? o2.call(n2) : o2; } return n2; } function od(n2, t2, e2) { return n2 == null ? n2 : fe2(n2, t2, e2); } function fd(n2, t2, e2, r2) { return r2 = typeof r2 == "function" ? r2 : i2, n2 == null ? n2 : fe2(n2, t2, e2, r2); } var la = xu(V2), pa = xu(on2); function cd(n2, t2, e2) { var r2 = R2(n2), s2 = r2 || at2(n2) || Bt2(n2); if (t2 = x2(t2, 4), e2 == null) { var o2 = n2 && n2.constructor; s2 ? e2 = r2 ? new o2() : [] : K2(n2) ? e2 = Jn2(o2) ? Wt2(He2(n2)) : {} : e2 = {}; } return (s2 ? mn2 : $n)(n2, function(f2, c2, l2) { return t2(e2, f2, c2, l2); }), e2; } function hd(n2, t2) { return n2 == null ? true : si(n2, t2); } function ld(n2, t2, e2) { return n2 == null ? n2 : au(n2, t2, oi(e2)); } function pd(n2, t2, e2, r2) { return r2 = typeof r2 == "function" ? r2 : i2, n2 == null ? n2 : au(n2, t2, oi(e2), r2); } function Gt2(n2) { return n2 == null ? [] : Mr2(n2, V2(n2)); } function dd(n2) { return n2 == null ? [] : Mr2(n2, on2(n2)); } function gd(n2, t2, e2) { return e2 === i2 && (e2 = t2, t2 = i2), e2 !== i2 && (e2 = xn2(e2), e2 = e2 === e2 ? e2 : 0), t2 !== i2 && (t2 = xn2(t2), t2 = t2 === t2 ? t2 : 0), vt2(xn2(n2), t2, e2); } function vd(n2, t2, e2) { return t2 = Xn2(t2), e2 === i2 ? (e2 = t2, t2 = 0) : e2 = Xn2(e2), n2 = xn2(n2), Cc(n2, t2, e2); } function _d(n2, t2, e2) { if (e2 && typeof e2 != "boolean" && rn2(n2, t2, e2) && (t2 = e2 = i2), e2 === i2 && (typeof t2 == "boolean" ? (e2 = t2, t2 = i2) : typeof n2 == "boolean" && (e2 = n2, n2 = i2)), n2 === i2 && t2 === i2 ? (n2 = 0, t2 = 1) : (n2 = Xn2(n2), t2 === i2 ? (t2 = n2, n2 = 0) : t2 = Xn2(t2)), n2 > t2) { var r2 = n2; n2 = t2, t2 = r2; } if (e2 || n2 % 1 || t2 % 1) { var s2 = Us2(); return nn2(n2 + s2 * (t2 - n2 + Jo2("1e-" + ((s2 + "").length - 1))), t2); } return ei(n2, t2); } var md = Mt2(function(n2, t2, e2) { return t2 = t2.toLowerCase(), n2 + (e2 ? da(t2) : t2); }); function da(n2) { return Ri(W2(n2).toLowerCase()); } function ga(n2) { return n2 = W2(n2), n2 && n2.replace(wo2, of).replace(Wo2, ""); } function wd(n2, t2, e2) { n2 = W2(n2), t2 = ln2(t2); var r2 = n2.length; e2 = e2 === i2 ? r2 : vt2(b2(e2), 0, r2); var s2 = e2; return e2 -= t2.length, e2 >= 0 && n2.slice(e2, s2) == t2; } function Pd(n2) { return n2 = W2(n2), n2 && ka.test(n2) ? n2.replace(Yi2, ff) : n2; } function Ad(n2) { return n2 = W2(n2), n2 && io2.test(n2) ? n2.replace(xr2, "\\$&") : n2; } var Cd = Mt2(function(n2, t2, e2) { return n2 + (e2 ? "-" : "") + t2.toLowerCase(); }), Id = Mt2(function(n2, t2, e2) { return n2 + (e2 ? " " : "") + t2.toLowerCase(); }), xd = mu("toLowerCase"); function Ed(n2, t2, e2) { n2 = W2(n2), t2 = b2(t2); var r2 = t2 ? Dt2(n2) : 0; if (!t2 || r2 >= t2) return n2; var s2 = (t2 - r2) / 2; return Ve2(We2(s2), e2) + n2 + Ve2(Ue2(s2), e2); } function yd(n2, t2, e2) { n2 = W2(n2), t2 = b2(t2); var r2 = t2 ? Dt2(n2) : 0; return t2 && r2 < t2 ? n2 + Ve2(t2 - r2, e2) : n2; } function Sd(n2, t2, e2) { n2 = W2(n2), t2 = b2(t2); var r2 = t2 ? Dt2(n2) : 0; return t2 && r2 < t2 ? Ve2(t2 - r2, e2) + n2 : n2; } function Od(n2, t2, e2) { return e2 || t2 == null ? t2 = 0 : t2 && (t2 = +t2), Nf(W2(n2).replace(Er, ""), t2 || 0); } function Rd(n2, t2, e2) { return (e2 ? rn2(n2, t2, e2) : t2 === i2) ? t2 = 1 : t2 = b2(t2), ri(W2(n2), t2); } function bd() { var n2 = arguments, t2 = W2(n2[0]); return n2.length < 3 ? t2 : t2.replace(n2[1], n2[2]); } var Td = Mt2(function(n2, t2, e2) { return n2 + (e2 ? "_" : "") + t2.toLowerCase(); }); function Ld(n2, t2, e2) { return e2 && typeof e2 != "number" && rn2(n2, t2, e2) && (t2 = e2 = i2), e2 = e2 === i2 ? Nn : e2 >>> 0, e2 ? (n2 = W2(n2), n2 && (typeof t2 == "string" || t2 != null && !yi(t2)) && (t2 = ln2(t2), !t2 && Lt2(n2)) ? ut2(On(n2), 0, e2) : n2.split(t2, e2)) : []; } var Dd = Mt2(function(n2, t2, e2) { return n2 + (e2 ? " " : "") + Ri(t2); }); function Hd(n2, t2, e2) { return n2 = W2(n2), e2 = e2 == null ? 0 : vt2(b2(e2), 0, n2.length), t2 = ln2(t2), n2.slice(e2, e2 + t2.length) == t2; } function Nd(n2, t2, e2) { var r2 = a2.templateSettings; e2 && rn2(n2, t2, e2) && (t2 = i2), n2 = W2(n2), t2 = fr({}, t2, r2, Eu); var s2 = fr({}, t2.imports, r2.imports, Eu), o2 = V2(s2), f2 = Mr2(s2, o2), c2, l2, v2 = 0, _2 = t2.interpolate || Ce2, m2 = "__p += '", w2 = Br((t2.escape || Ce2).source + "|" + _2.source + "|" + (_2 === Zi2 ? lo2 : Ce2).source + "|" + (t2.evaluate || Ce2).source + "|$", "g"), I2 = "//# sourceURL=" + (F2.call(t2, "sourceURL") ? (t2.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++Go2 + "]") + ` `; n2.replace(w2, function(y2, D2, N2, dn2, sn2, gn2) { return N2 || (N2 = dn2), m2 += n2.slice(v2, gn2).replace(Po2, cf), D2 && (c2 = true, m2 += `' + __e(` + D2 + `) + '`), sn2 && (l2 = true, m2 += `'; ` + sn2 + `; __p += '`), N2 && (m2 += `' + ((__t = (` + N2 + `)) == null ? '' : __t) + '`), v2 = gn2 + y2.length, y2; }), m2 += `'; `; var E2 = F2.call(t2, "variable") && t2.variable; if (!E2) m2 = `with (obj) { ` + m2 + ` } `; else if (co2.test(E2)) throw new S2(En); m2 = (l2 ? m2.replace(Ja, "") : m2).replace(Xa, "$1").replace(Qa, "$1;"), m2 = "function(" + (E2 || "obj") + `) { ` + (E2 ? "" : `obj || (obj = {}); `) + "var __t, __p = ''" + (c2 ? ", __e = _.escape" : "") + (l2 ? `, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } ` : `; `) + m2 + `return __p }`; var T2 = _a2(function() { return U2(o2, I2 + "return " + m2).apply(i2, f2); }); if (T2.source = m2, Ei(T2)) throw T2; return T2; } function $d(n2) { return W2(n2).toLowerCase(); } function Ud(n2) { return W2(n2).toUpperCase(); } function Wd(n2, t2, e2) { if (n2 = W2(n2), n2 && (e2 || t2 === i2)) return ys2(n2); if (!n2 || !(t2 = ln2(t2))) return n2; var r2 = On(n2), s2 = On(t2), o2 = Ss2(r2, s2), f2 = Os2(r2, s2) + 1; return ut2(r2, o2, f2).join(""); } function Fd(n2, t2, e2) { if (n2 = W2(n2), n2 && (e2 || t2 === i2)) return n2.slice(0, bs2(n2) + 1); if (!n2 || !(t2 = ln2(t2))) return n2; var r2 = On(n2), s2 = Os2(r2, On(t2)) + 1; return ut2(r2, 0, s2).join(""); } function Md(n2, t2, e2) { if (n2 = W2(n2), n2 && (e2 || t2 === i2)) return n2.replace(Er, ""); if (!n2 || !(t2 = ln2(t2))) return n2; var r2 = On(n2), s2 = Ss2(r2, On(t2)); return ut2(r2, s2).join(""); } function qd(n2, t2) { var e2 = La, r2 = Da; if (K2(t2)) { var s2 = "separator" in t2 ? t2.separator : s2; e2 = "length" in t2 ? b2(t2.length) : e2, r2 = "omission" in t2 ? ln2(t2.omission) : r2; } n2 = W2(n2); var o2 = n2.length; if (Lt2(n2)) { var f2 = On(n2); o2 = f2.length; } if (e2 >= o2) return n2; var c2 = e2 - Dt2(r2); if (c2 < 1) return r2; var l2 = f2 ? ut2(f2, 0, c2).join("") : n2.slice(0, c2); if (s2 === i2) return l2 + r2; if (f2 && (c2 += l2.length - c2), yi(s2)) { if (n2.slice(c2).search(s2)) { var v2, _2 = l2; for (s2.global || (s2 = Br(s2.source, W2(Ji2.exec(s2)) + "g")), s2.lastIndex = 0; v2 = s2.exec(_2); ) var m2 = v2.index; l2 = l2.slice(0, m2 === i2 ? c2 : m2); } } else if (n2.indexOf(ln2(s2), c2) != c2) { var w2 = l2.lastIndexOf(s2); w2 > -1 && (l2 = l2.slice(0, w2)); } return l2 + r2; } function Bd(n2) { return n2 = W2(n2), n2 && Va.test(n2) ? n2.replace(Ki, _f) : n2; } var Gd = Mt2(function(n2, t2, e2) { return n2 + (e2 ? " " : "") + t2.toUpperCase(); }), Ri = mu("toUpperCase"); function va(n2, t2, e2) { return n2 = W2(n2), t2 = e2 ? i2 : t2, t2 === i2 ? lf(n2) ? Pf(n2) : ef(n2) : n2.match(t2) || []; } var _a2 = L2(function(n2, t2) { try { return cn2(n2, i2, t2); } catch (e2) { return Ei(e2) ? e2 : new S2(e2); } }), zd = Yn(function(n2, t2) { return mn2(t2, function(e2) { e2 = Wn2(e2), zn(n2, e2, Ii(n2[e2], n2)); }), n2; }); function Kd(n2) { var t2 = n2 == null ? 0 : n2.length, e2 = x2(); return n2 = t2 ? G2(n2, function(r2) { if (typeof r2[1] != "function") throw new wn($2); return [e2(r2[0]), r2[1]]; }) : [], L2(function(r2) { for (var s2 = -1; ++s2 < t2; ) { var o2 = n2[s2]; if (cn2(o2[0], this, r2)) return cn2(o2[1], this, r2); } }); } function Yd(n2) { return _c2(An(n2, Ln2)); } function bi(n2) { return function() { return n2; }; } function Zd(n2, t2) { return n2 == null || n2 !== n2 ? t2 : n2; } var Jd = Pu(), Xd = Pu(true); function fn2(n2) { return n2; } function Ti(n2) { return Qs2(typeof n2 == "function" ? n2 : An(n2, Ln2)); } function Qd(n2) { return ks2(An(n2, Ln2)); } function Vd(n2, t2) { return js2(n2, An(t2, Ln2)); } var kd = L2(function(n2, t2) { return function(e2) { return ae2(e2, n2, t2); }; }), jd = L2(function(n2, t2) { return function(e2) { return ae2(n2, e2, t2); }; }); function Li(n2, t2, e2) { var r2 = V2(t2), s2 = ze2(t2, r2); e2 == null && !(K2(t2) && (s2.length || !r2.length)) && (e2 = t2, t2 = n2, n2 = this, s2 = ze2(t2, V2(t2))); var o2 = !(K2(e2) && "chain" in e2) || !!e2.chain, f2 = Jn2(n2); return mn2(s2, function(c2) { var l2 = t2[c2]; n2[c2] = l2, f2 && (n2.prototype[c2] = function() { var v2 = this.__chain__; if (o2 || v2) { var _2 = n2(this.__wrapped__), m2 = _2.__actions__ = un2(this.__actions__); return m2.push({ func: l2, args: arguments, thisArg: n2 }), _2.__chain__ = v2, _2; } return l2.apply(n2, nt2([this.value()], arguments)); }); }), n2; } function ng() { return k2._ === this && (k2._ = yf), this; } function Di() { } function tg(n2) { return n2 = b2(n2), L2(function(t2) { return nu(t2, n2); }); } var eg = ci(G2), rg = ci(As2), ig = ci(Nr2); function ma(n2) { return _i(n2) ? $r2(Wn2(n2)) : Hc(n2); } function sg(n2) { return function(t2) { return n2 == null ? i2 : _t2(n2, t2); }; } var ug = Cu(), ag = Cu(true); function Hi2() { return []; } function Ni() { return false; } function og() { return {}; } function fg() { return ""; } function cg() { return true; } function hg(n2, t2) { if (n2 = b2(n2), n2 < 1 || n2 > kn2) return []; var e2 = Nn, r2 = nn2(n2, Nn); t2 = x2(t2), n2 -= Nn; for (var s2 = Fr2(r2, t2); ++e2 < n2; ) t2(e2); return s2; } function lg(n2) { return R2(n2) ? G2(n2, Wn2) : pn2(n2) ? [n2] : un2(Wu(W2(n2))); } function pg(n2) { var t2 = ++xf; return W2(n2) + t2; } var dg = Qe2(function(n2, t2) { return n2 + t2; }, 0), gg = hi("ceil"), vg = Qe2(function(n2, t2) { return n2 / t2; }, 1), _g = hi("floor"); function mg(n2) { return n2 && n2.length ? Ge2(n2, fn2, Qr) : i2; } function wg(n2, t2) { return n2 && n2.length ? Ge2(n2, x2(t2, 2), Qr) : i2; } function Pg(n2) { return xs2(n2, fn2); } function Ag(n2, t2) { return xs2(n2, x2(t2, 2)); } function Cg(n2) { return n2 && n2.length ? Ge2(n2, fn2, ni) : i2; } function Ig(n2, t2) { return n2 && n2.length ? Ge2(n2, x2(t2, 2), ni) : i2; } var xg = Qe2(function(n2, t2) { return n2 * t2; }, 1), Eg = hi("round"), yg = Qe2(function(n2, t2) { return n2 - t2; }, 0); function Sg(n2) { return n2 && n2.length ? Wr(n2, fn2) : 0; } function Og(n2, t2) { return n2 && n2.length ? Wr(n2, x2(t2, 2)) : 0; } return a2.after = Ql, a2.ary = Xu, a2.assign = Up, a2.assignIn = fa, a2.assignInWith = fr, a2.assignWith = Wp, a2.at = Fp, a2.before = Qu, a2.bind = Ii, a2.bindAll = zd, a2.bindKey = Vu, a2.castArray = op, a2.chain = Yu, a2.chunk = _h, a2.compact = mh, a2.concat = wh, a2.cond = Kd, a2.conforms = Yd, a2.constant = bi, a2.countBy = Sl, a2.create = Mp, a2.curry = ku, a2.curryRight = ju, a2.debounce = na, a2.defaults = qp, a2.defaultsDeep = Bp, a2.defer = Vl, a2.delay = kl, a2.difference = Ph, a2.differenceBy = Ah, a2.differenceWith = Ch2, a2.drop = Ih, a2.dropRight = xh, a2.dropRightWhile = Eh, a2.dropWhile = yh, a2.fill = Sh, a2.filter = Rl, a2.flatMap = Ll, a2.flatMapDeep = Dl, a2.flatMapDepth = Hl, a2.flatten = Bu, a2.flattenDeep = Oh, a2.flattenDepth = Rh, a2.flip = jl, a2.flow = Jd, a2.flowRight = Xd, a2.fromPairs = bh, a2.functions = Xp, a2.functionsIn = Qp, a2.groupBy = Nl, a2.initial = Lh, a2.intersection = Dh, a2.intersectionBy = Hh, a2.intersectionWith = Nh, a2.invert = kp, a2.invertBy = jp, a2.invokeMap = Ul, a2.iteratee = Ti, a2.keyBy = Wl, a2.keys = V2, a2.keysIn = on2, a2.map = rr2, a2.mapKeys = td, a2.mapValues = ed, a2.matches = Qd, a2.matchesProperty = Vd, a2.memoize = sr2, a2.merge = rd, a2.mergeWith = ca, a2.method = kd, a2.methodOf = jd, a2.mixin = Li, a2.negate = ur2, a2.nthArg = tg, a2.omit = id2, a2.omitBy = sd, a2.once = np, a2.orderBy = Fl, a2.over = eg, a2.overArgs = tp, a2.overEvery = rg, a2.overSome = ig, a2.partial = xi, a2.partialRight = ta, a2.partition = Ml, a2.pick = ud, a2.pickBy = ha, a2.property = ma, a2.propertyOf = sg, a2.pull = Fh, a2.pullAll = zu, a2.pullAllBy = Mh, a2.pullAllWith = qh, a2.pullAt = Bh, a2.range = ug, a2.rangeRight = ag, a2.rearg = ep, a2.reject = Gl, a2.remove = Gh, a2.rest = rp, a2.reverse = Ai, a2.sampleSize = Kl, a2.set = od, a2.setWith = fd, a2.shuffle = Yl, a2.slice = zh, a2.sortBy = Xl, a2.sortedUniq = Vh, a2.sortedUniqBy = kh, a2.split = Ld, a2.spread = ip, a2.tail = jh, a2.take = nl, a2.takeRight = tl, a2.takeRightWhile = el, a2.takeWhile = rl, a2.tap = ml, a2.throttle = sp, a2.thru = er2, a2.toArray = ua, a2.toPairs = la, a2.toPairsIn = pa, a2.toPath = lg, a2.toPlainObject = oa, a2.transform = cd, a2.unary = up, a2.union = il, a2.unionBy = sl, a2.unionWith = ul, a2.uniq = al, a2.uniqBy = ol, a2.uniqWith = fl, a2.unset = hd, a2.unzip = Ci, a2.unzipWith = Ku, a2.update = ld, a2.updateWith = pd, a2.values = Gt2, a2.valuesIn = dd, a2.without = cl, a2.words = va, a2.wrap = ap, a2.xor = hl, a2.xorBy = ll, a2.xorWith = pl, a2.zip = dl, a2.zipObject = gl, a2.zipObjectDeep = vl, a2.zipWith = _l, a2.entries = la, a2.entriesIn = pa, a2.extend = fa, a2.extendWith = fr, Li(a2, a2), a2.add = dg, a2.attempt = _a2, a2.camelCase = md, a2.capitalize = da, a2.ceil = gg, a2.clamp = gd, a2.clone = fp, a2.cloneDeep = hp, a2.cloneDeepWith = lp, a2.cloneWith = cp, a2.conformsTo = pp, a2.deburr = ga, a2.defaultTo = Zd, a2.divide = vg, a2.endsWith = wd, a2.eq = bn2, a2.escape = Pd, a2.escapeRegExp = Ad, a2.every = Ol, a2.find = bl, a2.findIndex = Mu, a2.findKey = Gp, a2.findLast = Tl, a2.findLastIndex = qu, a2.findLastKey = zp, a2.floor = _g, a2.forEach = Zu, a2.forEachRight = Ju, a2.forIn = Kp, a2.forInRight = Yp, a2.forOwn = Zp, a2.forOwnRight = Jp, a2.get = Si, a2.gt = dp, a2.gte = gp, a2.has = Vp, a2.hasIn = Oi, a2.head = Gu, a2.identity = fn2, a2.includes = $l, a2.indexOf = Th, a2.inRange = vd, a2.invoke = nd, a2.isArguments = Pt2, a2.isArray = R2, a2.isArrayBuffer = vp, a2.isArrayLike = an2, a2.isArrayLikeObject = Z2, a2.isBoolean = _p, a2.isBuffer = at2, a2.isDate = mp, a2.isElement = wp, a2.isEmpty = Pp, a2.isEqual = Ap, a2.isEqualWith = Cp, a2.isError = Ei, a2.isFinite = Ip, a2.isFunction = Jn2, a2.isInteger = ea, a2.isLength = ar2, a2.isMap = ra, a2.isMatch = xp, a2.isMatchWith = Ep, a2.isNaN = yp, a2.isNative = Sp, a2.isNil = Rp, a2.isNull = Op, a2.isNumber = ia, a2.isObject = K2, a2.isObjectLike = Y2, a2.isPlainObject = pe2, a2.isRegExp = yi, a2.isSafeInteger = bp, a2.isSet = sa, a2.isString = or2, a2.isSymbol = pn2, a2.isTypedArray = Bt2, a2.isUndefined = Tp, a2.isWeakMap = Lp, a2.isWeakSet = Dp, a2.join = $h, a2.kebabCase = Cd, a2.last = In, a2.lastIndexOf = Uh, a2.lowerCase = Id, a2.lowerFirst = xd, a2.lt = Hp, a2.lte = Np, a2.max = mg, a2.maxBy = wg, a2.mean = Pg, a2.meanBy = Ag, a2.min = Cg, a2.minBy = Ig, a2.stubArray = Hi2, a2.stubFalse = Ni, a2.stubObject = og, a2.stubString = fg, a2.stubTrue = cg, a2.multiply = xg, a2.nth = Wh, a2.noConflict = ng, a2.noop = Di, a2.now = ir2, a2.pad = Ed, a2.padEnd = yd, a2.padStart = Sd, a2.parseInt = Od, a2.random = _d, a2.reduce = ql, a2.reduceRight = Bl, a2.repeat = Rd, a2.replace = bd, a2.result = ad, a2.round = Eg, a2.runInContext = h2, a2.sample = zl, a2.size = Zl, a2.snakeCase = Td, a2.some = Jl, a2.sortedIndex = Kh, a2.sortedIndexBy = Yh, a2.sortedIndexOf = Zh, a2.sortedLastIndex = Jh, a2.sortedLastIndexBy = Xh, a2.sortedLastIndexOf = Qh, a2.startCase = Dd, a2.startsWith = Hd, a2.subtract = yg, a2.sum = Sg, a2.sumBy = Og, a2.template = Nd, a2.times = hg, a2.toFinite = Xn2, a2.toInteger = b2, a2.toLength = aa, a2.toLower = $d, a2.toNumber = xn2, a2.toSafeInteger = $p, a2.toString = W2, a2.toUpper = Ud, a2.trim = Wd, a2.trimEnd = Fd, a2.trimStart = Md, a2.truncate = qd, a2.unescape = Bd, a2.uniqueId = pg, a2.upperCase = Gd, a2.upperFirst = Ri, a2.each = Zu, a2.eachRight = Ju, a2.first = Gu, Li(a2, function() { var n2 = {}; return $n(a2, function(t2, e2) { F2.call(a2.prototype, e2) || (n2[e2] = t2); }), n2; }(), { chain: false }), a2.VERSION = d2, mn2(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(n2) { a2[n2].placeholder = a2; }), mn2(["drop", "take"], function(n2, t2) { H2.prototype[n2] = function(e2) { e2 = e2 === i2 ? 1 : Q2(b2(e2), 0); var r2 = this.__filtered__ && !t2 ? new H2(this) : this.clone(); return r2.__filtered__ ? r2.__takeCount__ = nn2(e2, r2.__takeCount__) : r2.__views__.push({ size: nn2(e2, Nn), type: n2 + (r2.__dir__ < 0 ? "Right" : "") }), r2; }, H2.prototype[n2 + "Right"] = function(e2) { return this.reverse()[n2](e2).reverse(); }; }), mn2(["filter", "map", "takeWhile"], function(n2, t2) { var e2 = t2 + 1, r2 = e2 == Bi || e2 == Ua; H2.prototype[n2] = function(s2) { var o2 = this.clone(); return o2.__iteratees__.push({ iteratee: x2(s2, 3), type: e2 }), o2.__filtered__ = o2.__filtered__ || r2, o2; }; }), mn2(["head", "last"], function(n2, t2) { var e2 = "take" + (t2 ? "Right" : ""); H2.prototype[n2] = function() { return this[e2](1).value()[0]; }; }), mn2(["initial", "tail"], function(n2, t2) { var e2 = "drop" + (t2 ? "" : "Right"); H2.prototype[n2] = function() { return this.__filtered__ ? new H2(this) : this[e2](1); }; }), H2.prototype.compact = function() { return this.filter(fn2); }, H2.prototype.find = function(n2) { return this.filter(n2).head(); }, H2.prototype.findLast = function(n2) { return this.reverse().find(n2); }, H2.prototype.invokeMap = L2(function(n2, t2) { return typeof n2 == "function" ? new H2(this) : this.map(function(e2) { return ae2(e2, n2, t2); }); }), H2.prototype.reject = function(n2) { return this.filter(ur2(x2(n2))); }, H2.prototype.slice = function(n2, t2) { n2 = b2(n2); var e2 = this; return e2.__filtered__ && (n2 > 0 || t2 < 0) ? new H2(e2) : (n2 < 0 ? e2 = e2.takeRight(-n2) : n2 && (e2 = e2.drop(n2)), t2 !== i2 && (t2 = b2(t2), e2 = t2 < 0 ? e2.dropRight(-t2) : e2.take(t2 - n2)), e2); }, H2.prototype.takeRightWhile = function(n2) { return this.reverse().takeWhile(n2).reverse(); }, H2.prototype.toArray = function() { return this.take(Nn); }, $n(H2.prototype, function(n2, t2) { var e2 = /^(?:filter|find|map|reject)|While$/.test(t2), r2 = /^(?:head|last)$/.test(t2), s2 = a2[r2 ? "take" + (t2 == "last" ? "Right" : "") : t2], o2 = r2 || /^find/.test(t2); s2 && (a2.prototype[t2] = function() { var f2 = this.__wrapped__, c2 = r2 ? [1] : arguments, l2 = f2 instanceof H2, v2 = c2[0], _2 = l2 || R2(f2), m2 = function(D2) { var N2 = s2.apply(a2, nt2([D2], c2)); return r2 && w2 ? N2[0] : N2; }; _2 && e2 && typeof v2 == "function" && v2.length != 1 && (l2 = _2 = false); var w2 = this.__chain__, I2 = !!this.__actions__.length, E2 = o2 && !w2, T2 = l2 && !I2; if (!o2 && _2) { f2 = T2 ? f2 : new H2(this); var y2 = n2.apply(f2, c2); return y2.__actions__.push({ func: er2, args: [m2], thisArg: i2 }), new Pn(y2, w2); } return E2 && T2 ? n2.apply(this, c2) : (y2 = this.thru(m2), E2 ? r2 ? y2.value()[0] : y2.value() : y2); }); }), mn2(["pop", "push", "shift", "sort", "splice", "unshift"], function(n2) { var t2 = Oe2[n2], e2 = /^(?:push|sort|unshift)$/.test(n2) ? "tap" : "thru", r2 = /^(?:pop|shift)$/.test(n2); a2.prototype[n2] = function() { var s2 = arguments; if (r2 && !this.__chain__) { var o2 = this.value(); return t2.apply(R2(o2) ? o2 : [], s2); } return this[e2](function(f2) { return t2.apply(R2(f2) ? f2 : [], s2); }); }; }), $n(H2.prototype, function(n2, t2) { var e2 = a2[t2]; if (e2) { var r2 = e2.name + ""; F2.call(Ut2, r2) || (Ut2[r2] = []), Ut2[r2].push({ name: t2, func: e2 }); } }), Ut2[Xe2(i2, ct2).name] = [{ name: "wrapper", func: i2 }], H2.prototype.clone = Bf, H2.prototype.reverse = Gf, H2.prototype.value = zf, a2.prototype.at = wl, a2.prototype.chain = Pl, a2.prototype.commit = Al, a2.prototype.next = Cl, a2.prototype.plant = xl, a2.prototype.reverse = El, a2.prototype.toJSON = a2.prototype.valueOf = a2.prototype.value = yl, a2.prototype.first = a2.prototype.head, ne2 && (a2.prototype[ne2] = Il), a2; }, Ht2 = Af(); lt2 ? ((lt2.exports = Ht2)._ = Ht2, Tr2._ = Ht2) : k2._ = Ht2; }).call(ge); })(Ui, Ui.exports); var Bg = Object.defineProperty, Gg = Object.defineProperties, zg = Object.getOwnPropertyDescriptors, Ea = Object.getOwnPropertySymbols, Kg = Object.prototype.hasOwnProperty, Yg = Object.prototype.propertyIsEnumerable, ya = (C2, u2, i2) => u2 in C2 ? Bg(C2, u2, { enumerable: true, configurable: true, writable: true, value: i2 }) : C2[u2] = i2, cr$1 = (C2, u2) => { for (var i2 in u2 || (u2 = {})) Kg.call(u2, i2) && ya(C2, i2, u2[i2]); if (Ea) for (var i2 of Ea(u2)) Yg.call(u2, i2) && ya(C2, i2, u2[i2]); return C2; }, Zg = (C2, u2) => Gg(C2, zg(u2)); function ft$1(C2, u2, i2) { var d2; const P2 = ve$1(C2); return ((d2 = u2.rpcMap) == null ? void 0 : d2[P2.reference]) || `${qg}?chainId=${P2.namespace}:${P2.reference}&projectId=${i2}`; } function Ct$1(C2) { return C2.includes(":") ? C2.split(":")[1] : C2; } function Sa(C2) { return C2.map((u2) => `${u2.split(":")[0]}:${u2.split(":")[1]}`); } function Jg(C2, u2) { const i2 = Object.keys(u2.namespaces).filter((P2) => P2.includes(C2)); if (!i2.length) return []; const d2 = []; return i2.forEach((P2) => { const O2 = u2.namespaces[P2].accounts; d2.push(...O2); }), d2; } function Xg(C2 = {}, u2 = {}) { const i2 = Oa(C2), d2 = Oa(u2); return Ui.exports.merge(i2, d2); } function Oa(C2) { var u2, i2, d2, P2; const O2 = {}; if (!B$6(C2)) return O2; for (const [$2, En] of Object.entries(C2)) { const zt2 = oe$3($2) ? [$2] : En.chains, pr2 = En.methods || [], It2 = En.events || [], Ln2 = En.rpcMap || {}, Fn2 = en($2); O2[Fn2] = Zg(cr$1(cr$1({}, O2[Fn2]), En), { chains: S$8(zt2, (u2 = O2[Fn2]) == null ? void 0 : u2.chains), methods: S$8(pr2, (i2 = O2[Fn2]) == null ? void 0 : i2.methods), events: S$8(It2, (d2 = O2[Fn2]) == null ? void 0 : d2.events), rpcMap: cr$1(cr$1({}, Ln2), (P2 = O2[Fn2]) == null ? void 0 : P2.rpcMap) }); } return O2; } function Qg(C2) { return C2.includes(":") ? C2.split(":")[2] : C2; } function Vg(C2) { const u2 = {}; for (const [i2, d2] of Object.entries(C2)) { const P2 = d2.methods || [], O2 = d2.events || [], $2 = d2.accounts || [], En = oe$3(i2) ? [i2] : d2.chains ? d2.chains : Sa(d2.accounts); u2[i2] = { chains: En, methods: P2, events: O2, accounts: $2 }; } return u2; } function Wi(C2) { return typeof C2 == "number" ? C2 : C2.includes("0x") ? parseInt(C2, 16) : C2.includes(":") ? Number(C2.split(":")[1]) : Number(C2); } const Ra = {}, z$2 = (C2) => Ra[C2], Fi = (C2, u2) => { Ra[C2] = u2; }; class kg { constructor(u2) { this.name = "polkadot", this.namespace = u2.namespace, this.events = z$2("events"), this.client = z$2("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders(); } updateNamespace(u2) { this.namespace = Object.assign(this.namespace, u2); } requestAccounts() { return this.getAccounts(); } getDefaultChain() { if (this.chainId) return this.chainId; if (this.namespace.defaultChain) return this.namespace.defaultChain; const u2 = this.namespace.chains[0]; if (!u2) throw new Error("ChainId not found"); return u2.split(":")[1]; } request(u2) { return this.namespace.methods.includes(u2.request.method) ? this.client.request(u2) : this.getHttpProvider().request(u2.request); } setDefaultChain(u2, i2) { this.httpProviders[u2] || this.setHttpProvider(u2, i2), this.chainId = u2, this.events.emit(Vn.DEFAULT_CHAIN_CHANGED, `${this.name}:${u2}`); } getAccounts() { const u2 = this.namespace.accounts; return u2 ? u2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]) || [] : []; } createHttpProviders() { const u2 = {}; return this.namespace.chains.forEach((i2) => { var d2; const P2 = Ct$1(i2); u2[P2] = this.createHttpProvider(P2, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); }), u2; } getHttpProvider() { const u2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[u2]; if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${u2} not found`); return i2; } setHttpProvider(u2, i2) { const d2 = this.createHttpProvider(u2, i2); d2 && (this.httpProviders[u2] = d2); } createHttpProvider(u2, i2) { const d2 = i2 || ft$1(u2, this.namespace, this.client.core.projectId); if (!d2) throw new Error(`No RPC url provided for chainId: ${u2}`); return new JsonRpcProvider(new f$2(d2, z$2("disableProviderPing"))); } } class jg { constructor(u2) { this.name = "eip155", this.namespace = u2.namespace, this.events = z$2("events"), this.client = z$2("client"), this.httpProviders = this.createHttpProviders(), this.chainId = parseInt(this.getDefaultChain()); } async request(u2) { switch (u2.request.method) { case "eth_requestAccounts": return this.getAccounts(); case "eth_accounts": return this.getAccounts(); case "wallet_switchEthereumChain": return await this.handleSwitchChain(u2); case "eth_chainId": return parseInt(this.getDefaultChain()); } return this.namespace.methods.includes(u2.request.method) ? await this.client.request(u2) : this.getHttpProvider().request(u2.request); } updateNamespace(u2) { this.namespace = Object.assign(this.namespace, u2); } setDefaultChain(u2, i2) { this.httpProviders[u2] || this.setHttpProvider(parseInt(u2), i2), this.chainId = parseInt(u2), this.events.emit(Vn.DEFAULT_CHAIN_CHANGED, `${this.name}:${u2}`); } requestAccounts() { return this.getAccounts(); } getDefaultChain() { if (this.chainId) return this.chainId.toString(); if (this.namespace.defaultChain) return this.namespace.defaultChain; const u2 = this.namespace.chains[0]; if (!u2) throw new Error("ChainId not found"); return u2.split(":")[1]; } createHttpProvider(u2, i2) { const d2 = i2 || ft$1(`${this.name}:${u2}`, this.namespace, this.client.core.projectId); if (!d2) throw new Error(`No RPC url provided for chainId: ${u2}`); return new JsonRpcProvider(new f$2(d2, z$2("disableProviderPing"))); } setHttpProvider(u2, i2) { const d2 = this.createHttpProvider(u2, i2); d2 && (this.httpProviders[u2] = d2); } createHttpProviders() { const u2 = {}; return this.namespace.chains.forEach((i2) => { var d2; const P2 = parseInt(Ct$1(i2)); u2[P2] = this.createHttpProvider(P2, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); }), u2; } getAccounts() { const u2 = this.namespace.accounts; return u2 ? [...new Set(u2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } getHttpProvider() { const u2 = this.chainId, i2 = this.httpProviders[u2]; if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${u2} not found`); return i2; } async handleSwitchChain(u2) { var i2, d2; let P2 = u2.request.params ? (i2 = u2.request.params[0]) == null ? void 0 : i2.chainId : "0x0"; P2 = P2.startsWith("0x") ? P2 : `0x${P2}`; const O2 = parseInt(P2, 16); if (this.isChainApproved(O2)) this.setDefaultChain(`${O2}`); else if (this.namespace.methods.includes("wallet_switchEthereumChain")) await this.client.request({ topic: u2.topic, request: { method: u2.request.method, params: [{ chainId: P2 }] }, chainId: (d2 = this.namespace.chains) == null ? void 0 : d2[0] }), this.setDefaultChain(`${O2}`); else throw new Error(`Failed to switch to chain 'eip155:${O2}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`); return null; } isChainApproved(u2) { return this.namespace.chains.includes(`${this.name}:${u2}`); } } class nv { constructor(u2) { this.name = "solana", this.namespace = u2.namespace, this.events = z$2("events"), this.client = z$2("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders(); } updateNamespace(u2) { this.namespace = Object.assign(this.namespace, u2); } requestAccounts() { return this.getAccounts(); } request(u2) { return this.namespace.methods.includes(u2.request.method) ? this.client.request(u2) : this.getHttpProvider().request(u2.request); } setDefaultChain(u2, i2) { this.httpProviders[u2] || this.setHttpProvider(u2, i2), this.chainId = u2, this.events.emit(Vn.DEFAULT_CHAIN_CHANGED, `${this.name}:${u2}`); } getDefaultChain() { if (this.chainId) return this.chainId; if (this.namespace.defaultChain) return this.namespace.defaultChain; const u2 = this.namespace.chains[0]; if (!u2) throw new Error("ChainId not found"); return u2.split(":")[1]; } getAccounts() { const u2 = this.namespace.accounts; return u2 ? [...new Set(u2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } createHttpProviders() { const u2 = {}; return this.namespace.chains.forEach((i2) => { var d2; const P2 = Ct$1(i2); u2[P2] = this.createHttpProvider(P2, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); }), u2; } getHttpProvider() { const u2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[u2]; if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${u2} not found`); return i2; } setHttpProvider(u2, i2) { const d2 = this.createHttpProvider(u2, i2); d2 && (this.httpProviders[u2] = d2); } createHttpProvider(u2, i2) { const d2 = i2 || ft$1(u2, this.namespace, this.client.core.projectId); if (!d2) throw new Error(`No RPC url provided for chainId: ${u2}`); return new JsonRpcProvider(new f$2(d2, z$2("disableProviderPing"))); } } class tv { constructor(u2) { this.name = "cosmos", this.namespace = u2.namespace, this.events = z$2("events"), this.client = z$2("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders(); } updateNamespace(u2) { this.namespace = Object.assign(this.namespace, u2); } requestAccounts() { return this.getAccounts(); } getDefaultChain() { if (this.chainId) return this.chainId; if (this.namespace.defaultChain) return this.namespace.defaultChain; const u2 = this.namespace.chains[0]; if (!u2) throw new Error("ChainId not found"); return u2.split(":")[1]; } request(u2) { return this.namespace.methods.includes(u2.request.method) ? this.client.request(u2) : this.getHttpProvider().request(u2.request); } setDefaultChain(u2, i2) { this.httpProviders[u2] || this.setHttpProvider(u2, i2), this.chainId = u2, this.events.emit(Vn.DEFAULT_CHAIN_CHANGED, `${this.name}:${this.chainId}`); } getAccounts() { const u2 = this.namespace.accounts; return u2 ? [...new Set(u2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } createHttpProviders() { const u2 = {}; return this.namespace.chains.forEach((i2) => { var d2; const P2 = Ct$1(i2); u2[P2] = this.createHttpProvider(P2, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); }), u2; } getHttpProvider() { const u2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[u2]; if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${u2} not found`); return i2; } setHttpProvider(u2, i2) { const d2 = this.createHttpProvider(u2, i2); d2 && (this.httpProviders[u2] = d2); } createHttpProvider(u2, i2) { const d2 = i2 || ft$1(u2, this.namespace, this.client.core.projectId); if (!d2) throw new Error(`No RPC url provided for chainId: ${u2}`); return new JsonRpcProvider(new f$2(d2, z$2("disableProviderPing"))); } } class ev { constructor(u2) { this.name = "cip34", this.namespace = u2.namespace, this.events = z$2("events"), this.client = z$2("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders(); } updateNamespace(u2) { this.namespace = Object.assign(this.namespace, u2); } requestAccounts() { return this.getAccounts(); } getDefaultChain() { if (this.chainId) return this.chainId; if (this.namespace.defaultChain) return this.namespace.defaultChain; const u2 = this.namespace.chains[0]; if (!u2) throw new Error("ChainId not found"); return u2.split(":")[1]; } request(u2) { return this.namespace.methods.includes(u2.request.method) ? this.client.request(u2) : this.getHttpProvider().request(u2.request); } setDefaultChain(u2, i2) { this.httpProviders[u2] || this.setHttpProvider(u2, i2), this.chainId = u2, this.events.emit(Vn.DEFAULT_CHAIN_CHANGED, `${this.name}:${this.chainId}`); } getAccounts() { const u2 = this.namespace.accounts; return u2 ? [...new Set(u2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } createHttpProviders() { const u2 = {}; return this.namespace.chains.forEach((i2) => { const d2 = this.getCardanoRPCUrl(i2), P2 = Ct$1(i2); u2[P2] = this.createHttpProvider(P2, d2); }), u2; } getHttpProvider() { const u2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[u2]; if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${u2} not found`); return i2; } getCardanoRPCUrl(u2) { const i2 = this.namespace.rpcMap; if (i2) return i2[u2]; } setHttpProvider(u2, i2) { const d2 = this.createHttpProvider(u2, i2); d2 && (this.httpProviders[u2] = d2); } createHttpProvider(u2, i2) { const d2 = i2 || this.getCardanoRPCUrl(u2); if (!d2) throw new Error(`No RPC url provided for chainId: ${u2}`); return new JsonRpcProvider(new f$2(d2, z$2("disableProviderPing"))); } } class rv { constructor(u2) { this.name = "elrond", this.namespace = u2.namespace, this.events = z$2("events"), this.client = z$2("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders(); } updateNamespace(u2) { this.namespace = Object.assign(this.namespace, u2); } requestAccounts() { return this.getAccounts(); } request(u2) { return this.namespace.methods.includes(u2.request.method) ? this.client.request(u2) : this.getHttpProvider().request(u2.request); } setDefaultChain(u2, i2) { this.httpProviders[u2] || this.setHttpProvider(u2, i2), this.chainId = u2, this.events.emit(Vn.DEFAULT_CHAIN_CHANGED, `${this.name}:${u2}`); } getDefaultChain() { if (this.chainId) return this.chainId; if (this.namespace.defaultChain) return this.namespace.defaultChain; const u2 = this.namespace.chains[0]; if (!u2) throw new Error("ChainId not found"); return u2.split(":")[1]; } getAccounts() { const u2 = this.namespace.accounts; return u2 ? [...new Set(u2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } createHttpProviders() { const u2 = {}; return this.namespace.chains.forEach((i2) => { var d2; const P2 = Ct$1(i2); u2[P2] = this.createHttpProvider(P2, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); }), u2; } getHttpProvider() { const u2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[u2]; if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${u2} not found`); return i2; } setHttpProvider(u2, i2) { const d2 = this.createHttpProvider(u2, i2); d2 && (this.httpProviders[u2] = d2); } createHttpProvider(u2, i2) { const d2 = i2 || ft$1(u2, this.namespace, this.client.core.projectId); if (!d2) throw new Error(`No RPC url provided for chainId: ${u2}`); return new JsonRpcProvider(new f$2(d2, z$2("disableProviderPing"))); } } class iv { constructor(u2) { this.name = "multiversx", this.namespace = u2.namespace, this.events = z$2("events"), this.client = z$2("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders(); } updateNamespace(u2) { this.namespace = Object.assign(this.namespace, u2); } requestAccounts() { return this.getAccounts(); } request(u2) { return this.namespace.methods.includes(u2.request.method) ? this.client.request(u2) : this.getHttpProvider().request(u2.request); } setDefaultChain(u2, i2) { this.httpProviders[u2] || this.setHttpProvider(u2, i2), this.chainId = u2, this.events.emit(Vn.DEFAULT_CHAIN_CHANGED, `${this.name}:${u2}`); } getDefaultChain() { if (this.chainId) return this.chainId; if (this.namespace.defaultChain) return this.namespace.defaultChain; const u2 = this.namespace.chains[0]; if (!u2) throw new Error("ChainId not found"); return u2.split(":")[1]; } getAccounts() { const u2 = this.namespace.accounts; return u2 ? [...new Set(u2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]))] : []; } createHttpProviders() { const u2 = {}; return this.namespace.chains.forEach((i2) => { var d2; const P2 = Ct$1(i2); u2[P2] = this.createHttpProvider(P2, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); }), u2; } getHttpProvider() { const u2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[u2]; if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${u2} not found`); return i2; } setHttpProvider(u2, i2) { const d2 = this.createHttpProvider(u2, i2); d2 && (this.httpProviders[u2] = d2); } createHttpProvider(u2, i2) { const d2 = i2 || ft$1(u2, this.namespace, this.client.core.projectId); if (!d2) throw new Error(`No RPC url provided for chainId: ${u2}`); return new JsonRpcProvider(new f$2(d2, z$2("disableProviderPing"))); } } class sv { constructor(u2) { this.name = "near", this.namespace = u2.namespace, this.events = z$2("events"), this.client = z$2("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders(); } updateNamespace(u2) { this.namespace = Object.assign(this.namespace, u2); } requestAccounts() { return this.getAccounts(); } getDefaultChain() { if (this.chainId) return this.chainId; if (this.namespace.defaultChain) return this.namespace.defaultChain; const u2 = this.namespace.chains[0]; if (!u2) throw new Error("ChainId not found"); return u2.split(":")[1]; } request(u2) { return this.namespace.methods.includes(u2.request.method) ? this.client.request(u2) : this.getHttpProvider().request(u2.request); } setDefaultChain(u2, i2) { if (this.chainId = u2, !this.httpProviders[u2]) { const d2 = i2 || ft$1(`${this.name}:${u2}`, this.namespace); if (!d2) throw new Error(`No RPC url provided for chainId: ${u2}`); this.setHttpProvider(u2, d2); } this.events.emit(Vn.DEFAULT_CHAIN_CHANGED, `${this.name}:${this.chainId}`); } getAccounts() { const u2 = this.namespace.accounts; return u2 ? u2.filter((i2) => i2.split(":")[1] === this.chainId.toString()).map((i2) => i2.split(":")[2]) || [] : []; } createHttpProviders() { const u2 = {}; return this.namespace.chains.forEach((i2) => { var d2; u2[i2] = this.createHttpProvider(i2, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); }), u2; } getHttpProvider() { const u2 = `${this.name}:${this.chainId}`, i2 = this.httpProviders[u2]; if (typeof i2 > "u") throw new Error(`JSON-RPC provider for ${u2} not found`); return i2; } setHttpProvider(u2, i2) { const d2 = this.createHttpProvider(u2, i2); d2 && (this.httpProviders[u2] = d2); } createHttpProvider(u2, i2) { const d2 = i2 || ft$1(u2, this.namespace); return typeof d2 > "u" ? void 0 : new JsonRpcProvider(new f$2(d2, z$2("disableProviderPing"))); } } var uv = Object.defineProperty, av = Object.defineProperties, ov = Object.getOwnPropertyDescriptors, ba = Object.getOwnPropertySymbols, fv = Object.prototype.hasOwnProperty, cv = Object.prototype.propertyIsEnumerable, Ta = (C2, u2, i2) => u2 in C2 ? uv(C2, u2, { enumerable: true, configurable: true, writable: true, value: i2 }) : C2[u2] = i2, hr$1 = (C2, u2) => { for (var i2 in u2 || (u2 = {})) fv.call(u2, i2) && Ta(C2, i2, u2[i2]); if (ba) for (var i2 of ba(u2)) cv.call(u2, i2) && Ta(C2, i2, u2[i2]); return C2; }, Mi = (C2, u2) => av(C2, ov(u2)); let lr$1 = class lr2 { constructor(u2) { this.events = new $g(), this.rpcProviders = {}, this.shouldAbortPairingAttempt = false, this.maxPairingAttempts = 10, this.disableProviderPing = false, this.providerOpts = u2, this.logger = typeof (u2 == null ? void 0 : u2.logger) < "u" && typeof (u2 == null ? void 0 : u2.logger) != "string" ? u2.logger : Dg(k$2({ level: (u2 == null ? void 0 : u2.logger) || Ia })), this.disableProviderPing = (u2 == null ? void 0 : u2.disableProviderPing) || false; } static async init(u2) { const i2 = new lr2(u2); return await i2.initialize(), i2; } async request(u2, i2) { const [d2, P2] = this.validateChain(i2); if (!this.session) throw new Error("Please call connect() before request()"); return await this.getProvider(d2).request({ request: hr$1({}, u2), chainId: `${d2}:${P2}`, topic: this.session.topic }); } sendAsync(u2, i2, d2) { const P2 = (/* @__PURE__ */ new Date()).getTime(); this.request(u2, d2).then((O2) => i2(null, formatJsonRpcResult(P2, O2))).catch((O2) => i2(O2, 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 u2; if (!this.session) throw new Error("Please call connect() before enable()"); await this.client.disconnect({ topic: (u2 = this.session) == null ? void 0 : u2.topic, reason: U$3("USER_DISCONNECTED") }), await this.cleanup(); } async connect(u2) { if (!this.client) throw new Error("Sign Client not initialized"); if (this.setNamespaces(u2), await this.cleanupPendingPairings(), !u2.skipPairing) return await this.pair(u2.pairingTopic); } on(u2, i2) { this.events.on(u2, i2); } once(u2, i2) { this.events.once(u2, i2); } removeListener(u2, i2) { this.events.removeListener(u2, i2); } off(u2, i2) { this.events.off(u2, i2); } get isWalletConnect() { return true; } async pair(u2) { this.shouldAbortPairingAttempt = false; let i2 = 0; do { if (this.shouldAbortPairingAttempt) throw new Error("Pairing aborted"); if (i2 >= this.maxPairingAttempts) throw new Error("Max auto pairing attempts reached"); const { uri: d2, approval: P2 } = await this.client.connect({ pairingTopic: u2, requiredNamespaces: this.namespaces, optionalNamespaces: this.optionalNamespaces, sessionProperties: this.sessionProperties }); d2 && (this.uri = d2, this.events.emit("display_uri", d2)), await P2().then((O2) => { this.session = O2, this.namespaces || (this.namespaces = Vg(O2.namespaces), this.persist("namespaces", this.namespaces)); }).catch((O2) => { if (O2.message !== oe$2) throw O2; i2++; }); } while (!this.session); return this.onConnect(), this.session; } setDefaultChain(u2, i2) { try { if (!this.session) return; const [d2, P2] = this.validateChain(u2); this.getProvider(d2).setDefaultChain(P2, i2); } catch (d2) { if (!/Please call connect/.test(d2.message)) throw d2; } } async cleanupPendingPairings(u2 = {}) { this.logger.info("Cleaning up inactive pairings..."); const i2 = this.client.pairing.getAll(); if (k$6(i2)) { for (const d2 of i2) u2.deletePairings ? this.client.core.expirer.set(d2.topic, 0) : await this.client.core.relayer.subscriber.unsubscribe(d2.topic); this.logger.info(`Inactive pairings cleared: ${i2.length}`); } } abortPairingAttempt() { this.shouldAbortPairingAttempt = true; } async checkStorage() { if (this.namespaces = await this.getFromStore("namespaces"), this.optionalNamespaces = await this.getFromStore("optionalNamespaces") || {}, this.client.session.length) { const u2 = this.client.session.keys.length - 1; this.session = this.client.session.get(this.client.session.keys[u2]), this.createProviders(); } } async initialize() { this.logger.trace("Initialized"), await this.createClient(), await this.checkStorage(), this.registerEventListeners(); } async createClient() { this.client = this.providerOpts.client || await Q$3.init({ logger: this.providerOpts.logger || Ia, relayUrl: this.providerOpts.relayUrl || Wg, projectId: this.providerOpts.projectId, metadata: this.providerOpts.metadata, storageOptions: this.providerOpts.storageOptions, storage: this.providerOpts.storage, name: this.providerOpts.name }), 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 u2 = [...new Set(Object.keys(this.session.namespaces).map((i2) => en(i2)))]; Fi("client", this.client), Fi("events", this.events), Fi("disableProviderPing", this.disableProviderPing), u2.forEach((i2) => { if (!this.session) return; const d2 = Jg(i2, this.session), P2 = Sa(d2), O2 = Xg(this.namespaces, this.optionalNamespaces), $2 = Mi(hr$1({}, O2[i2]), { accounts: d2, chains: P2 }); switch (i2) { case "eip155": this.rpcProviders[i2] = new jg({ namespace: $2 }); break; case "solana": this.rpcProviders[i2] = new nv({ namespace: $2 }); break; case "cosmos": this.rpcProviders[i2] = new tv({ namespace: $2 }); break; case "polkadot": this.rpcProviders[i2] = new kg({ namespace: $2 }); break; case "cip34": this.rpcProviders[i2] = new ev({ namespace: $2 }); break; case "elrond": this.rpcProviders[i2] = new rv({ namespace: $2 }); break; case "multiversx": this.rpcProviders[i2] = new iv({ namespace: $2 }); break; case "near": this.rpcProviders[i2] = new sv({ namespace: $2 }); break; } }); } registerEventListeners() { if (typeof this.client > "u") throw new Error("Sign Client is not initialized"); this.client.on("session_ping", (u2) => { this.events.emit("session_ping", u2); }), this.client.on("session_event", (u2) => { const { params: i2 } = u2, { event: d2 } = i2; if (d2.name === "accountsChanged") { const P2 = d2.data; P2 && k$6(P2) && this.events.emit("accountsChanged", P2.map(Qg)); } else if (d2.name === "chainChanged") { const P2 = i2.chainId, O2 = i2.event.data, $2 = en(P2), En = Wi(P2) !== Wi(O2) ? `${$2}:${Wi(O2)}` : P2; this.onChainChanged(En); } else this.events.emit(d2.name, d2.data); this.events.emit("session_event", u2); }), this.client.on("session_update", ({ topic: u2, params: i2 }) => { var d2; const { namespaces: P2 } = i2, O2 = (d2 = this.client) == null ? void 0 : d2.session.get(u2); this.session = Mi(hr$1({}, O2), { namespaces: P2 }), this.onSessionUpdate(), this.events.emit("session_update", { topic: u2, params: i2 }); }), this.client.on("session_delete", async (u2) => { await this.cleanup(), this.events.emit("session_delete", u2), this.events.emit("disconnect", Mi(hr$1({}, U$3("USER_DISCONNECTED")), { data: u2.topic })); }), this.on(Vn.DEFAULT_CHAIN_CHANGED, (u2) => { this.onChainChanged(u2, true); }); } getProvider(u2) { if (!this.rpcProviders[u2]) throw new Error(`Provider not found: ${u2}`); return this.rpcProviders[u2]; } onSessionUpdate() { Object.keys(this.rpcProviders).forEach((u2) => { var i2; this.getProvider(u2).updateNamespace((i2 = this.session) == null ? void 0 : i2.namespaces[u2]); }); } setNamespaces(u2) { const { namespaces: i2, optionalNamespaces: d2, sessionProperties: P2 } = u2; i2 && Object.keys(i2).length && (this.namespaces = i2), d2 && Object.keys(d2).length && (this.optionalNamespaces = d2), this.sessionProperties = P2, this.persist("namespaces", i2), this.persist("optionalNamespaces", d2); } validateChain(u2) { const [i2, d2] = (u2 == null ? void 0 : u2.split(":")) || ["", ""]; if (!this.namespaces || !Object.keys(this.namespaces).length) return [i2, d2]; if (i2 && !Object.keys(this.namespaces || {}).map(($2) => en($2)).includes(i2)) throw new Error(`Namespace '${i2}' is not configured. Please call connect() first with namespace config.`); if (i2 && d2) return [i2, d2]; const P2 = en(Object.keys(this.namespaces)[0]), O2 = this.rpcProviders[P2].getDefaultChain(); return [P2, O2]; } async requestAccounts() { const [u2] = this.validateChain(); return await this.getProvider(u2).requestAccounts(); } onChainChanged(u2, i2 = false) { var d2; if (!this.namespaces) return; const [P2, O2] = this.validateChain(u2); i2 || this.getProvider(P2).setDefaultChain(O2), ((d2 = this.namespaces[P2]) != null ? d2 : this.namespaces[`${P2}:${O2}`]).defaultChain = O2, this.persist("namespaces", this.namespaces), this.events.emit("chainChanged", O2); } 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: true }); } persist(u2, i2) { this.client.core.storage.setItem(`${xa}/${u2}`, i2); } async getFromStore(u2) { return await this.client.core.storage.getItem(`${xa}/${u2}`); } }; const hv = lr$1; const P$1 = "wc", S$4 = "ethereum_provider", $$2 = `${P$1}@2:${S$4}:`, j$2 = "https://rpc.walletconnect.com/v1/", u$2 = ["eth_sendTransaction", "personal_sign"], E$2 = ["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"], m$2 = ["chainChanged", "accountsChanged"], _$3 = ["chainChanged", "accountsChanged", "message", "disconnect", "connect"]; var N$2 = Object.defineProperty, q$2 = Object.defineProperties, D$3 = Object.getOwnPropertyDescriptors, y$2 = Object.getOwnPropertySymbols, U$1 = Object.prototype.hasOwnProperty, Q$2 = Object.prototype.propertyIsEnumerable, O$1 = (a2, t2, s2) => t2 in a2 ? N$2(a2, t2, { enumerable: true, configurable: true, writable: true, value: s2 }) : a2[t2] = s2, p$2 = (a2, t2) => { for (var s2 in t2 || (t2 = {})) U$1.call(t2, s2) && O$1(a2, s2, t2[s2]); if (y$2) for (var s2 of y$2(t2)) Q$2.call(t2, s2) && O$1(a2, s2, t2[s2]); return a2; }, M$2 = (a2, t2) => q$2(a2, D$3(t2)); function g$2(a2) { return Number(a2[0].split(":")[1]); } function f$1(a2) { return `0x${a2.toString(16)}`; } function L$3(a2) { const { chains: t2, optionalChains: s2, methods: i2, optionalMethods: n2, events: e2, optionalEvents: h2, rpcMap: c2 } = a2; if (!k$6(t2)) throw new Error("Invalid chains"); const o2 = { chains: t2, methods: i2 || u$2, events: e2 || m$2, rpcMap: p$2({}, t2.length ? { [g$2(t2)]: c2[g$2(t2)] } : {}) }, r2 = e2 == null ? void 0 : e2.filter((l2) => !m$2.includes(l2)), d2 = i2 == null ? void 0 : i2.filter((l2) => !u$2.includes(l2)); if (!s2 && !h2 && !n2 && !(r2 != null && r2.length) && !(d2 != null && d2.length)) return { required: t2.length ? o2 : void 0 }; const C2 = (r2 == null ? void 0 : r2.length) && (d2 == null ? void 0 : d2.length) || !s2, I2 = { chains: [...new Set(C2 ? o2.chains.concat(s2 || []) : s2)], methods: [...new Set(o2.methods.concat(n2 != null && n2.length ? n2 : E$2))], events: [...new Set(o2.events.concat(h2 != null && h2.length ? h2 : _$3))], rpcMap: c2 }; return { required: t2.length ? o2 : void 0, optional: s2.length ? I2 : void 0 }; } let v$2 = class v2 { constructor() { this.events = new eventsExports.EventEmitter(), this.namespace = "eip155", this.accounts = [], this.chainId = 1, this.STORAGE_KEY = $$2, this.on = (t2, s2) => (this.events.on(t2, s2), this), this.once = (t2, s2) => (this.events.once(t2, s2), this), this.removeListener = (t2, s2) => (this.events.removeListener(t2, s2), this), this.off = (t2, s2) => (this.events.off(t2, s2), this), this.parseAccount = (t2) => this.isCompatibleChainId(t2) ? this.parseAccountId(t2).address : t2, this.signer = {}, this.rpc = {}; } static async init(t2) { const s2 = new v2(); return await s2.initialize(t2), s2; } async request(t2) { return await this.signer.request(t2, this.formatChainId(this.chainId)); } sendAsync(t2, s2) { this.signer.sendAsync(t2, s2, this.formatChainId(this.chainId)); } get connected() { return this.signer.client ? this.signer.client.core.relayer.connected : false; } get connecting() { return this.signer.client ? this.signer.client.core.relayer.connecting : false; } async enable() { return this.session || await this.connect(), await this.request({ method: "eth_requestAccounts" }); } async connect(t2) { if (!this.signer.client) throw new Error("Provider not initialized. Call init() first"); this.loadConnectOpts(t2); const { required: s2, optional: i2 } = L$3(this.rpc); try { const n2 = await new Promise(async (h2, c2) => { var o2; this.rpc.showQrModal && ((o2 = this.modal) == null || o2.subscribeModal((r2) => { !r2.open && !this.signer.session && (this.signer.abortPairingAttempt(), c2(new Error("Connection request reset. Please try again."))); })), await this.signer.connect(M$2(p$2({ namespaces: p$2({}, s2 && { [this.namespace]: s2 }) }, i2 && { optionalNamespaces: { [this.namespace]: i2 } }), { pairingTopic: t2 == null ? void 0 : t2.pairingTopic })).then((r2) => { h2(r2); }).catch((r2) => { c2(new Error(r2.message)); }); }); if (!n2) return; const e2 = Un(n2.namespaces, [this.namespace]); this.setChainIds(this.rpc.chains.length ? this.rpc.chains : e2), this.setAccounts(e2), this.events.emit("connect", { chainId: f$1(this.chainId) }); } catch (n2) { throw this.signer.logger.error(n2), n2; } finally { this.modal && this.modal.closeModal(); } } async disconnect() { this.session && await this.signer.disconnect(), this.reset(); } get isWalletConnect() { return true; } get session() { return this.signer.session; } registerEventListeners() { this.signer.on("session_event", (t2) => { const { params: s2 } = t2, { event: i2 } = s2; i2.name === "accountsChanged" ? (this.accounts = this.parseAccounts(i2.data), this.events.emit("accountsChanged", this.accounts)) : i2.name === "chainChanged" ? this.setChainId(this.formatChainId(i2.data)) : this.events.emit(i2.name, i2.data), this.events.emit("session_event", t2); }), this.signer.on("chainChanged", (t2) => { const s2 = parseInt(t2); this.chainId = s2, this.events.emit("chainChanged", f$1(this.chainId)), this.persist(); }), this.signer.on("session_update", (t2) => { this.events.emit("session_update", t2); }), this.signer.on("session_delete", (t2) => { this.reset(), this.events.emit("session_delete", t2), this.events.emit("disconnect", M$2(p$2({}, U$3("USER_DISCONNECTED")), { data: t2.topic, name: "USER_DISCONNECTED" })); }), this.signer.on("display_uri", (t2) => { var s2, i2; this.rpc.showQrModal && ((s2 = this.modal) == null || s2.closeModal(), (i2 = this.modal) == null || i2.openModal({ uri: t2 })), this.events.emit("display_uri", t2); }); } switchEthereumChain(t2) { this.request({ method: "wallet_switchEthereumChain", params: [{ chainId: t2.toString(16) }] }); } isCompatibleChainId(t2) { return typeof t2 == "string" ? t2.startsWith(`${this.namespace}:`) : false; } formatChainId(t2) { return `${this.namespace}:${t2}`; } parseChainId(t2) { return Number(t2.split(":")[1]); } setChainIds(t2) { const s2 = t2.filter((i2) => this.isCompatibleChainId(i2)).map((i2) => this.parseChainId(i2)); s2.length && (this.chainId = s2[0], this.events.emit("chainChanged", f$1(this.chainId)), this.persist()); } setChainId(t2) { if (this.isCompatibleChainId(t2)) { const s2 = this.parseChainId(t2); this.chainId = s2, this.switchEthereumChain(s2); } } parseAccountId(t2) { const [s2, i2, n2] = t2.split(":"); return { chainId: `${s2}:${i2}`, address: n2 }; } setAccounts(t2) { this.accounts = t2.filter((s2) => this.parseChainId(this.parseAccountId(s2).chainId) === this.chainId).map((s2) => this.parseAccountId(s2).address), this.events.emit("accountsChanged", this.accounts); } getRpcConfig(t2) { var s2, i2; const n2 = (s2 = t2 == null ? void 0 : t2.chains) != null ? s2 : [], e2 = (i2 = t2 == null ? void 0 : t2.optionalChains) != null ? i2 : [], h2 = n2.concat(e2); if (!h2.length) throw new Error("No chains specified in either `chains` or `optionalChains`"); const c2 = n2.length ? (t2 == null ? void 0 : t2.methods) || u$2 : [], o2 = n2.length ? (t2 == null ? void 0 : t2.events) || m$2 : [], r2 = (t2 == null ? void 0 : t2.optionalMethods) || [], d2 = (t2 == null ? void 0 : t2.optionalEvents) || [], C2 = (t2 == null ? void 0 : t2.rpcMap) || this.buildRpcMap(h2, t2.projectId), I2 = (t2 == null ? void 0 : t2.qrModalOptions) || void 0; return { chains: n2 == null ? void 0 : n2.map((l2) => this.formatChainId(l2)), optionalChains: e2.map((l2) => this.formatChainId(l2)), methods: c2, events: o2, optionalMethods: r2, optionalEvents: d2, rpcMap: C2, showQrModal: !!(t2 != null && t2.showQrModal), qrModalOptions: I2, projectId: t2.projectId, metadata: t2.metadata }; } buildRpcMap(t2, s2) { const i2 = {}; return t2.forEach((n2) => { i2[n2] = this.getRpcUrl(n2, s2); }), i2; } async initialize(t2) { if (this.rpc = this.getRpcConfig(t2), this.chainId = this.rpc.chains.length ? g$2(this.rpc.chains) : g$2(this.rpc.optionalChains), this.signer = await hv.init({ projectId: this.rpc.projectId, metadata: this.rpc.metadata, disableProviderPing: t2.disableProviderPing, relayUrl: t2.relayUrl, storageOptions: t2.storageOptions }), this.registerEventListeners(), await this.loadPersistedSession(), this.rpc.showQrModal) { let s2; try { const { WalletConnectModal: i2 } = await Promise.resolve().then(() => index$1); s2 = i2; } catch { throw new Error("To use QR modal, please install @walletconnect/modal package"); } if (s2) try { this.modal = new s2(p$2({ projectId: this.rpc.projectId }, this.rpc.qrModalOptions)); } catch (i2) { throw this.signer.logger.error(i2), new Error("Could not generate WalletConnectModal Instance"); } } } loadConnectOpts(t2) { if (!t2) return; const { chains: s2, optionalChains: i2, rpcMap: n2 } = t2; s2 && k$6(s2) && (this.rpc.chains = s2.map((e2) => this.formatChainId(e2)), s2.forEach((e2) => { this.rpc.rpcMap[e2] = (n2 == null ? void 0 : n2[e2]) || this.getRpcUrl(e2); })), i2 && k$6(i2) && (this.rpc.optionalChains = [], this.rpc.optionalChains = i2 == null ? void 0 : i2.map((e2) => this.formatChainId(e2)), i2.forEach((e2) => { this.rpc.rpcMap[e2] = (n2 == null ? void 0 : n2[e2]) || this.getRpcUrl(e2); })); } getRpcUrl(t2, s2) { var i2; return ((i2 = this.rpc.rpcMap) == null ? void 0 : i2[t2]) || `${j$2}?chainId=eip155:${t2}&projectId=${s2 || this.rpc.projectId}`; } async loadPersistedSession() { if (!this.session) return; const t2 = await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`), s2 = this.session.namespaces[`${this.namespace}:${t2}`] ? this.session.namespaces[`${this.namespace}:${t2}`] : this.session.namespaces[this.namespace]; this.setChainIds(t2 ? [this.formatChainId(t2)] : s2 == null ? void 0 : s2.accounts), this.setAccounts(s2 == null ? void 0 : s2.accounts); } reset() { this.chainId = 1, this.accounts = []; } persist() { this.session && this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`, this.chainId); } parseAccounts(t2) { return typeof t2 == "string" || t2 instanceof String ? [this.parseAccount(t2)] : t2.map((s2) => this.parseAccount(s2)); } }; const G$2 = v$2; const index_es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, EthereumProvider: G$2, OPTIONAL_EVENTS: _$3, OPTIONAL_METHODS: E$2, REQUIRED_EVENTS: m$2, REQUIRED_METHODS: u$2, default: v$2 }, Symbol.toStringTag, { value: "Module" })); const o$5 = proxy({ history: ["ConnectWallet"], view: "ConnectWallet", data: void 0 }), T$2 = { state: o$5, subscribe(e2) { return subscribe(o$5, () => e2(o$5)); }, push(e2, t2) { e2 !== o$5.view && (o$5.view = e2, t2 && (o$5.data = t2), o$5.history.push(e2)); }, reset(e2) { o$5.view = e2, o$5.history = [e2]; }, replace(e2) { o$5.history.length > 1 && (o$5.history[o$5.history.length - 1] = e2, o$5.view = e2); }, goBack() { if (o$5.history.length > 1) { o$5.history.pop(); const [e2] = o$5.history.slice(-1); o$5.view = e2; } }, setData(e2) { o$5.data = e2; } }, a$2 = { WALLETCONNECT_DEEPLINK_CHOICE: "WALLETCONNECT_DEEPLINK_CHOICE", WCM_VERSION: "WCM_VERSION", RECOMMENDED_WALLET_AMOUNT: 9, isMobile() { return typeof window < "u" ? Boolean(window.matchMedia("(pointer:coarse)").matches || /Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)) : false; }, isAndroid() { return a$2.isMobile() && navigator.userAgent.toLowerCase().includes("android"); }, isIos() { const e2 = navigator.userAgent.toLowerCase(); return a$2.isMobile() && (e2.includes("iphone") || e2.includes("ipad")); }, isHttpUrl(e2) { return e2.startsWith("http://") || e2.startsWith("https://"); }, isArray(e2) { return Array.isArray(e2) && e2.length > 0; }, formatNativeUrl(e2, t2, s2) { if (a$2.isHttpUrl(e2)) return this.formatUniversalUrl(e2, t2, s2); let n2 = e2; n2.includes("://") || (n2 = e2.replaceAll("/", "").replaceAll(":", ""), n2 = `${n2}://`), n2.endsWith("/") || (n2 = `${n2}/`), this.setWalletConnectDeepLink(n2, s2); const i2 = encodeURIComponent(t2); return `${n2}wc?uri=${i2}`; }, formatUniversalUrl(e2, t2, s2) { if (!a$2.isHttpUrl(e2)) return this.formatNativeUrl(e2, t2, s2); let n2 = e2; n2.endsWith("/") || (n2 = `${n2}/`), this.setWalletConnectDeepLink(n2, s2); const i2 = encodeURIComponent(t2); return `${n2}wc?uri=${i2}`; }, async wait(e2) { return new Promise((t2) => { setTimeout(t2, e2); }); }, openHref(e2, t2) { window.open(e2, t2, "noreferrer noopener"); }, setWalletConnectDeepLink(e2, t2) { try { localStorage.setItem(a$2.WALLETCONNECT_DEEPLINK_CHOICE, JSON.stringify({ href: e2, name: t2 })); } catch { console.info("Unable to set WalletConnect deep link"); } }, setWalletConnectAndroidDeepLink(e2) { try { const [t2] = e2.split("?"); localStorage.setItem(a$2.WALLETCONNECT_DEEPLINK_CHOICE, JSON.stringify({ href: t2, name: "Android" })); } catch { console.info("Unable to set WalletConnect android deep link"); } }, removeWalletConnectDeepLink() { try { localStorage.removeItem(a$2.WALLETCONNECT_DEEPLINK_CHOICE); } catch { console.info("Unable to remove WalletConnect deep link"); } }, setModalVersionInStorage() { try { typeof localStorage < "u" && localStorage.setItem(a$2.WCM_VERSION, "2.6.2"); } catch { console.info("Unable to set Web3Modal version in storage"); } }, getWalletRouterData() { var e2; const t2 = (e2 = T$2.state.data) == null ? void 0 : e2.Wallet; if (!t2) throw new Error('Missing "Wallet" view data'); return t2; } }, _$2 = typeof location < "u" && (location.hostname.includes("localhost") || location.protocol.includes("https")), r$3 = proxy({ enabled: _$2, userSessionId: "", events: [], connectedWalletId: void 0 }), R$1 = { state: r$3, subscribe(e2) { return subscribe(r$3.events, () => e2(snapshot(r$3.events[r$3.events.length - 1]))); }, initialize() { r$3.enabled && typeof (crypto == null ? void 0 : crypto.randomUUID) < "u" && (r$3.userSessionId = crypto.randomUUID()); }, setConnectedWalletId(e2) { r$3.connectedWalletId = e2; }, click(e2) { if (r$3.enabled) { const t2 = { type: "CLICK", name: e2.name, userSessionId: r$3.userSessionId, timestamp: Date.now(), data: e2 }; r$3.events.push(t2); } }, track(e2) { if (r$3.enabled) { const t2 = { type: "TRACK", name: e2.name, userSessionId: r$3.userSessionId, timestamp: Date.now(), data: e2 }; r$3.events.push(t2); } }, view(e2) { if (r$3.enabled) { const t2 = { type: "VIEW", name: e2.name, userSessionId: r$3.userSessionId, timestamp: Date.now(), data: e2 }; r$3.events.push(t2); } } }, c$3 = proxy({ chains: void 0, walletConnectUri: void 0, isAuth: false, isCustomDesktop: false, isCustomMobile: false, isDataLoaded: false, isUiLoaded: false }), p$1 = { state: c$3, subscribe(e2) { return subscribe(c$3, () => e2(c$3)); }, setChains(e2) { c$3.chains = e2; }, setWalletConnectUri(e2) { c$3.walletConnectUri = e2; }, setIsCustomDesktop(e2) { c$3.isCustomDesktop = e2; }, setIsCustomMobile(e2) { c$3.isCustomMobile = e2; }, setIsDataLoaded(e2) { c$3.isDataLoaded = e2; }, setIsUiLoaded(e2) { c$3.isUiLoaded = e2; }, setIsAuth(e2) { c$3.isAuth = e2; } }, W = proxy({ projectId: "", mobileWallets: void 0, desktopWallets: void 0, walletImages: void 0, chains: void 0, enableAuthMode: false, enableExplorer: true, explorerExcludedWalletIds: void 0, explorerRecommendedWalletIds: void 0, termsOfServiceUrl: void 0, privacyPolicyUrl: void 0 }), y$1 = { state: W, subscribe(e2) { return subscribe(W, () => e2(W)); }, setConfig(e2) { var t2, s2; R$1.initialize(), p$1.setChains(e2.chains), p$1.setIsAuth(Boolean(e2.enableAuthMode)), p$1.setIsCustomMobile(Boolean((t2 = e2.mobileWallets) == null ? void 0 : t2.length)), p$1.setIsCustomDesktop(Boolean((s2 = e2.desktopWallets) == null ? void 0 : s2.length)), a$2.setModalVersionInStorage(), Object.assign(W, e2); } }; var V$1 = Object.defineProperty, D$2 = Object.getOwnPropertySymbols, H$1 = Object.prototype.hasOwnProperty, B$2 = Object.prototype.propertyIsEnumerable, M$1 = (e2, t2, s2) => t2 in e2 ? V$1(e2, t2, { enumerable: true, configurable: true, writable: true, value: s2 }) : e2[t2] = s2, K$1 = (e2, t2) => { for (var s2 in t2 || (t2 = {})) H$1.call(t2, s2) && M$1(e2, s2, t2[s2]); if (D$2) for (var s2 of D$2(t2)) B$2.call(t2, s2) && M$1(e2, s2, t2[s2]); return e2; }; const L$2 = "https://explorer-api.walletconnect.com", E$1 = "wcm", O = "js-2.6.2"; async function w$1(e2, t2) { const s2 = K$1({ sdkType: E$1, sdkVersion: O }, t2), n2 = new URL(e2, L$2); return n2.searchParams.append("projectId", y$1.state.projectId), Object.entries(s2).forEach(([i2, l2]) => { l2 && n2.searchParams.append(i2, String(l2)); }), (await fetch(n2)).json(); } const m$1 = { async getDesktopListings(e2) { return w$1("/w3m/v1/getDesktopListings", e2); }, async getMobileListings(e2) { return w$1("/w3m/v1/getMobileListings", e2); }, async getInjectedListings(e2) { return w$1("/w3m/v1/getInjectedListings", e2); }, async getAllListings(e2) { return w$1("/w3m/v1/getAllListings", e2); }, getWalletImageUrl(e2) { return `${L$2}/w3m/v1/getWalletImage/${e2}?projectId=${y$1.state.projectId}&sdkType=${E$1}&sdkVersion=${O}`; }, getAssetImageUrl(e2) { return `${L$2}/w3m/v1/getAssetImage/${e2}?projectId=${y$1.state.projectId}&sdkType=${E$1}&sdkVersion=${O}`; } }; var z$1 = Object.defineProperty, j$1 = Object.getOwnPropertySymbols, J = Object.prototype.hasOwnProperty, q$1 = Object.prototype.propertyIsEnumerable, k$1 = (e2, t2, s2) => t2 in e2 ? z$1(e2, t2, { enumerable: true, configurable: true, writable: true, value: s2 }) : e2[t2] = s2, F$1 = (e2, t2) => { for (var s2 in t2 || (t2 = {})) J.call(t2, s2) && k$1(e2, s2, t2[s2]); if (j$1) for (var s2 of j$1(t2)) q$1.call(t2, s2) && k$1(e2, s2, t2[s2]); return e2; }; const N$1 = a$2.isMobile(), d$3 = proxy({ wallets: { listings: [], total: 0, page: 1 }, search: { listings: [], total: 0, page: 1 }, recomendedWallets: [] }), te$1 = { state: d$3, async getRecomendedWallets() { const { explorerRecommendedWalletIds: e2, explorerExcludedWalletIds: t2 } = y$1.state; if (e2 === "NONE" || t2 === "ALL" && !e2) return d$3.recomendedWallets; if (a$2.isArray(e2)) { const s2 = { recommendedIds: e2.join(",") }, { listings: n2 } = await m$1.getAllListings(s2), i2 = Object.values(n2); i2.sort((l2, v2) => { const b2 = e2.indexOf(l2.id), f2 = e2.indexOf(v2.id); return b2 - f2; }), d$3.recomendedWallets = i2; } else { const { chains: s2, isAuth: n2 } = p$1.state, i2 = s2 == null ? void 0 : s2.join(","), l2 = a$2.isArray(t2), v2 = { page: 1, sdks: n2 ? "auth_v1" : void 0, entries: a$2.RECOMMENDED_WALLET_AMOUNT, chains: i2, version: 2, excludedIds: l2 ? t2.join(",") : void 0 }, { listings: b2 } = N$1 ? await m$1.getMobileListings(v2) : await m$1.getDesktopListings(v2); d$3.recomendedWallets = Object.values(b2); } return d$3.recomendedWallets; }, async getWallets(e2) { const t2 = F$1({}, e2), { explorerRecommendedWalletIds: s2, explorerExcludedWalletIds: n2 } = y$1.state, { recomendedWallets: i2 } = d$3; if (n2 === "ALL") return d$3.wallets; i2.length ? t2.excludedIds = i2.map((x2) => x2.id).join(",") : a$2.isArray(s2) && (t2.excludedIds = s2.join(",")), a$2.isArray(n2) && (t2.excludedIds = [t2.excludedIds, n2].filter(Boolean).join(",")), p$1.state.isAuth && (t2.sdks = "auth_v1"); const { page: l2, search: v2 } = e2, { listings: b2, total: f2 } = N$1 ? await m$1.getMobileListings(t2) : await m$1.getDesktopListings(t2), A2 = Object.values(b2), U2 = v2 ? "search" : "wallets"; return d$3[U2] = { listings: [...d$3[U2].listings, ...A2], total: f2, page: l2 ?? 1 }, { listings: A2, total: f2 }; }, getWalletImageUrl(e2) { return m$1.getWalletImageUrl(e2); }, getAssetImageUrl(e2) { return m$1.getAssetImageUrl(e2); }, resetSearch() { d$3.search = { listings: [], total: 0, page: 1 }; } }, I$1 = proxy({ open: false }), se$1 = { state: I$1, subscribe(e2) { return subscribe(I$1, () => e2(I$1)); }, async open(e2) { return new Promise((t2) => { const { isUiLoaded: s2, isDataLoaded: n2 } = p$1.state; if (a$2.removeWalletConnectDeepLink(), p$1.setWalletConnectUri(e2 == null ? void 0 : e2.uri), p$1.setChains(e2 == null ? void 0 : e2.chains), T$2.reset("ConnectWallet"), s2 && n2) I$1.open = true, t2(); else { const i2 = setInterval(() => { const l2 = p$1.state; l2.isUiLoaded && l2.isDataLoaded && (clearInterval(i2), I$1.open = true, t2()); }, 200); } }); }, close() { I$1.open = false; } }; var G$1 = Object.defineProperty, $$1 = Object.getOwnPropertySymbols, Q$1 = Object.prototype.hasOwnProperty, X = Object.prototype.propertyIsEnumerable, S$3 = (e2, t2, s2) => t2 in e2 ? G$1(e2, t2, { enumerable: true, configurable: true, writable: true, value: s2 }) : e2[t2] = s2, Y$1 = (e2, t2) => { for (var s2 in t2 || (t2 = {})) Q$1.call(t2, s2) && S$3(e2, s2, t2[s2]); if ($$1) for (var s2 of $$1(t2)) X.call(t2, s2) && S$3(e2, s2, t2[s2]); return e2; }; function Z$2() { return typeof matchMedia < "u" && matchMedia("(prefers-color-scheme: dark)").matches; } const C$1 = proxy({ themeMode: Z$2() ? "dark" : "light" }), ne$1 = { state: C$1, subscribe(e2) { return subscribe(C$1, () => e2(C$1)); }, setThemeConfig(e2) { const { themeMode: t2, themeVariables: s2 } = e2; t2 && (C$1.themeMode = t2), s2 && (C$1.themeVariables = Y$1({}, s2)); } }, g$1 = proxy({ open: false, message: "", variant: "success" }), oe$1 = { state: g$1, subscribe(e2) { return subscribe(g$1, () => e2(g$1)); }, openToast(e2, t2) { g$1.open = true, g$1.message = e2, g$1.variant = t2; }, closeToast() { g$1.open = false; } }; let d$2 = class d { constructor(e2) { this.openModal = se$1.open, this.closeModal = se$1.close, this.subscribeModal = se$1.subscribe, this.setTheme = ne$1.setThemeConfig, ne$1.setThemeConfig(e2), y$1.setConfig(e2), this.initUi(); } async initUi() { if (typeof window < "u") { await Promise.resolve().then(() => index); const e2 = document.createElement("wcm-modal"); document.body.insertAdjacentElement("beforeend", e2), p$1.setIsUiLoaded(true); } } }; const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, WalletConnectModal: d$2 }, Symbol.toStringTag, { value: "Module" })); /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t$3 = window, e$5 = t$3.ShadowRoot && (void 0 === t$3.ShadyCSS || t$3.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$3 = Symbol(), n$5 = /* @__PURE__ */ new WeakMap(); let o$4 = class o { constructor(t2, e2, n2) { if (this._$cssResult$ = true, n2 !== s$3) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); this.cssText = t2, this.t = e2; } get styleSheet() { let t2 = this.o; const s2 = this.t; if (e$5 && void 0 === t2) { const e2 = void 0 !== s2 && 1 === s2.length; e2 && (t2 = n$5.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && n$5.set(s2, t2)); } return t2; } toString() { return this.cssText; } }; const r$2 = (t2) => new o$4("string" == typeof t2 ? t2 : t2 + "", void 0, s$3), i$3 = (t2, ...e2) => { const n2 = 1 === t2.length ? t2[0] : e2.reduce((e3, s2, n3) => e3 + ((t3) => { if (true === t3._$cssResult$) return t3.cssText; if ("number" == typeof t3) return t3; throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); })(s2) + t2[n3 + 1], t2[0]); return new o$4(n2, t2, s$3); }, S$2 = (s2, n2) => { e$5 ? s2.adoptedStyleSheets = n2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet) : n2.forEach((e2) => { const n3 = document.createElement("style"), o2 = t$3.litNonce; void 0 !== o2 && n3.setAttribute("nonce", o2), n3.textContent = e2.cssText, s2.appendChild(n3); }); }, c$2 = e$5 ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { let e2 = ""; for (const s2 of t3.cssRules) e2 += s2.cssText; return r$2(e2); })(t2) : t2; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var s$2; const e$4 = window, r$1 = e$4.trustedTypes, h$2 = r$1 ? r$1.emptyScript : "", o$3 = e$4.reactiveElementPolyfillSupport, n$4 = { toAttribute(t2, i2) { switch (i2) { case Boolean: t2 = t2 ? h$2 : null; break; case Object: case Array: t2 = null == t2 ? t2 : JSON.stringify(t2); } return t2; }, fromAttribute(t2, i2) { let s2 = t2; switch (i2) { case Boolean: s2 = null !== t2; break; case Number: s2 = null === t2 ? null : Number(t2); break; case Object: case Array: try { s2 = JSON.parse(t2); } catch (t3) { s2 = null; } } return s2; } }, a$1 = (t2, i2) => i2 !== t2 && (i2 == i2 || t2 == t2), l$3 = { attribute: true, type: String, converter: n$4, reflect: false, hasChanged: a$1 }, d$1 = "finalized"; let u$1 = class u extends HTMLElement { constructor() { super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = false, this.hasUpdated = false, this._$El = null, this._$Eu(); } static addInitializer(t2) { var i2; this.finalize(), (null !== (i2 = this.h) && void 0 !== i2 ? i2 : this.h = []).push(t2); } static get observedAttributes() { this.finalize(); const t2 = []; return this.elementProperties.forEach((i2, s2) => { const e2 = this._$Ep(s2, i2); void 0 !== e2 && (this._$Ev.set(e2, s2), t2.push(e2)); }), t2; } static createProperty(t2, i2 = l$3) { if (i2.state && (i2.attribute = false), this.finalize(), this.elementProperties.set(t2, i2), !i2.noAccessor && !this.prototype.hasOwnProperty(t2)) { const s2 = "symbol" == typeof t2 ? Symbol() : "__" + t2, e2 = this.getPropertyDescriptor(t2, s2, i2); void 0 !== e2 && Object.defineProperty(this.prototype, t2, e2); } } static getPropertyDescriptor(t2, i2, s2) { return { get() { return this[i2]; }, set(e2) { const r2 = this[t2]; this[i2] = e2, this.requestUpdate(t2, r2, s2); }, configurable: true, enumerable: true }; } static getPropertyOptions(t2) { return this.elementProperties.get(t2) || l$3; } static finalize() { if (this.hasOwnProperty(d$1)) return false; this[d$1] = true; const t2 = Object.getPrototypeOf(this); if (t2.finalize(), void 0 !== t2.h && (this.h = [...t2.h]), this.elementProperties = new Map(t2.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) { const t3 = this.properties, i2 = [...Object.getOwnPropertyNames(t3), ...Object.getOwnPropertySymbols(t3)]; for (const s2 of i2) this.createProperty(s2, t3[s2]); } return this.elementStyles = this.finalizeStyles(this.styles), true; } static finalizeStyles(i2) { const s2 = []; if (Array.isArray(i2)) { const e2 = new Set(i2.flat(1 / 0).reverse()); for (const i3 of e2) s2.unshift(c$2(i3)); } else void 0 !== i2 && s2.push(c$2(i2)); return s2; } static _$Ep(t2, i2) { const s2 = i2.attribute; return false === s2 ? void 0 : "string" == typeof s2 ? s2 : "string" == typeof t2 ? t2.toLowerCase() : void 0; } _$Eu() { var t2; this._$E_ = new Promise((t3) => this.enableUpdating = t3), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), null === (t2 = this.constructor.h) || void 0 === t2 || t2.forEach((t3) => t3(this)); } addController(t2) { var i2, s2; (null !== (i2 = this._$ES) && void 0 !== i2 ? i2 : this._$ES = []).push(t2), void 0 !== this.renderRoot && this.isConnected && (null === (s2 = t2.hostConnected) || void 0 === s2 || s2.call(t2)); } removeController(t2) { var i2; null === (i2 = this._$ES) || void 0 === i2 || i2.splice(this._$ES.indexOf(t2) >>> 0, 1); } _$Eg() { this.constructor.elementProperties.forEach((t2, i2) => { this.hasOwnProperty(i2) && (this._$Ei.set(i2, this[i2]), delete this[i2]); }); } createRenderRoot() { var t2; const s2 = null !== (t2 = this.shadowRoot) && void 0 !== t2 ? t2 : this.attachShadow(this.constructor.shadowRootOptions); return S$2(s2, this.constructor.elementStyles), s2; } connectedCallback() { var t2; void 0 === this.renderRoot && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), null === (t2 = this._$ES) || void 0 === t2 || t2.forEach((t3) => { var i2; return null === (i2 = t3.hostConnected) || void 0 === i2 ? void 0 : i2.call(t3); }); } enableUpdating(t2) { } disconnectedCallback() { var t2; null === (t2 = this._$ES) || void 0 === t2 || t2.forEach((t3) => { var i2; return null === (i2 = t3.hostDisconnected) || void 0 === i2 ? void 0 : i2.call(t3); }); } attributeChangedCallback(t2, i2, s2) { this._$AK(t2, s2); } _$EO(t2, i2, s2 = l$3) { var e2; const r2 = this.constructor._$Ep(t2, s2); if (void 0 !== r2 && true === s2.reflect) { const h2 = (void 0 !== (null === (e2 = s2.converter) || void 0 === e2 ? void 0 : e2.toAttribute) ? s2.converter : n$4).toAttribute(i2, s2.type); this._$El = t2, null == h2 ? this.removeAttribute(r2) : this.setAttribute(r2, h2), this._$El = null; } } _$AK(t2, i2) { var s2; const e2 = this.constructor, r2 = e2._$Ev.get(t2); if (void 0 !== r2 && this._$El !== r2) { const t3 = e2.getPropertyOptions(r2), h2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== (null === (s2 = t3.converter) || void 0 === s2 ? void 0 : s2.fromAttribute) ? t3.converter : n$4; this._$El = r2, this[r2] = h2.fromAttribute(i2, t3.type), this._$El = null; } } requestUpdate(t2, i2, s2) { let e2 = true; void 0 !== t2 && (((s2 = s2 || this.constructor.getPropertyOptions(t2)).hasChanged || a$1)(this[t2], i2) ? (this._$AL.has(t2) || this._$AL.set(t2, i2), true === s2.reflect && this._$El !== t2 && (void 0 === this._$EC && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t2, s2))) : e2 = false), !this.isUpdatePending && e2 && (this._$E_ = this._$Ej()); } async _$Ej() { this.isUpdatePending = true; try { await this._$E_; } catch (t3) { Promise.reject(t3); } const t2 = this.scheduleUpdate(); return null != t2 && await t2, !this.isUpdatePending; } scheduleUpdate() { return this.performUpdate(); } performUpdate() { var t2; if (!this.isUpdatePending) return; this.hasUpdated, this._$Ei && (this._$Ei.forEach((t3, i3) => this[i3] = t3), this._$Ei = void 0); let i2 = false; const s2 = this._$AL; try { i2 = this.shouldUpdate(s2), i2 ? (this.willUpdate(s2), null === (t2 = this._$ES) || void 0 === t2 || t2.forEach((t3) => { var i3; return null === (i3 = t3.hostUpdate) || void 0 === i3 ? void 0 : i3.call(t3); }), this.update(s2)) : this._$Ek(); } catch (t3) { throw i2 = false, this._$Ek(), t3; } i2 && this._$AE(s2); } willUpdate(t2) { } _$AE(t2) { var i2; null === (i2 = this._$ES) || void 0 === i2 || i2.forEach((t3) => { var i3; return null === (i3 = t3.hostUpdated) || void 0 === i3 ? void 0 : i3.call(t3); }), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); } _$Ek() { this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; } get updateComplete() { return this.getUpdateComplete(); } getUpdateComplete() { return this._$E_; } shouldUpdate(t2) { return true; } update(t2) { void 0 !== this._$EC && (this._$EC.forEach((t3, i2) => this._$EO(i2, this[i2], t3)), this._$EC = void 0), this._$Ek(); } updated(t2) { } firstUpdated(t2) { } }; u$1[d$1] = true, u$1.elementProperties = /* @__PURE__ */ new Map(), u$1.elementStyles = [], u$1.shadowRootOptions = { mode: "open" }, null == o$3 || o$3({ ReactiveElement: u$1 }), (null !== (s$2 = e$4.reactiveElementVersions) && void 0 !== s$2 ? s$2 : e$4.reactiveElementVersions = []).push("1.6.3"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var t$2; const i$2 = window, s$1 = i$2.trustedTypes, e$3 = s$1 ? s$1.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, o$2 = "$lit$", n$3 = `lit$${(Math.random() + "").slice(9)}$`, l$2 = "?" + n$3, h$1 = `<${l$2}>`, r = document, u = () => r.createComment(""), d = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, c$1 = Array.isArray, v$1 = (t2) => c$1(t2) || "function" == typeof (null == t2 ? void 0 : t2[Symbol.iterator]), a = "[ \n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, _$1 = /-->/g, m = />/g, p = RegExp(`>|${a}(?:([^\\s"'>=/]+)(${a}*=${a}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"), g = /'/g, $ = /"/g, y = /^(?:script|style|textarea|title)$/i, w = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), x = w(1), b = w(2), T$1 = Symbol.for("lit-noChange"), A$1 = Symbol.for("lit-nothing"), E = /* @__PURE__ */ new WeakMap(), C = r.createTreeWalker(r, 129, null, false); function P(t2, i2) { if (!Array.isArray(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); return void 0 !== e$3 ? e$3.createHTML(i2) : i2; } const V = (t2, i2) => { const s2 = t2.length - 1, e2 = []; let l2, r2 = 2 === i2 ? "" : "", u2 = f; for (let i3 = 0; i3 < s2; i3++) { const s3 = t2[i3]; let d2, c2, v2 = -1, a2 = 0; for (; a2 < s3.length && (u2.lastIndex = a2, c2 = u2.exec(s3), null !== c2); ) a2 = u2.lastIndex, u2 === f ? "!--" === c2[1] ? u2 = _$1 : void 0 !== c2[1] ? u2 = m : void 0 !== c2[2] ? (y.test(c2[2]) && (l2 = RegExp("" === c2[0] ? (u2 = null != l2 ? l2 : f, v2 = -1) : void 0 === c2[1] ? v2 = -2 : (v2 = u2.lastIndex - c2[2].length, d2 = c2[1], u2 = void 0 === c2[3] ? p : '"' === c2[3] ? $ : g) : u2 === $ || u2 === g ? u2 = p : u2 === _$1 || u2 === m ? u2 = f : (u2 = p, l2 = void 0); const w2 = u2 === p && t2[i3 + 1].startsWith("/>") ? " " : ""; r2 += u2 === f ? s3 + h$1 : v2 >= 0 ? (e2.push(d2), s3.slice(0, v2) + o$2 + s3.slice(v2) + n$3 + w2) : s3 + n$3 + (-2 === v2 ? (e2.push(void 0), i3) : w2); } return [P(t2, r2 + (t2[s2] || "") + (2 === i2 ? "" : "")), e2]; }; class N { constructor({ strings: t2, _$litType$: i2 }, e2) { let h2; this.parts = []; let r2 = 0, d2 = 0; const c2 = t2.length - 1, v2 = this.parts, [a2, f2] = V(t2, i2); if (this.el = N.createElement(a2, e2), C.currentNode = this.el.content, 2 === i2) { const t3 = this.el.content, i3 = t3.firstChild; i3.remove(), t3.append(...i3.childNodes); } for (; null !== (h2 = C.nextNode()) && v2.length < c2; ) { if (1 === h2.nodeType) { if (h2.hasAttributes()) { const t3 = []; for (const i3 of h2.getAttributeNames()) if (i3.endsWith(o$2) || i3.startsWith(n$3)) { const s2 = f2[d2++]; if (t3.push(i3), void 0 !== s2) { const t4 = h2.getAttribute(s2.toLowerCase() + o$2).split(n$3), i4 = /([.?@])?(.*)/.exec(s2); v2.push({ type: 1, index: r2, name: i4[2], strings: t4, ctor: "." === i4[1] ? H : "?" === i4[1] ? L$1 : "@" === i4[1] ? z : k }); } else v2.push({ type: 6, index: r2 }); } for (const i3 of t3) h2.removeAttribute(i3); } if (y.test(h2.tagName)) { const t3 = h2.textContent.split(n$3), i3 = t3.length - 1; if (i3 > 0) { h2.textContent = s$1 ? s$1.emptyScript : ""; for (let s2 = 0; s2 < i3; s2++) h2.append(t3[s2], u()), C.nextNode(), v2.push({ type: 2, index: ++r2 }); h2.append(t3[i3], u()); } } } else if (8 === h2.nodeType) if (h2.data === l$2) v2.push({ type: 2, index: r2 }); else { let t3 = -1; for (; -1 !== (t3 = h2.data.indexOf(n$3, t3 + 1)); ) v2.push({ type: 7, index: r2 }), t3 += n$3.length - 1; } r2++; } } static createElement(t2, i2) { const s2 = r.createElement("template"); return s2.innerHTML = t2, s2; } } function S$1(t2, i2, s2 = t2, e2) { var o2, n2, l2, h2; if (i2 === T$1) return i2; let r2 = void 0 !== e2 ? null === (o2 = s2._$Co) || void 0 === o2 ? void 0 : o2[e2] : s2._$Cl; const u2 = d(i2) ? void 0 : i2._$litDirective$; return (null == r2 ? void 0 : r2.constructor) !== u2 && (null === (n2 = null == r2 ? void 0 : r2._$AO) || void 0 === n2 || n2.call(r2, false), void 0 === u2 ? r2 = void 0 : (r2 = new u2(t2), r2._$AT(t2, s2, e2)), void 0 !== e2 ? (null !== (l2 = (h2 = s2)._$Co) && void 0 !== l2 ? l2 : h2._$Co = [])[e2] = r2 : s2._$Cl = r2), void 0 !== r2 && (i2 = S$1(t2, r2._$AS(t2, i2.values), r2, e2)), i2; } class M { constructor(t2, i2) { this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2; } get parentNode() { return this._$AM.parentNode; } get _$AU() { return this._$AM._$AU; } u(t2) { var i2; const { el: { content: s2 }, parts: e2 } = this._$AD, o2 = (null !== (i2 = null == t2 ? void 0 : t2.creationScope) && void 0 !== i2 ? i2 : r).importNode(s2, true); C.currentNode = o2; let n2 = C.nextNode(), l2 = 0, h2 = 0, u2 = e2[0]; for (; void 0 !== u2; ) { if (l2 === u2.index) { let i3; 2 === u2.type ? i3 = new R(n2, n2.nextSibling, this, t2) : 1 === u2.type ? i3 = new u2.ctor(n2, u2.name, u2.strings, this, t2) : 6 === u2.type && (i3 = new Z$1(n2, this, t2)), this._$AV.push(i3), u2 = e2[++h2]; } l2 !== (null == u2 ? void 0 : u2.index) && (n2 = C.nextNode(), l2++); } return C.currentNode = r, o2; } v(t2) { let i2 = 0; for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i2), i2 += s2.strings.length - 2) : s2._$AI(t2[i2])), i2++; } } class R { constructor(t2, i2, s2, e2) { var o2; this.type = 2, this._$AH = A$1, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$Cp = null === (o2 = null == e2 ? void 0 : e2.isConnected) || void 0 === o2 || o2; } get _$AU() { var t2, i2; return null !== (i2 = null === (t2 = this._$AM) || void 0 === t2 ? void 0 : t2._$AU) && void 0 !== i2 ? i2 : this._$Cp; } get parentNode() { let t2 = this._$AA.parentNode; const i2 = this._$AM; return void 0 !== i2 && 11 === (null == t2 ? void 0 : t2.nodeType) && (t2 = i2.parentNode), t2; } get startNode() { return this._$AA; } get endNode() { return this._$AB; } _$AI(t2, i2 = this) { t2 = S$1(this, t2, i2), d(t2) ? t2 === A$1 || null == t2 || "" === t2 ? (this._$AH !== A$1 && this._$AR(), this._$AH = A$1) : t2 !== this._$AH && t2 !== T$1 && this._(t2) : void 0 !== t2._$litType$ ? this.g(t2) : void 0 !== t2.nodeType ? this.$(t2) : v$1(t2) ? this.T(t2) : this._(t2); } k(t2) { return this._$AA.parentNode.insertBefore(t2, this._$AB); } $(t2) { this._$AH !== t2 && (this._$AR(), this._$AH = this.k(t2)); } _(t2) { this._$AH !== A$1 && d(this._$AH) ? this._$AA.nextSibling.data = t2 : this.$(r.createTextNode(t2)), this._$AH = t2; } g(t2) { var i2; const { values: s2, _$litType$: e2 } = t2, o2 = "number" == typeof e2 ? this._$AC(t2) : (void 0 === e2.el && (e2.el = N.createElement(P(e2.h, e2.h[0]), this.options)), e2); if ((null === (i2 = this._$AH) || void 0 === i2 ? void 0 : i2._$AD) === o2) this._$AH.v(s2); else { const t3 = new M(o2, this), i3 = t3.u(this.options); t3.v(s2), this.$(i3), this._$AH = t3; } } _$AC(t2) { let i2 = E.get(t2.strings); return void 0 === i2 && E.set(t2.strings, i2 = new N(t2)), i2; } T(t2) { c$1(this._$AH) || (this._$AH = [], this._$AR()); const i2 = this._$AH; let s2, e2 = 0; for (const o2 of t2) e2 === i2.length ? i2.push(s2 = new R(this.k(u()), this.k(u()), this, this.options)) : s2 = i2[e2], s2._$AI(o2), e2++; e2 < i2.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i2.length = e2); } _$AR(t2 = this._$AA.nextSibling, i2) { var s2; for (null === (s2 = this._$AP) || void 0 === s2 || s2.call(this, false, true, i2); t2 && t2 !== this._$AB; ) { const i3 = t2.nextSibling; t2.remove(), t2 = i3; } } setConnected(t2) { var i2; void 0 === this._$AM && (this._$Cp = t2, null === (i2 = this._$AP) || void 0 === i2 || i2.call(this, t2)); } } class k { constructor(t2, i2, s2, e2, o2) { this.type = 1, this._$AH = A$1, this._$AN = void 0, this.element = t2, this.name = i2, this._$AM = e2, this.options = o2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = A$1; } get tagName() { return this.element.tagName; } get _$AU() { return this._$AM._$AU; } _$AI(t2, i2 = this, s2, e2) { const o2 = this.strings; let n2 = false; if (void 0 === o2) t2 = S$1(this, t2, i2, 0), n2 = !d(t2) || t2 !== this._$AH && t2 !== T$1, n2 && (this._$AH = t2); else { const e3 = t2; let l2, h2; for (t2 = o2[0], l2 = 0; l2 < o2.length - 1; l2++) h2 = S$1(this, e3[s2 + l2], i2, l2), h2 === T$1 && (h2 = this._$AH[l2]), n2 || (n2 = !d(h2) || h2 !== this._$AH[l2]), h2 === A$1 ? t2 = A$1 : t2 !== A$1 && (t2 += (null != h2 ? h2 : "") + o2[l2 + 1]), this._$AH[l2] = h2; } n2 && !e2 && this.j(t2); } j(t2) { t2 === A$1 ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, null != t2 ? t2 : ""); } } class H extends k { constructor() { super(...arguments), this.type = 3; } j(t2) { this.element[this.name] = t2 === A$1 ? void 0 : t2; } } const I = s$1 ? s$1.emptyScript : ""; let L$1 = class L extends k { constructor() { super(...arguments), this.type = 4; } j(t2) { t2 && t2 !== A$1 ? this.element.setAttribute(this.name, I) : this.element.removeAttribute(this.name); } }; class z extends k { constructor(t2, i2, s2, e2, o2) { super(t2, i2, s2, e2, o2), this.type = 5; } _$AI(t2, i2 = this) { var s2; if ((t2 = null !== (s2 = S$1(this, t2, i2, 0)) && void 0 !== s2 ? s2 : A$1) === T$1) return; const e2 = this._$AH, o2 = t2 === A$1 && e2 !== A$1 || t2.capture !== e2.capture || t2.once !== e2.once || t2.passive !== e2.passive, n2 = t2 !== A$1 && (e2 === A$1 || o2); o2 && this.element.removeEventListener(this.name, this, e2), n2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; } handleEvent(t2) { var i2, s2; "function" == typeof this._$AH ? this._$AH.call(null !== (s2 = null === (i2 = this.options) || void 0 === i2 ? void 0 : i2.host) && void 0 !== s2 ? s2 : this.element, t2) : this._$AH.handleEvent(t2); } } let Z$1 = class Z { constructor(t2, i2, s2) { this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i2, this.options = s2; } get _$AU() { return this._$AM._$AU; } _$AI(t2) { S$1(this, t2); } }; const B$1 = i$2.litHtmlPolyfillSupport; null == B$1 || B$1(N, R), (null !== (t$2 = i$2.litHtmlVersions) && void 0 !== t$2 ? t$2 : i$2.litHtmlVersions = []).push("2.8.0"); const D$1 = (t2, i2, s2) => { var e2, o2; const n2 = null !== (e2 = null == s2 ? void 0 : s2.renderBefore) && void 0 !== e2 ? e2 : i2; let l2 = n2._$litPart$; if (void 0 === l2) { const t3 = null !== (o2 = null == s2 ? void 0 : s2.renderBefore) && void 0 !== o2 ? o2 : null; n2._$litPart$ = l2 = new R(i2.insertBefore(u(), t3), t3, void 0, null != s2 ? s2 : {}); } return l2._$AI(t2), l2; }; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var l$1, o$1; class s extends u$1 { constructor() { super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; } createRenderRoot() { var t2, e2; const i2 = super.createRenderRoot(); return null !== (t2 = (e2 = this.renderOptions).renderBefore) && void 0 !== t2 || (e2.renderBefore = i2.firstChild), i2; } update(t2) { const i2 = this.render(); this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = D$1(i2, this.renderRoot, this.renderOptions); } connectedCallback() { var t2; super.connectedCallback(), null === (t2 = this._$Do) || void 0 === t2 || t2.setConnected(true); } disconnectedCallback() { var t2; super.disconnectedCallback(), null === (t2 = this._$Do) || void 0 === t2 || t2.setConnected(false); } render() { return T$1; } } s.finalized = true, s._$litElement$ = true, null === (l$1 = globalThis.litElementHydrateSupport) || void 0 === l$1 || l$1.call(globalThis, { LitElement: s }); const n$2 = globalThis.litElementPolyfillSupport; null == n$2 || n$2({ LitElement: s }); (null !== (o$1 = globalThis.litElementVersions) && void 0 !== o$1 ? o$1 : globalThis.litElementVersions = []).push("3.3.3"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const e$2 = (e2) => (n2) => "function" == typeof n2 ? ((e3, n3) => (customElements.define(e3, n3), n3))(e2, n2) : ((e3, n3) => { const { kind: t2, elements: s2 } = n3; return { kind: t2, elements: s2, finisher(n4) { customElements.define(e3, n4); } }; })(e2, n2); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const i$1 = (i2, e2) => "method" === e2.kind && e2.descriptor && !("value" in e2.descriptor) ? { ...e2, finisher(n2) { n2.createProperty(e2.key, i2); } } : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: e2.key, initializer() { "function" == typeof e2.initializer && (this[e2.key] = e2.initializer.call(this)); }, finisher(n2) { n2.createProperty(e2.key, i2); } }, e$1 = (i2, e2, n2) => { e2.constructor.createProperty(n2, i2); }; function n$1(n2) { return (t2, o2) => void 0 !== o2 ? e$1(n2, t2, o2) : i$1(n2, t2); } /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ function t$1(t2) { return n$1({ ...t2, state: true }); } /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var n; null != (null === (n = window.HTMLSlotElement) || void 0 === n ? void 0 : n.prototype.assignedElements) ? (o2, n2) => o2.assignedElements(n2) : (o2, n2) => o2.assignedNodes(n2).filter((o3) => o3.nodeType === Node.ELEMENT_NODE); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const t = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, e = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 }); class i { constructor(t2) { } get _$AU() { return this._$AM._$AU; } _$AT(t2, e2, i2) { this._$Ct = t2, this._$AM = e2, this._$Ci = i2; } _$AS(t2, e2) { return this.update(t2, e2); } update(t2, e2) { return this.render(...e2); } } /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const o = e(class extends i { constructor(t$12) { var i2; if (super(t$12), t$12.type !== t.ATTRIBUTE || "class" !== t$12.name || (null === (i2 = t$12.strings) || void 0 === i2 ? void 0 : i2.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute."); } render(t2) { return " " + Object.keys(t2).filter((i2) => t2[i2]).join(" ") + " "; } update(i2, [s2]) { var r2, o2; if (void 0 === this.it) { this.it = /* @__PURE__ */ new Set(), void 0 !== i2.strings && (this.nt = new Set(i2.strings.join(" ").split(/\s/).filter((t2) => "" !== t2))); for (const t2 in s2) s2[t2] && !(null === (r2 = this.nt) || void 0 === r2 ? void 0 : r2.has(t2)) && this.it.add(t2); return this.render(s2); } const e2 = i2.element.classList; this.it.forEach((t2) => { t2 in s2 || (e2.remove(t2), this.it.delete(t2)); }); for (const t2 in s2) { const i3 = !!s2[t2]; i3 === this.it.has(t2) || (null === (o2 = this.nt) || void 0 === o2 ? void 0 : o2.has(t2)) || (i3 ? (e2.add(t2), this.it.add(t2)) : (e2.remove(t2), this.it.delete(t2))); } return T$1; } }); function addUniqueItem(array2, item) { array2.indexOf(item) === -1 && array2.push(item); } const clamp = (min2, max2, v2) => Math.min(Math.max(v2, min2), max2); const defaults = { duration: 0.3, delay: 0, endDelay: 0, repeat: 0, easing: "ease" }; const isNumber = (value) => typeof value === "number"; const isEasingList = (easing) => Array.isArray(easing) && !isNumber(easing[0]); const wrap = (min2, max2, v2) => { const rangeSize = max2 - min2; return ((v2 - min2) % rangeSize + rangeSize) % rangeSize + min2; }; function getEasingForSegment(easing, i2) { return isEasingList(easing) ? easing[wrap(0, easing.length, i2)] : easing; } const mix = (min2, max2, progress2) => -progress2 * min2 + progress2 * max2 + min2; const noop = () => { }; const noopReturn = (v2) => v2; const progress = (min2, max2, value) => max2 - min2 === 0 ? 1 : (value - min2) / (max2 - min2); function fillOffset(offset, remaining) { const min2 = offset[offset.length - 1]; for (let i2 = 1; i2 <= remaining; i2++) { const offsetProgress = progress(0, remaining, i2); offset.push(mix(min2, 1, offsetProgress)); } } function defaultOffset(length) { const offset = [0]; fillOffset(offset, length - 1); return offset; } function interpolate(output2, input = defaultOffset(output2.length), easing = noopReturn) { const length = output2.length; const remainder = length - input.length; remainder > 0 && fillOffset(input, remainder); return (t2) => { let i2 = 0; for (; i2 < length - 2; i2++) { if (t2 < input[i2 + 1]) break; } let progressInRange = clamp(0, 1, progress(input[i2], input[i2 + 1], t2)); const segmentEasing = getEasingForSegment(easing, i2); progressInRange = segmentEasing(progressInRange); return mix(output2[i2], output2[i2 + 1], progressInRange); }; } const isCubicBezier = (easing) => Array.isArray(easing) && isNumber(easing[0]); const isEasingGenerator = (easing) => typeof easing === "object" && Boolean(easing.createAnimation); const isFunction = (value) => typeof value === "function"; const isString = (value) => typeof value === "string"; const time = { ms: (seconds) => seconds * 1e3, s: (milliseconds) => milliseconds / 1e3 }; const calcBezier = (t2, a1, a2) => (((1 - 3 * a2 + 3 * a1) * t2 + (3 * a2 - 6 * a1)) * t2 + 3 * a1) * t2; const subdivisionPrecision = 1e-7; const subdivisionMaxIterations = 12; function binarySubdivide(x2, lowerBound, upperBound, mX1, mX2) { let currentX; let currentT; let i2 = 0; do { currentT = lowerBound + (upperBound - lowerBound) / 2; currentX = calcBezier(currentT, mX1, mX2) - x2; if (currentX > 0) { upperBound = currentT; } else { lowerBound = currentT; } } while (Math.abs(currentX) > subdivisionPrecision && ++i2 < subdivisionMaxIterations); return currentT; } function cubicBezier(mX1, mY1, mX2, mY2) { if (mX1 === mY1 && mX2 === mY2) return noopReturn; const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); return (t2) => t2 === 0 || t2 === 1 ? t2 : calcBezier(getTForX(t2), mY1, mY2); } const steps = (steps2, direction = "end") => (progress2) => { progress2 = direction === "end" ? Math.min(progress2, 0.999) : Math.max(progress2, 1e-3); const expanded = progress2 * steps2; const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); return clamp(0, 1, rounded / steps2); }; const namedEasings = { ease: cubicBezier(0.25, 0.1, 0.25, 1), "ease-in": cubicBezier(0.42, 0, 1, 1), "ease-in-out": cubicBezier(0.42, 0, 0.58, 1), "ease-out": cubicBezier(0, 0, 0.58, 1) }; const functionArgsRegex = /\((.*?)\)/; function getEasingFunction(definition) { if (isFunction(definition)) return definition; if (isCubicBezier(definition)) return cubicBezier(...definition); if (namedEasings[definition]) return namedEasings[definition]; if (definition.startsWith("steps")) { const args = functionArgsRegex.exec(definition); if (args) { const argsArray = args[1].split(","); return steps(parseFloat(argsArray[0]), argsArray[1].trim()); } } return noopReturn; } class Animation { constructor(output2, keyframes = [0, 1], { easing, duration: initialDuration = defaults.duration, delay: delay2 = defaults.delay, endDelay = defaults.endDelay, repeat = defaults.repeat, offset, direction = "normal", autoplay = true } = {}) { this.startTime = null; this.rate = 1; this.t = 0; this.cancelTimestamp = null; this.easing = noopReturn; this.duration = 0; this.totalDuration = 0; this.repeat = 0; this.playState = "idle"; this.finished = new Promise((resolve, reject) => { this.resolve = resolve; this.reject = reject; }); easing = easing || defaults.easing; if (isEasingGenerator(easing)) { const custom2 = easing.createAnimation(keyframes); easing = custom2.easing; keyframes = custom2.keyframes || keyframes; initialDuration = custom2.duration || initialDuration; } this.repeat = repeat; this.easing = isEasingList(easing) ? noopReturn : getEasingFunction(easing); this.updateDuration(initialDuration); const interpolate$1 = interpolate(keyframes, offset, isEasingList(easing) ? easing.map(getEasingFunction) : noopReturn); this.tick = (timestamp) => { var _a2; delay2 = delay2; let t2 = 0; if (this.pauseTime !== void 0) { t2 = this.pauseTime; } else { t2 = (timestamp - this.startTime) * this.rate; } this.t = t2; t2 /= 1e3; t2 = Math.max(t2 - delay2, 0); if (this.playState === "finished" && this.pauseTime === void 0) { t2 = this.totalDuration; } const progress2 = t2 / this.duration; let currentIteration = Math.floor(progress2); let iterationProgress = progress2 % 1; if (!iterationProgress && progress2 >= 1) { iterationProgress = 1; } iterationProgress === 1 && currentIteration--; const iterationIsOdd = currentIteration % 2; if (direction === "reverse" || direction === "alternate" && iterationIsOdd || direction === "alternate-reverse" && !iterationIsOdd) { iterationProgress = 1 - iterationProgress; } const p2 = t2 >= this.totalDuration ? 1 : Math.min(iterationProgress, 1); const latest = interpolate$1(this.easing(p2)); output2(latest); const isAnimationFinished = this.pauseTime === void 0 && (this.playState === "finished" || t2 >= this.totalDuration + endDelay); if (isAnimationFinished) { this.playState = "finished"; (_a2 = this.resolve) === null || _a2 === void 0 ? void 0 : _a2.call(this, latest); } else if (this.playState !== "idle") { this.frameRequestId = requestAnimationFrame(this.tick); } }; if (autoplay) this.play(); } play() { const now = performance.now(); this.playState = "running"; if (this.pauseTime !== void 0) { this.startTime = now - this.pauseTime; } else if (!this.startTime) { this.startTime = now; } 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 _a2; this.playState = "idle"; if (this.frameRequestId !== void 0) { cancelAnimationFrame(this.frameRequestId); } (_a2 = this.reject) === null || _a2 === void 0 ? void 0 : _a2.call(this, false); } cancel() { this.stop(); this.tick(this.cancelTimestamp); } reverse() { this.rate *= -1; } commitStyles() { } updateDuration(duration) { this.duration = duration; this.totalDuration = duration * (this.repeat + 1); } get currentTime() { return this.t; } set currentTime(t2) { if (this.pauseTime !== void 0 || this.rate === 0) { this.pauseTime = t2; } else { this.startTime = performance.now() - t2 / this.rate; } } get playbackRate() { return this.rate; } set playbackRate(rate) { this.rate = rate; } } var invariant = function() { }; if (process.env.NODE_ENV !== "production") { invariant = function(check, message) { if (!check) { throw new Error(message); } }; } class MotionValue { setAnimation(animation) { this.animation = animation; animation === null || animation === void 0 ? void 0 : animation.finished.then(() => this.clearAnimation()).catch(() => { }); } clearAnimation() { this.animation = this.generator = void 0; } } const data = /* @__PURE__ */ new WeakMap(); function getAnimationData(element) { if (!data.has(element)) { data.set(element, { transforms: [], values: /* @__PURE__ */ new Map() }); } return data.get(element); } function getMotionValue(motionValues, name2) { if (!motionValues.has(name2)) { motionValues.set(name2, new MotionValue()); } return motionValues.get(name2); } const axes = ["", "X", "Y", "Z"]; const order = ["translate", "scale", "rotate", "skew"]; const transformAlias = { x: "translateX", y: "translateY", z: "translateZ" }; const rotation = { syntax: "", initialValue: "0deg", toDefaultUnit: (v2) => v2 + "deg" }; const baseTransformProperties = { translate: { syntax: "", initialValue: "0px", toDefaultUnit: (v2) => v2 + "px" }, rotate: rotation, scale: { syntax: "", initialValue: 1, toDefaultUnit: noopReturn }, skew: rotation }; const transformDefinitions = /* @__PURE__ */ new Map(); const asTransformCssVar = (name2) => `--motion-${name2}`; const transforms = ["x", "y", "z"]; order.forEach((name2) => { axes.forEach((axis) => { transforms.push(name2 + axis); transformDefinitions.set(asTransformCssVar(name2 + axis), baseTransformProperties[name2]); }); }); const compareTransformOrder = (a2, b2) => transforms.indexOf(a2) - transforms.indexOf(b2); const transformLookup = new Set(transforms); const isTransform = (name2) => transformLookup.has(name2); const addTransformToElement = (element, name2) => { if (transformAlias[name2]) name2 = transformAlias[name2]; const { transforms: transforms2 } = getAnimationData(element); addUniqueItem(transforms2, name2); element.style.transform = buildTransformTemplate(transforms2); }; const buildTransformTemplate = (transforms2) => transforms2.sort(compareTransformOrder).reduce(transformListToString, "").trim(); const transformListToString = (template, name2) => `${template} ${name2}(var(${asTransformCssVar(name2)}))`; const isCssVar = (name2) => name2.startsWith("--"); const registeredProperties = /* @__PURE__ */ new Set(); function registerCssVariable(name2) { if (registeredProperties.has(name2)) return; registeredProperties.add(name2); try { const { syntax, initialValue } = transformDefinitions.has(name2) ? transformDefinitions.get(name2) : {}; CSS.registerProperty({ name: name2, inherits: false, syntax, initialValue }); } catch (e2) { } } const testAnimation = (keyframes, options) => document.createElement("div").animate(keyframes, options); const featureTests = { cssRegisterProperty: () => typeof CSS !== "undefined" && Object.hasOwnProperty.call(CSS, "registerProperty"), waapi: () => Object.hasOwnProperty.call(Element.prototype, "animate"), partialKeyframes: () => { try { testAnimation({ opacity: [1] }); } catch (e2) { return false; } return true; }, finished: () => Boolean(testAnimation({ opacity: [0, 1] }, { duration: 1e-3 }).finished), linearEasing: () => { try { testAnimation({ opacity: 0 }, { easing: "linear(0, 1)" }); } catch (e2) { return false; } return true; } }; const results = {}; const supports = {}; for (const key in featureTests) { supports[key] = () => { if (results[key] === void 0) results[key] = featureTests[key](); return results[key]; }; } const resolution = 0.015; const generateLinearEasingPoints = (easing, duration) => { let points = ""; const numPoints = Math.round(duration / resolution); for (let i2 = 0; i2 < numPoints; i2++) { points += easing(progress(0, numPoints - 1, i2)) + ", "; } return points.substring(0, points.length - 2); }; const convertEasing = (easing, duration) => { if (isFunction(easing)) { return supports.linearEasing() ? `linear(${generateLinearEasingPoints(easing, duration)})` : defaults.easing; } else { return isCubicBezier(easing) ? cubicBezierAsString(easing) : easing; } }; const cubicBezierAsString = ([a2, b2, c2, d2]) => `cubic-bezier(${a2}, ${b2}, ${c2}, ${d2})`; function hydrateKeyframes(keyframes, readInitialValue) { for (let i2 = 0; i2 < keyframes.length; i2++) { if (keyframes[i2] === null) { keyframes[i2] = i2 ? keyframes[i2 - 1] : readInitialValue(); } } return keyframes; } const keyframesList = (keyframes) => Array.isArray(keyframes) ? keyframes : [keyframes]; function getStyleName(key) { if (transformAlias[key]) key = transformAlias[key]; return isTransform(key) ? asTransformCssVar(key) : key; } const style = { get: (element, name2) => { name2 = getStyleName(name2); let value = isCssVar(name2) ? element.style.getPropertyValue(name2) : getComputedStyle(element)[name2]; if (!value && value !== 0) { const definition = transformDefinitions.get(name2); if (definition) value = definition.initialValue; } return value; }, set: (element, name2, value) => { name2 = getStyleName(name2); if (isCssVar(name2)) { element.style.setProperty(name2, value); } else { element.style[name2] = value; } } }; function stopAnimation(animation, needsCommit = true) { if (!animation || animation.playState === "finished") return; try { if (animation.stop) { animation.stop(); } else { needsCommit && animation.commitStyles(); animation.cancel(); } } catch (e2) { } } function getUnitConverter(keyframes, definition) { var _a2; let toUnit = (definition === null || definition === void 0 ? void 0 : definition.toDefaultUnit) || noopReturn; const finalKeyframe = keyframes[keyframes.length - 1]; if (isString(finalKeyframe)) { const unit = ((_a2 = finalKeyframe.match(/(-?[\d.]+)([a-z%]*)/)) === null || _a2 === void 0 ? void 0 : _a2[2]) || ""; if (unit) toUnit = (value) => value + unit; } return toUnit; } function getDevToolsRecord() { return window.__MOTION_DEV_TOOLS_RECORD; } function animateStyle(element, key, keyframesDefinition, options = {}, AnimationPolyfill) { const record2 = getDevToolsRecord(); const isRecording = options.record !== false && record2; let animation; let { duration = defaults.duration, delay: delay2 = defaults.delay, endDelay = defaults.endDelay, repeat = defaults.repeat, easing = defaults.easing, persist: persist2 = false, direction, offset, allowWebkitAcceleration = false, autoplay = true } = options; const data2 = getAnimationData(element); const valueIsTransform = isTransform(key); let canAnimateNatively = supports.waapi(); valueIsTransform && addTransformToElement(element, key); const name2 = getStyleName(key); const motionValue = getMotionValue(data2.values, name2); const definition = transformDefinitions.get(name2); stopAnimation(motionValue.animation, !(isEasingGenerator(easing) && motionValue.generator) && options.record !== false); return () => { const readInitialValue = () => { var _a2, _b2; return (_b2 = (_a2 = style.get(element, name2)) !== null && _a2 !== void 0 ? _a2 : definition === null || definition === void 0 ? void 0 : definition.initialValue) !== null && _b2 !== void 0 ? _b2 : 0; }; let keyframes = hydrateKeyframes(keyframesList(keyframesDefinition), readInitialValue); const toUnit = getUnitConverter(keyframes, definition); if (isEasingGenerator(easing)) { const custom2 = easing.createAnimation(keyframes, key !== "opacity", readInitialValue, name2, motionValue); easing = custom2.easing; keyframes = custom2.keyframes || keyframes; duration = custom2.duration || duration; } if (isCssVar(name2)) { if (supports.cssRegisterProperty()) { registerCssVariable(name2); } else { canAnimateNatively = false; } } if (valueIsTransform && !supports.linearEasing() && (isFunction(easing) || isEasingList(easing) && easing.some(isFunction))) { canAnimateNatively = false; } if (canAnimateNatively) { if (definition) { keyframes = keyframes.map((value) => isNumber(value) ? definition.toDefaultUnit(value) : value); } if (keyframes.length === 1 && (!supports.partialKeyframes() || isRecording)) { keyframes.unshift(readInitialValue()); } const animationOptions = { delay: time.ms(delay2), duration: time.ms(duration), endDelay: time.ms(endDelay), easing: !isEasingList(easing) ? convertEasing(easing, duration) : void 0, direction, iterations: repeat + 1, fill: "both" }; animation = element.animate({ [name2]: keyframes, offset, easing: isEasingList(easing) ? easing.map((thisEasing) => convertEasing(thisEasing, duration)) : void 0 }, animationOptions); if (!animation.finished) { animation.finished = new Promise((resolve, reject) => { animation.onfinish = resolve; animation.oncancel = reject; }); } const target = keyframes[keyframes.length - 1]; animation.finished.then(() => { if (persist2) return; style.set(element, name2, target); animation.cancel(); }).catch(noop); if (!allowWebkitAcceleration) animation.playbackRate = 1.000001; } else if (AnimationPolyfill && valueIsTransform) { keyframes = keyframes.map((value) => typeof value === "string" ? parseFloat(value) : value); if (keyframes.length === 1) { keyframes.unshift(parseFloat(readInitialValue())); } animation = new AnimationPolyfill((latest) => { style.set(element, name2, toUnit ? toUnit(latest) : latest); }, keyframes, Object.assign(Object.assign({}, options), { duration, easing })); } else { const target = keyframes[keyframes.length - 1]; style.set(element, name2, definition && isNumber(target) ? definition.toDefaultUnit(target) : target); } if (isRecording) { record2(element, key, keyframes, { duration, delay: delay2, easing, repeat, offset }, "motion-one"); } motionValue.setAnimation(animation); if (animation && !autoplay) animation.pause(); return animation; }; } const getOptions = (options, key) => ( /** * TODO: Make test for this * Always return a new object otherwise delay is overwritten by results of stagger * and this results in no stagger */ options[key] ? Object.assign(Object.assign({}, options), options[key]) : Object.assign({}, options) ); function resolveElements(elements, selectorCache) { var _a2; if (typeof elements === "string") { if (selectorCache) { (_a2 = selectorCache[elements]) !== null && _a2 !== void 0 ? _a2 : selectorCache[elements] = document.querySelectorAll(elements); elements = selectorCache[elements]; } else { elements = document.querySelectorAll(elements); } } else if (elements instanceof Element) { elements = [elements]; } return Array.from(elements || []); } const createAnimation = (factory) => factory(); const withControls = (animationFactory, options, duration = defaults.duration) => { return new Proxy({ animations: animationFactory.map(createAnimation).filter(Boolean), duration, options }, controls); }; const getActiveAnimation = (state2) => state2.animations[0]; const controls = { get: (target, key) => { const activeAnimation = getActiveAnimation(target); switch (key) { case "duration": return target.duration; case "currentTime": return time.s((activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]) || 0); case "playbackRate": case "playState": return activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]; case "finished": if (!target.finished) { target.finished = Promise.all(target.animations.map(selectFinished)).catch(noop); } return target.finished; case "stop": return () => { target.animations.forEach((animation) => stopAnimation(animation)); }; case "forEachNative": return (callback) => { target.animations.forEach((animation) => callback(animation, target)); }; default: return typeof (activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]) === "undefined" ? void 0 : () => target.animations.forEach((animation) => animation[key]()); } }, set: (target, key, value) => { switch (key) { case "currentTime": value = time.ms(value); case "playbackRate": for (let i2 = 0; i2 < target.animations.length; i2++) { target.animations[i2][key] = value; } return true; } return false; } }; const selectFinished = (animation) => animation.finished; function resolveOption(option, i2, total) { return isFunction(option) ? option(i2, total) : option; } function createAnimate(AnimatePolyfill) { return function animate2(elements, keyframes, options = {}) { elements = resolveElements(elements); const numElements = elements.length; invariant(Boolean(numElements), "No valid element provided."); invariant(Boolean(keyframes), "No keyframes defined."); const animationFactories = []; for (let i2 = 0; i2 < numElements; i2++) { const element = elements[i2]; for (const key in keyframes) { const valueOptions = getOptions(options, key); valueOptions.delay = resolveOption(valueOptions.delay, i2, numElements); const animation = animateStyle(element, key, keyframes[key], valueOptions, AnimatePolyfill); animationFactories.push(animation); } } return withControls( animationFactories, options, /** * TODO: * If easing is set to spring or glide, duration will be dynamically * generated. Ideally we would dynamically generate this from * animation.effect.getComputedTiming().duration but this isn't * supported in iOS13 or our number polyfill. Perhaps it's possible * to Proxy animations returned from animateStyle that has duration * as a getter. */ options.duration ); }; } const animate$1 = createAnimate(Animation); function animateProgress(target, options = {}) { return withControls([ () => { const animation = new Animation(target, [0, 1], options); animation.finished.catch(() => { }); return animation; } ], options, options.duration); } function animate(target, keyframesOrOptions, options) { const factory = isFunction(target) ? animateProgress : animate$1; return factory(target, keyframesOrOptions, options); } /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const l = (l2) => null != l2 ? l2 : A$1; var et = Object.defineProperty, Be = Object.getOwnPropertySymbols, tt = Object.prototype.hasOwnProperty, ot = Object.prototype.propertyIsEnumerable, Ue = (e2, o2, r2) => o2 in e2 ? et(e2, o2, { enumerable: true, configurable: true, writable: true, value: r2 }) : e2[o2] = r2, ve = (e2, o2) => { for (var r2 in o2 || (o2 = {})) tt.call(o2, r2) && Ue(e2, r2, o2[r2]); if (Be) for (var r2 of Be(o2)) ot.call(o2, r2) && Ue(e2, r2, o2[r2]); return e2; }; function rt() { var e2; const o2 = (e2 = ne$1.state.themeMode) != null ? e2 : "dark", r2 = { 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)" } }[o2]; return { "--wcm-color-fg-1": r2.foreground[1], "--wcm-color-fg-2": r2.foreground[2], "--wcm-color-fg-3": r2.foreground[3], "--wcm-color-bg-1": r2.background[1], "--wcm-color-bg-2": r2.background[2], "--wcm-color-bg-3": r2.background[3], "--wcm-color-overlay": r2.overlay }; } function He() { return { "--wcm-accent-color": "#3396FF", "--wcm-accent-fill-color": "#FFFFFF", "--wcm-z-index": "89", "--wcm-background-color": "#3396FF", "--wcm-background-border-radius": "8px", "--wcm-container-border-radius": "30px", "--wcm-wallet-icon-border-radius": "15px", "--wcm-wallet-icon-large-border-radius": "30px", "--wcm-wallet-icon-small-border-radius": "7px", "--wcm-input-border-radius": "28px", "--wcm-button-border-radius": "10px", "--wcm-notification-border-radius": "36px", "--wcm-secondary-button-border-radius": "28px", "--wcm-icon-button-border-radius": "50%", "--wcm-button-hover-highlight-border-radius": "10px", "--wcm-text-big-bold-size": "20px", "--wcm-text-big-bold-weight": "600", "--wcm-text-big-bold-line-height": "24px", "--wcm-text-big-bold-letter-spacing": "-0.03em", "--wcm-text-big-bold-text-transform": "none", "--wcm-text-xsmall-bold-size": "10px", "--wcm-text-xsmall-bold-weight": "700", "--wcm-text-xsmall-bold-line-height": "12px", "--wcm-text-xsmall-bold-letter-spacing": "0.02em", "--wcm-text-xsmall-bold-text-transform": "uppercase", "--wcm-text-xsmall-regular-size": "12px", "--wcm-text-xsmall-regular-weight": "600", "--wcm-text-xsmall-regular-line-height": "14px", "--wcm-text-xsmall-regular-letter-spacing": "-0.03em", "--wcm-text-xsmall-regular-text-transform": "none", "--wcm-text-small-thin-size": "14px", "--wcm-text-small-thin-weight": "500", "--wcm-text-small-thin-line-height": "16px", "--wcm-text-small-thin-letter-spacing": "-0.03em", "--wcm-text-small-thin-text-transform": "none", "--wcm-text-small-regular-size": "14px", "--wcm-text-small-regular-weight": "600", "--wcm-text-small-regular-line-height": "16px", "--wcm-text-small-regular-letter-spacing": "-0.03em", "--wcm-text-small-regular-text-transform": "none", "--wcm-text-medium-regular-size": "16px", "--wcm-text-medium-regular-weight": "600", "--wcm-text-medium-regular-line-height": "20px", "--wcm-text-medium-regular-letter-spacing": "-0.03em", "--wcm-text-medium-regular-text-transform": "none", "--wcm-font-family": "-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif", "--wcm-font-feature-settings": "'tnum' on, 'lnum' on, 'case' on", "--wcm-success-color": "rgb(38,181,98)", "--wcm-error-color": "rgb(242, 90, 103)", "--wcm-overlay-background-color": "rgba(0, 0, 0, 0.3)", "--wcm-overlay-backdrop-filter": "none" }; } const h = { getPreset(e2) { return He()[e2]; }, setTheme() { const e2 = document.querySelector(":root"), { themeVariables: o2 } = ne$1.state; if (e2) { const r2 = ve(ve(ve({}, rt()), He()), o2); Object.entries(r2).forEach(([a2, t2]) => e2.style.setProperty(a2, t2)); } }, globalCss: i$3`*,::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 wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}` }, at = i$3`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`; var lt = Object.defineProperty, it = Object.getOwnPropertyDescriptor, F = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? it(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && lt(o2, r2, t2), t2; }; let T = class extends s { constructor() { super(...arguments), this.disabled = false, this.iconLeft = void 0, this.iconRight = void 0, this.onClick = () => null, this.variant = "default"; } render() { const e2 = { "wcm-icon-left": this.iconLeft !== void 0, "wcm-icon-right": this.iconRight !== void 0, "wcm-ghost": this.variant === "ghost", "wcm-outline": this.variant === "outline" }; let o$12 = "inverse"; return this.variant === "ghost" && (o$12 = "secondary"), this.variant === "outline" && (o$12 = "accent"), x``; } }; T.styles = [h.globalCss, at], F([n$1({ type: Boolean })], T.prototype, "disabled", 2), F([n$1()], T.prototype, "iconLeft", 2), F([n$1()], T.prototype, "iconRight", 2), F([n$1()], T.prototype, "onClick", 2), F([n$1()], T.prototype, "variant", 2), T = F([e$2("wcm-button")], T); const nt = i$3`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-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(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`; var ct = Object.defineProperty, st = Object.getOwnPropertyDescriptor, ue = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? st(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && ct(o2, r2, t2), t2; }; let ee = class extends s { constructor() { super(...arguments), this.disabled = false, this.variant = "primary"; } render() { const e2 = { "wcm-secondary": this.variant === "secondary" }; return x``; } }; ee.styles = [h.globalCss, nt], ue([n$1({ type: Boolean })], ee.prototype, "disabled", 2), ue([n$1()], ee.prototype, "variant", 2), ee = ue([e$2("wcm-button-big")], ee); const dt = i$3`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`; var mt = Object.defineProperty, ht = Object.getOwnPropertyDescriptor, wt = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? ht(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && mt(o2, r2, t2), t2; }; let be = class extends s { render() { return x`
`; } }; be.styles = [h.globalCss, dt], be = wt([e$2("wcm-info-footer")], be); const v = { CROSS_ICON: b``, WALLET_CONNECT_LOGO: b``, WALLET_CONNECT_ICON: b``, WALLET_CONNECT_ICON_COLORED: b``, BACK_ICON: b``, COPY_ICON: b``, RETRY_ICON: b``, DESKTOP_ICON: b``, MOBILE_ICON: b``, ARROW_DOWN_ICON: b``, ARROW_UP_RIGHT_ICON: b``, ARROW_RIGHT_ICON: b``, QRCODE_ICON: b``, SCAN_ICON: b``, CHECKMARK_ICON: b``, SEARCH_ICON: b``, WALLET_PLACEHOLDER: b``, GLOBE_ICON: b`` }, pt = i$3`.wcm-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(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`; var gt = Object.defineProperty, vt = Object.getOwnPropertyDescriptor, ut = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? vt(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && gt(o2, r2, t2), t2; }; let fe = class extends s { render() { return x`
${v.WALLET_CONNECT_LOGO}
`; } }; fe.styles = [h.globalCss, pt], fe = ut([e$2("wcm-modal-backcard")], fe); const bt = i$3`main{padding:20px;padding-top:0;width:100%}`; var ft = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, yt = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? xt(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && ft(o2, r2, t2), t2; }; let xe = class extends s { render() { return x`
`; } }; xe.styles = [h.globalCss, bt], xe = yt([e$2("wcm-modal-content")], xe); const $t = i$3`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`; var Ct = Object.defineProperty, kt = Object.getOwnPropertyDescriptor, Ot = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? kt(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Ct(o2, r2, t2), t2; }; let ye = class extends s { render() { return x`
`; } }; ye.styles = [h.globalCss, $t], ye = Ot([e$2("wcm-modal-footer")], ye); const Wt = i$3`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`; var It = Object.defineProperty, Et = Object.getOwnPropertyDescriptor, te = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Et(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && It(o2, r2, t2), t2; }; let S = class extends s { constructor() { super(...arguments), this.title = "", this.onAction = void 0, this.actionIcon = void 0, this.border = false; } backBtnTemplate() { return x``; } actionBtnTemplate() { return x``; } render() { const e2 = { "wcm-border": this.border }, o$12 = T$2.state.history.length > 1, r2 = this.title ? x`${this.title}` : x``; return x`
${o$12 ? this.backBtnTemplate() : null} ${r2} ${this.onAction ? this.actionBtnTemplate() : null}
`; } }; S.styles = [h.globalCss, Wt], te([n$1()], S.prototype, "title", 2), te([n$1()], S.prototype, "onAction", 2), te([n$1()], S.prototype, "actionIcon", 2), te([n$1({ type: Boolean })], S.prototype, "border", 2), S = te([e$2("wcm-modal-header")], S); const c = { MOBILE_BREAKPOINT: 600, WCM_RECENT_WALLET_DATA: "WCM_RECENT_WALLET_DATA", EXPLORER_WALLET_URL: "https://explorer.walletconnect.com/?type=wallet", getShadowRootElement(e2, o2) { const r2 = e2.renderRoot.querySelector(o2); if (!r2) throw new Error(`${o2} not found`); return r2; }, getWalletIcon({ id: e2, image_id: o2 }) { const { walletImages: r2 } = y$1.state; return r2 != null && r2[e2] ? r2[e2] : o2 ? te$1.getWalletImageUrl(o2) : ""; }, getWalletName(e2, o2 = false) { return o2 && e2.length > 8 ? `${e2.substring(0, 8)}..` : e2; }, isMobileAnimation() { return window.innerWidth <= c.MOBILE_BREAKPOINT; }, async preloadImage(e2) { const o2 = new Promise((r2, a2) => { const t2 = new Image(); t2.onload = r2, t2.onerror = a2, t2.crossOrigin = "anonymous", t2.src = e2; }); return Promise.race([o2, a$2.wait(3e3)]); }, getErrorMessage(e2) { return e2 instanceof Error ? e2.message : "Unknown Error"; }, debounce(e2, o2 = 500) { let r2; return (...a2) => { function t2() { e2(...a2); } r2 && clearTimeout(r2), r2 = setTimeout(t2, o2); }; }, handleMobileLinking(e2) { const { walletConnectUri: o2 } = p$1.state, { mobile: r2, name: a2 } = e2, t2 = r2 == null ? void 0 : r2.native, l2 = r2 == null ? void 0 : r2.universal; c.setRecentWallet(e2); function i2(s2) { let $2 = ""; t2 ? $2 = a$2.formatUniversalUrl(t2, s2, a2) : l2 && ($2 = a$2.formatNativeUrl(l2, s2, a2)), a$2.openHref($2, "_self"); } o2 && i2(o2); }, handleAndroidLinking() { const { walletConnectUri: e2 } = p$1.state; e2 && (a$2.setWalletConnectAndroidDeepLink(e2), a$2.openHref(e2, "_self")); }, async handleUriCopy() { const { walletConnectUri: e2 } = p$1.state; if (e2) try { await navigator.clipboard.writeText(e2), oe$1.openToast("Link copied", "success"); } catch { oe$1.openToast("Failed to copy", "error"); } }, getCustomImageUrls() { const { walletImages: e2 } = y$1.state, o2 = Object.values(e2 ?? {}); return Object.values(o2); }, truncate(e2, o2 = 8) { return e2.length <= o2 ? e2 : `${e2.substring(0, 4)}...${e2.substring(e2.length - 4)}`; }, setRecentWallet(e2) { try { localStorage.setItem(c.WCM_RECENT_WALLET_DATA, JSON.stringify(e2)); } catch { console.info("Unable to set recent wallet"); } }, getRecentWallet() { try { const e2 = localStorage.getItem(c.WCM_RECENT_WALLET_DATA); return e2 ? JSON.parse(e2) : void 0; } catch { console.info("Unable to get recent wallet"); } }, caseSafeIncludes(e2, o2) { return e2.toUpperCase().includes(o2.toUpperCase()); }, openWalletExplorerUrl() { a$2.openHref(c.EXPLORER_WALLET_URL, "_blank"); }, getCachedRouterWalletPlatforms() { const { desktop: e2, mobile: o2 } = a$2.getWalletRouterData(), r2 = Boolean(e2 == null ? void 0 : e2.native), a2 = Boolean(e2 == null ? void 0 : e2.universal), t2 = Boolean(o2 == null ? void 0 : o2.native) || Boolean(o2 == null ? void 0 : o2.universal); return { isDesktop: r2, isMobile: t2, isWeb: a2 }; }, goToConnectingView(e2) { T$2.setData({ Wallet: e2 }); const o2 = a$2.isMobile(), { isDesktop: r2, isWeb: a2, isMobile: t2 } = c.getCachedRouterWalletPlatforms(); o2 ? t2 ? T$2.push("MobileConnecting") : a2 ? T$2.push("WebConnecting") : T$2.push("InstallWallet") : r2 ? T$2.push("DesktopConnecting") : a2 ? T$2.push("WebConnecting") : t2 ? T$2.push("MobileQrcodeConnecting") : T$2.push("InstallWallet"); } }, Mt = i$3`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`; var Lt = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, $e = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Rt(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Lt(o2, r2, t2), t2; }; let oe = class extends s { constructor() { super(), this.view = T$2.state.view, this.prevView = T$2.state.view, this.unsubscribe = void 0, this.oldHeight = "0px", this.resizeObserver = void 0, this.unsubscribe = T$2.subscribe((e2) => { this.view !== e2.view && this.onChangeRoute(); }); } firstUpdated() { this.resizeObserver = new ResizeObserver(([e2]) => { const o2 = `${e2.contentRect.height}px`; this.oldHeight !== "0px" && animate(this.routerEl, { height: [this.oldHeight, o2] }, { duration: 0.2 }), this.oldHeight = o2; }), this.resizeObserver.observe(this.contentEl); } disconnectedCallback() { var e2, o2; (e2 = this.unsubscribe) == null || e2.call(this), (o2 = this.resizeObserver) == null || o2.disconnect(); } get routerEl() { return c.getShadowRootElement(this, ".wcm-router"); } get contentEl() { return c.getShadowRootElement(this, ".wcm-content"); } viewTemplate() { switch (this.view) { case "ConnectWallet": return x``; case "DesktopConnecting": return x``; case "MobileConnecting": return x``; case "WebConnecting": return x``; case "MobileQrcodeConnecting": return x``; case "WalletExplorer": return x``; case "Qrcode": return x``; case "InstallWallet": return x``; default: return x`
Not Found
`; } } async onChangeRoute() { await animate(this.routerEl, { opacity: [1, 0], scale: [1, 1.02] }, { duration: 0.15, delay: 0.1 }).finished, this.view = T$2.state.view, animate(this.routerEl, { opacity: [0, 1], scale: [0.99, 1] }, { duration: 0.37, delay: 0.05 }); } render() { return x`
${this.viewTemplate()}
`; } }; oe.styles = [h.globalCss, Mt], $e([t$1()], oe.prototype, "view", 2), $e([t$1()], oe.prototype, "prevView", 2), oe = $e([e$2("wcm-modal-router")], oe); const At = i$3`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(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`; var Pt = Object.defineProperty, Tt = Object.getOwnPropertyDescriptor, ze = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Tt(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Pt(o2, r2, t2), t2; }; let ne = class extends s { constructor() { super(), this.open = false, this.unsubscribe = void 0, this.timeout = void 0, this.unsubscribe = oe$1.subscribe((e2) => { e2.open ? (this.open = true, this.timeout = setTimeout(() => oe$1.closeToast(), 2200)) : (this.open = false, clearTimeout(this.timeout)); }); } disconnectedCallback() { var e2; (e2 = this.unsubscribe) == null || e2.call(this), clearTimeout(this.timeout), oe$1.closeToast(); } render() { const { message: e2, variant: o$12 } = oe$1.state, r2 = { "wcm-success": o$12 === "success", "wcm-error": o$12 === "error" }; return this.open ? x`
${o$12 === "success" ? v.CHECKMARK_ICON : null} ${o$12 === "error" ? v.CROSS_ICON : null}${e2}
` : null; } }; ne.styles = [h.globalCss, At], ze([t$1()], ne.prototype, "open", 2), ne = ze([e$2("wcm-modal-toast")], ne); const jt = 0.1, Ve = 2.5, A = 7; function Ce(e2, o2, r2) { return e2 === o2 ? false : (e2 - o2 < 0 ? o2 - e2 : e2 - o2) <= r2 + jt; } function _t(e2, o2) { const r2 = Array.prototype.slice.call(browser$5.create(e2, { errorCorrectionLevel: o2 }).modules.data, 0), a2 = Math.sqrt(r2.length); return r2.reduce((t2, l2, i2) => (i2 % a2 === 0 ? t2.push([l2]) : t2[t2.length - 1].push(l2)) && t2, []); } const Dt = { generate(e2, o2, r2) { const a2 = "#141414", t2 = "#ffffff", l2 = [], i2 = _t(e2, "Q"), s2 = o2 / i2.length, $2 = [{ x: 0, y: 0 }, { x: 1, y: 0 }, { x: 0, y: 1 }]; $2.forEach(({ x: y2, y: u2 }) => { const O2 = (i2.length - A) * s2 * y2, b$12 = (i2.length - A) * s2 * u2, E2 = 0.45; for (let M2 = 0; M2 < $2.length; M2 += 1) { const V2 = s2 * (A - M2 * 2); l2.push(b``); } }); const f2 = Math.floor((r2 + 25) / s2), Ne2 = i2.length / 2 - f2 / 2, Ze2 = i2.length / 2 + f2 / 2 - 1, Se = []; i2.forEach((y2, u2) => { y2.forEach((O2, b2) => { if (i2[u2][b2] && !(u2 < A && b2 < A || u2 > i2.length - (A + 1) && b2 < A || u2 < A && b2 > i2.length - (A + 1)) && !(u2 > Ne2 && u2 < Ze2 && b2 > Ne2 && b2 < Ze2)) { const E2 = u2 * s2 + s2 / 2, M2 = b2 * s2 + s2 / 2; Se.push([E2, M2]); } }); }); const J2 = {}; return Se.forEach(([y2, u2]) => { J2[y2] ? J2[y2].push(u2) : J2[y2] = [u2]; }), Object.entries(J2).map(([y2, u2]) => { const O2 = u2.filter((b2) => u2.every((E2) => !Ce(b2, E2, s2))); return [Number(y2), O2]; }).forEach(([y2, u2]) => { u2.forEach((O2) => { l2.push(b``); }); }), Object.entries(J2).filter(([y2, u2]) => u2.length > 1).map(([y2, u2]) => { const O2 = u2.filter((b2) => u2.some((E2) => Ce(b2, E2, s2))); return [Number(y2), O2]; }).map(([y2, u2]) => { u2.sort((b2, E2) => b2 < E2 ? -1 : 1); const O2 = []; for (const b2 of u2) { const E2 = O2.find((M2) => M2.some((V2) => Ce(b2, V2, s2))); E2 ? E2.push(b2) : O2.push([b2]); } return [y2, O2.map((b2) => [b2[0], b2[b2.length - 1]])]; }).forEach(([y2, u2]) => { u2.forEach(([O2, b$12]) => { l2.push(b``); }); }), l2; } }, Nt = i$3`@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}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`; var Zt = Object.defineProperty, St = Object.getOwnPropertyDescriptor, q = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? St(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Zt(o2, r2, t2), t2; }; let j = class extends s { constructor() { super(...arguments), this.uri = "", this.size = 0, this.imageId = void 0, this.walletId = void 0, this.imageUrl = void 0; } svgTemplate() { const e2 = ne$1.state.themeMode === "light" ? this.size : this.size - 36; return b`${Dt.generate(this.uri, e2, e2 / 4)}`; } render() { const e2 = { "wcm-dark": ne$1.state.themeMode === "dark" }; return x`
${this.walletId || this.imageUrl ? x`` : v.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`; } }; j.styles = [h.globalCss, Nt], q([n$1()], j.prototype, "uri", 2), q([n$1({ type: Number })], j.prototype, "size", 2), q([n$1()], j.prototype, "imageId", 2), q([n$1()], j.prototype, "walletId", 2), q([n$1()], j.prototype, "imageUrl", 2), j = q([e$2("wcm-qrcode")], j); const Bt = i$3`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-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(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-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(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`; var Ut = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, Fe = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Ht(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Ut(o2, r2, t2), t2; }; let ce = class extends s { constructor() { super(...arguments), this.onChange = () => null; } render() { return x` ${v.SEARCH_ICON}`; } }; ce.styles = [h.globalCss, Bt], Fe([n$1()], ce.prototype, "onChange", 2), ce = Fe([e$2("wcm-search-input")], ce); const zt = i$3`@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(--wcm-accent-color)}`; var Vt = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, qt = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Ft(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Vt(o2, r2, t2), t2; }; let ke = class extends s { render() { return x``; } }; ke.styles = [h.globalCss, zt], ke = qt([e$2("wcm-spinner")], ke); const Qt = i$3`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`; var Kt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, Oe = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Yt(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Kt(o2, r2, t2), t2; }; let re = class extends s { constructor() { super(...arguments), this.variant = "medium-regular", this.color = "primary"; } render() { const e2 = { "wcm-big-bold": this.variant === "big-bold", "wcm-medium-regular": this.variant === "medium-regular", "wcm-small-regular": this.variant === "small-regular", "wcm-small-thin": this.variant === "small-thin", "wcm-xsmall-regular": this.variant === "xsmall-regular", "wcm-xsmall-bold": this.variant === "xsmall-bold", "wcm-color-primary": this.color === "primary", "wcm-color-secondary": this.color === "secondary", "wcm-color-tertiary": this.color === "tertiary", "wcm-color-inverse": this.color === "inverse", "wcm-color-accnt": this.color === "accent", "wcm-color-error": this.color === "error" }; return x``; } }; re.styles = [h.globalCss, Qt], Oe([n$1()], re.prototype, "variant", 2), Oe([n$1()], re.prototype, "color", 2), re = Oe([e$2("wcm-text")], re); const Gt = i$3`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`; var Xt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, _ = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Jt(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Xt(o2, r2, t2), t2; }; let L = class extends s { constructor() { super(...arguments), this.onClick = () => null, this.name = "", this.walletId = "", this.label = void 0, this.imageId = void 0, this.installed = false, this.recent = false; } sublabelTemplate() { return this.recent ? x`RECENT` : this.installed ? x`INSTALLED` : null; } handleClick() { R$1.click({ name: "WALLET_BUTTON", walletId: this.walletId }), this.onClick(); } render() { var e2; return x``; } }; L.styles = [h.globalCss, Gt], _([n$1()], L.prototype, "onClick", 2), _([n$1()], L.prototype, "name", 2), _([n$1()], L.prototype, "walletId", 2), _([n$1()], L.prototype, "label", 2), _([n$1()], L.prototype, "imageId", 2), _([n$1({ type: Boolean })], L.prototype, "installed", 2), _([n$1({ type: Boolean })], L.prototype, "recent", 2), L = _([e$2("wcm-wallet-button")], L); const eo = i$3`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-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(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`; var to = Object.defineProperty, oo = Object.getOwnPropertyDescriptor, se = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? oo(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && to(o2, r2, t2), t2; }; let Q = class extends s { constructor() { super(...arguments), this.walletId = "", this.imageId = void 0, this.imageUrl = void 0; } render() { var e2; const o2 = (e2 = this.imageUrl) != null && e2.length ? this.imageUrl : c.getWalletIcon({ id: this.walletId, image_id: this.imageId }); return x`${o2.length ? x`
${this.id}
` : v.WALLET_PLACEHOLDER}`; } }; Q.styles = [h.globalCss, eo], se([n$1()], Q.prototype, "walletId", 2), se([n$1()], Q.prototype, "imageId", 2), se([n$1()], Q.prototype, "imageUrl", 2), Q = se([e$2("wcm-wallet-image")], Q); var ro = Object.defineProperty, ao = Object.getOwnPropertyDescriptor, qe = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? ao(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && ro(o2, r2, t2), t2; }; let We = class extends s { constructor() { super(), this.preload = true, this.preloadData(); } async loadImages(e2) { try { e2 != null && e2.length && await Promise.all(e2.map(async (o2) => c.preloadImage(o2))); } catch { console.info("Unsuccessful attempt at preloading some images", e2); } } async preloadListings() { if (y$1.state.enableExplorer) { await te$1.getRecomendedWallets(), p$1.setIsDataLoaded(true); const { recomendedWallets: e2 } = te$1.state, o2 = e2.map((r2) => c.getWalletIcon(r2)); await this.loadImages(o2); } else p$1.setIsDataLoaded(true); } async preloadCustomImages() { const e2 = c.getCustomImageUrls(); await this.loadImages(e2); } async preloadData() { try { this.preload && (this.preload = false, await Promise.all([this.preloadListings(), this.preloadCustomImages()])); } catch (e2) { console.error(e2), oe$1.openToast("Failed preloading", "error"); } } }; qe([t$1()], We.prototype, "preload", 2), We = qe([e$2("wcm-explorer-context")], We); var lo = Object.defineProperty, io = Object.getOwnPropertyDescriptor, no = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? io(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && lo(o2, r2, t2), t2; }; let Qe = class extends s { constructor() { super(), this.unsubscribeTheme = void 0, h.setTheme(), this.unsubscribeTheme = ne$1.subscribe(h.setTheme); } disconnectedCallback() { var e2; (e2 = this.unsubscribeTheme) == null || e2.call(this); } }; Qe = no([e$2("wcm-theme-context")], Qe); const co = i$3`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`; var so = Object.defineProperty, mo = Object.getOwnPropertyDescriptor, ho = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? mo(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && so(o2, r2, t2), t2; }; let Ie = class extends s { onGoToQrcode() { T$2.push("Qrcode"); } render() { const { recomendedWallets: e2 } = te$1.state, o2 = [...e2, ...e2], r2 = a$2.RECOMMENDED_WALLET_AMOUNT * 2; return x`
${v.MOBILE_ICON}WalletConnect
${[...Array(r2)].map((a2, t2) => { const l2 = o2[t2 % o2.length]; return l2 ? x`` : v.WALLET_PLACEHOLDER; })}
Select Wallet
Choose WalletConnect to see supported apps on your device`; } }; Ie.styles = [h.globalCss, co], Ie = ho([e$2("wcm-android-wallet-selection")], Ie); const wo = i$3`@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(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`; var po = Object.defineProperty, go = Object.getOwnPropertyDescriptor, K = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? go(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && po(o2, r2, t2), t2; }; let D = class extends s { constructor() { super(...arguments), this.walletId = void 0, this.imageId = void 0, this.isError = false, this.isStale = false, this.label = ""; } svgLoaderTemplate() { var e2, o2; const r2 = (o2 = (e2 = ne$1.state.themeVariables) == null ? void 0 : e2["--wcm-wallet-icon-large-border-radius"]) != null ? o2 : h.getPreset("--wcm-wallet-icon-large-border-radius"); let a2 = 0; r2.includes("%") ? a2 = 88 / 100 * parseInt(r2, 10) : a2 = parseInt(r2, 10), a2 *= 1.17; const t2 = 317 - a2 * 1.57, l2 = 425 - a2 * 1.8; return x``; } render() { const e2 = { "wcm-error": this.isError, "wcm-stale": this.isStale }; return x`
${this.svgLoaderTemplate()}
${this.isError ? "Connection declined" : this.label}`; } }; D.styles = [h.globalCss, wo], K([n$1()], D.prototype, "walletId", 2), K([n$1()], D.prototype, "imageId", 2), K([n$1({ type: Boolean })], D.prototype, "isError", 2), K([n$1({ type: Boolean })], D.prototype, "isStale", 2), K([n$1()], D.prototype, "label", 2), D = K([e$2("wcm-connector-waiting")], D); const G = { manualWallets() { var e2, o2; const { mobileWallets: r2, desktopWallets: a2 } = y$1.state, t2 = (e2 = G.recentWallet()) == null ? void 0 : e2.id, l2 = a$2.isMobile() ? r2 : a2, i2 = l2 == null ? void 0 : l2.filter((s2) => t2 !== s2.id); return (o2 = a$2.isMobile() ? i2 == null ? void 0 : i2.map(({ id: s2, name: $2, links: f2 }) => ({ id: s2, name: $2, mobile: f2, links: f2 })) : i2 == null ? void 0 : i2.map(({ id: s2, name: $2, links: f2 }) => ({ id: s2, name: $2, desktop: f2, links: f2 }))) != null ? o2 : []; }, recentWallet() { return c.getRecentWallet(); }, recomendedWallets(e2 = false) { var o2; const r2 = e2 || (o2 = G.recentWallet()) == null ? void 0 : o2.id, { recomendedWallets: a2 } = te$1.state; return a2.filter((t2) => r2 !== t2.id); } }, Z = { onConnecting(e2) { c.goToConnectingView(e2); }, manualWalletsTemplate() { return G.manualWallets().map((e2) => x``); }, recomendedWalletsTemplate(e2 = false) { return G.recomendedWallets(e2).map((o2) => x``); }, recentWalletTemplate() { const e2 = G.recentWallet(); if (e2) return x``; } }, vo = i$3`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`; var uo = Object.defineProperty, bo = Object.getOwnPropertyDescriptor, fo = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? bo(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && uo(o2, r2, t2), t2; }; let Ee = class extends s { render() { const { explorerExcludedWalletIds: e2, enableExplorer: o2 } = y$1.state, r2 = e2 !== "ALL" && o2, a2 = Z.manualWalletsTemplate(), t2 = Z.recomendedWalletsTemplate(); let l2 = [Z.recentWalletTemplate(), ...a2, ...t2]; l2 = l2.filter(Boolean); const i2 = l2.length > 4 || r2; let s2 = []; i2 ? s2 = l2.slice(0, 3) : s2 = l2; const $2 = Boolean(s2.length); return x`
${v.MOBILE_ICON}Mobile
${v.SCAN_ICON}Scan with your wallet
${$2 ? x`
${v.DESKTOP_ICON}Desktop
${s2} ${i2 ? x`` : null}
` : null}`; } }; Ee.styles = [h.globalCss, vo], Ee = fo([e$2("wcm-desktop-wallet-selection")], Ee); const xo = i$3`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-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 yo = Object.defineProperty, $o = Object.getOwnPropertyDescriptor, Co = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? $o(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && yo(o2, r2, t2), t2; }; let Me = class extends s { render() { const { termsOfServiceUrl: e2, privacyPolicyUrl: o2 } = y$1.state; return e2 ?? o2 ? x`
By connecting your wallet to this app, you agree to the app's ${e2 ? x`Terms of Service` : null} ${e2 && o2 ? "and" : null} ${o2 ? x`Privacy Policy` : null}
` : null; } }; Me.styles = [h.globalCss, xo], Me = Co([e$2("wcm-legal-notice")], Me); const ko = i$3`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`; var Oo = Object.defineProperty, Wo = Object.getOwnPropertyDescriptor, Io = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Wo(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Oo(o2, r2, t2), t2; }; let Le = class extends s { onQrcode() { T$2.push("Qrcode"); } render() { const { explorerExcludedWalletIds: e2, enableExplorer: o2 } = y$1.state, r2 = e2 !== "ALL" && o2, a2 = Z.manualWalletsTemplate(), t2 = Z.recomendedWalletsTemplate(); let l2 = [Z.recentWalletTemplate(), ...a2, ...t2]; l2 = l2.filter(Boolean); const i2 = l2.length > 8 || r2; let s2 = []; i2 ? s2 = l2.slice(0, 7) : s2 = l2; const $2 = Boolean(s2.length); return x`${$2 ? x`
${s2} ${i2 ? x`` : null}
` : null}`; } }; Le.styles = [h.globalCss, ko], Le = Io([e$2("wcm-mobile-wallet-selection")], Le); const Eo = i$3`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-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(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`; var Mo = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, Re = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Lo(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Mo(o2, r2, t2), t2; }; let ae = class extends s { constructor() { super(), this.open = false, this.active = false, this.unsubscribeModal = void 0, this.abortController = void 0, this.unsubscribeModal = se$1.subscribe((e2) => { e2.open ? this.onOpenModalEvent() : this.onCloseModalEvent(); }); } disconnectedCallback() { var e2; (e2 = this.unsubscribeModal) == null || e2.call(this); } get overlayEl() { return c.getShadowRootElement(this, ".wcm-overlay"); } get containerEl() { return c.getShadowRootElement(this, ".wcm-container"); } toggleBodyScroll(e2) { if (document.querySelector("body")) if (e2) { const o2 = document.getElementById("wcm-styles"); o2 == null ? void 0 : o2.remove(); } else document.head.insertAdjacentHTML("beforeend", ''); } onCloseModal(e2) { e2.target === e2.currentTarget && se$1.close(); } onOpenModalEvent() { this.toggleBodyScroll(false), this.addKeyboardEvents(), this.open = true, setTimeout(async () => { const e2 = c.isMobileAnimation() ? { y: ["50vh", "0vh"] } : { scale: [0.98, 1] }, o2 = 0.1, r2 = 0.2; await Promise.all([animate(this.overlayEl, { opacity: [0, 1] }, { delay: o2, duration: r2 }).finished, animate(this.containerEl, e2, { delay: o2, duration: r2 }).finished]), this.active = true; }, 0); } async onCloseModalEvent() { this.toggleBodyScroll(true), this.removeKeyboardEvents(); const e2 = c.isMobileAnimation() ? { y: ["0vh", "50vh"] } : { scale: [1, 0.98] }, o2 = 0.2; await Promise.all([animate(this.overlayEl, { opacity: [1, 0] }, { duration: o2 }).finished, animate(this.containerEl, e2, { duration: o2 }).finished]), this.containerEl.removeAttribute("style"), this.active = false, this.open = false; } addKeyboardEvents() { this.abortController = new AbortController(), window.addEventListener("keydown", (e2) => { var o2; e2.key === "Escape" ? se$1.close() : e2.key === "Tab" && ((o2 = e2.target) != null && o2.tagName.includes("wcm-") || this.containerEl.focus()); }, this.abortController), this.containerEl.focus(); } removeKeyboardEvents() { var e2; (e2 = this.abortController) == null || e2.abort(), this.abortController = void 0; } render() { const e2 = { "wcm-overlay": true, "wcm-active": this.active }; return x`
${this.open ? x`
` : null}
`; } }; ae.styles = [h.globalCss, Eo], Re([t$1()], ae.prototype, "open", 2), Re([t$1()], ae.prototype, "active", 2), ae = Re([e$2("wcm-modal")], ae); const Ro = i$3`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`; var Ao = Object.defineProperty, Po = Object.getOwnPropertyDescriptor, le = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Po(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Ao(o2, r2, t2), t2; }; let B = class extends s { constructor() { super(...arguments), this.isMobile = false, this.isDesktop = false, this.isWeb = false, this.isRetry = false; } onMobile() { a$2.isMobile() ? T$2.replace("MobileConnecting") : T$2.replace("MobileQrcodeConnecting"); } onDesktop() { T$2.replace("DesktopConnecting"); } onWeb() { T$2.replace("WebConnecting"); } render() { return x`
${this.isRetry ? x`` : null} ${this.isMobile ? x`Mobile` : null} ${this.isDesktop ? x`Desktop` : null} ${this.isWeb ? x`Web` : null}
`; } }; B.styles = [h.globalCss, Ro], le([n$1({ type: Boolean })], B.prototype, "isMobile", 2), le([n$1({ type: Boolean })], B.prototype, "isDesktop", 2), le([n$1({ type: Boolean })], B.prototype, "isWeb", 2), le([n$1({ type: Boolean })], B.prototype, "isRetry", 2), B = le([e$2("wcm-platform-selection")], B); const To = i$3`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`; var jo = Object.defineProperty, _o = Object.getOwnPropertyDescriptor, Do = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? _o(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && jo(o2, r2, t2), t2; }; let Ae = class extends s { onClick() { T$2.push("WalletExplorer"); } render() { const { recomendedWallets: e2 } = te$1.state, o2 = G.manualWallets(), r2 = [...e2, ...o2].reverse().slice(0, 4); return x``; } }; Ae.styles = [h.globalCss, To], Ae = Do([e$2("wcm-view-all-wallets-button")], Ae); const No = i$3`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`; var Zo = Object.defineProperty, So = Object.getOwnPropertyDescriptor, de = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? So(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Zo(o2, r2, t2), t2; }; let Y = class extends s { constructor() { super(), this.walletId = "", this.imageId = "", this.uri = "", setTimeout(() => { const { walletConnectUri: e2 } = p$1.state; this.uri = e2; }, 0); } get overlayEl() { return c.getShadowRootElement(this, ".wcm-qr-container"); } render() { return x`
${this.uri ? x`` : x``}
`; } }; Y.styles = [h.globalCss, No], de([n$1()], Y.prototype, "walletId", 2), de([n$1()], Y.prototype, "imageId", 2), de([t$1()], Y.prototype, "uri", 2), Y = de([e$2("wcm-walletconnect-qr")], Y); var Bo = Object.defineProperty, Uo = Object.getOwnPropertyDescriptor, Ho = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Uo(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Bo(o2, r2, t2), t2; }; let Pe = class extends s { viewTemplate() { return a$2.isAndroid() ? x`` : a$2.isMobile() ? x`` : x``; } render() { return x`${this.viewTemplate()}`; } }; Pe.styles = [h.globalCss], Pe = Ho([e$2("wcm-connect-wallet-view")], Pe); const zo = i$3`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`; var Vo = Object.defineProperty, Fo = Object.getOwnPropertyDescriptor, Ke = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Fo(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Vo(o2, r2, t2), t2; }; let me = class extends s { constructor() { super(), this.isError = false, this.openDesktopApp(); } onFormatAndRedirect(e2) { const { desktop: o2, name: r2 } = a$2.getWalletRouterData(), a2 = o2 == null ? void 0 : o2.native; if (a2) { const t2 = a$2.formatNativeUrl(a2, e2, r2); a$2.openHref(t2, "_self"); } } openDesktopApp() { const { walletConnectUri: e2 } = p$1.state, o2 = a$2.getWalletRouterData(); c.setRecentWallet(o2), e2 && this.onFormatAndRedirect(e2); } render() { const { name: e2, id: o2, image_id: r2 } = a$2.getWalletRouterData(), { isMobile: a2, isWeb: t2 } = c.getCachedRouterWalletPlatforms(); return x`${`Connection can continue loading if ${e2} is not installed on your device`}Retry`; } }; me.styles = [h.globalCss, zo], Ke([t$1()], me.prototype, "isError", 2), me = Ke([e$2("wcm-desktop-connecting-view")], me); const qo = i$3`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`; var Qo = Object.defineProperty, Ko = Object.getOwnPropertyDescriptor, Yo = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Ko(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Qo(o2, r2, t2), t2; }; let Te = class extends s { onInstall(e2) { e2 && a$2.openHref(e2, "_blank"); } render() { const { name: e2, id: o2, image_id: r2, homepage: a2 } = a$2.getWalletRouterData(); return x`${`Download ${e2} to continue. If multiple browser extensions are installed, disable non ${e2} ones and try again`}Download`; } }; Te.styles = [h.globalCss, qo], Te = Yo([e$2("wcm-install-wallet-view")], Te); const Go = i$3`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`; var Xo = Object.defineProperty, Jo = Object.getOwnPropertyDescriptor, Ye = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? Jo(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && Xo(o2, r2, t2), t2; }; let he = class extends s { constructor() { super(), this.isError = false, this.openMobileApp(); } onFormatAndRedirect(e2, o2 = false) { const { mobile: r2, name: a2 } = a$2.getWalletRouterData(), t2 = r2 == null ? void 0 : r2.native, l2 = r2 == null ? void 0 : r2.universal; if (t2 && !o2) { const i2 = a$2.formatNativeUrl(t2, e2, a2); a$2.openHref(i2, "_self"); } else if (l2) { const i2 = a$2.formatUniversalUrl(l2, e2, a2); a$2.openHref(i2, "_self"); } } openMobileApp(e2 = false) { const { walletConnectUri: o2 } = p$1.state, r2 = a$2.getWalletRouterData(); c.setRecentWallet(r2), o2 && this.onFormatAndRedirect(o2, e2); } onGoToAppStore(e2) { e2 && a$2.openHref(e2, "_blank"); } render() { const { name: e2, id: o2, image_id: r2, app: a2, mobile: t2 } = a$2.getWalletRouterData(), { isWeb: l$12 } = c.getCachedRouterWalletPlatforms(), i2 = a2 == null ? void 0 : a2.ios, s2 = t2 == null ? void 0 : t2.universal; return x`Retry${s2 ? x`Still doesn't work? Try this alternate link` : null}
${`Get ${e2}`}
App Store
`; } }; he.styles = [h.globalCss, Go], Ye([t$1()], he.prototype, "isError", 2), he = Ye([e$2("wcm-mobile-connecting-view")], he); const er = i$3`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`; var tr = Object.defineProperty, or = Object.getOwnPropertyDescriptor, rr = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? or(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && tr(o2, r2, t2), t2; }; let je = class extends s { render() { const { name: e2, id: o2, image_id: r2 } = a$2.getWalletRouterData(), { isDesktop: a2, isWeb: t2 } = c.getCachedRouterWalletPlatforms(); return x`${`Scan this QR Code with your phone's camera or inside ${e2} app`}`; } }; je.styles = [h.globalCss, er], je = rr([e$2("wcm-mobile-qr-connecting-view")], je); var ar = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, ir = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? lr(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && ar(o2, r2, t2), t2; }; let _e = class extends s { render() { return x``; } }; _e.styles = [h.globalCss], _e = ir([e$2("wcm-qrcode-view")], _e); const nr = i$3`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`; var cr = Object.defineProperty, sr = Object.getOwnPropertyDescriptor, ie = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? sr(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && cr(o2, r2, t2), t2; }; const De = 40; let U = class extends s { constructor() { super(...arguments), this.loading = !te$1.state.wallets.listings.length, this.firstFetch = !te$1.state.wallets.listings.length, this.search = "", this.endReached = false, this.intersectionObserver = void 0, this.searchDebounce = c.debounce((e2) => { e2.length >= 1 ? (this.firstFetch = true, this.endReached = false, this.search = e2, te$1.resetSearch(), this.fetchWallets()) : this.search && (this.search = "", this.endReached = this.isLastPage(), te$1.resetSearch()); }); } firstUpdated() { this.createPaginationObserver(); } disconnectedCallback() { var e2; (e2 = this.intersectionObserver) == null || e2.disconnect(); } get placeholderEl() { return c.getShadowRootElement(this, ".wcm-placeholder-block"); } createPaginationObserver() { this.intersectionObserver = new IntersectionObserver(([e2]) => { e2.isIntersecting && !(this.search && this.firstFetch) && this.fetchWallets(); }), this.intersectionObserver.observe(this.placeholderEl); } isLastPage() { const { wallets: e2, search: o2 } = te$1.state, { listings: r2, total: a2 } = this.search ? o2 : e2; return a2 <= De || r2.length >= a2; } async fetchWallets() { var e2; const { wallets: o2, search: r2 } = te$1.state, { listings: a2, total: t2, page: l2 } = this.search ? r2 : o2; if (!this.endReached && (this.firstFetch || t2 > De && a2.length < t2)) try { this.loading = true; const i2 = (e2 = p$1.state.chains) == null ? void 0 : e2.join(","), { listings: s2 } = await te$1.getWallets({ page: this.firstFetch ? 1 : l2 + 1, entries: De, search: this.search, version: 2, chains: i2 }), $2 = s2.map((f2) => c.getWalletIcon(f2)); await Promise.all([...$2.map(async (f2) => c.preloadImage(f2)), a$2.wait(300)]), this.endReached = this.isLastPage(); } catch (i2) { console.error(i2), oe$1.openToast(c.getErrorMessage(i2), "error"); } finally { this.loading = false, this.firstFetch = false; } } onConnect(e2) { a$2.isAndroid() ? c.handleMobileLinking(e2) : c.goToConnectingView(e2); } onSearchChange(e2) { const { value: o2 } = e2.target; this.searchDebounce(o2); } render() { const { wallets: e2, search: o$12 } = te$1.state, { listings: r2 } = this.search ? o$12 : e2, a2 = this.loading && !r2.length, t2 = this.search.length >= 3; let l2 = Z.manualWalletsTemplate(), i2 = Z.recomendedWalletsTemplate(true); t2 && (l2 = l2.filter(({ values: f2 }) => c.caseSafeIncludes(f2[0], this.search)), i2 = i2.filter(({ values: f2 }) => c.caseSafeIncludes(f2[0], this.search))); const s2 = !this.loading && !r2.length && !i2.length, $2 = { "wcm-loading": a2, "wcm-end-reached": this.endReached || !this.loading, "wcm-empty": s2 }; return x`
${a2 ? null : l2} ${a2 ? null : i2} ${a2 ? null : r2.map((f2) => x`${f2 ? x`` : null}`)}
${s2 ? x`No results found` : null} ${!s2 && this.loading ? x`` : null}
`; } }; U.styles = [h.globalCss, nr], ie([t$1()], U.prototype, "loading", 2), ie([t$1()], U.prototype, "firstFetch", 2), ie([t$1()], U.prototype, "search", 2), ie([t$1()], U.prototype, "endReached", 2), U = ie([e$2("wcm-wallet-explorer-view")], U); const dr = i$3`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`; var mr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, Ge = (e2, o2, r2, a2) => { for (var t2 = a2 > 1 ? void 0 : a2 ? hr(o2, r2) : o2, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o2, r2, t2) : i2(t2)) || t2); return a2 && t2 && mr(o2, r2, t2), t2; }; let we = class extends s { constructor() { super(), this.isError = false, this.openWebWallet(); } onFormatAndRedirect(e2) { const { desktop: o2, name: r2 } = a$2.getWalletRouterData(), a2 = o2 == null ? void 0 : o2.universal; if (a2) { const t2 = a$2.formatUniversalUrl(a2, e2, r2); a$2.openHref(t2, "_blank"); } } openWebWallet() { const { walletConnectUri: e2 } = p$1.state, o2 = a$2.getWalletRouterData(); c.setRecentWallet(o2), e2 && this.onFormatAndRedirect(e2); } render() { const { name: e2, id: o2, image_id: r2 } = a$2.getWalletRouterData(), { isMobile: a2, isDesktop: t2 } = c.getCachedRouterWalletPlatforms(), l$12 = a$2.isMobile(); return x`${`${e2} web app has opened in a new tab. Go there, accept the connection, and come back`}Retry`; } }; we.styles = [h.globalCss, dr], Ge([t$1()], we.prototype, "isError", 2), we = Ge([e$2("wcm-web-connecting-view")], we); const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, get WcmModal() { return ae; }, get WcmQrCode() { return j; } }, Symbol.toStringTag, { value: "Module" })); exports2.getWeb3 = getWeb3; exports2.wallet_bootstrap_e2e = wallet_bootstrap_e2e; exports2.wallet_connect = wallet_connect; exports2.wallet_init = wallet_init; exports2.wallet_init_readonly = wallet_init_readonly; exports2.wallet_network_handler_e2e = wallet_network_handler_e2e; Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" }); });