diff --git a/dist/events/schema.d.ts b/dist/events/schema.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/dist/index.js b/dist/index.js index 6f630e5..93991b1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -145,27 +145,27 @@ function digest(bytes, algo = "SHA-384") { }); } -var __defProp$5 = Object.defineProperty; -var __defProps$4 = Object.defineProperties; -var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors; -var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols; +var __defProp$7 = Object.defineProperty; +var __defProps$6 = Object.defineProperties; +var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols; var __getProtoOf$2 = Object.getPrototypeOf; -var __hasOwnProp$5 = Object.prototype.hasOwnProperty; -var __propIsEnum$5 = Object.prototype.propertyIsEnumerable; +var __hasOwnProp$7 = Object.prototype.hasOwnProperty; +var __propIsEnum$7 = Object.prototype.propertyIsEnumerable; var __reflectGet$2 = Reflect.get; -var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __spreadValues$5 = (a, b) => { +var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$7 = (a, b) => { for (var prop in b || (b = {})) - if (__hasOwnProp$5.call(b, prop)) - __defNormalProp$5(a, prop, b[prop]); - if (__getOwnPropSymbols$5) - for (var prop of __getOwnPropSymbols$5(b)) { - if (__propIsEnum$5.call(b, prop)) - __defNormalProp$5(a, prop, b[prop]); + if (__hasOwnProp$7.call(b, prop)) + __defNormalProp$7(a, prop, b[prop]); + if (__getOwnPropSymbols$7) + for (var prop of __getOwnPropSymbols$7(b)) { + if (__propIsEnum$7.call(b, prop)) + __defNormalProp$7(a, prop, b[prop]); } return a; }; -var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b)); +var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b)); var __superGet$2 = (cls, obj, key) => __reflectGet$2(__getProtoOf$2(cls), key, obj); var __async$d = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { @@ -317,7 +317,7 @@ const fetchGetUrlFunc = (options = {}) => (req, _signal) => __async$d(void 0, nu controller.abort(); }); } - const init = __spreadProps$4(__spreadValues$5({}, options), { + const init = __spreadProps$6(__spreadValues$7({}, options), { method: req.method || "POST", headers: req.headers, body: req.body || void 0, @@ -683,25 +683,25 @@ const GET_GOVERNANCE_APY = ` } `; -var __defProp$4 = Object.defineProperty; -var __defProps$3 = Object.defineProperties; -var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors; -var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols; -var __hasOwnProp$4 = Object.prototype.hasOwnProperty; -var __propIsEnum$4 = Object.prototype.propertyIsEnumerable; -var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __spreadValues$4 = (a, b) => { +var __defProp$6 = Object.defineProperty; +var __defProps$5 = Object.defineProperties; +var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols; +var __hasOwnProp$6 = Object.prototype.hasOwnProperty; +var __propIsEnum$6 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$6 = (a, b) => { for (var prop in b || (b = {})) - if (__hasOwnProp$4.call(b, prop)) - __defNormalProp$4(a, prop, b[prop]); - if (__getOwnPropSymbols$4) - for (var prop of __getOwnPropSymbols$4(b)) { - if (__propIsEnum$4.call(b, prop)) - __defNormalProp$4(a, prop, b[prop]); + if (__hasOwnProp$6.call(b, prop)) + __defNormalProp$6(a, prop, b[prop]); + if (__getOwnPropSymbols$6) + for (var prop of __getOwnPropSymbols$6(b)) { + if (__propIsEnum$6.call(b, prop)) + __defNormalProp$6(a, prop, b[prop]); } return a; }; -var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b)); +var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b)); var __async$c = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { @@ -734,7 +734,7 @@ function queryGraph(_0) { }) { var _a; const graphUrl = `${graphApi}/subgraphs/name/${subgraphName}`; - const { data, errors } = yield fetchData(graphUrl, __spreadProps$3(__spreadValues$4({}, fetchDataOptions2), { + const { data, errors } = yield fetchData(graphUrl, __spreadProps$5(__spreadValues$6({}, fetchDataOptions2), { method: "POST", headers: { "Content-Type": "application/json" @@ -1722,19 +1722,19 @@ class BatchEventsService { } } -var __defProp$3 = Object.defineProperty; -var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols; -var __hasOwnProp$3 = Object.prototype.hasOwnProperty; -var __propIsEnum$3 = Object.prototype.propertyIsEnumerable; -var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __spreadValues$3 = (a, b) => { +var __defProp$5 = Object.defineProperty; +var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols; +var __hasOwnProp$5 = Object.prototype.hasOwnProperty; +var __propIsEnum$5 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$5 = (a, b) => { for (var prop in b || (b = {})) - if (__hasOwnProp$3.call(b, prop)) - __defNormalProp$3(a, prop, b[prop]); - if (__getOwnPropSymbols$3) - for (var prop of __getOwnPropSymbols$3(b)) { - if (__propIsEnum$3.call(b, prop)) - __defNormalProp$3(a, prop, b[prop]); + if (__hasOwnProp$5.call(b, prop)) + __defNormalProp$5(a, prop, b[prop]); + if (__getOwnPropSymbols$5) + for (var prop of __getOwnPropSymbols$5(b)) { + if (__propIsEnum$5.call(b, prop)) + __defNormalProp$5(a, prop, b[prop]); } return a; }; @@ -2318,10 +2318,10 @@ function addNetwork(newConfig) { enabledChains.push( ...Object.keys(newConfig).map((netId) => Number(netId)).filter((netId) => !enabledChains.includes(netId)) ); - exports.customConfig = __spreadValues$3(__spreadValues$3({}, exports.customConfig), newConfig); + exports.customConfig = __spreadValues$5(__spreadValues$5({}, exports.customConfig), newConfig); } function getNetworkConfig() { - const allConfig = __spreadValues$3(__spreadValues$3({}, defaultConfig), exports.customConfig); + const allConfig = __spreadValues$5(__spreadValues$5({}, defaultConfig), exports.customConfig); return enabledChains.reduce((acc, curr) => { acc[curr] = allConfig[curr]; return acc; @@ -2373,12 +2373,244 @@ function getRelayerEnsSubdomains() { }, {}); } -const addressType = { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" }; -const bnType = { type: "string", BN: true }; +const ajv = new Ajv({ allErrors: true }); +ajv.addKeyword({ + keyword: "BN", + // eslint-disable-next-line @typescript-eslint/no-explicit-any + validate: (schema, data) => { + try { + BigInt(data); + return true; + } catch (e) { + return false; + } + }, + errors: true +}); +ajv.addKeyword({ + keyword: "isAddress", + // eslint-disable-next-line @typescript-eslint/no-explicit-any + validate: (schema, data) => { + try { + return ethers.isAddress(data); + } catch (e) { + return false; + } + }, + errors: true +}); + +var __defProp$4 = Object.defineProperty; +var __defProps$4 = Object.defineProperties; +var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols; +var __hasOwnProp$4 = Object.prototype.hasOwnProperty; +var __propIsEnum$4 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$4 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$4.call(b, prop)) + __defNormalProp$4(a, prop, b[prop]); + if (__getOwnPropSymbols$4) + for (var prop of __getOwnPropSymbols$4(b)) { + if (__propIsEnum$4.call(b, prop)) + __defNormalProp$4(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b)); +const addressSchemaType = { + type: "string", + pattern: "^0x[a-fA-F0-9]{40}$", + isAddress: true +}; +const bnSchemaType = { type: "string", BN: true }; +const proofSchemaType = { type: "string", pattern: "^0x[a-fA-F0-9]{512}$" }; +const bytes32SchemaType = { type: "string", pattern: "^0x[a-fA-F0-9]{64}$" }; +const bytes32BNSchemaType = __spreadProps$4(__spreadValues$4({}, bytes32SchemaType), { BN: true }); + +var __defProp$3 = Object.defineProperty; +var __defProps$3 = Object.defineProperties; +var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols; +var __hasOwnProp$3 = Object.prototype.hasOwnProperty; +var __propIsEnum$3 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$3 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$3.call(b, prop)) + __defNormalProp$3(a, prop, b[prop]); + if (__getOwnPropSymbols$3) + for (var prop of __getOwnPropSymbols$3(b)) { + if (__propIsEnum$3.call(b, prop)) + __defNormalProp$3(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b)); +const baseEventsSchemaProperty = { + blockNumber: { + type: "number" + }, + logIndex: { + type: "number" + }, + transactionHash: bytes32SchemaType +}; +const baseEventsSchemaRequired = Object.keys(baseEventsSchemaProperty); +const governanceEventsSchema = { + type: "array", + items: { + anyOf: [ + { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + event: { type: "string" }, + id: { type: "number" }, + proposer: addressSchemaType, + target: addressSchemaType, + startTime: { type: "number" }, + endTime: { type: "number" }, + description: { type: "string" } + }), + required: [ + ...baseEventsSchemaRequired, + "event", + "id", + "proposer", + "target", + "startTime", + "endTime", + "description" + ], + additionalProperties: false + }, + { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + event: { type: "string" }, + proposalId: { type: "number" }, + voter: addressSchemaType, + support: { type: "boolean" }, + votes: { type: "string" }, + from: addressSchemaType, + input: { type: "string" } + }), + required: [...baseEventsSchemaRequired, "event", "proposalId", "voter", "support", "votes", "from", "input"], + additionalProperties: false + }, + { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + event: { type: "string" }, + account: addressSchemaType, + delegateTo: addressSchemaType + }), + required: [...baseEventsSchemaRequired, "account", "delegateTo"], + additionalProperties: false + }, + { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + event: { type: "string" }, + account: addressSchemaType, + delegateFrom: addressSchemaType + }), + required: [...baseEventsSchemaRequired, "account", "delegateFrom"], + additionalProperties: false + } + ] + } +}; +const registeredEventsSchema = { + type: "array", + items: { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + ensName: { type: "string" }, + relayerAddress: addressSchemaType + }), + required: [...baseEventsSchemaRequired, "ensName", "relayerAddress"], + additionalProperties: false + } +}; +const depositsEventsSchema = { + type: "array", + items: { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + commitment: bytes32SchemaType, + leafIndex: { type: "number" }, + timestamp: { type: "number" }, + from: addressSchemaType + }), + required: [...baseEventsSchemaRequired, "commitment", "leafIndex", "timestamp", "from"], + additionalProperties: false + } +}; +const withdrawalsEventsSchema = { + type: "array", + items: { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + nullifierHash: bytes32SchemaType, + to: addressSchemaType, + fee: bnSchemaType, + timestamp: { type: "number" } + }), + required: [...baseEventsSchemaRequired, "nullifierHash", "to", "fee", "timestamp"], + additionalProperties: false + } +}; +const echoEventsSchema = { + type: "array", + items: { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + address: addressSchemaType, + encryptedAccount: { type: "string" } + }), + required: [...baseEventsSchemaRequired, "address", "encryptedAccount"], + additionalProperties: false + } +}; +const encryptedNotesSchema = { + type: "array", + items: { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + encryptedNote: { type: "string" } + }), + required: [...baseEventsSchemaRequired, "encryptedNote"], + additionalProperties: false + } +}; +function getEventsSchemaValidator(type) { + if (type === DEPOSIT) { + return ajv.compile(depositsEventsSchema); + } + if (type === WITHDRAWAL) { + return ajv.compile(withdrawalsEventsSchema); + } + if (type === "governance") { + return ajv.compile(governanceEventsSchema); + } + if (type === "registered") { + return ajv.compile(registeredEventsSchema); + } + if (type === "echo") { + return ajv.compile(echoEventsSchema); + } + if (type === "encrypted_notes") { + return ajv.compile(encryptedNotesSchema); + } + throw new Error("Unsupported event type for schema validation"); +} + const statusSchema = { type: "object", properties: { - rewardAccount: addressType, + rewardAccount: addressSchemaType, gasPrices: { type: "object", properties: { @@ -2390,7 +2622,7 @@ const statusSchema = { netId: { type: "integer" }, tornadoServiceFee: { type: "number", maximum: 20, minimum: 0 }, latestBlock: { type: "number" }, - latestBalance: { type: "string", BN: true }, + latestBalance: bnSchemaType, version: { type: "string" }, health: { type: "object", @@ -2427,7 +2659,7 @@ function getStatusSchema(netId, config, tovarish) { instanceAddress: { type: "object", properties: amounts.reduce((acc2, cur) => { - acc2[cur] = addressType; + acc2[cur] = addressSchemaType; return acc2; }, {}), required: amounts.filter((amount) => !optionalInstances.includes(amount)) @@ -2440,7 +2672,7 @@ function getStatusSchema(netId, config, tovarish) { ) }; if (tokenAddress) { - instanceProperties.properties.tokenAddress = addressType; + instanceProperties.properties.tokenAddress = addressSchemaType; } if (symbol) { instanceProperties.properties.symbol = { enum: [symbol] }; @@ -2471,7 +2703,7 @@ function getStatusSchema(netId, config, tovarish) { const ethPrices = { type: "object", properties: _tokens.reduce((acc, token) => { - acc[token] = bnType; + acc[token] = bnSchemaType; return acc; }, {}), required: _tokens @@ -2505,21 +2737,6 @@ const jobsSchema = { required: ["id", "status"] }; -const ajv = new Ajv({ allErrors: true }); -ajv.addKeyword({ - keyword: "BN", - // eslint-disable-next-line @typescript-eslint/no-explicit-any - validate: (schema, data) => { - try { - BigInt(data); - return true; - } catch (e) { - return false; - } - }, - errors: true -}); - var __defProp$2 = Object.defineProperty; var __defProps$2 = Object.defineProperties; var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors; @@ -6848,6 +7065,7 @@ class TovarishClient extends RelayerClient { }) { var _a; const url = `${(_a = this.selectedRelayer) == null ? void 0 : _a.url}events`; + const schemaValidator = getEventsSchemaValidator(type); try { const events = []; let lastSyncBlock = fromBlock; @@ -6865,6 +7083,10 @@ class TovarishClient extends RelayerClient { recent }) })); + if (!schemaValidator(fetchedEvents)) { + const errMsg = `Schema validation failed for ${type} events`; + throw new Error(errMsg); + } lastSyncBlock = currentBlock; if (!Array.isArray(fetchedEvents) || !fetchedEvents.length) { break; @@ -7009,12 +7231,16 @@ exports.TovarishClient = TovarishClient; exports.WITHDRAWAL = WITHDRAWAL; exports._META = _META; exports.addNetwork = addNetwork; +exports.addressSchemaType = addressSchemaType; exports.ajv = ajv; exports.base64ToBytes = base64ToBytes; exports.bigIntReplacer = bigIntReplacer; +exports.bnSchemaType = bnSchemaType; exports.bnToBytes = bnToBytes; exports.buffPedersenHash = buffPedersenHash; exports.bufferToBytes = bufferToBytes; +exports.bytes32BNSchemaType = bytes32BNSchemaType; +exports.bytes32SchemaType = bytes32SchemaType; exports.bytesToBN = bytesToBN; exports.bytesToBase64 = bytesToBase64; exports.bytesToHex = bytesToHex; @@ -7027,8 +7253,11 @@ exports.createDeposit = createDeposit; exports.crypto = crypto; exports.defaultConfig = defaultConfig; exports.defaultUserAgent = defaultUserAgent; +exports.depositsEventsSchema = depositsEventsSchema; exports.digest = digest; +exports.echoEventsSchema = echoEventsSchema; exports.enabledChains = enabledChains; +exports.encryptedNotesSchema = encryptedNotesSchema; exports.factories = index; exports.fetch = fetch; exports.fetchData = fetchData; @@ -7044,6 +7273,7 @@ exports.getAllWithdrawals = getAllWithdrawals; exports.getConfig = getConfig; exports.getDeposits = getDeposits; exports.getEncryptedNotes = getEncryptedNotes; +exports.getEventsSchemaValidator = getEventsSchemaValidator; exports.getGovernanceEvents = getGovernanceEvents; exports.getGraphEchoEvents = getGraphEchoEvents; exports.getHttpAgent = getHttpAgent; @@ -7062,6 +7292,7 @@ exports.getTokenBalances = getTokenBalances; exports.getTovarishNetworks = getTovarishNetworks; exports.getWeightRandom = getWeightRandom; exports.getWithdrawals = getWithdrawals; +exports.governanceEventsSchema = governanceEventsSchema; exports.hexToBytes = hexToBytes; exports.initGroth16 = initGroth16; exports.isNode = isNode; @@ -7074,11 +7305,14 @@ exports.packEncryptedMessage = packEncryptedMessage; exports.pedersen = pedersen; exports.pickWeightedRandomRelayer = pickWeightedRandomRelayer; exports.populateTransaction = populateTransaction; +exports.proofSchemaType = proofSchemaType; exports.queryGraph = queryGraph; exports.rBigInt = rBigInt; +exports.registeredEventsSchema = registeredEventsSchema; exports.sleep = sleep; exports.substring = substring; exports.toFixedHex = toFixedHex; exports.toFixedLength = toFixedLength; exports.unpackEncryptedMessage = unpackEncryptedMessage; exports.validateUrl = validateUrl; +exports.withdrawalsEventsSchema = withdrawalsEventsSchema; diff --git a/dist/index.mjs b/dist/index.mjs index d88ff20..72347d8 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -1,4 +1,4 @@ -import { FetchRequest, Network, EnsPlugin, GasCostPlugin, JsonRpcProvider, Wallet, HDNodeWallet, VoidSigner, JsonRpcSigner, BrowserProvider, getAddress, parseEther, namehash, formatEther, Interface, Contract, computeAddress, parseUnits, Transaction, ZeroAddress } from 'ethers'; +import { FetchRequest, Network, EnsPlugin, GasCostPlugin, JsonRpcProvider, Wallet, HDNodeWallet, VoidSigner, JsonRpcSigner, BrowserProvider, getAddress, isAddress, parseEther, namehash, formatEther, Interface, Contract, computeAddress, parseUnits, Transaction, ZeroAddress } from 'ethers'; import crossFetch from 'cross-fetch'; import { webcrypto } from 'crypto'; import BN from 'bn.js'; @@ -124,27 +124,27 @@ function digest(bytes, algo = "SHA-384") { }); } -var __defProp$5 = Object.defineProperty; -var __defProps$4 = Object.defineProperties; -var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors; -var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols; +var __defProp$7 = Object.defineProperty; +var __defProps$6 = Object.defineProperties; +var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols; var __getProtoOf$2 = Object.getPrototypeOf; -var __hasOwnProp$5 = Object.prototype.hasOwnProperty; -var __propIsEnum$5 = Object.prototype.propertyIsEnumerable; +var __hasOwnProp$7 = Object.prototype.hasOwnProperty; +var __propIsEnum$7 = Object.prototype.propertyIsEnumerable; var __reflectGet$2 = Reflect.get; -var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __spreadValues$5 = (a, b) => { +var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$7 = (a, b) => { for (var prop in b || (b = {})) - if (__hasOwnProp$5.call(b, prop)) - __defNormalProp$5(a, prop, b[prop]); - if (__getOwnPropSymbols$5) - for (var prop of __getOwnPropSymbols$5(b)) { - if (__propIsEnum$5.call(b, prop)) - __defNormalProp$5(a, prop, b[prop]); + if (__hasOwnProp$7.call(b, prop)) + __defNormalProp$7(a, prop, b[prop]); + if (__getOwnPropSymbols$7) + for (var prop of __getOwnPropSymbols$7(b)) { + if (__propIsEnum$7.call(b, prop)) + __defNormalProp$7(a, prop, b[prop]); } return a; }; -var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b)); +var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b)); var __superGet$2 = (cls, obj, key) => __reflectGet$2(__getProtoOf$2(cls), key, obj); var __async$d = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { @@ -296,7 +296,7 @@ const fetchGetUrlFunc = (options = {}) => (req, _signal) => __async$d(void 0, nu controller.abort(); }); } - const init = __spreadProps$4(__spreadValues$5({}, options), { + const init = __spreadProps$6(__spreadValues$7({}, options), { method: req.method || "POST", headers: req.headers, body: req.body || void 0, @@ -662,25 +662,25 @@ const GET_GOVERNANCE_APY = ` } `; -var __defProp$4 = Object.defineProperty; -var __defProps$3 = Object.defineProperties; -var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors; -var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols; -var __hasOwnProp$4 = Object.prototype.hasOwnProperty; -var __propIsEnum$4 = Object.prototype.propertyIsEnumerable; -var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __spreadValues$4 = (a, b) => { +var __defProp$6 = Object.defineProperty; +var __defProps$5 = Object.defineProperties; +var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols; +var __hasOwnProp$6 = Object.prototype.hasOwnProperty; +var __propIsEnum$6 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$6 = (a, b) => { for (var prop in b || (b = {})) - if (__hasOwnProp$4.call(b, prop)) - __defNormalProp$4(a, prop, b[prop]); - if (__getOwnPropSymbols$4) - for (var prop of __getOwnPropSymbols$4(b)) { - if (__propIsEnum$4.call(b, prop)) - __defNormalProp$4(a, prop, b[prop]); + if (__hasOwnProp$6.call(b, prop)) + __defNormalProp$6(a, prop, b[prop]); + if (__getOwnPropSymbols$6) + for (var prop of __getOwnPropSymbols$6(b)) { + if (__propIsEnum$6.call(b, prop)) + __defNormalProp$6(a, prop, b[prop]); } return a; }; -var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b)); +var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b)); var __async$c = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { @@ -713,7 +713,7 @@ function queryGraph(_0) { }) { var _a; const graphUrl = `${graphApi}/subgraphs/name/${subgraphName}`; - const { data, errors } = yield fetchData(graphUrl, __spreadProps$3(__spreadValues$4({}, fetchDataOptions2), { + const { data, errors } = yield fetchData(graphUrl, __spreadProps$5(__spreadValues$6({}, fetchDataOptions2), { method: "POST", headers: { "Content-Type": "application/json" @@ -1701,19 +1701,19 @@ class BatchEventsService { } } -var __defProp$3 = Object.defineProperty; -var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols; -var __hasOwnProp$3 = Object.prototype.hasOwnProperty; -var __propIsEnum$3 = Object.prototype.propertyIsEnumerable; -var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __spreadValues$3 = (a, b) => { +var __defProp$5 = Object.defineProperty; +var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols; +var __hasOwnProp$5 = Object.prototype.hasOwnProperty; +var __propIsEnum$5 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$5 = (a, b) => { for (var prop in b || (b = {})) - if (__hasOwnProp$3.call(b, prop)) - __defNormalProp$3(a, prop, b[prop]); - if (__getOwnPropSymbols$3) - for (var prop of __getOwnPropSymbols$3(b)) { - if (__propIsEnum$3.call(b, prop)) - __defNormalProp$3(a, prop, b[prop]); + if (__hasOwnProp$5.call(b, prop)) + __defNormalProp$5(a, prop, b[prop]); + if (__getOwnPropSymbols$5) + for (var prop of __getOwnPropSymbols$5(b)) { + if (__propIsEnum$5.call(b, prop)) + __defNormalProp$5(a, prop, b[prop]); } return a; }; @@ -2297,10 +2297,10 @@ function addNetwork(newConfig) { enabledChains.push( ...Object.keys(newConfig).map((netId) => Number(netId)).filter((netId) => !enabledChains.includes(netId)) ); - customConfig = __spreadValues$3(__spreadValues$3({}, customConfig), newConfig); + customConfig = __spreadValues$5(__spreadValues$5({}, customConfig), newConfig); } function getNetworkConfig() { - const allConfig = __spreadValues$3(__spreadValues$3({}, defaultConfig), customConfig); + const allConfig = __spreadValues$5(__spreadValues$5({}, defaultConfig), customConfig); return enabledChains.reduce((acc, curr) => { acc[curr] = allConfig[curr]; return acc; @@ -2352,12 +2352,244 @@ function getRelayerEnsSubdomains() { }, {}); } -const addressType = { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" }; -const bnType = { type: "string", BN: true }; +const ajv = new Ajv({ allErrors: true }); +ajv.addKeyword({ + keyword: "BN", + // eslint-disable-next-line @typescript-eslint/no-explicit-any + validate: (schema, data) => { + try { + BigInt(data); + return true; + } catch (e) { + return false; + } + }, + errors: true +}); +ajv.addKeyword({ + keyword: "isAddress", + // eslint-disable-next-line @typescript-eslint/no-explicit-any + validate: (schema, data) => { + try { + return isAddress(data); + } catch (e) { + return false; + } + }, + errors: true +}); + +var __defProp$4 = Object.defineProperty; +var __defProps$4 = Object.defineProperties; +var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols; +var __hasOwnProp$4 = Object.prototype.hasOwnProperty; +var __propIsEnum$4 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$4 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$4.call(b, prop)) + __defNormalProp$4(a, prop, b[prop]); + if (__getOwnPropSymbols$4) + for (var prop of __getOwnPropSymbols$4(b)) { + if (__propIsEnum$4.call(b, prop)) + __defNormalProp$4(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b)); +const addressSchemaType = { + type: "string", + pattern: "^0x[a-fA-F0-9]{40}$", + isAddress: true +}; +const bnSchemaType = { type: "string", BN: true }; +const proofSchemaType = { type: "string", pattern: "^0x[a-fA-F0-9]{512}$" }; +const bytes32SchemaType = { type: "string", pattern: "^0x[a-fA-F0-9]{64}$" }; +const bytes32BNSchemaType = __spreadProps$4(__spreadValues$4({}, bytes32SchemaType), { BN: true }); + +var __defProp$3 = Object.defineProperty; +var __defProps$3 = Object.defineProperties; +var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols; +var __hasOwnProp$3 = Object.prototype.hasOwnProperty; +var __propIsEnum$3 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues$3 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$3.call(b, prop)) + __defNormalProp$3(a, prop, b[prop]); + if (__getOwnPropSymbols$3) + for (var prop of __getOwnPropSymbols$3(b)) { + if (__propIsEnum$3.call(b, prop)) + __defNormalProp$3(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b)); +const baseEventsSchemaProperty = { + blockNumber: { + type: "number" + }, + logIndex: { + type: "number" + }, + transactionHash: bytes32SchemaType +}; +const baseEventsSchemaRequired = Object.keys(baseEventsSchemaProperty); +const governanceEventsSchema = { + type: "array", + items: { + anyOf: [ + { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + event: { type: "string" }, + id: { type: "number" }, + proposer: addressSchemaType, + target: addressSchemaType, + startTime: { type: "number" }, + endTime: { type: "number" }, + description: { type: "string" } + }), + required: [ + ...baseEventsSchemaRequired, + "event", + "id", + "proposer", + "target", + "startTime", + "endTime", + "description" + ], + additionalProperties: false + }, + { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + event: { type: "string" }, + proposalId: { type: "number" }, + voter: addressSchemaType, + support: { type: "boolean" }, + votes: { type: "string" }, + from: addressSchemaType, + input: { type: "string" } + }), + required: [...baseEventsSchemaRequired, "event", "proposalId", "voter", "support", "votes", "from", "input"], + additionalProperties: false + }, + { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + event: { type: "string" }, + account: addressSchemaType, + delegateTo: addressSchemaType + }), + required: [...baseEventsSchemaRequired, "account", "delegateTo"], + additionalProperties: false + }, + { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + event: { type: "string" }, + account: addressSchemaType, + delegateFrom: addressSchemaType + }), + required: [...baseEventsSchemaRequired, "account", "delegateFrom"], + additionalProperties: false + } + ] + } +}; +const registeredEventsSchema = { + type: "array", + items: { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + ensName: { type: "string" }, + relayerAddress: addressSchemaType + }), + required: [...baseEventsSchemaRequired, "ensName", "relayerAddress"], + additionalProperties: false + } +}; +const depositsEventsSchema = { + type: "array", + items: { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + commitment: bytes32SchemaType, + leafIndex: { type: "number" }, + timestamp: { type: "number" }, + from: addressSchemaType + }), + required: [...baseEventsSchemaRequired, "commitment", "leafIndex", "timestamp", "from"], + additionalProperties: false + } +}; +const withdrawalsEventsSchema = { + type: "array", + items: { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + nullifierHash: bytes32SchemaType, + to: addressSchemaType, + fee: bnSchemaType, + timestamp: { type: "number" } + }), + required: [...baseEventsSchemaRequired, "nullifierHash", "to", "fee", "timestamp"], + additionalProperties: false + } +}; +const echoEventsSchema = { + type: "array", + items: { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + address: addressSchemaType, + encryptedAccount: { type: "string" } + }), + required: [...baseEventsSchemaRequired, "address", "encryptedAccount"], + additionalProperties: false + } +}; +const encryptedNotesSchema = { + type: "array", + items: { + type: "object", + properties: __spreadProps$3(__spreadValues$3({}, baseEventsSchemaProperty), { + encryptedNote: { type: "string" } + }), + required: [...baseEventsSchemaRequired, "encryptedNote"], + additionalProperties: false + } +}; +function getEventsSchemaValidator(type) { + if (type === DEPOSIT) { + return ajv.compile(depositsEventsSchema); + } + if (type === WITHDRAWAL) { + return ajv.compile(withdrawalsEventsSchema); + } + if (type === "governance") { + return ajv.compile(governanceEventsSchema); + } + if (type === "registered") { + return ajv.compile(registeredEventsSchema); + } + if (type === "echo") { + return ajv.compile(echoEventsSchema); + } + if (type === "encrypted_notes") { + return ajv.compile(encryptedNotesSchema); + } + throw new Error("Unsupported event type for schema validation"); +} + const statusSchema = { type: "object", properties: { - rewardAccount: addressType, + rewardAccount: addressSchemaType, gasPrices: { type: "object", properties: { @@ -2369,7 +2601,7 @@ const statusSchema = { netId: { type: "integer" }, tornadoServiceFee: { type: "number", maximum: 20, minimum: 0 }, latestBlock: { type: "number" }, - latestBalance: { type: "string", BN: true }, + latestBalance: bnSchemaType, version: { type: "string" }, health: { type: "object", @@ -2406,7 +2638,7 @@ function getStatusSchema(netId, config, tovarish) { instanceAddress: { type: "object", properties: amounts.reduce((acc2, cur) => { - acc2[cur] = addressType; + acc2[cur] = addressSchemaType; return acc2; }, {}), required: amounts.filter((amount) => !optionalInstances.includes(amount)) @@ -2419,7 +2651,7 @@ function getStatusSchema(netId, config, tovarish) { ) }; if (tokenAddress) { - instanceProperties.properties.tokenAddress = addressType; + instanceProperties.properties.tokenAddress = addressSchemaType; } if (symbol) { instanceProperties.properties.symbol = { enum: [symbol] }; @@ -2450,7 +2682,7 @@ function getStatusSchema(netId, config, tovarish) { const ethPrices = { type: "object", properties: _tokens.reduce((acc, token) => { - acc[token] = bnType; + acc[token] = bnSchemaType; return acc; }, {}), required: _tokens @@ -2484,21 +2716,6 @@ const jobsSchema = { required: ["id", "status"] }; -const ajv = new Ajv({ allErrors: true }); -ajv.addKeyword({ - keyword: "BN", - // eslint-disable-next-line @typescript-eslint/no-explicit-any - validate: (schema, data) => { - try { - BigInt(data); - return true; - } catch (e) { - return false; - } - }, - errors: true -}); - var __defProp$2 = Object.defineProperty; var __defProps$2 = Object.defineProperties; var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors; @@ -6827,6 +7044,7 @@ class TovarishClient extends RelayerClient { }) { var _a; const url = `${(_a = this.selectedRelayer) == null ? void 0 : _a.url}events`; + const schemaValidator = getEventsSchemaValidator(type); try { const events = []; let lastSyncBlock = fromBlock; @@ -6844,6 +7062,10 @@ class TovarishClient extends RelayerClient { recent }) })); + if (!schemaValidator(fetchedEvents)) { + const errMsg = `Schema validation failed for ${type} events`; + throw new Error(errMsg); + } lastSyncBlock = currentBlock; if (!Array.isArray(fetchedEvents) || !fetchedEvents.length) { break; @@ -6941,4 +7163,4 @@ function calculateSnarkProof(input, circuit, provingKey) { }); } -export { BaseEchoService, BaseEncryptedNotesService, BaseEventsService, BaseGovernanceService, BaseRegistryService, BaseTornadoService, BatchBlockService, BatchEventsService, BatchTransactionService, DEPOSIT, Deposit, ENS__factory, ERC20__factory, GET_DEPOSITS, GET_ECHO_EVENTS, GET_ENCRYPTED_NOTES, GET_GOVERNANCE_APY, GET_GOVERNANCE_EVENTS, GET_NOTE_ACCOUNTS, GET_REGISTERED, GET_STATISTIC, GET_WITHDRAWALS, Invoice, MAX_FEE, MAX_TOVARISH_EVENTS, MIN_FEE, MIN_STAKE_BALANCE, MerkleTreeService, Mimc, Multicall__factory, NetId, NoteAccount, OffchainOracle__factory, OvmGasPriceOracle__factory, Pedersen, RelayerClient, ReverseRecords__factory, TokenPriceOracle, TornadoBrowserProvider, TornadoFeeOracle, TornadoRpcSigner, TornadoVoidSigner, TornadoWallet, TovarishClient, WITHDRAWAL, _META, addNetwork, ajv, base64ToBytes, bigIntReplacer, bnToBytes, buffPedersenHash, bufferToBytes, bytesToBN, bytesToBase64, bytesToHex, calculateScore, calculateSnarkProof, chunk, concatBytes, convertETHToTokenAmount, createDeposit, crypto, customConfig, defaultConfig, defaultUserAgent, digest, enabledChains, index as factories, fetch, fetchData, fetchGetUrlFunc, getActiveTokenInstances, getActiveTokens, getAllDeposits, getAllEncryptedNotes, getAllGovernanceEvents, getAllGraphEchoEvents, getAllRegisters, getAllWithdrawals, getConfig, getDeposits, getEncryptedNotes, getGovernanceEvents, getGraphEchoEvents, getHttpAgent, getInstanceByAddress, getMeta, getNetworkConfig, getNoteAccounts, getProvider, getProviderWithNetId, getRegisters, getRelayerEnsSubdomains, getStatistic, getStatusSchema, getSupportedInstances, getTokenBalances, getTovarishNetworks, getWeightRandom, getWithdrawals, hexToBytes, initGroth16, isNode, jobsSchema, leBuff2Int, leInt2Buff, mimc, multicall, packEncryptedMessage, pedersen, pickWeightedRandomRelayer, populateTransaction, queryGraph, rBigInt, sleep, substring, toFixedHex, toFixedLength, unpackEncryptedMessage, validateUrl }; +export { BaseEchoService, BaseEncryptedNotesService, BaseEventsService, BaseGovernanceService, BaseRegistryService, BaseTornadoService, BatchBlockService, BatchEventsService, BatchTransactionService, DEPOSIT, Deposit, ENS__factory, ERC20__factory, GET_DEPOSITS, GET_ECHO_EVENTS, GET_ENCRYPTED_NOTES, GET_GOVERNANCE_APY, GET_GOVERNANCE_EVENTS, GET_NOTE_ACCOUNTS, GET_REGISTERED, GET_STATISTIC, GET_WITHDRAWALS, Invoice, MAX_FEE, MAX_TOVARISH_EVENTS, MIN_FEE, MIN_STAKE_BALANCE, MerkleTreeService, Mimc, Multicall__factory, NetId, NoteAccount, OffchainOracle__factory, OvmGasPriceOracle__factory, Pedersen, RelayerClient, ReverseRecords__factory, TokenPriceOracle, TornadoBrowserProvider, TornadoFeeOracle, TornadoRpcSigner, TornadoVoidSigner, TornadoWallet, TovarishClient, WITHDRAWAL, _META, addNetwork, addressSchemaType, ajv, base64ToBytes, bigIntReplacer, bnSchemaType, bnToBytes, buffPedersenHash, bufferToBytes, bytes32BNSchemaType, bytes32SchemaType, bytesToBN, bytesToBase64, bytesToHex, calculateScore, calculateSnarkProof, chunk, concatBytes, convertETHToTokenAmount, createDeposit, crypto, customConfig, defaultConfig, defaultUserAgent, depositsEventsSchema, digest, echoEventsSchema, enabledChains, encryptedNotesSchema, index as factories, fetch, fetchData, fetchGetUrlFunc, getActiveTokenInstances, getActiveTokens, getAllDeposits, getAllEncryptedNotes, getAllGovernanceEvents, getAllGraphEchoEvents, getAllRegisters, getAllWithdrawals, getConfig, getDeposits, getEncryptedNotes, getEventsSchemaValidator, getGovernanceEvents, getGraphEchoEvents, getHttpAgent, getInstanceByAddress, getMeta, getNetworkConfig, getNoteAccounts, getProvider, getProviderWithNetId, getRegisters, getRelayerEnsSubdomains, getStatistic, getStatusSchema, getSupportedInstances, getTokenBalances, getTovarishNetworks, getWeightRandom, getWithdrawals, governanceEventsSchema, hexToBytes, initGroth16, isNode, jobsSchema, leBuff2Int, leInt2Buff, mimc, multicall, packEncryptedMessage, pedersen, pickWeightedRandomRelayer, populateTransaction, proofSchemaType, queryGraph, rBigInt, registeredEventsSchema, sleep, substring, toFixedHex, toFixedLength, unpackEncryptedMessage, validateUrl, withdrawalsEventsSchema }; diff --git a/dist/schemas/ajv.d.ts b/dist/schemas/ajv.d.ts new file mode 100644 index 0000000..fb7b27d --- /dev/null +++ b/dist/schemas/ajv.d.ts @@ -0,0 +1,2 @@ +import Ajv from 'ajv'; +export declare const ajv: Ajv; diff --git a/dist/schemas/events.d.ts b/dist/schemas/events.d.ts new file mode 100644 index 0000000..caad40e --- /dev/null +++ b/dist/schemas/events.d.ts @@ -0,0 +1,297 @@ +export declare const governanceEventsSchema: { + readonly type: "array"; + readonly items: { + readonly anyOf: readonly [{ + readonly type: "object"; + readonly properties: { + readonly event: { + readonly type: "string"; + }; + readonly id: { + readonly type: "number"; + }; + readonly proposer: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; + }; + readonly target: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; + }; + readonly startTime: { + readonly type: "number"; + }; + readonly endTime: { + readonly type: "number"; + }; + readonly description: { + readonly type: "string"; + }; + readonly blockNumber: { + readonly type: "number"; + }; + readonly logIndex: { + readonly type: "number"; + }; + readonly transactionHash: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; + }; + }; + readonly required: readonly [...string[], "event", "id", "proposer", "target", "startTime", "endTime", "description"]; + readonly additionalProperties: false; + }, { + readonly type: "object"; + readonly properties: { + readonly event: { + readonly type: "string"; + }; + readonly proposalId: { + readonly type: "number"; + }; + readonly voter: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; + }; + readonly support: { + readonly type: "boolean"; + }; + readonly votes: { + readonly type: "string"; + }; + readonly from: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; + }; + readonly input: { + readonly type: "string"; + }; + readonly blockNumber: { + readonly type: "number"; + }; + readonly logIndex: { + readonly type: "number"; + }; + readonly transactionHash: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; + }; + }; + readonly required: readonly [...string[], "event", "proposalId", "voter", "support", "votes", "from", "input"]; + readonly additionalProperties: false; + }, { + readonly type: "object"; + readonly properties: { + readonly event: { + readonly type: "string"; + }; + readonly account: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; + }; + readonly delegateTo: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; + }; + readonly blockNumber: { + readonly type: "number"; + }; + readonly logIndex: { + readonly type: "number"; + }; + readonly transactionHash: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; + }; + }; + readonly required: readonly [...string[], "account", "delegateTo"]; + readonly additionalProperties: false; + }, { + readonly type: "object"; + readonly properties: { + readonly event: { + readonly type: "string"; + }; + readonly account: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; + }; + readonly delegateFrom: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; + }; + readonly blockNumber: { + readonly type: "number"; + }; + readonly logIndex: { + readonly type: "number"; + }; + readonly transactionHash: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; + }; + }; + readonly required: readonly [...string[], "account", "delegateFrom"]; + readonly additionalProperties: false; + }]; + }; +}; +export declare const registeredEventsSchema: { + readonly type: "array"; + readonly items: { + readonly type: "object"; + readonly properties: { + readonly ensName: { + readonly type: "string"; + }; + readonly relayerAddress: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; + }; + readonly blockNumber: { + readonly type: "number"; + }; + readonly logIndex: { + readonly type: "number"; + }; + readonly transactionHash: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; + }; + }; + readonly required: readonly [...string[], "ensName", "relayerAddress"]; + readonly additionalProperties: false; + }; +}; +export declare const depositsEventsSchema: { + readonly type: "array"; + readonly items: { + readonly type: "object"; + readonly properties: { + readonly commitment: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; + }; + readonly leafIndex: { + readonly type: "number"; + }; + readonly timestamp: { + readonly type: "number"; + }; + readonly from: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; + }; + readonly blockNumber: { + readonly type: "number"; + }; + readonly logIndex: { + readonly type: "number"; + }; + readonly transactionHash: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; + }; + }; + readonly required: readonly [...string[], "commitment", "leafIndex", "timestamp", "from"]; + readonly additionalProperties: false; + }; +}; +export declare const withdrawalsEventsSchema: { + readonly type: "array"; + readonly items: { + readonly type: "object"; + readonly properties: { + readonly nullifierHash: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; + }; + readonly to: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; + }; + readonly fee: { + readonly type: "string"; + readonly BN: true; + }; + readonly timestamp: { + readonly type: "number"; + }; + readonly blockNumber: { + readonly type: "number"; + }; + readonly logIndex: { + readonly type: "number"; + }; + readonly transactionHash: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; + }; + }; + readonly required: readonly [...string[], "nullifierHash", "to", "fee", "timestamp"]; + readonly additionalProperties: false; + }; +}; +export declare const echoEventsSchema: { + readonly type: "array"; + readonly items: { + readonly type: "object"; + readonly properties: { + readonly address: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; + }; + readonly encryptedAccount: { + readonly type: "string"; + }; + readonly blockNumber: { + readonly type: "number"; + }; + readonly logIndex: { + readonly type: "number"; + }; + readonly transactionHash: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; + }; + }; + readonly required: readonly [...string[], "address", "encryptedAccount"]; + readonly additionalProperties: false; + }; +}; +export declare const encryptedNotesSchema: { + readonly type: "array"; + readonly items: { + readonly type: "object"; + readonly properties: { + readonly encryptedNote: { + readonly type: "string"; + }; + readonly blockNumber: { + readonly type: "number"; + }; + readonly logIndex: { + readonly type: "number"; + }; + readonly transactionHash: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; + }; + }; + readonly required: readonly [...string[], "encryptedNote"]; + readonly additionalProperties: false; + }; +}; +export declare function getEventsSchemaValidator(type: string): import("ajv").ValidateFunction; diff --git a/dist/schemas/index.d.ts b/dist/schemas/index.d.ts index b3c1810..f01c441 100644 --- a/dist/schemas/index.d.ts +++ b/dist/schemas/index.d.ts @@ -1,4 +1,5 @@ -import Ajv from 'ajv'; -export declare const ajv: Ajv; +export * from './ajv'; +export * from './events'; export * from './status'; export * from './jobs'; +export * from './types'; diff --git a/dist/schemas/status.d.ts b/dist/schemas/status.d.ts index c2fdf7b..484d215 100644 --- a/dist/schemas/status.d.ts +++ b/dist/schemas/status.d.ts @@ -1,15 +1,16 @@ import { Config, NetIdType } from '../networkConfig'; +import { addressSchemaType, bnSchemaType } from '.'; export type statusInstanceType = { type: string; properties: { instanceAddress: { type: string; properties: { - [key in string]: typeof addressType; + [key in string]: typeof addressSchemaType; }; required: string[]; }; - tokenAddress?: typeof addressType; + tokenAddress?: typeof addressSchemaType; symbol?: { enum: string[]; }; @@ -29,14 +30,14 @@ export type statusInstancesType = { export type statusEthPricesType = { type: string; properties: { - [key in string]: typeof bnType; + [key in string]: typeof bnSchemaType; }; required?: string[]; }; export type statusSchema = { type: string; properties: { - rewardAccount: typeof addressType; + rewardAccount: typeof addressSchemaType; instances?: statusInstancesType; gasPrices: { type: string; @@ -102,13 +103,4 @@ export type statusSchema = { }; required: string[]; }; -declare const addressType: { - type: string; - pattern: string; -}; -declare const bnType: { - type: string; - BN: boolean; -}; export declare function getStatusSchema(netId: NetIdType, config: Config, tovarish: boolean): statusSchema; -export {}; diff --git a/dist/schemas/types.d.ts b/dist/schemas/types.d.ts new file mode 100644 index 0000000..d373cf4 --- /dev/null +++ b/dist/schemas/types.d.ts @@ -0,0 +1,22 @@ +export declare const addressSchemaType: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{40}$"; + readonly isAddress: true; +}; +export declare const bnSchemaType: { + readonly type: "string"; + readonly BN: true; +}; +export declare const proofSchemaType: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{512}$"; +}; +export declare const bytes32SchemaType: { + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; +}; +export declare const bytes32BNSchemaType: { + readonly BN: true; + readonly type: "string"; + readonly pattern: "^0x[a-fA-F0-9]{64}$"; +}; diff --git a/dist/tornado.umd.js b/dist/tornado.umd.js index 82189f4..8235fe5 100644 --- a/dist/tornado.umd.js +++ b/dist/tornado.umd.js @@ -71542,7 +71542,7 @@ class TornadoBrowserProvider extends BrowserProvider { /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67418); /* harmony import */ var _networkConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59499); /* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68434); -/* harmony import */ var _schemas__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7613); +/* harmony import */ var _schemas__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59511); var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; @@ -71798,32 +71798,292 @@ class RelayerClient { /***/ }), -/***/ 7613: +/***/ 59511: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { - SS: () => (/* binding */ schemas_ajv), + SC: () => (/* reexport */ addressSchemaType), + SS: () => (/* reexport */ ajv_ajv), + iL: () => (/* reexport */ bnSchemaType), + i1: () => (/* reexport */ bytes32BNSchemaType), + yF: () => (/* reexport */ bytes32SchemaType), + CI: () => (/* reexport */ depositsEventsSchema), + ME: () => (/* reexport */ echoEventsSchema), + XW: () => (/* reexport */ encryptedNotesSchema), + ZC: () => (/* reexport */ getEventsSchemaValidator), c_: () => (/* reexport */ getStatusSchema), - Us: () => (/* reexport */ jobsSchema) + FR: () => (/* reexport */ governanceEventsSchema), + Us: () => (/* reexport */ jobsSchema), + Y6: () => (/* reexport */ proofSchemaType), + dX: () => (/* reexport */ registeredEventsSchema), + $j: () => (/* reexport */ withdrawalsEventsSchema) }); // EXTERNAL MODULE: ./node_modules/ajv/dist/ajv.js var ajv = __webpack_require__(63282); var ajv_default = /*#__PURE__*/__webpack_require__.n(ajv); +// EXTERNAL MODULE: ./node_modules/ethers/lib.esm/address/checks.js +var checks = __webpack_require__(41442); +;// CONCATENATED MODULE: ./src/schemas/ajv.ts + + + +const ajv_ajv = new (ajv_default())({ allErrors: true }); +ajv_ajv.addKeyword({ + keyword: "BN", + // eslint-disable-next-line @typescript-eslint/no-explicit-any + validate: (schema, data) => { + try { + BigInt(data); + return true; + } catch (e) { + return false; + } + }, + errors: true +}); +ajv_ajv.addKeyword({ + keyword: "isAddress", + // eslint-disable-next-line @typescript-eslint/no-explicit-any + validate: (schema, data) => { + try { + return (0,checks/* isAddress */.PW)(data); + } catch (e) { + return false; + } + }, + errors: true +}); + +// EXTERNAL MODULE: ./src/events/index.ts +var events = __webpack_require__(94513); +;// CONCATENATED MODULE: ./src/schemas/types.ts + +var __defProp = Object.defineProperty; +var __defProps = Object.defineProperties; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; +}; +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); +const addressSchemaType = { + type: "string", + pattern: "^0x[a-fA-F0-9]{40}$", + isAddress: true +}; +const bnSchemaType = { type: "string", BN: true }; +const proofSchemaType = { type: "string", pattern: "^0x[a-fA-F0-9]{512}$" }; +const bytes32SchemaType = { type: "string", pattern: "^0x[a-fA-F0-9]{64}$" }; +const bytes32BNSchemaType = __spreadProps(__spreadValues({}, bytes32SchemaType), { BN: true }); + +;// CONCATENATED MODULE: ./src/schemas/events.ts + +var events_defProp = Object.defineProperty; +var events_defProps = Object.defineProperties; +var events_getOwnPropDescs = Object.getOwnPropertyDescriptors; +var events_getOwnPropSymbols = Object.getOwnPropertySymbols; +var events_hasOwnProp = Object.prototype.hasOwnProperty; +var events_propIsEnum = Object.prototype.propertyIsEnumerable; +var events_defNormalProp = (obj, key, value) => key in obj ? events_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var events_spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (events_hasOwnProp.call(b, prop)) + events_defNormalProp(a, prop, b[prop]); + if (events_getOwnPropSymbols) + for (var prop of events_getOwnPropSymbols(b)) { + if (events_propIsEnum.call(b, prop)) + events_defNormalProp(a, prop, b[prop]); + } + return a; +}; +var events_spreadProps = (a, b) => events_defProps(a, events_getOwnPropDescs(b)); + + + +const baseEventsSchemaProperty = { + blockNumber: { + type: "number" + }, + logIndex: { + type: "number" + }, + transactionHash: bytes32SchemaType +}; +const baseEventsSchemaRequired = Object.keys(baseEventsSchemaProperty); +const governanceEventsSchema = { + type: "array", + items: { + anyOf: [ + { + type: "object", + properties: events_spreadProps(events_spreadValues({}, baseEventsSchemaProperty), { + event: { type: "string" }, + id: { type: "number" }, + proposer: addressSchemaType, + target: addressSchemaType, + startTime: { type: "number" }, + endTime: { type: "number" }, + description: { type: "string" } + }), + required: [ + ...baseEventsSchemaRequired, + "event", + "id", + "proposer", + "target", + "startTime", + "endTime", + "description" + ], + additionalProperties: false + }, + { + type: "object", + properties: events_spreadProps(events_spreadValues({}, baseEventsSchemaProperty), { + event: { type: "string" }, + proposalId: { type: "number" }, + voter: addressSchemaType, + support: { type: "boolean" }, + votes: { type: "string" }, + from: addressSchemaType, + input: { type: "string" } + }), + required: [...baseEventsSchemaRequired, "event", "proposalId", "voter", "support", "votes", "from", "input"], + additionalProperties: false + }, + { + type: "object", + properties: events_spreadProps(events_spreadValues({}, baseEventsSchemaProperty), { + event: { type: "string" }, + account: addressSchemaType, + delegateTo: addressSchemaType + }), + required: [...baseEventsSchemaRequired, "account", "delegateTo"], + additionalProperties: false + }, + { + type: "object", + properties: events_spreadProps(events_spreadValues({}, baseEventsSchemaProperty), { + event: { type: "string" }, + account: addressSchemaType, + delegateFrom: addressSchemaType + }), + required: [...baseEventsSchemaRequired, "account", "delegateFrom"], + additionalProperties: false + } + ] + } +}; +const registeredEventsSchema = { + type: "array", + items: { + type: "object", + properties: events_spreadProps(events_spreadValues({}, baseEventsSchemaProperty), { + ensName: { type: "string" }, + relayerAddress: addressSchemaType + }), + required: [...baseEventsSchemaRequired, "ensName", "relayerAddress"], + additionalProperties: false + } +}; +const depositsEventsSchema = { + type: "array", + items: { + type: "object", + properties: events_spreadProps(events_spreadValues({}, baseEventsSchemaProperty), { + commitment: bytes32SchemaType, + leafIndex: { type: "number" }, + timestamp: { type: "number" }, + from: addressSchemaType + }), + required: [...baseEventsSchemaRequired, "commitment", "leafIndex", "timestamp", "from"], + additionalProperties: false + } +}; +const withdrawalsEventsSchema = { + type: "array", + items: { + type: "object", + properties: events_spreadProps(events_spreadValues({}, baseEventsSchemaProperty), { + nullifierHash: bytes32SchemaType, + to: addressSchemaType, + fee: bnSchemaType, + timestamp: { type: "number" } + }), + required: [...baseEventsSchemaRequired, "nullifierHash", "to", "fee", "timestamp"], + additionalProperties: false + } +}; +const echoEventsSchema = { + type: "array", + items: { + type: "object", + properties: events_spreadProps(events_spreadValues({}, baseEventsSchemaProperty), { + address: addressSchemaType, + encryptedAccount: { type: "string" } + }), + required: [...baseEventsSchemaRequired, "address", "encryptedAccount"], + additionalProperties: false + } +}; +const encryptedNotesSchema = { + type: "array", + items: { + type: "object", + properties: events_spreadProps(events_spreadValues({}, baseEventsSchemaProperty), { + encryptedNote: { type: "string" } + }), + required: [...baseEventsSchemaRequired, "encryptedNote"], + additionalProperties: false + } +}; +function getEventsSchemaValidator(type) { + if (type === events.DEPOSIT) { + return ajv_ajv.compile(depositsEventsSchema); + } + if (type === events.WITHDRAWAL) { + return ajv_ajv.compile(withdrawalsEventsSchema); + } + if (type === "governance") { + return ajv_ajv.compile(governanceEventsSchema); + } + if (type === "registered") { + return ajv_ajv.compile(registeredEventsSchema); + } + if (type === "echo") { + return ajv_ajv.compile(echoEventsSchema); + } + if (type === "encrypted_notes") { + return ajv_ajv.compile(encryptedNotesSchema); + } + throw new Error("Unsupported event type for schema validation"); +} + // EXTERNAL MODULE: ./src/networkConfig.ts var networkConfig = __webpack_require__(59499); ;// CONCATENATED MODULE: ./src/schemas/status.ts -const addressType = { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" }; -const bnType = { type: "string", BN: true }; + const statusSchema = { type: "object", properties: { - rewardAccount: addressType, + rewardAccount: addressSchemaType, gasPrices: { type: "object", properties: { @@ -71835,7 +72095,7 @@ const statusSchema = { netId: { type: "integer" }, tornadoServiceFee: { type: "number", maximum: 20, minimum: 0 }, latestBlock: { type: "number" }, - latestBalance: { type: "string", BN: true }, + latestBalance: bnSchemaType, version: { type: "string" }, health: { type: "object", @@ -71872,7 +72132,7 @@ function getStatusSchema(netId, config, tovarish) { instanceAddress: { type: "object", properties: amounts.reduce((acc2, cur) => { - acc2[cur] = addressType; + acc2[cur] = addressSchemaType; return acc2; }, {}), required: amounts.filter((amount) => !optionalInstances.includes(amount)) @@ -71885,7 +72145,7 @@ function getStatusSchema(netId, config, tovarish) { ) }; if (tokenAddress) { - instanceProperties.properties.tokenAddress = addressType; + instanceProperties.properties.tokenAddress = addressSchemaType; } if (symbol) { instanceProperties.properties.symbol = { enum: [symbol] }; @@ -71916,7 +72176,7 @@ function getStatusSchema(netId, config, tovarish) { const ethPrices = { type: "object", properties: _tokens.reduce((acc, token) => { - acc[token] = bnType; + acc[token] = bnSchemaType; return acc; }, {}), required: _tokens @@ -71955,20 +72215,8 @@ const jobsSchema = { ;// CONCATENATED MODULE: ./src/schemas/index.ts -const schemas_ajv = new (ajv_default())({ allErrors: true }); -schemas_ajv.addKeyword({ - keyword: "BN", - // eslint-disable-next-line @typescript-eslint/no-explicit-any - validate: (schema, data) => { - try { - BigInt(data); - return true; - } catch (e) { - return false; - } - }, - errors: true -}); + + @@ -72086,9 +72334,10 @@ function getTokenBalances(_0) { /* harmony export */ E: () => (/* binding */ TovarishClient), /* harmony export */ o: () => (/* binding */ MAX_TOVARISH_EVENTS) /* harmony export */ }); -/* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30031); +/* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(30031); /* harmony import */ var _relayerClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57194); /* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(68434); +/* harmony import */ var _schemas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59511); var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; @@ -72135,6 +72384,7 @@ var __async = (__this, __arguments, generator) => { + const MAX_TOVARISH_EVENTS = 5e3; class TovarishClient extends _relayerClient__WEBPACK_IMPORTED_MODULE_0__/* .RelayerClient */ .OR { constructor({ netId, config, fetchDataOptions }) { @@ -72169,7 +72419,7 @@ class TovarishClient extends _relayerClient__WEBPACK_IMPORTED_MODULE_0__/* .Rela hostname, ensName, relayerAddress, - rewardAccount: (0,ethers__WEBPACK_IMPORTED_MODULE_2__/* .getAddress */ .b)(status.rewardAccount), + rewardAccount: (0,ethers__WEBPACK_IMPORTED_MODULE_3__/* .getAddress */ .b)(status.rewardAccount), instances: (0,_relayerClient__WEBPACK_IMPORTED_MODULE_0__/* .getSupportedInstances */ .XF)(status.instances), stakeBalance: relayer.stakeBalance, gasPrice: (_a = status.gasPrices) == null ? void 0 : _a.fast, @@ -72222,6 +72472,7 @@ class TovarishClient extends _relayerClient__WEBPACK_IMPORTED_MODULE_0__/* .Rela }) { var _a; const url = `${(_a = this.selectedRelayer) == null ? void 0 : _a.url}events`; + const schemaValidator = (0,_schemas__WEBPACK_IMPORTED_MODULE_2__/* .getEventsSchemaValidator */ .ZC)(type); try { const events = []; let lastSyncBlock = fromBlock; @@ -72239,6 +72490,10 @@ class TovarishClient extends _relayerClient__WEBPACK_IMPORTED_MODULE_0__/* .Rela recent }) })); + if (!schemaValidator(fetchedEvents)) { + const errMsg = `Schema validation failed for ${type} events`; + throw new Error(errMsg); + } lastSyncBlock = currentBlock; if (!Array.isArray(fetchedEvents) || !fetchedEvents.length) { break; @@ -162074,11 +162329,11 @@ function getIcapAddress(address) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $C: () => (/* binding */ isAddressable), +/* harmony export */ PW: () => (/* binding */ isAddress), /* harmony export */ tG: () => (/* binding */ resolveAddress) /* harmony export */ }); -/* unused harmony export isAddress */ -/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57339); -/* harmony import */ var _address_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30031); +/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57339); +/* harmony import */ var _address_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30031); /** @@ -162125,7 +162380,7 @@ function isAddressable(value) { */ function isAddress(value) { try { - getAddress(value); + (0,_address_js__WEBPACK_IMPORTED_MODULE_0__/* .getAddress */ .b)(value); return true; } catch (error) { } @@ -162134,10 +162389,10 @@ function isAddress(value) { async function checkAddress(target, promise) { const result = await promise; if (result == null || result === "0x0000000000000000000000000000000000000000") { - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__/* .assert */ .vA)(typeof (target) !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__/* .assertArgument */ .MR)(false, "invalid AddressLike value; did not resolve to a value address", "target", target); + (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .vA)(typeof (target) !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); + (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__/* .assertArgument */ .MR)(false, "invalid AddressLike value; did not resolve to a value address", "target", target); } - return (0,_address_js__WEBPACK_IMPORTED_MODULE_1__/* .getAddress */ .b)(result); + return (0,_address_js__WEBPACK_IMPORTED_MODULE_0__/* .getAddress */ .b)(result); } /** * Resolves to an address for the %%target%%, which may be any @@ -162179,9 +162434,9 @@ async function checkAddress(target, promise) { function resolveAddress(target, resolver) { if (typeof (target) === "string") { if (target.match(/^0x[0-9a-f]{40}$/i)) { - return (0,_address_js__WEBPACK_IMPORTED_MODULE_1__/* .getAddress */ .b)(target); + return (0,_address_js__WEBPACK_IMPORTED_MODULE_0__/* .getAddress */ .b)(target); } - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__/* .assert */ .vA)(resolver != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" }); + (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .vA)(resolver != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" }); return checkAddress(target, resolver.resolveName(target)); } else if (isAddressable(target)) { @@ -162190,7 +162445,7 @@ function resolveAddress(target, resolver) { else if (target && typeof (target.then) === "function") { return checkAddress(target, target); } - (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__/* .assertArgument */ .MR)(false, "unsupported addressable value", "target", target); + (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__/* .assertArgument */ .MR)(false, "unsupported addressable value", "target", target); } //# sourceMappingURL=checks.js.map @@ -173348,12 +173603,16 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ TovarishClient: () => (/* reexport safe */ _tovarishClient__WEBPACK_IMPORTED_MODULE_17__.E), /* harmony export */ _META: () => (/* reexport safe */ _graphql__WEBPACK_IMPORTED_MODULE_1__._META), /* harmony export */ addNetwork: () => (/* reexport safe */ _networkConfig__WEBPACK_IMPORTED_MODULE_11__.AE), +/* harmony export */ addressSchemaType: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.SC), /* harmony export */ ajv: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.SS), /* harmony export */ base64ToBytes: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.Kp), /* harmony export */ bigIntReplacer: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.gn), +/* harmony export */ bnSchemaType: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.iL), /* harmony export */ bnToBytes: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.jm), /* harmony export */ buffPedersenHash: () => (/* reexport safe */ _pedersen__WEBPACK_IMPORTED_MODULE_12__.UB), /* harmony export */ bufferToBytes: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.lY), +/* harmony export */ bytes32BNSchemaType: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.i1), +/* harmony export */ bytes32SchemaType: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.yF), /* harmony export */ bytesToBN: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.Ju), /* harmony export */ bytesToBase64: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__["if"]), /* harmony export */ bytesToHex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.My), @@ -173367,8 +173626,11 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ customConfig: () => (/* reexport safe */ _networkConfig__WEBPACK_IMPORTED_MODULE_11__.cX), /* harmony export */ defaultConfig: () => (/* reexport safe */ _networkConfig__WEBPACK_IMPORTED_MODULE_11__.sb), /* harmony export */ defaultUserAgent: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_14__.mJ), +/* harmony export */ depositsEventsSchema: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.CI), /* harmony export */ digest: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.br), +/* harmony export */ echoEventsSchema: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.ME), /* harmony export */ enabledChains: () => (/* reexport safe */ _networkConfig__WEBPACK_IMPORTED_MODULE_11__.Af), +/* harmony export */ encryptedNotesSchema: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.XW), /* harmony export */ factories: () => (/* reexport safe */ _typechain__WEBPACK_IMPORTED_MODULE_3__.XB), /* harmony export */ fetch: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_14__.hd), /* harmony export */ fetchData: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_14__.Fd), @@ -173384,6 +173646,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ getConfig: () => (/* reexport safe */ _networkConfig__WEBPACK_IMPORTED_MODULE_11__.zj), /* harmony export */ getDeposits: () => (/* reexport safe */ _graphql__WEBPACK_IMPORTED_MODULE_1__.getDeposits), /* harmony export */ getEncryptedNotes: () => (/* reexport safe */ _graphql__WEBPACK_IMPORTED_MODULE_1__.getEncryptedNotes), +/* harmony export */ getEventsSchemaValidator: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.ZC), /* harmony export */ getGovernanceEvents: () => (/* reexport safe */ _graphql__WEBPACK_IMPORTED_MODULE_1__.getGovernanceEvents), /* harmony export */ getGraphEchoEvents: () => (/* reexport safe */ _graphql__WEBPACK_IMPORTED_MODULE_1__.getGraphEchoEvents), /* harmony export */ getHttpAgent: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_14__.WU), @@ -173401,6 +173664,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ getTokenBalances: () => (/* reexport safe */ _tokens__WEBPACK_IMPORTED_MODULE_16__.H), /* harmony export */ getWeightRandom: () => (/* reexport safe */ _relayerClient__WEBPACK_IMPORTED_MODULE_15__.c$), /* harmony export */ getWithdrawals: () => (/* reexport safe */ _graphql__WEBPACK_IMPORTED_MODULE_1__.getWithdrawals), +/* harmony export */ governanceEventsSchema: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.FR), /* harmony export */ hexToBytes: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.aT), /* harmony export */ initGroth16: () => (/* reexport safe */ _websnark__WEBPACK_IMPORTED_MODULE_19__.O), /* harmony export */ isNode: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.Ll), @@ -173413,21 +173677,24 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ pedersen: () => (/* reexport safe */ _pedersen__WEBPACK_IMPORTED_MODULE_12__.NO), /* harmony export */ pickWeightedRandomRelayer: () => (/* reexport safe */ _relayerClient__WEBPACK_IMPORTED_MODULE_15__.sN), /* harmony export */ populateTransaction: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_14__.zr), +/* harmony export */ proofSchemaType: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.Y6), /* harmony export */ queryGraph: () => (/* reexport safe */ _graphql__WEBPACK_IMPORTED_MODULE_1__.queryGraph), /* harmony export */ rBigInt: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.ib), +/* harmony export */ registeredEventsSchema: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.dX), /* harmony export */ sleep: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.yy), /* harmony export */ substring: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.uU), /* harmony export */ toFixedHex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.$W), /* harmony export */ toFixedLength: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.sY), /* harmony export */ unpackEncryptedMessage: () => (/* reexport safe */ _encryptedNotes__WEBPACK_IMPORTED_MODULE_6__.ol), -/* harmony export */ validateUrl: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.wv) +/* harmony export */ validateUrl: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_18__.wv), +/* harmony export */ withdrawalsEventsSchema: () => (/* reexport safe */ _schemas__WEBPACK_IMPORTED_MODULE_2__.$j) /* harmony export */ }); /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94513); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _events__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _events__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); /* harmony import */ var _graphql__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(52049); -/* harmony import */ var _schemas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7613); +/* harmony import */ var _schemas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59511); /* harmony import */ var _typechain__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21278); /* harmony import */ var _batch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9723); /* harmony import */ var _deposits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7240); diff --git a/dist/tornado.umd.min.js b/dist/tornado.umd.min.js index e1eed9a..90c81ac 100644 --- a/dist/tornado.umd.min.js +++ b/dist/tornado.umd.min.js @@ -1,8 +1,8 @@ /*! For license information please see tornado.umd.min.js.LICENSE.txt */ -!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?exports.Tornado=a():e.Tornado=a()}(self,(()=>(()=>{var __webpack_modules__={66289:(e,a)=>{"use strict";function t(e){if(Array.isArray(e)){const a=[];let c=0;for(let f=0;fe.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(a,t)}function f(e){if(0===e[0])throw new Error("invalid RLP: extra zeros");return o(b(e))}function d(e,a){if(e<56)return Uint8Array.from([e+a]);const t=h(e),c=h(a+55+t.length/2);return Uint8Array.from(s(c+t))}function r(e,a=!1){if(null==e||0===e.length)return Uint8Array.from([]);const t=n(g(e));if(a)return t;if(0!==t.remainder.length)throw new Error("invalid RLP: remainder must be zero");return t.data}function n(e){let a,t,d,r,i;const b=[],o=e[0];if(o<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(o<=183){if(a=o-127,d=128===o?Uint8Array.from([]):c(e,1,a),2===a&&d[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:d,remainder:e.slice(a)}}if(o<=191){if(t=o-182,e.length-1e.length)throw new Error("invalid RLP: total length is larger than the data");for(r=c(e,t,d);r.length;)i=n(r),b.push(i.data),r=i.remainder;return{data:b,remainder:e.slice(d)}}}Object.defineProperty(a,"__esModule",{value:!0}),a.RLP=a.utils=a.decode=a.encode=void 0,a.encode=t,a.decode=r;const i=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function b(e){let a="";for(let t=0;te+a.length),0),t=new Uint8Array(a);for(let a=0,c=0;a=2&&"0"===e[0]&&"x"===e[1]}function g(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return p(e)?s((a="string"!=typeof(t=e)?t:p(t)?t.slice(2):t).length%2?`0${a}`:a):u(e);var a,t;if("number"==typeof e||"bigint"==typeof e)return e?s(h(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}a.utils={bytesToHex:b,concatBytes:l,hexToBytes:s,utf8ToBytes:u},a.RLP={encode:t,decode:r}},16284:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.accountBodyToRLP=a.accountBodyToSlim=a.accountBodyFromSlim=a.isZeroAddress=a.zeroAddress=a.importPublic=a.privateToAddress=a.privateToPublic=a.publicToAddress=a.pubToAddress=a.isValidPublic=a.isValidPrivate=a.generateAddress2=a.generateAddress=a.isValidChecksumAddress=a.toChecksumAddress=a.isValidAddress=a.Account=void 0;const f=t(66289),d=t(32019),r=t(26513),n=t(82672),i=t(77312),b=t(89838),o=t(35546),s=t(59498),l=BigInt(0);class u{constructor(e=l,a=l,t=b.KECCAK256_RLP,c=b.KECCAK256_NULL){this.nonce=e,this.balance=a,this.storageRoot=t,this.codeHash=c,this._validate()}static fromAccountData(e){const{nonce:a,balance:t,storageRoot:c,codeHash:f}=e;return new u(void 0!==a?(0,i.bufferToBigInt)((0,i.toBuffer)(a)):void 0,void 0!==t?(0,i.bufferToBigInt)((0,i.toBuffer)(t)):void 0,void 0!==c?(0,i.toBuffer)(c):void 0,void 0!==f?(0,i.toBuffer)(f):void 0)}static fromRlpSerializedAccount(e){const a=(0,i.arrToBufArr)(f.RLP.decode(Uint8Array.from(e)));if(!Array.isArray(a))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(a)}static fromValuesArray(e){const[a,t,c,f]=e;return new u((0,i.bufferToBigInt)(a),(0,i.bufferToBigInt)(t),c,f)}_validate(){if(this.nonce=8?l+=t[e].toUpperCase():l+=t[e];return l},a.isValidChecksumAddress=function(e,t){return(0,a.isValidAddress)(e)&&(0,a.toChecksumAddress)(e,t)===e},a.generateAddress=function(e,a){return(0,o.assertIsBuffer)(e),(0,o.assertIsBuffer)(a),(0,i.bufferToBigInt)(a)===BigInt(0)?c.from((0,d.keccak256)(f.RLP.encode((0,i.bufArrToArr)([e,null])))).slice(-20):c.from((0,d.keccak256)(f.RLP.encode((0,i.bufArrToArr)([e,a])))).slice(-20)},a.generateAddress2=function(e,a,t){if((0,o.assertIsBuffer)(e),(0,o.assertIsBuffer)(a),(0,o.assertIsBuffer)(t),20!==e.length)throw new Error("Expected from to be of length 20");if(32!==a.length)throw new Error("Expected salt to be of length 32");const f=(0,d.keccak256)(c.concat([c.from("ff","hex"),e,a,(0,d.keccak256)(t)]));return(0,i.toBuffer)(f).slice(-20)},a.isValidPrivate=function(e){return r.secp256k1.utils.isValidPrivateKey(e)},a.isValidPublic=function(e,a=!1){if((0,o.assertIsBuffer)(e),64===e.length)try{return r.secp256k1.ProjectivePoint.fromHex(c.concat([c.from([4]),e])),!0}catch(e){return!1}if(!a)return!1;try{return r.secp256k1.ProjectivePoint.fromHex(e),!0}catch(e){return!1}},a.pubToAddress=function(e,a=!1){if((0,o.assertIsBuffer)(e),a&&64!==e.length&&(e=c.from(r.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),64!==e.length)throw new Error("Expected pubKey to be of length 64");return c.from((0,d.keccak256)(e)).slice(-20)},a.publicToAddress=a.pubToAddress,a.privateToPublic=function(e){return(0,o.assertIsBuffer)(e),c.from(r.secp256k1.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1))},a.privateToAddress=function(e){return(0,a.publicToAddress)((0,a.privateToPublic)(e))},a.importPublic=function(e){return(0,o.assertIsBuffer)(e),64!==e.length&&(e=c.from(r.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),e},a.zeroAddress=function(){const e=(0,i.zeros)(20);return(0,i.bufferToHex)(e)},a.isZeroAddress=function(e){try{(0,o.assertIsString)(e)}catch(e){return!1}return(0,a.zeroAddress)()===e},a.accountBodyFromSlim=h;const p=new Uint8Array(0);a.accountBodyToSlim=function(e){const[a,t,c,f]=e;return[a,t,(0,i.arrToBufArr)(c).equals(b.KECCAK256_RLP)?p:c,(0,i.arrToBufArr)(f).equals(b.KECCAK256_NULL)?p:f]},a.accountBodyToRLP=function(e,a=!0){const t=a?h(e):e;return(0,i.arrToBufArr)(f.RLP.encode(t))}},86727:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.Address=void 0;const f=t(16284),d=t(77312);class r{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.buf=e}static zero(){return new r((0,d.zeros)(20))}static fromString(e){if(!(0,f.isValidAddress)(e))throw new Error("Invalid address");return new r((0,d.toBuffer)(e))}static fromPublicKey(e){if(!c.isBuffer(e))throw new Error("Public key should be Buffer");const a=(0,f.pubToAddress)(e);return new r(a)}static fromPrivateKey(e){if(!c.isBuffer(e))throw new Error("Private key should be Buffer");const a=(0,f.privateToAddress)(e);return new r(a)}static generate(e,a){if("bigint"!=typeof a)throw new Error("Expected nonce to be a bigint");return new r((0,f.generateAddress)(e.buf,(0,d.bigIntToBuffer)(a)))}static generate2(e,a,t){if(!c.isBuffer(a))throw new Error("Expected salt to be a Buffer");if(!c.isBuffer(t))throw new Error("Expected initCode to be a Buffer");return new r((0,f.generateAddress2)(e.buf,a,t))}equals(e){return this.buf.equals(e.buf)}isZero(){return this.equals(r.zero())}isPrecompileOrSystemAddress(){const e=(0,d.bufferToBigInt)(this.buf),a=BigInt(0),t=BigInt("0xffff");return e>=a&&e<=t}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return c.from(this.buf)}}a.Address=r},98421:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.AsyncEventEmitter=void 0;const c=t(37007);class f extends c.EventEmitter{emit(e,...a){let[t,c]=a;const f=this;let d=f._events[e]??[];return void 0===c&&"function"==typeof t&&(c=t,t=void 0),"newListener"!==e&&"removeListener"!==e||(t={event:t,fn:c},c=void 0),d=Array.isArray(d)?d:[d],async function(e,a,t){let c;for await(const f of a)try{f.length<2?f.call(e,t):await new Promise(((a,c)=>{f.call(e,t,(e=>{e?c(e):a()}))}))}catch(e){c=e}if(c)throw c}(f,d.slice(),t).then(c).catch(c),f.listenerCount(e)>0}once(e,a){const t=this;let c;if("function"!=typeof a)throw new TypeError("listener must be a function");return c=a.length>=2?function(f,d){t.removeListener(e,c),a(f,d)}:function(f){t.removeListener(e,c),a(f,c)},t.on(e,c),t}first(e,a){let t=this._events[e]??[];if("function"!=typeof a)throw new TypeError("listener must be a function");return Array.isArray(t)||(this._events[e]=t=[t]),t.unshift(a),this}before(e,a,t){return this.beforeOrAfter(e,a,t)}after(e,a,t){return this.beforeOrAfter(e,a,t,"after")}beforeOrAfter(e,a,t,c){let f,d,r=this._events[e]??[];const n="after"===c?1:0;if("function"!=typeof t)throw new TypeError("listener must be a function");if("function"!=typeof a)throw new TypeError("target must be a function");for(Array.isArray(r)||(this._events[e]=r=[r]),d=r.length,f=r.length;f--;)if(r[f]===a){d=f+n;break}return r.splice(d,0,t),this}on(e,a){return super.on(e,a)}addListener(e,a){return super.addListener(e,a)}prependListener(e,a){return super.prependListener(e,a)}prependOnceListener(e,a){return super.prependOnceListener(e,a)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,a){return super.removeListener(e,a)}eventNames(){return super.eventNames()}listeners(e){return super.listeners(e)}listenerCount(e){return super.listenerCount(e)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(e){return super.setMaxListeners(e)}}a.AsyncEventEmitter=f},77312:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.intToUnpaddedBuffer=a.bigIntToUnpaddedBuffer=a.bigIntToHex=a.bufArrToArr=a.arrToBufArr=a.validateNoLeadingZeroes=a.baToJSON=a.toUtf8=a.short=a.addHexPrefix=a.toUnsigned=a.fromSigned=a.bufferToInt=a.bigIntToBuffer=a.bufferToBigInt=a.bufferToHex=a.toBuffer=a.unpadHexString=a.unpadArray=a.unpadBuffer=a.setLengthRight=a.setLengthLeft=a.zeros=a.intToBuffer=a.intToHex=void 0;const f=t(35546),d=t(59498);a.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`},a.intToBuffer=function(e){const t=(0,a.intToHex)(e);return c.from((0,d.padToEven)(t.slice(2)),"hex")},a.zeros=function(e){return c.allocUnsafe(e).fill(0)};const r=function(e,t,c){const f=(0,a.zeros)(t);return c?e.length0&&"0"===a.toString();)a=(e=e.slice(1))[0];return e};function i(e){const t=(0,a.bufferToHex)(e);return"0x"===t?BigInt(0):BigInt(t)}function b(e){return(0,a.toBuffer)("0x"+e.toString(16))}a.unpadBuffer=function(e){return(0,f.assertIsBuffer)(e),n(e)},a.unpadArray=function(e){return(0,f.assertIsArray)(e),n(e)},a.unpadHexString=function(e){return(0,f.assertIsHexString)(e),e=(0,d.stripHexPrefix)(e),"0x"+n(e)},a.toBuffer=function(e){if(null==e)return c.allocUnsafe(0);if(c.isBuffer(e))return c.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return c.from(e);if("string"==typeof e){if(!(0,d.isHexString)(e))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${e}`);return c.from((0,d.padToEven)((0,d.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,a.intToBuffer)(e);if("bigint"==typeof e){if(e0&&0===t[0])throw new Error(`${a} cannot have leading zeroes, received: ${t.toString("hex")}`)},a.arrToBufArr=function e(a){return Array.isArray(a)?a.map((a=>e(a))):c.from(a)},a.bufArrToArr=function e(a){return Array.isArray(a)?a.map((a=>e(a))):Uint8Array.from(a??[])},a.bigIntToHex=e=>"0x"+e.toString(16),a.bigIntToUnpaddedBuffer=function(e){return(0,a.unpadBuffer)(b(e))},a.intToUnpaddedBuffer=function(e){return(0,a.unpadBuffer)((0,a.intToBuffer)(e))}},89838:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MAX_WITHDRAWALS_PER_PAYLOAD=a.RLP_EMPTY_STRING=a.KECCAK256_RLP=a.KECCAK256_RLP_S=a.KECCAK256_RLP_ARRAY=a.KECCAK256_RLP_ARRAY_S=a.KECCAK256_NULL=a.KECCAK256_NULL_S=a.TWO_POW256=a.SECP256K1_ORDER_DIV_2=a.SECP256K1_ORDER=a.MAX_INTEGER_BIGINT=a.MAX_INTEGER=a.MAX_UINT64=void 0;const c=t(48287),f=t(26513);a.MAX_UINT64=BigInt("0xffffffffffffffff"),a.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),a.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),a.SECP256K1_ORDER=f.secp256k1.CURVE.n,a.SECP256K1_ORDER_DIV_2=f.secp256k1.CURVE.n/BigInt(2),a.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),a.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",a.KECCAK256_NULL=c.Buffer.from(a.KECCAK256_NULL_S,"hex"),a.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",a.KECCAK256_RLP_ARRAY=c.Buffer.from(a.KECCAK256_RLP_ARRAY_S,"hex"),a.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",a.KECCAK256_RLP=c.Buffer.from(a.KECCAK256_RLP_S,"hex"),a.RLP_EMPTY_STRING=c.Buffer.from([128]),a.MAX_WITHDRAWALS_PER_PAYLOAD=16},45062:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.compactBytesToNibbles=a.bytesToNibbles=a.nibblesToCompactBytes=a.nibblesToBytes=a.hasTerminator=void 0,a.hasTerminator=e=>e.length>0&&16===e[e.length-1],a.nibblesToBytes=(e,a)=>{for(let t=0,c=0;c{let t=0;(0,a.hasTerminator)(e)&&(t=1,e=e.subarray(0,e.length-1));const c=new Uint8Array(e.length/2+1);return c[0]=t<<5,1&~e.length||(c[0]|=16,c[0]|=e[0],e=e.subarray(1)),(0,a.nibblesToBytes)(e,c.subarray(1)),c},a.bytesToNibbles=e=>{const a=2*e.length+1,t=new Uint8Array(a);for(let a=0;a{if(0===e.length)return e;let t=(0,a.bytesToNibbles)(e);t[0]<2&&(t=t.subarray(0,t.length-1));const c=2-(1&t[0]);return t.subarray(c)}},35546:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.assertIsString=a.assertIsArray=a.assertIsBuffer=a.assertIsHexString=void 0;const f=t(59498);a.assertIsHexString=function(e){if(!(0,f.isHexString)(e))throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${e}`)},a.assertIsBuffer=function(e){if(!c.isBuffer(e))throw new Error(`This method only supports Buffer but input was: ${e}`)},a.assertIsArray=function(e){if(!Array.isArray(e))throw new Error(`This method only supports number arrays but input was: ${e}`)},a.assertIsString=function(e){if("string"!=typeof e)throw new Error(`This method only supports strings but input was: ${e}`)}},68683:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),a.toAscii=a.stripHexPrefix=a.padToEven=a.isHexString=a.isHexPrefixed=a.getKeys=a.getBinarySize=a.fromUtf8=a.fromAscii=a.arrayContainsArray=void 0,f(t(89838),a),f(t(52652),a),f(t(16284),a),f(t(86727),a),f(t(37380),a),f(t(92133),a),f(t(77312),a),f(t(42666),a),f(t(45062),a),f(t(98421),a);var d=t(59498);Object.defineProperty(a,"arrayContainsArray",{enumerable:!0,get:function(){return d.arrayContainsArray}}),Object.defineProperty(a,"fromAscii",{enumerable:!0,get:function(){return d.fromAscii}}),Object.defineProperty(a,"fromUtf8",{enumerable:!0,get:function(){return d.fromUtf8}}),Object.defineProperty(a,"getBinarySize",{enumerable:!0,get:function(){return d.getBinarySize}}),Object.defineProperty(a,"getKeys",{enumerable:!0,get:function(){return d.getKeys}}),Object.defineProperty(a,"isHexPrefixed",{enumerable:!0,get:function(){return d.isHexPrefixed}}),Object.defineProperty(a,"isHexString",{enumerable:!0,get:function(){return d.isHexString}}),Object.defineProperty(a,"padToEven",{enumerable:!0,get:function(){return d.padToEven}}),Object.defineProperty(a,"stripHexPrefix",{enumerable:!0,get:function(){return d.stripHexPrefix}}),Object.defineProperty(a,"toAscii",{enumerable:!0,get:function(){return d.toAscii}}),f(t(31708),a),f(t(81862),a)},59498:(e,a,t)=>{"use strict";var c=t(48287).Buffer;function f(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]}function d(e){let a=e;if("string"!=typeof a)throw new Error("[padToEven] value must be type 'string', received "+typeof a);return a.length%2&&(a=`0${a}`),a}Object.defineProperty(a,"__esModule",{value:!0}),a.isHexString=a.getKeys=a.fromAscii=a.fromUtf8=a.toAscii=a.arrayContainsArray=a.getBinarySize=a.padToEven=a.stripHexPrefix=a.isHexPrefixed=void 0,a.isHexPrefixed=f,a.stripHexPrefix=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return f(e)?e.slice(2):e},a.padToEven=d,a.getBinarySize=function(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof e);return c.byteLength(e,"utf8")},a.arrayContainsArray=function(e,a,t){if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(!0!==Array.isArray(a))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof a}'`);return a[!0===t?"some":"every"]((a=>e.indexOf(a)>=0))},a.toAscii=function(e){let a="",t=0;const c=e.length;for("0x"===e.substring(0,2)&&(t=2);t0&&e.length!==2+2*a)}},31708:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Lock=void 0,a.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((e=>this.promiseResolverQueue.push(e)))}release(){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;const e=this.promiseResolverQueue.shift();e&&e(!0)}}}},81862:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getProvider=a.fetchFromProvider=void 0;const c=t(6215);a.fetchFromProvider=async(e,a)=>(await(0,c.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:a.method,params:a.params,jsonrpc:"2.0",id:1}})).result,a.getProvider=e=>{if("string"==typeof e)return e;if(void 0!==e?.connection?.url)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")}},92133:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.hashPersonalMessage=a.isValidSignature=a.fromRpcSig=a.toCompactSig=a.toRpcSig=a.ecrecover=a.ecsign=void 0;const f=t(32019),d=t(26513),r=t(77312),n=t(89838),i=t(35546);function b(e,a){return e===BigInt(0)||e===BigInt(1)?e:void 0===a?e-BigInt(27):e-(a*BigInt(2)+BigInt(35))}function o(e){return e===BigInt(0)||e===BigInt(1)}a.ecsign=function(e,a,t){const f=d.secp256k1.sign(e,a),r=f.toCompactRawBytes();return{r:c.from(r.slice(0,32)),s:c.from(r.slice(32,64)),v:void 0===t?BigInt(f.recovery+27):BigInt(f.recovery+35)+BigInt(t)*BigInt(2)}},a.ecrecover=function(e,a,t,f,n){const i=c.concat([(0,r.setLengthLeft)(t,32),(0,r.setLengthLeft)(f,32)],64),s=b(a,n);if(!o(s))throw new Error("Invalid signature v value");const l=d.secp256k1.Signature.fromCompact(i).addRecoveryBit(Number(s)).recoverPublicKey(e);return c.from(l.toRawBytes(!1).slice(1))},a.toRpcSig=function(e,a,t,f){if(!o(b(e,f)))throw new Error("Invalid signature v value");return(0,r.bufferToHex)(c.concat([(0,r.setLengthLeft)(a,32),(0,r.setLengthLeft)(t,32),(0,r.toBuffer)(e)]))},a.toCompactSig=function(e,a,t,f){if(!o(b(e,f)))throw new Error("Invalid signature v value");let d=t;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(d=c.from(t),d[0]|=128),(0,r.bufferToHex)(c.concat([(0,r.setLengthLeft)(a,32),(0,r.setLengthLeft)(d,32)]))},a.fromRpcSig=function(e){const a=(0,r.toBuffer)(e);let t,c,f;if(a.length>=65)t=a.slice(0,32),c=a.slice(32,64),f=(0,r.bufferToBigInt)(a.slice(64));else{if(64!==a.length)throw new Error("Invalid signature length");t=a.slice(0,32),c=a.slice(32,64),f=BigInt((0,r.bufferToInt)(a.slice(32,33))>>7),c[0]&=127}return f<27&&(f+=BigInt(27)),{v:f,r:t,s:c}},a.isValidSignature=function(e,a,t,c=!0,f){if(32!==a.length||32!==t.length)return!1;if(!o(b(e,f)))return!1;const d=(0,r.bufferToBigInt)(a),i=(0,r.bufferToBigInt)(t);return!(d===BigInt(0)||d>=n.SECP256K1_ORDER||i===BigInt(0)||i>=n.SECP256K1_ORDER||c&&i>=n.SECP256K1_ORDER_DIV_2)},a.hashPersonalMessage=function(e){(0,i.assertIsBuffer)(e);const a=c.from(`Ethereum Signed Message:\n${e.length}`,"utf-8");return c.from((0,f.keccak256)(c.concat([a,e])))}},42666:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.toType=a.TypeOutput=void 0;const c=t(77312),f=t(59498);var d;!function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(d=a.TypeOutput||(a.TypeOutput={})),a.toType=function(e,a){if(null===e)return null;if(void 0===e)return;if("string"==typeof e&&!(0,f.isHexString)(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const t=(0,c.toBuffer)(e);switch(a){case d.Buffer:return t;case d.BigInt:return(0,c.bufferToBigInt)(t);case d.Number:{const e=(0,c.bufferToBigInt)(t);if(e>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(e)}case d.PrefixedHexString:return(0,c.bufferToHex)(t);default:throw new Error("unknown outputType")}}},52652:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.GWEI_TO_WEI=void 0,a.GWEI_TO_WEI=BigInt(1e9)},37380:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.Withdrawal=void 0;const f=t(86727),d=t(77312),r=t(42666);class n{constructor(e,a,t,c){this.index=e,this.validatorIndex=a,this.address=t,this.amount=c}static fromWithdrawalData(e){const{index:a,validatorIndex:t,address:c,amount:d}=e,i=(0,r.toType)(a,r.TypeOutput.BigInt),b=(0,r.toType)(t,r.TypeOutput.BigInt),o=new f.Address((0,r.toType)(c,r.TypeOutput.Buffer)),s=(0,r.toType)(d,r.TypeOutput.BigInt);return new n(i,b,o,s)}static fromValuesArray(e){if(4!==e.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${e.length}`);const[a,t,c,f]=e;return n.fromWithdrawalData({index:a,validatorIndex:t,address:c,amount:f})}static toBufferArray(e){const{index:a,validatorIndex:t,address:d,amount:n}=e,i=(0,r.toType)(a,r.TypeOutput.BigInt)===BigInt(0)?c.alloc(0):(0,r.toType)(a,r.TypeOutput.Buffer),b=(0,r.toType)(t,r.TypeOutput.BigInt)===BigInt(0)?c.alloc(0):(0,r.toType)(t,r.TypeOutput.Buffer);let o;return o=d instanceof f.Address?d.buf:(0,r.toType)(d,r.TypeOutput.Buffer),[i,b,o,(0,r.toType)(n,r.TypeOutput.BigInt)===BigInt(0)?c.alloc(0):(0,r.toType)(n,r.TypeOutput.Buffer)]}raw(){return n.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,d.bigIntToHex)(this.index),validatorIndex:(0,d.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,d.bigIntToHex)(this.amount)}}}a.Withdrawal=n},56498:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.decodeSingle=a.decode=a.encodePacked=a.encodeSingle=a.encode=void 0;const c=t(52367),f=t(5961),d=t(37700);a.encode=(e,a,t,c)=>{try{return(0,d.pack)({types:e,values:a,packed:t,tight:c})}catch(e){if(e instanceof f.ParserError)throw new f.ParserError(`Unable to encode value: ${e.message}`,e);throw new f.ParserError(`An unexpected error occurred: ${(0,f.getErrorMessage)(e)}`,e)}},a.encodeSingle=(e,t)=>(0,a.encode)([e],[t]),a.encodePacked=(e,t,c)=>(0,a.encode)(e,t,!0,c),a.decode=(e,a)=>{const t=(0,c.createBytes)(a);try{return(0,d.unpack)(e,t)}catch(e){if(e instanceof f.ParserError)throw new f.ParserError(`Unable to decode value: ${e.message}`,e);throw new f.ParserError(`An unexpected error occurred: ${(0,f.getErrorMessage)(e)}`,e)}},a.decodeSingle=(e,t)=>{const d=(0,a.decode)([e],t);return(0,c.assert)(1===d.length,new f.ParserError("Decoded value array has unexpected length.")),d[0]}},5961:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ParserError=a.getErrorStack=a.getErrorMessage=void 0;const c=t(52367);a.getErrorMessage=e=>"string"==typeof e?e:e instanceof Error||(0,c.isObject)(e)&&(0,c.hasProperty)(e,"message")&&"string"==typeof e.message?e.message:"Unknown error.",a.getErrorStack=e=>{if(e instanceof Error)return e.stack};class f extends Error{constructor(e,t){super(e),this.name="ParserError";const c=(0,a.getErrorStack)(t);c&&(this.stack=c)}}a.ParserError=f},93256:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(56498),a),f(t(5961),a),f(t(11126),a)},57924:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.iterate=void 0;const c=t(52367);a.iterate=function*(e,a=32){for(let t=0;t{(0,c.assert)(e>=0,"Cannot skip a negative number of bytes."),(0,c.assert)(e%a==0,"Length must be a multiple of the size."),t+=e},d=e.subarray(t);yield{skip:f,value:d}}return{skip:()=>{},value:new Uint8Array}}},37700:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.unpack=a.pack=a.isDynamicParser=a.getParser=void 0;const c=t(52367),f=t(5961),d=t(57924),r=t(46207),n=t(26365);a.getParser=e=>{const a={address:r.address,array:r.array,bool:r.bool,bytes:r.bytes,fixedBytes:r.fixedBytes,function:r.fn,number:r.number,string:r.string,tuple:r.tuple},t=a[e];if(t)return t;const c=Object.values(a).find((a=>a.isType(e)));if(c)return c;throw new f.ParserError(`The type "${e}" is not supported.`)},a.isDynamicParser=(e,a)=>{const{isDynamic:t}=e;return"function"==typeof t?t(a):t},a.pack=({types:e,values:t,packed:d=!1,tight:r=!1,arrayPacked:i=!1,byteArray:b=new Uint8Array})=>{(0,c.assert)(e.length===t.length,new f.ParserError(`The number of types (${e.length}) does not match the number of values (${t.length}).`));const{staticBuffer:o,dynamicBuffer:s,pointers:l}=e.reduce((({staticBuffer:e,dynamicBuffer:f,pointers:n},b,o)=>{const s=(0,a.getParser)(b),l=t[o];return d||i||!(0,a.isDynamicParser)(s,b)?{staticBuffer:s.encode({buffer:e,value:l,type:b,packed:d,tight:r}),dynamicBuffer:f,pointers:n}:{staticBuffer:(0,c.concatBytes)([e,new Uint8Array(32)]),dynamicBuffer:s.encode({buffer:f,value:l,type:b,packed:d,tight:r}),pointers:[...n,{position:e.length,pointer:f.length}]}}),{staticBuffer:new Uint8Array,dynamicBuffer:new Uint8Array,pointers:[]});(0,c.assert)(!d&&!i||0===s.length,new f.ParserError("Invalid pack state."));const u=o.length,h=l.reduce(((e,{pointer:a,position:t})=>{const f=(0,n.padStart)((0,c.numberToBytes)(u+a));return(0,n.set)(e,f,t)}),o);return(0,c.concatBytes)([b,h,s])},a.unpack=(e,t)=>{const r=(0,d.iterate)(t);return e.map((e=>{const{value:{value:d,skip:n},done:i}=r.next();(0,c.assert)(!i,new f.ParserError(`The encoded value is invalid for the provided types. Reached end of buffer while attempting to parse "${e}".`));const b=(0,a.getParser)(e);if((0,a.isDynamicParser)(b,e)){const a=(0,c.bytesToNumber)(d.subarray(0,32)),f=t.subarray(a);return b.decode({type:e,value:f,skip:n})}return b.decode({type:e,value:d,skip:n})}))}},91563:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.address=a.getAddress=void 0;const c=t(52367),f=t(5961),d=t(26365);a.getAddress=e=>{const a=(0,c.createBytes)(e);return(0,c.assert)(a.length<=20,new f.ParserError(`Invalid address value. Expected address to be 20 bytes long, but received ${a.length} bytes.`)),(0,d.padStart)(a,20)},a.address={isDynamic:!1,isType:e=>"address"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:f}){const r=(0,a.getAddress)(t);if(f)return(0,c.concatBytes)([e,r]);const n=(0,d.padStart)(r);return(0,c.concatBytes)([e,n])},decode:({value:e})=>(0,c.add0x)((0,c.bytesToHex)(e.slice(12,32)))}},186:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.array=a.getTupleType=a.getArrayType=a.isArrayType=void 0;const c=t(52367),f=t(5961),d=t(37700),r=t(26365),n=t(83415),i=t(30717),b=/^(?.*)\[(?\d*?)\]$/u;a.isArrayType=e=>b.test(e),a.getArrayType=e=>{const a=e.match(b);return(0,c.assert)(a?.groups?.type,new f.ParserError(`Invalid array type. Expected an array type, but received "${e}".`)),[a.groups.type,a.groups.length?parseInt(a.groups.length,10):void 0]},a.getTupleType=(e,a)=>`(${new Array(a).fill(e).join(",")})`,a.array={isDynamic(e){const[t,c]=(0,a.getArrayType)(e);return void 0===c||(0,d.isDynamicParser)((0,d.getParser)(t),t)},isType:e=>(0,a.isArrayType)(e),getByteLength(e){(0,c.assert)((0,a.isArrayType)(e),new f.ParserError(`Expected an array type, but received "${e}".`));const[t,r]=(0,a.getArrayType)(e);return(0,d.isDynamicParser)(this,e)||void 0===r?32:i.tuple.getByteLength((0,a.getTupleType)(t,r))},encode({type:e,buffer:t,value:b,packed:o,tight:s}){const[l,u]=(0,a.getArrayType)(e);if((0,c.assert)(!o||!(0,a.isArrayType)(l),new f.ParserError("Cannot pack nested arrays.")),o&&(0,d.isDynamicParser)((0,d.getParser)(l),l))return(0,d.pack)({types:new Array(b.length).fill(l),values:b,byteArray:t,packed:o,arrayPacked:!0,tight:s});if(u)return(0,c.assert)(u===b.length,new f.ParserError(`Array length does not match type length. Expected a length of ${u}, but received ${b.length}.`)),i.tuple.encode({type:(0,a.getTupleType)(l,u),buffer:t,value:b,packed:n.fixedBytes.isType(l)&&s,tight:s});if(o)return(0,d.pack)({types:new Array(b.length).fill(l),values:b,byteArray:t,packed:n.fixedBytes.isType(l)&&s,arrayPacked:!0,tight:s});const h=(0,r.padStart)((0,c.numberToBytes)(b.length));return(0,d.pack)({types:new Array(b.length).fill(l),values:b,byteArray:(0,c.concatBytes)([t,h]),packed:o,tight:s})},decode({type:e,value:t,...r}){const[n,b]=(0,a.getArrayType)(e);if(b){const e=i.tuple.decode({type:(0,a.getTupleType)(n,b),value:t,...r});return(0,c.assert)(e.length===b,new f.ParserError(`Array length does not match type length. Expected a length of ${b}, but received ${e.length}.`)),e}const o=(0,c.bytesToNumber)(t.subarray(0,32));return(0,d.unpack)(new Array(o).fill(n),t.subarray(32))}}},47435:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.bool=a.getBooleanValue=void 0;const c=t(35620),f=t(52367),d=t(5961),r=t(6150),n=(0,c.coerce)((0,c.boolean)(),(0,c.union)([(0,c.literal)("true"),(0,c.literal)("false")]),(e=>"true"===e));a.getBooleanValue=e=>{try{return(0,c.create)(e,n)?BigInt(1):BigInt(0)}catch{throw new d.ParserError(`Invalid boolean value. Expected a boolean literal, or the string "true" or "false", but received "${e}".`)}},a.bool={isDynamic:!1,isType:e=>"bool"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:c,tight:d}){const n=(0,a.getBooleanValue)(t);return c?(0,f.concatBytes)([e,(0,f.bigIntToBytes)(n)]):r.number.encode({type:"uint256",buffer:e,value:n,packed:c,tight:d})},decode:e=>r.number.decode({...e,type:"uint256"})===BigInt(1)}},99356:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.bytes=void 0;const c=t(52367),f=t(26365);a.bytes={isDynamic:!0,isType:e=>"bytes"===e,getByteLength:()=>32,encode({buffer:e,value:a,packed:t}){const d=(0,c.createBytes)(a);if(t)return(0,c.concatBytes)([e,d]);const r=32*Math.ceil(d.byteLength/32);return(0,c.concatBytes)([e,(0,f.padStart)((0,c.numberToBytes)(d.byteLength)),(0,f.padEnd)(d,r)])},decode({value:e}){const a=e.subarray(0,32),t=(0,c.bytesToNumber)(a);return e.slice(32,32+t)}}},83415:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.fixedBytes=a.getByteLength=void 0;const c=t(52367),f=t(5961),d=t(26365),r=/^bytes([0-9]{1,2})$/u;a.getByteLength=e=>{const a=e.match(r)?.[1];(0,c.assert)(a,`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`);const t=Number(a);return(0,c.assert)(t>0&&t<=32,new f.ParserError(`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`)),t},a.fixedBytes={isDynamic:!1,isType:e=>r.test(e),getByteLength:()=>32,encode({type:e,buffer:t,value:r,packed:n}){const i=(0,a.getByteLength)(e),b=(0,c.createBytes)(r);return(0,c.assert)(b.length<=i,new f.ParserError(`Expected a value of length ${i}, but received a value of length ${b.length}.`)),n?(0,c.concatBytes)([t,(0,d.padEnd)(b,i)]):(0,c.concatBytes)([t,(0,d.padEnd)(b)])},decode({type:e,value:t}){const c=(0,a.getByteLength)(e);return t.slice(0,c)}}},27827:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.fn=a.getFunction=void 0;const c=t(35620),f=t(52367),d=t(5961),r=t(83415),n=(0,c.coerce)((0,c.object)({address:f.StrictHexStruct,selector:f.StrictHexStruct}),(0,c.union)([f.StrictHexStruct,(0,c.instance)(Uint8Array)]),(e=>{const a=(0,f.createBytes)(e);return(0,f.assert)(24===a.length,new d.ParserError(`Invalid Solidity function. Expected function to be 24 bytes long, but received ${a.length} bytes.`)),{address:(0,f.bytesToHex)(a.subarray(0,20)),selector:(0,f.bytesToHex)(a.subarray(20,24))}}));a.getFunction=e=>{const a=(0,c.create)(e,n);return(0,f.concatBytes)([(0,f.hexToBytes)(a.address),(0,f.hexToBytes)(a.selector)])},a.fn={isDynamic:!1,isType:e=>"function"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:c,tight:f}){const d=(0,a.getFunction)(t);return r.fixedBytes.encode({type:"bytes24",buffer:e,value:d,packed:c,tight:f})},decode:({value:e})=>({address:(0,f.bytesToHex)(e.slice(0,20)),selector:(0,f.bytesToHex)(e.slice(20,24))})}},46207:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(91563),a),f(t(186),a),f(t(47435),a),f(t(99356),a),f(t(83415),a),f(t(27827),a),f(t(6150),a),f(t(28160),a),f(t(8446),a),f(t(30717),a)},6150:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.number=a.getBigInt=a.assertNumberLength=a.getLength=a.isSigned=void 0;const c=t(52367),f=t(5961),d=t(26365),r=/^u?int(?[0-9]*)?$/u;a.isSigned=e=>!e.startsWith("u"),a.getLength=e=>{if("int"===e||"uint"===e)return 256;const a=e.match(r);(0,c.assert)(a?.groups?.length,new f.ParserError(`Invalid number type. Expected a number type, but received "${e}".`));const t=parseInt(a.groups.length,10);return(0,c.assert)(t>=8&&t<=256,new f.ParserError(`Invalid number length. Expected a number between 8 and 256, but received "${e}".`)),(0,c.assert)(t%8==0,new f.ParserError(`Invalid number length. Expected a multiple of 8, but received "${e}".`)),t},a.assertNumberLength=(e,t)=>{const d=(0,a.getLength)(t),r=BigInt(2)**BigInt(d-((0,a.isSigned)(t)?1:0))-BigInt(1);(0,a.isSigned)(t)?(0,c.assert)(e>=-(r+BigInt(1))&&e<=r,new f.ParserError(`Number "${e}" is out of range for type "${t}".`)):(0,c.assert)(e<=r,new f.ParserError(`Number "${e}" is out of range for type "${t}".`))},a.getBigInt=e=>{try{return(0,c.createBigInt)(e)}catch{throw new f.ParserError(`Invalid number. Expected a valid number value, but received "${e}".`)}},a.number={isDynamic:!1,isType:e=>r.test(e),getByteLength:()=>32,encode({type:e,buffer:t,value:f,packed:r}){const n=(0,a.getBigInt)(f);if((0,a.assertNumberLength)(n,e),(0,a.isSigned)(e)){if(r){const f=(0,a.getLength)(e)/8;return(0,c.concatBytes)([t,(0,c.signedBigIntToBytes)(n,f)])}return(0,c.concatBytes)([t,(0,d.padStart)((0,c.signedBigIntToBytes)(n,32))])}if(r){const f=(0,a.getLength)(e)/8;return(0,c.concatBytes)([t,(0,d.padStart)((0,c.bigIntToBytes)(n),f)])}return(0,c.concatBytes)([t,(0,d.padStart)((0,c.bigIntToBytes)(n))])},decode({type:e,value:t}){const f=t.subarray(0,32);if((0,a.isSigned)(e)){const t=(0,c.bytesToSignedBigInt)(f);return(0,a.assertNumberLength)(t,e),t}const d=(0,c.bytesToBigInt)(f);return(0,a.assertNumberLength)(d,e),d}}},28160:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},8446:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.string=void 0;const c=t(52367),f=t(99356);a.string={isDynamic:!0,isType:e=>"string"===e,getByteLength:()=>32,encode:({buffer:e,value:a,packed:t,tight:d})=>f.bytes.encode({type:"bytes",buffer:e,value:(0,c.stringToBytes)(a),packed:t,tight:d}),decode:e=>(0,c.bytesToString)(f.bytes.decode(e))}},30717:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.tuple=a.getTupleElements=void 0;const c=t(52367),f=t(5961),d=t(37700),r=/^\((.+)\)$/u;a.getTupleElements=e=>{(0,c.assert)(e.startsWith("(")&&e.endsWith(")"),new f.ParserError(`Invalid tuple type. Expected tuple type, but received "${e}".`));const a=[];let t="",d=0;for(let c=1;c(0,a.getTupleElements)(e).some((e=>{const a=(0,d.getParser)(e);return(0,d.isDynamicParser)(a,e)})),isType:e=>(e=>r.test(e))(e),getByteLength(e){return(0,d.isDynamicParser)(this,e)?32:(0,a.getTupleElements)(e).reduce(((e,a)=>e+(0,d.getParser)(a).getByteLength(a)),0)},encode({type:e,buffer:t,value:c,packed:f,tight:r}){const n=(0,a.getTupleElements)(e);return(0,d.pack)({types:n,values:c,byteArray:t,packed:f,tight:r})},decode({type:e,value:t,skip:c}){const f=(0,a.getTupleElements)(e);return c(this.getByteLength(e)-32),(0,d.unpack)(f,t)}}},15744:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},11126:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(15744),a)},59194:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.padEnd=a.padStart=a.set=void 0;const c=t(52367);a.set=(e,a,t)=>(0,c.concatBytes)([e.subarray(0,t),a,e.subarray(t+a.length)]),a.padStart=(e,a=32)=>{const t=new Uint8Array(Math.max(a-e.length,0)).fill(0);return(0,c.concatBytes)([t,e])},a.padEnd=(e,a=32)=>{const t=new Uint8Array(Math.max(a-e.length,0)).fill(0);return(0,c.concatBytes)([e,t])}},26365:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(59194),a)},98537:function(e,a,t){"use strict";var c=t(48287).Buffer,f=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),d=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&f(a,e,t);return d(a,e),a};Object.defineProperty(a,"__esModule",{value:!0}),a.getEncryptionPublicKey=a.decryptSafely=a.decrypt=a.encryptSafely=a.encrypt=void 0;const n=t(63203),i=r(t(88947)),b=t(54907);function o({publicKey:e,data:a,version:t}){if((0,b.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,b.isNullish)(a))throw new Error("Missing data parameter");if((0,b.isNullish)(t))throw new Error("Missing version parameter");if("x25519-xsalsa20-poly1305"===t){if("string"!=typeof a)throw new Error("Message data must be given as a string");const t=i.box.keyPair();let c;try{c=n.base64.decode(e)}catch(e){throw new Error("Bad public key")}const f=n.utf8.decode(a),d=i.randomBytes(i.box.nonceLength),r=i.box(f,d,c,t.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:n.base64.encode(d),ephemPublicKey:n.base64.encode(t.publicKey),ciphertext:n.base64.encode(r)}}throw new Error("Encryption type/version not supported")}function s({encryptedData:e,privateKey:a}){if((0,b.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,b.isNullish)(a))throw new Error("Missing privateKey parameter");if("x25519-xsalsa20-poly1305"===e.version){const t=c.from(a,"hex"),f=i.box.keyPair.fromSecretKey(t).secretKey,d=n.base64.decode(e.nonce),r=n.base64.decode(e.ciphertext),b=n.base64.decode(e.ephemPublicKey),o=i.box.open(r,d,b,f);try{if(!o)throw new Error;const e=n.utf8.encode(o);if(!e)throw new Error;return e}catch(e){if(e&&"string"==typeof e.message&&e.message.length)throw new Error(`Decryption failed: ${e.message}`);throw new Error("Decryption failed.")}}throw new Error("Encryption type/version not supported.")}a.encrypt=o,a.encryptSafely=function({publicKey:e,data:a,version:t}){if((0,b.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,b.isNullish)(a))throw new Error("Missing data parameter");if((0,b.isNullish)(t))throw new Error("Missing version parameter");if("object"==typeof a&&a&&"toJSON"in a)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const f={data:a,padding:""},d=c.byteLength(JSON.stringify(f),"utf-8")%2048;let r=0;return d>0&&(r=2048-d-16),f.padding="0".repeat(r),o({publicKey:e,data:JSON.stringify(f),version:t})},a.decrypt=s,a.decryptSafely=function({encryptedData:e,privateKey:a}){if((0,b.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,b.isNullish)(a))throw new Error("Missing privateKey parameter");return JSON.parse(s({encryptedData:e,privateKey:a})).data},a.getEncryptionPublicKey=function(e){const a=c.from(e,"hex"),t=i.box.keyPair.fromSecretKey(a).publicKey;return n.base64.encode(t)}},51594:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),a.normalize=a.concatSig=void 0,f(t(20252),a),f(t(10169),a),f(t(98537),a);var d=t(54907);Object.defineProperty(a,"concatSig",{enumerable:!0,get:function(){return d.concatSig}}),Object.defineProperty(a,"normalize",{enumerable:!0,get:function(){return d.normalize}})},20252:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extractPublicKey=a.recoverPersonalSignature=a.personalSign=void 0;const c=t(68683),f=t(54907);function d(e,a){const t=(0,c.hashPersonalMessage)((0,f.legacyToBuffer)(e));return(0,f.recoverPublicKey)(t,a)}a.personalSign=function({privateKey:e,data:a}){if((0,f.isNullish)(a))throw new Error("Missing data parameter");if((0,f.isNullish)(e))throw new Error("Missing privateKey parameter");const t=(0,f.legacyToBuffer)(a),d=(0,c.hashPersonalMessage)(t),r=(0,c.ecsign)(d,e);return(0,f.concatSig)((0,c.toBuffer)(r.v),r.r,r.s)},a.recoverPersonalSignature=function({data:e,signature:a}){if((0,f.isNullish)(e))throw new Error("Missing data parameter");if((0,f.isNullish)(a))throw new Error("Missing signature parameter");const t=d(e,a),r=(0,c.publicToAddress)(t);return(0,c.bufferToHex)(r)},a.extractPublicKey=function({data:e,signature:a}){if((0,f.isNullish)(e))throw new Error("Missing data parameter");if((0,f.isNullish)(a))throw new Error("Missing signature parameter");return`0x${d(e,a).toString("hex")}`}},10169:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.recoverTypedSignature=a.signTypedData=a.typedSignatureHash=a.TypedDataUtils=a.TYPED_MESSAGE_SCHEMA=a.SignTypedDataVersion=void 0;const c=t(68683),f=t(93256),d=t(46207),r=t(26365),n=t(52367),i=t(32019),b=t(54907);var o;function s(e,a){if(!Object.keys(o).includes(e))throw new Error(`Invalid version: '${e}'`);if(a&&!a.includes(e))throw new Error(`SignTypedDataVersion not allowed: '${e}'. Allowed versions are: ${a.join(", ")}`)}function l(e,a){(0,n.assert)(null!==a,`Unable to encode value: Invalid number. Expected a valid number value, but received "${a}".`);const t=BigInt(a),c=(0,d.getLength)(e),f=BigInt(2)**BigInt(c)-BigInt(1);return(0,n.assert)(t>=-f&&t<=f,`Unable to encode value: Number "${a}" is out of range for type "${e}".`),t}function u(e){let a=BigInt(0);for(let t=0;t=49?c-BigInt(49)+BigInt(10):c>=17?c-BigInt(17)+BigInt(10):c}return(0,r.padStart)((0,n.bigIntToBytes)(a),20)}function h(e,a,t,d,b){if(s(b,[o.V3,o.V4]),void 0!==e[t])return["bytes32",b===o.V4&&null==d?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,c.arrToBufArr)((0,i.keccak256)(p(t,d,e,b)))];if("function"===t)throw new Error('Unsupported or invalid type: "function"');if(void 0===d)throw new Error(`missing value for field ${a} of type ${t}`);if("address"===t){if("number"==typeof d)return["address",(0,r.padStart)((0,n.numberToBytes)(d),20)];if((0,n.isStrictHexString)(d))return["address",(0,n.add0x)(d)];if("string"==typeof d)return["address",u(d).subarray(0,20)]}if("bool"===t)return["bool",Boolean(d)];if("bytes"===t)return"number"==typeof d?d=(0,n.numberToBytes)(d):(0,n.isStrictHexString)(d)||"0x"===d?d=(0,n.hexToBytes)(d):"string"==typeof d&&(d=(0,n.stringToBytes)(d)),["bytes32",(0,c.arrToBufArr)((0,i.keccak256)(d))];if(t.startsWith("bytes")&&"bytes"!==t&&!t.includes("["))return"number"==typeof d?d<0?["bytes32",new Uint8Array(32)]:["bytes32",(0,n.bigIntToBytes)(BigInt(d))]:(0,n.isStrictHexString)(d)?["bytes32",(0,n.hexToBytes)(d)]:["bytes32",d];if(t.startsWith("int")&&!t.includes("[")){const e=l(t,d);return e>=BigInt(0)?["uint256",e]:["int256",e]}if("string"===t)return d="number"==typeof d?(0,n.numberToBytes)(d):(0,n.stringToBytes)(null!=d?d:""),["bytes32",(0,c.arrToBufArr)((0,i.keccak256)(d))];if(t.endsWith("]")){if(b===o.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const r=t.slice(0,t.lastIndexOf("[")),n=d.map((t=>h(e,a,r,t,b)));return["bytes32",(0,c.arrToBufArr)((0,i.keccak256)((0,f.encode)(n.map((([e])=>e)),n.map((([,e])=>e)))))]}return[t,d]}function p(e,a,t,d){s(d,[o.V3,o.V4]);const r=["bytes32"],n=[y(e,t)];for(const c of t[e]){if(d===o.V3&&void 0===a[c.name])continue;const[e,f]=h(t,c.name,c.type,a[c.name],d);r.push(e),n.push(f)}return(0,c.arrToBufArr)((0,f.encode)(r,n))}function g(e,a){let t="";const c=m(e,a);c.delete(e);const f=[e,...Array.from(c).sort()];for(const e of f){if(!a[e])throw new Error(`No type definition specified: ${e}`);t+=`${e}(${a[e].map((({name:e,type:a})=>`${a} ${e}`)).join(",")})`}return t}function m(e,a,t=new Set){if("string"!=typeof e)throw new Error(`Invalid findTypeDependencies input ${JSON.stringify(e)}`);const c=e.match(/^\w*/u);if([e]=c,t.has(e)||void 0===a[e])return t;t.add(e);for(const c of a[e])m(c.type,a,t);return t}function x(e,a,t,f){s(f,[o.V3,o.V4]);const d=p(e,a,t,f),r=(0,i.keccak256)(d);return(0,c.arrToBufArr)(r)}function y(e,a){const t=(0,n.stringToBytes)(g(e,a));return(0,c.arrToBufArr)((0,i.keccak256)(t))}function A(e){const t={};for(const c in a.TYPED_MESSAGE_SCHEMA.properties)e[c]&&(t[c]=e[c]);return"types"in t&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t}function v(e,a){s(a,[o.V3,o.V4]);const t=A(e),{domain:c}=t;return x("EIP712Domain",c,{EIP712Domain:t.types.EIP712Domain},a)}function w(e,a){if((0,d.isArrayType)(e)&&Array.isArray(a)){const[t]=(0,d.getArrayType)(e);return a.map((e=>w(t,e)))}if("address"===e){if("number"==typeof a)return(0,r.padStart)((0,n.numberToBytes)(a),20);if((0,n.isStrictHexString)(a))return(0,r.padStart)((0,n.hexToBytes)(a).subarray(0,20),20);if(a instanceof Uint8Array)return(0,r.padStart)(a.subarray(0,20),20)}if("bool"===e)return Boolean(a);if(e.startsWith("bytes")&&"bytes"!==e){const t=(0,d.getByteLength)(e);if("number"==typeof a)return a<0?new Uint8Array:(0,n.numberToBytes)(a).subarray(0,t);if((0,n.isStrictHexString)(a))return(0,n.hexToBytes)(a).subarray(0,t);if(a instanceof Uint8Array)return a.subarray(0,t)}if(e.startsWith("uint")&&"number"==typeof a)return Math.abs(a);if(e.startsWith("int")&&"number"==typeof a){const t=(0,d.getLength)(e);return BigInt.asIntN(t,BigInt(a))}return a}function _(e,a){return a.map((a=>{if("string"==typeof a||"number"==typeof a||"bigint"==typeof a){const t=l(e,a);if(t>=BigInt(0))return(0,r.padStart)((0,n.bigIntToBytes)(t),32);const c=(0,d.getLength)(e),f=BigInt.asIntN(c,t);return(0,n.signedBigIntToBytes)(f,32)}return a}))}function I(e){const a=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!("length"in e)||!e.length)throw a;const t=e.map((({name:e,type:a,value:t})=>{if("address[]"===a)return{name:e,type:"bytes32[]",value:(c=t,c.map((e=>"number"==typeof e?(0,r.padStart)((0,n.numberToBytes)(e),32):(0,n.isStrictHexString)(e)?(0,r.padStart)((0,n.hexToBytes)(e).subarray(0,32),32):e instanceof Uint8Array?(0,r.padStart)(e.subarray(0,32),32):e)))};var c;if(a.startsWith("int")&&(0,d.isArrayType)(a)){const[c,f]=(0,d.getArrayType)(a);return{name:e,type:`bytes32[${null!=f?f:""}]`,value:_(c,t)}}return{name:e,type:a,value:w(a,t)}})),o=t.map((e=>"bytes"!==e.type?e.value:(0,b.legacyToBuffer)(e.value))),s=t.map((e=>{if("function"===e.type)throw new Error('Unsupported or invalid type: "function"');return e.type})),l=e.map((e=>{if(!e.name)throw a;return`${e.type} ${e.name}`}));return(0,c.arrToBufArr)((0,i.keccak256)((0,f.encodePacked)(["bytes32","bytes32"],[(0,i.keccak256)((0,f.encodePacked)(["string[]"],[l],!0)),(0,i.keccak256)((0,f.encodePacked)(s,o,!0))])))}!function(e){e.V1="V1",e.V3="V3",e.V4="V4"}(o=a.SignTypedDataVersion||(a.SignTypedDataVersion={})),a.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"]},a.TypedDataUtils={encodeData:p,encodeType:g,findTypeDependencies:m,hashStruct:x,hashType:y,sanitizeData:A,eip712Hash:function(e,a){s(a,[o.V3,o.V4]);const t=A(e),f=[(0,n.hexToBytes)("1901")];return f.push(v(e,a)),"EIP712Domain"!==t.primaryType&&f.push(x(t.primaryType,t.message,t.types,a)),(0,c.arrToBufArr)((0,i.keccak256)((0,n.concatBytes)(f)))},eip712DomainHash:v},a.typedSignatureHash=function(e){const a=I(e);return(0,n.bytesToHex)(a)},a.signTypedData=function({privateKey:e,data:t,version:f}){if(s(f),(0,b.isNullish)(t))throw new Error("Missing data parameter");if((0,b.isNullish)(e))throw new Error("Missing private key parameter");const d=f===o.V1?I(t):a.TypedDataUtils.eip712Hash(t,f),r=(0,c.ecsign)(d,e);return(0,b.concatSig)((0,c.arrToBufArr)((0,n.bigIntToBytes)(r.v)),r.r,r.s)},a.recoverTypedSignature=function({data:e,signature:t,version:f}){if(s(f),(0,b.isNullish)(e))throw new Error("Missing data parameter");if((0,b.isNullish)(t))throw new Error("Missing signature parameter");const d=f===o.V1?I(e):a.TypedDataUtils.eip712Hash(e,f),r=(0,b.recoverPublicKey)(d,t),i=(0,c.publicToAddress)(r);return(0,n.bytesToHex)(i)}},54907:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.normalize=a.recoverPublicKey=a.concatSig=a.legacyToBuffer=a.isNullish=a.padWithZeroes=void 0;const f=t(68683),d=t(52367);function r(e,a){if(""!==e&&!/^[a-f0-9]+$/iu.test(e))throw new Error(`Expected an unprefixed hex string. Received: ${e}`);if(a<0)throw new Error(`Expected a non-negative integer target length. Received: ${a}`);return String.prototype.padStart.call(e,a,"0")}function n(e){return null==e}a.padWithZeroes=r,a.isNullish=n,a.legacyToBuffer=function(e){return"string"!=typeof e||(0,f.isHexString)(e)?(0,f.toBuffer)(e):c.from(e)},a.concatSig=function(e,a,t){const c=(0,f.fromSigned)(a),n=(0,f.fromSigned)(t),i=(0,f.bufferToInt)(e),b=r((0,f.toUnsigned)(c).toString("hex"),64),o=r((0,f.toUnsigned)(n).toString("hex"),64),s=(0,d.remove0x)((0,d.numberToHex)(i));return(0,d.add0x)(b.concat(o,s))},a.recoverPublicKey=function(e,a){const t=(0,f.fromRpcSig)(a);return(0,f.ecrecover)(e,t.v,t.r,t.s)},a.normalize=function(e){if(!n(e)){if("number"==typeof e){if(e<0)return"0x";const a=(0,d.numberToBytes)(e);e=(0,d.bytesToHex)(a)}if("string"!=typeof e){let a="eth-sig-util.normalize() requires hex string or integer input.";throw a+=` received ${typeof e}: ${e}`,new Error(a)}return(0,d.add0x)(e.toLowerCase())}}},82102:(e,a)=>{"use strict";function t(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function c(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function f(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function d(e,...a){if(!f(e))throw new Error("Uint8Array expected");if(a.length>0&&!a.includes(e.length))throw new Error(`Uint8Array expected of length ${a}, not of length=${e.length}`)}function r(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");t(e.outputLen),t(e.blockLen)}function n(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function i(e,a){d(e);const t=a.outputLen;if(e.length{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.add5L=a.add5H=a.add4H=a.add4L=a.add3H=a.add3L=a.rotlBL=a.rotlBH=a.rotlSL=a.rotlSH=a.rotr32L=a.rotr32H=a.rotrBL=a.rotrBH=a.rotrSL=a.rotrSH=a.shrSL=a.shrSH=a.toBig=void 0,a.fromBig=f,a.split=d,a.add=y;const t=BigInt(2**32-1),c=BigInt(32);function f(e,a=!1){return a?{h:Number(e&t),l:Number(e>>c&t)}:{h:0|Number(e>>c&t),l:0|Number(e&t)}}function d(e,a=!1){let t=new Uint32Array(e.length),c=new Uint32Array(e.length);for(let d=0;dBigInt(e>>>0)<>>0);a.toBig=r;const n=(e,a,t)=>e>>>t;a.shrSH=n;const i=(e,a,t)=>e<<32-t|a>>>t;a.shrSL=i;const b=(e,a,t)=>e>>>t|a<<32-t;a.rotrSH=b;const o=(e,a,t)=>e<<32-t|a>>>t;a.rotrSL=o;const s=(e,a,t)=>e<<64-t|a>>>t-32;a.rotrBH=s;const l=(e,a,t)=>e>>>t-32|a<<64-t;a.rotrBL=l;const u=(e,a)=>a;a.rotr32H=u;const h=(e,a)=>e;a.rotr32L=h;const p=(e,a,t)=>e<>>32-t;a.rotlSH=p;const g=(e,a,t)=>a<>>32-t;a.rotlSL=g;const m=(e,a,t)=>a<>>64-t;a.rotlBH=m;const x=(e,a,t)=>e<>>64-t;function y(e,a,t,c){const f=(a>>>0)+(c>>>0);return{h:e+t+(f/2**32|0)|0,l:0|f}}a.rotlBL=x;const A=(e,a,t)=>(e>>>0)+(a>>>0)+(t>>>0);a.add3L=A;const v=(e,a,t,c)=>a+t+c+(e/2**32|0)|0;a.add3H=v;const w=(e,a,t,c)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0);a.add4L=w;const _=(e,a,t,c,f)=>a+t+c+f+(e/2**32|0)|0;a.add4H=_;const I=(e,a,t,c,f)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0)+(f>>>0);a.add5L=I;const E=(e,a,t,c,f,d)=>a+t+c+f+d+(e/2**32|0)|0;a.add5H=E;const C={fromBig:f,split:d,toBig:r,shrSH:n,shrSL:i,rotrSH:b,rotrSL:o,rotrBH:s,rotrBL:l,rotr32H:u,rotr32L:h,rotlSH:p,rotlSL:g,rotlBH:m,rotlBL:x,add:y,add3L:A,add3H:v,add4L:w,add4H:_,add5H:E,add5L:I};a.default=C},6256:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.crypto=void 0,a.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},2214:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.shake256=a.shake128=a.keccak_512=a.keccak_384=a.keccak_256=a.keccak_224=a.sha3_512=a.sha3_384=a.sha3_256=a.sha3_224=a.Keccak=void 0,a.keccakP=y;const c=t(82102),f=t(17335),d=t(79520),r=[],n=[],i=[],b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(7),u=BigInt(256),h=BigInt(113);for(let e=0,a=o,t=1,c=0;e<24;e++){[t,c]=[c,(2*t+3*c)%5],r.push(2*(5*c+t)),n.push((e+1)*(e+2)/2%64);let f=b;for(let e=0;e<7;e++)a=(a<>l)*h)%u,a&s&&(f^=o<<(o<t>32?(0,f.rotlBH)(e,a,t):(0,f.rotlSH)(e,a,t),x=(e,a,t)=>t>32?(0,f.rotlBL)(e,a,t):(0,f.rotlSL)(e,a,t);function y(e,a=24){const t=new Uint32Array(10);for(let c=24-a;c<24;c++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const c=(a+8)%10,f=(a+2)%10,d=t[f],r=t[f+1],n=m(d,r,1)^t[c],i=x(d,r,1)^t[c+1];for(let t=0;t<50;t+=10)e[a+t]^=n,e[a+t+1]^=i}let a=e[2],f=e[3];for(let t=0;t<24;t++){const c=n[t],d=m(a,f,c),i=x(a,f,c),b=r[t];a=e[b],f=e[b+1],e[b]=d,e[b+1]=i}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)t[c]=e[a+c];for(let c=0;c<10;c++)e[a+c]^=~t[(c+2)%10]&t[(c+4)%10]}e[0]^=p[c],e[1]^=g[c]}t.fill(0)}class A extends d.Hash{constructor(e,a,t,f=!1,r=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=t,this.enableXOF=f,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,c.number)(t),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,d.u32)(this.state)}keccak(){d.isLE||(0,d.byteSwap32)(this.state32),y(this.state32,this.rounds),d.isLE||(0,d.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,c.exists)(this);const{blockLen:a,state:t}=this,f=(e=(0,d.toBytes)(e)).length;for(let c=0;c=t&&this.keccak();const d=Math.min(t-this.posOut,f-c);e.set(a.subarray(this.posOut,this.posOut+d),c),this.posOut+=d,c+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,c.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,c.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:t,outputLen:c,rounds:f,enableXOF:d}=this;return e||(e=new A(a,t,c,d,f)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=f,e.suffix=t,e.outputLen=c,e.enableXOF=d,e.destroyed=this.destroyed,e}}a.Keccak=A;const v=(e,a,t)=>(0,d.wrapConstructor)((()=>new A(a,e,t)));a.sha3_224=v(6,144,28),a.sha3_256=v(6,136,32),a.sha3_384=v(6,104,48),a.sha3_512=v(6,72,64),a.keccak_224=v(1,144,28),a.keccak_256=v(1,136,32),a.keccak_384=v(1,104,48),a.keccak_512=v(1,72,64);const w=(e,a,t)=>(0,d.wrapXOFConstructorWithOpts)(((c={})=>new A(a,e,void 0===c.dkLen?t:c.dkLen,!0)));a.shake128=w(31,168,16),a.shake256=w(31,136,32)},79520:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Hash=a.nextTick=a.byteSwapIfBE=a.byteSwap=a.isLE=a.rotl=a.rotr=a.createView=a.u32=a.u8=void 0,a.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name},a.byteSwap32=function(e){for(let t=0;t=0&&ee().update(b(a)).digest(),t=e();return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=()=>e(),a},a.wrapConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(b(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.wrapXOFConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(b(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.randomBytes=function(e=32){if(c.crypto&&"function"==typeof c.crypto.getRandomValues)return c.crypto.getRandomValues(new Uint8Array(e));if(c.crypto&&"function"==typeof c.crypto.randomBytes)return c.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const c=t(6256),f=t(82102);a.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),a.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),a.rotr=(e,a)=>e<<32-a|e>>>a,a.rotl=(e,a)=>e<>>32-a>>>0,a.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],a.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,a.byteSwapIfBE=a.isLE?e=>e:e=>(0,a.byteSwap)(e);const d=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0"))),r={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function n(e){return e>=r._0&&e<=r._9?e-r._0:e>=r._A&&e<=r._F?e-(r._A-10):e>=r._a&&e<=r._f?e-(r._a-10):void 0}function i(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function b(e){return"string"==typeof e&&(e=i(e)),(0,f.bytes)(e),e}a.nextTick=async()=>{},a.Hash=class{clone(){return this._cloneInto()}};const o={}.toString},73562:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getHash=r,a.createCurve=function(e,a){const t=a=>(0,d.weierstrass)({...e,...r(a)});return Object.freeze({...t(a),create:t})};const c=t(39615),f=t(99175),d=t(91705);function r(e){return{hash:e,hmac:(a,...t)=>(0,c.hmac)(e,a,(0,f.concatBytes)(...t)),randomBytes:f.randomBytes}}},62422:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.wNAF=function(e,a){const t=(e,a)=>{const t=a.negate();return e?t:a},c=e=>({windows:Math.ceil(a/e)+1,windowSize:2**(e-1)});return{constTimeNegate:t,unsafeLadder(a,t){let c=e.ZERO,f=a;for(;t>d;)t&r&&(c=c.add(f)),f=f.double(),t>>=r;return c},precomputeWindow(e,a){const{windows:t,windowSize:f}=c(a),d=[];let r=e,n=r;for(let e=0;e>=u,c>i&&(c-=l,d+=r);const n=a,h=a+Math.abs(c)-1,p=e%2!=0,g=c<0;0===c?o=o.add(t(p,f[n])):b=b.add(t(g,f[h]))}return{p:b,f:o}},wNAFCached(e,a,t,c){const f=e._WINDOW_SIZE||1;let d=a.get(e);return d||(d=this.precomputeWindow(e,f),1!==f&&a.set(e,c(d))),this.wNAF(f,d,t)}}},a.validateBasic=function(e){return(0,c.validateField)(e.Fp),(0,f.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,c.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})};const c=t(24967),f=t(91484),d=BigInt(0),r=BigInt(1)},71761:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.expand_message_xmd=b,a.expand_message_xof=o,a.hash_to_field=s,a.isogenyMap=function(e,a){const t=a.map((e=>Array.from(e).reverse()));return(a,c)=>{const[f,d,r,n]=t.map((t=>t.reduce(((t,c)=>e.add(e.mul(t,a),c)))));return a=e.div(f,d),c=e.mul(c,e.div(r,n)),{x:a,y:c}}},a.createHasher=function(e,a,t){if("function"!=typeof a)throw new Error("mapToCurve() must be defined");return{hashToCurve(c,f){const d=s(c,2,{...t,DST:t.DST,...f}),r=e.fromAffine(a(d[0])),n=e.fromAffine(a(d[1])),i=r.add(n).clearCofactor();return i.assertValidity(),i},encodeToCurve(c,f){const d=s(c,1,{...t,DST:t.encodeDST,...f}),r=e.fromAffine(a(d[0])).clearCofactor();return r.assertValidity(),r},mapToCurve(t){if(!Array.isArray(t))throw new Error("mapToCurve: expected array of bigints");for(const e of t)if("bigint"!=typeof e)throw new Error(`mapToCurve: expected array of bigints, got ${e} in array`);const c=e.fromAffine(a(t)).clearCofactor();return c.assertValidity(),c}}};const c=t(24967),f=t(91484),d=f.bytesToNumberBE;function r(e,a){if(e<0||e>=1<<8*a)throw new Error(`bad I2OSP call: value=${e} length=${a}`);const t=Array.from({length:a}).fill(0);for(let c=a-1;c>=0;c--)t[c]=255&e,e>>>=8;return new Uint8Array(t)}function n(e,a){const t=new Uint8Array(e.length);for(let c=0;c255&&(a=c((0,f.concatBytes)((0,f.utf8ToBytes)("H2C-OVERSIZE-DST-"),a)));const{outputLen:d,blockLen:b}=c,o=Math.ceil(t/d);if(o>255)throw new Error("Invalid xmd length");const s=(0,f.concatBytes)(a,r(a.length,1)),l=r(0,b),u=r(t,2),h=new Array(o),p=c((0,f.concatBytes)(l,e,u,r(0,1),s));h[0]=c((0,f.concatBytes)(p,r(1,1),s));for(let e=1;e<=o;e++){const a=[n(p,h[e-1]),r(e+1,1),s];h[e]=c((0,f.concatBytes)(...a))}return(0,f.concatBytes)(...h).slice(0,t)}function o(e,a,t,c,d){if((0,f.abytes)(e),(0,f.abytes)(a),i(t),a.length>255){const e=Math.ceil(2*c/8);a=d.create({dkLen:e}).update((0,f.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(a).digest()}if(t>65535||a.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return d.create({dkLen:t}).update(e).update(r(t,2)).update(a).update(r(a.length,1)).digest()}function s(e,a,t){(0,f.validateObject)(t,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:r,k:n,m:s,hash:l,expand:u,DST:h}=t;(0,f.abytes)(e),i(a);const p="string"==typeof h?(0,f.utf8ToBytes)(h):h,g=r.toString(2).length,m=Math.ceil((g+n)/8),x=a*s*m;let y;if("xmd"===u)y=b(e,p,x,l);else if("xof"===u)y=o(e,p,x,n,l);else{if("_internal_pass"!==u)throw new Error('expand must be "xmd" or "xof"');y=e}const A=new Array(a);for(let e=0;e{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.isNegativeLE=void 0,a.mod=s,a.pow=l,a.pow2=function(e,a,t){let c=e;for(;a-- >f;)c*=c,c%=t;return c},a.invert=u,a.tonelliShanks=h,a.FpSqrt=p,a.validateField=function(e){const a=g.reduce(((e,a)=>(e[a]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,c.validateObject)(e,a)},a.FpPow=m,a.FpInvertBatch=x,a.FpDiv=function(e,a,t){return e.mul(a,"bigint"==typeof t?u(t,e.ORDER):e.inv(t))},a.FpIsSquare=function(e){const a=(e.ORDER-d)/r;return t=>{const c=e.pow(t,a);return e.eql(c,e.ZERO)||e.eql(c,e.ONE)}},a.nLength=y,a.Field=function(e,a,t=!1,r={}){if(e<=f)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:n,nByteLength:i}=y(e,a);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const b=p(e),o=Object.freeze({ORDER:e,BITS:n,BYTES:i,MASK:(0,c.bitMask)(n),ZERO:f,ONE:d,create:a=>s(a,e),isValid:a=>{if("bigint"!=typeof a)throw new Error("Invalid field element: expected bigint, got "+typeof a);return f<=a&&ae===f,isOdd:e=>(e&d)===d,neg:a=>s(-a,e),eql:(e,a)=>e===a,sqr:a=>s(a*a,e),add:(a,t)=>s(a+t,e),sub:(a,t)=>s(a-t,e),mul:(a,t)=>s(a*t,e),pow:(e,a)=>m(o,e,a),div:(a,t)=>s(a*u(t,e),e),sqrN:e=>e*e,addN:(e,a)=>e+a,subN:(e,a)=>e-a,mulN:(e,a)=>e*a,inv:a=>u(a,e),sqrt:r.sqrt||(e=>b(o,e)),invertBatch:e=>x(o,e),cmov:(e,a,t)=>t?a:e,toBytes:e=>t?(0,c.numberToBytesLE)(e,i):(0,c.numberToBytesBE)(e,i),fromBytes:e=>{if(e.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${e.length}`);return t?(0,c.bytesToNumberLE)(e):(0,c.bytesToNumberBE)(e)}});return Object.freeze(o)},a.FpSqrtOdd=function(e,a){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const t=e.sqrt(a);return e.isOdd(t)?t:e.neg(t)},a.FpSqrtEven=function(e,a){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const t=e.sqrt(a);return e.isOdd(t)?e.neg(t):t},a.hashToPrivateScalar=function(e,a,t=!1){const f=(e=(0,c.ensureBytes)("privateHash",e)).length,r=y(a).nByteLength+8;if(r<24||f1024)throw new Error(`hashToPrivateScalar: expected ${r}-1024 bytes of input, got ${f}`);return s(t?(0,c.bytesToNumberLE)(e):(0,c.bytesToNumberBE)(e),a-d)+d},a.getFieldBytesLength=A,a.getMinHashLength=v,a.mapHashToField=function(e,a,t=!1){const f=e.length,r=A(a),n=v(a);if(f<16||f1024)throw new Error(`expected ${n}-1024 bytes of input, got ${f}`);const i=s(t?(0,c.bytesToNumberBE)(e):(0,c.bytesToNumberLE)(e),a-d)+d;return t?(0,c.numberToBytesLE)(i,r):(0,c.numberToBytesBE)(i,r)};const c=t(91484),f=BigInt(0),d=BigInt(1),r=BigInt(2),n=BigInt(3),i=BigInt(4),b=BigInt(5),o=BigInt(8);function s(e,a){const t=e%a;return t>=f?t:a+t}function l(e,a,t){if(t<=f||a 0");if(t===d)return f;let c=d;for(;a>f;)a&d&&(c=c*e%t),e=e*e%t,a>>=d;return c}function u(e,a){if(e===f||a<=f)throw new Error(`invert: expected positive integers, got n=${e} mod=${a}`);let t=s(e,a),c=a,r=f,n=d,i=d,b=f;for(;t!==f;){const e=c/t,a=c%t,f=r-i*e,d=n-b*e;c=t,t=a,r=i,n=b,i=f,b=d}if(c!==d)throw new Error("invert: does not exist");return s(r,a)}function h(e){const a=(e-d)/r;let t,c,n;for(t=e-d,c=0;t%r===f;t/=r,c++);for(n=r;n(s(e,a)&d)===d;const g=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function m(e,a,t){if(t 0");if(t===f)return e.ONE;if(t===d)return a;let c=e.ONE,r=a;for(;t>f;)t&d&&(c=e.mul(c,r)),r=e.sqr(r),t>>=d;return c}function x(e,a){const t=new Array(a.length),c=a.reduce(((a,c,f)=>e.is0(c)?a:(t[f]=a,e.mul(a,c))),e.ONE),f=e.inv(c);return a.reduceRight(((a,c,f)=>e.is0(c)?a:(t[f]=e.mul(a,t[f]),e.mul(a,c))),f),t}function y(e,a){const t=void 0!==a?a:e.toString(2).length;return{nBitLength:t,nByteLength:Math.ceil(t/8)}}function A(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const a=e.toString(2).length;return Math.ceil(a/8)}function v(e){const a=A(e);return a+Math.ceil(a/2)}},91484:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.bitMask=void 0,a.isBytes=d,a.abytes=r,a.bytesToHex=i,a.numberToHexUnpadded=b,a.hexToNumber=o,a.hexToBytes=u,a.bytesToNumberBE=function(e){return o(i(e))},a.bytesToNumberLE=function(e){return r(e),o(i(Uint8Array.from(e).reverse()))},a.numberToBytesBE=h,a.numberToBytesLE=function(e,a){return h(e,a).reverse()},a.numberToVarBytesBE=function(e){return u(b(e))},a.ensureBytes=function(e,a,t){let c;if("string"==typeof a)try{c=u(a)}catch(t){throw new Error(`${e} must be valid hex string, got "${a}". Cause: ${t}`)}else{if(!d(a))throw new Error(`${e} must be hex string or Uint8Array`);c=Uint8Array.from(a)}const f=c.length;if("number"==typeof t&&f!==t)throw new Error(`${e} expected ${t} bytes, got ${f}`);return c},a.concatBytes=p,a.equalBytes=function(e,a){if(e.length!==a.length)return!1;let t=0;for(let c=0;ct;e>>=c,a+=1);return a},a.bitGet=function(e,a){return e>>BigInt(a)&c},a.bitSet=function(e,a,f){return e|(f?c:t)<{c.fill(1),f.fill(0),d=0},n=(...e)=>t(f,c,...e),i=(e=g())=>{f=n(m([0]),e),c=n(),0!==e.length&&(f=n(m([1]),e),c=n())},b=()=>{if(d++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const t=[];for(;e{let t;for(r(),i(e);!(t=a(b()));)i();return r(),t}},a.validateObject=function(e,a,t={}){const c=(a,t,c)=>{const f=x[t];if("function"!=typeof f)throw new Error(`Invalid validator "${t}", expected function`);const d=e[a];if(!(c&&void 0===d||f(d,e)))throw new Error(`Invalid param ${String(a)}=${d} (${typeof d}), expected ${t}`)};for(const[e,t]of Object.entries(a))c(e,t,!1);for(const[e,a]of Object.entries(t))c(e,a,!0);return e};const t=BigInt(0),c=BigInt(1),f=BigInt(2);function d(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function r(e){if(!d(e))throw new Error("Uint8Array expected")}const n=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function i(e){r(e);let a="";for(let t=0;t=s._0&&e<=s._9?e-s._0:e>=s._A&&e<=s._F?e-(s._A-10):e>=s._a&&e<=s._f?e-(s._a-10):void 0}function u(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const a=e.length,t=a/2;if(a%2)throw new Error("padded hex string expected, got unpadded hex of length "+a);const c=new Uint8Array(t);for(let a=0,f=0;a(f<new Uint8Array(e),m=e=>Uint8Array.from(e),x={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||d(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,a)=>a.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)}},91705:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.DER=void 0,a.weierstrassPoints=h,a.weierstrass=function(e){const t=function(e){const a=(0,c.validateBasic)(e);return d.validateObject(a,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...a})}(e),{Fp:n,n:i}=t,s=n.BYTES+1,l=2*n.BYTES+1;function u(e){return f.mod(e,i)}function p(e){return f.invert(e,i)}const{ProjectivePoint:g,normPrivateKeyToScalar:m,weierstrassEquation:x,isWithinCurveOrder:y}=h({...t,toBytes(e,a,t){const c=a.toAffine(),f=n.toBytes(c.x),r=d.concatBytes;return t?r(Uint8Array.from([a.hasEvenY()?2:3]),f):r(Uint8Array.from([4]),f,n.toBytes(c.y))},fromBytes(e){const a=e.length,t=e[0],c=e.subarray(1);if(a!==s||2!==t&&3!==t){if(a===l&&4===t)return{x:n.fromBytes(c.subarray(0,n.BYTES)),y:n.fromBytes(c.subarray(n.BYTES,2*n.BYTES))};throw new Error(`Point of length ${a} was invalid. Expected ${s} compressed bytes or ${l} uncompressed bytes`)}{const e=d.bytesToNumberBE(c);if(!(b<(f=e)&&fd.bytesToHex(d.numberToBytesBE(e,t.nByteLength));function v(e){return e>i>>o}const w=(e,a,t)=>d.bytesToNumberBE(e.slice(a,t));class _{constructor(e,a,t){this.r=e,this.s=a,this.recovery=t,this.assertValidity()}static fromCompact(e){const a=t.nByteLength;return e=(0,r.ensureBytes)("compactSignature",e,2*a),new _(w(e,0,a),w(e,a,2*a))}static fromDER(e){const{r:t,s:c}=a.DER.toSig((0,r.ensureBytes)("DER",e));return new _(t,c)}assertValidity(){if(!y(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!y(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new _(this.r,this.s,e)}recoverPublicKey(e){const{r:a,s:c,recovery:f}=this,d=M((0,r.ensureBytes)("msgHash",e));if(null==f||![0,1,2,3].includes(f))throw new Error("recovery id invalid");const i=2===f||3===f?a+t.n:a;if(i>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const b=1&f?"03":"02",o=g.fromHex(b+A(i)),s=p(i),l=u(-d*s),h=u(c*s),m=g.BASE.multiplyAndAddUnsafe(o,l,h);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return d.hexToBytes(this.toDERHex())}toDERHex(){return a.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return d.hexToBytes(this.toCompactHex())}toCompactHex(){return A(this.r)+A(this.s)}}const I={isValidPrivateKey(e){try{return m(e),!0}catch(e){return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{const e=f.getMinHashLength(t.n);return f.mapHashToField(t.randomBytes(e),t.n)},precompute:(e=8,a=g.BASE)=>(a._setWindowSize(e),a.multiply(BigInt(3)),a)};function E(e){const a=d.isBytes(e),t="string"==typeof e,c=(a||t)&&e.length;return a?c===s||c===l:t?c===2*s||c===2*l:e instanceof g}const C=t.bits2int||function(e){const a=d.bytesToNumberBE(e),c=8*e.length-t.nBitLength;return c>0?a>>BigInt(c):a},M=t.bits2int_modN||function(e){return u(C(e))},B=d.bitMask(t.nBitLength);function L(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(b<=e&&ee in c)))throw new Error("sign() legacy options not supported");const{hash:f,randomBytes:i}=t;let{lowS:s,prehash:l,extraEntropy:h}=c;null==s&&(s=!0),e=(0,r.ensureBytes)("msgHash",e),l&&(e=(0,r.ensureBytes)("prehashed msgHash",f(e)));const x=M(e),A=m(a),w=[L(A),L(x)];if(null!=h&&!1!==h){const e=!0===h?i(n.BYTES):h;w.push((0,r.ensureBytes)("extraEntropy",e))}const I=d.concatBytes(...w),E=x;return{seed:I,k2sig:function(e){const a=C(e);if(!y(a))return;const t=p(a),c=g.BASE.multiply(a).toAffine(),f=u(c.x);if(f===b)return;const d=u(t*u(E+f*A));if(d===b)return;let r=(c.x===f?0:2)|Number(c.y&o),n=d;return s&&v(d)&&(n=function(e){return v(e)?u(-e):e}(d),r^=1),new _(f,n,r)}}}(e,a,c),s=t;return d.createHmacDrbg(s.hash.outputLen,s.nByteLength,s.hmac)(f,i)},verify:function(e,c,f,n=k){const i=e;if(c=(0,r.ensureBytes)("msgHash",c),f=(0,r.ensureBytes)("publicKey",f),"strict"in n)throw new Error("options.strict was renamed to lowS");const{lowS:b,prehash:o}=n;let s,l;try{if("string"==typeof i||d.isBytes(i))try{s=_.fromDER(i)}catch(e){if(!(e instanceof a.DER.Err))throw e;s=_.fromCompact(i)}else{if("object"!=typeof i||"bigint"!=typeof i.r||"bigint"!=typeof i.s)throw new Error("PARSE");{const{r:e,s:a}=i;s=new _(e,a)}}l=g.fromHex(f)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(b&&s.hasHighS())return!1;o&&(c=t.hash(c));const{r:h,s:m}=s,x=M(c),y=p(m),A=u(x*y),v=u(h*y),w=g.BASE.multiplyAndAddUnsafe(l,A,v)?.toAffine();return!!w&&u(w.x)===h},ProjectivePoint:g,Signature:_,utils:I}},a.SWUFpSqrtRatio=p,a.mapToCurveSimpleSWU=function(e,a){if(f.validateField(e),!e.isValid(a.A)||!e.isValid(a.B)||!e.isValid(a.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const t=p(e,a.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return c=>{let f,d,r,n,i,b,o,s;f=e.sqr(c),f=e.mul(f,a.Z),d=e.sqr(f),d=e.add(d,f),r=e.add(d,e.ONE),r=e.mul(r,a.B),n=e.cmov(a.Z,e.neg(d),!e.eql(d,e.ZERO)),n=e.mul(n,a.A),d=e.sqr(r),b=e.sqr(n),i=e.mul(b,a.A),d=e.add(d,i),d=e.mul(d,r),b=e.mul(b,n),i=e.mul(b,a.B),d=e.add(d,i),o=e.mul(f,r);const{isValid:l,value:u}=t(d,b);s=e.mul(f,c),s=e.mul(s,u),o=e.cmov(o,r,l),s=e.cmov(s,u,l);const h=e.isOdd(c)===e.isOdd(s);return s=e.cmov(e.neg(s),s,h),o=e.div(o,n),{x:o,y:s}}};const c=t(62422),f=t(24967),d=t(91484),r=t(91484),{bytesToNumberBE:n,hexToBytes:i}=d;a.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=a.DER;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const c=e[1],f=e.subarray(2,c+2);if(!c||f.length!==c)throw new t("Invalid signature integer: wrong length");if(128&f[0])throw new t("Invalid signature integer: negative");if(0===f[0]&&!(128&f[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:n(f),l:e.subarray(c+2)}},toSig(e){const{Err:t}=a.DER,c="string"==typeof e?i(e):e;d.abytes(c);let f=c.length;if(f<2||48!=c[0])throw new t("Invalid signature tag");if(c[1]!==f-2)throw new t("Invalid signature: incorrect length");const{d:r,l:n}=a.DER._parseInt(c.subarray(2)),{d:b,l:o}=a.DER._parseInt(n);if(o.length)throw new t("Invalid signature: left bytes after parsing");return{r,s:b}},hexFromSig(e){const a=e=>8&Number.parseInt(e[0],16)?"00"+e:e,t=e=>{const a=e.toString(16);return 1&a.length?`0${a}`:a},c=a(t(e.s)),f=a(t(e.r)),d=c.length/2,r=f.length/2,n=t(d),i=t(r);return`30${t(r+d+4)}02${i}${f}02${n}${c}`}};const b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(3),u=BigInt(4);function h(e){const a=function(e){const a=(0,c.validateBasic)(e);d.validateObject(a,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:f,a:r}=a;if(t){if(!f.eql(r,f.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof t||"bigint"!=typeof t.beta||"function"!=typeof t.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...a})}(e),{Fp:t}=a,n=a.toBytes||((e,a,c)=>{const f=a.toAffine();return d.concatBytes(Uint8Array.from([4]),t.toBytes(f.x),t.toBytes(f.y))}),i=a.fromBytes||(e=>{const a=e.subarray(1);return{x:t.fromBytes(a.subarray(0,t.BYTES)),y:t.fromBytes(a.subarray(t.BYTES,2*t.BYTES))}});function s(e){const{a:c,b:f}=a,d=t.sqr(e),r=t.mul(d,e);return t.add(t.add(r,t.mul(e,c)),f)}if(!t.eql(t.sqr(a.Gy),s(a.Gx)))throw new Error("bad generator point: equation left != right");function u(e){return"bigint"==typeof e&&bt.eql(e,t.ZERO);return f(a)&&f(c)?x.ZERO:new x(a,c,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(x.fromAffine)}static fromHex(e){const a=x.fromAffine(i((0,r.ensureBytes)("pointHex",e)));return a.assertValidity(),a}static fromPrivateKey(e){return x.BASE.multiply(p(e))}_setWindowSize(e){this._WINDOW_SIZE=e,g.delete(this)}assertValidity(){if(this.is0()){if(a.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:c}=this.toAffine();if(!t.isValid(e)||!t.isValid(c))throw new Error("bad point: x or y not FE");const f=t.sqr(c),d=s(e);if(!t.eql(f,d))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(t.isOdd)return!t.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){m(e);const{px:a,py:c,pz:f}=this,{px:d,py:r,pz:n}=e,i=t.eql(t.mul(a,n),t.mul(d,f)),b=t.eql(t.mul(c,n),t.mul(r,f));return i&&b}negate(){return new x(this.px,t.neg(this.py),this.pz)}double(){const{a:e,b:c}=a,f=t.mul(c,l),{px:d,py:r,pz:n}=this;let i=t.ZERO,b=t.ZERO,o=t.ZERO,s=t.mul(d,d),u=t.mul(r,r),h=t.mul(n,n),p=t.mul(d,r);return p=t.add(p,p),o=t.mul(d,n),o=t.add(o,o),i=t.mul(e,o),b=t.mul(f,h),b=t.add(i,b),i=t.sub(u,b),b=t.add(u,b),b=t.mul(i,b),i=t.mul(p,i),o=t.mul(f,o),h=t.mul(e,h),p=t.sub(s,h),p=t.mul(e,p),p=t.add(p,o),o=t.add(s,s),s=t.add(o,s),s=t.add(s,h),s=t.mul(s,p),b=t.add(b,s),h=t.mul(r,n),h=t.add(h,h),s=t.mul(h,p),i=t.sub(i,s),o=t.mul(h,u),o=t.add(o,o),o=t.add(o,o),new x(i,b,o)}add(e){m(e);const{px:c,py:f,pz:d}=this,{px:r,py:n,pz:i}=e;let b=t.ZERO,o=t.ZERO,s=t.ZERO;const u=a.a,h=t.mul(a.b,l);let p=t.mul(c,r),g=t.mul(f,n),y=t.mul(d,i),A=t.add(c,f),v=t.add(r,n);A=t.mul(A,v),v=t.add(p,g),A=t.sub(A,v),v=t.add(c,d);let w=t.add(r,i);return v=t.mul(v,w),w=t.add(p,y),v=t.sub(v,w),w=t.add(f,d),b=t.add(n,i),w=t.mul(w,b),b=t.add(g,y),w=t.sub(w,b),s=t.mul(u,v),b=t.mul(h,y),s=t.add(b,s),b=t.sub(g,s),s=t.add(g,s),o=t.mul(b,s),g=t.add(p,p),g=t.add(g,p),y=t.mul(u,y),v=t.mul(h,v),g=t.add(g,y),y=t.sub(p,y),y=t.mul(u,y),v=t.add(v,y),p=t.mul(g,v),o=t.add(o,p),p=t.mul(w,v),b=t.mul(A,b),b=t.sub(b,p),p=t.mul(A,g),s=t.mul(w,s),s=t.add(s,p),new x(b,o,s)}subtract(e){return this.add(e.negate())}is0(){return this.equals(x.ZERO)}wNAF(e){return A.wNAFCached(this,g,e,(e=>{const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(x.fromAffine)}))}multiplyUnsafe(e){const c=x.ZERO;if(e===b)return c;if(h(e),e===o)return this;const{endo:f}=a;if(!f)return A.unsafeLadder(this,e);let{k1neg:d,k1:r,k2neg:n,k2:i}=f.splitScalar(e),s=c,l=c,u=this;for(;r>b||i>b;)r&o&&(s=s.add(u)),i&o&&(l=l.add(u)),u=u.double(),r>>=o,i>>=o;return d&&(s=s.negate()),n&&(l=l.negate()),l=new x(t.mul(l.px,f.beta),l.py,l.pz),s.add(l)}multiply(e){h(e);let c,f,d=e;const{endo:r}=a;if(r){const{k1neg:e,k1:a,k2neg:n,k2:i}=r.splitScalar(d);let{p:b,f:o}=this.wNAF(a),{p:s,f:l}=this.wNAF(i);b=A.constTimeNegate(e,b),s=A.constTimeNegate(n,s),s=new x(t.mul(s.px,r.beta),s.py,s.pz),c=b.add(s),f=o.add(l)}else{const{p:e,f:a}=this.wNAF(d);c=e,f=a}return x.normalizeZ([c,f])[0]}multiplyAndAddUnsafe(e,a,t){const c=x.BASE,f=(e,a)=>a!==b&&a!==o&&e.equals(c)?e.multiply(a):e.multiplyUnsafe(a),d=f(this,a).add(f(e,t));return d.is0()?void 0:d}toAffine(e){const{px:a,py:c,pz:f}=this,d=this.is0();null==e&&(e=d?t.ONE:t.inv(f));const r=t.mul(a,e),n=t.mul(c,e),i=t.mul(f,e);if(d)return{x:t.ZERO,y:t.ZERO};if(!t.eql(i,t.ONE))throw new Error("invZ was invalid");return{x:r,y:n}}isTorsionFree(){const{h:e,isTorsionFree:t}=a;if(e===o)return!0;if(t)return t(x,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:t}=a;return e===o?this:t?t(x,this):this.multiplyUnsafe(a.h)}toRawBytes(e=!0){return this.assertValidity(),n(x,this,e)}toHex(e=!0){return d.bytesToHex(this.toRawBytes(e))}}x.BASE=new x(a.Gx,a.Gy,t.ONE),x.ZERO=new x(t.ZERO,t.ONE,t.ZERO);const y=a.nBitLength,A=(0,c.wNAF)(x,a.endo?Math.ceil(y/2):y);return{CURVE:a,ProjectivePoint:x,normPrivateKeyToScalar:p,weierstrassEquation:s,isWithinCurveOrder:u}}function p(e,a){const t=e.ORDER;let c=b;for(let e=t-o;e%s===b;e/=s)c+=o;const f=c,d=s<{let c=g,d=e.pow(t,h),r=e.sqr(d);r=e.mul(r,t);let n=e.mul(a,r);n=e.pow(n,i),n=e.mul(n,d),d=e.mul(n,t),r=e.mul(n,a);let b=e.mul(r,d);n=e.pow(b,p);let l=e.eql(n,e.ONE);d=e.mul(r,m),n=e.mul(b,c),r=e.cmov(d,r,l),b=e.cmov(n,b,l);for(let a=f;a>o;a--){let t=a-s;t=s<{let d=e.sqr(f);const r=e.mul(a,f);d=e.mul(d,r);let n=e.pow(d,t);n=e.mul(n,r);const i=e.mul(n,c),b=e.mul(e.sqr(n),f),o=e.eql(b,a);return{isValid:o,value:e.cmov(i,n,o)}}}return x}},8510:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.encodeToCurve=a.hashToCurve=a.schnorr=a.secp256k1=void 0;const c=t(22623),f=t(99175),d=t(73562),r=t(71761),n=t(24967),i=t(91484),b=t(91705),o=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),s=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(1),u=BigInt(2),h=(e,a)=>(e+a/u)/a;function p(e){const a=o,t=BigInt(3),c=BigInt(6),f=BigInt(11),d=BigInt(22),r=BigInt(23),i=BigInt(44),b=BigInt(88),s=e*e*e%a,l=s*s*e%a,h=(0,n.pow2)(l,t,a)*l%a,p=(0,n.pow2)(h,t,a)*l%a,m=(0,n.pow2)(p,u,a)*s%a,x=(0,n.pow2)(m,f,a)*m%a,y=(0,n.pow2)(x,d,a)*x%a,A=(0,n.pow2)(y,i,a)*y%a,v=(0,n.pow2)(A,b,a)*A%a,w=(0,n.pow2)(v,i,a)*y%a,_=(0,n.pow2)(w,t,a)*l%a,I=(0,n.pow2)(_,r,a)*x%a,E=(0,n.pow2)(I,c,a)*s%a,C=(0,n.pow2)(E,u,a);if(!g.eql(g.sqr(C),e))throw new Error("Cannot find square root");return C}const g=(0,n.Field)(o,void 0,void 0,{sqrt:p});a.secp256k1=(0,d.createCurve)({a:BigInt(0),b:BigInt(7),Fp:g,n:s,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const a=s,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),c=-l*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),f=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),d=t,r=BigInt("0x100000000000000000000000000000000"),i=h(d*e,a),b=h(-c*e,a);let o=(0,n.mod)(e-i*t-b*f,a),u=(0,n.mod)(-i*c-b*d,a);const p=o>r,g=u>r;if(p&&(o=a-o),g&&(u=a-u),o>r||u>r)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:p,k1:o,k2neg:g,k2:u}}}},c.sha256);const m=BigInt(0),x=e=>"bigint"==typeof e&&me.charCodeAt(0))));t=(0,i.concatBytes)(a,a),y[e]=t}return(0,c.sha256)((0,i.concatBytes)(t,...a))}const v=e=>e.toRawBytes(!0).slice(1),w=e=>(0,i.numberToBytesBE)(e,32),_=e=>(0,n.mod)(e,o),I=e=>(0,n.mod)(e,s),E=a.secp256k1.ProjectivePoint;function C(e){let t=a.secp256k1.utils.normPrivateKeyToScalar(e),c=E.fromPrivateKey(t);return{scalar:c.hasEvenY()?t:I(-t),bytes:v(c)}}function M(e){if(!x(e))throw new Error("bad x: need 0 < x < p");const a=_(e*e);let t=p(_(a*e+BigInt(7)));t%u!==m&&(t=_(-t));const c=new E(e,t,l);return c.assertValidity(),c}function B(...e){return I((0,i.bytesToNumberBE)(A("BIP0340/challenge",...e)))}function L(e,a,t){const c=(0,i.ensureBytes)("signature",e,64),f=(0,i.ensureBytes)("message",a),d=(0,i.ensureBytes)("publicKey",t,32);try{const e=M((0,i.bytesToNumberBE)(d)),a=(0,i.bytesToNumberBE)(c.subarray(0,32));if(!x(a))return!1;const t=(0,i.bytesToNumberBE)(c.subarray(32,64));if(!("bigint"==typeof(o=t)&&m(0,r.isogenyMap)(g,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((e=>e.map((e=>BigInt(e)))))))(),k=(()=>(0,b.mapToCurveSimpleSWU)(g,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:g.create(BigInt("-11"))}))(),N=(()=>(0,r.createHasher)(a.secp256k1.ProjectivePoint,(e=>{const{x:a,y:t}=k(g.create(e[0]));return S(a,t)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:g.ORDER,m:1,k:128,expand:"xmd",hash:c.sha256}))();a.hashToCurve=N.hashToCurve,a.encodeToCurve=N.encodeToCurve},67557:(e,a)=>{"use strict";function t(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function c(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function f(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function d(e,...a){if(!f(e))throw new Error("Uint8Array expected");if(a.length>0&&!a.includes(e.length))throw new Error(`Uint8Array expected of length ${a}, not of length=${e.length}`)}function r(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");t(e.outputLen),t(e.blockLen)}function n(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function i(e,a){d(e);const t=a.outputLen;if(e.length{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.HashMD=a.Maj=a.Chi=void 0;const c=t(67557),f=t(99175);a.Chi=(e,a,t)=>e&a^~e&t,a.Maj=(e,a,t)=>e&a^e&t^a&t;class d extends f.Hash{constructor(e,a,t,c){super(),this.blockLen=e,this.outputLen=a,this.padOffset=t,this.isLE=c,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,f.createView)(this.buffer)}update(e){(0,c.exists)(this);const{view:a,buffer:t,blockLen:d}=this,r=(e=(0,f.toBytes)(e)).length;for(let c=0;cd-n&&(this.process(t,0),n=0);for(let e=n;e>f&d),n=Number(t&d),i=c?4:0,b=c?0:4;e.setUint32(a+i,r,c),e.setUint32(a+b,n,c)}(t,d-8,BigInt(8*this.length),r),this.process(t,0);const i=(0,f.createView)(e),b=this.outputLen;if(b%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const o=b/4,s=this.get();if(o>s.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.add5L=a.add5H=a.add4H=a.add4L=a.add3H=a.add3L=a.add=a.rotlBL=a.rotlBH=a.rotlSL=a.rotlSH=a.rotr32L=a.rotr32H=a.rotrBL=a.rotrBH=a.rotrSL=a.rotrSH=a.shrSL=a.shrSH=a.toBig=a.split=a.fromBig=void 0;const t=BigInt(2**32-1),c=BigInt(32);function f(e,a=!1){return a?{h:Number(e&t),l:Number(e>>c&t)}:{h:0|Number(e>>c&t),l:0|Number(e&t)}}function d(e,a=!1){let t=new Uint32Array(e.length),c=new Uint32Array(e.length);for(let d=0;dBigInt(e>>>0)<>>0);a.toBig=r;const n=(e,a,t)=>e>>>t;a.shrSH=n;const i=(e,a,t)=>e<<32-t|a>>>t;a.shrSL=i;const b=(e,a,t)=>e>>>t|a<<32-t;a.rotrSH=b;const o=(e,a,t)=>e<<32-t|a>>>t;a.rotrSL=o;const s=(e,a,t)=>e<<64-t|a>>>t-32;a.rotrBH=s;const l=(e,a,t)=>e>>>t-32|a<<64-t;a.rotrBL=l;const u=(e,a)=>a;a.rotr32H=u;const h=(e,a)=>e;a.rotr32L=h;const p=(e,a,t)=>e<>>32-t;a.rotlSH=p;const g=(e,a,t)=>a<>>32-t;a.rotlSL=g;const m=(e,a,t)=>a<>>64-t;a.rotlBH=m;const x=(e,a,t)=>e<>>64-t;function y(e,a,t,c){const f=(a>>>0)+(c>>>0);return{h:e+t+(f/2**32|0)|0,l:0|f}}a.rotlBL=x,a.add=y;const A=(e,a,t)=>(e>>>0)+(a>>>0)+(t>>>0);a.add3L=A;const v=(e,a,t,c)=>a+t+c+(e/2**32|0)|0;a.add3H=v;const w=(e,a,t,c)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0);a.add4L=w;const _=(e,a,t,c,f)=>a+t+c+f+(e/2**32|0)|0;a.add4H=_;const I=(e,a,t,c,f)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0)+(f>>>0);a.add5L=I;const E=(e,a,t,c,f,d)=>a+t+c+f+d+(e/2**32|0)|0;a.add5H=E;const C={fromBig:f,split:d,toBig:r,shrSH:n,shrSL:i,rotrSH:b,rotrSL:o,rotrBH:s,rotrBL:l,rotr32H:u,rotr32L:h,rotlSH:p,rotlSL:g,rotlBH:m,rotlBL:x,add:y,add3L:A,add3H:v,add4L:w,add4H:_,add5H:E,add5L:I};a.default=C},25145:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.crypto=void 0,a.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},39615:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.hmac=a.HMAC=void 0;const c=t(67557),f=t(99175);class d extends f.Hash{constructor(e,a){super(),this.finished=!1,this.destroyed=!1,(0,c.hash)(e);const t=(0,f.toBytes)(a);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,r=new Uint8Array(d);r.set(t.length>d?e.create().update(t).digest():t);for(let e=0;enew d(e,a).update(t).digest(),a.hmac.create=(e,a)=>new d(e,a)},22623:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.sha224=a.sha256=void 0;const c=t(37202),f=t(99175),d=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]),r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),n=new Uint32Array(64);class i extends c.HashMD{constructor(){super(64,32,8,!1),this.A=0|r[0],this.B=0|r[1],this.C=0|r[2],this.D=0|r[3],this.E=0|r[4],this.F=0|r[5],this.G=0|r[6],this.H=0|r[7]}get(){const{A:e,B:a,C:t,D:c,E:f,F:d,G:r,H:n}=this;return[e,a,t,c,f,d,r,n]}set(e,a,t,c,f,d,r,n){this.A=0|e,this.B=0|a,this.C=0|t,this.D=0|c,this.E=0|f,this.F=0|d,this.G=0|r,this.H=0|n}process(e,a){for(let t=0;t<16;t++,a+=4)n[t]=e.getUint32(a,!1);for(let e=16;e<64;e++){const a=n[e-15],t=n[e-2],c=(0,f.rotr)(a,7)^(0,f.rotr)(a,18)^a>>>3,d=(0,f.rotr)(t,17)^(0,f.rotr)(t,19)^t>>>10;n[e]=d+n[e-7]+c+n[e-16]|0}let{A:t,B:r,C:i,D:b,E:o,F:s,G:l,H:u}=this;for(let e=0;e<64;e++){const a=u+((0,f.rotr)(o,6)^(0,f.rotr)(o,11)^(0,f.rotr)(o,25))+(0,c.Chi)(o,s,l)+d[e]+n[e]|0,h=((0,f.rotr)(t,2)^(0,f.rotr)(t,13)^(0,f.rotr)(t,22))+(0,c.Maj)(t,r,i)|0;u=l,l=s,s=o,o=b+a|0,b=i,i=r,r=t,t=a+h|0}t=t+this.A|0,r=r+this.B|0,i=i+this.C|0,b=b+this.D|0,o=o+this.E|0,s=s+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(t,r,i,b,o,s,l,u)}roundClean(){n.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class b extends i{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}a.sha256=(0,f.wrapConstructor)((()=>new i)),a.sha224=(0,f.wrapConstructor)((()=>new b))},32955:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.shake256=a.shake128=a.keccak_512=a.keccak_384=a.keccak_256=a.keccak_224=a.sha3_512=a.sha3_384=a.sha3_256=a.sha3_224=a.Keccak=a.keccakP=void 0;const c=t(67557),f=t(22318),d=t(99175),r=[],n=[],i=[],b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(7),u=BigInt(256),h=BigInt(113);for(let e=0,a=o,t=1,c=0;e<24;e++){[t,c]=[c,(2*t+3*c)%5],r.push(2*(5*c+t)),n.push((e+1)*(e+2)/2%64);let f=b;for(let e=0;e<7;e++)a=(a<>l)*h)%u,a&s&&(f^=o<<(o<t>32?(0,f.rotlBH)(e,a,t):(0,f.rotlSH)(e,a,t),x=(e,a,t)=>t>32?(0,f.rotlBL)(e,a,t):(0,f.rotlSL)(e,a,t);function y(e,a=24){const t=new Uint32Array(10);for(let c=24-a;c<24;c++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const c=(a+8)%10,f=(a+2)%10,d=t[f],r=t[f+1],n=m(d,r,1)^t[c],i=x(d,r,1)^t[c+1];for(let t=0;t<50;t+=10)e[a+t]^=n,e[a+t+1]^=i}let a=e[2],f=e[3];for(let t=0;t<24;t++){const c=n[t],d=m(a,f,c),i=x(a,f,c),b=r[t];a=e[b],f=e[b+1],e[b]=d,e[b+1]=i}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)t[c]=e[a+c];for(let c=0;c<10;c++)e[a+c]^=~t[(c+2)%10]&t[(c+4)%10]}e[0]^=p[c],e[1]^=g[c]}t.fill(0)}a.keccakP=y;class A extends d.Hash{constructor(e,a,t,f=!1,r=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=t,this.enableXOF=f,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,c.number)(t),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,d.u32)(this.state)}keccak(){d.isLE||(0,d.byteSwap32)(this.state32),y(this.state32,this.rounds),d.isLE||(0,d.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,c.exists)(this);const{blockLen:a,state:t}=this,f=(e=(0,d.toBytes)(e)).length;for(let c=0;c=t&&this.keccak();const d=Math.min(t-this.posOut,f-c);e.set(a.subarray(this.posOut,this.posOut+d),c),this.posOut+=d,c+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,c.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,c.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:t,outputLen:c,rounds:f,enableXOF:d}=this;return e||(e=new A(a,t,c,d,f)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=f,e.suffix=t,e.outputLen=c,e.enableXOF=d,e.destroyed=this.destroyed,e}}a.Keccak=A;const v=(e,a,t)=>(0,d.wrapConstructor)((()=>new A(a,e,t)));a.sha3_224=v(6,144,28),a.sha3_256=v(6,136,32),a.sha3_384=v(6,104,48),a.sha3_512=v(6,72,64),a.keccak_224=v(1,144,28),a.keccak_256=v(1,136,32),a.keccak_384=v(1,104,48),a.keccak_512=v(1,72,64);const w=(e,a,t)=>(0,d.wrapXOFConstructorWithOpts)(((c={})=>new A(a,e,void 0===c.dkLen?t:c.dkLen,!0)));a.shake128=w(31,168,16),a.shake256=w(31,136,32)},99175:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.randomBytes=a.wrapXOFConstructorWithOpts=a.wrapConstructorWithOpts=a.wrapConstructor=a.checkOpts=a.Hash=a.concatBytes=a.toBytes=a.utf8ToBytes=a.asyncLoop=a.nextTick=a.hexToBytes=a.bytesToHex=a.byteSwap32=a.byteSwapIfBE=a.byteSwap=a.isLE=a.rotl=a.rotr=a.createView=a.u32=a.u8=a.isBytes=void 0;const c=t(25145),f=t(67557);a.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name},a.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),a.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),a.rotr=(e,a)=>e<<32-a|e>>>a,a.rotl=(e,a)=>e<>>32-a>>>0,a.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],a.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,a.byteSwapIfBE=a.isLE?e=>e:e=>(0,a.byteSwap)(e),a.byteSwap32=function(e){for(let t=0;ta.toString(16).padStart(2,"0")));a.bytesToHex=function(e){(0,f.bytes)(e);let a="";for(let t=0;t=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function n(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function i(e){return"string"==typeof e&&(e=n(e)),(0,f.bytes)(e),e}a.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const a=e.length,t=a/2;if(a%2)throw new Error("padded hex string expected, got unpadded hex of length "+a);const c=new Uint8Array(t);for(let a=0,f=0;a{},a.asyncLoop=async function(e,t,c){let f=Date.now();for(let d=0;d=0&&ee().update(i(a)).digest(),t=e();return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=()=>e(),a},a.wrapConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(i(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.wrapXOFConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(i(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.randomBytes=function(e=32){if(c.crypto&&"function"==typeof c.crypto.getRandomValues)return c.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},63203:(e,a)=>{"use strict";function t(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function c(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function f(...e){const a=e=>e,t=(e,a)=>t=>e(a(t));return{encode:e.map((e=>e.encode)).reduceRight(t,a),decode:e.map((e=>e.decode)).reduce(t,a)}}function d(e){return{encode:a=>{if(!Array.isArray(a)||a.length&&"number"!=typeof a[0])throw new Error("alphabet.encode input should be an array of numbers");return a.map((a=>{if(t(a),a<0||a>=e.length)throw new Error(`Digit index outside alphabet: ${a} (alphabet: ${e.length})`);return e[a]}))},decode:a=>{if(!Array.isArray(a)||a.length&&"string"!=typeof a[0])throw new Error("alphabet.decode input should be array of strings");return a.map((a=>{if("string"!=typeof a)throw new Error(`alphabet.decode: not string element=${a}`);const t=e.indexOf(a);if(-1===t)throw new Error(`Unknown letter: "${a}". Allowed: ${e}`);return t}))}}}function r(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:a=>{if(!Array.isArray(a)||a.length&&"string"!=typeof a[0])throw new Error("join.encode input should be array of strings");for(let e of a)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return a.join(e)},decode:a=>{if("string"!=typeof a)throw new Error("join.decode input should be string");return a.split(e)}}}function n(e,a="="){if(t(e),"string"!=typeof a)throw new Error("padding chr should be string");return{encode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("padding.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;t.length*e%8;)t.push(a);return t},decode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("padding.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let c=t.length;if(c*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;c>0&&t[c-1]===a;c--)if(!((c-1)*e%8))throw new Error("Invalid padding: string has too much padding");return t.slice(0,c)}}}function i(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:a=>e(a)}}function b(e,a,c){if(a<2)throw new Error(`convertRadix: wrong from=${a}, base cannot be less than 2`);if(c<2)throw new Error(`convertRadix: wrong to=${c}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let f=0;const d=[],r=Array.from(e);for(r.forEach((e=>{if(t(e),e<0||e>=a)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,t=!0;for(let d=f;da?o(a,e%a):e,s=(e,a)=>e+(a-o(e,a));function l(e,a,c,f){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(a<=0||a>32)throw new Error(`convertRadix2: wrong from=${a}`);if(c<=0||c>32)throw new Error(`convertRadix2: wrong to=${c}`);if(s(a,c)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${c} carryBits=${s(a,c)}`);let d=0,r=0;const n=2**c-1,i=[];for(const f of e){if(t(f),f>=2**a)throw new Error(`convertRadix2: invalid data word=${f} from=${a}`);if(d=d<32)throw new Error(`convertRadix2: carry overflow pos=${r} from=${a}`);for(r+=a;r>=c;r-=c)i.push((d>>r-c&n)>>>0);d&=2**r-1}if(d=d<=a)throw new Error("Excess padding");if(!f&&d)throw new Error(`Non-zero padding: ${d}`);return f&&r>0&&i.push(d>>>0),i}function u(e){return t(e),{encode:a=>{if(!c(a))throw new Error("radix.encode input should be Uint8Array");return b(Array.from(a),256,e)},decode:a=>{if(!Array.isArray(a)||a.length&&"number"!=typeof a[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(b(a,e,256))}}}function h(e,a=!1){if(t(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(s(8,e)>32||s(e,8)>32)throw new Error("radix2: carry overflow");return{encode:t=>{if(!c(t))throw new Error("radix2.encode input should be Uint8Array");return l(Array.from(t),8,e,!a)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(l(t,e,8,a))}}}function p(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...a){try{return e.apply(null,a)}catch(e){}}}function g(e,a){if(t(e),"function"!=typeof a)throw new Error("checksum fn should be function");return{encode(t){if(!c(t))throw new Error("checksum.encode: input should be Uint8Array");const f=a(t).slice(0,e),d=new Uint8Array(t.length+e);return d.set(t),d.set(f,t.length),d},decode(t){if(!c(t))throw new Error("checksum.decode: input should be Uint8Array");const f=t.slice(0,-e),d=a(f).slice(0,e),r=t.slice(-e);for(let a=0;ae.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),a.base64=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),n(6),r("")),a.base64nopad=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),r("")),a.base64url=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),n(6),r("")),a.base64urlnopad=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),r(""));const m=e=>f(u(58),d(e),r(""));a.base58=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),a.base58flickr=m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),a.base58xrp=m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const x=[0,2,3,5,6,7,9,10,11];a.base58xmr={encode(e){let t="";for(let c=0;cf(g(4,(a=>e(e(a)))),a.base58),a.base58check=a.createBase58check;const y=f(d("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),r("")),A=[996825010,642813549,513874426,1027748829,705979059];function v(e){const a=e>>25;let t=(33554431&e)<<5;for(let e=0;e>e&1)&&(t^=A[e]);return t}function w(e,a,t=1){const c=e.length;let f=1;for(let a=0;a126)throw new Error(`Invalid prefix (${e})`);f=v(f)^t>>5}f=v(f);for(let a=0;ac)throw new TypeError(`Length ${f} exceeds limit ${c}`);const d=e.toLowerCase(),r=w(d,t,a);return`${d}1${y.encode(t)}${r}`}function n(e,t=90){if("string"!=typeof e)throw new Error("bech32.decode input should be string, not "+typeof e);if(e.length<8||!1!==t&&e.length>t)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${t})`);const c=e.toLowerCase();if(e!==c&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const f=c.lastIndexOf("1");if(0===f||-1===f)throw new Error('Letter "1" must be present between prefix and data only');const d=c.slice(0,f),r=c.slice(f+1);if(r.length<6)throw new Error("Data must be at least 6 characters long");const n=y.decode(r).slice(0,-6),i=w(d,n,a);if(!r.endsWith(i))throw new Error(`Invalid checksum in ${e}: expected "${i}"`);return{prefix:d,words:n}}return{encode:r,decode:n,encodeFromBytes:function(e,a){return r(e,f(a))},decodeToBytes:function(e){const{prefix:a,words:t}=n(e,!1);return{prefix:a,words:t,bytes:c(t)}},decodeUnsafe:p(n),fromWords:c,fromWordsUnsafe:d,toWords:f}}a.bech32=_("bech32"),a.bech32m=_("bech32m"),a.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},a.hex=f(h(4),d("0123456789abcdef"),r(""),i((e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const I={utf8:a.utf8,hex:a.hex,base16:a.base16,base32:a.base32,base64:a.base64,base64url:a.base64url,base58:a.base58,base58xmr:a.base58xmr},E="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";a.bytesToString=(e,a)=>{if("string"!=typeof e||!I.hasOwnProperty(e))throw new TypeError(E);if(!c(a))throw new TypeError("bytesToString() expects Uint8Array");return I[e].encode(a)},a.str=a.bytesToString,a.stringToBytes=(e,a)=>{if(!I.hasOwnProperty(e))throw new TypeError(E);if("string"!=typeof a)throw new TypeError("stringToBytes() expects string");return I[e].decode(a)},a.bytes=a.stringToBytes},7736:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.BaseTree=void 0,a.BaseTree=class{get capacity(){return 2**this.levels}get layers(){return this._layers.slice()}get zeros(){return this._zeros.slice()}get elements(){return this._layers[0].slice()}get root(){var e;return null!==(e=this._layers[this.levels][0])&&void 0!==e?e:this._zeros[this.levels]}static indexOf(e,a,t,c){return c?e.findIndex((e=>c(a,e))):e.indexOf(a,t)}insert(e){if(this._layers[0].length>=this.capacity)throw new Error("Tree is full");this.update(this._layers[0].length,e)}bulkInsert(e){if(e.length){if(this._layers[0].length+e.length>this.capacity)throw new Error("Tree is full");for(let a=0;a>=1;const e=this._layers[t-1][2*c],a=this._layers[t-1][2*c+1];this._layers[t][c]=this._hashFn(e,a)}}this.insert(e[e.length-1])}}update(e,a){if(isNaN(Number(e))||e<0||e>this._layers[0].length||e>=this.capacity)throw new Error("Insert index out of bounds: "+e);this._layers[0][e]=a,this._processUpdate(e)}path(e){if(isNaN(Number(e))||e<0||e>=this._layers[0].length)throw new Error("Index out of bounds: "+e);let a=+e;const t=[],c=[],f=[];for(let e=0;e>=1}return{pathElements:t,pathIndices:c,pathPositions:f,pathRoot:this.root}}_buildZeros(){this._zeros=[this.zeroElement];for(let e=1;e<=this.levels;e++)this._zeros[e]=this._hashFn(this._zeros[e-1],this._zeros[e-1])}_processNodes(e,a){const t=e.length;let c=Math.ceil(t/2);const f=new Array(c);c--;const d=t-(t%2^1);let r=0;for(let n=d;n>=0&&void 0!==e[n-1];n-=2){const i=e[n-1],b=n===d&&t%2==1?this._zeros[a-1]:e[n];f[c-r]=this._hashFn(i,b),r++}return f}_processUpdate(e){for(let a=1;a<=this.levels;a++){e>>=1;const t=this._layers[a-1][2*e],c=2*e+1this.capacity)throw new Error("Tree is full");this._hashFn=t,this.zeroElement=c,this._layers=[];const d=a.slice();this._layers=[d],this._buildZeros(),this._buildHashes()}_buildHashes(){for(let e=1;e<=this.levels;e++){const a=this._layers[e-1];this._layers[e]=this._processNodes(a,e)}}bulkInsert(e){if(e.length){if(this._layers[0].length+e.length>this.capacity)throw new Error("Tree is full");for(let a=0;a>=1,this._layers[t][c]=this._hashFn(this._layers[t-1][2*c],this._layers[t-1][2*c+1])}this.insert(e[e.length-1])}}indexOf(e,a){return d.BaseTree.indexOf(this._layers[0],e,0,a)}proof(e){const a=this.indexOf(e);return this.path(a)}getTreeEdge(e){const a=this._layers[0][e];if(void 0===a)throw new Error("Element not found");return{edgePath:this.path(e),edgeElement:a,edgeIndex:e,edgeElementsCount:this._layers[0].length}}getTreeSlices(e=4){const a=this._layers[0].length;let t=Math.ceil(a/e);t%2&&t++;const c=[];for(let e=0;e(e.set(t,[a,this.edgeLeafProof.pathElements[t]]),e)),new Map),this._proofMap.set(this.levels,[0,this.edgeLeafProof.pathRoot])}_buildTree(){const e=this._edgeLeaf.index;if(this._leaves=Array(e).concat(this._leavesAfterEdge),this._proofMap.has(0)){const[e,a]=this._proofMap.get(0);this._leaves[e]=a}this._layers=[this._leaves],this._buildZeros(),this._buildHashes()}_buildHashes(){for(let e=1;e<=this.levels;e++){const a=this._layers[e-1],t=this._processNodes(a,e);if(this._proofMap.has(e)){const[a,c]=this._proofMap.get(e);t[a]||(t[a]=c)}this._layers[e]=t}}update(e,a){if(isNaN(Number(e))||e<0||e>this._layers[0].length||e>=this.capacity)throw new Error("Insert index out of bounds: "+e);if(e=this._layers[0].length)throw new Error("Index out of bounds: "+e);if(e>=1}return{pathElements:c,pathIndices:f,pathPositions:d,pathRoot:this.root}}indexOf(e,a){return d.BaseTree.indexOf(this._layers[0],e,this.edgeIndex,a)}proof(e){const a=this.indexOf(e);return this.path(a)}shiftEdge(e,a){if(this._edgeLeaf.index<=e.edgeIndex)throw new Error(`New edgeIndex should be smaller then ${this._edgeLeaf.index}`);if(a.length!==this._edgeLeaf.index-e.edgeIndex)throw new Error("Elements length should be "+(this._edgeLeaf.index-e.edgeIndex));this._edgeLeafProof=e.edgePath,this._edgeLeaf={index:e.edgeIndex,data:e.edgeElement},this._leavesAfterEdge=[...a,...this._leavesAfterEdge],this._createProofMap(),this._buildTree()}serialize(){return{_edgeLeafProof:this._edgeLeafProof,_edgeLeaf:this._edgeLeaf,_layers:this._layers,_zeros:this._zeros,levels:this.levels}}static deserialize(e,a){const t=Object.assign(Object.create(this.prototype),e);return t._hashFn=a||f.default,t._initialRoot=e._edgeLeafProof.pathRoot,t.zeroElement=t._zeros[0],t._leavesAfterEdge=t._layers[0].slice(e._edgeLeaf.index),t._createProofMap(),t}toString(){return JSON.stringify(this.serialize())}}a.PartialMerkleTree=r},41217:function(e,a,t){"use strict";var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.MerkleTree=a.simpleHash=a.PartialMerkleTree=void 0;const f=c(t(9093));Object.defineProperty(a,"MerkleTree",{enumerable:!0,get:function(){return f.default}});var d=t(91230);Object.defineProperty(a,"PartialMerkleTree",{enumerable:!0,get:function(){return d.PartialMerkleTree}});var r=t(5319);Object.defineProperty(a,"simpleHash",{enumerable:!0,get:function(){return r.simpleHash}}),a.default=f.default},5319:(e,a)=>{"use strict";function t(e,a,t=40){const c=e.join("");let f,d,r=null!=a?a:34658180293;for(f=0,d=c.length;f>>0).toString(16);return BigInt("0x"+n.padEnd(t-(n.length-1),"0")).toString(10)}Object.defineProperty(a,"__esModule",{value:!0}),a.simpleHash=void 0,a.simpleHash=t,a.default=(e,a)=>t([e,a])},27351:(e,a,t)=>{var c=t(48287).Buffer;const f=t(92096);let d;if("undefined"!=typeof BigInt)d=BigInt,d.one=d(1),d.zero=d(0),d.genAffine=e=>{const a=-e;return t=>{let c=t;return c<0?(c<=a&&(c%=e),c=e&&(c%=e),c.valueOf()}},d.genInverse=e=>a=>{let t=d.zero,c=e,f=d.one,r=d.affine(a,e);for(;r!=d.zero;){let e=c/r;[t,f]=[f,t-e*f],[c,r]=[r,c-e*r]}return te?(a,t)=>(a+t)%e:(e,a)=>e+a,d.genSub=e=>e?(a,t)=>(a-t)%e:(e,a)=>e-a,d.genNeg=e=>e?a=>-a%e:e=>-e,d.genMul=e=>e?(a,t)=>a*t%e:(e,a)=>e*a,d.genShr=()=>(e,a)=>e>>d(a),d.genShl=e=>e?(a,t)=>(a<e<e?(a,t)=>a.affine(e)==t.affine(e):(e,a)=>e==a,d.genSquare=e=>e?a=>a*a%e:e=>e*e,d.genDouble=e=>e?a=>(a+a)%e:e=>e+e,d.genIsZero=e=>e?a=>a.affine(e)==d.zero:e=>e==d.zero,d.prototype.isOdd=function(){return(this&d.one)==d(1)},d.prototype.isNegative=function(){return thisd.zero?this:-this},d.prototype.modPow=function(e,a){let t=d.one,c=this,f=e;for(;f;)f&d.one&&(t=t*c%a),c=c*c%a,f>>=d.one;return t},d.prototype.greaterOrEquals=function(e){return this>=e},d.prototype.greater=function(e){return this>e},d.prototype.gt=d.prototype.greater,d.prototype.lesserOrEquals=function(e){return this<=e},d.prototype.lesser=function(e){return this{const a=d.zero.minus(e);return t=>{let c=t;return c.isNegative()?(c.lesserOrEquals(a)&&(c=c.mod(e)),c.isNegative()&&(c=c.add(e))):c.greaterOrEquals(e)&&(c=c.mod(e)),c}},d.genInverse=e=>a=>a.affine(e).modInv(e),d.genAdd=e=>e?(a,t)=>{const c=a.add(t);return c.greaterOrEquals(e)?c.minus(e):c}:(e,a)=>e.add(a),d.genSub=e=>e?(a,t)=>a.greaterOrEquals(t)?a.minus(t):a.minus(t).add(e):(e,a)=>e.minus(a),d.genNeg=e=>e?a=>a.isZero()?a:e.minus(a):e=>d.zero.minus(e),d.genMul=e=>e?(a,t)=>a.times(t).mod(e):(e,a)=>e.times(a),d.genShr=()=>(e,a)=>e.shiftRight(d(a).value),d.genShl=e=>e?(a,t)=>a.shiftLeft(d(t).value).mod(e):(e,a)=>e.shiftLeft(d(a).value),d.genSquare=e=>e?a=>a.square().mod(e):e=>e.square(),d.genDouble=e=>e?a=>a.add(a).mod(e):e=>e.add(e),d.genEquals=e=>e?(a,t)=>a.affine(e).equals(t.affine(e)):(e,a)=>e.equals(a),d.genIsZero=e=>e?a=>a.affine(e).isZero():e=>e.isZero()}d.affine=function(e,a){return d.genAffine(a)(e)},d.prototype.affine=function(e){return d.affine(this,e)},d.inverse=function(e,a){return d.genInverse(a)(e)},d.prototype.inverse=function(e){return d.genInverse(e)(this)},d.add=function(e,a,t){return d.genAdd(t)(e,a)},d.prototype.add=function(e,a){return d.genAdd(a)(this,e)},d.sub=function(e,a,t){return d.genSub(t)(e,a)},d.prototype.sub=function(e,a){return d.genSub(a)(this,e)},d.neg=function(e,a){return d.genNeg(a)(e)},d.prototype.neg=function(e){return d.genNeg(e)(this)},d.mul=function(e,a,t){return d.genMul(t)(e,a)},d.prototype.mul=function(e,a){return d.genMul(a)(this,e)},d.shr=function(e,a,t){return d.genShr(t)(e,a)},d.prototype.shr=function(e,a){return d.genShr(a)(this,e)},d.shl=function(e,a,t){return d.genShl(t)(e,a)},d.prototype.shl=function(e,a){return d.genShl(a)(this,e)},d.equals=function(e,a,t){return d.genEquals(t)(e,a)},d.prototype.equals=function(e,a){return d.genEquals(a)(this,e)},d.square=function(e,a){return d.genSquare(a)(e)},d.prototype.square=function(e){return d.genSquare(e)(this)},d.double=function(e,a){return d.genDouble(a)(e)},d.prototype.double=function(e){return d.genDouble(e)(this)},d.isZero=function(e,a){return d.genIsZero(a)(e)},d.prototype.isZero=function(e){return d.genIsZero(e)(this)},d.leBuff2int=function(e){let a=d.zero;for(let t=0;t=0;){let e=Number(t.and(d("255")));r[f]=e,f--,t=t.shr(8)}if(t.greater(d.zero))throw new Error("Number does not feed in buffer");return r},d.prototype.beInt2Buff=function(e){return d.beInt2Buff(this,e)},e.exports=d},28803:(e,a,t)=>{const c=t(27351);e.exports=function(e,a,t){(t=t||{}).logFunction||(t.logFunction=console.log);const d=new f(e,t);function r(e,a,t){if(!Array.isArray(e))return t(a,e);for(let c=0;c{0==this.notInitSignals[e]&&this.triggerComponent(e)})),this.witness[t]}setVar(e,a,t){const c=this.scopes[this.scopes.length-1];return 0==a.length?c[e]=t:(void 0===c[e]&&(c[e]=[]),function e(a,t,c){1==t.length?a[t[0]]=c:(void 0===a[t[0]]&&(a[t[0]]=[]),e(a[t[0]],t.slice(1),c))}(c[e],a,t)),t}getVar(e,a){function t(e,a){return 0==a.length?e:t(e[a[0]],a.slice(1))}for(let c=this.scopes.length-1;c>=0;c--)if(void 0!==this.scopes[c][e])return t(this.scopes[c][e],a);throw new Error("Variable not defined: "+e)}getSignal(e,a){let t="one"==e?"one":this.currentComponent+"."+e;return t+=this._sels2str(a),this.getSignalFullName(t)}getPin(e,a,t,c){let f="one"==e?"one":this.currentComponent+"."+e;return f+=this._sels2str(a)+"."+t+this._sels2str(c),this.getSignalFullName(f)}getSignalFullName(e){const a=this.circuit.getSignalIdx(e);if(void 0===this.witness[a])throw new Error("Signal not initialized: "+e);return this.options.logGet&&this.options.logFunction("get ---\x3e"+e+" = "+this.witness[a].toString()),this.witness[a]}assert(e,a,t){const f=c(e),d=c(a);if(!f.equals(d))throw new Error("Constraint doesn't match "+this.currentComponent+": "+t+" -> "+f.toString()+" != "+d.toString())}}},98665:(module,__unused_webpack_exports,__webpack_require__)=>{const bigInt=__webpack_require__(27351),__P__=bigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617"),__MASK__=bigInt("28948022309329048855892746252171976963317496166410141009864396001978282409983"),calculateWitness=__webpack_require__(28803);module.exports=class Circuit{constructor(circuitDef){this.nPubInputs=circuitDef.nPubInputs,this.nPrvInputs=circuitDef.nPrvInputs,this.nInputs=circuitDef.nInputs,this.nOutputs=circuitDef.nOutputs,this.nVars=circuitDef.nVars,this.nSignals=circuitDef.nSignals,this.nConstants=circuitDef.nConstants,this.nConstraints=circuitDef.constraints.length,this.signalName2Idx=circuitDef.signalName2Idx,this.components=circuitDef.components,this.componentName2Idx=circuitDef.componentName2Idx,this.signals=circuitDef.signals,this.constraints=circuitDef.constraints,this.templates={};for(let t in circuitDef.templates)this.templates[t]=eval(" const __f= "+circuitDef.templates[t]+"\n__f");this.functions={};for(let f in circuitDef.functions)this.functions[f]={params:circuitDef.functions[f].params,func:eval(" const __f= "+circuitDef.functions[f].func+"\n__f;")}}calculateWitness(e,a){return calculateWitness(this,e,a)}checkWitness(e){const a=(e,a)=>{let t=bigInt(0);for(let c in e)t=t.add(bigInt(a[c]).mul(bigInt(e[c]))).mod(__P__);return t},t=(e,t)=>{const c=a(e[0],t),f=a(e[1],t),d=a(e[2],t);return!!c.mul(f).sub(d).affine(__P__).isZero()};for(let a=0;a{let a="";for(let t in e){let c=this.signals[t].names[0];"one"==c&&(c="");let f,d=bigInt(e[t]);d.lesserOrEquals(__P__.shr(bigInt(1)))?(f=""!=a?"+"+d.toString():"","1"!=f&&(f+=d.toString())):(d=__P__.sub(d),f="-"+d.toString()),a=a+" "+f+c}return a},t=`[ ${a(e[0])} ] * [ ${a(e[1])} ] - [ ${a(e[2])} ] = 0`;console.log(t)}printConstraints(){for(let e=0;e=this.nOutputs)throw new Error("Accessing an invalid output: "+e);return e+1}inputIdx(e){if(e>=this.nInputs)throw new Error("Accessing an invalid input: "+e);return this.nOutputs+1+e}pubInputIdx(e){if(e>=this.nPubInputs)throw new Error("Accessing an invalid pubInput: "+e);return this.inputIdx(e)}prvInputIdx(e){if(e>=this.nPrvInputs)throw new Error("Accessing an invalid prvInput: "+e);return this.inputIdx(this.nPubInputs+e)}varIdx(e){if(e>=this.nVars)throw new Error("Accessing an invalid variable: "+e);return e}constantIdx(e){if(e>=this.nConstants)throw new Error("Accessing an invalid constant: "+e);return this.nVars+e}signalIdx(e){if(e>=this.nSignls)throw new Error("Accessing an invalid signal: "+e);return e}signalNames(e){return this.signals[this.getSignalIdx(e)].names.join(", ")}a(e,a){return bigInt(this.constraints[e][0][a]||0)}b(e,a){return bigInt(this.constraints[e][1][a]||0)}c(e,a){return bigInt(this.constraints[e][2][a]||0)}}},73248:(e,a,t)=>{const c=t(27351);e.exports.e=function e(a){if("bigint"==typeof a||void 0!==a.isZero)return a.toString(10);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a},e.exports.H=function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return c(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a}},71293:(e,a,t)=>{var c=t(48287).Buffer;a.code=new c("AGFzbQEAAAABPApgAn9/AGABfwBgAX8Bf2ACf38Bf2ADf39/AX9gA39/fwBgA39+fwBgAn9+AGAEf39/fwBgBX9/f39/AAIQAQNlbnYGbWVtb3J5AgDoBwNsawABAgEDAwQEBQUGBwgFBQUAAAUFAAAAAQUFAAAFBQAAAAEFAAIBAAAFAAUAAAAIAQIAAgUICQgABQkDAAUFBQUAAgUFCAAIAgEBAAUFBQAAAAMAAgEAAAUABQAAAAgBAgACBQgJCAAFCQgIB8gJYghpbnRfY29weQAACGludF96ZXJvAAEHaW50X29uZQADCmludF9pc1plcm8AAgZpbnRfZXEABAdpbnRfZ3RlAAUHaW50X2FkZAAGB2ludF9zdWIABwppbnRfbXVsT2xkAAkHaW50X211bAAIB2ludF9kaXYADA5pbnRfaW52ZXJzZU1vZAANB2YxbV9hZGQADgdmMW1fc3ViAA8HZjFtX25lZwAQC2YxbV9tUmVkdWN0ABEHZjFtX211bAASCmYxbV9tdWxPbGQAExJmMW1fZnJvbU1vbnRnb21lcnkAFRBmMW1fdG9Nb250Z29tZXJ5ABQLZjFtX2ludmVyc2UAFghmMW1fY29weQAACGYxbV96ZXJvAAEKZjFtX2lzWmVybwACBmYxbV9lcQAEB2YxbV9vbmUAFwdmcm1fYWRkABgHZnJtX3N1YgAZB2ZybV9uZWcAGgtmcm1fbVJlZHVjdAAbB2ZybV9tdWwAHApmcm1fbXVsT2xkAB0SZnJtX2Zyb21Nb250Z29tZXJ5AB8QZnJtX3RvTW9udGdvbWVyeQAeC2ZybV9pbnZlcnNlACAIZnJtX2NvcHkAAAhmcm1femVybwABCmZybV9pc1plcm8AAgZmcm1fZXEABAdmcm1fb25lACEGZnJfYWRkABgGZnJfc3ViABkGZnJfbmVnABoGZnJfbXVsACIKZnJfaW52ZXJzZQAjB2ZyX2NvcHkAAAdmcl96ZXJvAAEGZnJfb25lACEJZnJfaXNaZXJvAAIFZnJfZXEABAlnMV9pc1plcm8AJAdnMV9jb3B5ACYHZzFfemVybwAlCWcxX2RvdWJsZQAnBmcxX2FkZAAoBmcxX25lZwApBmcxX3N1YgAqEWcxX2Zyb21Nb250Z29tZXJ5ACsPZzFfdG9Nb250Z29tZXJ5ACwJZzFfYWZmaW5lAC0OZzFfdGltZXNTY2FsYXIALgtnMV9tdWx0aWV4cAA1DGcxX211bHRpZXhwMgA5B2ZmdF9mZnQAQghmZnRfaWZmdABDEWZmdF90b01vbnRnb21lcnlOAD8TZmZ0X2Zyb21Nb250Z29tZXJ5TgA+FGZmdF9jb3B5TkludGVybGVhdmVkAD0IZmZ0X211bE4ARAhwb2xfemVybwBFD3BvbF9jb25zdHJ1Y3RMQwBGCmYybV9pc1plcm8ARwhmMm1femVybwBIB2YybV9vbmUASQhmMm1fY29weQBKB2YybV9tdWwASwdmMm1fYWRkAEwHZjJtX3N1YgBNB2YybV9uZWcAThJmMm1fZnJvbU1vbnRnb21lcnkAUBBmMm1fdG9Nb250Z29tZXJ5AE8GZjJtX2VxAFELZjJtX2ludmVyc2UAUglnMl9pc1plcm8AUwdnMl9jb3B5AFUHZzJfemVybwBUCWcyX2RvdWJsZQBWBmcyX2FkZABXBmcyX25lZwBYBmcyX3N1YgBZEWcyX2Zyb21Nb250Z29tZXJ5AFoPZzJfdG9Nb250Z29tZXJ5AFsJZzJfYWZmaW5lAFwOZzJfdGltZXNTY2FsYXIAXQtnMl9tdWx0aWV4cABkDGcyX211bHRpZXhwMgBoDHRlc3RfZjFtX211bABpD3Rlc3RfZjFtX211bE9sZABqCsfEAWsqACABIAApAwA3AwAgASAAKQMINwMIIAEgACkDEDcDECABIAApAxg3AxgLHgAgAEIANwMAIABCADcDCCAAQgA3AxAgAEIANwMYCzMAIAApAxhQBEAgACkDEFAEQCAAKQMIUARAIAApAwBQDwVBAA8LBUEADwsFQQAPC0EADwseACAAQgE3AwAgAEIANwMIIABCADcDECAAQgA3AxgLRwAgACkDGCABKQMYUQRAIAApAxAgASkDEFEEQCAAKQMIIAEpAwhRBEAgACkDACABKQMAUQ8FQQAPCwVBAA8LBUEADwtBAA8LfQAgACkDGCABKQMYVARAQQAPBSAAKQMYIAEpAxhWBEBBAQ8FIAApAxAgASkDEFQEQEEADwUgACkDECABKQMQVgRAQQEPBSAAKQMIIAEpAwhUBEBBAA8FIAApAwggASkDCFYEQEEBDwUgACkDACABKQMAWg8LCwsLCwtBAA8L1AEBAX4gADUCACABNQIAfCEDIAIgAz4CACAANQIEIAE1AgR8IANCIIh8IQMgAiADPgIEIAA1AgggATUCCHwgA0IgiHwhAyACIAM+AgggADUCDCABNQIMfCADQiCIfCEDIAIgAz4CDCAANQIQIAE1AhB8IANCIIh8IQMgAiADPgIQIAA1AhQgATUCFHwgA0IgiHwhAyACIAM+AhQgADUCGCABNQIYfCADQiCIfCEDIAIgAz4CGCAANQIcIAE1Ahx8IANCIIh8IQMgAiADPgIcIANCIIinC4wCAQF+IAA1AgAgATUCAH0hAyACIANC/////w+DPgIAIAA1AgQgATUCBH0gA0Igh3whAyACIANC/////w+DPgIEIAA1AgggATUCCH0gA0Igh3whAyACIANC/////w+DPgIIIAA1AgwgATUCDH0gA0Igh3whAyACIANC/////w+DPgIMIAA1AhAgATUCEH0gA0Igh3whAyACIANC/////w+DPgIQIAA1AhQgATUCFH0gA0Igh3whAyACIANC/////w+DPgIUIAA1AhggATUCGH0gA0Igh3whAyACIANC/////w+DPgIYIAA1AhwgATUCHH0gA0Igh3whAyACIANC/////w+DPgIcIANCIIenC48QEgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfiADQv////8PgyAANQIAIgUgATUCACIGfnwhAyAEIANCIIh8IQQgAiADPgIAIARCIIghAyAEQv////8PgyAFIAE1AgQiCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgQiByAGfnwhBCADIARCIIh8IQMgAiAEPgIEIANCIIghBCADQv////8PgyAFIAE1AggiCn58IQMgBCADQiCIfCEEIANC/////w+DIAcgCH58IQMgBCADQiCIfCEEIANC/////w+DIAA1AggiCSAGfnwhAyAEIANCIIh8IQQgAiADPgIIIARCIIghAyAEQv////8PgyAFIAE1AgwiDH58IQQgAyAEQiCIfCEDIARC/////w+DIAcgCn58IQQgAyAEQiCIfCEDIARC/////w+DIAkgCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgwiCyAGfnwhBCADIARCIIh8IQMgAiAEPgIMIANCIIghBCADQv////8PgyAFIAE1AhAiDn58IQMgBCADQiCIfCEEIANC/////w+DIAcgDH58IQMgBCADQiCIfCEEIANC/////w+DIAkgCn58IQMgBCADQiCIfCEEIANC/////w+DIAsgCH58IQMgBCADQiCIfCEEIANC/////w+DIAA1AhAiDSAGfnwhAyAEIANCIIh8IQQgAiADPgIQIARCIIghAyAEQv////8PgyAFIAE1AhQiEH58IQQgAyAEQiCIfCEDIARC/////w+DIAcgDn58IQQgAyAEQiCIfCEDIARC/////w+DIAkgDH58IQQgAyAEQiCIfCEDIARC/////w+DIAsgCn58IQQgAyAEQiCIfCEDIARC/////w+DIA0gCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AhQiDyAGfnwhBCADIARCIIh8IQMgAiAEPgIUIANCIIghBCADQv////8PgyAFIAE1AhgiEn58IQMgBCADQiCIfCEEIANC/////w+DIAcgEH58IQMgBCADQiCIfCEEIANC/////w+DIAkgDn58IQMgBCADQiCIfCEEIANC/////w+DIAsgDH58IQMgBCADQiCIfCEEIANC/////w+DIA0gCn58IQMgBCADQiCIfCEEIANC/////w+DIA8gCH58IQMgBCADQiCIfCEEIANC/////w+DIAA1AhgiESAGfnwhAyAEIANCIIh8IQQgAiADPgIYIARCIIghAyAEQv////8PgyAFIAE1AhwiFH58IQQgAyAEQiCIfCEDIARC/////w+DIAcgEn58IQQgAyAEQiCIfCEDIARC/////w+DIAkgEH58IQQgAyAEQiCIfCEDIARC/////w+DIAsgDn58IQQgAyAEQiCIfCEDIARC/////w+DIA0gDH58IQQgAyAEQiCIfCEDIARC/////w+DIA8gCn58IQQgAyAEQiCIfCEDIARC/////w+DIBEgCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AhwiEyAGfnwhBCADIARCIIh8IQMgAiAEPgIcIANCIIghBCADQv////8PgyAHIBR+fCEDIAQgA0IgiHwhBCADQv////8PgyAJIBJ+fCEDIAQgA0IgiHwhBCADQv////8PgyALIBB+fCEDIAQgA0IgiHwhBCADQv////8PgyANIA5+fCEDIAQgA0IgiHwhBCADQv////8PgyAPIAx+fCEDIAQgA0IgiHwhBCADQv////8PgyARIAp+fCEDIAQgA0IgiHwhBCADQv////8PgyATIAh+fCEDIAQgA0IgiHwhBCACIAM+AiAgBEIgiCEDIARC/////w+DIAkgFH58IQQgAyAEQiCIfCEDIARC/////w+DIAsgEn58IQQgAyAEQiCIfCEDIARC/////w+DIA0gEH58IQQgAyAEQiCIfCEDIARC/////w+DIA8gDn58IQQgAyAEQiCIfCEDIARC/////w+DIBEgDH58IQQgAyAEQiCIfCEDIARC/////w+DIBMgCn58IQQgAyAEQiCIfCEDIAIgBD4CJCADQiCIIQQgA0L/////D4MgCyAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSASfnwhAyAEIANCIIh8IQQgA0L/////D4MgDyAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAOfnwhAyAEIANCIIh8IQQgA0L/////D4MgEyAMfnwhAyAEIANCIIh8IQQgAiADPgIoIARCIIghAyAEQv////8PgyANIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAPIBJ+fCEEIAMgBEIgiHwhAyAEQv////8PgyARIBB+fCEEIAMgBEIgiHwhAyAEQv////8PgyATIA5+fCEEIAMgBEIgiHwhAyACIAQ+AiwgA0IgiCEEIANC/////w+DIA8gFH58IQMgBCADQiCIfCEEIANC/////w+DIBEgEn58IQMgBCADQiCIfCEEIANC/////w+DIBMgEH58IQMgBCADQiCIfCEEIAIgAz4CMCAEQiCIIQMgBEL/////D4MgESAUfnwhBCADIARCIIh8IQMgBEL/////D4MgEyASfnwhBCADIARCIIh8IQMgAiAEPgI0IANCIIghBCADQv////8PgyATIBR+fCEDIAQgA0IgiHwhBCACIAM+AjggBEIgiCEDIAIgBD4CPAv0EAEBfkEoIAA1AgAgATUCAH43AwBBKCAANQIAIAE1AgR+NwMIQSggADUCACABNQIIfjcDEEEoIAA1AgAgATUCDH43AxhBKCAANQIAIAE1AhB+NwMgQSggADUCACABNQIUfjcDKEEoIAA1AgAgATUCGH43AzBBKCAANQIAIAE1Ahx+NwM4QSggADUCBCABNQIAfjcDQEEoIAA1AgQgATUCBH43A0hBKCAANQIEIAE1Agh+NwNQQSggADUCBCABNQIMfjcDWEEoIAA1AgQgATUCEH43A2BBKCAANQIEIAE1AhR+NwNoQSggADUCBCABNQIYfjcDcEEoIAA1AgQgATUCHH43A3hBKCAANQIIIAE1AgB+NwOAAUEoIAA1AgggATUCBH43A4gBQSggADUCCCABNQIIfjcDkAFBKCAANQIIIAE1Agx+NwOYAUEoIAA1AgggATUCEH43A6ABQSggADUCCCABNQIUfjcDqAFBKCAANQIIIAE1Ahh+NwOwAUEoIAA1AgggATUCHH43A7gBQSggADUCDCABNQIAfjcDwAFBKCAANQIMIAE1AgR+NwPIAUEoIAA1AgwgATUCCH43A9ABQSggADUCDCABNQIMfjcD2AFBKCAANQIMIAE1AhB+NwPgAUEoIAA1AgwgATUCFH43A+gBQSggADUCDCABNQIYfjcD8AFBKCAANQIMIAE1Ahx+NwP4AUEoIAA1AhAgATUCAH43A4ACQSggADUCECABNQIEfjcDiAJBKCAANQIQIAE1Agh+NwOQAkEoIAA1AhAgATUCDH43A5gCQSggADUCECABNQIQfjcDoAJBKCAANQIQIAE1AhR+NwOoAkEoIAA1AhAgATUCGH43A7ACQSggADUCECABNQIcfjcDuAJBKCAANQIUIAE1AgB+NwPAAkEoIAA1AhQgATUCBH43A8gCQSggADUCFCABNQIIfjcD0AJBKCAANQIUIAE1Agx+NwPYAkEoIAA1AhQgATUCEH43A+ACQSggADUCFCABNQIUfjcD6AJBKCAANQIUIAE1Ahh+NwPwAkEoIAA1AhQgATUCHH43A/gCQSggADUCGCABNQIAfjcDgANBKCAANQIYIAE1AgR+NwOIA0EoIAA1AhggATUCCH43A5ADQSggADUCGCABNQIMfjcDmANBKCAANQIYIAE1AhB+NwOgA0EoIAA1AhggATUCFH43A6gDQSggADUCGCABNQIYfjcDsANBKCAANQIYIAE1Ahx+NwO4A0EoIAA1AhwgATUCAH43A8ADQSggADUCHCABNQIEfjcDyANBKCAANQIcIAE1Agh+NwPQA0EoIAA1AhwgATUCDH43A9gDQSggADUCHCABNQIQfjcD4ANBKCAANQIcIAE1AhR+NwPoA0EoIAA1AhwgATUCGH43A/ADQSggADUCHCABNQIcfjcD+AMgA0IgiEEoNQIAfCEDIAIgAz4CACADQiCIQSg1AgR8QSg1Agh8QSg1AkB8IQMgAiADPgIEIANCIIhBKDUCDHxBKDUCRHxBKDUCEHxBKDUCSHxBKDUCgAF8IQMgAiADPgIIIANCIIhBKDUCFHxBKDUCTHxBKDUChAF8QSg1Ahh8QSg1AlB8QSg1AogBfEEoNQLAAXwhAyACIAM+AgwgA0IgiEEoNQIcfEEoNQJUfEEoNQKMAXxBKDUCxAF8QSg1AiB8QSg1Alh8QSg1ApABfEEoNQLIAXxBKDUCgAJ8IQMgAiADPgIQIANCIIhBKDUCJHxBKDUCXHxBKDUClAF8QSg1AswBfEEoNQKEAnxBKDUCKHxBKDUCYHxBKDUCmAF8QSg1AtABfEEoNQKIAnxBKDUCwAJ8IQMgAiADPgIUIANCIIhBKDUCLHxBKDUCZHxBKDUCnAF8QSg1AtQBfEEoNQKMAnxBKDUCxAJ8QSg1AjB8QSg1Amh8QSg1AqABfEEoNQLYAXxBKDUCkAJ8QSg1AsgCfEEoNQKAA3whAyACIAM+AhggA0IgiEEoNQI0fEEoNQJsfEEoNQKkAXxBKDUC3AF8QSg1ApQCfEEoNQLMAnxBKDUChAN8QSg1Ajh8QSg1AnB8QSg1AqgBfEEoNQLgAXxBKDUCmAJ8QSg1AtACfEEoNQKIA3xBKDUCwAN8IQMgAiADPgIcIANCIIhBKDUCPHxBKDUCdHxBKDUCrAF8QSg1AuQBfEEoNQKcAnxBKDUC1AJ8QSg1AowDfEEoNQLEA3xBKDUCeHxBKDUCsAF8QSg1AugBfEEoNQKgAnxBKDUC2AJ8QSg1ApADfEEoNQLIA3whAyACIAM+AiAgA0IgiEEoNQJ8fEEoNQK0AXxBKDUC7AF8QSg1AqQCfEEoNQLcAnxBKDUClAN8QSg1AswDfEEoNQK4AXxBKDUC8AF8QSg1AqgCfEEoNQLgAnxBKDUCmAN8QSg1AtADfCEDIAIgAz4CJCADQiCIQSg1ArwBfEEoNQL0AXxBKDUCrAJ8QSg1AuQCfEEoNQKcA3xBKDUC1AN8QSg1AvgBfEEoNQKwAnxBKDUC6AJ8QSg1AqADfEEoNQLYA3whAyACIAM+AiggA0IgiEEoNQL8AXxBKDUCtAJ8QSg1AuwCfEEoNQKkA3xBKDUC3AN8QSg1ArgCfEEoNQLwAnxBKDUCqAN8QSg1AuADfCEDIAIgAz4CLCADQiCIQSg1ArwCfEEoNQL0AnxBKDUCrAN8QSg1AuQDfEEoNQL4AnxBKDUCsAN8QSg1AugDfCEDIAIgAz4CMCADQiCIQSg1AvwCfEEoNQK0A3xBKDUC7AN8QSg1ArgDfEEoNQLwA3whAyACIAM+AjQgA0IgiEEoNQK8A3xBKDUC9AN8QSg1AvgDfCEDIAIgAz4COCADQiCIQSg1AvwDfCEDIAIgAz4CPAu2AQEBfiAANQAAIAF+IQMgAiADPgAAIAA1AAQgAX4gA0IgiHwhAyACIAM+AAQgADUACCABfiADQiCIfCEDIAIgAz4ACCAANQAMIAF+IANCIIh8IQMgAiADPgAMIAA1ABAgAX4gA0IgiHwhAyACIAM+ABAgADUAFCABfiADQiCIfCEDIAIgAz4AFCAANQAYIAF+IANCIIh8IQMgAiADPgAYIAA1ABwgAX4gA0IgiHwhAyACIAM+ABwLTgIBfgF/IAAhAyADNQAAIAF8IQIgAyACPgAAIAJCIIghAgJAA0AgAlANASADQQRqIQMgAzUAACACfCECIAMgAj4AACACQiCIIQIMAAsLC7ACBwF/AX8BfwF/AX4BfgF/IAIEQCACIQUFQcgEIQULIAMEQCADIQQFQegEIQQLIAAgBBAAIAFBqAQQACAFEAFBiAUQAUEfIQZBHyEHAkADQEGoBCAHai0AACAHQQNGcg0BIAdBAWshBwwACwtBqAQgB2pBA2s1AABCAXwhCCAIQgFRBEBCAEIAgBoLAkADQAJAA0AgBCAGai0AACAGQQdGcg0BIAZBAWshBgwACwsgBCAGakEHaykAACEJIAkgCIAhCSAGIAdrQQRrIQoCQANAIAlCgICAgHCDUCAKQQBOcQ0BIAlCCIghCSAKQQFqIQoMAAsLIAlQBEAgBEGoBBAFRQ0CQgEhCUEAIQoLQagEIAlBqAUQCiAEQagFIAprIAQQBxogBSAKaiAJEAsMAAsLC7UCCwF/AX8BfwF/AX8BfwF/AX8BfwF/AX9ByAUhA0HIBRABQQAhC0HoBSEFIAFB6AUQAEGIBiEEQYgGEANBACEMQagGIQggAEGoBhAAQcgGIQZB6AYhB0HIByEKAkADQCAIEAINASAFIAggBiAHEAwgBiAEQYgHEAggCwRAIAwEQEGIByADEAUEQEGIByADIAoQBxpBACENBSADQYgHIAoQBxpBASENCwVBiAcgAyAKEAYaQQEhDQsFIAwEQEGIByADIAoQBhpBACENBSADQYgHEAUEQCADQYgHIAoQBxpBACENBUGIByADIAoQBxpBASENCwsLIAMhCSAEIQMgCiEEIAkhCiAMIQsgDSEMIAUhCSAIIQUgByEIIAkhBwwACwsgCwRAIAEgAyACEAcaBSADIAIQAAsLLAAgACABIAIQBgRAIAJB6AcgAhAHGgUgAkHoBxAFBEAgAkHoByACEAcaCwsLFwAgACABIAIQBwRAIAJB6AcgAhAGGgsLFAAgABACRQRAQegHIAAgARAHGgsLnBEDAX4BfgF+QonHmaQOIQJCACEDIAA1AgAgAn5C/////w+DIQQgADUCACADQiCIfEHoBzUCACAEfnwhAyAAIAM+AgAgADUCBCADQiCIfEHoBzUCBCAEfnwhAyAAIAM+AgQgADUCCCADQiCIfEHoBzUCCCAEfnwhAyAAIAM+AgggADUCDCADQiCIfEHoBzUCDCAEfnwhAyAAIAM+AgwgADUCECADQiCIfEHoBzUCECAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoBzUCFCAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AhxB6AggA0IgiD4CAEIAIQMgADUCBCACfkL/////D4MhBCAANQIEIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CBCAANQIIIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CCCAANQIMIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CDCAANQIQIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CECAANQIUIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegHNQIYIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIcIAR+fCEDIAAgAz4CIEHoCCADQiCIPgIEQgAhAyAANQIIIAJ+Qv////8PgyEEIAA1AgggA0IgiHxB6Ac1AgAgBH58IQMgACADPgIIIAA1AgwgA0IgiHxB6Ac1AgQgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6Ac1AgggBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6Ac1AgwgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6Ac1AhAgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6Ac1AhQgBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6Ac1AhggBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6Ac1AhwgBH58IQMgACADPgIkQegIIANCIIg+AghCACEDIAA1AgwgAn5C/////w+DIQQgADUCDCADQiCIfEHoBzUCACAEfnwhAyAAIAM+AgwgADUCECADQiCIfEHoBzUCBCAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoBzUCCCAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoBzUCDCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoBzUCECAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoBzUCFCAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AihB6AggA0IgiD4CDEIAIQMgADUCECACfkL/////D4MhBCAANQIQIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CECAANQIUIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegHNQIYIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegHNQIcIAR+fCEDIAAgAz4CLEHoCCADQiCIPgIQQgAhAyAANQIUIAJ+Qv////8PgyEEIAA1AhQgA0IgiHxB6Ac1AgAgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6Ac1AgQgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6Ac1AgggBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6Ac1AgwgBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6Ac1AhAgBH58IQMgACADPgIkIAA1AiggA0IgiHxB6Ac1AhQgBH58IQMgACADPgIoIAA1AiwgA0IgiHxB6Ac1AhggBH58IQMgACADPgIsIAA1AjAgA0IgiHxB6Ac1AhwgBH58IQMgACADPgIwQegIIANCIIg+AhRCACEDIAA1AhggAn5C/////w+DIQQgADUCGCADQiCIfEHoBzUCACAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoBzUCBCAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoBzUCCCAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoBzUCDCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoBzUCECAEfnwhAyAAIAM+AiggADUCLCADQiCIfEHoBzUCFCAEfnwhAyAAIAM+AiwgADUCMCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AjAgADUCNCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AjRB6AggA0IgiD4CGEIAIQMgADUCHCACfkL/////D4MhBCAANQIcIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CLCAANQIwIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CMCAANQI0IANCIIh8QegHNQIYIAR+fCEDIAAgAz4CNCAANQI4IANCIIh8QegHNQIcIAR+fCEDIAAgAz4COEHoCCADQiCIPgIcQegIIABBIGogARAOC74fIwF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX5CiceZpA4hBSADQv////8PgyAANQIAIgYgATUCACIHfnwhAyAEIANCIIh8IQQgA0L/////D4MgBX5C/////w+DIQggA0L/////D4NBADUC6AciCSAIfnwhAyAEIANCIIh8IQQgBEIgiCEDIARC/////w+DIAYgATUCBCILfnwhBCADIARCIIh8IQMgBEL/////D4MgADUCBCIKIAd+fCEEIAMgBEIgiHwhAyAEQv////8Pg0EANQLsByINIAh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAFfkL/////D4MhDCAEQv////8PgyAJIAx+fCEEIAMgBEIgiHwhAyADQiCIIQQgA0L/////D4MgBiABNQIIIg9+fCEDIAQgA0IgiHwhBCADQv////8PgyAKIAt+fCEDIAQgA0IgiHwhBCADQv////8PgyAANQIIIg4gB358IQMgBCADQiCIfCEEIANC/////w+DIA0gDH58IQMgBCADQiCIfCEEIANC/////w+DQQA1AvAHIhEgCH58IQMgBCADQiCIfCEEIANC/////w+DIAV+Qv////8PgyEQIANC/////w+DIAkgEH58IQMgBCADQiCIfCEEIARCIIghAyAEQv////8PgyAGIAE1AgwiE358IQQgAyAEQiCIfCEDIARC/////w+DIAogD358IQQgAyAEQiCIfCEDIARC/////w+DIA4gC358IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgwiEiAHfnwhBCADIARCIIh8IQMgBEL/////D4MgDSAQfnwhBCADIARCIIh8IQMgBEL/////D4MgESAMfnwhBCADIARCIIh8IQMgBEL/////D4NBADUC9AciFSAIfnwhBCADIARCIIh8IQMgBEL/////D4MgBX5C/////w+DIRQgBEL/////D4MgCSAUfnwhBCADIARCIIh8IQMgA0IgiCEEIANC/////w+DIAYgATUCECIXfnwhAyAEIANCIIh8IQQgA0L/////D4MgCiATfnwhAyAEIANCIIh8IQQgA0L/////D4MgDiAPfnwhAyAEIANCIIh8IQQgA0L/////D4MgEiALfnwhAyAEIANCIIh8IQQgA0L/////D4MgADUCECIWIAd+fCEDIAQgA0IgiHwhBCADQv////8PgyANIBR+fCEDIAQgA0IgiHwhBCADQv////8PgyARIBB+fCEDIAQgA0IgiHwhBCADQv////8PgyAVIAx+fCEDIAQgA0IgiHwhBCADQv////8Pg0EANQL4ByIZIAh+fCEDIAQgA0IgiHwhBCADQv////8PgyAFfkL/////D4MhGCADQv////8PgyAJIBh+fCEDIAQgA0IgiHwhBCAEQiCIIQMgBEL/////D4MgBiABNQIUIht+fCEEIAMgBEIgiHwhAyAEQv////8PgyAKIBd+fCEEIAMgBEIgiHwhAyAEQv////8PgyAOIBN+fCEEIAMgBEIgiHwhAyAEQv////8PgyASIA9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAWIAt+fCEEIAMgBEIgiHwhAyAEQv////8PgyAANQIUIhogB358IQQgAyAEQiCIfCEDIARC/////w+DIA0gGH58IQQgAyAEQiCIfCEDIARC/////w+DIBEgFH58IQQgAyAEQiCIfCEDIARC/////w+DIBUgEH58IQQgAyAEQiCIfCEDIARC/////w+DIBkgDH58IQQgAyAEQiCIfCEDIARC/////w+DQQA1AvwHIh0gCH58IQQgAyAEQiCIfCEDIARC/////w+DIAV+Qv////8PgyEcIARC/////w+DIAkgHH58IQQgAyAEQiCIfCEDIANCIIghBCADQv////8PgyAGIAE1AhgiH358IQMgBCADQiCIfCEEIANC/////w+DIAogG358IQMgBCADQiCIfCEEIANC/////w+DIA4gF358IQMgBCADQiCIfCEEIANC/////w+DIBIgE358IQMgBCADQiCIfCEEIANC/////w+DIBYgD358IQMgBCADQiCIfCEEIANC/////w+DIBogC358IQMgBCADQiCIfCEEIANC/////w+DIAA1AhgiHiAHfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSAcfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAYfnwhAyAEIANCIIh8IQQgA0L/////D4MgFSAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgGSAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgHSAMfnwhAyAEIANCIIh8IQQgA0L/////D4NBADUCgAgiISAIfnwhAyAEIANCIIh8IQQgA0L/////D4MgBX5C/////w+DISAgA0L/////D4MgCSAgfnwhAyAEIANCIIh8IQQgBEIgiCEDIARC/////w+DIAYgATUCHCIjfnwhBCADIARCIIh8IQMgBEL/////D4MgCiAffnwhBCADIARCIIh8IQMgBEL/////D4MgDiAbfnwhBCADIARCIIh8IQMgBEL/////D4MgEiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgFiATfnwhBCADIARCIIh8IQMgBEL/////D4MgGiAPfnwhBCADIARCIIh8IQMgBEL/////D4MgHiALfnwhBCADIARCIIh8IQMgBEL/////D4MgADUCHCIiIAd+fCEEIAMgBEIgiHwhAyAEQv////8PgyANICB+fCEEIAMgBEIgiHwhAyAEQv////8PgyARIBx+fCEEIAMgBEIgiHwhAyAEQv////8PgyAVIBh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAZIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAdIBB+fCEEIAMgBEIgiHwhAyAEQv////8PgyAhIAx+fCEEIAMgBEIgiHwhAyAEQv////8Pg0EANQKECCIlIAh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAFfkL/////D4MhJCAEQv////8PgyAJICR+fCEEIAMgBEIgiHwhAyADQiCIIQQgA0L/////D4MgCiAjfnwhAyAEIANCIIh8IQQgA0L/////D4MgDiAffnwhAyAEIANCIIh8IQQgA0L/////D4MgEiAbfnwhAyAEIANCIIh8IQQgA0L/////D4MgFiAXfnwhAyAEIANCIIh8IQQgA0L/////D4MgGiATfnwhAyAEIANCIIh8IQQgA0L/////D4MgHiAPfnwhAyAEIANCIIh8IQQgA0L/////D4MgIiALfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSAkfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAgfnwhAyAEIANCIIh8IQQgA0L/////D4MgFSAcfnwhAyAEIANCIIh8IQQgA0L/////D4MgGSAYfnwhAyAEIANCIIh8IQQgA0L/////D4MgHSAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgISAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgJSAMfnwhAyAEIANCIIh8IQQgAiADPgIAIARCIIghAyAEQv////8PgyAOICN+fCEEIAMgBEIgiHwhAyAEQv////8PgyASIB9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAWIBt+fCEEIAMgBEIgiHwhAyAEQv////8PgyAaIBd+fCEEIAMgBEIgiHwhAyAEQv////8PgyAeIBN+fCEEIAMgBEIgiHwhAyAEQv////8PgyAiIA9+fCEEIAMgBEIgiHwhAyAEQv////8PgyARICR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAVICB+fCEEIAMgBEIgiHwhAyAEQv////8PgyAZIBx+fCEEIAMgBEIgiHwhAyAEQv////8PgyAdIBh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAhIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAlIBB+fCEEIAMgBEIgiHwhAyACIAQ+AgQgA0IgiCEEIANC/////w+DIBIgI358IQMgBCADQiCIfCEEIANC/////w+DIBYgH358IQMgBCADQiCIfCEEIANC/////w+DIBogG358IQMgBCADQiCIfCEEIANC/////w+DIB4gF358IQMgBCADQiCIfCEEIANC/////w+DICIgE358IQMgBCADQiCIfCEEIANC/////w+DIBUgJH58IQMgBCADQiCIfCEEIANC/////w+DIBkgIH58IQMgBCADQiCIfCEEIANC/////w+DIB0gHH58IQMgBCADQiCIfCEEIANC/////w+DICEgGH58IQMgBCADQiCIfCEEIANC/////w+DICUgFH58IQMgBCADQiCIfCEEIAIgAz4CCCAEQiCIIQMgBEL/////D4MgFiAjfnwhBCADIARCIIh8IQMgBEL/////D4MgGiAffnwhBCADIARCIIh8IQMgBEL/////D4MgHiAbfnwhBCADIARCIIh8IQMgBEL/////D4MgIiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgGSAkfnwhBCADIARCIIh8IQMgBEL/////D4MgHSAgfnwhBCADIARCIIh8IQMgBEL/////D4MgISAcfnwhBCADIARCIIh8IQMgBEL/////D4MgJSAYfnwhBCADIARCIIh8IQMgAiAEPgIMIANCIIghBCADQv////8PgyAaICN+fCEDIAQgA0IgiHwhBCADQv////8PgyAeIB9+fCEDIAQgA0IgiHwhBCADQv////8PgyAiIBt+fCEDIAQgA0IgiHwhBCADQv////8PgyAdICR+fCEDIAQgA0IgiHwhBCADQv////8PgyAhICB+fCEDIAQgA0IgiHwhBCADQv////8PgyAlIBx+fCEDIAQgA0IgiHwhBCACIAM+AhAgBEIgiCEDIARC/////w+DIB4gI358IQQgAyAEQiCIfCEDIARC/////w+DICIgH358IQQgAyAEQiCIfCEDIARC/////w+DICEgJH58IQQgAyAEQiCIfCEDIARC/////w+DICUgIH58IQQgAyAEQiCIfCEDIAIgBD4CFCADQiCIIQQgA0L/////D4MgIiAjfnwhAyAEIANCIIh8IQQgA0L/////D4MgJSAkfnwhAyAEIANCIIh8IQQgAiADPgIYIARCIIghAyACIAQ+AhwgA6cEQCACQegHIAIQBxoFIAJB6AcQBQRAIAJB6AcgAhAHGgsLCxIAIAAgAUHoDBAJQegMIAIQEQsLACAAQYgIIAEQEgsVACAAQagNEABByA0QAUGoDSABEBELFwAgACABEBUgAUHoByABEA0gASABEBQLCQBBqAggABAACywAIAAgASACEAYEQCACQegNIAIQBxoFIAJB6A0QBQRAIAJB6A0gAhAHGgsLCxcAIAAgASACEAcEQCACQegNIAIQBhoLCxQAIAAQAkUEQEHoDSAAIAEQBxoLC5wRAwF+AX4BfkL/////DiECQgAhAyAANQIAIAJ+Qv////8PgyEEIAA1AgAgA0IgiHxB6A01AgAgBH58IQMgACADPgIAIAA1AgQgA0IgiHxB6A01AgQgBH58IQMgACADPgIEIAA1AgggA0IgiHxB6A01AgggBH58IQMgACADPgIIIAA1AgwgA0IgiHxB6A01AgwgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6A01AhAgBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6A01AhQgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6A01AhggBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AhwgBH58IQMgACADPgIcQegOIANCIIg+AgBCACEDIAA1AgQgAn5C/////w+DIQQgADUCBCADQiCIfEHoDTUCACAEfnwhAyAAIAM+AgQgADUCCCADQiCIfEHoDTUCBCAEfnwhAyAAIAM+AgggADUCDCADQiCIfEHoDTUCCCAEfnwhAyAAIAM+AgwgADUCECADQiCIfEHoDTUCDCAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoDTUCECAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoDTUCFCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoDTUCGCAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoDTUCHCAEfnwhAyAAIAM+AiBB6A4gA0IgiD4CBEIAIQMgADUCCCACfkL/////D4MhBCAANQIIIANCIIh8QegNNQIAIAR+fCEDIAAgAz4CCCAANQIMIANCIIh8QegNNQIEIAR+fCEDIAAgAz4CDCAANQIQIANCIIh8QegNNQIIIAR+fCEDIAAgAz4CECAANQIUIANCIIh8QegNNQIMIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegNNQIQIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegNNQIUIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegNNQIYIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegNNQIcIAR+fCEDIAAgAz4CJEHoDiADQiCIPgIIQgAhAyAANQIMIAJ+Qv////8PgyEEIAA1AgwgA0IgiHxB6A01AgAgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6A01AgQgBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6A01AgggBH58IQMgACADPgIUIAA1AhggA0IgiHxB6A01AgwgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AhAgBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6A01AhQgBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6A01AhggBH58IQMgACADPgIkIAA1AiggA0IgiHxB6A01AhwgBH58IQMgACADPgIoQegOIANCIIg+AgxCACEDIAA1AhAgAn5C/////w+DIQQgADUCECADQiCIfEHoDTUCACAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoDTUCBCAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoDTUCCCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoDTUCDCAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoDTUCECAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoDTUCFCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoDTUCGCAEfnwhAyAAIAM+AiggADUCLCADQiCIfEHoDTUCHCAEfnwhAyAAIAM+AixB6A4gA0IgiD4CEEIAIQMgADUCFCACfkL/////D4MhBCAANQIUIANCIIh8QegNNQIAIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegNNQIEIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegNNQIIIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegNNQIMIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegNNQIQIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegNNQIUIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegNNQIYIAR+fCEDIAAgAz4CLCAANQIwIANCIIh8QegNNQIcIAR+fCEDIAAgAz4CMEHoDiADQiCIPgIUQgAhAyAANQIYIAJ+Qv////8PgyEEIAA1AhggA0IgiHxB6A01AgAgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AgQgBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6A01AgggBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6A01AgwgBH58IQMgACADPgIkIAA1AiggA0IgiHxB6A01AhAgBH58IQMgACADPgIoIAA1AiwgA0IgiHxB6A01AhQgBH58IQMgACADPgIsIAA1AjAgA0IgiHxB6A01AhggBH58IQMgACADPgIwIAA1AjQgA0IgiHxB6A01AhwgBH58IQMgACADPgI0QegOIANCIIg+AhhCACEDIAA1AhwgAn5C/////w+DIQQgADUCHCADQiCIfEHoDTUCACAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoDTUCBCAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoDTUCCCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoDTUCDCAEfnwhAyAAIAM+AiggADUCLCADQiCIfEHoDTUCECAEfnwhAyAAIAM+AiwgADUCMCADQiCIfEHoDTUCFCAEfnwhAyAAIAM+AjAgADUCNCADQiCIfEHoDTUCGCAEfnwhAyAAIAM+AjQgADUCOCADQiCIfEHoDTUCHCAEfnwhAyAAIAM+AjhB6A4gA0IgiD4CHEHoDiAAQSBqIAEQGAu+HyMBfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+Qv////8OIQUgA0L/////D4MgADUCACIGIAE1AgAiB358IQMgBCADQiCIfCEEIANC/////w+DIAV+Qv////8PgyEIIANC/////w+DQQA1AugNIgkgCH58IQMgBCADQiCIfCEEIARCIIghAyAEQv////8PgyAGIAE1AgQiC358IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgQiCiAHfnwhBCADIARCIIh8IQMgBEL/////D4NBADUC7A0iDSAIfnwhBCADIARCIIh8IQMgBEL/////D4MgBX5C/////w+DIQwgBEL/////D4MgCSAMfnwhBCADIARCIIh8IQMgA0IgiCEEIANC/////w+DIAYgATUCCCIPfnwhAyAEIANCIIh8IQQgA0L/////D4MgCiALfnwhAyAEIANCIIh8IQQgA0L/////D4MgADUCCCIOIAd+fCEDIAQgA0IgiHwhBCADQv////8PgyANIAx+fCEDIAQgA0IgiHwhBCADQv////8Pg0EANQLwDSIRIAh+fCEDIAQgA0IgiHwhBCADQv////8PgyAFfkL/////D4MhECADQv////8PgyAJIBB+fCEDIAQgA0IgiHwhBCAEQiCIIQMgBEL/////D4MgBiABNQIMIhN+fCEEIAMgBEIgiHwhAyAEQv////8PgyAKIA9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAOIAt+fCEEIAMgBEIgiHwhAyAEQv////8PgyAANQIMIhIgB358IQQgAyAEQiCIfCEDIARC/////w+DIA0gEH58IQQgAyAEQiCIfCEDIARC/////w+DIBEgDH58IQQgAyAEQiCIfCEDIARC/////w+DQQA1AvQNIhUgCH58IQQgAyAEQiCIfCEDIARC/////w+DIAV+Qv////8PgyEUIARC/////w+DIAkgFH58IQQgAyAEQiCIfCEDIANCIIghBCADQv////8PgyAGIAE1AhAiF358IQMgBCADQiCIfCEEIANC/////w+DIAogE358IQMgBCADQiCIfCEEIANC/////w+DIA4gD358IQMgBCADQiCIfCEEIANC/////w+DIBIgC358IQMgBCADQiCIfCEEIANC/////w+DIAA1AhAiFiAHfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgFSAMfnwhAyAEIANCIIh8IQQgA0L/////D4NBADUC+A0iGSAIfnwhAyAEIANCIIh8IQQgA0L/////D4MgBX5C/////w+DIRggA0L/////D4MgCSAYfnwhAyAEIANCIIh8IQQgBEIgiCEDIARC/////w+DIAYgATUCFCIbfnwhBCADIARCIIh8IQMgBEL/////D4MgCiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgDiATfnwhBCADIARCIIh8IQMgBEL/////D4MgEiAPfnwhBCADIARCIIh8IQMgBEL/////D4MgFiALfnwhBCADIARCIIh8IQMgBEL/////D4MgADUCFCIaIAd+fCEEIAMgBEIgiHwhAyAEQv////8PgyANIBh+fCEEIAMgBEIgiHwhAyAEQv////8PgyARIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAVIBB+fCEEIAMgBEIgiHwhAyAEQv////8PgyAZIAx+fCEEIAMgBEIgiHwhAyAEQv////8Pg0EANQL8DSIdIAh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAFfkL/////D4MhHCAEQv////8PgyAJIBx+fCEEIAMgBEIgiHwhAyADQiCIIQQgA0L/////D4MgBiABNQIYIh9+fCEDIAQgA0IgiHwhBCADQv////8PgyAKIBt+fCEDIAQgA0IgiHwhBCADQv////8PgyAOIBd+fCEDIAQgA0IgiHwhBCADQv////8PgyASIBN+fCEDIAQgA0IgiHwhBCADQv////8PgyAWIA9+fCEDIAQgA0IgiHwhBCADQv////8PgyAaIAt+fCEDIAQgA0IgiHwhBCADQv////8PgyAANQIYIh4gB358IQMgBCADQiCIfCEEIANC/////w+DIA0gHH58IQMgBCADQiCIfCEEIANC/////w+DIBEgGH58IQMgBCADQiCIfCEEIANC/////w+DIBUgFH58IQMgBCADQiCIfCEEIANC/////w+DIBkgEH58IQMgBCADQiCIfCEEIANC/////w+DIB0gDH58IQMgBCADQiCIfCEEIANC/////w+DQQA1AoAOIiEgCH58IQMgBCADQiCIfCEEIANC/////w+DIAV+Qv////8PgyEgIANC/////w+DIAkgIH58IQMgBCADQiCIfCEEIARCIIghAyAEQv////8PgyAGIAE1AhwiI358IQQgAyAEQiCIfCEDIARC/////w+DIAogH358IQQgAyAEQiCIfCEDIARC/////w+DIA4gG358IQQgAyAEQiCIfCEDIARC/////w+DIBIgF358IQQgAyAEQiCIfCEDIARC/////w+DIBYgE358IQQgAyAEQiCIfCEDIARC/////w+DIBogD358IQQgAyAEQiCIfCEDIARC/////w+DIB4gC358IQQgAyAEQiCIfCEDIARC/////w+DIAA1AhwiIiAHfnwhBCADIARCIIh8IQMgBEL/////D4MgDSAgfnwhBCADIARCIIh8IQMgBEL/////D4MgESAcfnwhBCADIARCIIh8IQMgBEL/////D4MgFSAYfnwhBCADIARCIIh8IQMgBEL/////D4MgGSAUfnwhBCADIARCIIh8IQMgBEL/////D4MgHSAQfnwhBCADIARCIIh8IQMgBEL/////D4MgISAMfnwhBCADIARCIIh8IQMgBEL/////D4NBADUChA4iJSAIfnwhBCADIARCIIh8IQMgBEL/////D4MgBX5C/////w+DISQgBEL/////D4MgCSAkfnwhBCADIARCIIh8IQMgA0IgiCEEIANC/////w+DIAogI358IQMgBCADQiCIfCEEIANC/////w+DIA4gH358IQMgBCADQiCIfCEEIANC/////w+DIBIgG358IQMgBCADQiCIfCEEIANC/////w+DIBYgF358IQMgBCADQiCIfCEEIANC/////w+DIBogE358IQMgBCADQiCIfCEEIANC/////w+DIB4gD358IQMgBCADQiCIfCEEIANC/////w+DICIgC358IQMgBCADQiCIfCEEIANC/////w+DIA0gJH58IQMgBCADQiCIfCEEIANC/////w+DIBEgIH58IQMgBCADQiCIfCEEIANC/////w+DIBUgHH58IQMgBCADQiCIfCEEIANC/////w+DIBkgGH58IQMgBCADQiCIfCEEIANC/////w+DIB0gFH58IQMgBCADQiCIfCEEIANC/////w+DICEgEH58IQMgBCADQiCIfCEEIANC/////w+DICUgDH58IQMgBCADQiCIfCEEIAIgAz4CACAEQiCIIQMgBEL/////D4MgDiAjfnwhBCADIARCIIh8IQMgBEL/////D4MgEiAffnwhBCADIARCIIh8IQMgBEL/////D4MgFiAbfnwhBCADIARCIIh8IQMgBEL/////D4MgGiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgHiATfnwhBCADIARCIIh8IQMgBEL/////D4MgIiAPfnwhBCADIARCIIh8IQMgBEL/////D4MgESAkfnwhBCADIARCIIh8IQMgBEL/////D4MgFSAgfnwhBCADIARCIIh8IQMgBEL/////D4MgGSAcfnwhBCADIARCIIh8IQMgBEL/////D4MgHSAYfnwhBCADIARCIIh8IQMgBEL/////D4MgISAUfnwhBCADIARCIIh8IQMgBEL/////D4MgJSAQfnwhBCADIARCIIh8IQMgAiAEPgIEIANCIIghBCADQv////8PgyASICN+fCEDIAQgA0IgiHwhBCADQv////8PgyAWIB9+fCEDIAQgA0IgiHwhBCADQv////8PgyAaIBt+fCEDIAQgA0IgiHwhBCADQv////8PgyAeIBd+fCEDIAQgA0IgiHwhBCADQv////8PgyAiIBN+fCEDIAQgA0IgiHwhBCADQv////8PgyAVICR+fCEDIAQgA0IgiHwhBCADQv////8PgyAZICB+fCEDIAQgA0IgiHwhBCADQv////8PgyAdIBx+fCEDIAQgA0IgiHwhBCADQv////8PgyAhIBh+fCEDIAQgA0IgiHwhBCADQv////8PgyAlIBR+fCEDIAQgA0IgiHwhBCACIAM+AgggBEIgiCEDIARC/////w+DIBYgI358IQQgAyAEQiCIfCEDIARC/////w+DIBogH358IQQgAyAEQiCIfCEDIARC/////w+DIB4gG358IQQgAyAEQiCIfCEDIARC/////w+DICIgF358IQQgAyAEQiCIfCEDIARC/////w+DIBkgJH58IQQgAyAEQiCIfCEDIARC/////w+DIB0gIH58IQQgAyAEQiCIfCEDIARC/////w+DICEgHH58IQQgAyAEQiCIfCEDIARC/////w+DICUgGH58IQQgAyAEQiCIfCEDIAIgBD4CDCADQiCIIQQgA0L/////D4MgGiAjfnwhAyAEIANCIIh8IQQgA0L/////D4MgHiAffnwhAyAEIANCIIh8IQQgA0L/////D4MgIiAbfnwhAyAEIANCIIh8IQQgA0L/////D4MgHSAkfnwhAyAEIANCIIh8IQQgA0L/////D4MgISAgfnwhAyAEIANCIIh8IQQgA0L/////D4MgJSAcfnwhAyAEIANCIIh8IQQgAiADPgIQIARCIIghAyAEQv////8PgyAeICN+fCEEIAMgBEIgiHwhAyAEQv////8PgyAiIB9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAhICR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAlICB+fCEEIAMgBEIgiHwhAyACIAQ+AhQgA0IgiCEEIANC/////w+DICIgI358IQMgBCADQiCIfCEEIANC/////w+DICUgJH58IQMgBCADQiCIfCEEIAIgAz4CGCAEQiCIIQMgAiAEPgIcIAOnBEAgAkHoDSACEAcaBSACQegNEAUEQCACQegNIAIQBxoLCwsSACAAIAFB6BIQCUHoEiACEBsLCwAgAEGIDiABEBwLFQAgAEGoExAAQcgTEAFBqBMgARAbCxcAIAAgARAfIAFB6A0gARANIAEgARAeCwkAQagOIAAQAAsVACAAIAFB6BMQHEHoE0GIDiACEBwLCwAgAEHoDSABEA0LCgAgAEHAAGoQAgsVACAAEAEgAEEgahAXIABBwABqEAELIgAgACABEAAgAEEgaiABQSBqEAAgAEHAAGogAUHAAGoQAAuGAgAgABAkBEAgACABECYPCyAAIABBiBQQEiAAQSBqIABBIGpBqBQQEkGoFEGoFEHIFBASIABBqBRB6BQQDkHoFEHoFEHoFBASQegUQYgUQegUEA9B6BRByBRB6BQQD0HoFEHoFEHoFBAOQYgUQYgUQYgVEA5BiBVBiBRBiBUQDkGIFUGIFUGoFRASIABBIGogAEHAAGpByBUQEkHoFEHoFCABEA5BqBUgASABEA9ByBRByBRB6BUQDkHoFUHoFUHoFRAOQegVQegVQegVEA5B6BQgASABQSBqEA8gAUEgakGIFSABQSBqEBIgAUEgakHoFSABQSBqEA9ByBVByBUgAUHAAGoQDgusAwIBfwF/IABBwABqIQMgAUHAAGohBCAAECQEQCABIAIQJg8LIAEQJARAIAAgAhAmDwsgAyADQYgWEBIgBCAEQagWEBIgAEGoFkHIFhASIAFBiBZB6BYQEiADQYgWQYgXEBIgBEGoFkGoFxASIABBIGpBqBdByBcQEiABQSBqQYgXQegXEBJByBZB6BYQBARAQcgXQegXEAQEQCAAIAIQJw8LC0HoFkHIFkGIGBAPQegXQcgXQagYEA9BiBhBiBhByBgQDkHIGEHIGEHIGBASQYgYQcgYQegYEBJBqBhBqBhBiBkQDkHIFkHIGEHIGRASQYgZQYgZQagZEBJByBlByBlB6BkQDkGoGUHoGCACEA8gAkHoGSACEA9ByBdB6BhBiBoQEkGIGkGIGkGIGhAOQcgZIAIgAkEgahAPIAJBIGpBiBkgAkEgahASIAJBIGpBiBogAkEgahAPIAMgBCACQcAAahAOIAJBwABqIAJBwABqIAJBwABqEBIgAkHAAGpBiBYgAkHAAGoQDyACQcAAakGoFiACQcAAahAPIAJBwABqQYgYIAJBwABqEBILIgAgACABEAAgAEEgaiABQSBqEBAgAEHAAGogAUHAAGoQAAsQACABIAIQKSAAIAIgAhAoCyIAIAAgARAVIABBIGogAUEgahAVIABBwABqIAFBwABqEBULIgAgACABEBQgAEEgaiABQSBqEBQgAEHAAGogAUHAAGoQFAtPACAAECQEQCABECUFIABBwABqQagaEBZBqBpBqBpByBoQEkGoGkHIGkHoGhASIABByBogARASIABBIGpB6BogAUEgahASIAFBwABqEBcLC6cCAgF/AX8gAEGIGxAmIAMQJSACIQQCQANAIARBAWshBCABIARqLQAAIQUgAyADECcgBUGAAU8EQCAFQYABayEFQYgbIAMgAxAoCyADIAMQJyAFQcAATwRAIAVBwABrIQVBiBsgAyADECgLIAMgAxAnIAVBIE8EQCAFQSBrIQVBiBsgAyADECgLIAMgAxAnIAVBEE8EQCAFQRBrIQVBiBsgAyADECgLIAMgAxAnIAVBCE8EQCAFQQhrIQVBiBsgAyADECgLIAMgAxAnIAVBBE8EQCAFQQRrIQVBiBsgAyADECgLIAMgAxAnIAVBAk8EQCAFQQJrIQVBiBsgAyADECgLIAMgAxAnIAVBAU8EQCAFQQFrIQVBiBsgAyADECgLIARFDQEMAAsLCysCAX8BfyAAQQV2QQJ0IQFBASAAQR9xdCECIAEgASgC6NsBIAJyNgLo2wELJAIBfwF/IABBBXZBAnQhAUEBIABBH3F0IQIgASgC6NsBIAJxC6ABBAF/AX8BfwF/IAAhAkHoGxAlQQAhBAJAA0AgBCABRg0BQegbQQEgBHRB4ABsaiEDIAIQAiEFIAIgAxAAIAJBIGohAiADQSBqIQMgAiADEAAgAkEgaiECIANBIGohAyAFBEAgAxABBSADEBcLIARBAWohBAwACwtB6NsBQpeChIAQNwMAQfDbAUIBNwMAQfjbAUIBNwMAQYDcAUIANwMAC0ADAX8BfwF/QegbIABB4ABsaiEBIAAQMEUEQCAALQCI3AEQMiECIAAtAIjeARAyIQMgAiADIAEQKCAAEC8LIAELpQEEAX8BfwF+AX5BACEDAkADQCADQSBGDQFCACEGQQAhBAJAA0AgBCABRg0BIAAgBEEgbCADamoxAAAhBSAFIAVCHIaEQo+AgIDwAYMhBSAFIAVCDoaEQoOAjICwgMABgyEFIAUgBUIHhoRCgYKEiJCgwIABgyEFIAYgBSAErYaEIQYgBEEBaiEEDAALCyACIANBCGxqIAY3AwAgA0EBaiEDDAALCwtLAQF/IAAgAkGI4AEQMyADECUgASACEDFBACEEAkADQCAEQYACRg0BIAMgAxAnIANBh+IBIARrLQAAEDIgAxAoIARBAWohBAwACwsLfgQBfwF/AX8BfyAAIQUgASEGIAUgAiADbiADbEEgbGohCAJAA0AgBSAIRg0BIAUgBiADQYjiARA0QYjiASAEIAQQKCAFQSAgA2xqIQUgBkHAACADbGohBgwACwsgAiADcCEHIAcEQCAFIAYgB0GI4gEQNEGI4gEgBCAEECgLC04CAX8BfyAAIAJB6OIBEDMgASACEDFBACEEAkADQCAEQYACRg0BIAMgBEHgAGxqIQUgBUHn5AEgBGstAAAQMiAFECggBEEBaiEEDAALCwspAQF/QQAhAgJAA0AgAiABRg0BIAAgAkHgAGxqECUgAkEBaiECDAALCwtIAgF/AX8gACEEIAQgAhAmIARB4ABqIQRBASEDAkADQCADIAFGDQEgAiACECcgBCACIAIQKCAEQeAAaiEEIANBAWohAwwACwsLigEEAX8BfwF/AX9B6OQBQYACEDcgACEFIAEhBiAFIAIgA24gA2xBIGxqIQgCQANAIAUgCEYNASAFIAYgA0Ho5AEQNiAFQSAgA2xqIQUgBkHAACADbGohBgwACwsgAiADcCEHIAcEQCAFIAYgB0Ho5AEQNgtB6OQBQYACQeikAxA4QeikAyAEIAQQKAtGACAAQf8BcS0AiLQDQRh0IABBCHZB/wFxLQCItANBEHRqIABBEHZB/wFxLQCItANBCHQgAEEYdkH/AXEtAIi0A2pqIAF3C2cFAX8BfwF/AX8Bf0EBIAF0IQJBACEDAkADQCADIAJGDQEgACADQSBsaiEFIAMgARA6IQQgACAEQSBsaiEGIAMgBEkEQCAFQYi2AxAAIAYgBRAAQYi2AyAGEAALIANBAWohAwwACwsL7wEJAX8BfwF/AX8BfwF/AX8BfwF/IAAgARA7QQEgAXQhCEEBIQMCQANAIAMgAUsNAUEBIAN0IQZByKUDIANBIGxqIQlBACEEAkADQCAEIAhPDQEgAgRAIAlBIGpBqLYDEAAFQai2AxAhCyAGQQF2IQdBACEFAkADQCAFIAdPDQEgACAEIAVqQSBsaiEKIAogB0EgbGohC0GotgMgC0HItgMQHCAKQei2AxAAQei2A0HItgMgChAYQei2A0HItgMgCxAZQai2AyAJQai2AxAcIAVBAWohBQwACwsgBCAGaiEEDAALCyADQQFqIQMMAAsLCz4DAX8BfwF/IAAhAyABIQQgACACQSBsaiEFAkADQCADIAVGDQEgAyAEEAAgA0EgaiEDIARBwABqIQQMAAsLCz0DAX8BfwF/IAAhAyABIQQgACACQSBsaiEFAkADQCADIAVGDQEgAyAEEB8gA0EgaiEDIARBIGohBAwACwsLPQMBfwF/AX8gACEDIAEhBCAAIAJBIGxqIQUCQANAIAMgBUYNASADIAQQHiADQSBqIQMgBEEgaiEEDAALCwuWAQcBfwF/AX8BfwF/AX8Bf0EBIAF0IQJB6KwDIAFBIGxqIQQgAkEBayEGQQEhBSACQQF2IQMCQANAIAUgA0YNASAAIAVBIGxqIQcgACACIAVrQSBsaiEIIAdBiLcDEAAgCCAEIAcQHEGItwMgBCAIEBwgBUEBaiEFDAALCyAAIAQgABAcIAAgA0EgbGohCCAIIAQgCBAcC0MCAX8BfyAAQQF2IQJBACEBAkADQCACRQ0BIAJBAXYhAiABQQFqIQEMAAsLIABBASABdEcEQAALIAFBHEsEQAALIAELEgEBfyABEEEhAyAAIAMgAhA8CxgBAX8gARBBIQMgACADIAIQPCAAIAMQQAtMBAF/AX8BfwF/IAAhBCABIQUgAyEGIAAgAkEgbGohBwJAA0AgBCAHRg0BIAQgBSAGEBwgBEEgaiEEIAVBIGohBSAGQSBqIQYMAAsLCy4CAX8BfyAAIQMgACABQSBsaiECAkADQCADIAJGDQEgAxABIANBIGohAwwACwsLjgEGAX8BfwF/AX8BfwF/QQAhBCAAIQYgASEHAkADQCAEIAJGDQEgBigCACEJIAZBBGohBkEAIQUCQANAIAUgCUYNASADIAYoAgBBIGxqIQggBkEEaiEGIAcgBkGotwMQHEGotwMgCCAIEBggBkEgaiEGIAVBAWohBQwACwsgB0EgaiEHIARBAWohBAwACwsLDgAgABACIABBIGoQAnELDQAgABABIABBIGoQAQsNACAAEBcgAEEgahABCxQAIAAgARAAIABBIGogAUEgahAAC3kAIAAgAUHotwMQEiAAQSBqIAFBIGpBiLgDEBIgACAAQSBqQai4AxAOIAEgAUEgakHIuAMQDkGouANByLgDQai4AxASQYi4A0HItwMgAhASQei3AyACIAIQDkHotwNBiLgDIAJBIGoQDkGouAMgAkEgaiACQSBqEA8LGwAgACABIAIQDiAAQSBqIAFBIGogAkEgahAOCxsAIAAgASACEA8gAEEgaiABQSBqIAJBIGoQDwsUACAAIAEQECAAQSBqIAFBIGoQEAsUACAAIAEQFCAAQSBqIAFBIGoQFAsUACAAIAEQFSAAQSBqIAFBIGoQFQsVACAAIAEQBCAAQSBqIAFBIGoQBHELaAAgACAAQei4AxASIABBIGogAEEgakGIuQMQEkGIuQNByLcDQai5AxASQei4A0GouQNBqLkDEA9BqLkDQci5AxAWIABByLkDIAEQEiAAQSBqQci5AyABQSBqEBIgAUEgaiABQSBqEBALCgAgAEGAAWoQRwsWACAAEEggAEHAAGoQSSAAQYABahBICyQAIAAgARBKIABBwABqIAFBwABqEEogAEGAAWogAUGAAWoQSgu8AgAgABBTBEAgACABEFUPCyAAIABB6LkDEEsgAEHAAGogAEHAAGpBqLoDEEtBqLoDQai6A0HougMQSyAAQai6A0GouwMQTEGouwNBqLsDQai7AxBLQai7A0HouQNBqLsDEE1BqLsDQei6A0GouwMQTUGouwNBqLsDQai7AxBMQei5A0HouQNB6LsDEExB6LsDQei5A0HouwMQTEHouwNB6LsDQai8AxBLIABBwABqIABBgAFqQei8AxBLQai7A0GouwMgARBMQai8AyABIAEQTUHougNB6LoDQai9AxBMQai9A0GovQNBqL0DEExBqL0DQai9A0GovQMQTEGouwMgASABQcAAahBNIAFBwABqQei7AyABQcAAahBLIAFBwABqQai9AyABQcAAahBNQei8A0HovAMgAUGAAWoQTAvvAwIBfwF/IABBgAFqIQMgAUGAAWohBCAAEFMEQCABIAIQVQ8LIAEQUwRAIAAgAhBVDwsgAyADQei9AxBLIAQgBEGovgMQSyAAQai+A0HovgMQSyABQei9A0GovwMQSyADQei9A0HovwMQSyAEQai+A0GowAMQSyAAQcAAakGowANB6MADEEsgAUHAAGpB6L8DQajBAxBLQei+A0GovwMQUQRAQejAA0GowQMQUQRAIAAgAhBWDwsLQai/A0HovgNB6MEDEE1BqMEDQejAA0GowgMQTUHowQNB6MEDQejCAxBMQejCA0HowgNB6MIDEEtB6MEDQejCA0GowwMQS0GowgNBqMIDQejDAxBMQei+A0HowgNB6MQDEEtB6MMDQejDA0GoxAMQS0HoxANB6MQDQajFAxBMQajEA0GowwMgAhBNIAJBqMUDIAIQTUHowANBqMMDQejFAxBLQejFA0HoxQNB6MUDEExB6MQDIAIgAkHAAGoQTSACQcAAakHowwMgAkHAAGoQSyACQcAAakHoxQMgAkHAAGoQTSADIAQgAkGAAWoQTCACQYABaiACQYABaiACQYABahBLIAJBgAFqQei9AyACQYABahBNIAJBgAFqQai+AyACQYABahBNIAJBgAFqQejBAyACQYABahBLCyQAIAAgARBKIABBwABqIAFBwABqEE4gAEGAAWogAUGAAWoQSgsQACABIAIQWCAAIAIgAhBXCyQAIAAgARBQIABBwABqIAFBwABqEFAgAEGAAWogAUGAAWoQUAskACAAIAEQTyAAQcAAaiABQcAAahBPIABBgAFqIAFBgAFqEE8LWgAgABBTBEAgARBUBSAAQYABakGoxgMQUkGoxgNBqMYDQejGAxBLQajGA0HoxgNBqMcDEEsgAEHoxgMgARBLIABBwABqQajHAyABQcAAahBLIAFBgAFqEEkLC7ACAgF/AX8gAEHoxwMQVSADEFQgAiEEAkADQCAEQQFrIQQgASAEai0AACEFIAMgAxBWIAVBgAFPBEAgBUGAAWshBUHoxwMgAyADEFcLIAMgAxBWIAVBwABPBEAgBUHAAGshBUHoxwMgAyADEFcLIAMgAxBWIAVBIE8EQCAFQSBrIQVB6McDIAMgAxBXCyADIAMQViAFQRBPBEAgBUEQayEFQejHAyADIAMQVwsgAyADEFYgBUEITwRAIAVBCGshBUHoxwMgAyADEFcLIAMgAxBWIAVBBE8EQCAFQQRrIQVB6McDIAMgAxBXCyADIAMQViAFQQJPBEAgBUECayEFQejHAyADIAMQVwsgAyADEFYgBUEBTwRAIAVBAWshBUHoxwMgAyADEFcLIARFDQEMAAsLCysCAX8BfyAAQQV2QQJ0IQFBASAAQR9xdCECIAEgASgCqMkGIAJyNgKoyQYLJAIBfwF/IABBBXZBAnQhAUEBIABBH3F0IQIgASgCqMkGIAJxC6YBBAF/AX8BfwF/IAAhAkGoyQMQVEEAIQQCQANAIAQgAUYNAUGoyQNBASAEdEHAAWxqIQMgAhBHIQUgAiADEEogAkHAAGohAiADQcAAaiEDIAIgAxBKIAJBwABqIQIgA0HAAGohAyAFBEAgAxBIBSADEEkLIARBAWohBAwACwtBqMkGQpeChIAQNwMAQbDJBkIBNwMAQbjJBkIBNwMAQcDJBkIANwMAC0EDAX8BfwF/QajJAyAAQcABbGohASAAEF9FBEAgAC0AyMkGEGEhAiAALQDIywYQYSEDIAIgAyABEFcgABBeCyABC6UBBAF/AX8BfgF+QQAhAwJAA0AgA0EgRg0BQgAhBkEAIQQCQANAIAQgAUYNASAAIARBIGwgA2pqMQAAIQUgBSAFQhyGhEKPgICA8AGDIQUgBSAFQg6GhEKDgIyAsIDAAYMhBSAFIAVCB4aEQoGChIiQoMCAAYMhBSAGIAUgBK2GhCEGIARBAWohBAwACwsgAiADQQhsaiAGNwMAIANBAWohAwwACwsLSwEBfyAAIAJByM0GEGIgAxBUIAEgAhBgQQAhBAJAA0AgBEGAAkYNASADIAMQViADQcfPBiAEay0AABBhIAMQVyAEQQFqIQQMAAsLC34EAX8BfwF/AX8gACEFIAEhBiAFIAIgA24gA2xBIGxqIQgCQANAIAUgCEYNASAFIAYgA0HIzwYQY0HIzwYgBCAEEFcgBUEgIANsaiEFIAZBgAEgA2xqIQYMAAsLIAIgA3AhByAHBEAgBSAGIAdByM8GEGNByM8GIAQgBBBXCwtOAgF/AX8gACACQYjRBhBiIAEgAhBgQQAhBAJAA0AgBEGAAkYNASADIARBwAFsaiEFIAVBh9MGIARrLQAAEGEgBRBXIARBAWohBAwACwsLKQEBf0EAIQICQANAIAIgAUYNASAAIAJBwAFsahBUIAJBAWohAgwACwsLSAIBfwF/IAAhBCAEIAIQVSAEQcABaiEEQQEhAwJAA0AgAyABRg0BIAIgAhBWIAQgAiACEFcgBEHAAWohBCADQQFqIQMMAAsLC4oBBAF/AX8BfwF/QYjTBkGAAhBmIAAhBSABIQYgBSACIANuIANsQSBsaiEIAkADQCAFIAhGDQEgBSAGIANBiNMGEGUgBUEgIANsaiEFIAZBgAEgA2xqIQYMAAsLIAIgA3AhByAHBEAgBSAGIAdBiNMGEGULQYjTBkGAAkGI0wkQZ0GI0wkgBCAEEFcLJAEBfyADIQQCQANAIAAgASACEBIgBEEBayEEIARFDQEMAAsLCyQBAX8gAyEEAkADQCAAIAEgAhATIARBAWshBCAERQ0BDAALCwsL/hsSAEEACwRIagIAAEEICyABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABB6AcLIEf9fNgWjCA8jcpxaJFqgZddWIGBtkVQuCmgMeFyTmQwAEGICAsgifqKU1v8LPP7AUXUERnntfZ/QQr/HqtHHzW4ynGf2AYAQagICyCdDY/FjUNd0z0Lx/Uo63gKLEZ5eG+jbmYv3weawXcKDgBByAgLIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEHoDQsgAQAA8JP14UORcLl5SOgzKF1YgYG2RVC4KaAx4XJOZDAAQYgOCyCnbSGuRea4G+NZXOOxOv5ThYC7Uz2DSYylRE5/sdAWAgBBqA4LIPv//08cNJasKc1gn5V2/DYuRnl4b6NuZi/fB5rBdwoOAEHIDgsgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQYjcAQuAAgAAAAIABAQGAAgICggMDAwAEBASEBQUFBAYGBgYGBgcACAgIiAkJCQgKCgoKCgoLCAwMDAwMDA0MDAwODA4ODgAQEBCQEREREBISEhISEhMQFBQUFBQUFRQUFBYUFhYWEBgYGBgYGBkYGBgaGBoaGhgYGBwYHBwcGBwcHBwcHB4AICAgoCEhISAiIiIiIiIjICQkJCQkJCUkJCQmJCYmJiAoKCgoKCgpKCgoKigqKiooKCgsKCwsLCgsLCwsLCwuIDAwMDAwMDEwMDAyMDIyMjAwMDQwNDQ0MDQ0NDQ0NDYwMDA4MDg4ODA4ODg4ODg6MDg4ODg4ODw4ODg8ODw8PAAQYjeAQuAAgAAAAEAAQIBAAECAQQBAgMAAQIBBAECAwgBAgMEBQYDAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcAAQIBBAECAwgBAgMEBQYDEAECAwQFBgMICQoDDAUGByABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcgAQIDBAUGAwgJCgMMBQYHEBESAxQFBgcYCQoLDA0OB0ABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HICEiAyQFBgcoCQoLDA0OBzAREhMUFRYHGBkaCxwNDg8AQcilAwugB/v//08cNJasKc1gn5V2/DYuRnl4b6NuZi/fB5rBdwoOBgAAoHfBS5dno1jasnE38S4SCAlHouFR+sApR7HWWSKL79yelz11fyCRR7EsFz9fbmwJdHlisY3PCME5NXs3Kz98rbXiSq34voXLg//GYC33KZRdK/122anZmj/nfEAkA48vdHx9tvTMaNBj3C0baGpX+xvvvOWM/jy20lEpfBZkTFe/sfcUIvJ9MfcvI/kozXWtsKiEdeUDbRfcWfuBK0KecG6u8VG1znHA3RMpmJsOBYBC6VZzZO31B/wGuNMJgFNdsQYNFKuXWzG8zDovjE+ZBJIlN1l4NCbiWfDzshwAnKOeMZOPf4JXzPlZECV7fFP7zWe9g1asm6gYrsbsFzMECZKPksjJo/TZf6YBR9mLJ4/9+1Xmzt4OLRdwRY4VE6UgZnX5WZ2ZVwHqo0XnM2zdv2C/4paJx+I1twLvpiIudgBd/OlRSeWuZMGCrX128iJOQvGv4V+XE7D47etlI9kBPlZnQaSjJboMUrpemCwhbXCfkuALYy7ljTRjrYwPGmYZCIlu6JiUND20wnGJpQyvbkFNfcvYJ1nvfCLUBAERlgf+kG8TKjJxjFo7lZGQN1CWNzfy380mlBQCXqEpDNRyDoJMZGltDMJyc8g9YzCdm1pCQQw7VxcnCqB/QlgeELjTUZK0AZScwI809Zg83oOT1AeLGbXPYwx/RlvO7CngQ+GA5vdXj3vbSsX5Loork99rO4/jEMoAAl1nXrctKecj6qy4yOYv8R6NjwW1zvfwzRJ8H4QnUTCoubd9byIhzi1+AHOxdSTqeQVkX6otYtxn8e7Xdq71fylqiLEQ7iUzR54WRLPrASD4tYlq3XaJ3TQOTAP7n6IA4mGcFayzGX0R+krdZAdiV5Mti3GsHJG6+FYYISp3CMFg9aFV9WgXZIs6zEmo7UWQbqVH9LpafStbw6/v4Ua/Pkg47qP9/RfvaMRqvM7HsG9Jryf2s34eEapUzcyjkkpfuMOubR1HFMwGf4lFmV7tafi5x3bRxWN5uYLSR51EFtxVzV1/hyoj2h08y2o/HLkYoHNUZKTEngzfD2tkXfnp9i7EyNy6ei9uxcz31cVAdqfy89gf8xbnR/8w9Pae3HbbOE42ZfQcIrN9xQ6tQO/ha7dA7s7CGs1m0ftNi8+MHDB7M+wTiPEQuP45tsXHMpaZ8g8NQONcmNjssAEAiN2yKc6YbQ0HaR0AQeisAwugB/v//08cNJasKc1gn5V2/DYuRnl4b6NuZi/fB5rBdwoO/v//H9gUPHjdHo0Mby+Yr0VP/fySdF+PrL+cPRpjNx////8PbAoevG6PRoa3F8zXoqd+fkm6r0fWX84ejbGbDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAQYi0AwuAAgCAQMAgoGDgEJBQ0DCwcPAIiEjIKKho6BiYWNg4uHj4BIRExCSkZOQUlFTUNLR09AyMTMwsrGzsHJxc3Dy8fPwCgkLCIqJi4hKSUtIysnLyCopKyiqqauoamlraOrp6+gaGRsYmpmbmFpZW1ja2dvYOjk7OLq5u7h6eXt4+vn7+AYFBwSGhYeERkVHRMbFx8QmJSckpqWnpGZlZ2Tm5efkFhUXFJaVl5RWVVdU1tXX1DY1NzS2tbe0dnV3dPb19/QODQ8Mjo2PjE5NT0zOzc/MLi0vLK6tr6xubW9s7u3v7B4dHxyenZ+cXl1fXN7d39w+PT88vr2/vH59f3z+/f/8AQci3Awsgqu/tEolIw2hPv6pyaH8IjTESCAlHouFR+sApR7HWWSIAQcjJBguAAgAAAAIABAQGAAgICggMDAwAEBASEBQUFBAYGBgYGBgcACAgIiAkJCQgKCgoKCgoLCAwMDAwMDA0MDAwODA4ODgAQEBCQEREREBISEhISEhMQFBQUFBQUFRQUFBYUFhYWEBgYGBgYGBkYGBgaGBoaGhgYGBwYHBwcGBwcHBwcHB4AICAgoCEhISAiIiIiIiIjICQkJCQkJCUkJCQmJCYmJiAoKCgoKCgpKCgoKigqKiooKCgsKCwsLCgsLCwsLCwuIDAwMDAwMDEwMDAyMDIyMjAwMDQwNDQ0MDQ0NDQ0NDYwMDA4MDg4ODA4ODg4ODg6MDg4ODg4ODw4ODg8ODw8PAAQcjLBguAAgAAAAEAAQIBAAECAQQBAgMAAQIBBAECAwgBAgMEBQYDAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcAAQIBBAECAwgBAgMEBQYDEAECAwQFBgMICQoDDAUGByABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcgAQIDBAUGAwgJCgMMBQYHEBESAxQFBgcYCQoLDA0OB0ABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HICEiAyQFBgcoCQoLDA0OBzAREhMUFRYHGBkaCxwNDg8=","base64"),a.pq=1e3,a.pr=1768},9565:(e,a,t)=>{var c;e=t.nmd(e);var f=function(e){"use strict";var a=1e7,t=9007199254740992,c=l(t),d="0123456789abcdefghijklmnopqrstuvwxyz",r="function"==typeof BigInt;function n(e,a,t,c){return void 0===e?n[0]:void 0===a||10==+a&&!t?Z(e):q(e,a,t,c)}function i(e,a){this.value=e,this.sign=a,this.isSmall=!1}function b(e){this.value=e,this.sign=e<0,this.isSmall=!0}function o(e){this.value=e}function s(e){return-t0?Math.floor(e):Math.ceil(e)}function m(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(f=0;f=b?1:0,n[f]=c-i*b;for(;f0&&n.push(i),n}function x(e,a){return e.length>=a.length?m(e,a):m(a,e)}function y(e,t){var c,f,d=e.length,r=new Array(d),n=a;for(f=0;f0;)r[f++]=t%n,t=Math.floor(t/n);return r}function A(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(c=0;c0;)r[f++]=i%n,i=Math.floor(i/n);return r}function I(e,a){for(var t=[];a-- >0;)t.push(0);return t.concat(e)}function E(e,a){var t=Math.max(e.length,a.length);if(t<=30)return w(e,a);t=Math.ceil(t/2);var c=e.slice(t),f=e.slice(0,t),d=a.slice(t),r=a.slice(0,t),n=E(f,r),i=E(c,d),b=E(x(f,c),x(r,d)),o=x(x(n,I(A(A(b,n),i),t)),I(i,2*t));return h(o),o}function C(e,t,c){return new i(e=0;--c)d=(r=d*b+e[c])-(f=g(r/t))*t,i[c]=0|f;return[i,0|d]}function L(e,t){var c,f=Z(t);if(r)return[new o(e.value/f.value),new o(e.value%f.value)];var d,s=e.value,m=f.value;if(0===m)throw new Error("Cannot divide by zero");if(e.isSmall)return f.isSmall?[new b(g(s/m)),new b(s%m)]:[n[0],e];if(f.isSmall){if(1===m)return[e,n[0]];if(-1==m)return[e.negate(),n[0]];var x=Math.abs(m);if(x=0;f--){for(c=l-1,x[f+s]!==g&&(c=Math.floor((x[f+s]*l+x[f+s-1])/g)),d=0,r=0,i=y.length,n=0;nb&&(d=(d+1)*l),c=Math.ceil(d/r);do{if(S(n=_(t,c),s)<=0)break;c--}while(c);o.push(c),s=A(s,n)}return o.reverse(),[u(o),u(s)]}(s,m),d=c[0];var w=e.sign!==f.sign,I=c[1],E=e.sign;return"number"==typeof d?(w&&(d=-d),d=new b(d)):d=new i(d,w),"number"==typeof I?(E&&(I=-I),I=new b(I)):I=new i(I,E),[d,I]}function S(e,a){if(e.length!==a.length)return e.length>a.length?1:-1;for(var t=e.length-1;t>=0;t--)if(e[t]!==a[t])return e[t]>a[t]?1:-1;return 0}function k(e){var a=e.abs();return!a.isUnit()&&(!!(a.equals(2)||a.equals(3)||a.equals(5))||!(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))&&(!!a.lesser(49)||void 0))}function N(e,a){for(var t,c,d,r=e.prev(),n=r,i=0;n.isEven();)n=n.divide(2),i++;e:for(c=0;c=0?c=A(e,a):(c=A(a,e),t=!t),"number"==typeof(c=u(c))?(t&&(c=-c),new b(c)):new i(c,t)}(t,c,this.sign)},i.prototype.minus=i.prototype.subtract,b.prototype.subtract=function(e){var a=Z(e),t=this.value;if(t<0!==a.sign)return this.add(a.negate());var c=a.value;return a.isSmall?new b(t-c):v(c,Math.abs(t),t>=0)},b.prototype.minus=b.prototype.subtract,o.prototype.subtract=function(e){return new o(this.value-Z(e).value)},o.prototype.minus=o.prototype.subtract,i.prototype.negate=function(){return new i(this.value,!this.sign)},b.prototype.negate=function(){var e=this.sign,a=new b(-this.value);return a.sign=!e,a},o.prototype.negate=function(){return new o(-this.value)},i.prototype.abs=function(){return new i(this.value,!1)},b.prototype.abs=function(){return new b(Math.abs(this.value))},o.prototype.abs=function(){return new o(this.value>=0?this.value:-this.value)},i.prototype.multiply=function(e){var t,c,f,d=Z(e),r=this.value,b=d.value,o=this.sign!==d.sign;if(d.isSmall){if(0===b)return n[0];if(1===b)return this;if(-1===b)return this.negate();if((t=Math.abs(b))0?E(r,b):w(r,b),o)},i.prototype.times=i.prototype.multiply,b.prototype._multiplyBySmall=function(e){return s(e.value*this.value)?new b(e.value*this.value):C(Math.abs(e.value),l(Math.abs(this.value)),this.sign!==e.sign)},i.prototype._multiplyBySmall=function(e){return 0===e.value?n[0]:1===e.value?this:-1===e.value?this.negate():C(Math.abs(e.value),this.value,this.sign!==e.sign)},b.prototype.multiply=function(e){return Z(e)._multiplyBySmall(this)},b.prototype.times=b.prototype.multiply,o.prototype.multiply=function(e){return new o(this.value*Z(e).value)},o.prototype.times=o.prototype.multiply,i.prototype.square=function(){return new i(M(this.value),!1)},b.prototype.square=function(){var e=this.value*this.value;return s(e)?new b(e):new i(M(l(Math.abs(this.value))),!1)},o.prototype.square=function(e){return new o(this.value*this.value)},i.prototype.divmod=function(e){var a=L(this,e);return{quotient:a[0],remainder:a[1]}},o.prototype.divmod=b.prototype.divmod=i.prototype.divmod,i.prototype.divide=function(e){return L(this,e)[0]},o.prototype.over=o.prototype.divide=function(e){return new o(this.value/Z(e).value)},b.prototype.over=b.prototype.divide=i.prototype.over=i.prototype.divide,i.prototype.mod=function(e){return L(this,e)[1]},o.prototype.mod=o.prototype.remainder=function(e){return new o(this.value%Z(e).value)},b.prototype.remainder=b.prototype.mod=i.prototype.remainder=i.prototype.mod,i.prototype.pow=function(e){var a,t,c,f=Z(e),d=this.value,r=f.value;if(0===r)return n[1];if(0===d)return n[0];if(1===d)return n[1];if(-1===d)return f.isEven()?n[1]:n[-1];if(f.sign)return n[0];if(!f.isSmall)throw new Error("The exponent "+f.toString()+" is too large.");if(this.isSmall&&s(a=Math.pow(d,r)))return new b(g(a));for(t=this,c=n[1];!0&r&&(c=c.times(t),--r),0!==r;)r/=2,t=t.square();return c},b.prototype.pow=i.prototype.pow,o.prototype.pow=function(e){var a=Z(e),t=this.value,c=a.value,f=BigInt(0),d=BigInt(1),r=BigInt(2);if(c===f)return n[1];if(t===f)return n[0];if(t===d)return n[1];if(t===BigInt(-1))return a.isEven()?n[1]:n[-1];if(a.isNegative())return new o(f);for(var i=this,b=n[1];(c&d)===d&&(b=b.times(i),--c),c!==f;)c/=r,i=i.square();return b},i.prototype.modPow=function(e,a){if(e=Z(e),(a=Z(a)).isZero())throw new Error("Cannot take modPow with modulus 0");for(var t=n[1],c=this.mod(a);e.isPositive();){if(c.isZero())return n[0];e.isOdd()&&(t=t.multiply(c).mod(a)),e=e.divide(2),c=c.square().mod(a)}return t},o.prototype.modPow=b.prototype.modPow=i.prototype.modPow,i.prototype.compareAbs=function(e){var a=Z(e),t=this.value,c=a.value;return a.isSmall?1:S(t,c)},b.prototype.compareAbs=function(e){var a=Z(e),t=Math.abs(this.value),c=a.value;return a.isSmall?t===(c=Math.abs(c))?0:t>c?1:-1:-1},o.prototype.compareAbs=function(e){var a=this.value,t=Z(e).value;return(a=a>=0?a:-a)===(t=t>=0?t:-t)?0:a>t?1:-1},i.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return this.sign!==a.sign?a.sign?1:-1:a.isSmall?this.sign?-1:1:S(t,c)*(this.sign?-1:1)},i.prototype.compareTo=i.prototype.compare,b.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return a.isSmall?t==c?0:t>c?1:-1:t<0!==a.sign?t<0?-1:1:t<0?1:-1},b.prototype.compareTo=b.prototype.compare,o.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=this.value,t=Z(e).value;return a===t?0:a>t?1:-1},o.prototype.compareTo=o.prototype.compare,i.prototype.equals=function(e){return 0===this.compare(e)},o.prototype.eq=o.prototype.equals=b.prototype.eq=b.prototype.equals=i.prototype.eq=i.prototype.equals,i.prototype.notEquals=function(e){return 0!==this.compare(e)},o.prototype.neq=o.prototype.notEquals=b.prototype.neq=b.prototype.notEquals=i.prototype.neq=i.prototype.notEquals,i.prototype.greater=function(e){return this.compare(e)>0},o.prototype.gt=o.prototype.greater=b.prototype.gt=b.prototype.greater=i.prototype.gt=i.prototype.greater,i.prototype.lesser=function(e){return this.compare(e)<0},o.prototype.lt=o.prototype.lesser=b.prototype.lt=b.prototype.lesser=i.prototype.lt=i.prototype.lesser,i.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},o.prototype.geq=o.prototype.greaterOrEquals=b.prototype.geq=b.prototype.greaterOrEquals=i.prototype.geq=i.prototype.greaterOrEquals,i.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},o.prototype.leq=o.prototype.lesserOrEquals=b.prototype.leq=b.prototype.lesserOrEquals=i.prototype.leq=i.prototype.lesserOrEquals,i.prototype.isEven=function(){return!(1&this.value[0])},b.prototype.isEven=function(){return!(1&this.value)},o.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},i.prototype.isOdd=function(){return!(1&~this.value[0])},b.prototype.isOdd=function(){return!(1&~this.value)},o.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},i.prototype.isPositive=function(){return!this.sign},b.prototype.isPositive=function(){return this.value>0},o.prototype.isPositive=b.prototype.isPositive,i.prototype.isNegative=function(){return this.sign},b.prototype.isNegative=function(){return this.value<0},o.prototype.isNegative=b.prototype.isNegative,i.prototype.isUnit=function(){return!1},b.prototype.isUnit=function(){return 1===Math.abs(this.value)},o.prototype.isUnit=function(){return this.abs().value===BigInt(1)},i.prototype.isZero=function(){return!1},b.prototype.isZero=function(){return 0===this.value},o.prototype.isZero=function(){return this.value===BigInt(0)},i.prototype.isDivisibleBy=function(e){var a=Z(e);return!a.isZero()&&(!!a.isUnit()||(0===a.compareAbs(2)?this.isEven():this.mod(a).isZero()))},o.prototype.isDivisibleBy=b.prototype.isDivisibleBy=i.prototype.isDivisibleBy,i.prototype.isPrime=function(a){var t=k(this);if(t!==e)return t;var c=this.abs(),d=c.bitLength();if(d<=64)return N(c,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var r=Math.log(2)*d.toJSNumber(),n=Math.ceil(!0===a?2*Math.pow(r,2):r),i=[],b=0;b-t?new b(e-1):new i(c,!0)},o.prototype.prev=function(){return new o(this.value-BigInt(1))};for(var P=[1];2*P[P.length-1]<=a;)P.push(2*P[P.length-1]);var R=P.length,O=P[R-1];function D(e){return Math.abs(e)<=a}function T(e,a,t){a=Z(a);for(var c=e.isNegative(),d=a.isNegative(),r=c?e.not():e,n=d?a.not():a,i=0,b=0,o=null,s=null,l=[];!r.isZero()||!n.isZero();)i=(o=L(r,O))[1].toJSNumber(),c&&(i=O-1-i),b=(s=L(n,O))[1].toJSNumber(),d&&(b=O-1-b),r=o[0],n=s[0],l.push(t(i,b));for(var u=0!==t(c?1:0,d?1:0)?f(-1):f(0),h=l.length-1;h>=0;h-=1)u=u.multiply(O).add(f(l[h]));return u}i.prototype.shiftLeft=function(e){var a=Z(e).toJSNumber();if(!D(a))throw new Error(String(a)+" is too large for shifting.");if(a<0)return this.shiftRight(-a);var t=this;if(t.isZero())return t;for(;a>=R;)t=t.multiply(O),a-=R-1;return t.multiply(P[a])},o.prototype.shiftLeft=b.prototype.shiftLeft=i.prototype.shiftLeft,i.prototype.shiftRight=function(e){var a,t=Z(e).toJSNumber();if(!D(t))throw new Error(String(t)+" is too large for shifting.");if(t<0)return this.shiftLeft(-t);for(var c=this;t>=R;){if(c.isZero()||c.isNegative()&&c.isUnit())return c;c=(a=L(c,O))[1].isNegative()?a[0].prev():a[0],t-=R-1}return(a=L(c,P[t]))[1].isNegative()?a[0].prev():a[0]},o.prototype.shiftRight=b.prototype.shiftRight=i.prototype.shiftRight,i.prototype.not=function(){return this.negate().prev()},o.prototype.not=b.prototype.not=i.prototype.not,i.prototype.and=function(e){return T(this,e,(function(e,a){return e&a}))},o.prototype.and=b.prototype.and=i.prototype.and,i.prototype.or=function(e){return T(this,e,(function(e,a){return e|a}))},o.prototype.or=b.prototype.or=i.prototype.or,i.prototype.xor=function(e){return T(this,e,(function(e,a){return e^a}))},o.prototype.xor=b.prototype.xor=i.prototype.xor;var F=1<<30;function Q(e){var t=e.value,c="number"==typeof t?t|F:"bigint"==typeof t?t|BigInt(F):t[0]+t[1]*a|1073758208;return c&-c}function U(e,a){if(a.compareTo(e)<=0){var t=U(e,a.square(a)),c=t.p,d=t.e,r=c.multiply(a);return r.compareTo(e)<=0?{p:r,e:2*d+1}:{p:c,e:2*d}}return{p:f(1),e:0}}function j(e,a){return e=Z(e),a=Z(a),e.greater(a)?e:a}function H(e,a){return e=Z(e),a=Z(a),e.lesser(a)?e:a}function $(e,a){if(e=Z(e).abs(),a=Z(a).abs(),e.equals(a))return e;if(e.isZero())return a;if(a.isZero())return e;for(var t,c,f=n[1];e.isEven()&&a.isEven();)t=H(Q(e),Q(a)),e=e.divide(t),a=a.divide(t),f=f.multiply(t);for(;e.isEven();)e=e.divide(Q(e));do{for(;a.isEven();)a=a.divide(Q(a));e.greater(a)&&(c=a,a=e,e=c),a=a.subtract(e)}while(!a.isZero());return f.isUnit()?e:e.multiply(f)}i.prototype.bitLength=function(){var e=this;return e.compareTo(f(0))<0&&(e=e.negate().subtract(f(1))),0===e.compareTo(f(0))?f(0):f(U(e,f(2)).e).add(f(1))},o.prototype.bitLength=b.prototype.bitLength=i.prototype.bitLength;var q=function(e,a,t,c){t=t||d,e=String(e),c||(e=e.toLowerCase(),t=t.toLowerCase());var f,r=e.length,n=Math.abs(a),i={};for(f=0;f=n){if("1"===s&&1===n)continue;throw new Error(s+" is not a valid digit in base "+a+".")}a=Z(a);var b=[],o="-"===e[0];for(f=o?1:0;f"!==e[f]&&f=0;c--)f=f.add(e[c].times(d)),d=d.times(a);return t?f.negate():f}function z(e,a){if((a=f(a)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(a.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var t=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return t.unshift([1]),{value:[].concat.apply([],t),isNegative:!1}}var c=!1;if(e.isNegative()&&a.isPositive()&&(c=!0,e=e.abs()),a.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:c};for(var d,r=[],n=e;n.isNegative()||n.compareAbs(a)>=0;){d=n.divmod(a),n=d.quotient;var i=d.remainder;i.isNegative()&&(i=a.minus(i).abs(),n=n.next()),r.push(i.toJSNumber())}return r.push(n.toJSNumber()),{value:r.reverse(),isNegative:c}}function K(e,a,t){var c=z(e,a);return(c.isNegative?"-":"")+c.value.map((function(e){return function(e,a){return e<(a=a||d).length?a[e]:"<"+e+">"}(e,t)})).join("")}function V(e){if(s(+e)){var a=+e;if(a===g(a))return r?new o(BigInt(a)):new b(a);throw new Error("Invalid integer: "+e)}var t="-"===e[0];t&&(e=e.slice(1));var c=e.split(/e/i);if(c.length>2)throw new Error("Invalid integer: "+c.join("e"));if(2===c.length){var f=c[1];if("+"===f[0]&&(f=f.slice(1)),(f=+f)!==g(f)||!s(f))throw new Error("Invalid integer: "+f+" is not a valid exponent.");var d=c[0],n=d.indexOf(".");if(n>=0&&(f-=d.length-n-1,d=d.slice(0,n)+d.slice(n+1)),f<0)throw new Error("Cannot include negative exponent part for integers");e=d+=new Array(f+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);if(r)return new o(BigInt(t?"-"+e:e));for(var l=[],u=e.length,p=u-7;u>0;)l.push(+e.slice(p,u)),(p-=7)<0&&(p=0),u-=7;return h(l),new i(l,t)}function Z(e){return"number"==typeof e?function(e){if(r)return new o(BigInt(e));if(s(e)){if(e!==g(e))throw new Error(e+" is not an integer.");return new b(e)}return V(e.toString())}(e):"string"==typeof e?V(e):"bigint"==typeof e?new o(e):e}i.prototype.toArray=function(e){return z(this,e)},b.prototype.toArray=function(e){return z(this,e)},o.prototype.toArray=function(e){return z(this,e)},i.prototype.toString=function(a,t){if(a===e&&(a=10),10!==a)return K(this,a,t);for(var c,f=this.value,d=f.length,r=String(f[--d]);--d>=0;)c=String(f[d]),r+="0000000".slice(c.length)+c;return(this.sign?"-":"")+r},b.prototype.toString=function(a,t){return a===e&&(a=10),10!=a?K(this,a,t):String(this.value)},o.prototype.toString=b.prototype.toString,o.prototype.toJSON=i.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()},i.prototype.valueOf=function(){return parseInt(this.toString(),10)},i.prototype.toJSNumber=i.prototype.valueOf,b.prototype.valueOf=function(){return this.value},b.prototype.toJSNumber=b.prototype.valueOf,o.prototype.valueOf=o.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var J=0;J<1e3;J++)n[J]=Z(J),J>0&&(n[-J]=Z(-J));return n.one=n[1],n.zero=n[0],n.minusOne=n[-1],n.max=j,n.min=H,n.gcd=$,n.lcm=function(e,a){return e=Z(e).abs(),a=Z(a).abs(),e.divide($(e,a)).multiply(a)},n.isInstance=function(e){return e instanceof i||e instanceof b||e instanceof o},n.randBetween=function(e,t){var c=H(e=Z(e),t=Z(t)),f=j(e,t).subtract(c).add(1);if(f.isSmall)return c.add(Math.floor(Math.random()*f));for(var d=z(f,a).value,r=[],i=!0,b=0;b{const c=t(9565),f=t(71293),d=t(94148),r="undefined"!=typeof window;let n,i;r||(n=t(5183).Worker,i=t(91565));class b{constructor(){this.promise=new Promise(((e,a)=>{this.reject=a,this.resolve=e}))}}function o(e){let a,t,c;function f(e){for(;3&c[0];)c[0]++;const a=c[0];for(c[0]+=e;c[0]>t.buffer.byteLength;)t.grow(100);return c=new Uint32Array(t.buffer),a}function d(e){const a=f(e.byteLength),t=new Uint32Array(e);return c.set(t,a/4),a}function r(e,a){return t.buffer.slice(e,e+a)}e.onmessage=function(n){let i;if(i=n.data?n.data:n,"INIT"==i.command)(async function(e){const f=new Uint8Array(e.code),d=await WebAssembly.compile(f);t=new WebAssembly.Memory({initial:e.init}),c=new Uint32Array(t.buffer),a=await WebAssembly.instantiate(d,{env:{memory:t}})})(i).then((function(){e.postMessage(i.result)}));else if("G1_MULTIEXP"==i.command){const t=c[0],n=d(i.scalars),b=d(i.points),o=f(96);a.exports.g1_zero(o),a.exports.g1_multiexp2(n,b,i.n,7,o),i.result=r(o,96),c[0]=t,e.postMessage(i.result,[i.result])}else if("G2_MULTIEXP"==i.command){const t=c[0],n=d(i.scalars),b=d(i.points),o=f(192);a.exports.g2_zero(o),a.exports.g2_multiexp(n,b,i.n,7,o),i.result=r(o,192),c[0]=t,e.postMessage(i.result,[i.result])}else if("CALC_H"==i.command){const t=c[0],n=d(i.signals),b=d(i.polsA),o=d(i.polsB),s=i.nSignals,l=i.domainSize,u=f(32*s),h=f(32*l),p=f(32*l),g=f(32*l*2),m=f(32*l*2);a.exports.fft_toMontgomeryN(n,u,s),a.exports.pol_zero(h,l),a.exports.pol_zero(p,l),a.exports.pol_constructLC(b,u,s,h),a.exports.pol_constructLC(o,u,s,p),a.exports.fft_copyNInterleaved(h,g,l),a.exports.fft_copyNInterleaved(p,m,l),a.exports.fft_ifft(h,l,0),a.exports.fft_ifft(p,l,0),a.exports.fft_fft(h,l,1),a.exports.fft_fft(p,l,1),a.exports.fft_copyNInterleaved(h,g+32,l),a.exports.fft_copyNInterleaved(p,m+32,l),a.exports.fft_mulN(g,m,2*l,g),a.exports.fft_ifft(g,2*l,0),a.exports.fft_fromMontgomeryN(g+32*l,g+32*l,l),i.result=r(g+32*l,32*l),c[0]=t,e.postMessage(i.result,[i.result])}else"TERMINATE"==i.command&&process.exit()}}class s{constructor(){this.actionQueue=[]}postAction(e,a,t,c){return d(0==this.working[e]),this.working[e]=!0,this.pendingDeferreds[e]=c||new b,this.workers[e].postMessage(a,t),this.pendingDeferreds[e].promise}processWorks(){for(let e=0;e0;e++)if(0==this.working[e]){const a=this.actionQueue.shift();this.postAction(e,a.data,a.transfers,a.deferred)}}queueAction(e,a){const t=new b;return this.actionQueue.push({data:e,transfers:a,deferred:t}),this.processWorks(),t.promise}alloc(e){for(;3&this.i32[0];)this.i32[0]++;const a=this.i32[0];return this.i32[0]+=e,a}putBin(e,a){const t=new Uint32Array(a);this.i32.set(t,e/4)}getBin(e,a){return this.memory.buffer.slice(e,e+a)}bin2int(e){const a=new Uint32Array(e);let t=c(a[7]);for(let e=6;e>=0;e--)t=t.shiftLeft(32),t=t.add(a[e]);return t.toString()}bin2g1(e){return[this.bin2int(e.slice(0,32)),this.bin2int(e.slice(32,64)),this.bin2int(e.slice(64,96))]}bin2g2(e){return[[this.bin2int(e.slice(0,32)),this.bin2int(e.slice(32,64))],[this.bin2int(e.slice(64,96)),this.bin2int(e.slice(96,128))],[this.bin2int(e.slice(128,160)),this.bin2int(e.slice(160,192))]]}async g1_multiexp(e,a){const t=e.byteLength/32,c=Math.floor(t/this.workers.length),f=[];for(let d=0;dthis.g1_multiexp(e,v))),B=this.g1_multiexp(e.slice(0),m),L=this.g1_multiexp(e.slice(0),x),S=this.g2_multiexp(e.slice(0),y),k=this.g1_multiexp(e.slice(32*(f+1)),A),N=await Promise.all([B,L,S,k,M]),P=this.alloc(96),R=this.alloc(192),O=this.alloc(96),D=this.alloc(96);this.putBin(P,N[0]),this.putBin(D,N[1]),this.putBin(R,N[2]),this.putBin(O,N[3]);const T=this.loadPoint1(w),F=this.loadPoint1(_),Q=this.loadPoint1(I),U=this.loadPoint2(E),j=this.loadPoint2(C);let H=new Uint32Array(8);const $=this.alloc(96),q=this.alloc(192),G=this.alloc(32),z=this.alloc(32);if(r)window.crypto.getRandomValues(H),this.putBin(G,H),window.crypto.getRandomValues(H),this.putBin(z,H);else{const e=i.randomBytes(32);this.putBin(G,e);const a=i.randomBytes(32);this.putBin(z,a)}this.instance.exports.g1_add(T,P,P),this.instance.exports.g1_timesScalar(Q,G,32,$),this.instance.exports.g1_add($,P,P),this.instance.exports.g2_add(U,R,R),this.instance.exports.g2_timesScalar(j,z,32,q),this.instance.exports.g2_add(q,R,R),this.instance.exports.g1_add(F,D,D),this.instance.exports.g1_timesScalar(Q,z,32,$),this.instance.exports.g1_add($,D,D),this.putBin($,N[4]),this.instance.exports.g1_add($,O,O),this.instance.exports.g1_timesScalar(P,z,32,$),this.instance.exports.g1_add($,O,O),this.instance.exports.g1_timesScalar(D,G,32,$),this.instance.exports.g1_add($,O,O);const K=this.alloc(64);return this.instance.exports.int_mul(G,z,K),this.instance.exports.g1_timesScalar(Q,K,64,$),this.instance.exports.g1_neg($,$),this.instance.exports.g1_add($,O,O),this.instance.exports.g1_affine(P,P),this.instance.exports.g2_affine(R,R),this.instance.exports.g1_affine(O,O),this.instance.exports.g1_fromMontgomery(P,P),this.instance.exports.g2_fromMontgomery(R,R),this.instance.exports.g1_fromMontgomery(O,O),{pi_a:this.bin2g1(this.getBin(P,96)),pi_b:this.bin2g2(this.getBin(R,192)),pi_c:this.bin2g1(this.getBin(O,96))}}}e.exports=async function(e){const a={wasmInitialMemory:5e3};Object.assign(a,e);const t=new s;t.q=c("21888242871839275222246405745257275088696311157297823662689037894645226208583"),t.r=c("21888242871839275222246405745257275088548364400416034343698204186575808495617"),t.n64=Math.floor((t.q.minus(1).bitLength()-1)/64)+1,t.n32=2*t.n64,t.n8=8*t.n64,t.memory=new WebAssembly.Memory({initial:a.wasmInitialMemory}),t.i32=new Uint32Array(t.memory.buffer);const d=await WebAssembly.compile(f.code);let i;function b(e){return function(a){let c;c=a&&a.data?a.data:a,t.working[e]=!1,t.pendingDeferreds[e].resolve(c),t.processWorks()}}t.instance=await WebAssembly.instantiate(d,{env:{memory:t.memory}}),t.pq=f.pq,t.pr=f.pr,t.pr0=t.alloc(192),t.pr1=t.alloc(192),t.workers=[],t.pendingDeferreds=[],t.working=[],i="object"==typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:8;for(let e=0;e{const c=t(9565),f=t(98665),d=t(27351),r=t(56274).cL,n=(t(56274).XL,t(56274).ex,t(56274).Hf),i=t(73248).e,b=t(73248).H;e.exports={bigInt2BytesLE:function(e,a){const t=Array(a);let f=c(e);for(let e=0;efunction(e){let a=e.toString(16);for(;a.length<64;)a="0"+a;return a}(e))).join("")};return e.publicSignals&&(a.publicSignals=r(n(e.publicSignals))),a},genWitnessAndProve:async function(e,a,t,c){const r=function(e,a){const t=new f(b(a)),c=t.calculateWitness(b(e)),d=c.slice(1,t.nPubInputs+t.nOutputs+1);return{witness:c,publicSignals:d}}(a,t),n=function(e){const a=32*e.length,t=new ArrayBuffer(a),c={dataView:new DataView(t),offset:0},f=d(4294967295);for(let a=0;a{const c=t(9565);e.exports.ex=function e(a){if("bigint"==typeof a||a instanceof c)return a.toString(10);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a},e.exports.Hf=function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return c(a);if(Array.isArray(a))return a.map(e);if("object"!=typeof a||a instanceof c)return a;{const t={};for(let c in a)t[c]=e(a[c]);return t}},e.exports.cL=function e(a){if("bigInt"==typeof a||a instanceof c){let e=a.toString(16);for(;e.length<64;)e="0"+e;return e="0x"+e,e}if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a},e.exports.XL=function e(a){if("string"==typeof a&&/^0x[0-9a-fA-F]+$/.test(a))return c(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a}},63282:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MissingRefError=a.ValidationError=a.CodeGen=a.Name=a.nil=a.stringify=a.str=a._=a.KeywordCxt=a.Ajv=void 0;const c=t(4042),f=t(86144),d=t(36653),r=t(72079),n=["/properties"],i="http://json-schema.org/draft-07/schema";class b extends c.default{_addVocabularies(){super._addVocabularies(),f.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(d.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(r,n):r;this.addMetaSchema(e,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}a.Ajv=b,e.exports=a=b,e.exports.Ajv=b,Object.defineProperty(a,"__esModule",{value:!0}),a.default=b;var o=t(62586);Object.defineProperty(a,"KeywordCxt",{enumerable:!0,get:function(){return o.KeywordCxt}});var s=t(99029);Object.defineProperty(a,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(a,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});var l=t(13558);Object.defineProperty(a,"ValidationError",{enumerable:!0,get:function(){return l.default}});var u=t(34551);Object.defineProperty(a,"MissingRefError",{enumerable:!0,get:function(){return u.default}})},41520:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.regexpCode=a.getEsmExportName=a.getProperty=a.safeStringify=a.stringify=a.strConcat=a.addCodeArg=a.str=a._=a.nil=a._Code=a.Name=a.IDENTIFIER=a._CodeOrName=void 0;class t{}a._CodeOrName=t,a.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class c extends t{constructor(e){if(super(),!a.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}a.Name=c;class f extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,a)=>`${e}${a}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,a)=>(a instanceof c&&(e[a.str]=(e[a.str]||0)+1),e)),{})}}function d(e,...a){const t=[e[0]];let c=0;for(;c{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.or=a.and=a.not=a.CodeGen=a.operators=a.varKinds=a.ValueScopeName=a.ValueScope=a.Scope=a.Name=a.regexpCode=a.stringify=a.getProperty=a.nil=a.strConcat=a.str=a._=void 0;const c=t(41520),f=t(57845);var d=t(41520);Object.defineProperty(a,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(a,"strConcat",{enumerable:!0,get:function(){return d.strConcat}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(a,"getProperty",{enumerable:!0,get:function(){return d.getProperty}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(a,"regexpCode",{enumerable:!0,get:function(){return d.regexpCode}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return d.Name}});var r=t(57845);Object.defineProperty(a,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(a,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(a,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(a,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),a.operators={GT:new c._Code(">"),GTE:new c._Code(">="),LT:new c._Code("<"),LTE:new c._Code("<="),EQ:new c._Code("==="),NEQ:new c._Code("!=="),NOT:new c._Code("!"),OR:new c._Code("||"),AND:new c._Code("&&"),ADD:new c._Code("+")};class n{optimizeNodes(){return this}optimizeNames(e,a){return this}}class i extends n{constructor(e,a,t){super(),this.varKind=e,this.name=a,this.rhs=t}render({es5:e,_n:a}){const t=e?f.varKinds.var:this.varKind,c=void 0===this.rhs?"":` = ${this.rhs}`;return`${t} ${this.name}${c};`+a}optimizeNames(e,a){if(e[this.name.str])return this.rhs&&(this.rhs=k(this.rhs,e,a)),this}get names(){return this.rhs instanceof c._CodeOrName?this.rhs.names:{}}}class b extends n{constructor(e,a,t){super(),this.lhs=e,this.rhs=a,this.sideEffects=t}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,a){if(!(this.lhs instanceof c.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=k(this.rhs,e,a),this}get names(){return S(this.lhs instanceof c.Name?{}:{...this.lhs.names},this.rhs)}}class o extends b{constructor(e,a,t,c){super(e,t,c),this.op=a}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class s extends n{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class l extends n{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class u extends n{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class h extends n{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,a){return this.code=k(this.code,e,a),this}get names(){return this.code instanceof c._CodeOrName?this.code.names:{}}}class p extends n{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((a,t)=>a+t.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let a=e.length;for(;a--;){const t=e[a].optimizeNodes();Array.isArray(t)?e.splice(a,1,...t):t?e[a]=t:e.splice(a,1)}return e.length>0?this:void 0}optimizeNames(e,a){const{nodes:t}=this;let c=t.length;for(;c--;){const f=t[c];f.optimizeNames(e,a)||(N(e,f.names),t.splice(c,1))}return t.length>0?this:void 0}get names(){return this.nodes.reduce(((e,a)=>L(e,a.names)),{})}}class g extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends p{}class x extends g{}x.kind="else";class y extends g{constructor(e,a){super(a),this.condition=e}render(e){let a=`if(${this.condition})`+super.render(e);return this.else&&(a+="else "+this.else.render(e)),a}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let a=this.else;if(a){const e=a.optimizeNodes();a=this.else=Array.isArray(e)?new x(e):e}return a?!1===e?a instanceof y?a:a.nodes:this.nodes.length?this:new y(P(e),a instanceof y?[a]:a.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,a){var t;if(this.else=null===(t=this.else)||void 0===t?void 0:t.optimizeNames(e,a),super.optimizeNames(e,a)||this.else)return this.condition=k(this.condition,e,a),this}get names(){const e=super.names;return S(e,this.condition),this.else&&L(e,this.else.names),e}}y.kind="if";class A extends g{}A.kind="for";class v extends A{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,a){if(super.optimizeNames(e,a))return this.iteration=k(this.iteration,e,a),this}get names(){return L(super.names,this.iteration.names)}}class w extends A{constructor(e,a,t,c){super(),this.varKind=e,this.name=a,this.from=t,this.to=c}render(e){const a=e.es5?f.varKinds.var:this.varKind,{name:t,from:c,to:d}=this;return`for(${a} ${t}=${c}; ${t}<${d}; ${t}++)`+super.render(e)}get names(){const e=S(super.names,this.from);return S(e,this.to)}}class _ extends A{constructor(e,a,t,c){super(),this.loop=e,this.varKind=a,this.name=t,this.iterable=c}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,a){if(super.optimizeNames(e,a))return this.iterable=k(this.iterable,e,a),this}get names(){return L(super.names,this.iterable.names)}}class I extends g{constructor(e,a,t){super(),this.name=e,this.args=a,this.async=t}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}I.kind="func";class E extends p{render(e){return"return "+super.render(e)}}E.kind="return";class C extends g{render(e){let a="try"+super.render(e);return this.catch&&(a+=this.catch.render(e)),this.finally&&(a+=this.finally.render(e)),a}optimizeNodes(){var e,a;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(a=this.finally)||void 0===a||a.optimizeNodes(),this}optimizeNames(e,a){var t,c;return super.optimizeNames(e,a),null===(t=this.catch)||void 0===t||t.optimizeNames(e,a),null===(c=this.finally)||void 0===c||c.optimizeNames(e,a),this}get names(){const e=super.names;return this.catch&&L(e,this.catch.names),this.finally&&L(e,this.finally.names),e}}class M extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}M.kind="catch";class B extends g{render(e){return"finally"+super.render(e)}}function L(e,a){for(const t in a)e[t]=(e[t]||0)+(a[t]||0);return e}function S(e,a){return a instanceof c._CodeOrName?L(e,a.names):e}function k(e,a,t){return e instanceof c.Name?d(e):(f=e)instanceof c._Code&&f._items.some((e=>e instanceof c.Name&&1===a[e.str]&&void 0!==t[e.str]))?new c._Code(e._items.reduce(((e,a)=>(a instanceof c.Name&&(a=d(a)),a instanceof c._Code?e.push(...a._items):e.push(a),e)),[])):e;var f;function d(e){const c=t[e.str];return void 0===c||1!==a[e.str]?e:(delete a[e.str],c)}}function N(e,a){for(const t in a)e[t]=(e[t]||0)-(a[t]||0)}function P(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:c._`!${T(e)}`}B.kind="finally",a.CodeGen=class{constructor(e,a={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...a,_n:a.lines?"\n":""},this._extScope=e,this._scope=new f.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,a){const t=this._extScope.value(e,a);return(this._values[t.prefix]||(this._values[t.prefix]=new Set)).add(t),t}getScopeValue(e,a){return this._extScope.getValue(e,a)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,a,t,c){const f=this._scope.toName(a);return void 0!==t&&c&&(this._constants[f.str]=t),this._leafNode(new i(e,f,t)),f}const(e,a,t){return this._def(f.varKinds.const,e,a,t)}let(e,a,t){return this._def(f.varKinds.let,e,a,t)}var(e,a,t){return this._def(f.varKinds.var,e,a,t)}assign(e,a,t){return this._leafNode(new b(e,a,t))}add(e,t){return this._leafNode(new o(e,a.operators.ADD,t))}code(e){return"function"==typeof e?e():e!==c.nil&&this._leafNode(new h(e)),this}object(...e){const a=["{"];for(const[t,f]of e)a.length>1&&a.push(","),a.push(t),(t!==f||this.opts.es5)&&(a.push(":"),(0,c.addCodeArg)(a,f));return a.push("}"),new c._Code(a)}if(e,a,t){if(this._blockNode(new y(e)),a&&t)this.code(a).else().code(t).endIf();else if(a)this.code(a).endIf();else if(t)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new x)}endIf(){return this._endBlockNode(y,x)}_for(e,a){return this._blockNode(e),a&&this.code(a).endFor(),this}for(e,a){return this._for(new v(e),a)}forRange(e,a,t,c,d=(this.opts.es5?f.varKinds.var:f.varKinds.let)){const r=this._scope.toName(e);return this._for(new w(d,r,a,t),(()=>c(r)))}forOf(e,a,t,d=f.varKinds.const){const r=this._scope.toName(e);if(this.opts.es5){const e=a instanceof c.Name?a:this.var("_arr",a);return this.forRange("_i",0,c._`${e}.length`,(a=>{this.var(r,c._`${e}[${a}]`),t(r)}))}return this._for(new _("of",d,r,a),(()=>t(r)))}forIn(e,a,t,d=(this.opts.es5?f.varKinds.var:f.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,c._`Object.keys(${a})`,t);const r=this._scope.toName(e);return this._for(new _("in",d,r,a),(()=>t(r)))}endFor(){return this._endBlockNode(A)}label(e){return this._leafNode(new s(e))}break(e){return this._leafNode(new l(e))}return(e){const a=new E;if(this._blockNode(a),this.code(e),1!==a.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,a,t){if(!a&&!t)throw new Error('CodeGen: "try" without "catch" and "finally"');const c=new C;if(this._blockNode(c),this.code(e),a){const e=this.name("e");this._currNode=c.catch=new M(e),a(e)}return t&&(this._currNode=c.finally=new B,this.code(t)),this._endBlockNode(M,B)}throw(e){return this._leafNode(new u(e))}block(e,a){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(a),this}endBlock(e){const a=this._blockStarts.pop();if(void 0===a)throw new Error("CodeGen: not in self-balancing block");const t=this._nodes.length-a;if(t<0||void 0!==e&&t!==e)throw new Error(`CodeGen: wrong number of nodes: ${t} vs ${e} expected`);return this._nodes.length=a,this}func(e,a=c.nil,t,f){return this._blockNode(new I(e,a,t)),f&&this.code(f).endFunc(),this}endFunc(){return this._endBlockNode(I)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,a){const t=this._currNode;if(t instanceof e||a&&t instanceof a)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${a?`${e.kind}/${a.kind}`:e.kind}"`)}_elseNode(e){const a=this._currNode;if(!(a instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=a.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const a=this._nodes;a[a.length-1]=e}},a.not=P;const R=D(a.operators.AND);a.and=function(...e){return e.reduce(R)};const O=D(a.operators.OR);function D(e){return(a,t)=>a===c.nil?t:t===c.nil?a:c._`${T(a)} ${e} ${T(t)}`}function T(e){return e instanceof c.Name?e:c._`(${e})`}a.or=function(...e){return e.reduce(O)}},57845:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ValueScope=a.ValueScopeName=a.Scope=a.varKinds=a.UsedValueState=void 0;const c=t(41520);class f extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var d;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(d||(a.UsedValueState=d={})),a.varKinds={const:new c.Name("const"),let:new c.Name("let"),var:new c.Name("var")};class r{constructor({prefixes:e,parent:a}={}){this._names={},this._prefixes=e,this._parent=a}toName(e){return e instanceof c.Name?e:this.name(e)}name(e){return new c.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var a,t;if((null===(t=null===(a=this._parent)||void 0===a?void 0:a._prefixes)||void 0===t?void 0:t.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}a.Scope=r;class n extends c.Name{constructor(e,a){super(a),this.prefix=e}setValue(e,{property:a,itemIndex:t}){this.value=e,this.scopePath=c._`.${new c.Name(a)}[${t}]`}}a.ValueScopeName=n;const i=c._`\n`;a.ValueScope=class extends r{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?i:c.nil}}get(){return this._scope}name(e){return new n(e,this._newName(e))}value(e,a){var t;if(void 0===a.ref)throw new Error("CodeGen: ref must be passed in value");const c=this.toName(e),{prefix:f}=c,d=null!==(t=a.key)&&void 0!==t?t:a.ref;let r=this._values[f];if(r){const e=r.get(d);if(e)return e}else r=this._values[f]=new Map;r.set(d,c);const n=this._scope[f]||(this._scope[f]=[]),i=n.length;return n[i]=a.ref,c.setValue(a,{property:f,itemIndex:i}),c}getValue(e,a){const t=this._values[e];if(t)return t.get(a)}scopeRefs(e,a=this._values){return this._reduceValues(a,(a=>{if(void 0===a.scopePath)throw new Error(`CodeGen: name "${a}" has no value`);return c._`${e}${a.scopePath}`}))}scopeCode(e=this._values,a,t){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),a,t)}_reduceValues(e,t,r={},n){let i=c.nil;for(const b in e){const o=e[b];if(!o)continue;const s=r[b]=r[b]||new Map;o.forEach((e=>{if(s.has(e))return;s.set(e,d.Started);let r=t(e);if(r){const t=this.opts.es5?a.varKinds.var:a.varKinds.const;i=c._`${i}${t} ${e} = ${r};${this.opts._n}`}else{if(!(r=null==n?void 0:n(e)))throw new f(e);i=c._`${i}${r}${this.opts._n}`}s.set(e,d.Completed)}))}return i}}},48708:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extendErrors=a.resetErrorsCount=a.reportExtraError=a.reportError=a.keyword$DataError=a.keywordError=void 0;const c=t(99029),f=t(94227),d=t(42023);function r(e,a){const t=e.const("err",a);e.if(c._`${d.default.vErrors} === null`,(()=>e.assign(d.default.vErrors,c._`[${t}]`)),c._`${d.default.vErrors}.push(${t})`),e.code(c._`${d.default.errors}++`)}function n(e,a){const{gen:t,validateName:f,schemaEnv:d}=e;d.$async?t.throw(c._`new ${e.ValidationError}(${a})`):(t.assign(c._`${f}.errors`,a),t.return(!1))}a.keywordError={message:({keyword:e})=>c.str`must pass "${e}" keyword validation`},a.keyword$DataError={message:({keyword:e,schemaType:a})=>a?c.str`"${e}" keyword must be ${a} ($data)`:c.str`"${e}" keyword is invalid ($data)`},a.reportError=function(e,t=a.keywordError,f,d){const{it:i}=e,{gen:o,compositeRule:s,allErrors:l}=i,u=b(e,t,f);(null!=d?d:s||l)?r(o,u):n(i,c._`[${u}]`)},a.reportExtraError=function(e,t=a.keywordError,c){const{it:f}=e,{gen:i,compositeRule:o,allErrors:s}=f;r(i,b(e,t,c)),o||s||n(f,d.default.vErrors)},a.resetErrorsCount=function(e,a){e.assign(d.default.errors,a),e.if(c._`${d.default.vErrors} !== null`,(()=>e.if(a,(()=>e.assign(c._`${d.default.vErrors}.length`,a)),(()=>e.assign(d.default.vErrors,null)))))},a.extendErrors=function({gen:e,keyword:a,schemaValue:t,data:f,errsCount:r,it:n}){if(void 0===r)throw new Error("ajv implementation error");const i=e.name("err");e.forRange("i",r,d.default.errors,(r=>{e.const(i,c._`${d.default.vErrors}[${r}]`),e.if(c._`${i}.instancePath === undefined`,(()=>e.assign(c._`${i}.instancePath`,(0,c.strConcat)(d.default.instancePath,n.errorPath)))),e.assign(c._`${i}.schemaPath`,c.str`${n.errSchemaPath}/${a}`),n.opts.verbose&&(e.assign(c._`${i}.schema`,t),e.assign(c._`${i}.data`,f))}))};const i={keyword:new c.Name("keyword"),schemaPath:new c.Name("schemaPath"),params:new c.Name("params"),propertyName:new c.Name("propertyName"),message:new c.Name("message"),schema:new c.Name("schema"),parentSchema:new c.Name("parentSchema")};function b(e,a,t){const{createErrors:f}=e.it;return!1===f?c._`{}`:function(e,a,t={}){const{gen:f,it:r}=e,n=[o(r,t),s(e,t)];return function(e,{params:a,message:t},f){const{keyword:r,data:n,schemaValue:b,it:o}=e,{opts:s,propertyName:l,topSchemaRef:u,schemaPath:h}=o;f.push([i.keyword,r],[i.params,"function"==typeof a?a(e):a||c._`{}`]),s.messages&&f.push([i.message,"function"==typeof t?t(e):t]),s.verbose&&f.push([i.schema,b],[i.parentSchema,c._`${u}${h}`],[d.default.data,n]),l&&f.push([i.propertyName,l])}(e,a,n),f.object(...n)}(e,a,t)}function o({errorPath:e},{instancePath:a}){const t=a?c.str`${e}${(0,f.getErrorPath)(a,f.Type.Str)}`:e;return[d.default.instancePath,(0,c.strConcat)(d.default.instancePath,t)]}function s({keyword:e,it:{errSchemaPath:a}},{schemaPath:t,parentSchema:d}){let r=d?a:c.str`${a}/${e}`;return t&&(r=c.str`${r}${(0,f.getErrorPath)(t,f.Type.Str)}`),[i.schemaPath,r]}},73835:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.resolveSchema=a.getCompilingSchema=a.resolveRef=a.compileSchema=a.SchemaEnv=void 0;const c=t(99029),f=t(13558),d=t(42023),r=t(66939),n=t(94227),i=t(62586);class b{constructor(e){var a;let t;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(a=e.baseId)&&void 0!==a?a:(0,r.normalizeId)(null==t?void 0:t[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==t?void 0:t.$async,this.refs={}}}function o(e){const a=l.call(this,e);if(a)return a;const t=(0,r.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:b}=this.opts.code,{ownProperties:o}=this.opts,s=new c.CodeGen(this.scope,{es5:n,lines:b,ownProperties:o});let u;e.$async&&(u=s.scopeValue("Error",{ref:f.default,code:c._`require("ajv/dist/runtime/validation_error").default`}));const h=s.scopeName("validate");e.validateName=h;const p={gen:s,allErrors:this.opts.allErrors,data:d.default.data,parentData:d.default.parentData,parentDataProperty:d.default.parentDataProperty,dataNames:[d.default.data],dataPathArr:[c.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,c.stringify)(e.schema)}:{ref:e.schema}),validateName:h,ValidationError:u,schema:e.schema,schemaEnv:e,rootId:t,baseId:e.baseId||t,schemaPath:c.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:c._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,i.validateFunctionCode)(p),s.optimize(this.opts.code.optimize);const a=s.toString();g=`${s.scopeRefs(d.default.scope)}return ${a}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const t=new Function(`${d.default.self}`,`${d.default.scope}`,g)(this,this.scope.get());if(this.scope.value(h,{ref:t}),t.errors=null,t.schema=e.schema,t.schemaEnv=e,e.$async&&(t.$async=!0),!0===this.opts.code.source&&(t.source={validateName:h,validateCode:a,scopeValues:s._values}),this.opts.unevaluated){const{props:e,items:a}=p;t.evaluated={props:e instanceof c.Name?void 0:e,items:a instanceof c.Name?void 0:a,dynamicProps:e instanceof c.Name,dynamicItems:a instanceof c.Name},t.source&&(t.source.evaluated=(0,c.stringify)(t.evaluated))}return e.validate=t,e}catch(a){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),a}finally{this._compilations.delete(e)}}function s(e){return(0,r.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:o.call(this,e)}function l(e){for(const c of this._compilations)if(t=e,(a=c).schema===t.schema&&a.root===t.root&&a.baseId===t.baseId)return c;var a,t}function u(e,a){let t;for(;"string"==typeof(t=this.refs[a]);)a=t;return t||this.schemas[a]||h.call(this,e,a)}function h(e,a){const t=this.opts.uriResolver.parse(a),c=(0,r._getFullPath)(this.opts.uriResolver,t);let f=(0,r.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&c===f)return g.call(this,t,e);const d=(0,r.normalizeId)(c),n=this.refs[d]||this.schemas[d];if("string"==typeof n){const a=h.call(this,e,n);if("object"!=typeof(null==a?void 0:a.schema))return;return g.call(this,t,a)}if("object"==typeof(null==n?void 0:n.schema)){if(n.validate||o.call(this,n),d===(0,r.normalizeId)(a)){const{schema:a}=n,{schemaId:t}=this.opts,c=a[t];return c&&(f=(0,r.resolveUrl)(this.opts.uriResolver,f,c)),new b({schema:a,schemaId:t,root:e,baseId:f})}return g.call(this,t,n)}}a.SchemaEnv=b,a.compileSchema=o,a.resolveRef=function(e,a,t){var c;t=(0,r.resolveUrl)(this.opts.uriResolver,a,t);const f=e.refs[t];if(f)return f;let d=u.call(this,e,t);if(void 0===d){const f=null===(c=e.localRefs)||void 0===c?void 0:c[t],{schemaId:r}=this.opts;f&&(d=new b({schema:f,schemaId:r,root:e,baseId:a}))}return void 0!==d?e.refs[t]=s.call(this,d):void 0},a.getCompilingSchema=l,a.resolveSchema=h;const p=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:a,schema:t,root:c}){var f;if("/"!==(null===(f=e.fragment)||void 0===f?void 0:f[0]))return;for(const c of e.fragment.slice(1).split("/")){if("boolean"==typeof t)return;const e=t[(0,n.unescapeFragment)(c)];if(void 0===e)return;const f="object"==typeof(t=e)&&t[this.opts.schemaId];!p.has(c)&&f&&(a=(0,r.resolveUrl)(this.opts.uriResolver,a,f))}let d;if("boolean"!=typeof t&&t.$ref&&!(0,n.schemaHasRulesButRef)(t,this.RULES)){const e=(0,r.resolveUrl)(this.opts.uriResolver,a,t.$ref);d=h.call(this,c,e)}const{schemaId:i}=this.opts;return d=d||new b({schema:t,schemaId:i,root:c,baseId:a}),d.schema!==d.root.schema?d:void 0}},42023:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={data:new c.Name("data"),valCxt:new c.Name("valCxt"),instancePath:new c.Name("instancePath"),parentData:new c.Name("parentData"),parentDataProperty:new c.Name("parentDataProperty"),rootData:new c.Name("rootData"),dynamicAnchors:new c.Name("dynamicAnchors"),vErrors:new c.Name("vErrors"),errors:new c.Name("errors"),this:new c.Name("this"),self:new c.Name("self"),scope:new c.Name("scope"),json:new c.Name("json"),jsonPos:new c.Name("jsonPos"),jsonLen:new c.Name("jsonLen"),jsonPart:new c.Name("jsonPart")};a.default=f},34551:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(66939);class f extends Error{constructor(e,a,t,f){super(f||`can't resolve reference ${t} from id ${a}`),this.missingRef=(0,c.resolveUrl)(e,a,t),this.missingSchema=(0,c.normalizeId)((0,c.getFullPath)(e,this.missingRef))}}a.default=f},66939:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getSchemaRefs=a.resolveUrl=a.normalizeId=a._getFullPath=a.getFullPath=a.inlineRef=void 0;const c=t(94227),f=t(32017),d=t(7106),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);a.inlineRef=function(e,a=!0){return"boolean"==typeof e||(!0===a?!i(e):!!a&&b(e)<=a)};const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(e){for(const a in e){if(n.has(a))return!0;const t=e[a];if(Array.isArray(t)&&t.some(i))return!0;if("object"==typeof t&&i(t))return!0}return!1}function b(e){let a=0;for(const t in e){if("$ref"===t)return 1/0;if(a++,!r.has(t)&&("object"==typeof e[t]&&(0,c.eachItem)(e[t],(e=>a+=b(e))),a===1/0))return 1/0}return a}function o(e,a="",t){!1!==t&&(a=u(a));const c=e.parse(a);return s(e,c)}function s(e,a){return e.serialize(a).split("#")[0]+"#"}a.getFullPath=o,a._getFullPath=s;const l=/#\/?$/;function u(e){return e?e.replace(l,""):""}a.normalizeId=u,a.resolveUrl=function(e,a,t){return t=u(t),e.resolve(a,t)};const h=/^[a-z_][-a-z0-9._]*$/i;a.getSchemaRefs=function(e,a){if("boolean"==typeof e)return{};const{schemaId:t,uriResolver:c}=this.opts,r=u(e[t]||a),n={"":r},i=o(c,r,!1),b={},s=new Set;return d(e,{allKeys:!0},((e,a,c,f)=>{if(void 0===f)return;const d=i+a;let r=n[f];function o(a){const t=this.opts.uriResolver.resolve;if(a=u(r?t(r,a):a),s.has(a))throw p(a);s.add(a);let c=this.refs[a];return"string"==typeof c&&(c=this.refs[c]),"object"==typeof c?l(e,c.schema,a):a!==u(d)&&("#"===a[0]?(l(e,b[a],a),b[a]=e):this.refs[a]=d),a}function g(e){if("string"==typeof e){if(!h.test(e))throw new Error(`invalid anchor "${e}"`);o.call(this,`#${e}`)}}"string"==typeof e[t]&&(r=o.call(this,e[t])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),n[a]=r})),b;function l(e,a,t){if(void 0!==a&&!f(e,a))throw p(t)}function p(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},10396:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getRules=a.isJSONType=void 0;const t=new Set(["string","number","integer","boolean","null","object","array"]);a.isJSONType=function(e){return"string"==typeof e&&t.has(e)},a.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},94227:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.checkStrictMode=a.getErrorPath=a.Type=a.useFunc=a.setEvaluated=a.evaluatedPropsToName=a.mergeEvaluated=a.eachItem=a.unescapeJsonPointer=a.escapeJsonPointer=a.escapeFragment=a.unescapeFragment=a.schemaRefOrVal=a.schemaHasRulesButRef=a.schemaHasRules=a.checkUnknownRules=a.alwaysValidSchema=a.toHash=void 0;const c=t(99029),f=t(41520);function d(e,a=e.schema){const{opts:t,self:c}=e;if(!t.strictSchema)return;if("boolean"==typeof a)return;const f=c.RULES.keywords;for(const t in a)f[t]||h(e,`unknown keyword: "${t}"`)}function r(e,a){if("boolean"==typeof e)return!e;for(const t in e)if(a[t])return!0;return!1}function n(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function i(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function b({mergeNames:e,mergeToName:a,mergeValues:t,resultToName:f}){return(d,r,n,i)=>{const b=void 0===n?r:n instanceof c.Name?(r instanceof c.Name?e(d,r,n):a(d,r,n),n):r instanceof c.Name?(a(d,n,r),r):t(r,n);return i!==c.Name||b instanceof c.Name?b:f(d,b)}}function o(e,a){if(!0===a)return e.var("props",!0);const t=e.var("props",c._`{}`);return void 0!==a&&s(e,t,a),t}function s(e,a,t){Object.keys(t).forEach((t=>e.assign(c._`${a}${(0,c.getProperty)(t)}`,!0)))}a.toHash=function(e){const a={};for(const t of e)a[t]=!0;return a},a.alwaysValidSchema=function(e,a){return"boolean"==typeof a?a:0===Object.keys(a).length||(d(e,a),!r(a,e.self.RULES.all))},a.checkUnknownRules=d,a.schemaHasRules=r,a.schemaHasRulesButRef=function(e,a){if("boolean"==typeof e)return!e;for(const t in e)if("$ref"!==t&&a.all[t])return!0;return!1},a.schemaRefOrVal=function({topSchemaRef:e,schemaPath:a},t,f,d){if(!d){if("number"==typeof t||"boolean"==typeof t)return t;if("string"==typeof t)return c._`${t}`}return c._`${e}${a}${(0,c.getProperty)(f)}`},a.unescapeFragment=function(e){return i(decodeURIComponent(e))},a.escapeFragment=function(e){return encodeURIComponent(n(e))},a.escapeJsonPointer=n,a.unescapeJsonPointer=i,a.eachItem=function(e,a){if(Array.isArray(e))for(const t of e)a(t);else a(e)},a.mergeEvaluated={props:b({mergeNames:(e,a,t)=>e.if(c._`${t} !== true && ${a} !== undefined`,(()=>{e.if(c._`${a} === true`,(()=>e.assign(t,!0)),(()=>e.assign(t,c._`${t} || {}`).code(c._`Object.assign(${t}, ${a})`)))})),mergeToName:(e,a,t)=>e.if(c._`${t} !== true`,(()=>{!0===a?e.assign(t,!0):(e.assign(t,c._`${t} || {}`),s(e,t,a))})),mergeValues:(e,a)=>!0===e||{...e,...a},resultToName:o}),items:b({mergeNames:(e,a,t)=>e.if(c._`${t} !== true && ${a} !== undefined`,(()=>e.assign(t,c._`${a} === true ? true : ${t} > ${a} ? ${t} : ${a}`))),mergeToName:(e,a,t)=>e.if(c._`${t} !== true`,(()=>e.assign(t,!0===a||c._`${t} > ${a} ? ${t} : ${a}`))),mergeValues:(e,a)=>!0===e||Math.max(e,a),resultToName:(e,a)=>e.var("items",a)})},a.evaluatedPropsToName=o,a.setEvaluated=s;const l={};var u;function h(e,a,t=e.opts.strictSchema){if(t){if(a=`strict mode: ${a}`,!0===t)throw new Error(a);e.self.logger.warn(a)}}a.useFunc=function(e,a){return e.scopeValue("func",{ref:a,code:l[a.code]||(l[a.code]=new f._Code(a.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(u||(a.Type=u={})),a.getErrorPath=function(e,a,t){if(e instanceof c.Name){const f=a===u.Num;return t?f?c._`"[" + ${e} + "]"`:c._`"['" + ${e} + "']"`:f?c._`"/" + ${e}`:c._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,c.getProperty)(e).toString():"/"+n(e)},a.checkStrictMode=h},7887:(e,a)=>{"use strict";function t(e,a){return a.rules.some((a=>c(e,a)))}function c(e,a){var t;return void 0!==e[a.keyword]||(null===(t=a.definition.implements)||void 0===t?void 0:t.some((a=>void 0!==e[a])))}Object.defineProperty(a,"__esModule",{value:!0}),a.shouldUseRule=a.shouldUseGroup=a.schemaHasRulesForType=void 0,a.schemaHasRulesForType=function({schema:e,self:a},c){const f=a.RULES.types[c];return f&&!0!==f&&t(e,f)},a.shouldUseGroup=t,a.shouldUseRule=c},28727:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.boolOrEmptySchema=a.topBoolOrEmptySchema=void 0;const c=t(48708),f=t(99029),d=t(42023),r={message:"boolean schema is false"};function n(e,a){const{gen:t,data:f}=e,d={gen:t,keyword:"false schema",data:f,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,c.reportError)(d,r,void 0,a)}a.topBoolOrEmptySchema=function(e){const{gen:a,schema:t,validateName:c}=e;!1===t?n(e,!1):"object"==typeof t&&!0===t.$async?a.return(d.default.data):(a.assign(f._`${c}.errors`,null),a.return(!0))},a.boolOrEmptySchema=function(e,a){const{gen:t,schema:c}=e;!1===c?(t.var(a,!1),n(e)):t.var(a,!0)}},10208:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.reportTypeError=a.checkDataTypes=a.checkDataType=a.coerceAndCheckDataType=a.getJSONTypes=a.getSchemaTypes=a.DataType=void 0;const c=t(10396),f=t(7887),d=t(48708),r=t(99029),n=t(94227);var i;function b(e){const a=Array.isArray(e)?e:e?[e]:[];if(a.every(c.isJSONType))return a;throw new Error("type must be JSONType or JSONType[]: "+a.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(i||(a.DataType=i={})),a.getSchemaTypes=function(e){const a=b(e.type);if(a.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!a.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&a.push("null")}return a},a.getJSONTypes=b,a.coerceAndCheckDataType=function(e,a){const{gen:t,data:c,opts:d}=e,n=function(e,a){return a?e.filter((e=>o.has(e)||"array"===a&&"array"===e)):[]}(a,d.coerceTypes),b=a.length>0&&!(0===n.length&&1===a.length&&(0,f.schemaHasRulesForType)(e,a[0]));if(b){const f=l(a,c,d.strictNumbers,i.Wrong);t.if(f,(()=>{n.length?function(e,a,t){const{gen:c,data:f,opts:d}=e,n=c.let("dataType",r._`typeof ${f}`),i=c.let("coerced",r._`undefined`);"array"===d.coerceTypes&&c.if(r._`${n} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,(()=>c.assign(f,r._`${f}[0]`).assign(n,r._`typeof ${f}`).if(l(a,f,d.strictNumbers),(()=>c.assign(i,f))))),c.if(r._`${i} !== undefined`);for(const e of t)(o.has(e)||"array"===e&&"array"===d.coerceTypes)&&b(e);function b(e){switch(e){case"string":return void c.elseIf(r._`${n} == "number" || ${n} == "boolean"`).assign(i,r._`"" + ${f}`).elseIf(r._`${f} === null`).assign(i,r._`""`);case"number":return void c.elseIf(r._`${n} == "boolean" || ${f} === null +!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?exports.Tornado=a():e.Tornado=a()}(self,(()=>(()=>{var __webpack_modules__={66289:(e,a)=>{"use strict";function t(e){if(Array.isArray(e)){const a=[];let c=0;for(let f=0;fe.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(a,t)}function f(e){if(0===e[0])throw new Error("invalid RLP: extra zeros");return o(b(e))}function d(e,a){if(e<56)return Uint8Array.from([e+a]);const t=h(e),c=h(a+55+t.length/2);return Uint8Array.from(s(c+t))}function r(e,a=!1){if(null==e||0===e.length)return Uint8Array.from([]);const t=n(g(e));if(a)return t;if(0!==t.remainder.length)throw new Error("invalid RLP: remainder must be zero");return t.data}function n(e){let a,t,d,r,i;const b=[],o=e[0];if(o<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(o<=183){if(a=o-127,d=128===o?Uint8Array.from([]):c(e,1,a),2===a&&d[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:d,remainder:e.slice(a)}}if(o<=191){if(t=o-182,e.length-1e.length)throw new Error("invalid RLP: total length is larger than the data");for(r=c(e,t,d);r.length;)i=n(r),b.push(i.data),r=i.remainder;return{data:b,remainder:e.slice(d)}}}Object.defineProperty(a,"__esModule",{value:!0}),a.RLP=a.utils=a.decode=a.encode=void 0,a.encode=t,a.decode=r;const i=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function b(e){let a="";for(let t=0;te+a.length),0),t=new Uint8Array(a);for(let a=0,c=0;a=2&&"0"===e[0]&&"x"===e[1]}function g(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return p(e)?s((a="string"!=typeof(t=e)?t:p(t)?t.slice(2):t).length%2?`0${a}`:a):u(e);var a,t;if("number"==typeof e||"bigint"==typeof e)return e?s(h(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}a.utils={bytesToHex:b,concatBytes:l,hexToBytes:s,utf8ToBytes:u},a.RLP={encode:t,decode:r}},16284:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.accountBodyToRLP=a.accountBodyToSlim=a.accountBodyFromSlim=a.isZeroAddress=a.zeroAddress=a.importPublic=a.privateToAddress=a.privateToPublic=a.publicToAddress=a.pubToAddress=a.isValidPublic=a.isValidPrivate=a.generateAddress2=a.generateAddress=a.isValidChecksumAddress=a.toChecksumAddress=a.isValidAddress=a.Account=void 0;const f=t(66289),d=t(32019),r=t(26513),n=t(82672),i=t(77312),b=t(89838),o=t(35546),s=t(59498),l=BigInt(0);class u{constructor(e=l,a=l,t=b.KECCAK256_RLP,c=b.KECCAK256_NULL){this.nonce=e,this.balance=a,this.storageRoot=t,this.codeHash=c,this._validate()}static fromAccountData(e){const{nonce:a,balance:t,storageRoot:c,codeHash:f}=e;return new u(void 0!==a?(0,i.bufferToBigInt)((0,i.toBuffer)(a)):void 0,void 0!==t?(0,i.bufferToBigInt)((0,i.toBuffer)(t)):void 0,void 0!==c?(0,i.toBuffer)(c):void 0,void 0!==f?(0,i.toBuffer)(f):void 0)}static fromRlpSerializedAccount(e){const a=(0,i.arrToBufArr)(f.RLP.decode(Uint8Array.from(e)));if(!Array.isArray(a))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(a)}static fromValuesArray(e){const[a,t,c,f]=e;return new u((0,i.bufferToBigInt)(a),(0,i.bufferToBigInt)(t),c,f)}_validate(){if(this.nonce=8?l+=t[e].toUpperCase():l+=t[e];return l},a.isValidChecksumAddress=function(e,t){return(0,a.isValidAddress)(e)&&(0,a.toChecksumAddress)(e,t)===e},a.generateAddress=function(e,a){return(0,o.assertIsBuffer)(e),(0,o.assertIsBuffer)(a),(0,i.bufferToBigInt)(a)===BigInt(0)?c.from((0,d.keccak256)(f.RLP.encode((0,i.bufArrToArr)([e,null])))).slice(-20):c.from((0,d.keccak256)(f.RLP.encode((0,i.bufArrToArr)([e,a])))).slice(-20)},a.generateAddress2=function(e,a,t){if((0,o.assertIsBuffer)(e),(0,o.assertIsBuffer)(a),(0,o.assertIsBuffer)(t),20!==e.length)throw new Error("Expected from to be of length 20");if(32!==a.length)throw new Error("Expected salt to be of length 32");const f=(0,d.keccak256)(c.concat([c.from("ff","hex"),e,a,(0,d.keccak256)(t)]));return(0,i.toBuffer)(f).slice(-20)},a.isValidPrivate=function(e){return r.secp256k1.utils.isValidPrivateKey(e)},a.isValidPublic=function(e,a=!1){if((0,o.assertIsBuffer)(e),64===e.length)try{return r.secp256k1.ProjectivePoint.fromHex(c.concat([c.from([4]),e])),!0}catch(e){return!1}if(!a)return!1;try{return r.secp256k1.ProjectivePoint.fromHex(e),!0}catch(e){return!1}},a.pubToAddress=function(e,a=!1){if((0,o.assertIsBuffer)(e),a&&64!==e.length&&(e=c.from(r.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),64!==e.length)throw new Error("Expected pubKey to be of length 64");return c.from((0,d.keccak256)(e)).slice(-20)},a.publicToAddress=a.pubToAddress,a.privateToPublic=function(e){return(0,o.assertIsBuffer)(e),c.from(r.secp256k1.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1))},a.privateToAddress=function(e){return(0,a.publicToAddress)((0,a.privateToPublic)(e))},a.importPublic=function(e){return(0,o.assertIsBuffer)(e),64!==e.length&&(e=c.from(r.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),e},a.zeroAddress=function(){const e=(0,i.zeros)(20);return(0,i.bufferToHex)(e)},a.isZeroAddress=function(e){try{(0,o.assertIsString)(e)}catch(e){return!1}return(0,a.zeroAddress)()===e},a.accountBodyFromSlim=h;const p=new Uint8Array(0);a.accountBodyToSlim=function(e){const[a,t,c,f]=e;return[a,t,(0,i.arrToBufArr)(c).equals(b.KECCAK256_RLP)?p:c,(0,i.arrToBufArr)(f).equals(b.KECCAK256_NULL)?p:f]},a.accountBodyToRLP=function(e,a=!0){const t=a?h(e):e;return(0,i.arrToBufArr)(f.RLP.encode(t))}},86727:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.Address=void 0;const f=t(16284),d=t(77312);class r{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.buf=e}static zero(){return new r((0,d.zeros)(20))}static fromString(e){if(!(0,f.isValidAddress)(e))throw new Error("Invalid address");return new r((0,d.toBuffer)(e))}static fromPublicKey(e){if(!c.isBuffer(e))throw new Error("Public key should be Buffer");const a=(0,f.pubToAddress)(e);return new r(a)}static fromPrivateKey(e){if(!c.isBuffer(e))throw new Error("Private key should be Buffer");const a=(0,f.privateToAddress)(e);return new r(a)}static generate(e,a){if("bigint"!=typeof a)throw new Error("Expected nonce to be a bigint");return new r((0,f.generateAddress)(e.buf,(0,d.bigIntToBuffer)(a)))}static generate2(e,a,t){if(!c.isBuffer(a))throw new Error("Expected salt to be a Buffer");if(!c.isBuffer(t))throw new Error("Expected initCode to be a Buffer");return new r((0,f.generateAddress2)(e.buf,a,t))}equals(e){return this.buf.equals(e.buf)}isZero(){return this.equals(r.zero())}isPrecompileOrSystemAddress(){const e=(0,d.bufferToBigInt)(this.buf),a=BigInt(0),t=BigInt("0xffff");return e>=a&&e<=t}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return c.from(this.buf)}}a.Address=r},98421:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.AsyncEventEmitter=void 0;const c=t(37007);class f extends c.EventEmitter{emit(e,...a){let[t,c]=a;const f=this;let d=f._events[e]??[];return void 0===c&&"function"==typeof t&&(c=t,t=void 0),"newListener"!==e&&"removeListener"!==e||(t={event:t,fn:c},c=void 0),d=Array.isArray(d)?d:[d],async function(e,a,t){let c;for await(const f of a)try{f.length<2?f.call(e,t):await new Promise(((a,c)=>{f.call(e,t,(e=>{e?c(e):a()}))}))}catch(e){c=e}if(c)throw c}(f,d.slice(),t).then(c).catch(c),f.listenerCount(e)>0}once(e,a){const t=this;let c;if("function"!=typeof a)throw new TypeError("listener must be a function");return c=a.length>=2?function(f,d){t.removeListener(e,c),a(f,d)}:function(f){t.removeListener(e,c),a(f,c)},t.on(e,c),t}first(e,a){let t=this._events[e]??[];if("function"!=typeof a)throw new TypeError("listener must be a function");return Array.isArray(t)||(this._events[e]=t=[t]),t.unshift(a),this}before(e,a,t){return this.beforeOrAfter(e,a,t)}after(e,a,t){return this.beforeOrAfter(e,a,t,"after")}beforeOrAfter(e,a,t,c){let f,d,r=this._events[e]??[];const n="after"===c?1:0;if("function"!=typeof t)throw new TypeError("listener must be a function");if("function"!=typeof a)throw new TypeError("target must be a function");for(Array.isArray(r)||(this._events[e]=r=[r]),d=r.length,f=r.length;f--;)if(r[f]===a){d=f+n;break}return r.splice(d,0,t),this}on(e,a){return super.on(e,a)}addListener(e,a){return super.addListener(e,a)}prependListener(e,a){return super.prependListener(e,a)}prependOnceListener(e,a){return super.prependOnceListener(e,a)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,a){return super.removeListener(e,a)}eventNames(){return super.eventNames()}listeners(e){return super.listeners(e)}listenerCount(e){return super.listenerCount(e)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(e){return super.setMaxListeners(e)}}a.AsyncEventEmitter=f},77312:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.intToUnpaddedBuffer=a.bigIntToUnpaddedBuffer=a.bigIntToHex=a.bufArrToArr=a.arrToBufArr=a.validateNoLeadingZeroes=a.baToJSON=a.toUtf8=a.short=a.addHexPrefix=a.toUnsigned=a.fromSigned=a.bufferToInt=a.bigIntToBuffer=a.bufferToBigInt=a.bufferToHex=a.toBuffer=a.unpadHexString=a.unpadArray=a.unpadBuffer=a.setLengthRight=a.setLengthLeft=a.zeros=a.intToBuffer=a.intToHex=void 0;const f=t(35546),d=t(59498);a.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`},a.intToBuffer=function(e){const t=(0,a.intToHex)(e);return c.from((0,d.padToEven)(t.slice(2)),"hex")},a.zeros=function(e){return c.allocUnsafe(e).fill(0)};const r=function(e,t,c){const f=(0,a.zeros)(t);return c?e.length0&&"0"===a.toString();)a=(e=e.slice(1))[0];return e};function i(e){const t=(0,a.bufferToHex)(e);return"0x"===t?BigInt(0):BigInt(t)}function b(e){return(0,a.toBuffer)("0x"+e.toString(16))}a.unpadBuffer=function(e){return(0,f.assertIsBuffer)(e),n(e)},a.unpadArray=function(e){return(0,f.assertIsArray)(e),n(e)},a.unpadHexString=function(e){return(0,f.assertIsHexString)(e),e=(0,d.stripHexPrefix)(e),"0x"+n(e)},a.toBuffer=function(e){if(null==e)return c.allocUnsafe(0);if(c.isBuffer(e))return c.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return c.from(e);if("string"==typeof e){if(!(0,d.isHexString)(e))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${e}`);return c.from((0,d.padToEven)((0,d.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,a.intToBuffer)(e);if("bigint"==typeof e){if(e0&&0===t[0])throw new Error(`${a} cannot have leading zeroes, received: ${t.toString("hex")}`)},a.arrToBufArr=function e(a){return Array.isArray(a)?a.map((a=>e(a))):c.from(a)},a.bufArrToArr=function e(a){return Array.isArray(a)?a.map((a=>e(a))):Uint8Array.from(a??[])},a.bigIntToHex=e=>"0x"+e.toString(16),a.bigIntToUnpaddedBuffer=function(e){return(0,a.unpadBuffer)(b(e))},a.intToUnpaddedBuffer=function(e){return(0,a.unpadBuffer)((0,a.intToBuffer)(e))}},89838:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MAX_WITHDRAWALS_PER_PAYLOAD=a.RLP_EMPTY_STRING=a.KECCAK256_RLP=a.KECCAK256_RLP_S=a.KECCAK256_RLP_ARRAY=a.KECCAK256_RLP_ARRAY_S=a.KECCAK256_NULL=a.KECCAK256_NULL_S=a.TWO_POW256=a.SECP256K1_ORDER_DIV_2=a.SECP256K1_ORDER=a.MAX_INTEGER_BIGINT=a.MAX_INTEGER=a.MAX_UINT64=void 0;const c=t(48287),f=t(26513);a.MAX_UINT64=BigInt("0xffffffffffffffff"),a.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),a.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),a.SECP256K1_ORDER=f.secp256k1.CURVE.n,a.SECP256K1_ORDER_DIV_2=f.secp256k1.CURVE.n/BigInt(2),a.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),a.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",a.KECCAK256_NULL=c.Buffer.from(a.KECCAK256_NULL_S,"hex"),a.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",a.KECCAK256_RLP_ARRAY=c.Buffer.from(a.KECCAK256_RLP_ARRAY_S,"hex"),a.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",a.KECCAK256_RLP=c.Buffer.from(a.KECCAK256_RLP_S,"hex"),a.RLP_EMPTY_STRING=c.Buffer.from([128]),a.MAX_WITHDRAWALS_PER_PAYLOAD=16},45062:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.compactBytesToNibbles=a.bytesToNibbles=a.nibblesToCompactBytes=a.nibblesToBytes=a.hasTerminator=void 0,a.hasTerminator=e=>e.length>0&&16===e[e.length-1],a.nibblesToBytes=(e,a)=>{for(let t=0,c=0;c{let t=0;(0,a.hasTerminator)(e)&&(t=1,e=e.subarray(0,e.length-1));const c=new Uint8Array(e.length/2+1);return c[0]=t<<5,1&~e.length||(c[0]|=16,c[0]|=e[0],e=e.subarray(1)),(0,a.nibblesToBytes)(e,c.subarray(1)),c},a.bytesToNibbles=e=>{const a=2*e.length+1,t=new Uint8Array(a);for(let a=0;a{if(0===e.length)return e;let t=(0,a.bytesToNibbles)(e);t[0]<2&&(t=t.subarray(0,t.length-1));const c=2-(1&t[0]);return t.subarray(c)}},35546:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.assertIsString=a.assertIsArray=a.assertIsBuffer=a.assertIsHexString=void 0;const f=t(59498);a.assertIsHexString=function(e){if(!(0,f.isHexString)(e))throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${e}`)},a.assertIsBuffer=function(e){if(!c.isBuffer(e))throw new Error(`This method only supports Buffer but input was: ${e}`)},a.assertIsArray=function(e){if(!Array.isArray(e))throw new Error(`This method only supports number arrays but input was: ${e}`)},a.assertIsString=function(e){if("string"!=typeof e)throw new Error(`This method only supports strings but input was: ${e}`)}},68683:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),a.toAscii=a.stripHexPrefix=a.padToEven=a.isHexString=a.isHexPrefixed=a.getKeys=a.getBinarySize=a.fromUtf8=a.fromAscii=a.arrayContainsArray=void 0,f(t(89838),a),f(t(52652),a),f(t(16284),a),f(t(86727),a),f(t(37380),a),f(t(92133),a),f(t(77312),a),f(t(42666),a),f(t(45062),a),f(t(98421),a);var d=t(59498);Object.defineProperty(a,"arrayContainsArray",{enumerable:!0,get:function(){return d.arrayContainsArray}}),Object.defineProperty(a,"fromAscii",{enumerable:!0,get:function(){return d.fromAscii}}),Object.defineProperty(a,"fromUtf8",{enumerable:!0,get:function(){return d.fromUtf8}}),Object.defineProperty(a,"getBinarySize",{enumerable:!0,get:function(){return d.getBinarySize}}),Object.defineProperty(a,"getKeys",{enumerable:!0,get:function(){return d.getKeys}}),Object.defineProperty(a,"isHexPrefixed",{enumerable:!0,get:function(){return d.isHexPrefixed}}),Object.defineProperty(a,"isHexString",{enumerable:!0,get:function(){return d.isHexString}}),Object.defineProperty(a,"padToEven",{enumerable:!0,get:function(){return d.padToEven}}),Object.defineProperty(a,"stripHexPrefix",{enumerable:!0,get:function(){return d.stripHexPrefix}}),Object.defineProperty(a,"toAscii",{enumerable:!0,get:function(){return d.toAscii}}),f(t(31708),a),f(t(81862),a)},59498:(e,a,t)=>{"use strict";var c=t(48287).Buffer;function f(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]}function d(e){let a=e;if("string"!=typeof a)throw new Error("[padToEven] value must be type 'string', received "+typeof a);return a.length%2&&(a=`0${a}`),a}Object.defineProperty(a,"__esModule",{value:!0}),a.isHexString=a.getKeys=a.fromAscii=a.fromUtf8=a.toAscii=a.arrayContainsArray=a.getBinarySize=a.padToEven=a.stripHexPrefix=a.isHexPrefixed=void 0,a.isHexPrefixed=f,a.stripHexPrefix=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return f(e)?e.slice(2):e},a.padToEven=d,a.getBinarySize=function(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof e);return c.byteLength(e,"utf8")},a.arrayContainsArray=function(e,a,t){if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(!0!==Array.isArray(a))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof a}'`);return a[!0===t?"some":"every"]((a=>e.indexOf(a)>=0))},a.toAscii=function(e){let a="",t=0;const c=e.length;for("0x"===e.substring(0,2)&&(t=2);t0&&e.length!==2+2*a)}},31708:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Lock=void 0,a.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((e=>this.promiseResolverQueue.push(e)))}release(){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;const e=this.promiseResolverQueue.shift();e&&e(!0)}}}},81862:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getProvider=a.fetchFromProvider=void 0;const c=t(6215);a.fetchFromProvider=async(e,a)=>(await(0,c.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:a.method,params:a.params,jsonrpc:"2.0",id:1}})).result,a.getProvider=e=>{if("string"==typeof e)return e;if(void 0!==e?.connection?.url)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")}},92133:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.hashPersonalMessage=a.isValidSignature=a.fromRpcSig=a.toCompactSig=a.toRpcSig=a.ecrecover=a.ecsign=void 0;const f=t(32019),d=t(26513),r=t(77312),n=t(89838),i=t(35546);function b(e,a){return e===BigInt(0)||e===BigInt(1)?e:void 0===a?e-BigInt(27):e-(a*BigInt(2)+BigInt(35))}function o(e){return e===BigInt(0)||e===BigInt(1)}a.ecsign=function(e,a,t){const f=d.secp256k1.sign(e,a),r=f.toCompactRawBytes();return{r:c.from(r.slice(0,32)),s:c.from(r.slice(32,64)),v:void 0===t?BigInt(f.recovery+27):BigInt(f.recovery+35)+BigInt(t)*BigInt(2)}},a.ecrecover=function(e,a,t,f,n){const i=c.concat([(0,r.setLengthLeft)(t,32),(0,r.setLengthLeft)(f,32)],64),s=b(a,n);if(!o(s))throw new Error("Invalid signature v value");const l=d.secp256k1.Signature.fromCompact(i).addRecoveryBit(Number(s)).recoverPublicKey(e);return c.from(l.toRawBytes(!1).slice(1))},a.toRpcSig=function(e,a,t,f){if(!o(b(e,f)))throw new Error("Invalid signature v value");return(0,r.bufferToHex)(c.concat([(0,r.setLengthLeft)(a,32),(0,r.setLengthLeft)(t,32),(0,r.toBuffer)(e)]))},a.toCompactSig=function(e,a,t,f){if(!o(b(e,f)))throw new Error("Invalid signature v value");let d=t;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(d=c.from(t),d[0]|=128),(0,r.bufferToHex)(c.concat([(0,r.setLengthLeft)(a,32),(0,r.setLengthLeft)(d,32)]))},a.fromRpcSig=function(e){const a=(0,r.toBuffer)(e);let t,c,f;if(a.length>=65)t=a.slice(0,32),c=a.slice(32,64),f=(0,r.bufferToBigInt)(a.slice(64));else{if(64!==a.length)throw new Error("Invalid signature length");t=a.slice(0,32),c=a.slice(32,64),f=BigInt((0,r.bufferToInt)(a.slice(32,33))>>7),c[0]&=127}return f<27&&(f+=BigInt(27)),{v:f,r:t,s:c}},a.isValidSignature=function(e,a,t,c=!0,f){if(32!==a.length||32!==t.length)return!1;if(!o(b(e,f)))return!1;const d=(0,r.bufferToBigInt)(a),i=(0,r.bufferToBigInt)(t);return!(d===BigInt(0)||d>=n.SECP256K1_ORDER||i===BigInt(0)||i>=n.SECP256K1_ORDER||c&&i>=n.SECP256K1_ORDER_DIV_2)},a.hashPersonalMessage=function(e){(0,i.assertIsBuffer)(e);const a=c.from(`Ethereum Signed Message:\n${e.length}`,"utf-8");return c.from((0,f.keccak256)(c.concat([a,e])))}},42666:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.toType=a.TypeOutput=void 0;const c=t(77312),f=t(59498);var d;!function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(d=a.TypeOutput||(a.TypeOutput={})),a.toType=function(e,a){if(null===e)return null;if(void 0===e)return;if("string"==typeof e&&!(0,f.isHexString)(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const t=(0,c.toBuffer)(e);switch(a){case d.Buffer:return t;case d.BigInt:return(0,c.bufferToBigInt)(t);case d.Number:{const e=(0,c.bufferToBigInt)(t);if(e>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(e)}case d.PrefixedHexString:return(0,c.bufferToHex)(t);default:throw new Error("unknown outputType")}}},52652:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.GWEI_TO_WEI=void 0,a.GWEI_TO_WEI=BigInt(1e9)},37380:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.Withdrawal=void 0;const f=t(86727),d=t(77312),r=t(42666);class n{constructor(e,a,t,c){this.index=e,this.validatorIndex=a,this.address=t,this.amount=c}static fromWithdrawalData(e){const{index:a,validatorIndex:t,address:c,amount:d}=e,i=(0,r.toType)(a,r.TypeOutput.BigInt),b=(0,r.toType)(t,r.TypeOutput.BigInt),o=new f.Address((0,r.toType)(c,r.TypeOutput.Buffer)),s=(0,r.toType)(d,r.TypeOutput.BigInt);return new n(i,b,o,s)}static fromValuesArray(e){if(4!==e.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${e.length}`);const[a,t,c,f]=e;return n.fromWithdrawalData({index:a,validatorIndex:t,address:c,amount:f})}static toBufferArray(e){const{index:a,validatorIndex:t,address:d,amount:n}=e,i=(0,r.toType)(a,r.TypeOutput.BigInt)===BigInt(0)?c.alloc(0):(0,r.toType)(a,r.TypeOutput.Buffer),b=(0,r.toType)(t,r.TypeOutput.BigInt)===BigInt(0)?c.alloc(0):(0,r.toType)(t,r.TypeOutput.Buffer);let o;return o=d instanceof f.Address?d.buf:(0,r.toType)(d,r.TypeOutput.Buffer),[i,b,o,(0,r.toType)(n,r.TypeOutput.BigInt)===BigInt(0)?c.alloc(0):(0,r.toType)(n,r.TypeOutput.Buffer)]}raw(){return n.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,d.bigIntToHex)(this.index),validatorIndex:(0,d.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,d.bigIntToHex)(this.amount)}}}a.Withdrawal=n},56498:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.decodeSingle=a.decode=a.encodePacked=a.encodeSingle=a.encode=void 0;const c=t(52367),f=t(5961),d=t(37700);a.encode=(e,a,t,c)=>{try{return(0,d.pack)({types:e,values:a,packed:t,tight:c})}catch(e){if(e instanceof f.ParserError)throw new f.ParserError(`Unable to encode value: ${e.message}`,e);throw new f.ParserError(`An unexpected error occurred: ${(0,f.getErrorMessage)(e)}`,e)}},a.encodeSingle=(e,t)=>(0,a.encode)([e],[t]),a.encodePacked=(e,t,c)=>(0,a.encode)(e,t,!0,c),a.decode=(e,a)=>{const t=(0,c.createBytes)(a);try{return(0,d.unpack)(e,t)}catch(e){if(e instanceof f.ParserError)throw new f.ParserError(`Unable to decode value: ${e.message}`,e);throw new f.ParserError(`An unexpected error occurred: ${(0,f.getErrorMessage)(e)}`,e)}},a.decodeSingle=(e,t)=>{const d=(0,a.decode)([e],t);return(0,c.assert)(1===d.length,new f.ParserError("Decoded value array has unexpected length.")),d[0]}},5961:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ParserError=a.getErrorStack=a.getErrorMessage=void 0;const c=t(52367);a.getErrorMessage=e=>"string"==typeof e?e:e instanceof Error||(0,c.isObject)(e)&&(0,c.hasProperty)(e,"message")&&"string"==typeof e.message?e.message:"Unknown error.",a.getErrorStack=e=>{if(e instanceof Error)return e.stack};class f extends Error{constructor(e,t){super(e),this.name="ParserError";const c=(0,a.getErrorStack)(t);c&&(this.stack=c)}}a.ParserError=f},93256:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(56498),a),f(t(5961),a),f(t(11126),a)},57924:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.iterate=void 0;const c=t(52367);a.iterate=function*(e,a=32){for(let t=0;t{(0,c.assert)(e>=0,"Cannot skip a negative number of bytes."),(0,c.assert)(e%a==0,"Length must be a multiple of the size."),t+=e},d=e.subarray(t);yield{skip:f,value:d}}return{skip:()=>{},value:new Uint8Array}}},37700:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.unpack=a.pack=a.isDynamicParser=a.getParser=void 0;const c=t(52367),f=t(5961),d=t(57924),r=t(46207),n=t(26365);a.getParser=e=>{const a={address:r.address,array:r.array,bool:r.bool,bytes:r.bytes,fixedBytes:r.fixedBytes,function:r.fn,number:r.number,string:r.string,tuple:r.tuple},t=a[e];if(t)return t;const c=Object.values(a).find((a=>a.isType(e)));if(c)return c;throw new f.ParserError(`The type "${e}" is not supported.`)},a.isDynamicParser=(e,a)=>{const{isDynamic:t}=e;return"function"==typeof t?t(a):t},a.pack=({types:e,values:t,packed:d=!1,tight:r=!1,arrayPacked:i=!1,byteArray:b=new Uint8Array})=>{(0,c.assert)(e.length===t.length,new f.ParserError(`The number of types (${e.length}) does not match the number of values (${t.length}).`));const{staticBuffer:o,dynamicBuffer:s,pointers:l}=e.reduce((({staticBuffer:e,dynamicBuffer:f,pointers:n},b,o)=>{const s=(0,a.getParser)(b),l=t[o];return d||i||!(0,a.isDynamicParser)(s,b)?{staticBuffer:s.encode({buffer:e,value:l,type:b,packed:d,tight:r}),dynamicBuffer:f,pointers:n}:{staticBuffer:(0,c.concatBytes)([e,new Uint8Array(32)]),dynamicBuffer:s.encode({buffer:f,value:l,type:b,packed:d,tight:r}),pointers:[...n,{position:e.length,pointer:f.length}]}}),{staticBuffer:new Uint8Array,dynamicBuffer:new Uint8Array,pointers:[]});(0,c.assert)(!d&&!i||0===s.length,new f.ParserError("Invalid pack state."));const u=o.length,h=l.reduce(((e,{pointer:a,position:t})=>{const f=(0,n.padStart)((0,c.numberToBytes)(u+a));return(0,n.set)(e,f,t)}),o);return(0,c.concatBytes)([b,h,s])},a.unpack=(e,t)=>{const r=(0,d.iterate)(t);return e.map((e=>{const{value:{value:d,skip:n},done:i}=r.next();(0,c.assert)(!i,new f.ParserError(`The encoded value is invalid for the provided types. Reached end of buffer while attempting to parse "${e}".`));const b=(0,a.getParser)(e);if((0,a.isDynamicParser)(b,e)){const a=(0,c.bytesToNumber)(d.subarray(0,32)),f=t.subarray(a);return b.decode({type:e,value:f,skip:n})}return b.decode({type:e,value:d,skip:n})}))}},91563:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.address=a.getAddress=void 0;const c=t(52367),f=t(5961),d=t(26365);a.getAddress=e=>{const a=(0,c.createBytes)(e);return(0,c.assert)(a.length<=20,new f.ParserError(`Invalid address value. Expected address to be 20 bytes long, but received ${a.length} bytes.`)),(0,d.padStart)(a,20)},a.address={isDynamic:!1,isType:e=>"address"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:f}){const r=(0,a.getAddress)(t);if(f)return(0,c.concatBytes)([e,r]);const n=(0,d.padStart)(r);return(0,c.concatBytes)([e,n])},decode:({value:e})=>(0,c.add0x)((0,c.bytesToHex)(e.slice(12,32)))}},186:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.array=a.getTupleType=a.getArrayType=a.isArrayType=void 0;const c=t(52367),f=t(5961),d=t(37700),r=t(26365),n=t(83415),i=t(30717),b=/^(?.*)\[(?\d*?)\]$/u;a.isArrayType=e=>b.test(e),a.getArrayType=e=>{const a=e.match(b);return(0,c.assert)(a?.groups?.type,new f.ParserError(`Invalid array type. Expected an array type, but received "${e}".`)),[a.groups.type,a.groups.length?parseInt(a.groups.length,10):void 0]},a.getTupleType=(e,a)=>`(${new Array(a).fill(e).join(",")})`,a.array={isDynamic(e){const[t,c]=(0,a.getArrayType)(e);return void 0===c||(0,d.isDynamicParser)((0,d.getParser)(t),t)},isType:e=>(0,a.isArrayType)(e),getByteLength(e){(0,c.assert)((0,a.isArrayType)(e),new f.ParserError(`Expected an array type, but received "${e}".`));const[t,r]=(0,a.getArrayType)(e);return(0,d.isDynamicParser)(this,e)||void 0===r?32:i.tuple.getByteLength((0,a.getTupleType)(t,r))},encode({type:e,buffer:t,value:b,packed:o,tight:s}){const[l,u]=(0,a.getArrayType)(e);if((0,c.assert)(!o||!(0,a.isArrayType)(l),new f.ParserError("Cannot pack nested arrays.")),o&&(0,d.isDynamicParser)((0,d.getParser)(l),l))return(0,d.pack)({types:new Array(b.length).fill(l),values:b,byteArray:t,packed:o,arrayPacked:!0,tight:s});if(u)return(0,c.assert)(u===b.length,new f.ParserError(`Array length does not match type length. Expected a length of ${u}, but received ${b.length}.`)),i.tuple.encode({type:(0,a.getTupleType)(l,u),buffer:t,value:b,packed:n.fixedBytes.isType(l)&&s,tight:s});if(o)return(0,d.pack)({types:new Array(b.length).fill(l),values:b,byteArray:t,packed:n.fixedBytes.isType(l)&&s,arrayPacked:!0,tight:s});const h=(0,r.padStart)((0,c.numberToBytes)(b.length));return(0,d.pack)({types:new Array(b.length).fill(l),values:b,byteArray:(0,c.concatBytes)([t,h]),packed:o,tight:s})},decode({type:e,value:t,...r}){const[n,b]=(0,a.getArrayType)(e);if(b){const e=i.tuple.decode({type:(0,a.getTupleType)(n,b),value:t,...r});return(0,c.assert)(e.length===b,new f.ParserError(`Array length does not match type length. Expected a length of ${b}, but received ${e.length}.`)),e}const o=(0,c.bytesToNumber)(t.subarray(0,32));return(0,d.unpack)(new Array(o).fill(n),t.subarray(32))}}},47435:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.bool=a.getBooleanValue=void 0;const c=t(35620),f=t(52367),d=t(5961),r=t(6150),n=(0,c.coerce)((0,c.boolean)(),(0,c.union)([(0,c.literal)("true"),(0,c.literal)("false")]),(e=>"true"===e));a.getBooleanValue=e=>{try{return(0,c.create)(e,n)?BigInt(1):BigInt(0)}catch{throw new d.ParserError(`Invalid boolean value. Expected a boolean literal, or the string "true" or "false", but received "${e}".`)}},a.bool={isDynamic:!1,isType:e=>"bool"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:c,tight:d}){const n=(0,a.getBooleanValue)(t);return c?(0,f.concatBytes)([e,(0,f.bigIntToBytes)(n)]):r.number.encode({type:"uint256",buffer:e,value:n,packed:c,tight:d})},decode:e=>r.number.decode({...e,type:"uint256"})===BigInt(1)}},99356:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.bytes=void 0;const c=t(52367),f=t(26365);a.bytes={isDynamic:!0,isType:e=>"bytes"===e,getByteLength:()=>32,encode({buffer:e,value:a,packed:t}){const d=(0,c.createBytes)(a);if(t)return(0,c.concatBytes)([e,d]);const r=32*Math.ceil(d.byteLength/32);return(0,c.concatBytes)([e,(0,f.padStart)((0,c.numberToBytes)(d.byteLength)),(0,f.padEnd)(d,r)])},decode({value:e}){const a=e.subarray(0,32),t=(0,c.bytesToNumber)(a);return e.slice(32,32+t)}}},83415:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.fixedBytes=a.getByteLength=void 0;const c=t(52367),f=t(5961),d=t(26365),r=/^bytes([0-9]{1,2})$/u;a.getByteLength=e=>{const a=e.match(r)?.[1];(0,c.assert)(a,`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`);const t=Number(a);return(0,c.assert)(t>0&&t<=32,new f.ParserError(`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`)),t},a.fixedBytes={isDynamic:!1,isType:e=>r.test(e),getByteLength:()=>32,encode({type:e,buffer:t,value:r,packed:n}){const i=(0,a.getByteLength)(e),b=(0,c.createBytes)(r);return(0,c.assert)(b.length<=i,new f.ParserError(`Expected a value of length ${i}, but received a value of length ${b.length}.`)),n?(0,c.concatBytes)([t,(0,d.padEnd)(b,i)]):(0,c.concatBytes)([t,(0,d.padEnd)(b)])},decode({type:e,value:t}){const c=(0,a.getByteLength)(e);return t.slice(0,c)}}},27827:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.fn=a.getFunction=void 0;const c=t(35620),f=t(52367),d=t(5961),r=t(83415),n=(0,c.coerce)((0,c.object)({address:f.StrictHexStruct,selector:f.StrictHexStruct}),(0,c.union)([f.StrictHexStruct,(0,c.instance)(Uint8Array)]),(e=>{const a=(0,f.createBytes)(e);return(0,f.assert)(24===a.length,new d.ParserError(`Invalid Solidity function. Expected function to be 24 bytes long, but received ${a.length} bytes.`)),{address:(0,f.bytesToHex)(a.subarray(0,20)),selector:(0,f.bytesToHex)(a.subarray(20,24))}}));a.getFunction=e=>{const a=(0,c.create)(e,n);return(0,f.concatBytes)([(0,f.hexToBytes)(a.address),(0,f.hexToBytes)(a.selector)])},a.fn={isDynamic:!1,isType:e=>"function"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:c,tight:f}){const d=(0,a.getFunction)(t);return r.fixedBytes.encode({type:"bytes24",buffer:e,value:d,packed:c,tight:f})},decode:({value:e})=>({address:(0,f.bytesToHex)(e.slice(0,20)),selector:(0,f.bytesToHex)(e.slice(20,24))})}},46207:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(91563),a),f(t(186),a),f(t(47435),a),f(t(99356),a),f(t(83415),a),f(t(27827),a),f(t(6150),a),f(t(28160),a),f(t(8446),a),f(t(30717),a)},6150:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.number=a.getBigInt=a.assertNumberLength=a.getLength=a.isSigned=void 0;const c=t(52367),f=t(5961),d=t(26365),r=/^u?int(?[0-9]*)?$/u;a.isSigned=e=>!e.startsWith("u"),a.getLength=e=>{if("int"===e||"uint"===e)return 256;const a=e.match(r);(0,c.assert)(a?.groups?.length,new f.ParserError(`Invalid number type. Expected a number type, but received "${e}".`));const t=parseInt(a.groups.length,10);return(0,c.assert)(t>=8&&t<=256,new f.ParserError(`Invalid number length. Expected a number between 8 and 256, but received "${e}".`)),(0,c.assert)(t%8==0,new f.ParserError(`Invalid number length. Expected a multiple of 8, but received "${e}".`)),t},a.assertNumberLength=(e,t)=>{const d=(0,a.getLength)(t),r=BigInt(2)**BigInt(d-((0,a.isSigned)(t)?1:0))-BigInt(1);(0,a.isSigned)(t)?(0,c.assert)(e>=-(r+BigInt(1))&&e<=r,new f.ParserError(`Number "${e}" is out of range for type "${t}".`)):(0,c.assert)(e<=r,new f.ParserError(`Number "${e}" is out of range for type "${t}".`))},a.getBigInt=e=>{try{return(0,c.createBigInt)(e)}catch{throw new f.ParserError(`Invalid number. Expected a valid number value, but received "${e}".`)}},a.number={isDynamic:!1,isType:e=>r.test(e),getByteLength:()=>32,encode({type:e,buffer:t,value:f,packed:r}){const n=(0,a.getBigInt)(f);if((0,a.assertNumberLength)(n,e),(0,a.isSigned)(e)){if(r){const f=(0,a.getLength)(e)/8;return(0,c.concatBytes)([t,(0,c.signedBigIntToBytes)(n,f)])}return(0,c.concatBytes)([t,(0,d.padStart)((0,c.signedBigIntToBytes)(n,32))])}if(r){const f=(0,a.getLength)(e)/8;return(0,c.concatBytes)([t,(0,d.padStart)((0,c.bigIntToBytes)(n),f)])}return(0,c.concatBytes)([t,(0,d.padStart)((0,c.bigIntToBytes)(n))])},decode({type:e,value:t}){const f=t.subarray(0,32);if((0,a.isSigned)(e)){const t=(0,c.bytesToSignedBigInt)(f);return(0,a.assertNumberLength)(t,e),t}const d=(0,c.bytesToBigInt)(f);return(0,a.assertNumberLength)(d,e),d}}},28160:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},8446:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.string=void 0;const c=t(52367),f=t(99356);a.string={isDynamic:!0,isType:e=>"string"===e,getByteLength:()=>32,encode:({buffer:e,value:a,packed:t,tight:d})=>f.bytes.encode({type:"bytes",buffer:e,value:(0,c.stringToBytes)(a),packed:t,tight:d}),decode:e=>(0,c.bytesToString)(f.bytes.decode(e))}},30717:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.tuple=a.getTupleElements=void 0;const c=t(52367),f=t(5961),d=t(37700),r=/^\((.+)\)$/u;a.getTupleElements=e=>{(0,c.assert)(e.startsWith("(")&&e.endsWith(")"),new f.ParserError(`Invalid tuple type. Expected tuple type, but received "${e}".`));const a=[];let t="",d=0;for(let c=1;c(0,a.getTupleElements)(e).some((e=>{const a=(0,d.getParser)(e);return(0,d.isDynamicParser)(a,e)})),isType:e=>(e=>r.test(e))(e),getByteLength(e){return(0,d.isDynamicParser)(this,e)?32:(0,a.getTupleElements)(e).reduce(((e,a)=>e+(0,d.getParser)(a).getByteLength(a)),0)},encode({type:e,buffer:t,value:c,packed:f,tight:r}){const n=(0,a.getTupleElements)(e);return(0,d.pack)({types:n,values:c,byteArray:t,packed:f,tight:r})},decode({type:e,value:t,skip:c}){const f=(0,a.getTupleElements)(e);return c(this.getByteLength(e)-32),(0,d.unpack)(f,t)}}},15744:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},11126:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(15744),a)},59194:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.padEnd=a.padStart=a.set=void 0;const c=t(52367);a.set=(e,a,t)=>(0,c.concatBytes)([e.subarray(0,t),a,e.subarray(t+a.length)]),a.padStart=(e,a=32)=>{const t=new Uint8Array(Math.max(a-e.length,0)).fill(0);return(0,c.concatBytes)([t,e])},a.padEnd=(e,a=32)=>{const t=new Uint8Array(Math.max(a-e.length,0)).fill(0);return(0,c.concatBytes)([e,t])}},26365:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(59194),a)},98537:function(e,a,t){"use strict";var c=t(48287).Buffer,f=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),d=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&f(a,e,t);return d(a,e),a};Object.defineProperty(a,"__esModule",{value:!0}),a.getEncryptionPublicKey=a.decryptSafely=a.decrypt=a.encryptSafely=a.encrypt=void 0;const n=t(63203),i=r(t(88947)),b=t(54907);function o({publicKey:e,data:a,version:t}){if((0,b.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,b.isNullish)(a))throw new Error("Missing data parameter");if((0,b.isNullish)(t))throw new Error("Missing version parameter");if("x25519-xsalsa20-poly1305"===t){if("string"!=typeof a)throw new Error("Message data must be given as a string");const t=i.box.keyPair();let c;try{c=n.base64.decode(e)}catch(e){throw new Error("Bad public key")}const f=n.utf8.decode(a),d=i.randomBytes(i.box.nonceLength),r=i.box(f,d,c,t.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:n.base64.encode(d),ephemPublicKey:n.base64.encode(t.publicKey),ciphertext:n.base64.encode(r)}}throw new Error("Encryption type/version not supported")}function s({encryptedData:e,privateKey:a}){if((0,b.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,b.isNullish)(a))throw new Error("Missing privateKey parameter");if("x25519-xsalsa20-poly1305"===e.version){const t=c.from(a,"hex"),f=i.box.keyPair.fromSecretKey(t).secretKey,d=n.base64.decode(e.nonce),r=n.base64.decode(e.ciphertext),b=n.base64.decode(e.ephemPublicKey),o=i.box.open(r,d,b,f);try{if(!o)throw new Error;const e=n.utf8.encode(o);if(!e)throw new Error;return e}catch(e){if(e&&"string"==typeof e.message&&e.message.length)throw new Error(`Decryption failed: ${e.message}`);throw new Error("Decryption failed.")}}throw new Error("Encryption type/version not supported.")}a.encrypt=o,a.encryptSafely=function({publicKey:e,data:a,version:t}){if((0,b.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,b.isNullish)(a))throw new Error("Missing data parameter");if((0,b.isNullish)(t))throw new Error("Missing version parameter");if("object"==typeof a&&a&&"toJSON"in a)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const f={data:a,padding:""},d=c.byteLength(JSON.stringify(f),"utf-8")%2048;let r=0;return d>0&&(r=2048-d-16),f.padding="0".repeat(r),o({publicKey:e,data:JSON.stringify(f),version:t})},a.decrypt=s,a.decryptSafely=function({encryptedData:e,privateKey:a}){if((0,b.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,b.isNullish)(a))throw new Error("Missing privateKey parameter");return JSON.parse(s({encryptedData:e,privateKey:a})).data},a.getEncryptionPublicKey=function(e){const a=c.from(e,"hex"),t=i.box.keyPair.fromSecretKey(a).publicKey;return n.base64.encode(t)}},51594:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),a.normalize=a.concatSig=void 0,f(t(20252),a),f(t(10169),a),f(t(98537),a);var d=t(54907);Object.defineProperty(a,"concatSig",{enumerable:!0,get:function(){return d.concatSig}}),Object.defineProperty(a,"normalize",{enumerable:!0,get:function(){return d.normalize}})},20252:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extractPublicKey=a.recoverPersonalSignature=a.personalSign=void 0;const c=t(68683),f=t(54907);function d(e,a){const t=(0,c.hashPersonalMessage)((0,f.legacyToBuffer)(e));return(0,f.recoverPublicKey)(t,a)}a.personalSign=function({privateKey:e,data:a}){if((0,f.isNullish)(a))throw new Error("Missing data parameter");if((0,f.isNullish)(e))throw new Error("Missing privateKey parameter");const t=(0,f.legacyToBuffer)(a),d=(0,c.hashPersonalMessage)(t),r=(0,c.ecsign)(d,e);return(0,f.concatSig)((0,c.toBuffer)(r.v),r.r,r.s)},a.recoverPersonalSignature=function({data:e,signature:a}){if((0,f.isNullish)(e))throw new Error("Missing data parameter");if((0,f.isNullish)(a))throw new Error("Missing signature parameter");const t=d(e,a),r=(0,c.publicToAddress)(t);return(0,c.bufferToHex)(r)},a.extractPublicKey=function({data:e,signature:a}){if((0,f.isNullish)(e))throw new Error("Missing data parameter");if((0,f.isNullish)(a))throw new Error("Missing signature parameter");return`0x${d(e,a).toString("hex")}`}},10169:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.recoverTypedSignature=a.signTypedData=a.typedSignatureHash=a.TypedDataUtils=a.TYPED_MESSAGE_SCHEMA=a.SignTypedDataVersion=void 0;const c=t(68683),f=t(93256),d=t(46207),r=t(26365),n=t(52367),i=t(32019),b=t(54907);var o;function s(e,a){if(!Object.keys(o).includes(e))throw new Error(`Invalid version: '${e}'`);if(a&&!a.includes(e))throw new Error(`SignTypedDataVersion not allowed: '${e}'. Allowed versions are: ${a.join(", ")}`)}function l(e,a){(0,n.assert)(null!==a,`Unable to encode value: Invalid number. Expected a valid number value, but received "${a}".`);const t=BigInt(a),c=(0,d.getLength)(e),f=BigInt(2)**BigInt(c)-BigInt(1);return(0,n.assert)(t>=-f&&t<=f,`Unable to encode value: Number "${a}" is out of range for type "${e}".`),t}function u(e){let a=BigInt(0);for(let t=0;t=49?c-BigInt(49)+BigInt(10):c>=17?c-BigInt(17)+BigInt(10):c}return(0,r.padStart)((0,n.bigIntToBytes)(a),20)}function h(e,a,t,d,b){if(s(b,[o.V3,o.V4]),void 0!==e[t])return["bytes32",b===o.V4&&null==d?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,c.arrToBufArr)((0,i.keccak256)(p(t,d,e,b)))];if("function"===t)throw new Error('Unsupported or invalid type: "function"');if(void 0===d)throw new Error(`missing value for field ${a} of type ${t}`);if("address"===t){if("number"==typeof d)return["address",(0,r.padStart)((0,n.numberToBytes)(d),20)];if((0,n.isStrictHexString)(d))return["address",(0,n.add0x)(d)];if("string"==typeof d)return["address",u(d).subarray(0,20)]}if("bool"===t)return["bool",Boolean(d)];if("bytes"===t)return"number"==typeof d?d=(0,n.numberToBytes)(d):(0,n.isStrictHexString)(d)||"0x"===d?d=(0,n.hexToBytes)(d):"string"==typeof d&&(d=(0,n.stringToBytes)(d)),["bytes32",(0,c.arrToBufArr)((0,i.keccak256)(d))];if(t.startsWith("bytes")&&"bytes"!==t&&!t.includes("["))return"number"==typeof d?d<0?["bytes32",new Uint8Array(32)]:["bytes32",(0,n.bigIntToBytes)(BigInt(d))]:(0,n.isStrictHexString)(d)?["bytes32",(0,n.hexToBytes)(d)]:["bytes32",d];if(t.startsWith("int")&&!t.includes("[")){const e=l(t,d);return e>=BigInt(0)?["uint256",e]:["int256",e]}if("string"===t)return d="number"==typeof d?(0,n.numberToBytes)(d):(0,n.stringToBytes)(null!=d?d:""),["bytes32",(0,c.arrToBufArr)((0,i.keccak256)(d))];if(t.endsWith("]")){if(b===o.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const r=t.slice(0,t.lastIndexOf("[")),n=d.map((t=>h(e,a,r,t,b)));return["bytes32",(0,c.arrToBufArr)((0,i.keccak256)((0,f.encode)(n.map((([e])=>e)),n.map((([,e])=>e)))))]}return[t,d]}function p(e,a,t,d){s(d,[o.V3,o.V4]);const r=["bytes32"],n=[y(e,t)];for(const c of t[e]){if(d===o.V3&&void 0===a[c.name])continue;const[e,f]=h(t,c.name,c.type,a[c.name],d);r.push(e),n.push(f)}return(0,c.arrToBufArr)((0,f.encode)(r,n))}function g(e,a){let t="";const c=m(e,a);c.delete(e);const f=[e,...Array.from(c).sort()];for(const e of f){if(!a[e])throw new Error(`No type definition specified: ${e}`);t+=`${e}(${a[e].map((({name:e,type:a})=>`${a} ${e}`)).join(",")})`}return t}function m(e,a,t=new Set){if("string"!=typeof e)throw new Error(`Invalid findTypeDependencies input ${JSON.stringify(e)}`);const c=e.match(/^\w*/u);if([e]=c,t.has(e)||void 0===a[e])return t;t.add(e);for(const c of a[e])m(c.type,a,t);return t}function x(e,a,t,f){s(f,[o.V3,o.V4]);const d=p(e,a,t,f),r=(0,i.keccak256)(d);return(0,c.arrToBufArr)(r)}function y(e,a){const t=(0,n.stringToBytes)(g(e,a));return(0,c.arrToBufArr)((0,i.keccak256)(t))}function A(e){const t={};for(const c in a.TYPED_MESSAGE_SCHEMA.properties)e[c]&&(t[c]=e[c]);return"types"in t&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t}function v(e,a){s(a,[o.V3,o.V4]);const t=A(e),{domain:c}=t;return x("EIP712Domain",c,{EIP712Domain:t.types.EIP712Domain},a)}function w(e,a){if((0,d.isArrayType)(e)&&Array.isArray(a)){const[t]=(0,d.getArrayType)(e);return a.map((e=>w(t,e)))}if("address"===e){if("number"==typeof a)return(0,r.padStart)((0,n.numberToBytes)(a),20);if((0,n.isStrictHexString)(a))return(0,r.padStart)((0,n.hexToBytes)(a).subarray(0,20),20);if(a instanceof Uint8Array)return(0,r.padStart)(a.subarray(0,20),20)}if("bool"===e)return Boolean(a);if(e.startsWith("bytes")&&"bytes"!==e){const t=(0,d.getByteLength)(e);if("number"==typeof a)return a<0?new Uint8Array:(0,n.numberToBytes)(a).subarray(0,t);if((0,n.isStrictHexString)(a))return(0,n.hexToBytes)(a).subarray(0,t);if(a instanceof Uint8Array)return a.subarray(0,t)}if(e.startsWith("uint")&&"number"==typeof a)return Math.abs(a);if(e.startsWith("int")&&"number"==typeof a){const t=(0,d.getLength)(e);return BigInt.asIntN(t,BigInt(a))}return a}function _(e,a){return a.map((a=>{if("string"==typeof a||"number"==typeof a||"bigint"==typeof a){const t=l(e,a);if(t>=BigInt(0))return(0,r.padStart)((0,n.bigIntToBytes)(t),32);const c=(0,d.getLength)(e),f=BigInt.asIntN(c,t);return(0,n.signedBigIntToBytes)(f,32)}return a}))}function I(e){const a=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!("length"in e)||!e.length)throw a;const t=e.map((({name:e,type:a,value:t})=>{if("address[]"===a)return{name:e,type:"bytes32[]",value:(c=t,c.map((e=>"number"==typeof e?(0,r.padStart)((0,n.numberToBytes)(e),32):(0,n.isStrictHexString)(e)?(0,r.padStart)((0,n.hexToBytes)(e).subarray(0,32),32):e instanceof Uint8Array?(0,r.padStart)(e.subarray(0,32),32):e)))};var c;if(a.startsWith("int")&&(0,d.isArrayType)(a)){const[c,f]=(0,d.getArrayType)(a);return{name:e,type:`bytes32[${null!=f?f:""}]`,value:_(c,t)}}return{name:e,type:a,value:w(a,t)}})),o=t.map((e=>"bytes"!==e.type?e.value:(0,b.legacyToBuffer)(e.value))),s=t.map((e=>{if("function"===e.type)throw new Error('Unsupported or invalid type: "function"');return e.type})),l=e.map((e=>{if(!e.name)throw a;return`${e.type} ${e.name}`}));return(0,c.arrToBufArr)((0,i.keccak256)((0,f.encodePacked)(["bytes32","bytes32"],[(0,i.keccak256)((0,f.encodePacked)(["string[]"],[l],!0)),(0,i.keccak256)((0,f.encodePacked)(s,o,!0))])))}!function(e){e.V1="V1",e.V3="V3",e.V4="V4"}(o=a.SignTypedDataVersion||(a.SignTypedDataVersion={})),a.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"]},a.TypedDataUtils={encodeData:p,encodeType:g,findTypeDependencies:m,hashStruct:x,hashType:y,sanitizeData:A,eip712Hash:function(e,a){s(a,[o.V3,o.V4]);const t=A(e),f=[(0,n.hexToBytes)("1901")];return f.push(v(e,a)),"EIP712Domain"!==t.primaryType&&f.push(x(t.primaryType,t.message,t.types,a)),(0,c.arrToBufArr)((0,i.keccak256)((0,n.concatBytes)(f)))},eip712DomainHash:v},a.typedSignatureHash=function(e){const a=I(e);return(0,n.bytesToHex)(a)},a.signTypedData=function({privateKey:e,data:t,version:f}){if(s(f),(0,b.isNullish)(t))throw new Error("Missing data parameter");if((0,b.isNullish)(e))throw new Error("Missing private key parameter");const d=f===o.V1?I(t):a.TypedDataUtils.eip712Hash(t,f),r=(0,c.ecsign)(d,e);return(0,b.concatSig)((0,c.arrToBufArr)((0,n.bigIntToBytes)(r.v)),r.r,r.s)},a.recoverTypedSignature=function({data:e,signature:t,version:f}){if(s(f),(0,b.isNullish)(e))throw new Error("Missing data parameter");if((0,b.isNullish)(t))throw new Error("Missing signature parameter");const d=f===o.V1?I(e):a.TypedDataUtils.eip712Hash(e,f),r=(0,b.recoverPublicKey)(d,t),i=(0,c.publicToAddress)(r);return(0,n.bytesToHex)(i)}},54907:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.normalize=a.recoverPublicKey=a.concatSig=a.legacyToBuffer=a.isNullish=a.padWithZeroes=void 0;const f=t(68683),d=t(52367);function r(e,a){if(""!==e&&!/^[a-f0-9]+$/iu.test(e))throw new Error(`Expected an unprefixed hex string. Received: ${e}`);if(a<0)throw new Error(`Expected a non-negative integer target length. Received: ${a}`);return String.prototype.padStart.call(e,a,"0")}function n(e){return null==e}a.padWithZeroes=r,a.isNullish=n,a.legacyToBuffer=function(e){return"string"!=typeof e||(0,f.isHexString)(e)?(0,f.toBuffer)(e):c.from(e)},a.concatSig=function(e,a,t){const c=(0,f.fromSigned)(a),n=(0,f.fromSigned)(t),i=(0,f.bufferToInt)(e),b=r((0,f.toUnsigned)(c).toString("hex"),64),o=r((0,f.toUnsigned)(n).toString("hex"),64),s=(0,d.remove0x)((0,d.numberToHex)(i));return(0,d.add0x)(b.concat(o,s))},a.recoverPublicKey=function(e,a){const t=(0,f.fromRpcSig)(a);return(0,f.ecrecover)(e,t.v,t.r,t.s)},a.normalize=function(e){if(!n(e)){if("number"==typeof e){if(e<0)return"0x";const a=(0,d.numberToBytes)(e);e=(0,d.bytesToHex)(a)}if("string"!=typeof e){let a="eth-sig-util.normalize() requires hex string or integer input.";throw a+=` received ${typeof e}: ${e}`,new Error(a)}return(0,d.add0x)(e.toLowerCase())}}},82102:(e,a)=>{"use strict";function t(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function c(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function f(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function d(e,...a){if(!f(e))throw new Error("Uint8Array expected");if(a.length>0&&!a.includes(e.length))throw new Error(`Uint8Array expected of length ${a}, not of length=${e.length}`)}function r(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");t(e.outputLen),t(e.blockLen)}function n(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function i(e,a){d(e);const t=a.outputLen;if(e.length{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.add5L=a.add5H=a.add4H=a.add4L=a.add3H=a.add3L=a.rotlBL=a.rotlBH=a.rotlSL=a.rotlSH=a.rotr32L=a.rotr32H=a.rotrBL=a.rotrBH=a.rotrSL=a.rotrSH=a.shrSL=a.shrSH=a.toBig=void 0,a.fromBig=f,a.split=d,a.add=y;const t=BigInt(2**32-1),c=BigInt(32);function f(e,a=!1){return a?{h:Number(e&t),l:Number(e>>c&t)}:{h:0|Number(e>>c&t),l:0|Number(e&t)}}function d(e,a=!1){let t=new Uint32Array(e.length),c=new Uint32Array(e.length);for(let d=0;dBigInt(e>>>0)<>>0);a.toBig=r;const n=(e,a,t)=>e>>>t;a.shrSH=n;const i=(e,a,t)=>e<<32-t|a>>>t;a.shrSL=i;const b=(e,a,t)=>e>>>t|a<<32-t;a.rotrSH=b;const o=(e,a,t)=>e<<32-t|a>>>t;a.rotrSL=o;const s=(e,a,t)=>e<<64-t|a>>>t-32;a.rotrBH=s;const l=(e,a,t)=>e>>>t-32|a<<64-t;a.rotrBL=l;const u=(e,a)=>a;a.rotr32H=u;const h=(e,a)=>e;a.rotr32L=h;const p=(e,a,t)=>e<>>32-t;a.rotlSH=p;const g=(e,a,t)=>a<>>32-t;a.rotlSL=g;const m=(e,a,t)=>a<>>64-t;a.rotlBH=m;const x=(e,a,t)=>e<>>64-t;function y(e,a,t,c){const f=(a>>>0)+(c>>>0);return{h:e+t+(f/2**32|0)|0,l:0|f}}a.rotlBL=x;const A=(e,a,t)=>(e>>>0)+(a>>>0)+(t>>>0);a.add3L=A;const v=(e,a,t,c)=>a+t+c+(e/2**32|0)|0;a.add3H=v;const w=(e,a,t,c)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0);a.add4L=w;const _=(e,a,t,c,f)=>a+t+c+f+(e/2**32|0)|0;a.add4H=_;const I=(e,a,t,c,f)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0)+(f>>>0);a.add5L=I;const E=(e,a,t,c,f,d)=>a+t+c+f+d+(e/2**32|0)|0;a.add5H=E;const C={fromBig:f,split:d,toBig:r,shrSH:n,shrSL:i,rotrSH:b,rotrSL:o,rotrBH:s,rotrBL:l,rotr32H:u,rotr32L:h,rotlSH:p,rotlSL:g,rotlBH:m,rotlBL:x,add:y,add3L:A,add3H:v,add4L:w,add4H:_,add5H:E,add5L:I};a.default=C},6256:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.crypto=void 0,a.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},2214:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.shake256=a.shake128=a.keccak_512=a.keccak_384=a.keccak_256=a.keccak_224=a.sha3_512=a.sha3_384=a.sha3_256=a.sha3_224=a.Keccak=void 0,a.keccakP=y;const c=t(82102),f=t(17335),d=t(79520),r=[],n=[],i=[],b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(7),u=BigInt(256),h=BigInt(113);for(let e=0,a=o,t=1,c=0;e<24;e++){[t,c]=[c,(2*t+3*c)%5],r.push(2*(5*c+t)),n.push((e+1)*(e+2)/2%64);let f=b;for(let e=0;e<7;e++)a=(a<>l)*h)%u,a&s&&(f^=o<<(o<t>32?(0,f.rotlBH)(e,a,t):(0,f.rotlSH)(e,a,t),x=(e,a,t)=>t>32?(0,f.rotlBL)(e,a,t):(0,f.rotlSL)(e,a,t);function y(e,a=24){const t=new Uint32Array(10);for(let c=24-a;c<24;c++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const c=(a+8)%10,f=(a+2)%10,d=t[f],r=t[f+1],n=m(d,r,1)^t[c],i=x(d,r,1)^t[c+1];for(let t=0;t<50;t+=10)e[a+t]^=n,e[a+t+1]^=i}let a=e[2],f=e[3];for(let t=0;t<24;t++){const c=n[t],d=m(a,f,c),i=x(a,f,c),b=r[t];a=e[b],f=e[b+1],e[b]=d,e[b+1]=i}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)t[c]=e[a+c];for(let c=0;c<10;c++)e[a+c]^=~t[(c+2)%10]&t[(c+4)%10]}e[0]^=p[c],e[1]^=g[c]}t.fill(0)}class A extends d.Hash{constructor(e,a,t,f=!1,r=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=t,this.enableXOF=f,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,c.number)(t),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,d.u32)(this.state)}keccak(){d.isLE||(0,d.byteSwap32)(this.state32),y(this.state32,this.rounds),d.isLE||(0,d.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,c.exists)(this);const{blockLen:a,state:t}=this,f=(e=(0,d.toBytes)(e)).length;for(let c=0;c=t&&this.keccak();const d=Math.min(t-this.posOut,f-c);e.set(a.subarray(this.posOut,this.posOut+d),c),this.posOut+=d,c+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,c.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,c.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:t,outputLen:c,rounds:f,enableXOF:d}=this;return e||(e=new A(a,t,c,d,f)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=f,e.suffix=t,e.outputLen=c,e.enableXOF=d,e.destroyed=this.destroyed,e}}a.Keccak=A;const v=(e,a,t)=>(0,d.wrapConstructor)((()=>new A(a,e,t)));a.sha3_224=v(6,144,28),a.sha3_256=v(6,136,32),a.sha3_384=v(6,104,48),a.sha3_512=v(6,72,64),a.keccak_224=v(1,144,28),a.keccak_256=v(1,136,32),a.keccak_384=v(1,104,48),a.keccak_512=v(1,72,64);const w=(e,a,t)=>(0,d.wrapXOFConstructorWithOpts)(((c={})=>new A(a,e,void 0===c.dkLen?t:c.dkLen,!0)));a.shake128=w(31,168,16),a.shake256=w(31,136,32)},79520:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Hash=a.nextTick=a.byteSwapIfBE=a.byteSwap=a.isLE=a.rotl=a.rotr=a.createView=a.u32=a.u8=void 0,a.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name},a.byteSwap32=function(e){for(let t=0;t=0&&ee().update(b(a)).digest(),t=e();return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=()=>e(),a},a.wrapConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(b(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.wrapXOFConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(b(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.randomBytes=function(e=32){if(c.crypto&&"function"==typeof c.crypto.getRandomValues)return c.crypto.getRandomValues(new Uint8Array(e));if(c.crypto&&"function"==typeof c.crypto.randomBytes)return c.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const c=t(6256),f=t(82102);a.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),a.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),a.rotr=(e,a)=>e<<32-a|e>>>a,a.rotl=(e,a)=>e<>>32-a>>>0,a.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],a.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,a.byteSwapIfBE=a.isLE?e=>e:e=>(0,a.byteSwap)(e);const d=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0"))),r={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function n(e){return e>=r._0&&e<=r._9?e-r._0:e>=r._A&&e<=r._F?e-(r._A-10):e>=r._a&&e<=r._f?e-(r._a-10):void 0}function i(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function b(e){return"string"==typeof e&&(e=i(e)),(0,f.bytes)(e),e}a.nextTick=async()=>{},a.Hash=class{clone(){return this._cloneInto()}};const o={}.toString},73562:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getHash=r,a.createCurve=function(e,a){const t=a=>(0,d.weierstrass)({...e,...r(a)});return Object.freeze({...t(a),create:t})};const c=t(39615),f=t(99175),d=t(91705);function r(e){return{hash:e,hmac:(a,...t)=>(0,c.hmac)(e,a,(0,f.concatBytes)(...t)),randomBytes:f.randomBytes}}},62422:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.wNAF=function(e,a){const t=(e,a)=>{const t=a.negate();return e?t:a},c=e=>({windows:Math.ceil(a/e)+1,windowSize:2**(e-1)});return{constTimeNegate:t,unsafeLadder(a,t){let c=e.ZERO,f=a;for(;t>d;)t&r&&(c=c.add(f)),f=f.double(),t>>=r;return c},precomputeWindow(e,a){const{windows:t,windowSize:f}=c(a),d=[];let r=e,n=r;for(let e=0;e>=u,c>i&&(c-=l,d+=r);const n=a,h=a+Math.abs(c)-1,p=e%2!=0,g=c<0;0===c?o=o.add(t(p,f[n])):b=b.add(t(g,f[h]))}return{p:b,f:o}},wNAFCached(e,a,t,c){const f=e._WINDOW_SIZE||1;let d=a.get(e);return d||(d=this.precomputeWindow(e,f),1!==f&&a.set(e,c(d))),this.wNAF(f,d,t)}}},a.validateBasic=function(e){return(0,c.validateField)(e.Fp),(0,f.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,c.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})};const c=t(24967),f=t(91484),d=BigInt(0),r=BigInt(1)},71761:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.expand_message_xmd=b,a.expand_message_xof=o,a.hash_to_field=s,a.isogenyMap=function(e,a){const t=a.map((e=>Array.from(e).reverse()));return(a,c)=>{const[f,d,r,n]=t.map((t=>t.reduce(((t,c)=>e.add(e.mul(t,a),c)))));return a=e.div(f,d),c=e.mul(c,e.div(r,n)),{x:a,y:c}}},a.createHasher=function(e,a,t){if("function"!=typeof a)throw new Error("mapToCurve() must be defined");return{hashToCurve(c,f){const d=s(c,2,{...t,DST:t.DST,...f}),r=e.fromAffine(a(d[0])),n=e.fromAffine(a(d[1])),i=r.add(n).clearCofactor();return i.assertValidity(),i},encodeToCurve(c,f){const d=s(c,1,{...t,DST:t.encodeDST,...f}),r=e.fromAffine(a(d[0])).clearCofactor();return r.assertValidity(),r},mapToCurve(t){if(!Array.isArray(t))throw new Error("mapToCurve: expected array of bigints");for(const e of t)if("bigint"!=typeof e)throw new Error(`mapToCurve: expected array of bigints, got ${e} in array`);const c=e.fromAffine(a(t)).clearCofactor();return c.assertValidity(),c}}};const c=t(24967),f=t(91484),d=f.bytesToNumberBE;function r(e,a){if(e<0||e>=1<<8*a)throw new Error(`bad I2OSP call: value=${e} length=${a}`);const t=Array.from({length:a}).fill(0);for(let c=a-1;c>=0;c--)t[c]=255&e,e>>>=8;return new Uint8Array(t)}function n(e,a){const t=new Uint8Array(e.length);for(let c=0;c255&&(a=c((0,f.concatBytes)((0,f.utf8ToBytes)("H2C-OVERSIZE-DST-"),a)));const{outputLen:d,blockLen:b}=c,o=Math.ceil(t/d);if(o>255)throw new Error("Invalid xmd length");const s=(0,f.concatBytes)(a,r(a.length,1)),l=r(0,b),u=r(t,2),h=new Array(o),p=c((0,f.concatBytes)(l,e,u,r(0,1),s));h[0]=c((0,f.concatBytes)(p,r(1,1),s));for(let e=1;e<=o;e++){const a=[n(p,h[e-1]),r(e+1,1),s];h[e]=c((0,f.concatBytes)(...a))}return(0,f.concatBytes)(...h).slice(0,t)}function o(e,a,t,c,d){if((0,f.abytes)(e),(0,f.abytes)(a),i(t),a.length>255){const e=Math.ceil(2*c/8);a=d.create({dkLen:e}).update((0,f.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(a).digest()}if(t>65535||a.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return d.create({dkLen:t}).update(e).update(r(t,2)).update(a).update(r(a.length,1)).digest()}function s(e,a,t){(0,f.validateObject)(t,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:r,k:n,m:s,hash:l,expand:u,DST:h}=t;(0,f.abytes)(e),i(a);const p="string"==typeof h?(0,f.utf8ToBytes)(h):h,g=r.toString(2).length,m=Math.ceil((g+n)/8),x=a*s*m;let y;if("xmd"===u)y=b(e,p,x,l);else if("xof"===u)y=o(e,p,x,n,l);else{if("_internal_pass"!==u)throw new Error('expand must be "xmd" or "xof"');y=e}const A=new Array(a);for(let e=0;e{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.isNegativeLE=void 0,a.mod=s,a.pow=l,a.pow2=function(e,a,t){let c=e;for(;a-- >f;)c*=c,c%=t;return c},a.invert=u,a.tonelliShanks=h,a.FpSqrt=p,a.validateField=function(e){const a=g.reduce(((e,a)=>(e[a]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,c.validateObject)(e,a)},a.FpPow=m,a.FpInvertBatch=x,a.FpDiv=function(e,a,t){return e.mul(a,"bigint"==typeof t?u(t,e.ORDER):e.inv(t))},a.FpIsSquare=function(e){const a=(e.ORDER-d)/r;return t=>{const c=e.pow(t,a);return e.eql(c,e.ZERO)||e.eql(c,e.ONE)}},a.nLength=y,a.Field=function(e,a,t=!1,r={}){if(e<=f)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:n,nByteLength:i}=y(e,a);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const b=p(e),o=Object.freeze({ORDER:e,BITS:n,BYTES:i,MASK:(0,c.bitMask)(n),ZERO:f,ONE:d,create:a=>s(a,e),isValid:a=>{if("bigint"!=typeof a)throw new Error("Invalid field element: expected bigint, got "+typeof a);return f<=a&&ae===f,isOdd:e=>(e&d)===d,neg:a=>s(-a,e),eql:(e,a)=>e===a,sqr:a=>s(a*a,e),add:(a,t)=>s(a+t,e),sub:(a,t)=>s(a-t,e),mul:(a,t)=>s(a*t,e),pow:(e,a)=>m(o,e,a),div:(a,t)=>s(a*u(t,e),e),sqrN:e=>e*e,addN:(e,a)=>e+a,subN:(e,a)=>e-a,mulN:(e,a)=>e*a,inv:a=>u(a,e),sqrt:r.sqrt||(e=>b(o,e)),invertBatch:e=>x(o,e),cmov:(e,a,t)=>t?a:e,toBytes:e=>t?(0,c.numberToBytesLE)(e,i):(0,c.numberToBytesBE)(e,i),fromBytes:e=>{if(e.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${e.length}`);return t?(0,c.bytesToNumberLE)(e):(0,c.bytesToNumberBE)(e)}});return Object.freeze(o)},a.FpSqrtOdd=function(e,a){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const t=e.sqrt(a);return e.isOdd(t)?t:e.neg(t)},a.FpSqrtEven=function(e,a){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const t=e.sqrt(a);return e.isOdd(t)?e.neg(t):t},a.hashToPrivateScalar=function(e,a,t=!1){const f=(e=(0,c.ensureBytes)("privateHash",e)).length,r=y(a).nByteLength+8;if(r<24||f1024)throw new Error(`hashToPrivateScalar: expected ${r}-1024 bytes of input, got ${f}`);return s(t?(0,c.bytesToNumberLE)(e):(0,c.bytesToNumberBE)(e),a-d)+d},a.getFieldBytesLength=A,a.getMinHashLength=v,a.mapHashToField=function(e,a,t=!1){const f=e.length,r=A(a),n=v(a);if(f<16||f1024)throw new Error(`expected ${n}-1024 bytes of input, got ${f}`);const i=s(t?(0,c.bytesToNumberBE)(e):(0,c.bytesToNumberLE)(e),a-d)+d;return t?(0,c.numberToBytesLE)(i,r):(0,c.numberToBytesBE)(i,r)};const c=t(91484),f=BigInt(0),d=BigInt(1),r=BigInt(2),n=BigInt(3),i=BigInt(4),b=BigInt(5),o=BigInt(8);function s(e,a){const t=e%a;return t>=f?t:a+t}function l(e,a,t){if(t<=f||a 0");if(t===d)return f;let c=d;for(;a>f;)a&d&&(c=c*e%t),e=e*e%t,a>>=d;return c}function u(e,a){if(e===f||a<=f)throw new Error(`invert: expected positive integers, got n=${e} mod=${a}`);let t=s(e,a),c=a,r=f,n=d,i=d,b=f;for(;t!==f;){const e=c/t,a=c%t,f=r-i*e,d=n-b*e;c=t,t=a,r=i,n=b,i=f,b=d}if(c!==d)throw new Error("invert: does not exist");return s(r,a)}function h(e){const a=(e-d)/r;let t,c,n;for(t=e-d,c=0;t%r===f;t/=r,c++);for(n=r;n(s(e,a)&d)===d;const g=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function m(e,a,t){if(t 0");if(t===f)return e.ONE;if(t===d)return a;let c=e.ONE,r=a;for(;t>f;)t&d&&(c=e.mul(c,r)),r=e.sqr(r),t>>=d;return c}function x(e,a){const t=new Array(a.length),c=a.reduce(((a,c,f)=>e.is0(c)?a:(t[f]=a,e.mul(a,c))),e.ONE),f=e.inv(c);return a.reduceRight(((a,c,f)=>e.is0(c)?a:(t[f]=e.mul(a,t[f]),e.mul(a,c))),f),t}function y(e,a){const t=void 0!==a?a:e.toString(2).length;return{nBitLength:t,nByteLength:Math.ceil(t/8)}}function A(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const a=e.toString(2).length;return Math.ceil(a/8)}function v(e){const a=A(e);return a+Math.ceil(a/2)}},91484:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.bitMask=void 0,a.isBytes=d,a.abytes=r,a.bytesToHex=i,a.numberToHexUnpadded=b,a.hexToNumber=o,a.hexToBytes=u,a.bytesToNumberBE=function(e){return o(i(e))},a.bytesToNumberLE=function(e){return r(e),o(i(Uint8Array.from(e).reverse()))},a.numberToBytesBE=h,a.numberToBytesLE=function(e,a){return h(e,a).reverse()},a.numberToVarBytesBE=function(e){return u(b(e))},a.ensureBytes=function(e,a,t){let c;if("string"==typeof a)try{c=u(a)}catch(t){throw new Error(`${e} must be valid hex string, got "${a}". Cause: ${t}`)}else{if(!d(a))throw new Error(`${e} must be hex string or Uint8Array`);c=Uint8Array.from(a)}const f=c.length;if("number"==typeof t&&f!==t)throw new Error(`${e} expected ${t} bytes, got ${f}`);return c},a.concatBytes=p,a.equalBytes=function(e,a){if(e.length!==a.length)return!1;let t=0;for(let c=0;ct;e>>=c,a+=1);return a},a.bitGet=function(e,a){return e>>BigInt(a)&c},a.bitSet=function(e,a,f){return e|(f?c:t)<{c.fill(1),f.fill(0),d=0},n=(...e)=>t(f,c,...e),i=(e=g())=>{f=n(m([0]),e),c=n(),0!==e.length&&(f=n(m([1]),e),c=n())},b=()=>{if(d++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const t=[];for(;e{let t;for(r(),i(e);!(t=a(b()));)i();return r(),t}},a.validateObject=function(e,a,t={}){const c=(a,t,c)=>{const f=x[t];if("function"!=typeof f)throw new Error(`Invalid validator "${t}", expected function`);const d=e[a];if(!(c&&void 0===d||f(d,e)))throw new Error(`Invalid param ${String(a)}=${d} (${typeof d}), expected ${t}`)};for(const[e,t]of Object.entries(a))c(e,t,!1);for(const[e,a]of Object.entries(t))c(e,a,!0);return e};const t=BigInt(0),c=BigInt(1),f=BigInt(2);function d(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function r(e){if(!d(e))throw new Error("Uint8Array expected")}const n=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function i(e){r(e);let a="";for(let t=0;t=s._0&&e<=s._9?e-s._0:e>=s._A&&e<=s._F?e-(s._A-10):e>=s._a&&e<=s._f?e-(s._a-10):void 0}function u(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const a=e.length,t=a/2;if(a%2)throw new Error("padded hex string expected, got unpadded hex of length "+a);const c=new Uint8Array(t);for(let a=0,f=0;a(f<new Uint8Array(e),m=e=>Uint8Array.from(e),x={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||d(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,a)=>a.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)}},91705:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.DER=void 0,a.weierstrassPoints=h,a.weierstrass=function(e){const t=function(e){const a=(0,c.validateBasic)(e);return d.validateObject(a,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...a})}(e),{Fp:n,n:i}=t,s=n.BYTES+1,l=2*n.BYTES+1;function u(e){return f.mod(e,i)}function p(e){return f.invert(e,i)}const{ProjectivePoint:g,normPrivateKeyToScalar:m,weierstrassEquation:x,isWithinCurveOrder:y}=h({...t,toBytes(e,a,t){const c=a.toAffine(),f=n.toBytes(c.x),r=d.concatBytes;return t?r(Uint8Array.from([a.hasEvenY()?2:3]),f):r(Uint8Array.from([4]),f,n.toBytes(c.y))},fromBytes(e){const a=e.length,t=e[0],c=e.subarray(1);if(a!==s||2!==t&&3!==t){if(a===l&&4===t)return{x:n.fromBytes(c.subarray(0,n.BYTES)),y:n.fromBytes(c.subarray(n.BYTES,2*n.BYTES))};throw new Error(`Point of length ${a} was invalid. Expected ${s} compressed bytes or ${l} uncompressed bytes`)}{const e=d.bytesToNumberBE(c);if(!(b<(f=e)&&fd.bytesToHex(d.numberToBytesBE(e,t.nByteLength));function v(e){return e>i>>o}const w=(e,a,t)=>d.bytesToNumberBE(e.slice(a,t));class _{constructor(e,a,t){this.r=e,this.s=a,this.recovery=t,this.assertValidity()}static fromCompact(e){const a=t.nByteLength;return e=(0,r.ensureBytes)("compactSignature",e,2*a),new _(w(e,0,a),w(e,a,2*a))}static fromDER(e){const{r:t,s:c}=a.DER.toSig((0,r.ensureBytes)("DER",e));return new _(t,c)}assertValidity(){if(!y(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!y(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new _(this.r,this.s,e)}recoverPublicKey(e){const{r:a,s:c,recovery:f}=this,d=M((0,r.ensureBytes)("msgHash",e));if(null==f||![0,1,2,3].includes(f))throw new Error("recovery id invalid");const i=2===f||3===f?a+t.n:a;if(i>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const b=1&f?"03":"02",o=g.fromHex(b+A(i)),s=p(i),l=u(-d*s),h=u(c*s),m=g.BASE.multiplyAndAddUnsafe(o,l,h);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return d.hexToBytes(this.toDERHex())}toDERHex(){return a.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return d.hexToBytes(this.toCompactHex())}toCompactHex(){return A(this.r)+A(this.s)}}const I={isValidPrivateKey(e){try{return m(e),!0}catch(e){return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{const e=f.getMinHashLength(t.n);return f.mapHashToField(t.randomBytes(e),t.n)},precompute:(e=8,a=g.BASE)=>(a._setWindowSize(e),a.multiply(BigInt(3)),a)};function E(e){const a=d.isBytes(e),t="string"==typeof e,c=(a||t)&&e.length;return a?c===s||c===l:t?c===2*s||c===2*l:e instanceof g}const C=t.bits2int||function(e){const a=d.bytesToNumberBE(e),c=8*e.length-t.nBitLength;return c>0?a>>BigInt(c):a},M=t.bits2int_modN||function(e){return u(C(e))},B=d.bitMask(t.nBitLength);function L(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(b<=e&&ee in c)))throw new Error("sign() legacy options not supported");const{hash:f,randomBytes:i}=t;let{lowS:s,prehash:l,extraEntropy:h}=c;null==s&&(s=!0),e=(0,r.ensureBytes)("msgHash",e),l&&(e=(0,r.ensureBytes)("prehashed msgHash",f(e)));const x=M(e),A=m(a),w=[L(A),L(x)];if(null!=h&&!1!==h){const e=!0===h?i(n.BYTES):h;w.push((0,r.ensureBytes)("extraEntropy",e))}const I=d.concatBytes(...w),E=x;return{seed:I,k2sig:function(e){const a=C(e);if(!y(a))return;const t=p(a),c=g.BASE.multiply(a).toAffine(),f=u(c.x);if(f===b)return;const d=u(t*u(E+f*A));if(d===b)return;let r=(c.x===f?0:2)|Number(c.y&o),n=d;return s&&v(d)&&(n=function(e){return v(e)?u(-e):e}(d),r^=1),new _(f,n,r)}}}(e,a,c),s=t;return d.createHmacDrbg(s.hash.outputLen,s.nByteLength,s.hmac)(f,i)},verify:function(e,c,f,n=k){const i=e;if(c=(0,r.ensureBytes)("msgHash",c),f=(0,r.ensureBytes)("publicKey",f),"strict"in n)throw new Error("options.strict was renamed to lowS");const{lowS:b,prehash:o}=n;let s,l;try{if("string"==typeof i||d.isBytes(i))try{s=_.fromDER(i)}catch(e){if(!(e instanceof a.DER.Err))throw e;s=_.fromCompact(i)}else{if("object"!=typeof i||"bigint"!=typeof i.r||"bigint"!=typeof i.s)throw new Error("PARSE");{const{r:e,s:a}=i;s=new _(e,a)}}l=g.fromHex(f)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(b&&s.hasHighS())return!1;o&&(c=t.hash(c));const{r:h,s:m}=s,x=M(c),y=p(m),A=u(x*y),v=u(h*y),w=g.BASE.multiplyAndAddUnsafe(l,A,v)?.toAffine();return!!w&&u(w.x)===h},ProjectivePoint:g,Signature:_,utils:I}},a.SWUFpSqrtRatio=p,a.mapToCurveSimpleSWU=function(e,a){if(f.validateField(e),!e.isValid(a.A)||!e.isValid(a.B)||!e.isValid(a.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const t=p(e,a.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return c=>{let f,d,r,n,i,b,o,s;f=e.sqr(c),f=e.mul(f,a.Z),d=e.sqr(f),d=e.add(d,f),r=e.add(d,e.ONE),r=e.mul(r,a.B),n=e.cmov(a.Z,e.neg(d),!e.eql(d,e.ZERO)),n=e.mul(n,a.A),d=e.sqr(r),b=e.sqr(n),i=e.mul(b,a.A),d=e.add(d,i),d=e.mul(d,r),b=e.mul(b,n),i=e.mul(b,a.B),d=e.add(d,i),o=e.mul(f,r);const{isValid:l,value:u}=t(d,b);s=e.mul(f,c),s=e.mul(s,u),o=e.cmov(o,r,l),s=e.cmov(s,u,l);const h=e.isOdd(c)===e.isOdd(s);return s=e.cmov(e.neg(s),s,h),o=e.div(o,n),{x:o,y:s}}};const c=t(62422),f=t(24967),d=t(91484),r=t(91484),{bytesToNumberBE:n,hexToBytes:i}=d;a.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=a.DER;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const c=e[1],f=e.subarray(2,c+2);if(!c||f.length!==c)throw new t("Invalid signature integer: wrong length");if(128&f[0])throw new t("Invalid signature integer: negative");if(0===f[0]&&!(128&f[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:n(f),l:e.subarray(c+2)}},toSig(e){const{Err:t}=a.DER,c="string"==typeof e?i(e):e;d.abytes(c);let f=c.length;if(f<2||48!=c[0])throw new t("Invalid signature tag");if(c[1]!==f-2)throw new t("Invalid signature: incorrect length");const{d:r,l:n}=a.DER._parseInt(c.subarray(2)),{d:b,l:o}=a.DER._parseInt(n);if(o.length)throw new t("Invalid signature: left bytes after parsing");return{r,s:b}},hexFromSig(e){const a=e=>8&Number.parseInt(e[0],16)?"00"+e:e,t=e=>{const a=e.toString(16);return 1&a.length?`0${a}`:a},c=a(t(e.s)),f=a(t(e.r)),d=c.length/2,r=f.length/2,n=t(d),i=t(r);return`30${t(r+d+4)}02${i}${f}02${n}${c}`}};const b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(3),u=BigInt(4);function h(e){const a=function(e){const a=(0,c.validateBasic)(e);d.validateObject(a,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:f,a:r}=a;if(t){if(!f.eql(r,f.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof t||"bigint"!=typeof t.beta||"function"!=typeof t.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...a})}(e),{Fp:t}=a,n=a.toBytes||((e,a,c)=>{const f=a.toAffine();return d.concatBytes(Uint8Array.from([4]),t.toBytes(f.x),t.toBytes(f.y))}),i=a.fromBytes||(e=>{const a=e.subarray(1);return{x:t.fromBytes(a.subarray(0,t.BYTES)),y:t.fromBytes(a.subarray(t.BYTES,2*t.BYTES))}});function s(e){const{a:c,b:f}=a,d=t.sqr(e),r=t.mul(d,e);return t.add(t.add(r,t.mul(e,c)),f)}if(!t.eql(t.sqr(a.Gy),s(a.Gx)))throw new Error("bad generator point: equation left != right");function u(e){return"bigint"==typeof e&&bt.eql(e,t.ZERO);return f(a)&&f(c)?x.ZERO:new x(a,c,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(x.fromAffine)}static fromHex(e){const a=x.fromAffine(i((0,r.ensureBytes)("pointHex",e)));return a.assertValidity(),a}static fromPrivateKey(e){return x.BASE.multiply(p(e))}_setWindowSize(e){this._WINDOW_SIZE=e,g.delete(this)}assertValidity(){if(this.is0()){if(a.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:c}=this.toAffine();if(!t.isValid(e)||!t.isValid(c))throw new Error("bad point: x or y not FE");const f=t.sqr(c),d=s(e);if(!t.eql(f,d))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(t.isOdd)return!t.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){m(e);const{px:a,py:c,pz:f}=this,{px:d,py:r,pz:n}=e,i=t.eql(t.mul(a,n),t.mul(d,f)),b=t.eql(t.mul(c,n),t.mul(r,f));return i&&b}negate(){return new x(this.px,t.neg(this.py),this.pz)}double(){const{a:e,b:c}=a,f=t.mul(c,l),{px:d,py:r,pz:n}=this;let i=t.ZERO,b=t.ZERO,o=t.ZERO,s=t.mul(d,d),u=t.mul(r,r),h=t.mul(n,n),p=t.mul(d,r);return p=t.add(p,p),o=t.mul(d,n),o=t.add(o,o),i=t.mul(e,o),b=t.mul(f,h),b=t.add(i,b),i=t.sub(u,b),b=t.add(u,b),b=t.mul(i,b),i=t.mul(p,i),o=t.mul(f,o),h=t.mul(e,h),p=t.sub(s,h),p=t.mul(e,p),p=t.add(p,o),o=t.add(s,s),s=t.add(o,s),s=t.add(s,h),s=t.mul(s,p),b=t.add(b,s),h=t.mul(r,n),h=t.add(h,h),s=t.mul(h,p),i=t.sub(i,s),o=t.mul(h,u),o=t.add(o,o),o=t.add(o,o),new x(i,b,o)}add(e){m(e);const{px:c,py:f,pz:d}=this,{px:r,py:n,pz:i}=e;let b=t.ZERO,o=t.ZERO,s=t.ZERO;const u=a.a,h=t.mul(a.b,l);let p=t.mul(c,r),g=t.mul(f,n),y=t.mul(d,i),A=t.add(c,f),v=t.add(r,n);A=t.mul(A,v),v=t.add(p,g),A=t.sub(A,v),v=t.add(c,d);let w=t.add(r,i);return v=t.mul(v,w),w=t.add(p,y),v=t.sub(v,w),w=t.add(f,d),b=t.add(n,i),w=t.mul(w,b),b=t.add(g,y),w=t.sub(w,b),s=t.mul(u,v),b=t.mul(h,y),s=t.add(b,s),b=t.sub(g,s),s=t.add(g,s),o=t.mul(b,s),g=t.add(p,p),g=t.add(g,p),y=t.mul(u,y),v=t.mul(h,v),g=t.add(g,y),y=t.sub(p,y),y=t.mul(u,y),v=t.add(v,y),p=t.mul(g,v),o=t.add(o,p),p=t.mul(w,v),b=t.mul(A,b),b=t.sub(b,p),p=t.mul(A,g),s=t.mul(w,s),s=t.add(s,p),new x(b,o,s)}subtract(e){return this.add(e.negate())}is0(){return this.equals(x.ZERO)}wNAF(e){return A.wNAFCached(this,g,e,(e=>{const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(x.fromAffine)}))}multiplyUnsafe(e){const c=x.ZERO;if(e===b)return c;if(h(e),e===o)return this;const{endo:f}=a;if(!f)return A.unsafeLadder(this,e);let{k1neg:d,k1:r,k2neg:n,k2:i}=f.splitScalar(e),s=c,l=c,u=this;for(;r>b||i>b;)r&o&&(s=s.add(u)),i&o&&(l=l.add(u)),u=u.double(),r>>=o,i>>=o;return d&&(s=s.negate()),n&&(l=l.negate()),l=new x(t.mul(l.px,f.beta),l.py,l.pz),s.add(l)}multiply(e){h(e);let c,f,d=e;const{endo:r}=a;if(r){const{k1neg:e,k1:a,k2neg:n,k2:i}=r.splitScalar(d);let{p:b,f:o}=this.wNAF(a),{p:s,f:l}=this.wNAF(i);b=A.constTimeNegate(e,b),s=A.constTimeNegate(n,s),s=new x(t.mul(s.px,r.beta),s.py,s.pz),c=b.add(s),f=o.add(l)}else{const{p:e,f:a}=this.wNAF(d);c=e,f=a}return x.normalizeZ([c,f])[0]}multiplyAndAddUnsafe(e,a,t){const c=x.BASE,f=(e,a)=>a!==b&&a!==o&&e.equals(c)?e.multiply(a):e.multiplyUnsafe(a),d=f(this,a).add(f(e,t));return d.is0()?void 0:d}toAffine(e){const{px:a,py:c,pz:f}=this,d=this.is0();null==e&&(e=d?t.ONE:t.inv(f));const r=t.mul(a,e),n=t.mul(c,e),i=t.mul(f,e);if(d)return{x:t.ZERO,y:t.ZERO};if(!t.eql(i,t.ONE))throw new Error("invZ was invalid");return{x:r,y:n}}isTorsionFree(){const{h:e,isTorsionFree:t}=a;if(e===o)return!0;if(t)return t(x,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:t}=a;return e===o?this:t?t(x,this):this.multiplyUnsafe(a.h)}toRawBytes(e=!0){return this.assertValidity(),n(x,this,e)}toHex(e=!0){return d.bytesToHex(this.toRawBytes(e))}}x.BASE=new x(a.Gx,a.Gy,t.ONE),x.ZERO=new x(t.ZERO,t.ONE,t.ZERO);const y=a.nBitLength,A=(0,c.wNAF)(x,a.endo?Math.ceil(y/2):y);return{CURVE:a,ProjectivePoint:x,normPrivateKeyToScalar:p,weierstrassEquation:s,isWithinCurveOrder:u}}function p(e,a){const t=e.ORDER;let c=b;for(let e=t-o;e%s===b;e/=s)c+=o;const f=c,d=s<{let c=g,d=e.pow(t,h),r=e.sqr(d);r=e.mul(r,t);let n=e.mul(a,r);n=e.pow(n,i),n=e.mul(n,d),d=e.mul(n,t),r=e.mul(n,a);let b=e.mul(r,d);n=e.pow(b,p);let l=e.eql(n,e.ONE);d=e.mul(r,m),n=e.mul(b,c),r=e.cmov(d,r,l),b=e.cmov(n,b,l);for(let a=f;a>o;a--){let t=a-s;t=s<{let d=e.sqr(f);const r=e.mul(a,f);d=e.mul(d,r);let n=e.pow(d,t);n=e.mul(n,r);const i=e.mul(n,c),b=e.mul(e.sqr(n),f),o=e.eql(b,a);return{isValid:o,value:e.cmov(i,n,o)}}}return x}},8510:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.encodeToCurve=a.hashToCurve=a.schnorr=a.secp256k1=void 0;const c=t(22623),f=t(99175),d=t(73562),r=t(71761),n=t(24967),i=t(91484),b=t(91705),o=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),s=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(1),u=BigInt(2),h=(e,a)=>(e+a/u)/a;function p(e){const a=o,t=BigInt(3),c=BigInt(6),f=BigInt(11),d=BigInt(22),r=BigInt(23),i=BigInt(44),b=BigInt(88),s=e*e*e%a,l=s*s*e%a,h=(0,n.pow2)(l,t,a)*l%a,p=(0,n.pow2)(h,t,a)*l%a,m=(0,n.pow2)(p,u,a)*s%a,x=(0,n.pow2)(m,f,a)*m%a,y=(0,n.pow2)(x,d,a)*x%a,A=(0,n.pow2)(y,i,a)*y%a,v=(0,n.pow2)(A,b,a)*A%a,w=(0,n.pow2)(v,i,a)*y%a,_=(0,n.pow2)(w,t,a)*l%a,I=(0,n.pow2)(_,r,a)*x%a,E=(0,n.pow2)(I,c,a)*s%a,C=(0,n.pow2)(E,u,a);if(!g.eql(g.sqr(C),e))throw new Error("Cannot find square root");return C}const g=(0,n.Field)(o,void 0,void 0,{sqrt:p});a.secp256k1=(0,d.createCurve)({a:BigInt(0),b:BigInt(7),Fp:g,n:s,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const a=s,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),c=-l*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),f=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),d=t,r=BigInt("0x100000000000000000000000000000000"),i=h(d*e,a),b=h(-c*e,a);let o=(0,n.mod)(e-i*t-b*f,a),u=(0,n.mod)(-i*c-b*d,a);const p=o>r,g=u>r;if(p&&(o=a-o),g&&(u=a-u),o>r||u>r)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:p,k1:o,k2neg:g,k2:u}}}},c.sha256);const m=BigInt(0),x=e=>"bigint"==typeof e&&me.charCodeAt(0))));t=(0,i.concatBytes)(a,a),y[e]=t}return(0,c.sha256)((0,i.concatBytes)(t,...a))}const v=e=>e.toRawBytes(!0).slice(1),w=e=>(0,i.numberToBytesBE)(e,32),_=e=>(0,n.mod)(e,o),I=e=>(0,n.mod)(e,s),E=a.secp256k1.ProjectivePoint;function C(e){let t=a.secp256k1.utils.normPrivateKeyToScalar(e),c=E.fromPrivateKey(t);return{scalar:c.hasEvenY()?t:I(-t),bytes:v(c)}}function M(e){if(!x(e))throw new Error("bad x: need 0 < x < p");const a=_(e*e);let t=p(_(a*e+BigInt(7)));t%u!==m&&(t=_(-t));const c=new E(e,t,l);return c.assertValidity(),c}function B(...e){return I((0,i.bytesToNumberBE)(A("BIP0340/challenge",...e)))}function L(e,a,t){const c=(0,i.ensureBytes)("signature",e,64),f=(0,i.ensureBytes)("message",a),d=(0,i.ensureBytes)("publicKey",t,32);try{const e=M((0,i.bytesToNumberBE)(d)),a=(0,i.bytesToNumberBE)(c.subarray(0,32));if(!x(a))return!1;const t=(0,i.bytesToNumberBE)(c.subarray(32,64));if(!("bigint"==typeof(o=t)&&m(0,r.isogenyMap)(g,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((e=>e.map((e=>BigInt(e)))))))(),k=(()=>(0,b.mapToCurveSimpleSWU)(g,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:g.create(BigInt("-11"))}))(),N=(()=>(0,r.createHasher)(a.secp256k1.ProjectivePoint,(e=>{const{x:a,y:t}=k(g.create(e[0]));return S(a,t)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:g.ORDER,m:1,k:128,expand:"xmd",hash:c.sha256}))();a.hashToCurve=N.hashToCurve,a.encodeToCurve=N.encodeToCurve},67557:(e,a)=>{"use strict";function t(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function c(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function f(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function d(e,...a){if(!f(e))throw new Error("Uint8Array expected");if(a.length>0&&!a.includes(e.length))throw new Error(`Uint8Array expected of length ${a}, not of length=${e.length}`)}function r(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");t(e.outputLen),t(e.blockLen)}function n(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function i(e,a){d(e);const t=a.outputLen;if(e.length{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.HashMD=a.Maj=a.Chi=void 0;const c=t(67557),f=t(99175);a.Chi=(e,a,t)=>e&a^~e&t,a.Maj=(e,a,t)=>e&a^e&t^a&t;class d extends f.Hash{constructor(e,a,t,c){super(),this.blockLen=e,this.outputLen=a,this.padOffset=t,this.isLE=c,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,f.createView)(this.buffer)}update(e){(0,c.exists)(this);const{view:a,buffer:t,blockLen:d}=this,r=(e=(0,f.toBytes)(e)).length;for(let c=0;cd-n&&(this.process(t,0),n=0);for(let e=n;e>f&d),n=Number(t&d),i=c?4:0,b=c?0:4;e.setUint32(a+i,r,c),e.setUint32(a+b,n,c)}(t,d-8,BigInt(8*this.length),r),this.process(t,0);const i=(0,f.createView)(e),b=this.outputLen;if(b%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const o=b/4,s=this.get();if(o>s.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.add5L=a.add5H=a.add4H=a.add4L=a.add3H=a.add3L=a.add=a.rotlBL=a.rotlBH=a.rotlSL=a.rotlSH=a.rotr32L=a.rotr32H=a.rotrBL=a.rotrBH=a.rotrSL=a.rotrSH=a.shrSL=a.shrSH=a.toBig=a.split=a.fromBig=void 0;const t=BigInt(2**32-1),c=BigInt(32);function f(e,a=!1){return a?{h:Number(e&t),l:Number(e>>c&t)}:{h:0|Number(e>>c&t),l:0|Number(e&t)}}function d(e,a=!1){let t=new Uint32Array(e.length),c=new Uint32Array(e.length);for(let d=0;dBigInt(e>>>0)<>>0);a.toBig=r;const n=(e,a,t)=>e>>>t;a.shrSH=n;const i=(e,a,t)=>e<<32-t|a>>>t;a.shrSL=i;const b=(e,a,t)=>e>>>t|a<<32-t;a.rotrSH=b;const o=(e,a,t)=>e<<32-t|a>>>t;a.rotrSL=o;const s=(e,a,t)=>e<<64-t|a>>>t-32;a.rotrBH=s;const l=(e,a,t)=>e>>>t-32|a<<64-t;a.rotrBL=l;const u=(e,a)=>a;a.rotr32H=u;const h=(e,a)=>e;a.rotr32L=h;const p=(e,a,t)=>e<>>32-t;a.rotlSH=p;const g=(e,a,t)=>a<>>32-t;a.rotlSL=g;const m=(e,a,t)=>a<>>64-t;a.rotlBH=m;const x=(e,a,t)=>e<>>64-t;function y(e,a,t,c){const f=(a>>>0)+(c>>>0);return{h:e+t+(f/2**32|0)|0,l:0|f}}a.rotlBL=x,a.add=y;const A=(e,a,t)=>(e>>>0)+(a>>>0)+(t>>>0);a.add3L=A;const v=(e,a,t,c)=>a+t+c+(e/2**32|0)|0;a.add3H=v;const w=(e,a,t,c)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0);a.add4L=w;const _=(e,a,t,c,f)=>a+t+c+f+(e/2**32|0)|0;a.add4H=_;const I=(e,a,t,c,f)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0)+(f>>>0);a.add5L=I;const E=(e,a,t,c,f,d)=>a+t+c+f+d+(e/2**32|0)|0;a.add5H=E;const C={fromBig:f,split:d,toBig:r,shrSH:n,shrSL:i,rotrSH:b,rotrSL:o,rotrBH:s,rotrBL:l,rotr32H:u,rotr32L:h,rotlSH:p,rotlSL:g,rotlBH:m,rotlBL:x,add:y,add3L:A,add3H:v,add4L:w,add4H:_,add5H:E,add5L:I};a.default=C},25145:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.crypto=void 0,a.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},39615:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.hmac=a.HMAC=void 0;const c=t(67557),f=t(99175);class d extends f.Hash{constructor(e,a){super(),this.finished=!1,this.destroyed=!1,(0,c.hash)(e);const t=(0,f.toBytes)(a);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,r=new Uint8Array(d);r.set(t.length>d?e.create().update(t).digest():t);for(let e=0;enew d(e,a).update(t).digest(),a.hmac.create=(e,a)=>new d(e,a)},22623:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.sha224=a.sha256=void 0;const c=t(37202),f=t(99175),d=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]),r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),n=new Uint32Array(64);class i extends c.HashMD{constructor(){super(64,32,8,!1),this.A=0|r[0],this.B=0|r[1],this.C=0|r[2],this.D=0|r[3],this.E=0|r[4],this.F=0|r[5],this.G=0|r[6],this.H=0|r[7]}get(){const{A:e,B:a,C:t,D:c,E:f,F:d,G:r,H:n}=this;return[e,a,t,c,f,d,r,n]}set(e,a,t,c,f,d,r,n){this.A=0|e,this.B=0|a,this.C=0|t,this.D=0|c,this.E=0|f,this.F=0|d,this.G=0|r,this.H=0|n}process(e,a){for(let t=0;t<16;t++,a+=4)n[t]=e.getUint32(a,!1);for(let e=16;e<64;e++){const a=n[e-15],t=n[e-2],c=(0,f.rotr)(a,7)^(0,f.rotr)(a,18)^a>>>3,d=(0,f.rotr)(t,17)^(0,f.rotr)(t,19)^t>>>10;n[e]=d+n[e-7]+c+n[e-16]|0}let{A:t,B:r,C:i,D:b,E:o,F:s,G:l,H:u}=this;for(let e=0;e<64;e++){const a=u+((0,f.rotr)(o,6)^(0,f.rotr)(o,11)^(0,f.rotr)(o,25))+(0,c.Chi)(o,s,l)+d[e]+n[e]|0,h=((0,f.rotr)(t,2)^(0,f.rotr)(t,13)^(0,f.rotr)(t,22))+(0,c.Maj)(t,r,i)|0;u=l,l=s,s=o,o=b+a|0,b=i,i=r,r=t,t=a+h|0}t=t+this.A|0,r=r+this.B|0,i=i+this.C|0,b=b+this.D|0,o=o+this.E|0,s=s+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(t,r,i,b,o,s,l,u)}roundClean(){n.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class b extends i{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}a.sha256=(0,f.wrapConstructor)((()=>new i)),a.sha224=(0,f.wrapConstructor)((()=>new b))},32955:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.shake256=a.shake128=a.keccak_512=a.keccak_384=a.keccak_256=a.keccak_224=a.sha3_512=a.sha3_384=a.sha3_256=a.sha3_224=a.Keccak=a.keccakP=void 0;const c=t(67557),f=t(22318),d=t(99175),r=[],n=[],i=[],b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(7),u=BigInt(256),h=BigInt(113);for(let e=0,a=o,t=1,c=0;e<24;e++){[t,c]=[c,(2*t+3*c)%5],r.push(2*(5*c+t)),n.push((e+1)*(e+2)/2%64);let f=b;for(let e=0;e<7;e++)a=(a<>l)*h)%u,a&s&&(f^=o<<(o<t>32?(0,f.rotlBH)(e,a,t):(0,f.rotlSH)(e,a,t),x=(e,a,t)=>t>32?(0,f.rotlBL)(e,a,t):(0,f.rotlSL)(e,a,t);function y(e,a=24){const t=new Uint32Array(10);for(let c=24-a;c<24;c++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const c=(a+8)%10,f=(a+2)%10,d=t[f],r=t[f+1],n=m(d,r,1)^t[c],i=x(d,r,1)^t[c+1];for(let t=0;t<50;t+=10)e[a+t]^=n,e[a+t+1]^=i}let a=e[2],f=e[3];for(let t=0;t<24;t++){const c=n[t],d=m(a,f,c),i=x(a,f,c),b=r[t];a=e[b],f=e[b+1],e[b]=d,e[b+1]=i}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)t[c]=e[a+c];for(let c=0;c<10;c++)e[a+c]^=~t[(c+2)%10]&t[(c+4)%10]}e[0]^=p[c],e[1]^=g[c]}t.fill(0)}a.keccakP=y;class A extends d.Hash{constructor(e,a,t,f=!1,r=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=t,this.enableXOF=f,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,c.number)(t),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,d.u32)(this.state)}keccak(){d.isLE||(0,d.byteSwap32)(this.state32),y(this.state32,this.rounds),d.isLE||(0,d.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,c.exists)(this);const{blockLen:a,state:t}=this,f=(e=(0,d.toBytes)(e)).length;for(let c=0;c=t&&this.keccak();const d=Math.min(t-this.posOut,f-c);e.set(a.subarray(this.posOut,this.posOut+d),c),this.posOut+=d,c+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,c.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,c.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:t,outputLen:c,rounds:f,enableXOF:d}=this;return e||(e=new A(a,t,c,d,f)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=f,e.suffix=t,e.outputLen=c,e.enableXOF=d,e.destroyed=this.destroyed,e}}a.Keccak=A;const v=(e,a,t)=>(0,d.wrapConstructor)((()=>new A(a,e,t)));a.sha3_224=v(6,144,28),a.sha3_256=v(6,136,32),a.sha3_384=v(6,104,48),a.sha3_512=v(6,72,64),a.keccak_224=v(1,144,28),a.keccak_256=v(1,136,32),a.keccak_384=v(1,104,48),a.keccak_512=v(1,72,64);const w=(e,a,t)=>(0,d.wrapXOFConstructorWithOpts)(((c={})=>new A(a,e,void 0===c.dkLen?t:c.dkLen,!0)));a.shake128=w(31,168,16),a.shake256=w(31,136,32)},99175:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.randomBytes=a.wrapXOFConstructorWithOpts=a.wrapConstructorWithOpts=a.wrapConstructor=a.checkOpts=a.Hash=a.concatBytes=a.toBytes=a.utf8ToBytes=a.asyncLoop=a.nextTick=a.hexToBytes=a.bytesToHex=a.byteSwap32=a.byteSwapIfBE=a.byteSwap=a.isLE=a.rotl=a.rotr=a.createView=a.u32=a.u8=a.isBytes=void 0;const c=t(25145),f=t(67557);a.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name},a.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),a.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),a.rotr=(e,a)=>e<<32-a|e>>>a,a.rotl=(e,a)=>e<>>32-a>>>0,a.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],a.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,a.byteSwapIfBE=a.isLE?e=>e:e=>(0,a.byteSwap)(e),a.byteSwap32=function(e){for(let t=0;ta.toString(16).padStart(2,"0")));a.bytesToHex=function(e){(0,f.bytes)(e);let a="";for(let t=0;t=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function n(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function i(e){return"string"==typeof e&&(e=n(e)),(0,f.bytes)(e),e}a.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const a=e.length,t=a/2;if(a%2)throw new Error("padded hex string expected, got unpadded hex of length "+a);const c=new Uint8Array(t);for(let a=0,f=0;a{},a.asyncLoop=async function(e,t,c){let f=Date.now();for(let d=0;d=0&&ee().update(i(a)).digest(),t=e();return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=()=>e(),a},a.wrapConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(i(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.wrapXOFConstructorWithOpts=function(e){const a=(a,t)=>e(t).update(i(a)).digest(),t=e({});return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=a=>e(a),a},a.randomBytes=function(e=32){if(c.crypto&&"function"==typeof c.crypto.getRandomValues)return c.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},63203:(e,a)=>{"use strict";function t(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function c(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function f(...e){const a=e=>e,t=(e,a)=>t=>e(a(t));return{encode:e.map((e=>e.encode)).reduceRight(t,a),decode:e.map((e=>e.decode)).reduce(t,a)}}function d(e){return{encode:a=>{if(!Array.isArray(a)||a.length&&"number"!=typeof a[0])throw new Error("alphabet.encode input should be an array of numbers");return a.map((a=>{if(t(a),a<0||a>=e.length)throw new Error(`Digit index outside alphabet: ${a} (alphabet: ${e.length})`);return e[a]}))},decode:a=>{if(!Array.isArray(a)||a.length&&"string"!=typeof a[0])throw new Error("alphabet.decode input should be array of strings");return a.map((a=>{if("string"!=typeof a)throw new Error(`alphabet.decode: not string element=${a}`);const t=e.indexOf(a);if(-1===t)throw new Error(`Unknown letter: "${a}". Allowed: ${e}`);return t}))}}}function r(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:a=>{if(!Array.isArray(a)||a.length&&"string"!=typeof a[0])throw new Error("join.encode input should be array of strings");for(let e of a)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return a.join(e)},decode:a=>{if("string"!=typeof a)throw new Error("join.decode input should be string");return a.split(e)}}}function n(e,a="="){if(t(e),"string"!=typeof a)throw new Error("padding chr should be string");return{encode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("padding.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;t.length*e%8;)t.push(a);return t},decode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("padding.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let c=t.length;if(c*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;c>0&&t[c-1]===a;c--)if(!((c-1)*e%8))throw new Error("Invalid padding: string has too much padding");return t.slice(0,c)}}}function i(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:a=>e(a)}}function b(e,a,c){if(a<2)throw new Error(`convertRadix: wrong from=${a}, base cannot be less than 2`);if(c<2)throw new Error(`convertRadix: wrong to=${c}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let f=0;const d=[],r=Array.from(e);for(r.forEach((e=>{if(t(e),e<0||e>=a)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,t=!0;for(let d=f;da?o(a,e%a):e,s=(e,a)=>e+(a-o(e,a));function l(e,a,c,f){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(a<=0||a>32)throw new Error(`convertRadix2: wrong from=${a}`);if(c<=0||c>32)throw new Error(`convertRadix2: wrong to=${c}`);if(s(a,c)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${c} carryBits=${s(a,c)}`);let d=0,r=0;const n=2**c-1,i=[];for(const f of e){if(t(f),f>=2**a)throw new Error(`convertRadix2: invalid data word=${f} from=${a}`);if(d=d<32)throw new Error(`convertRadix2: carry overflow pos=${r} from=${a}`);for(r+=a;r>=c;r-=c)i.push((d>>r-c&n)>>>0);d&=2**r-1}if(d=d<=a)throw new Error("Excess padding");if(!f&&d)throw new Error(`Non-zero padding: ${d}`);return f&&r>0&&i.push(d>>>0),i}function u(e){return t(e),{encode:a=>{if(!c(a))throw new Error("radix.encode input should be Uint8Array");return b(Array.from(a),256,e)},decode:a=>{if(!Array.isArray(a)||a.length&&"number"!=typeof a[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(b(a,e,256))}}}function h(e,a=!1){if(t(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(s(8,e)>32||s(e,8)>32)throw new Error("radix2: carry overflow");return{encode:t=>{if(!c(t))throw new Error("radix2.encode input should be Uint8Array");return l(Array.from(t),8,e,!a)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(l(t,e,8,a))}}}function p(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...a){try{return e.apply(null,a)}catch(e){}}}function g(e,a){if(t(e),"function"!=typeof a)throw new Error("checksum fn should be function");return{encode(t){if(!c(t))throw new Error("checksum.encode: input should be Uint8Array");const f=a(t).slice(0,e),d=new Uint8Array(t.length+e);return d.set(t),d.set(f,t.length),d},decode(t){if(!c(t))throw new Error("checksum.decode: input should be Uint8Array");const f=t.slice(0,-e),d=a(f).slice(0,e),r=t.slice(-e);for(let a=0;ae.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),a.base64=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),n(6),r("")),a.base64nopad=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),r("")),a.base64url=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),n(6),r("")),a.base64urlnopad=f(h(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),r(""));const m=e=>f(u(58),d(e),r(""));a.base58=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),a.base58flickr=m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),a.base58xrp=m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const x=[0,2,3,5,6,7,9,10,11];a.base58xmr={encode(e){let t="";for(let c=0;cf(g(4,(a=>e(e(a)))),a.base58),a.base58check=a.createBase58check;const y=f(d("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),r("")),A=[996825010,642813549,513874426,1027748829,705979059];function v(e){const a=e>>25;let t=(33554431&e)<<5;for(let e=0;e>e&1)&&(t^=A[e]);return t}function w(e,a,t=1){const c=e.length;let f=1;for(let a=0;a126)throw new Error(`Invalid prefix (${e})`);f=v(f)^t>>5}f=v(f);for(let a=0;ac)throw new TypeError(`Length ${f} exceeds limit ${c}`);const d=e.toLowerCase(),r=w(d,t,a);return`${d}1${y.encode(t)}${r}`}function n(e,t=90){if("string"!=typeof e)throw new Error("bech32.decode input should be string, not "+typeof e);if(e.length<8||!1!==t&&e.length>t)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${t})`);const c=e.toLowerCase();if(e!==c&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const f=c.lastIndexOf("1");if(0===f||-1===f)throw new Error('Letter "1" must be present between prefix and data only');const d=c.slice(0,f),r=c.slice(f+1);if(r.length<6)throw new Error("Data must be at least 6 characters long");const n=y.decode(r).slice(0,-6),i=w(d,n,a);if(!r.endsWith(i))throw new Error(`Invalid checksum in ${e}: expected "${i}"`);return{prefix:d,words:n}}return{encode:r,decode:n,encodeFromBytes:function(e,a){return r(e,f(a))},decodeToBytes:function(e){const{prefix:a,words:t}=n(e,!1);return{prefix:a,words:t,bytes:c(t)}},decodeUnsafe:p(n),fromWords:c,fromWordsUnsafe:d,toWords:f}}a.bech32=_("bech32"),a.bech32m=_("bech32m"),a.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},a.hex=f(h(4),d("0123456789abcdef"),r(""),i((e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const I={utf8:a.utf8,hex:a.hex,base16:a.base16,base32:a.base32,base64:a.base64,base64url:a.base64url,base58:a.base58,base58xmr:a.base58xmr},E="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";a.bytesToString=(e,a)=>{if("string"!=typeof e||!I.hasOwnProperty(e))throw new TypeError(E);if(!c(a))throw new TypeError("bytesToString() expects Uint8Array");return I[e].encode(a)},a.str=a.bytesToString,a.stringToBytes=(e,a)=>{if(!I.hasOwnProperty(e))throw new TypeError(E);if("string"!=typeof a)throw new TypeError("stringToBytes() expects string");return I[e].decode(a)},a.bytes=a.stringToBytes},7736:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.BaseTree=void 0,a.BaseTree=class{get capacity(){return 2**this.levels}get layers(){return this._layers.slice()}get zeros(){return this._zeros.slice()}get elements(){return this._layers[0].slice()}get root(){var e;return null!==(e=this._layers[this.levels][0])&&void 0!==e?e:this._zeros[this.levels]}static indexOf(e,a,t,c){return c?e.findIndex((e=>c(a,e))):e.indexOf(a,t)}insert(e){if(this._layers[0].length>=this.capacity)throw new Error("Tree is full");this.update(this._layers[0].length,e)}bulkInsert(e){if(e.length){if(this._layers[0].length+e.length>this.capacity)throw new Error("Tree is full");for(let a=0;a>=1;const e=this._layers[t-1][2*c],a=this._layers[t-1][2*c+1];this._layers[t][c]=this._hashFn(e,a)}}this.insert(e[e.length-1])}}update(e,a){if(isNaN(Number(e))||e<0||e>this._layers[0].length||e>=this.capacity)throw new Error("Insert index out of bounds: "+e);this._layers[0][e]=a,this._processUpdate(e)}path(e){if(isNaN(Number(e))||e<0||e>=this._layers[0].length)throw new Error("Index out of bounds: "+e);let a=+e;const t=[],c=[],f=[];for(let e=0;e>=1}return{pathElements:t,pathIndices:c,pathPositions:f,pathRoot:this.root}}_buildZeros(){this._zeros=[this.zeroElement];for(let e=1;e<=this.levels;e++)this._zeros[e]=this._hashFn(this._zeros[e-1],this._zeros[e-1])}_processNodes(e,a){const t=e.length;let c=Math.ceil(t/2);const f=new Array(c);c--;const d=t-(t%2^1);let r=0;for(let n=d;n>=0&&void 0!==e[n-1];n-=2){const i=e[n-1],b=n===d&&t%2==1?this._zeros[a-1]:e[n];f[c-r]=this._hashFn(i,b),r++}return f}_processUpdate(e){for(let a=1;a<=this.levels;a++){e>>=1;const t=this._layers[a-1][2*e],c=2*e+1this.capacity)throw new Error("Tree is full");this._hashFn=t,this.zeroElement=c,this._layers=[];const d=a.slice();this._layers=[d],this._buildZeros(),this._buildHashes()}_buildHashes(){for(let e=1;e<=this.levels;e++){const a=this._layers[e-1];this._layers[e]=this._processNodes(a,e)}}bulkInsert(e){if(e.length){if(this._layers[0].length+e.length>this.capacity)throw new Error("Tree is full");for(let a=0;a>=1,this._layers[t][c]=this._hashFn(this._layers[t-1][2*c],this._layers[t-1][2*c+1])}this.insert(e[e.length-1])}}indexOf(e,a){return d.BaseTree.indexOf(this._layers[0],e,0,a)}proof(e){const a=this.indexOf(e);return this.path(a)}getTreeEdge(e){const a=this._layers[0][e];if(void 0===a)throw new Error("Element not found");return{edgePath:this.path(e),edgeElement:a,edgeIndex:e,edgeElementsCount:this._layers[0].length}}getTreeSlices(e=4){const a=this._layers[0].length;let t=Math.ceil(a/e);t%2&&t++;const c=[];for(let e=0;e(e.set(t,[a,this.edgeLeafProof.pathElements[t]]),e)),new Map),this._proofMap.set(this.levels,[0,this.edgeLeafProof.pathRoot])}_buildTree(){const e=this._edgeLeaf.index;if(this._leaves=Array(e).concat(this._leavesAfterEdge),this._proofMap.has(0)){const[e,a]=this._proofMap.get(0);this._leaves[e]=a}this._layers=[this._leaves],this._buildZeros(),this._buildHashes()}_buildHashes(){for(let e=1;e<=this.levels;e++){const a=this._layers[e-1],t=this._processNodes(a,e);if(this._proofMap.has(e)){const[a,c]=this._proofMap.get(e);t[a]||(t[a]=c)}this._layers[e]=t}}update(e,a){if(isNaN(Number(e))||e<0||e>this._layers[0].length||e>=this.capacity)throw new Error("Insert index out of bounds: "+e);if(e=this._layers[0].length)throw new Error("Index out of bounds: "+e);if(e>=1}return{pathElements:c,pathIndices:f,pathPositions:d,pathRoot:this.root}}indexOf(e,a){return d.BaseTree.indexOf(this._layers[0],e,this.edgeIndex,a)}proof(e){const a=this.indexOf(e);return this.path(a)}shiftEdge(e,a){if(this._edgeLeaf.index<=e.edgeIndex)throw new Error(`New edgeIndex should be smaller then ${this._edgeLeaf.index}`);if(a.length!==this._edgeLeaf.index-e.edgeIndex)throw new Error("Elements length should be "+(this._edgeLeaf.index-e.edgeIndex));this._edgeLeafProof=e.edgePath,this._edgeLeaf={index:e.edgeIndex,data:e.edgeElement},this._leavesAfterEdge=[...a,...this._leavesAfterEdge],this._createProofMap(),this._buildTree()}serialize(){return{_edgeLeafProof:this._edgeLeafProof,_edgeLeaf:this._edgeLeaf,_layers:this._layers,_zeros:this._zeros,levels:this.levels}}static deserialize(e,a){const t=Object.assign(Object.create(this.prototype),e);return t._hashFn=a||f.default,t._initialRoot=e._edgeLeafProof.pathRoot,t.zeroElement=t._zeros[0],t._leavesAfterEdge=t._layers[0].slice(e._edgeLeaf.index),t._createProofMap(),t}toString(){return JSON.stringify(this.serialize())}}a.PartialMerkleTree=r},41217:function(e,a,t){"use strict";var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.MerkleTree=a.simpleHash=a.PartialMerkleTree=void 0;const f=c(t(9093));Object.defineProperty(a,"MerkleTree",{enumerable:!0,get:function(){return f.default}});var d=t(91230);Object.defineProperty(a,"PartialMerkleTree",{enumerable:!0,get:function(){return d.PartialMerkleTree}});var r=t(5319);Object.defineProperty(a,"simpleHash",{enumerable:!0,get:function(){return r.simpleHash}}),a.default=f.default},5319:(e,a)=>{"use strict";function t(e,a,t=40){const c=e.join("");let f,d,r=null!=a?a:34658180293;for(f=0,d=c.length;f>>0).toString(16);return BigInt("0x"+n.padEnd(t-(n.length-1),"0")).toString(10)}Object.defineProperty(a,"__esModule",{value:!0}),a.simpleHash=void 0,a.simpleHash=t,a.default=(e,a)=>t([e,a])},27351:(e,a,t)=>{var c=t(48287).Buffer;const f=t(92096);let d;if("undefined"!=typeof BigInt)d=BigInt,d.one=d(1),d.zero=d(0),d.genAffine=e=>{const a=-e;return t=>{let c=t;return c<0?(c<=a&&(c%=e),c=e&&(c%=e),c.valueOf()}},d.genInverse=e=>a=>{let t=d.zero,c=e,f=d.one,r=d.affine(a,e);for(;r!=d.zero;){let e=c/r;[t,f]=[f,t-e*f],[c,r]=[r,c-e*r]}return te?(a,t)=>(a+t)%e:(e,a)=>e+a,d.genSub=e=>e?(a,t)=>(a-t)%e:(e,a)=>e-a,d.genNeg=e=>e?a=>-a%e:e=>-e,d.genMul=e=>e?(a,t)=>a*t%e:(e,a)=>e*a,d.genShr=()=>(e,a)=>e>>d(a),d.genShl=e=>e?(a,t)=>(a<e<e?(a,t)=>a.affine(e)==t.affine(e):(e,a)=>e==a,d.genSquare=e=>e?a=>a*a%e:e=>e*e,d.genDouble=e=>e?a=>(a+a)%e:e=>e+e,d.genIsZero=e=>e?a=>a.affine(e)==d.zero:e=>e==d.zero,d.prototype.isOdd=function(){return(this&d.one)==d(1)},d.prototype.isNegative=function(){return thisd.zero?this:-this},d.prototype.modPow=function(e,a){let t=d.one,c=this,f=e;for(;f;)f&d.one&&(t=t*c%a),c=c*c%a,f>>=d.one;return t},d.prototype.greaterOrEquals=function(e){return this>=e},d.prototype.greater=function(e){return this>e},d.prototype.gt=d.prototype.greater,d.prototype.lesserOrEquals=function(e){return this<=e},d.prototype.lesser=function(e){return this{const a=d.zero.minus(e);return t=>{let c=t;return c.isNegative()?(c.lesserOrEquals(a)&&(c=c.mod(e)),c.isNegative()&&(c=c.add(e))):c.greaterOrEquals(e)&&(c=c.mod(e)),c}},d.genInverse=e=>a=>a.affine(e).modInv(e),d.genAdd=e=>e?(a,t)=>{const c=a.add(t);return c.greaterOrEquals(e)?c.minus(e):c}:(e,a)=>e.add(a),d.genSub=e=>e?(a,t)=>a.greaterOrEquals(t)?a.minus(t):a.minus(t).add(e):(e,a)=>e.minus(a),d.genNeg=e=>e?a=>a.isZero()?a:e.minus(a):e=>d.zero.minus(e),d.genMul=e=>e?(a,t)=>a.times(t).mod(e):(e,a)=>e.times(a),d.genShr=()=>(e,a)=>e.shiftRight(d(a).value),d.genShl=e=>e?(a,t)=>a.shiftLeft(d(t).value).mod(e):(e,a)=>e.shiftLeft(d(a).value),d.genSquare=e=>e?a=>a.square().mod(e):e=>e.square(),d.genDouble=e=>e?a=>a.add(a).mod(e):e=>e.add(e),d.genEquals=e=>e?(a,t)=>a.affine(e).equals(t.affine(e)):(e,a)=>e.equals(a),d.genIsZero=e=>e?a=>a.affine(e).isZero():e=>e.isZero()}d.affine=function(e,a){return d.genAffine(a)(e)},d.prototype.affine=function(e){return d.affine(this,e)},d.inverse=function(e,a){return d.genInverse(a)(e)},d.prototype.inverse=function(e){return d.genInverse(e)(this)},d.add=function(e,a,t){return d.genAdd(t)(e,a)},d.prototype.add=function(e,a){return d.genAdd(a)(this,e)},d.sub=function(e,a,t){return d.genSub(t)(e,a)},d.prototype.sub=function(e,a){return d.genSub(a)(this,e)},d.neg=function(e,a){return d.genNeg(a)(e)},d.prototype.neg=function(e){return d.genNeg(e)(this)},d.mul=function(e,a,t){return d.genMul(t)(e,a)},d.prototype.mul=function(e,a){return d.genMul(a)(this,e)},d.shr=function(e,a,t){return d.genShr(t)(e,a)},d.prototype.shr=function(e,a){return d.genShr(a)(this,e)},d.shl=function(e,a,t){return d.genShl(t)(e,a)},d.prototype.shl=function(e,a){return d.genShl(a)(this,e)},d.equals=function(e,a,t){return d.genEquals(t)(e,a)},d.prototype.equals=function(e,a){return d.genEquals(a)(this,e)},d.square=function(e,a){return d.genSquare(a)(e)},d.prototype.square=function(e){return d.genSquare(e)(this)},d.double=function(e,a){return d.genDouble(a)(e)},d.prototype.double=function(e){return d.genDouble(e)(this)},d.isZero=function(e,a){return d.genIsZero(a)(e)},d.prototype.isZero=function(e){return d.genIsZero(e)(this)},d.leBuff2int=function(e){let a=d.zero;for(let t=0;t=0;){let e=Number(t.and(d("255")));r[f]=e,f--,t=t.shr(8)}if(t.greater(d.zero))throw new Error("Number does not feed in buffer");return r},d.prototype.beInt2Buff=function(e){return d.beInt2Buff(this,e)},e.exports=d},28803:(e,a,t)=>{const c=t(27351);e.exports=function(e,a,t){(t=t||{}).logFunction||(t.logFunction=console.log);const d=new f(e,t);function r(e,a,t){if(!Array.isArray(e))return t(a,e);for(let c=0;c{0==this.notInitSignals[e]&&this.triggerComponent(e)})),this.witness[t]}setVar(e,a,t){const c=this.scopes[this.scopes.length-1];return 0==a.length?c[e]=t:(void 0===c[e]&&(c[e]=[]),function e(a,t,c){1==t.length?a[t[0]]=c:(void 0===a[t[0]]&&(a[t[0]]=[]),e(a[t[0]],t.slice(1),c))}(c[e],a,t)),t}getVar(e,a){function t(e,a){return 0==a.length?e:t(e[a[0]],a.slice(1))}for(let c=this.scopes.length-1;c>=0;c--)if(void 0!==this.scopes[c][e])return t(this.scopes[c][e],a);throw new Error("Variable not defined: "+e)}getSignal(e,a){let t="one"==e?"one":this.currentComponent+"."+e;return t+=this._sels2str(a),this.getSignalFullName(t)}getPin(e,a,t,c){let f="one"==e?"one":this.currentComponent+"."+e;return f+=this._sels2str(a)+"."+t+this._sels2str(c),this.getSignalFullName(f)}getSignalFullName(e){const a=this.circuit.getSignalIdx(e);if(void 0===this.witness[a])throw new Error("Signal not initialized: "+e);return this.options.logGet&&this.options.logFunction("get ---\x3e"+e+" = "+this.witness[a].toString()),this.witness[a]}assert(e,a,t){const f=c(e),d=c(a);if(!f.equals(d))throw new Error("Constraint doesn't match "+this.currentComponent+": "+t+" -> "+f.toString()+" != "+d.toString())}}},98665:(module,__unused_webpack_exports,__webpack_require__)=>{const bigInt=__webpack_require__(27351),__P__=bigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617"),__MASK__=bigInt("28948022309329048855892746252171976963317496166410141009864396001978282409983"),calculateWitness=__webpack_require__(28803);module.exports=class Circuit{constructor(circuitDef){this.nPubInputs=circuitDef.nPubInputs,this.nPrvInputs=circuitDef.nPrvInputs,this.nInputs=circuitDef.nInputs,this.nOutputs=circuitDef.nOutputs,this.nVars=circuitDef.nVars,this.nSignals=circuitDef.nSignals,this.nConstants=circuitDef.nConstants,this.nConstraints=circuitDef.constraints.length,this.signalName2Idx=circuitDef.signalName2Idx,this.components=circuitDef.components,this.componentName2Idx=circuitDef.componentName2Idx,this.signals=circuitDef.signals,this.constraints=circuitDef.constraints,this.templates={};for(let t in circuitDef.templates)this.templates[t]=eval(" const __f= "+circuitDef.templates[t]+"\n__f");this.functions={};for(let f in circuitDef.functions)this.functions[f]={params:circuitDef.functions[f].params,func:eval(" const __f= "+circuitDef.functions[f].func+"\n__f;")}}calculateWitness(e,a){return calculateWitness(this,e,a)}checkWitness(e){const a=(e,a)=>{let t=bigInt(0);for(let c in e)t=t.add(bigInt(a[c]).mul(bigInt(e[c]))).mod(__P__);return t},t=(e,t)=>{const c=a(e[0],t),f=a(e[1],t),d=a(e[2],t);return!!c.mul(f).sub(d).affine(__P__).isZero()};for(let a=0;a{let a="";for(let t in e){let c=this.signals[t].names[0];"one"==c&&(c="");let f,d=bigInt(e[t]);d.lesserOrEquals(__P__.shr(bigInt(1)))?(f=""!=a?"+"+d.toString():"","1"!=f&&(f+=d.toString())):(d=__P__.sub(d),f="-"+d.toString()),a=a+" "+f+c}return a},t=`[ ${a(e[0])} ] * [ ${a(e[1])} ] - [ ${a(e[2])} ] = 0`;console.log(t)}printConstraints(){for(let e=0;e=this.nOutputs)throw new Error("Accessing an invalid output: "+e);return e+1}inputIdx(e){if(e>=this.nInputs)throw new Error("Accessing an invalid input: "+e);return this.nOutputs+1+e}pubInputIdx(e){if(e>=this.nPubInputs)throw new Error("Accessing an invalid pubInput: "+e);return this.inputIdx(e)}prvInputIdx(e){if(e>=this.nPrvInputs)throw new Error("Accessing an invalid prvInput: "+e);return this.inputIdx(this.nPubInputs+e)}varIdx(e){if(e>=this.nVars)throw new Error("Accessing an invalid variable: "+e);return e}constantIdx(e){if(e>=this.nConstants)throw new Error("Accessing an invalid constant: "+e);return this.nVars+e}signalIdx(e){if(e>=this.nSignls)throw new Error("Accessing an invalid signal: "+e);return e}signalNames(e){return this.signals[this.getSignalIdx(e)].names.join(", ")}a(e,a){return bigInt(this.constraints[e][0][a]||0)}b(e,a){return bigInt(this.constraints[e][1][a]||0)}c(e,a){return bigInt(this.constraints[e][2][a]||0)}}},73248:(e,a,t)=>{const c=t(27351);e.exports.e=function e(a){if("bigint"==typeof a||void 0!==a.isZero)return a.toString(10);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a},e.exports.H=function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return c(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a}},71293:(e,a,t)=>{var c=t(48287).Buffer;a.code=new c("AGFzbQEAAAABPApgAn9/AGABfwBgAX8Bf2ACf38Bf2ADf39/AX9gA39/fwBgA39+fwBgAn9+AGAEf39/fwBgBX9/f39/AAIQAQNlbnYGbWVtb3J5AgDoBwNsawABAgEDAwQEBQUGBwgFBQUAAAUFAAAAAQUFAAAFBQAAAAEFAAIBAAAFAAUAAAAIAQIAAgUICQgABQkDAAUFBQUAAgUFCAAIAgEBAAUFBQAAAAMAAgEAAAUABQAAAAgBAgACBQgJCAAFCQgIB8gJYghpbnRfY29weQAACGludF96ZXJvAAEHaW50X29uZQADCmludF9pc1plcm8AAgZpbnRfZXEABAdpbnRfZ3RlAAUHaW50X2FkZAAGB2ludF9zdWIABwppbnRfbXVsT2xkAAkHaW50X211bAAIB2ludF9kaXYADA5pbnRfaW52ZXJzZU1vZAANB2YxbV9hZGQADgdmMW1fc3ViAA8HZjFtX25lZwAQC2YxbV9tUmVkdWN0ABEHZjFtX211bAASCmYxbV9tdWxPbGQAExJmMW1fZnJvbU1vbnRnb21lcnkAFRBmMW1fdG9Nb250Z29tZXJ5ABQLZjFtX2ludmVyc2UAFghmMW1fY29weQAACGYxbV96ZXJvAAEKZjFtX2lzWmVybwACBmYxbV9lcQAEB2YxbV9vbmUAFwdmcm1fYWRkABgHZnJtX3N1YgAZB2ZybV9uZWcAGgtmcm1fbVJlZHVjdAAbB2ZybV9tdWwAHApmcm1fbXVsT2xkAB0SZnJtX2Zyb21Nb250Z29tZXJ5AB8QZnJtX3RvTW9udGdvbWVyeQAeC2ZybV9pbnZlcnNlACAIZnJtX2NvcHkAAAhmcm1femVybwABCmZybV9pc1plcm8AAgZmcm1fZXEABAdmcm1fb25lACEGZnJfYWRkABgGZnJfc3ViABkGZnJfbmVnABoGZnJfbXVsACIKZnJfaW52ZXJzZQAjB2ZyX2NvcHkAAAdmcl96ZXJvAAEGZnJfb25lACEJZnJfaXNaZXJvAAIFZnJfZXEABAlnMV9pc1plcm8AJAdnMV9jb3B5ACYHZzFfemVybwAlCWcxX2RvdWJsZQAnBmcxX2FkZAAoBmcxX25lZwApBmcxX3N1YgAqEWcxX2Zyb21Nb250Z29tZXJ5ACsPZzFfdG9Nb250Z29tZXJ5ACwJZzFfYWZmaW5lAC0OZzFfdGltZXNTY2FsYXIALgtnMV9tdWx0aWV4cAA1DGcxX211bHRpZXhwMgA5B2ZmdF9mZnQAQghmZnRfaWZmdABDEWZmdF90b01vbnRnb21lcnlOAD8TZmZ0X2Zyb21Nb250Z29tZXJ5TgA+FGZmdF9jb3B5TkludGVybGVhdmVkAD0IZmZ0X211bE4ARAhwb2xfemVybwBFD3BvbF9jb25zdHJ1Y3RMQwBGCmYybV9pc1plcm8ARwhmMm1femVybwBIB2YybV9vbmUASQhmMm1fY29weQBKB2YybV9tdWwASwdmMm1fYWRkAEwHZjJtX3N1YgBNB2YybV9uZWcAThJmMm1fZnJvbU1vbnRnb21lcnkAUBBmMm1fdG9Nb250Z29tZXJ5AE8GZjJtX2VxAFELZjJtX2ludmVyc2UAUglnMl9pc1plcm8AUwdnMl9jb3B5AFUHZzJfemVybwBUCWcyX2RvdWJsZQBWBmcyX2FkZABXBmcyX25lZwBYBmcyX3N1YgBZEWcyX2Zyb21Nb250Z29tZXJ5AFoPZzJfdG9Nb250Z29tZXJ5AFsJZzJfYWZmaW5lAFwOZzJfdGltZXNTY2FsYXIAXQtnMl9tdWx0aWV4cABkDGcyX211bHRpZXhwMgBoDHRlc3RfZjFtX211bABpD3Rlc3RfZjFtX211bE9sZABqCsfEAWsqACABIAApAwA3AwAgASAAKQMINwMIIAEgACkDEDcDECABIAApAxg3AxgLHgAgAEIANwMAIABCADcDCCAAQgA3AxAgAEIANwMYCzMAIAApAxhQBEAgACkDEFAEQCAAKQMIUARAIAApAwBQDwVBAA8LBUEADwsFQQAPC0EADwseACAAQgE3AwAgAEIANwMIIABCADcDECAAQgA3AxgLRwAgACkDGCABKQMYUQRAIAApAxAgASkDEFEEQCAAKQMIIAEpAwhRBEAgACkDACABKQMAUQ8FQQAPCwVBAA8LBUEADwtBAA8LfQAgACkDGCABKQMYVARAQQAPBSAAKQMYIAEpAxhWBEBBAQ8FIAApAxAgASkDEFQEQEEADwUgACkDECABKQMQVgRAQQEPBSAAKQMIIAEpAwhUBEBBAA8FIAApAwggASkDCFYEQEEBDwUgACkDACABKQMAWg8LCwsLCwtBAA8L1AEBAX4gADUCACABNQIAfCEDIAIgAz4CACAANQIEIAE1AgR8IANCIIh8IQMgAiADPgIEIAA1AgggATUCCHwgA0IgiHwhAyACIAM+AgggADUCDCABNQIMfCADQiCIfCEDIAIgAz4CDCAANQIQIAE1AhB8IANCIIh8IQMgAiADPgIQIAA1AhQgATUCFHwgA0IgiHwhAyACIAM+AhQgADUCGCABNQIYfCADQiCIfCEDIAIgAz4CGCAANQIcIAE1Ahx8IANCIIh8IQMgAiADPgIcIANCIIinC4wCAQF+IAA1AgAgATUCAH0hAyACIANC/////w+DPgIAIAA1AgQgATUCBH0gA0Igh3whAyACIANC/////w+DPgIEIAA1AgggATUCCH0gA0Igh3whAyACIANC/////w+DPgIIIAA1AgwgATUCDH0gA0Igh3whAyACIANC/////w+DPgIMIAA1AhAgATUCEH0gA0Igh3whAyACIANC/////w+DPgIQIAA1AhQgATUCFH0gA0Igh3whAyACIANC/////w+DPgIUIAA1AhggATUCGH0gA0Igh3whAyACIANC/////w+DPgIYIAA1AhwgATUCHH0gA0Igh3whAyACIANC/////w+DPgIcIANCIIenC48QEgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfiADQv////8PgyAANQIAIgUgATUCACIGfnwhAyAEIANCIIh8IQQgAiADPgIAIARCIIghAyAEQv////8PgyAFIAE1AgQiCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgQiByAGfnwhBCADIARCIIh8IQMgAiAEPgIEIANCIIghBCADQv////8PgyAFIAE1AggiCn58IQMgBCADQiCIfCEEIANC/////w+DIAcgCH58IQMgBCADQiCIfCEEIANC/////w+DIAA1AggiCSAGfnwhAyAEIANCIIh8IQQgAiADPgIIIARCIIghAyAEQv////8PgyAFIAE1AgwiDH58IQQgAyAEQiCIfCEDIARC/////w+DIAcgCn58IQQgAyAEQiCIfCEDIARC/////w+DIAkgCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgwiCyAGfnwhBCADIARCIIh8IQMgAiAEPgIMIANCIIghBCADQv////8PgyAFIAE1AhAiDn58IQMgBCADQiCIfCEEIANC/////w+DIAcgDH58IQMgBCADQiCIfCEEIANC/////w+DIAkgCn58IQMgBCADQiCIfCEEIANC/////w+DIAsgCH58IQMgBCADQiCIfCEEIANC/////w+DIAA1AhAiDSAGfnwhAyAEIANCIIh8IQQgAiADPgIQIARCIIghAyAEQv////8PgyAFIAE1AhQiEH58IQQgAyAEQiCIfCEDIARC/////w+DIAcgDn58IQQgAyAEQiCIfCEDIARC/////w+DIAkgDH58IQQgAyAEQiCIfCEDIARC/////w+DIAsgCn58IQQgAyAEQiCIfCEDIARC/////w+DIA0gCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AhQiDyAGfnwhBCADIARCIIh8IQMgAiAEPgIUIANCIIghBCADQv////8PgyAFIAE1AhgiEn58IQMgBCADQiCIfCEEIANC/////w+DIAcgEH58IQMgBCADQiCIfCEEIANC/////w+DIAkgDn58IQMgBCADQiCIfCEEIANC/////w+DIAsgDH58IQMgBCADQiCIfCEEIANC/////w+DIA0gCn58IQMgBCADQiCIfCEEIANC/////w+DIA8gCH58IQMgBCADQiCIfCEEIANC/////w+DIAA1AhgiESAGfnwhAyAEIANCIIh8IQQgAiADPgIYIARCIIghAyAEQv////8PgyAFIAE1AhwiFH58IQQgAyAEQiCIfCEDIARC/////w+DIAcgEn58IQQgAyAEQiCIfCEDIARC/////w+DIAkgEH58IQQgAyAEQiCIfCEDIARC/////w+DIAsgDn58IQQgAyAEQiCIfCEDIARC/////w+DIA0gDH58IQQgAyAEQiCIfCEDIARC/////w+DIA8gCn58IQQgAyAEQiCIfCEDIARC/////w+DIBEgCH58IQQgAyAEQiCIfCEDIARC/////w+DIAA1AhwiEyAGfnwhBCADIARCIIh8IQMgAiAEPgIcIANCIIghBCADQv////8PgyAHIBR+fCEDIAQgA0IgiHwhBCADQv////8PgyAJIBJ+fCEDIAQgA0IgiHwhBCADQv////8PgyALIBB+fCEDIAQgA0IgiHwhBCADQv////8PgyANIA5+fCEDIAQgA0IgiHwhBCADQv////8PgyAPIAx+fCEDIAQgA0IgiHwhBCADQv////8PgyARIAp+fCEDIAQgA0IgiHwhBCADQv////8PgyATIAh+fCEDIAQgA0IgiHwhBCACIAM+AiAgBEIgiCEDIARC/////w+DIAkgFH58IQQgAyAEQiCIfCEDIARC/////w+DIAsgEn58IQQgAyAEQiCIfCEDIARC/////w+DIA0gEH58IQQgAyAEQiCIfCEDIARC/////w+DIA8gDn58IQQgAyAEQiCIfCEDIARC/////w+DIBEgDH58IQQgAyAEQiCIfCEDIARC/////w+DIBMgCn58IQQgAyAEQiCIfCEDIAIgBD4CJCADQiCIIQQgA0L/////D4MgCyAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSASfnwhAyAEIANCIIh8IQQgA0L/////D4MgDyAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAOfnwhAyAEIANCIIh8IQQgA0L/////D4MgEyAMfnwhAyAEIANCIIh8IQQgAiADPgIoIARCIIghAyAEQv////8PgyANIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAPIBJ+fCEEIAMgBEIgiHwhAyAEQv////8PgyARIBB+fCEEIAMgBEIgiHwhAyAEQv////8PgyATIA5+fCEEIAMgBEIgiHwhAyACIAQ+AiwgA0IgiCEEIANC/////w+DIA8gFH58IQMgBCADQiCIfCEEIANC/////w+DIBEgEn58IQMgBCADQiCIfCEEIANC/////w+DIBMgEH58IQMgBCADQiCIfCEEIAIgAz4CMCAEQiCIIQMgBEL/////D4MgESAUfnwhBCADIARCIIh8IQMgBEL/////D4MgEyASfnwhBCADIARCIIh8IQMgAiAEPgI0IANCIIghBCADQv////8PgyATIBR+fCEDIAQgA0IgiHwhBCACIAM+AjggBEIgiCEDIAIgBD4CPAv0EAEBfkEoIAA1AgAgATUCAH43AwBBKCAANQIAIAE1AgR+NwMIQSggADUCACABNQIIfjcDEEEoIAA1AgAgATUCDH43AxhBKCAANQIAIAE1AhB+NwMgQSggADUCACABNQIUfjcDKEEoIAA1AgAgATUCGH43AzBBKCAANQIAIAE1Ahx+NwM4QSggADUCBCABNQIAfjcDQEEoIAA1AgQgATUCBH43A0hBKCAANQIEIAE1Agh+NwNQQSggADUCBCABNQIMfjcDWEEoIAA1AgQgATUCEH43A2BBKCAANQIEIAE1AhR+NwNoQSggADUCBCABNQIYfjcDcEEoIAA1AgQgATUCHH43A3hBKCAANQIIIAE1AgB+NwOAAUEoIAA1AgggATUCBH43A4gBQSggADUCCCABNQIIfjcDkAFBKCAANQIIIAE1Agx+NwOYAUEoIAA1AgggATUCEH43A6ABQSggADUCCCABNQIUfjcDqAFBKCAANQIIIAE1Ahh+NwOwAUEoIAA1AgggATUCHH43A7gBQSggADUCDCABNQIAfjcDwAFBKCAANQIMIAE1AgR+NwPIAUEoIAA1AgwgATUCCH43A9ABQSggADUCDCABNQIMfjcD2AFBKCAANQIMIAE1AhB+NwPgAUEoIAA1AgwgATUCFH43A+gBQSggADUCDCABNQIYfjcD8AFBKCAANQIMIAE1Ahx+NwP4AUEoIAA1AhAgATUCAH43A4ACQSggADUCECABNQIEfjcDiAJBKCAANQIQIAE1Agh+NwOQAkEoIAA1AhAgATUCDH43A5gCQSggADUCECABNQIQfjcDoAJBKCAANQIQIAE1AhR+NwOoAkEoIAA1AhAgATUCGH43A7ACQSggADUCECABNQIcfjcDuAJBKCAANQIUIAE1AgB+NwPAAkEoIAA1AhQgATUCBH43A8gCQSggADUCFCABNQIIfjcD0AJBKCAANQIUIAE1Agx+NwPYAkEoIAA1AhQgATUCEH43A+ACQSggADUCFCABNQIUfjcD6AJBKCAANQIUIAE1Ahh+NwPwAkEoIAA1AhQgATUCHH43A/gCQSggADUCGCABNQIAfjcDgANBKCAANQIYIAE1AgR+NwOIA0EoIAA1AhggATUCCH43A5ADQSggADUCGCABNQIMfjcDmANBKCAANQIYIAE1AhB+NwOgA0EoIAA1AhggATUCFH43A6gDQSggADUCGCABNQIYfjcDsANBKCAANQIYIAE1Ahx+NwO4A0EoIAA1AhwgATUCAH43A8ADQSggADUCHCABNQIEfjcDyANBKCAANQIcIAE1Agh+NwPQA0EoIAA1AhwgATUCDH43A9gDQSggADUCHCABNQIQfjcD4ANBKCAANQIcIAE1AhR+NwPoA0EoIAA1AhwgATUCGH43A/ADQSggADUCHCABNQIcfjcD+AMgA0IgiEEoNQIAfCEDIAIgAz4CACADQiCIQSg1AgR8QSg1Agh8QSg1AkB8IQMgAiADPgIEIANCIIhBKDUCDHxBKDUCRHxBKDUCEHxBKDUCSHxBKDUCgAF8IQMgAiADPgIIIANCIIhBKDUCFHxBKDUCTHxBKDUChAF8QSg1Ahh8QSg1AlB8QSg1AogBfEEoNQLAAXwhAyACIAM+AgwgA0IgiEEoNQIcfEEoNQJUfEEoNQKMAXxBKDUCxAF8QSg1AiB8QSg1Alh8QSg1ApABfEEoNQLIAXxBKDUCgAJ8IQMgAiADPgIQIANCIIhBKDUCJHxBKDUCXHxBKDUClAF8QSg1AswBfEEoNQKEAnxBKDUCKHxBKDUCYHxBKDUCmAF8QSg1AtABfEEoNQKIAnxBKDUCwAJ8IQMgAiADPgIUIANCIIhBKDUCLHxBKDUCZHxBKDUCnAF8QSg1AtQBfEEoNQKMAnxBKDUCxAJ8QSg1AjB8QSg1Amh8QSg1AqABfEEoNQLYAXxBKDUCkAJ8QSg1AsgCfEEoNQKAA3whAyACIAM+AhggA0IgiEEoNQI0fEEoNQJsfEEoNQKkAXxBKDUC3AF8QSg1ApQCfEEoNQLMAnxBKDUChAN8QSg1Ajh8QSg1AnB8QSg1AqgBfEEoNQLgAXxBKDUCmAJ8QSg1AtACfEEoNQKIA3xBKDUCwAN8IQMgAiADPgIcIANCIIhBKDUCPHxBKDUCdHxBKDUCrAF8QSg1AuQBfEEoNQKcAnxBKDUC1AJ8QSg1AowDfEEoNQLEA3xBKDUCeHxBKDUCsAF8QSg1AugBfEEoNQKgAnxBKDUC2AJ8QSg1ApADfEEoNQLIA3whAyACIAM+AiAgA0IgiEEoNQJ8fEEoNQK0AXxBKDUC7AF8QSg1AqQCfEEoNQLcAnxBKDUClAN8QSg1AswDfEEoNQK4AXxBKDUC8AF8QSg1AqgCfEEoNQLgAnxBKDUCmAN8QSg1AtADfCEDIAIgAz4CJCADQiCIQSg1ArwBfEEoNQL0AXxBKDUCrAJ8QSg1AuQCfEEoNQKcA3xBKDUC1AN8QSg1AvgBfEEoNQKwAnxBKDUC6AJ8QSg1AqADfEEoNQLYA3whAyACIAM+AiggA0IgiEEoNQL8AXxBKDUCtAJ8QSg1AuwCfEEoNQKkA3xBKDUC3AN8QSg1ArgCfEEoNQLwAnxBKDUCqAN8QSg1AuADfCEDIAIgAz4CLCADQiCIQSg1ArwCfEEoNQL0AnxBKDUCrAN8QSg1AuQDfEEoNQL4AnxBKDUCsAN8QSg1AugDfCEDIAIgAz4CMCADQiCIQSg1AvwCfEEoNQK0A3xBKDUC7AN8QSg1ArgDfEEoNQLwA3whAyACIAM+AjQgA0IgiEEoNQK8A3xBKDUC9AN8QSg1AvgDfCEDIAIgAz4COCADQiCIQSg1AvwDfCEDIAIgAz4CPAu2AQEBfiAANQAAIAF+IQMgAiADPgAAIAA1AAQgAX4gA0IgiHwhAyACIAM+AAQgADUACCABfiADQiCIfCEDIAIgAz4ACCAANQAMIAF+IANCIIh8IQMgAiADPgAMIAA1ABAgAX4gA0IgiHwhAyACIAM+ABAgADUAFCABfiADQiCIfCEDIAIgAz4AFCAANQAYIAF+IANCIIh8IQMgAiADPgAYIAA1ABwgAX4gA0IgiHwhAyACIAM+ABwLTgIBfgF/IAAhAyADNQAAIAF8IQIgAyACPgAAIAJCIIghAgJAA0AgAlANASADQQRqIQMgAzUAACACfCECIAMgAj4AACACQiCIIQIMAAsLC7ACBwF/AX8BfwF/AX4BfgF/IAIEQCACIQUFQcgEIQULIAMEQCADIQQFQegEIQQLIAAgBBAAIAFBqAQQACAFEAFBiAUQAUEfIQZBHyEHAkADQEGoBCAHai0AACAHQQNGcg0BIAdBAWshBwwACwtBqAQgB2pBA2s1AABCAXwhCCAIQgFRBEBCAEIAgBoLAkADQAJAA0AgBCAGai0AACAGQQdGcg0BIAZBAWshBgwACwsgBCAGakEHaykAACEJIAkgCIAhCSAGIAdrQQRrIQoCQANAIAlCgICAgHCDUCAKQQBOcQ0BIAlCCIghCSAKQQFqIQoMAAsLIAlQBEAgBEGoBBAFRQ0CQgEhCUEAIQoLQagEIAlBqAUQCiAEQagFIAprIAQQBxogBSAKaiAJEAsMAAsLC7UCCwF/AX8BfwF/AX8BfwF/AX8BfwF/AX9ByAUhA0HIBRABQQAhC0HoBSEFIAFB6AUQAEGIBiEEQYgGEANBACEMQagGIQggAEGoBhAAQcgGIQZB6AYhB0HIByEKAkADQCAIEAINASAFIAggBiAHEAwgBiAEQYgHEAggCwRAIAwEQEGIByADEAUEQEGIByADIAoQBxpBACENBSADQYgHIAoQBxpBASENCwVBiAcgAyAKEAYaQQEhDQsFIAwEQEGIByADIAoQBhpBACENBSADQYgHEAUEQCADQYgHIAoQBxpBACENBUGIByADIAoQBxpBASENCwsLIAMhCSAEIQMgCiEEIAkhCiAMIQsgDSEMIAUhCSAIIQUgByEIIAkhBwwACwsgCwRAIAEgAyACEAcaBSADIAIQAAsLLAAgACABIAIQBgRAIAJB6AcgAhAHGgUgAkHoBxAFBEAgAkHoByACEAcaCwsLFwAgACABIAIQBwRAIAJB6AcgAhAGGgsLFAAgABACRQRAQegHIAAgARAHGgsLnBEDAX4BfgF+QonHmaQOIQJCACEDIAA1AgAgAn5C/////w+DIQQgADUCACADQiCIfEHoBzUCACAEfnwhAyAAIAM+AgAgADUCBCADQiCIfEHoBzUCBCAEfnwhAyAAIAM+AgQgADUCCCADQiCIfEHoBzUCCCAEfnwhAyAAIAM+AgggADUCDCADQiCIfEHoBzUCDCAEfnwhAyAAIAM+AgwgADUCECADQiCIfEHoBzUCECAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoBzUCFCAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AhxB6AggA0IgiD4CAEIAIQMgADUCBCACfkL/////D4MhBCAANQIEIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CBCAANQIIIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CCCAANQIMIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CDCAANQIQIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CECAANQIUIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegHNQIYIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIcIAR+fCEDIAAgAz4CIEHoCCADQiCIPgIEQgAhAyAANQIIIAJ+Qv////8PgyEEIAA1AgggA0IgiHxB6Ac1AgAgBH58IQMgACADPgIIIAA1AgwgA0IgiHxB6Ac1AgQgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6Ac1AgggBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6Ac1AgwgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6Ac1AhAgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6Ac1AhQgBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6Ac1AhggBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6Ac1AhwgBH58IQMgACADPgIkQegIIANCIIg+AghCACEDIAA1AgwgAn5C/////w+DIQQgADUCDCADQiCIfEHoBzUCACAEfnwhAyAAIAM+AgwgADUCECADQiCIfEHoBzUCBCAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoBzUCCCAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoBzUCDCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoBzUCECAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoBzUCFCAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AihB6AggA0IgiD4CDEIAIQMgADUCECACfkL/////D4MhBCAANQIQIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CECAANQIUIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegHNQIYIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegHNQIcIAR+fCEDIAAgAz4CLEHoCCADQiCIPgIQQgAhAyAANQIUIAJ+Qv////8PgyEEIAA1AhQgA0IgiHxB6Ac1AgAgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6Ac1AgQgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6Ac1AgggBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6Ac1AgwgBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6Ac1AhAgBH58IQMgACADPgIkIAA1AiggA0IgiHxB6Ac1AhQgBH58IQMgACADPgIoIAA1AiwgA0IgiHxB6Ac1AhggBH58IQMgACADPgIsIAA1AjAgA0IgiHxB6Ac1AhwgBH58IQMgACADPgIwQegIIANCIIg+AhRCACEDIAA1AhggAn5C/////w+DIQQgADUCGCADQiCIfEHoBzUCACAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoBzUCBCAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoBzUCCCAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoBzUCDCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoBzUCECAEfnwhAyAAIAM+AiggADUCLCADQiCIfEHoBzUCFCAEfnwhAyAAIAM+AiwgADUCMCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AjAgADUCNCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AjRB6AggA0IgiD4CGEIAIQMgADUCHCACfkL/////D4MhBCAANQIcIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CLCAANQIwIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CMCAANQI0IANCIIh8QegHNQIYIAR+fCEDIAAgAz4CNCAANQI4IANCIIh8QegHNQIcIAR+fCEDIAAgAz4COEHoCCADQiCIPgIcQegIIABBIGogARAOC74fIwF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX5CiceZpA4hBSADQv////8PgyAANQIAIgYgATUCACIHfnwhAyAEIANCIIh8IQQgA0L/////D4MgBX5C/////w+DIQggA0L/////D4NBADUC6AciCSAIfnwhAyAEIANCIIh8IQQgBEIgiCEDIARC/////w+DIAYgATUCBCILfnwhBCADIARCIIh8IQMgBEL/////D4MgADUCBCIKIAd+fCEEIAMgBEIgiHwhAyAEQv////8Pg0EANQLsByINIAh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAFfkL/////D4MhDCAEQv////8PgyAJIAx+fCEEIAMgBEIgiHwhAyADQiCIIQQgA0L/////D4MgBiABNQIIIg9+fCEDIAQgA0IgiHwhBCADQv////8PgyAKIAt+fCEDIAQgA0IgiHwhBCADQv////8PgyAANQIIIg4gB358IQMgBCADQiCIfCEEIANC/////w+DIA0gDH58IQMgBCADQiCIfCEEIANC/////w+DQQA1AvAHIhEgCH58IQMgBCADQiCIfCEEIANC/////w+DIAV+Qv////8PgyEQIANC/////w+DIAkgEH58IQMgBCADQiCIfCEEIARCIIghAyAEQv////8PgyAGIAE1AgwiE358IQQgAyAEQiCIfCEDIARC/////w+DIAogD358IQQgAyAEQiCIfCEDIARC/////w+DIA4gC358IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgwiEiAHfnwhBCADIARCIIh8IQMgBEL/////D4MgDSAQfnwhBCADIARCIIh8IQMgBEL/////D4MgESAMfnwhBCADIARCIIh8IQMgBEL/////D4NBADUC9AciFSAIfnwhBCADIARCIIh8IQMgBEL/////D4MgBX5C/////w+DIRQgBEL/////D4MgCSAUfnwhBCADIARCIIh8IQMgA0IgiCEEIANC/////w+DIAYgATUCECIXfnwhAyAEIANCIIh8IQQgA0L/////D4MgCiATfnwhAyAEIANCIIh8IQQgA0L/////D4MgDiAPfnwhAyAEIANCIIh8IQQgA0L/////D4MgEiALfnwhAyAEIANCIIh8IQQgA0L/////D4MgADUCECIWIAd+fCEDIAQgA0IgiHwhBCADQv////8PgyANIBR+fCEDIAQgA0IgiHwhBCADQv////8PgyARIBB+fCEDIAQgA0IgiHwhBCADQv////8PgyAVIAx+fCEDIAQgA0IgiHwhBCADQv////8Pg0EANQL4ByIZIAh+fCEDIAQgA0IgiHwhBCADQv////8PgyAFfkL/////D4MhGCADQv////8PgyAJIBh+fCEDIAQgA0IgiHwhBCAEQiCIIQMgBEL/////D4MgBiABNQIUIht+fCEEIAMgBEIgiHwhAyAEQv////8PgyAKIBd+fCEEIAMgBEIgiHwhAyAEQv////8PgyAOIBN+fCEEIAMgBEIgiHwhAyAEQv////8PgyASIA9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAWIAt+fCEEIAMgBEIgiHwhAyAEQv////8PgyAANQIUIhogB358IQQgAyAEQiCIfCEDIARC/////w+DIA0gGH58IQQgAyAEQiCIfCEDIARC/////w+DIBEgFH58IQQgAyAEQiCIfCEDIARC/////w+DIBUgEH58IQQgAyAEQiCIfCEDIARC/////w+DIBkgDH58IQQgAyAEQiCIfCEDIARC/////w+DQQA1AvwHIh0gCH58IQQgAyAEQiCIfCEDIARC/////w+DIAV+Qv////8PgyEcIARC/////w+DIAkgHH58IQQgAyAEQiCIfCEDIANCIIghBCADQv////8PgyAGIAE1AhgiH358IQMgBCADQiCIfCEEIANC/////w+DIAogG358IQMgBCADQiCIfCEEIANC/////w+DIA4gF358IQMgBCADQiCIfCEEIANC/////w+DIBIgE358IQMgBCADQiCIfCEEIANC/////w+DIBYgD358IQMgBCADQiCIfCEEIANC/////w+DIBogC358IQMgBCADQiCIfCEEIANC/////w+DIAA1AhgiHiAHfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSAcfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAYfnwhAyAEIANCIIh8IQQgA0L/////D4MgFSAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgGSAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgHSAMfnwhAyAEIANCIIh8IQQgA0L/////D4NBADUCgAgiISAIfnwhAyAEIANCIIh8IQQgA0L/////D4MgBX5C/////w+DISAgA0L/////D4MgCSAgfnwhAyAEIANCIIh8IQQgBEIgiCEDIARC/////w+DIAYgATUCHCIjfnwhBCADIARCIIh8IQMgBEL/////D4MgCiAffnwhBCADIARCIIh8IQMgBEL/////D4MgDiAbfnwhBCADIARCIIh8IQMgBEL/////D4MgEiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgFiATfnwhBCADIARCIIh8IQMgBEL/////D4MgGiAPfnwhBCADIARCIIh8IQMgBEL/////D4MgHiALfnwhBCADIARCIIh8IQMgBEL/////D4MgADUCHCIiIAd+fCEEIAMgBEIgiHwhAyAEQv////8PgyANICB+fCEEIAMgBEIgiHwhAyAEQv////8PgyARIBx+fCEEIAMgBEIgiHwhAyAEQv////8PgyAVIBh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAZIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAdIBB+fCEEIAMgBEIgiHwhAyAEQv////8PgyAhIAx+fCEEIAMgBEIgiHwhAyAEQv////8Pg0EANQKECCIlIAh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAFfkL/////D4MhJCAEQv////8PgyAJICR+fCEEIAMgBEIgiHwhAyADQiCIIQQgA0L/////D4MgCiAjfnwhAyAEIANCIIh8IQQgA0L/////D4MgDiAffnwhAyAEIANCIIh8IQQgA0L/////D4MgEiAbfnwhAyAEIANCIIh8IQQgA0L/////D4MgFiAXfnwhAyAEIANCIIh8IQQgA0L/////D4MgGiATfnwhAyAEIANCIIh8IQQgA0L/////D4MgHiAPfnwhAyAEIANCIIh8IQQgA0L/////D4MgIiALfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSAkfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAgfnwhAyAEIANCIIh8IQQgA0L/////D4MgFSAcfnwhAyAEIANCIIh8IQQgA0L/////D4MgGSAYfnwhAyAEIANCIIh8IQQgA0L/////D4MgHSAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgISAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgJSAMfnwhAyAEIANCIIh8IQQgAiADPgIAIARCIIghAyAEQv////8PgyAOICN+fCEEIAMgBEIgiHwhAyAEQv////8PgyASIB9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAWIBt+fCEEIAMgBEIgiHwhAyAEQv////8PgyAaIBd+fCEEIAMgBEIgiHwhAyAEQv////8PgyAeIBN+fCEEIAMgBEIgiHwhAyAEQv////8PgyAiIA9+fCEEIAMgBEIgiHwhAyAEQv////8PgyARICR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAVICB+fCEEIAMgBEIgiHwhAyAEQv////8PgyAZIBx+fCEEIAMgBEIgiHwhAyAEQv////8PgyAdIBh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAhIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAlIBB+fCEEIAMgBEIgiHwhAyACIAQ+AgQgA0IgiCEEIANC/////w+DIBIgI358IQMgBCADQiCIfCEEIANC/////w+DIBYgH358IQMgBCADQiCIfCEEIANC/////w+DIBogG358IQMgBCADQiCIfCEEIANC/////w+DIB4gF358IQMgBCADQiCIfCEEIANC/////w+DICIgE358IQMgBCADQiCIfCEEIANC/////w+DIBUgJH58IQMgBCADQiCIfCEEIANC/////w+DIBkgIH58IQMgBCADQiCIfCEEIANC/////w+DIB0gHH58IQMgBCADQiCIfCEEIANC/////w+DICEgGH58IQMgBCADQiCIfCEEIANC/////w+DICUgFH58IQMgBCADQiCIfCEEIAIgAz4CCCAEQiCIIQMgBEL/////D4MgFiAjfnwhBCADIARCIIh8IQMgBEL/////D4MgGiAffnwhBCADIARCIIh8IQMgBEL/////D4MgHiAbfnwhBCADIARCIIh8IQMgBEL/////D4MgIiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgGSAkfnwhBCADIARCIIh8IQMgBEL/////D4MgHSAgfnwhBCADIARCIIh8IQMgBEL/////D4MgISAcfnwhBCADIARCIIh8IQMgBEL/////D4MgJSAYfnwhBCADIARCIIh8IQMgAiAEPgIMIANCIIghBCADQv////8PgyAaICN+fCEDIAQgA0IgiHwhBCADQv////8PgyAeIB9+fCEDIAQgA0IgiHwhBCADQv////8PgyAiIBt+fCEDIAQgA0IgiHwhBCADQv////8PgyAdICR+fCEDIAQgA0IgiHwhBCADQv////8PgyAhICB+fCEDIAQgA0IgiHwhBCADQv////8PgyAlIBx+fCEDIAQgA0IgiHwhBCACIAM+AhAgBEIgiCEDIARC/////w+DIB4gI358IQQgAyAEQiCIfCEDIARC/////w+DICIgH358IQQgAyAEQiCIfCEDIARC/////w+DICEgJH58IQQgAyAEQiCIfCEDIARC/////w+DICUgIH58IQQgAyAEQiCIfCEDIAIgBD4CFCADQiCIIQQgA0L/////D4MgIiAjfnwhAyAEIANCIIh8IQQgA0L/////D4MgJSAkfnwhAyAEIANCIIh8IQQgAiADPgIYIARCIIghAyACIAQ+AhwgA6cEQCACQegHIAIQBxoFIAJB6AcQBQRAIAJB6AcgAhAHGgsLCxIAIAAgAUHoDBAJQegMIAIQEQsLACAAQYgIIAEQEgsVACAAQagNEABByA0QAUGoDSABEBELFwAgACABEBUgAUHoByABEA0gASABEBQLCQBBqAggABAACywAIAAgASACEAYEQCACQegNIAIQBxoFIAJB6A0QBQRAIAJB6A0gAhAHGgsLCxcAIAAgASACEAcEQCACQegNIAIQBhoLCxQAIAAQAkUEQEHoDSAAIAEQBxoLC5wRAwF+AX4BfkL/////DiECQgAhAyAANQIAIAJ+Qv////8PgyEEIAA1AgAgA0IgiHxB6A01AgAgBH58IQMgACADPgIAIAA1AgQgA0IgiHxB6A01AgQgBH58IQMgACADPgIEIAA1AgggA0IgiHxB6A01AgggBH58IQMgACADPgIIIAA1AgwgA0IgiHxB6A01AgwgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6A01AhAgBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6A01AhQgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6A01AhggBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AhwgBH58IQMgACADPgIcQegOIANCIIg+AgBCACEDIAA1AgQgAn5C/////w+DIQQgADUCBCADQiCIfEHoDTUCACAEfnwhAyAAIAM+AgQgADUCCCADQiCIfEHoDTUCBCAEfnwhAyAAIAM+AgggADUCDCADQiCIfEHoDTUCCCAEfnwhAyAAIAM+AgwgADUCECADQiCIfEHoDTUCDCAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoDTUCECAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoDTUCFCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoDTUCGCAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoDTUCHCAEfnwhAyAAIAM+AiBB6A4gA0IgiD4CBEIAIQMgADUCCCACfkL/////D4MhBCAANQIIIANCIIh8QegNNQIAIAR+fCEDIAAgAz4CCCAANQIMIANCIIh8QegNNQIEIAR+fCEDIAAgAz4CDCAANQIQIANCIIh8QegNNQIIIAR+fCEDIAAgAz4CECAANQIUIANCIIh8QegNNQIMIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegNNQIQIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegNNQIUIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegNNQIYIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegNNQIcIAR+fCEDIAAgAz4CJEHoDiADQiCIPgIIQgAhAyAANQIMIAJ+Qv////8PgyEEIAA1AgwgA0IgiHxB6A01AgAgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6A01AgQgBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6A01AgggBH58IQMgACADPgIUIAA1AhggA0IgiHxB6A01AgwgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AhAgBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6A01AhQgBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6A01AhggBH58IQMgACADPgIkIAA1AiggA0IgiHxB6A01AhwgBH58IQMgACADPgIoQegOIANCIIg+AgxCACEDIAA1AhAgAn5C/////w+DIQQgADUCECADQiCIfEHoDTUCACAEfnwhAyAAIAM+AhAgADUCFCADQiCIfEHoDTUCBCAEfnwhAyAAIAM+AhQgADUCGCADQiCIfEHoDTUCCCAEfnwhAyAAIAM+AhggADUCHCADQiCIfEHoDTUCDCAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoDTUCECAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoDTUCFCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoDTUCGCAEfnwhAyAAIAM+AiggADUCLCADQiCIfEHoDTUCHCAEfnwhAyAAIAM+AixB6A4gA0IgiD4CEEIAIQMgADUCFCACfkL/////D4MhBCAANQIUIANCIIh8QegNNQIAIAR+fCEDIAAgAz4CFCAANQIYIANCIIh8QegNNQIEIAR+fCEDIAAgAz4CGCAANQIcIANCIIh8QegNNQIIIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegNNQIMIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegNNQIQIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegNNQIUIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegNNQIYIAR+fCEDIAAgAz4CLCAANQIwIANCIIh8QegNNQIcIAR+fCEDIAAgAz4CMEHoDiADQiCIPgIUQgAhAyAANQIYIAJ+Qv////8PgyEEIAA1AhggA0IgiHxB6A01AgAgBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AgQgBH58IQMgACADPgIcIAA1AiAgA0IgiHxB6A01AgggBH58IQMgACADPgIgIAA1AiQgA0IgiHxB6A01AgwgBH58IQMgACADPgIkIAA1AiggA0IgiHxB6A01AhAgBH58IQMgACADPgIoIAA1AiwgA0IgiHxB6A01AhQgBH58IQMgACADPgIsIAA1AjAgA0IgiHxB6A01AhggBH58IQMgACADPgIwIAA1AjQgA0IgiHxB6A01AhwgBH58IQMgACADPgI0QegOIANCIIg+AhhCACEDIAA1AhwgAn5C/////w+DIQQgADUCHCADQiCIfEHoDTUCACAEfnwhAyAAIAM+AhwgADUCICADQiCIfEHoDTUCBCAEfnwhAyAAIAM+AiAgADUCJCADQiCIfEHoDTUCCCAEfnwhAyAAIAM+AiQgADUCKCADQiCIfEHoDTUCDCAEfnwhAyAAIAM+AiggADUCLCADQiCIfEHoDTUCECAEfnwhAyAAIAM+AiwgADUCMCADQiCIfEHoDTUCFCAEfnwhAyAAIAM+AjAgADUCNCADQiCIfEHoDTUCGCAEfnwhAyAAIAM+AjQgADUCOCADQiCIfEHoDTUCHCAEfnwhAyAAIAM+AjhB6A4gA0IgiD4CHEHoDiAAQSBqIAEQGAu+HyMBfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+AX4BfgF+Qv////8OIQUgA0L/////D4MgADUCACIGIAE1AgAiB358IQMgBCADQiCIfCEEIANC/////w+DIAV+Qv////8PgyEIIANC/////w+DQQA1AugNIgkgCH58IQMgBCADQiCIfCEEIARCIIghAyAEQv////8PgyAGIAE1AgQiC358IQQgAyAEQiCIfCEDIARC/////w+DIAA1AgQiCiAHfnwhBCADIARCIIh8IQMgBEL/////D4NBADUC7A0iDSAIfnwhBCADIARCIIh8IQMgBEL/////D4MgBX5C/////w+DIQwgBEL/////D4MgCSAMfnwhBCADIARCIIh8IQMgA0IgiCEEIANC/////w+DIAYgATUCCCIPfnwhAyAEIANCIIh8IQQgA0L/////D4MgCiALfnwhAyAEIANCIIh8IQQgA0L/////D4MgADUCCCIOIAd+fCEDIAQgA0IgiHwhBCADQv////8PgyANIAx+fCEDIAQgA0IgiHwhBCADQv////8Pg0EANQLwDSIRIAh+fCEDIAQgA0IgiHwhBCADQv////8PgyAFfkL/////D4MhECADQv////8PgyAJIBB+fCEDIAQgA0IgiHwhBCAEQiCIIQMgBEL/////D4MgBiABNQIMIhN+fCEEIAMgBEIgiHwhAyAEQv////8PgyAKIA9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAOIAt+fCEEIAMgBEIgiHwhAyAEQv////8PgyAANQIMIhIgB358IQQgAyAEQiCIfCEDIARC/////w+DIA0gEH58IQQgAyAEQiCIfCEDIARC/////w+DIBEgDH58IQQgAyAEQiCIfCEDIARC/////w+DQQA1AvQNIhUgCH58IQQgAyAEQiCIfCEDIARC/////w+DIAV+Qv////8PgyEUIARC/////w+DIAkgFH58IQQgAyAEQiCIfCEDIANCIIghBCADQv////8PgyAGIAE1AhAiF358IQMgBCADQiCIfCEEIANC/////w+DIAogE358IQMgBCADQiCIfCEEIANC/////w+DIA4gD358IQMgBCADQiCIfCEEIANC/////w+DIBIgC358IQMgBCADQiCIfCEEIANC/////w+DIAA1AhAiFiAHfnwhAyAEIANCIIh8IQQgA0L/////D4MgDSAUfnwhAyAEIANCIIh8IQQgA0L/////D4MgESAQfnwhAyAEIANCIIh8IQQgA0L/////D4MgFSAMfnwhAyAEIANCIIh8IQQgA0L/////D4NBADUC+A0iGSAIfnwhAyAEIANCIIh8IQQgA0L/////D4MgBX5C/////w+DIRggA0L/////D4MgCSAYfnwhAyAEIANCIIh8IQQgBEIgiCEDIARC/////w+DIAYgATUCFCIbfnwhBCADIARCIIh8IQMgBEL/////D4MgCiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgDiATfnwhBCADIARCIIh8IQMgBEL/////D4MgEiAPfnwhBCADIARCIIh8IQMgBEL/////D4MgFiALfnwhBCADIARCIIh8IQMgBEL/////D4MgADUCFCIaIAd+fCEEIAMgBEIgiHwhAyAEQv////8PgyANIBh+fCEEIAMgBEIgiHwhAyAEQv////8PgyARIBR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAVIBB+fCEEIAMgBEIgiHwhAyAEQv////8PgyAZIAx+fCEEIAMgBEIgiHwhAyAEQv////8Pg0EANQL8DSIdIAh+fCEEIAMgBEIgiHwhAyAEQv////8PgyAFfkL/////D4MhHCAEQv////8PgyAJIBx+fCEEIAMgBEIgiHwhAyADQiCIIQQgA0L/////D4MgBiABNQIYIh9+fCEDIAQgA0IgiHwhBCADQv////8PgyAKIBt+fCEDIAQgA0IgiHwhBCADQv////8PgyAOIBd+fCEDIAQgA0IgiHwhBCADQv////8PgyASIBN+fCEDIAQgA0IgiHwhBCADQv////8PgyAWIA9+fCEDIAQgA0IgiHwhBCADQv////8PgyAaIAt+fCEDIAQgA0IgiHwhBCADQv////8PgyAANQIYIh4gB358IQMgBCADQiCIfCEEIANC/////w+DIA0gHH58IQMgBCADQiCIfCEEIANC/////w+DIBEgGH58IQMgBCADQiCIfCEEIANC/////w+DIBUgFH58IQMgBCADQiCIfCEEIANC/////w+DIBkgEH58IQMgBCADQiCIfCEEIANC/////w+DIB0gDH58IQMgBCADQiCIfCEEIANC/////w+DQQA1AoAOIiEgCH58IQMgBCADQiCIfCEEIANC/////w+DIAV+Qv////8PgyEgIANC/////w+DIAkgIH58IQMgBCADQiCIfCEEIARCIIghAyAEQv////8PgyAGIAE1AhwiI358IQQgAyAEQiCIfCEDIARC/////w+DIAogH358IQQgAyAEQiCIfCEDIARC/////w+DIA4gG358IQQgAyAEQiCIfCEDIARC/////w+DIBIgF358IQQgAyAEQiCIfCEDIARC/////w+DIBYgE358IQQgAyAEQiCIfCEDIARC/////w+DIBogD358IQQgAyAEQiCIfCEDIARC/////w+DIB4gC358IQQgAyAEQiCIfCEDIARC/////w+DIAA1AhwiIiAHfnwhBCADIARCIIh8IQMgBEL/////D4MgDSAgfnwhBCADIARCIIh8IQMgBEL/////D4MgESAcfnwhBCADIARCIIh8IQMgBEL/////D4MgFSAYfnwhBCADIARCIIh8IQMgBEL/////D4MgGSAUfnwhBCADIARCIIh8IQMgBEL/////D4MgHSAQfnwhBCADIARCIIh8IQMgBEL/////D4MgISAMfnwhBCADIARCIIh8IQMgBEL/////D4NBADUChA4iJSAIfnwhBCADIARCIIh8IQMgBEL/////D4MgBX5C/////w+DISQgBEL/////D4MgCSAkfnwhBCADIARCIIh8IQMgA0IgiCEEIANC/////w+DIAogI358IQMgBCADQiCIfCEEIANC/////w+DIA4gH358IQMgBCADQiCIfCEEIANC/////w+DIBIgG358IQMgBCADQiCIfCEEIANC/////w+DIBYgF358IQMgBCADQiCIfCEEIANC/////w+DIBogE358IQMgBCADQiCIfCEEIANC/////w+DIB4gD358IQMgBCADQiCIfCEEIANC/////w+DICIgC358IQMgBCADQiCIfCEEIANC/////w+DIA0gJH58IQMgBCADQiCIfCEEIANC/////w+DIBEgIH58IQMgBCADQiCIfCEEIANC/////w+DIBUgHH58IQMgBCADQiCIfCEEIANC/////w+DIBkgGH58IQMgBCADQiCIfCEEIANC/////w+DIB0gFH58IQMgBCADQiCIfCEEIANC/////w+DICEgEH58IQMgBCADQiCIfCEEIANC/////w+DICUgDH58IQMgBCADQiCIfCEEIAIgAz4CACAEQiCIIQMgBEL/////D4MgDiAjfnwhBCADIARCIIh8IQMgBEL/////D4MgEiAffnwhBCADIARCIIh8IQMgBEL/////D4MgFiAbfnwhBCADIARCIIh8IQMgBEL/////D4MgGiAXfnwhBCADIARCIIh8IQMgBEL/////D4MgHiATfnwhBCADIARCIIh8IQMgBEL/////D4MgIiAPfnwhBCADIARCIIh8IQMgBEL/////D4MgESAkfnwhBCADIARCIIh8IQMgBEL/////D4MgFSAgfnwhBCADIARCIIh8IQMgBEL/////D4MgGSAcfnwhBCADIARCIIh8IQMgBEL/////D4MgHSAYfnwhBCADIARCIIh8IQMgBEL/////D4MgISAUfnwhBCADIARCIIh8IQMgBEL/////D4MgJSAQfnwhBCADIARCIIh8IQMgAiAEPgIEIANCIIghBCADQv////8PgyASICN+fCEDIAQgA0IgiHwhBCADQv////8PgyAWIB9+fCEDIAQgA0IgiHwhBCADQv////8PgyAaIBt+fCEDIAQgA0IgiHwhBCADQv////8PgyAeIBd+fCEDIAQgA0IgiHwhBCADQv////8PgyAiIBN+fCEDIAQgA0IgiHwhBCADQv////8PgyAVICR+fCEDIAQgA0IgiHwhBCADQv////8PgyAZICB+fCEDIAQgA0IgiHwhBCADQv////8PgyAdIBx+fCEDIAQgA0IgiHwhBCADQv////8PgyAhIBh+fCEDIAQgA0IgiHwhBCADQv////8PgyAlIBR+fCEDIAQgA0IgiHwhBCACIAM+AgggBEIgiCEDIARC/////w+DIBYgI358IQQgAyAEQiCIfCEDIARC/////w+DIBogH358IQQgAyAEQiCIfCEDIARC/////w+DIB4gG358IQQgAyAEQiCIfCEDIARC/////w+DICIgF358IQQgAyAEQiCIfCEDIARC/////w+DIBkgJH58IQQgAyAEQiCIfCEDIARC/////w+DIB0gIH58IQQgAyAEQiCIfCEDIARC/////w+DICEgHH58IQQgAyAEQiCIfCEDIARC/////w+DICUgGH58IQQgAyAEQiCIfCEDIAIgBD4CDCADQiCIIQQgA0L/////D4MgGiAjfnwhAyAEIANCIIh8IQQgA0L/////D4MgHiAffnwhAyAEIANCIIh8IQQgA0L/////D4MgIiAbfnwhAyAEIANCIIh8IQQgA0L/////D4MgHSAkfnwhAyAEIANCIIh8IQQgA0L/////D4MgISAgfnwhAyAEIANCIIh8IQQgA0L/////D4MgJSAcfnwhAyAEIANCIIh8IQQgAiADPgIQIARCIIghAyAEQv////8PgyAeICN+fCEEIAMgBEIgiHwhAyAEQv////8PgyAiIB9+fCEEIAMgBEIgiHwhAyAEQv////8PgyAhICR+fCEEIAMgBEIgiHwhAyAEQv////8PgyAlICB+fCEEIAMgBEIgiHwhAyACIAQ+AhQgA0IgiCEEIANC/////w+DICIgI358IQMgBCADQiCIfCEEIANC/////w+DICUgJH58IQMgBCADQiCIfCEEIAIgAz4CGCAEQiCIIQMgAiAEPgIcIAOnBEAgAkHoDSACEAcaBSACQegNEAUEQCACQegNIAIQBxoLCwsSACAAIAFB6BIQCUHoEiACEBsLCwAgAEGIDiABEBwLFQAgAEGoExAAQcgTEAFBqBMgARAbCxcAIAAgARAfIAFB6A0gARANIAEgARAeCwkAQagOIAAQAAsVACAAIAFB6BMQHEHoE0GIDiACEBwLCwAgAEHoDSABEA0LCgAgAEHAAGoQAgsVACAAEAEgAEEgahAXIABBwABqEAELIgAgACABEAAgAEEgaiABQSBqEAAgAEHAAGogAUHAAGoQAAuGAgAgABAkBEAgACABECYPCyAAIABBiBQQEiAAQSBqIABBIGpBqBQQEkGoFEGoFEHIFBASIABBqBRB6BQQDkHoFEHoFEHoFBASQegUQYgUQegUEA9B6BRByBRB6BQQD0HoFEHoFEHoFBAOQYgUQYgUQYgVEA5BiBVBiBRBiBUQDkGIFUGIFUGoFRASIABBIGogAEHAAGpByBUQEkHoFEHoFCABEA5BqBUgASABEA9ByBRByBRB6BUQDkHoFUHoFUHoFRAOQegVQegVQegVEA5B6BQgASABQSBqEA8gAUEgakGIFSABQSBqEBIgAUEgakHoFSABQSBqEA9ByBVByBUgAUHAAGoQDgusAwIBfwF/IABBwABqIQMgAUHAAGohBCAAECQEQCABIAIQJg8LIAEQJARAIAAgAhAmDwsgAyADQYgWEBIgBCAEQagWEBIgAEGoFkHIFhASIAFBiBZB6BYQEiADQYgWQYgXEBIgBEGoFkGoFxASIABBIGpBqBdByBcQEiABQSBqQYgXQegXEBJByBZB6BYQBARAQcgXQegXEAQEQCAAIAIQJw8LC0HoFkHIFkGIGBAPQegXQcgXQagYEA9BiBhBiBhByBgQDkHIGEHIGEHIGBASQYgYQcgYQegYEBJBqBhBqBhBiBkQDkHIFkHIGEHIGRASQYgZQYgZQagZEBJByBlByBlB6BkQDkGoGUHoGCACEA8gAkHoGSACEA9ByBdB6BhBiBoQEkGIGkGIGkGIGhAOQcgZIAIgAkEgahAPIAJBIGpBiBkgAkEgahASIAJBIGpBiBogAkEgahAPIAMgBCACQcAAahAOIAJBwABqIAJBwABqIAJBwABqEBIgAkHAAGpBiBYgAkHAAGoQDyACQcAAakGoFiACQcAAahAPIAJBwABqQYgYIAJBwABqEBILIgAgACABEAAgAEEgaiABQSBqEBAgAEHAAGogAUHAAGoQAAsQACABIAIQKSAAIAIgAhAoCyIAIAAgARAVIABBIGogAUEgahAVIABBwABqIAFBwABqEBULIgAgACABEBQgAEEgaiABQSBqEBQgAEHAAGogAUHAAGoQFAtPACAAECQEQCABECUFIABBwABqQagaEBZBqBpBqBpByBoQEkGoGkHIGkHoGhASIABByBogARASIABBIGpB6BogAUEgahASIAFBwABqEBcLC6cCAgF/AX8gAEGIGxAmIAMQJSACIQQCQANAIARBAWshBCABIARqLQAAIQUgAyADECcgBUGAAU8EQCAFQYABayEFQYgbIAMgAxAoCyADIAMQJyAFQcAATwRAIAVBwABrIQVBiBsgAyADECgLIAMgAxAnIAVBIE8EQCAFQSBrIQVBiBsgAyADECgLIAMgAxAnIAVBEE8EQCAFQRBrIQVBiBsgAyADECgLIAMgAxAnIAVBCE8EQCAFQQhrIQVBiBsgAyADECgLIAMgAxAnIAVBBE8EQCAFQQRrIQVBiBsgAyADECgLIAMgAxAnIAVBAk8EQCAFQQJrIQVBiBsgAyADECgLIAMgAxAnIAVBAU8EQCAFQQFrIQVBiBsgAyADECgLIARFDQEMAAsLCysCAX8BfyAAQQV2QQJ0IQFBASAAQR9xdCECIAEgASgC6NsBIAJyNgLo2wELJAIBfwF/IABBBXZBAnQhAUEBIABBH3F0IQIgASgC6NsBIAJxC6ABBAF/AX8BfwF/IAAhAkHoGxAlQQAhBAJAA0AgBCABRg0BQegbQQEgBHRB4ABsaiEDIAIQAiEFIAIgAxAAIAJBIGohAiADQSBqIQMgAiADEAAgAkEgaiECIANBIGohAyAFBEAgAxABBSADEBcLIARBAWohBAwACwtB6NsBQpeChIAQNwMAQfDbAUIBNwMAQfjbAUIBNwMAQYDcAUIANwMAC0ADAX8BfwF/QegbIABB4ABsaiEBIAAQMEUEQCAALQCI3AEQMiECIAAtAIjeARAyIQMgAiADIAEQKCAAEC8LIAELpQEEAX8BfwF+AX5BACEDAkADQCADQSBGDQFCACEGQQAhBAJAA0AgBCABRg0BIAAgBEEgbCADamoxAAAhBSAFIAVCHIaEQo+AgIDwAYMhBSAFIAVCDoaEQoOAjICwgMABgyEFIAUgBUIHhoRCgYKEiJCgwIABgyEFIAYgBSAErYaEIQYgBEEBaiEEDAALCyACIANBCGxqIAY3AwAgA0EBaiEDDAALCwtLAQF/IAAgAkGI4AEQMyADECUgASACEDFBACEEAkADQCAEQYACRg0BIAMgAxAnIANBh+IBIARrLQAAEDIgAxAoIARBAWohBAwACwsLfgQBfwF/AX8BfyAAIQUgASEGIAUgAiADbiADbEEgbGohCAJAA0AgBSAIRg0BIAUgBiADQYjiARA0QYjiASAEIAQQKCAFQSAgA2xqIQUgBkHAACADbGohBgwACwsgAiADcCEHIAcEQCAFIAYgB0GI4gEQNEGI4gEgBCAEECgLC04CAX8BfyAAIAJB6OIBEDMgASACEDFBACEEAkADQCAEQYACRg0BIAMgBEHgAGxqIQUgBUHn5AEgBGstAAAQMiAFECggBEEBaiEEDAALCwspAQF/QQAhAgJAA0AgAiABRg0BIAAgAkHgAGxqECUgAkEBaiECDAALCwtIAgF/AX8gACEEIAQgAhAmIARB4ABqIQRBASEDAkADQCADIAFGDQEgAiACECcgBCACIAIQKCAEQeAAaiEEIANBAWohAwwACwsLigEEAX8BfwF/AX9B6OQBQYACEDcgACEFIAEhBiAFIAIgA24gA2xBIGxqIQgCQANAIAUgCEYNASAFIAYgA0Ho5AEQNiAFQSAgA2xqIQUgBkHAACADbGohBgwACwsgAiADcCEHIAcEQCAFIAYgB0Ho5AEQNgtB6OQBQYACQeikAxA4QeikAyAEIAQQKAtGACAAQf8BcS0AiLQDQRh0IABBCHZB/wFxLQCItANBEHRqIABBEHZB/wFxLQCItANBCHQgAEEYdkH/AXEtAIi0A2pqIAF3C2cFAX8BfwF/AX8Bf0EBIAF0IQJBACEDAkADQCADIAJGDQEgACADQSBsaiEFIAMgARA6IQQgACAEQSBsaiEGIAMgBEkEQCAFQYi2AxAAIAYgBRAAQYi2AyAGEAALIANBAWohAwwACwsL7wEJAX8BfwF/AX8BfwF/AX8BfwF/IAAgARA7QQEgAXQhCEEBIQMCQANAIAMgAUsNAUEBIAN0IQZByKUDIANBIGxqIQlBACEEAkADQCAEIAhPDQEgAgRAIAlBIGpBqLYDEAAFQai2AxAhCyAGQQF2IQdBACEFAkADQCAFIAdPDQEgACAEIAVqQSBsaiEKIAogB0EgbGohC0GotgMgC0HItgMQHCAKQei2AxAAQei2A0HItgMgChAYQei2A0HItgMgCxAZQai2AyAJQai2AxAcIAVBAWohBQwACwsgBCAGaiEEDAALCyADQQFqIQMMAAsLCz4DAX8BfwF/IAAhAyABIQQgACACQSBsaiEFAkADQCADIAVGDQEgAyAEEAAgA0EgaiEDIARBwABqIQQMAAsLCz0DAX8BfwF/IAAhAyABIQQgACACQSBsaiEFAkADQCADIAVGDQEgAyAEEB8gA0EgaiEDIARBIGohBAwACwsLPQMBfwF/AX8gACEDIAEhBCAAIAJBIGxqIQUCQANAIAMgBUYNASADIAQQHiADQSBqIQMgBEEgaiEEDAALCwuWAQcBfwF/AX8BfwF/AX8Bf0EBIAF0IQJB6KwDIAFBIGxqIQQgAkEBayEGQQEhBSACQQF2IQMCQANAIAUgA0YNASAAIAVBIGxqIQcgACACIAVrQSBsaiEIIAdBiLcDEAAgCCAEIAcQHEGItwMgBCAIEBwgBUEBaiEFDAALCyAAIAQgABAcIAAgA0EgbGohCCAIIAQgCBAcC0MCAX8BfyAAQQF2IQJBACEBAkADQCACRQ0BIAJBAXYhAiABQQFqIQEMAAsLIABBASABdEcEQAALIAFBHEsEQAALIAELEgEBfyABEEEhAyAAIAMgAhA8CxgBAX8gARBBIQMgACADIAIQPCAAIAMQQAtMBAF/AX8BfwF/IAAhBCABIQUgAyEGIAAgAkEgbGohBwJAA0AgBCAHRg0BIAQgBSAGEBwgBEEgaiEEIAVBIGohBSAGQSBqIQYMAAsLCy4CAX8BfyAAIQMgACABQSBsaiECAkADQCADIAJGDQEgAxABIANBIGohAwwACwsLjgEGAX8BfwF/AX8BfwF/QQAhBCAAIQYgASEHAkADQCAEIAJGDQEgBigCACEJIAZBBGohBkEAIQUCQANAIAUgCUYNASADIAYoAgBBIGxqIQggBkEEaiEGIAcgBkGotwMQHEGotwMgCCAIEBggBkEgaiEGIAVBAWohBQwACwsgB0EgaiEHIARBAWohBAwACwsLDgAgABACIABBIGoQAnELDQAgABABIABBIGoQAQsNACAAEBcgAEEgahABCxQAIAAgARAAIABBIGogAUEgahAAC3kAIAAgAUHotwMQEiAAQSBqIAFBIGpBiLgDEBIgACAAQSBqQai4AxAOIAEgAUEgakHIuAMQDkGouANByLgDQai4AxASQYi4A0HItwMgAhASQei3AyACIAIQDkHotwNBiLgDIAJBIGoQDkGouAMgAkEgaiACQSBqEA8LGwAgACABIAIQDiAAQSBqIAFBIGogAkEgahAOCxsAIAAgASACEA8gAEEgaiABQSBqIAJBIGoQDwsUACAAIAEQECAAQSBqIAFBIGoQEAsUACAAIAEQFCAAQSBqIAFBIGoQFAsUACAAIAEQFSAAQSBqIAFBIGoQFQsVACAAIAEQBCAAQSBqIAFBIGoQBHELaAAgACAAQei4AxASIABBIGogAEEgakGIuQMQEkGIuQNByLcDQai5AxASQei4A0GouQNBqLkDEA9BqLkDQci5AxAWIABByLkDIAEQEiAAQSBqQci5AyABQSBqEBIgAUEgaiABQSBqEBALCgAgAEGAAWoQRwsWACAAEEggAEHAAGoQSSAAQYABahBICyQAIAAgARBKIABBwABqIAFBwABqEEogAEGAAWogAUGAAWoQSgu8AgAgABBTBEAgACABEFUPCyAAIABB6LkDEEsgAEHAAGogAEHAAGpBqLoDEEtBqLoDQai6A0HougMQSyAAQai6A0GouwMQTEGouwNBqLsDQai7AxBLQai7A0HouQNBqLsDEE1BqLsDQei6A0GouwMQTUGouwNBqLsDQai7AxBMQei5A0HouQNB6LsDEExB6LsDQei5A0HouwMQTEHouwNB6LsDQai8AxBLIABBwABqIABBgAFqQei8AxBLQai7A0GouwMgARBMQai8AyABIAEQTUHougNB6LoDQai9AxBMQai9A0GovQNBqL0DEExBqL0DQai9A0GovQMQTEGouwMgASABQcAAahBNIAFBwABqQei7AyABQcAAahBLIAFBwABqQai9AyABQcAAahBNQei8A0HovAMgAUGAAWoQTAvvAwIBfwF/IABBgAFqIQMgAUGAAWohBCAAEFMEQCABIAIQVQ8LIAEQUwRAIAAgAhBVDwsgAyADQei9AxBLIAQgBEGovgMQSyAAQai+A0HovgMQSyABQei9A0GovwMQSyADQei9A0HovwMQSyAEQai+A0GowAMQSyAAQcAAakGowANB6MADEEsgAUHAAGpB6L8DQajBAxBLQei+A0GovwMQUQRAQejAA0GowQMQUQRAIAAgAhBWDwsLQai/A0HovgNB6MEDEE1BqMEDQejAA0GowgMQTUHowQNB6MEDQejCAxBMQejCA0HowgNB6MIDEEtB6MEDQejCA0GowwMQS0GowgNBqMIDQejDAxBMQei+A0HowgNB6MQDEEtB6MMDQejDA0GoxAMQS0HoxANB6MQDQajFAxBMQajEA0GowwMgAhBNIAJBqMUDIAIQTUHowANBqMMDQejFAxBLQejFA0HoxQNB6MUDEExB6MQDIAIgAkHAAGoQTSACQcAAakHowwMgAkHAAGoQSyACQcAAakHoxQMgAkHAAGoQTSADIAQgAkGAAWoQTCACQYABaiACQYABaiACQYABahBLIAJBgAFqQei9AyACQYABahBNIAJBgAFqQai+AyACQYABahBNIAJBgAFqQejBAyACQYABahBLCyQAIAAgARBKIABBwABqIAFBwABqEE4gAEGAAWogAUGAAWoQSgsQACABIAIQWCAAIAIgAhBXCyQAIAAgARBQIABBwABqIAFBwABqEFAgAEGAAWogAUGAAWoQUAskACAAIAEQTyAAQcAAaiABQcAAahBPIABBgAFqIAFBgAFqEE8LWgAgABBTBEAgARBUBSAAQYABakGoxgMQUkGoxgNBqMYDQejGAxBLQajGA0HoxgNBqMcDEEsgAEHoxgMgARBLIABBwABqQajHAyABQcAAahBLIAFBgAFqEEkLC7ACAgF/AX8gAEHoxwMQVSADEFQgAiEEAkADQCAEQQFrIQQgASAEai0AACEFIAMgAxBWIAVBgAFPBEAgBUGAAWshBUHoxwMgAyADEFcLIAMgAxBWIAVBwABPBEAgBUHAAGshBUHoxwMgAyADEFcLIAMgAxBWIAVBIE8EQCAFQSBrIQVB6McDIAMgAxBXCyADIAMQViAFQRBPBEAgBUEQayEFQejHAyADIAMQVwsgAyADEFYgBUEITwRAIAVBCGshBUHoxwMgAyADEFcLIAMgAxBWIAVBBE8EQCAFQQRrIQVB6McDIAMgAxBXCyADIAMQViAFQQJPBEAgBUECayEFQejHAyADIAMQVwsgAyADEFYgBUEBTwRAIAVBAWshBUHoxwMgAyADEFcLIARFDQEMAAsLCysCAX8BfyAAQQV2QQJ0IQFBASAAQR9xdCECIAEgASgCqMkGIAJyNgKoyQYLJAIBfwF/IABBBXZBAnQhAUEBIABBH3F0IQIgASgCqMkGIAJxC6YBBAF/AX8BfwF/IAAhAkGoyQMQVEEAIQQCQANAIAQgAUYNAUGoyQNBASAEdEHAAWxqIQMgAhBHIQUgAiADEEogAkHAAGohAiADQcAAaiEDIAIgAxBKIAJBwABqIQIgA0HAAGohAyAFBEAgAxBIBSADEEkLIARBAWohBAwACwtBqMkGQpeChIAQNwMAQbDJBkIBNwMAQbjJBkIBNwMAQcDJBkIANwMAC0EDAX8BfwF/QajJAyAAQcABbGohASAAEF9FBEAgAC0AyMkGEGEhAiAALQDIywYQYSEDIAIgAyABEFcgABBeCyABC6UBBAF/AX8BfgF+QQAhAwJAA0AgA0EgRg0BQgAhBkEAIQQCQANAIAQgAUYNASAAIARBIGwgA2pqMQAAIQUgBSAFQhyGhEKPgICA8AGDIQUgBSAFQg6GhEKDgIyAsIDAAYMhBSAFIAVCB4aEQoGChIiQoMCAAYMhBSAGIAUgBK2GhCEGIARBAWohBAwACwsgAiADQQhsaiAGNwMAIANBAWohAwwACwsLSwEBfyAAIAJByM0GEGIgAxBUIAEgAhBgQQAhBAJAA0AgBEGAAkYNASADIAMQViADQcfPBiAEay0AABBhIAMQVyAEQQFqIQQMAAsLC34EAX8BfwF/AX8gACEFIAEhBiAFIAIgA24gA2xBIGxqIQgCQANAIAUgCEYNASAFIAYgA0HIzwYQY0HIzwYgBCAEEFcgBUEgIANsaiEFIAZBgAEgA2xqIQYMAAsLIAIgA3AhByAHBEAgBSAGIAdByM8GEGNByM8GIAQgBBBXCwtOAgF/AX8gACACQYjRBhBiIAEgAhBgQQAhBAJAA0AgBEGAAkYNASADIARBwAFsaiEFIAVBh9MGIARrLQAAEGEgBRBXIARBAWohBAwACwsLKQEBf0EAIQICQANAIAIgAUYNASAAIAJBwAFsahBUIAJBAWohAgwACwsLSAIBfwF/IAAhBCAEIAIQVSAEQcABaiEEQQEhAwJAA0AgAyABRg0BIAIgAhBWIAQgAiACEFcgBEHAAWohBCADQQFqIQMMAAsLC4oBBAF/AX8BfwF/QYjTBkGAAhBmIAAhBSABIQYgBSACIANuIANsQSBsaiEIAkADQCAFIAhGDQEgBSAGIANBiNMGEGUgBUEgIANsaiEFIAZBgAEgA2xqIQYMAAsLIAIgA3AhByAHBEAgBSAGIAdBiNMGEGULQYjTBkGAAkGI0wkQZ0GI0wkgBCAEEFcLJAEBfyADIQQCQANAIAAgASACEBIgBEEBayEEIARFDQEMAAsLCyQBAX8gAyEEAkADQCAAIAEgAhATIARBAWshBCAERQ0BDAALCwsL/hsSAEEACwRIagIAAEEICyABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABB6AcLIEf9fNgWjCA8jcpxaJFqgZddWIGBtkVQuCmgMeFyTmQwAEGICAsgifqKU1v8LPP7AUXUERnntfZ/QQr/HqtHHzW4ynGf2AYAQagICyCdDY/FjUNd0z0Lx/Uo63gKLEZ5eG+jbmYv3weawXcKDgBByAgLIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEHoDQsgAQAA8JP14UORcLl5SOgzKF1YgYG2RVC4KaAx4XJOZDAAQYgOCyCnbSGuRea4G+NZXOOxOv5ThYC7Uz2DSYylRE5/sdAWAgBBqA4LIPv//08cNJasKc1gn5V2/DYuRnl4b6NuZi/fB5rBdwoOAEHIDgsgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQYjcAQuAAgAAAAIABAQGAAgICggMDAwAEBASEBQUFBAYGBgYGBgcACAgIiAkJCQgKCgoKCgoLCAwMDAwMDA0MDAwODA4ODgAQEBCQEREREBISEhISEhMQFBQUFBQUFRQUFBYUFhYWEBgYGBgYGBkYGBgaGBoaGhgYGBwYHBwcGBwcHBwcHB4AICAgoCEhISAiIiIiIiIjICQkJCQkJCUkJCQmJCYmJiAoKCgoKCgpKCgoKigqKiooKCgsKCwsLCgsLCwsLCwuIDAwMDAwMDEwMDAyMDIyMjAwMDQwNDQ0MDQ0NDQ0NDYwMDA4MDg4ODA4ODg4ODg6MDg4ODg4ODw4ODg8ODw8PAAQYjeAQuAAgAAAAEAAQIBAAECAQQBAgMAAQIBBAECAwgBAgMEBQYDAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcAAQIBBAECAwgBAgMEBQYDEAECAwQFBgMICQoDDAUGByABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcgAQIDBAUGAwgJCgMMBQYHEBESAxQFBgcYCQoLDA0OB0ABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HICEiAyQFBgcoCQoLDA0OBzAREhMUFRYHGBkaCxwNDg8AQcilAwugB/v//08cNJasKc1gn5V2/DYuRnl4b6NuZi/fB5rBdwoOBgAAoHfBS5dno1jasnE38S4SCAlHouFR+sApR7HWWSKL79yelz11fyCRR7EsFz9fbmwJdHlisY3PCME5NXs3Kz98rbXiSq34voXLg//GYC33KZRdK/122anZmj/nfEAkA48vdHx9tvTMaNBj3C0baGpX+xvvvOWM/jy20lEpfBZkTFe/sfcUIvJ9MfcvI/kozXWtsKiEdeUDbRfcWfuBK0KecG6u8VG1znHA3RMpmJsOBYBC6VZzZO31B/wGuNMJgFNdsQYNFKuXWzG8zDovjE+ZBJIlN1l4NCbiWfDzshwAnKOeMZOPf4JXzPlZECV7fFP7zWe9g1asm6gYrsbsFzMECZKPksjJo/TZf6YBR9mLJ4/9+1Xmzt4OLRdwRY4VE6UgZnX5WZ2ZVwHqo0XnM2zdv2C/4paJx+I1twLvpiIudgBd/OlRSeWuZMGCrX128iJOQvGv4V+XE7D47etlI9kBPlZnQaSjJboMUrpemCwhbXCfkuALYy7ljTRjrYwPGmYZCIlu6JiUND20wnGJpQyvbkFNfcvYJ1nvfCLUBAERlgf+kG8TKjJxjFo7lZGQN1CWNzfy380mlBQCXqEpDNRyDoJMZGltDMJyc8g9YzCdm1pCQQw7VxcnCqB/QlgeELjTUZK0AZScwI809Zg83oOT1AeLGbXPYwx/RlvO7CngQ+GA5vdXj3vbSsX5Loork99rO4/jEMoAAl1nXrctKecj6qy4yOYv8R6NjwW1zvfwzRJ8H4QnUTCoubd9byIhzi1+AHOxdSTqeQVkX6otYtxn8e7Xdq71fylqiLEQ7iUzR54WRLPrASD4tYlq3XaJ3TQOTAP7n6IA4mGcFayzGX0R+krdZAdiV5Mti3GsHJG6+FYYISp3CMFg9aFV9WgXZIs6zEmo7UWQbqVH9LpafStbw6/v4Ua/Pkg47qP9/RfvaMRqvM7HsG9Jryf2s34eEapUzcyjkkpfuMOubR1HFMwGf4lFmV7tafi5x3bRxWN5uYLSR51EFtxVzV1/hyoj2h08y2o/HLkYoHNUZKTEngzfD2tkXfnp9i7EyNy6ei9uxcz31cVAdqfy89gf8xbnR/8w9Pae3HbbOE42ZfQcIrN9xQ6tQO/ha7dA7s7CGs1m0ftNi8+MHDB7M+wTiPEQuP45tsXHMpaZ8g8NQONcmNjssAEAiN2yKc6YbQ0HaR0AQeisAwugB/v//08cNJasKc1gn5V2/DYuRnl4b6NuZi/fB5rBdwoO/v//H9gUPHjdHo0Mby+Yr0VP/fySdF+PrL+cPRpjNx////8PbAoevG6PRoa3F8zXoqd+fkm6r0fWX84ejbGbDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAQYi0AwuAAgCAQMAgoGDgEJBQ0DCwcPAIiEjIKKho6BiYWNg4uHj4BIRExCSkZOQUlFTUNLR09AyMTMwsrGzsHJxc3Dy8fPwCgkLCIqJi4hKSUtIysnLyCopKyiqqauoamlraOrp6+gaGRsYmpmbmFpZW1ja2dvYOjk7OLq5u7h6eXt4+vn7+AYFBwSGhYeERkVHRMbFx8QmJSckpqWnpGZlZ2Tm5efkFhUXFJaVl5RWVVdU1tXX1DY1NzS2tbe0dnV3dPb19/QODQ8Mjo2PjE5NT0zOzc/MLi0vLK6tr6xubW9s7u3v7B4dHxyenZ+cXl1fXN7d39w+PT88vr2/vH59f3z+/f/8AQci3Awsgqu/tEolIw2hPv6pyaH8IjTESCAlHouFR+sApR7HWWSIAQcjJBguAAgAAAAIABAQGAAgICggMDAwAEBASEBQUFBAYGBgYGBgcACAgIiAkJCQgKCgoKCgoLCAwMDAwMDA0MDAwODA4ODgAQEBCQEREREBISEhISEhMQFBQUFBQUFRQUFBYUFhYWEBgYGBgYGBkYGBgaGBoaGhgYGBwYHBwcGBwcHBwcHB4AICAgoCEhISAiIiIiIiIjICQkJCQkJCUkJCQmJCYmJiAoKCgoKCgpKCgoKigqKiooKCgsKCwsLCgsLCwsLCwuIDAwMDAwMDEwMDAyMDIyMjAwMDQwNDQ0MDQ0NDQ0NDYwMDA4MDg4ODA4ODg4ODg6MDg4ODg4ODw4ODg8ODw8PAAQcjLBguAAgAAAAEAAQIBAAECAQQBAgMAAQIBBAECAwgBAgMEBQYDAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcAAQIBBAECAwgBAgMEBQYDEAECAwQFBgMICQoDDAUGByABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcgAQIDBAUGAwgJCgMMBQYHEBESAxQFBgcYCQoLDA0OB0ABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HICEiAyQFBgcoCQoLDA0OBzAREhMUFRYHGBkaCxwNDg8=","base64"),a.pq=1e3,a.pr=1768},9565:(e,a,t)=>{var c;e=t.nmd(e);var f=function(e){"use strict";var a=1e7,t=9007199254740992,c=l(t),d="0123456789abcdefghijklmnopqrstuvwxyz",r="function"==typeof BigInt;function n(e,a,t,c){return void 0===e?n[0]:void 0===a||10==+a&&!t?Z(e):q(e,a,t,c)}function i(e,a){this.value=e,this.sign=a,this.isSmall=!1}function b(e){this.value=e,this.sign=e<0,this.isSmall=!0}function o(e){this.value=e}function s(e){return-t0?Math.floor(e):Math.ceil(e)}function m(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(f=0;f=b?1:0,n[f]=c-i*b;for(;f0&&n.push(i),n}function x(e,a){return e.length>=a.length?m(e,a):m(a,e)}function y(e,t){var c,f,d=e.length,r=new Array(d),n=a;for(f=0;f0;)r[f++]=t%n,t=Math.floor(t/n);return r}function A(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(c=0;c0;)r[f++]=i%n,i=Math.floor(i/n);return r}function I(e,a){for(var t=[];a-- >0;)t.push(0);return t.concat(e)}function E(e,a){var t=Math.max(e.length,a.length);if(t<=30)return w(e,a);t=Math.ceil(t/2);var c=e.slice(t),f=e.slice(0,t),d=a.slice(t),r=a.slice(0,t),n=E(f,r),i=E(c,d),b=E(x(f,c),x(r,d)),o=x(x(n,I(A(A(b,n),i),t)),I(i,2*t));return h(o),o}function C(e,t,c){return new i(e=0;--c)d=(r=d*b+e[c])-(f=g(r/t))*t,i[c]=0|f;return[i,0|d]}function L(e,t){var c,f=Z(t);if(r)return[new o(e.value/f.value),new o(e.value%f.value)];var d,s=e.value,m=f.value;if(0===m)throw new Error("Cannot divide by zero");if(e.isSmall)return f.isSmall?[new b(g(s/m)),new b(s%m)]:[n[0],e];if(f.isSmall){if(1===m)return[e,n[0]];if(-1==m)return[e.negate(),n[0]];var x=Math.abs(m);if(x=0;f--){for(c=l-1,x[f+s]!==g&&(c=Math.floor((x[f+s]*l+x[f+s-1])/g)),d=0,r=0,i=y.length,n=0;nb&&(d=(d+1)*l),c=Math.ceil(d/r);do{if(S(n=_(t,c),s)<=0)break;c--}while(c);o.push(c),s=A(s,n)}return o.reverse(),[u(o),u(s)]}(s,m),d=c[0];var w=e.sign!==f.sign,I=c[1],E=e.sign;return"number"==typeof d?(w&&(d=-d),d=new b(d)):d=new i(d,w),"number"==typeof I?(E&&(I=-I),I=new b(I)):I=new i(I,E),[d,I]}function S(e,a){if(e.length!==a.length)return e.length>a.length?1:-1;for(var t=e.length-1;t>=0;t--)if(e[t]!==a[t])return e[t]>a[t]?1:-1;return 0}function k(e){var a=e.abs();return!a.isUnit()&&(!!(a.equals(2)||a.equals(3)||a.equals(5))||!(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))&&(!!a.lesser(49)||void 0))}function N(e,a){for(var t,c,d,r=e.prev(),n=r,i=0;n.isEven();)n=n.divide(2),i++;e:for(c=0;c=0?c=A(e,a):(c=A(a,e),t=!t),"number"==typeof(c=u(c))?(t&&(c=-c),new b(c)):new i(c,t)}(t,c,this.sign)},i.prototype.minus=i.prototype.subtract,b.prototype.subtract=function(e){var a=Z(e),t=this.value;if(t<0!==a.sign)return this.add(a.negate());var c=a.value;return a.isSmall?new b(t-c):v(c,Math.abs(t),t>=0)},b.prototype.minus=b.prototype.subtract,o.prototype.subtract=function(e){return new o(this.value-Z(e).value)},o.prototype.minus=o.prototype.subtract,i.prototype.negate=function(){return new i(this.value,!this.sign)},b.prototype.negate=function(){var e=this.sign,a=new b(-this.value);return a.sign=!e,a},o.prototype.negate=function(){return new o(-this.value)},i.prototype.abs=function(){return new i(this.value,!1)},b.prototype.abs=function(){return new b(Math.abs(this.value))},o.prototype.abs=function(){return new o(this.value>=0?this.value:-this.value)},i.prototype.multiply=function(e){var t,c,f,d=Z(e),r=this.value,b=d.value,o=this.sign!==d.sign;if(d.isSmall){if(0===b)return n[0];if(1===b)return this;if(-1===b)return this.negate();if((t=Math.abs(b))0?E(r,b):w(r,b),o)},i.prototype.times=i.prototype.multiply,b.prototype._multiplyBySmall=function(e){return s(e.value*this.value)?new b(e.value*this.value):C(Math.abs(e.value),l(Math.abs(this.value)),this.sign!==e.sign)},i.prototype._multiplyBySmall=function(e){return 0===e.value?n[0]:1===e.value?this:-1===e.value?this.negate():C(Math.abs(e.value),this.value,this.sign!==e.sign)},b.prototype.multiply=function(e){return Z(e)._multiplyBySmall(this)},b.prototype.times=b.prototype.multiply,o.prototype.multiply=function(e){return new o(this.value*Z(e).value)},o.prototype.times=o.prototype.multiply,i.prototype.square=function(){return new i(M(this.value),!1)},b.prototype.square=function(){var e=this.value*this.value;return s(e)?new b(e):new i(M(l(Math.abs(this.value))),!1)},o.prototype.square=function(e){return new o(this.value*this.value)},i.prototype.divmod=function(e){var a=L(this,e);return{quotient:a[0],remainder:a[1]}},o.prototype.divmod=b.prototype.divmod=i.prototype.divmod,i.prototype.divide=function(e){return L(this,e)[0]},o.prototype.over=o.prototype.divide=function(e){return new o(this.value/Z(e).value)},b.prototype.over=b.prototype.divide=i.prototype.over=i.prototype.divide,i.prototype.mod=function(e){return L(this,e)[1]},o.prototype.mod=o.prototype.remainder=function(e){return new o(this.value%Z(e).value)},b.prototype.remainder=b.prototype.mod=i.prototype.remainder=i.prototype.mod,i.prototype.pow=function(e){var a,t,c,f=Z(e),d=this.value,r=f.value;if(0===r)return n[1];if(0===d)return n[0];if(1===d)return n[1];if(-1===d)return f.isEven()?n[1]:n[-1];if(f.sign)return n[0];if(!f.isSmall)throw new Error("The exponent "+f.toString()+" is too large.");if(this.isSmall&&s(a=Math.pow(d,r)))return new b(g(a));for(t=this,c=n[1];!0&r&&(c=c.times(t),--r),0!==r;)r/=2,t=t.square();return c},b.prototype.pow=i.prototype.pow,o.prototype.pow=function(e){var a=Z(e),t=this.value,c=a.value,f=BigInt(0),d=BigInt(1),r=BigInt(2);if(c===f)return n[1];if(t===f)return n[0];if(t===d)return n[1];if(t===BigInt(-1))return a.isEven()?n[1]:n[-1];if(a.isNegative())return new o(f);for(var i=this,b=n[1];(c&d)===d&&(b=b.times(i),--c),c!==f;)c/=r,i=i.square();return b},i.prototype.modPow=function(e,a){if(e=Z(e),(a=Z(a)).isZero())throw new Error("Cannot take modPow with modulus 0");for(var t=n[1],c=this.mod(a);e.isPositive();){if(c.isZero())return n[0];e.isOdd()&&(t=t.multiply(c).mod(a)),e=e.divide(2),c=c.square().mod(a)}return t},o.prototype.modPow=b.prototype.modPow=i.prototype.modPow,i.prototype.compareAbs=function(e){var a=Z(e),t=this.value,c=a.value;return a.isSmall?1:S(t,c)},b.prototype.compareAbs=function(e){var a=Z(e),t=Math.abs(this.value),c=a.value;return a.isSmall?t===(c=Math.abs(c))?0:t>c?1:-1:-1},o.prototype.compareAbs=function(e){var a=this.value,t=Z(e).value;return(a=a>=0?a:-a)===(t=t>=0?t:-t)?0:a>t?1:-1},i.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return this.sign!==a.sign?a.sign?1:-1:a.isSmall?this.sign?-1:1:S(t,c)*(this.sign?-1:1)},i.prototype.compareTo=i.prototype.compare,b.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return a.isSmall?t==c?0:t>c?1:-1:t<0!==a.sign?t<0?-1:1:t<0?1:-1},b.prototype.compareTo=b.prototype.compare,o.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=this.value,t=Z(e).value;return a===t?0:a>t?1:-1},o.prototype.compareTo=o.prototype.compare,i.prototype.equals=function(e){return 0===this.compare(e)},o.prototype.eq=o.prototype.equals=b.prototype.eq=b.prototype.equals=i.prototype.eq=i.prototype.equals,i.prototype.notEquals=function(e){return 0!==this.compare(e)},o.prototype.neq=o.prototype.notEquals=b.prototype.neq=b.prototype.notEquals=i.prototype.neq=i.prototype.notEquals,i.prototype.greater=function(e){return this.compare(e)>0},o.prototype.gt=o.prototype.greater=b.prototype.gt=b.prototype.greater=i.prototype.gt=i.prototype.greater,i.prototype.lesser=function(e){return this.compare(e)<0},o.prototype.lt=o.prototype.lesser=b.prototype.lt=b.prototype.lesser=i.prototype.lt=i.prototype.lesser,i.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},o.prototype.geq=o.prototype.greaterOrEquals=b.prototype.geq=b.prototype.greaterOrEquals=i.prototype.geq=i.prototype.greaterOrEquals,i.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},o.prototype.leq=o.prototype.lesserOrEquals=b.prototype.leq=b.prototype.lesserOrEquals=i.prototype.leq=i.prototype.lesserOrEquals,i.prototype.isEven=function(){return!(1&this.value[0])},b.prototype.isEven=function(){return!(1&this.value)},o.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},i.prototype.isOdd=function(){return!(1&~this.value[0])},b.prototype.isOdd=function(){return!(1&~this.value)},o.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},i.prototype.isPositive=function(){return!this.sign},b.prototype.isPositive=function(){return this.value>0},o.prototype.isPositive=b.prototype.isPositive,i.prototype.isNegative=function(){return this.sign},b.prototype.isNegative=function(){return this.value<0},o.prototype.isNegative=b.prototype.isNegative,i.prototype.isUnit=function(){return!1},b.prototype.isUnit=function(){return 1===Math.abs(this.value)},o.prototype.isUnit=function(){return this.abs().value===BigInt(1)},i.prototype.isZero=function(){return!1},b.prototype.isZero=function(){return 0===this.value},o.prototype.isZero=function(){return this.value===BigInt(0)},i.prototype.isDivisibleBy=function(e){var a=Z(e);return!a.isZero()&&(!!a.isUnit()||(0===a.compareAbs(2)?this.isEven():this.mod(a).isZero()))},o.prototype.isDivisibleBy=b.prototype.isDivisibleBy=i.prototype.isDivisibleBy,i.prototype.isPrime=function(a){var t=k(this);if(t!==e)return t;var c=this.abs(),d=c.bitLength();if(d<=64)return N(c,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var r=Math.log(2)*d.toJSNumber(),n=Math.ceil(!0===a?2*Math.pow(r,2):r),i=[],b=0;b-t?new b(e-1):new i(c,!0)},o.prototype.prev=function(){return new o(this.value-BigInt(1))};for(var P=[1];2*P[P.length-1]<=a;)P.push(2*P[P.length-1]);var R=P.length,O=P[R-1];function T(e){return Math.abs(e)<=a}function D(e,a,t){a=Z(a);for(var c=e.isNegative(),d=a.isNegative(),r=c?e.not():e,n=d?a.not():a,i=0,b=0,o=null,s=null,l=[];!r.isZero()||!n.isZero();)i=(o=L(r,O))[1].toJSNumber(),c&&(i=O-1-i),b=(s=L(n,O))[1].toJSNumber(),d&&(b=O-1-b),r=o[0],n=s[0],l.push(t(i,b));for(var u=0!==t(c?1:0,d?1:0)?f(-1):f(0),h=l.length-1;h>=0;h-=1)u=u.multiply(O).add(f(l[h]));return u}i.prototype.shiftLeft=function(e){var a=Z(e).toJSNumber();if(!T(a))throw new Error(String(a)+" is too large for shifting.");if(a<0)return this.shiftRight(-a);var t=this;if(t.isZero())return t;for(;a>=R;)t=t.multiply(O),a-=R-1;return t.multiply(P[a])},o.prototype.shiftLeft=b.prototype.shiftLeft=i.prototype.shiftLeft,i.prototype.shiftRight=function(e){var a,t=Z(e).toJSNumber();if(!T(t))throw new Error(String(t)+" is too large for shifting.");if(t<0)return this.shiftLeft(-t);for(var c=this;t>=R;){if(c.isZero()||c.isNegative()&&c.isUnit())return c;c=(a=L(c,O))[1].isNegative()?a[0].prev():a[0],t-=R-1}return(a=L(c,P[t]))[1].isNegative()?a[0].prev():a[0]},o.prototype.shiftRight=b.prototype.shiftRight=i.prototype.shiftRight,i.prototype.not=function(){return this.negate().prev()},o.prototype.not=b.prototype.not=i.prototype.not,i.prototype.and=function(e){return D(this,e,(function(e,a){return e&a}))},o.prototype.and=b.prototype.and=i.prototype.and,i.prototype.or=function(e){return D(this,e,(function(e,a){return e|a}))},o.prototype.or=b.prototype.or=i.prototype.or,i.prototype.xor=function(e){return D(this,e,(function(e,a){return e^a}))},o.prototype.xor=b.prototype.xor=i.prototype.xor;var F=1<<30;function Q(e){var t=e.value,c="number"==typeof t?t|F:"bigint"==typeof t?t|BigInt(F):t[0]+t[1]*a|1073758208;return c&-c}function U(e,a){if(a.compareTo(e)<=0){var t=U(e,a.square(a)),c=t.p,d=t.e,r=c.multiply(a);return r.compareTo(e)<=0?{p:r,e:2*d+1}:{p:c,e:2*d}}return{p:f(1),e:0}}function j(e,a){return e=Z(e),a=Z(a),e.greater(a)?e:a}function H(e,a){return e=Z(e),a=Z(a),e.lesser(a)?e:a}function $(e,a){if(e=Z(e).abs(),a=Z(a).abs(),e.equals(a))return e;if(e.isZero())return a;if(a.isZero())return e;for(var t,c,f=n[1];e.isEven()&&a.isEven();)t=H(Q(e),Q(a)),e=e.divide(t),a=a.divide(t),f=f.multiply(t);for(;e.isEven();)e=e.divide(Q(e));do{for(;a.isEven();)a=a.divide(Q(a));e.greater(a)&&(c=a,a=e,e=c),a=a.subtract(e)}while(!a.isZero());return f.isUnit()?e:e.multiply(f)}i.prototype.bitLength=function(){var e=this;return e.compareTo(f(0))<0&&(e=e.negate().subtract(f(1))),0===e.compareTo(f(0))?f(0):f(U(e,f(2)).e).add(f(1))},o.prototype.bitLength=b.prototype.bitLength=i.prototype.bitLength;var q=function(e,a,t,c){t=t||d,e=String(e),c||(e=e.toLowerCase(),t=t.toLowerCase());var f,r=e.length,n=Math.abs(a),i={};for(f=0;f=n){if("1"===s&&1===n)continue;throw new Error(s+" is not a valid digit in base "+a+".")}a=Z(a);var b=[],o="-"===e[0];for(f=o?1:0;f"!==e[f]&&f=0;c--)f=f.add(e[c].times(d)),d=d.times(a);return t?f.negate():f}function z(e,a){if((a=f(a)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(a.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var t=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return t.unshift([1]),{value:[].concat.apply([],t),isNegative:!1}}var c=!1;if(e.isNegative()&&a.isPositive()&&(c=!0,e=e.abs()),a.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:c};for(var d,r=[],n=e;n.isNegative()||n.compareAbs(a)>=0;){d=n.divmod(a),n=d.quotient;var i=d.remainder;i.isNegative()&&(i=a.minus(i).abs(),n=n.next()),r.push(i.toJSNumber())}return r.push(n.toJSNumber()),{value:r.reverse(),isNegative:c}}function K(e,a,t){var c=z(e,a);return(c.isNegative?"-":"")+c.value.map((function(e){return function(e,a){return e<(a=a||d).length?a[e]:"<"+e+">"}(e,t)})).join("")}function V(e){if(s(+e)){var a=+e;if(a===g(a))return r?new o(BigInt(a)):new b(a);throw new Error("Invalid integer: "+e)}var t="-"===e[0];t&&(e=e.slice(1));var c=e.split(/e/i);if(c.length>2)throw new Error("Invalid integer: "+c.join("e"));if(2===c.length){var f=c[1];if("+"===f[0]&&(f=f.slice(1)),(f=+f)!==g(f)||!s(f))throw new Error("Invalid integer: "+f+" is not a valid exponent.");var d=c[0],n=d.indexOf(".");if(n>=0&&(f-=d.length-n-1,d=d.slice(0,n)+d.slice(n+1)),f<0)throw new Error("Cannot include negative exponent part for integers");e=d+=new Array(f+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);if(r)return new o(BigInt(t?"-"+e:e));for(var l=[],u=e.length,p=u-7;u>0;)l.push(+e.slice(p,u)),(p-=7)<0&&(p=0),u-=7;return h(l),new i(l,t)}function Z(e){return"number"==typeof e?function(e){if(r)return new o(BigInt(e));if(s(e)){if(e!==g(e))throw new Error(e+" is not an integer.");return new b(e)}return V(e.toString())}(e):"string"==typeof e?V(e):"bigint"==typeof e?new o(e):e}i.prototype.toArray=function(e){return z(this,e)},b.prototype.toArray=function(e){return z(this,e)},o.prototype.toArray=function(e){return z(this,e)},i.prototype.toString=function(a,t){if(a===e&&(a=10),10!==a)return K(this,a,t);for(var c,f=this.value,d=f.length,r=String(f[--d]);--d>=0;)c=String(f[d]),r+="0000000".slice(c.length)+c;return(this.sign?"-":"")+r},b.prototype.toString=function(a,t){return a===e&&(a=10),10!=a?K(this,a,t):String(this.value)},o.prototype.toString=b.prototype.toString,o.prototype.toJSON=i.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()},i.prototype.valueOf=function(){return parseInt(this.toString(),10)},i.prototype.toJSNumber=i.prototype.valueOf,b.prototype.valueOf=function(){return this.value},b.prototype.toJSNumber=b.prototype.valueOf,o.prototype.valueOf=o.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var J=0;J<1e3;J++)n[J]=Z(J),J>0&&(n[-J]=Z(-J));return n.one=n[1],n.zero=n[0],n.minusOne=n[-1],n.max=j,n.min=H,n.gcd=$,n.lcm=function(e,a){return e=Z(e).abs(),a=Z(a).abs(),e.divide($(e,a)).multiply(a)},n.isInstance=function(e){return e instanceof i||e instanceof b||e instanceof o},n.randBetween=function(e,t){var c=H(e=Z(e),t=Z(t)),f=j(e,t).subtract(c).add(1);if(f.isSmall)return c.add(Math.floor(Math.random()*f));for(var d=z(f,a).value,r=[],i=!0,b=0;b{const c=t(9565),f=t(71293),d=t(94148),r="undefined"!=typeof window;let n,i;r||(n=t(5183).Worker,i=t(91565));class b{constructor(){this.promise=new Promise(((e,a)=>{this.reject=a,this.resolve=e}))}}function o(e){let a,t,c;function f(e){for(;3&c[0];)c[0]++;const a=c[0];for(c[0]+=e;c[0]>t.buffer.byteLength;)t.grow(100);return c=new Uint32Array(t.buffer),a}function d(e){const a=f(e.byteLength),t=new Uint32Array(e);return c.set(t,a/4),a}function r(e,a){return t.buffer.slice(e,e+a)}e.onmessage=function(n){let i;if(i=n.data?n.data:n,"INIT"==i.command)(async function(e){const f=new Uint8Array(e.code),d=await WebAssembly.compile(f);t=new WebAssembly.Memory({initial:e.init}),c=new Uint32Array(t.buffer),a=await WebAssembly.instantiate(d,{env:{memory:t}})})(i).then((function(){e.postMessage(i.result)}));else if("G1_MULTIEXP"==i.command){const t=c[0],n=d(i.scalars),b=d(i.points),o=f(96);a.exports.g1_zero(o),a.exports.g1_multiexp2(n,b,i.n,7,o),i.result=r(o,96),c[0]=t,e.postMessage(i.result,[i.result])}else if("G2_MULTIEXP"==i.command){const t=c[0],n=d(i.scalars),b=d(i.points),o=f(192);a.exports.g2_zero(o),a.exports.g2_multiexp(n,b,i.n,7,o),i.result=r(o,192),c[0]=t,e.postMessage(i.result,[i.result])}else if("CALC_H"==i.command){const t=c[0],n=d(i.signals),b=d(i.polsA),o=d(i.polsB),s=i.nSignals,l=i.domainSize,u=f(32*s),h=f(32*l),p=f(32*l),g=f(32*l*2),m=f(32*l*2);a.exports.fft_toMontgomeryN(n,u,s),a.exports.pol_zero(h,l),a.exports.pol_zero(p,l),a.exports.pol_constructLC(b,u,s,h),a.exports.pol_constructLC(o,u,s,p),a.exports.fft_copyNInterleaved(h,g,l),a.exports.fft_copyNInterleaved(p,m,l),a.exports.fft_ifft(h,l,0),a.exports.fft_ifft(p,l,0),a.exports.fft_fft(h,l,1),a.exports.fft_fft(p,l,1),a.exports.fft_copyNInterleaved(h,g+32,l),a.exports.fft_copyNInterleaved(p,m+32,l),a.exports.fft_mulN(g,m,2*l,g),a.exports.fft_ifft(g,2*l,0),a.exports.fft_fromMontgomeryN(g+32*l,g+32*l,l),i.result=r(g+32*l,32*l),c[0]=t,e.postMessage(i.result,[i.result])}else"TERMINATE"==i.command&&process.exit()}}class s{constructor(){this.actionQueue=[]}postAction(e,a,t,c){return d(0==this.working[e]),this.working[e]=!0,this.pendingDeferreds[e]=c||new b,this.workers[e].postMessage(a,t),this.pendingDeferreds[e].promise}processWorks(){for(let e=0;e0;e++)if(0==this.working[e]){const a=this.actionQueue.shift();this.postAction(e,a.data,a.transfers,a.deferred)}}queueAction(e,a){const t=new b;return this.actionQueue.push({data:e,transfers:a,deferred:t}),this.processWorks(),t.promise}alloc(e){for(;3&this.i32[0];)this.i32[0]++;const a=this.i32[0];return this.i32[0]+=e,a}putBin(e,a){const t=new Uint32Array(a);this.i32.set(t,e/4)}getBin(e,a){return this.memory.buffer.slice(e,e+a)}bin2int(e){const a=new Uint32Array(e);let t=c(a[7]);for(let e=6;e>=0;e--)t=t.shiftLeft(32),t=t.add(a[e]);return t.toString()}bin2g1(e){return[this.bin2int(e.slice(0,32)),this.bin2int(e.slice(32,64)),this.bin2int(e.slice(64,96))]}bin2g2(e){return[[this.bin2int(e.slice(0,32)),this.bin2int(e.slice(32,64))],[this.bin2int(e.slice(64,96)),this.bin2int(e.slice(96,128))],[this.bin2int(e.slice(128,160)),this.bin2int(e.slice(160,192))]]}async g1_multiexp(e,a){const t=e.byteLength/32,c=Math.floor(t/this.workers.length),f=[];for(let d=0;dthis.g1_multiexp(e,v))),B=this.g1_multiexp(e.slice(0),m),L=this.g1_multiexp(e.slice(0),x),S=this.g2_multiexp(e.slice(0),y),k=this.g1_multiexp(e.slice(32*(f+1)),A),N=await Promise.all([B,L,S,k,M]),P=this.alloc(96),R=this.alloc(192),O=this.alloc(96),T=this.alloc(96);this.putBin(P,N[0]),this.putBin(T,N[1]),this.putBin(R,N[2]),this.putBin(O,N[3]);const D=this.loadPoint1(w),F=this.loadPoint1(_),Q=this.loadPoint1(I),U=this.loadPoint2(E),j=this.loadPoint2(C);let H=new Uint32Array(8);const $=this.alloc(96),q=this.alloc(192),G=this.alloc(32),z=this.alloc(32);if(r)window.crypto.getRandomValues(H),this.putBin(G,H),window.crypto.getRandomValues(H),this.putBin(z,H);else{const e=i.randomBytes(32);this.putBin(G,e);const a=i.randomBytes(32);this.putBin(z,a)}this.instance.exports.g1_add(D,P,P),this.instance.exports.g1_timesScalar(Q,G,32,$),this.instance.exports.g1_add($,P,P),this.instance.exports.g2_add(U,R,R),this.instance.exports.g2_timesScalar(j,z,32,q),this.instance.exports.g2_add(q,R,R),this.instance.exports.g1_add(F,T,T),this.instance.exports.g1_timesScalar(Q,z,32,$),this.instance.exports.g1_add($,T,T),this.putBin($,N[4]),this.instance.exports.g1_add($,O,O),this.instance.exports.g1_timesScalar(P,z,32,$),this.instance.exports.g1_add($,O,O),this.instance.exports.g1_timesScalar(T,G,32,$),this.instance.exports.g1_add($,O,O);const K=this.alloc(64);return this.instance.exports.int_mul(G,z,K),this.instance.exports.g1_timesScalar(Q,K,64,$),this.instance.exports.g1_neg($,$),this.instance.exports.g1_add($,O,O),this.instance.exports.g1_affine(P,P),this.instance.exports.g2_affine(R,R),this.instance.exports.g1_affine(O,O),this.instance.exports.g1_fromMontgomery(P,P),this.instance.exports.g2_fromMontgomery(R,R),this.instance.exports.g1_fromMontgomery(O,O),{pi_a:this.bin2g1(this.getBin(P,96)),pi_b:this.bin2g2(this.getBin(R,192)),pi_c:this.bin2g1(this.getBin(O,96))}}}e.exports=async function(e){const a={wasmInitialMemory:5e3};Object.assign(a,e);const t=new s;t.q=c("21888242871839275222246405745257275088696311157297823662689037894645226208583"),t.r=c("21888242871839275222246405745257275088548364400416034343698204186575808495617"),t.n64=Math.floor((t.q.minus(1).bitLength()-1)/64)+1,t.n32=2*t.n64,t.n8=8*t.n64,t.memory=new WebAssembly.Memory({initial:a.wasmInitialMemory}),t.i32=new Uint32Array(t.memory.buffer);const d=await WebAssembly.compile(f.code);let i;function b(e){return function(a){let c;c=a&&a.data?a.data:a,t.working[e]=!1,t.pendingDeferreds[e].resolve(c),t.processWorks()}}t.instance=await WebAssembly.instantiate(d,{env:{memory:t.memory}}),t.pq=f.pq,t.pr=f.pr,t.pr0=t.alloc(192),t.pr1=t.alloc(192),t.workers=[],t.pendingDeferreds=[],t.working=[],i="object"==typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:8;for(let e=0;e{const c=t(9565),f=t(98665),d=t(27351),r=t(56274).cL,n=(t(56274).XL,t(56274).ex,t(56274).Hf),i=t(73248).e,b=t(73248).H;e.exports={bigInt2BytesLE:function(e,a){const t=Array(a);let f=c(e);for(let e=0;efunction(e){let a=e.toString(16);for(;a.length<64;)a="0"+a;return a}(e))).join("")};return e.publicSignals&&(a.publicSignals=r(n(e.publicSignals))),a},genWitnessAndProve:async function(e,a,t,c){const r=function(e,a){const t=new f(b(a)),c=t.calculateWitness(b(e)),d=c.slice(1,t.nPubInputs+t.nOutputs+1);return{witness:c,publicSignals:d}}(a,t),n=function(e){const a=32*e.length,t=new ArrayBuffer(a),c={dataView:new DataView(t),offset:0},f=d(4294967295);for(let a=0;a{const c=t(9565);e.exports.ex=function e(a){if("bigint"==typeof a||a instanceof c)return a.toString(10);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a},e.exports.Hf=function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return c(a);if(Array.isArray(a))return a.map(e);if("object"!=typeof a||a instanceof c)return a;{const t={};for(let c in a)t[c]=e(a[c]);return t}},e.exports.cL=function e(a){if("bigInt"==typeof a||a instanceof c){let e=a.toString(16);for(;e.length<64;)e="0"+e;return e="0x"+e,e}if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a},e.exports.XL=function e(a){if("string"==typeof a&&/^0x[0-9a-fA-F]+$/.test(a))return c(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){const t={};for(let c in a)t[c]=e(a[c]);return t}return a}},63282:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MissingRefError=a.ValidationError=a.CodeGen=a.Name=a.nil=a.stringify=a.str=a._=a.KeywordCxt=a.Ajv=void 0;const c=t(4042),f=t(86144),d=t(36653),r=t(72079),n=["/properties"],i="http://json-schema.org/draft-07/schema";class b extends c.default{_addVocabularies(){super._addVocabularies(),f.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(d.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(r,n):r;this.addMetaSchema(e,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}a.Ajv=b,e.exports=a=b,e.exports.Ajv=b,Object.defineProperty(a,"__esModule",{value:!0}),a.default=b;var o=t(62586);Object.defineProperty(a,"KeywordCxt",{enumerable:!0,get:function(){return o.KeywordCxt}});var s=t(99029);Object.defineProperty(a,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(a,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});var l=t(13558);Object.defineProperty(a,"ValidationError",{enumerable:!0,get:function(){return l.default}});var u=t(34551);Object.defineProperty(a,"MissingRefError",{enumerable:!0,get:function(){return u.default}})},41520:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.regexpCode=a.getEsmExportName=a.getProperty=a.safeStringify=a.stringify=a.strConcat=a.addCodeArg=a.str=a._=a.nil=a._Code=a.Name=a.IDENTIFIER=a._CodeOrName=void 0;class t{}a._CodeOrName=t,a.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class c extends t{constructor(e){if(super(),!a.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}a.Name=c;class f extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,a)=>`${e}${a}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,a)=>(a instanceof c&&(e[a.str]=(e[a.str]||0)+1),e)),{})}}function d(e,...a){const t=[e[0]];let c=0;for(;c{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.or=a.and=a.not=a.CodeGen=a.operators=a.varKinds=a.ValueScopeName=a.ValueScope=a.Scope=a.Name=a.regexpCode=a.stringify=a.getProperty=a.nil=a.strConcat=a.str=a._=void 0;const c=t(41520),f=t(57845);var d=t(41520);Object.defineProperty(a,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(a,"strConcat",{enumerable:!0,get:function(){return d.strConcat}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(a,"getProperty",{enumerable:!0,get:function(){return d.getProperty}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(a,"regexpCode",{enumerable:!0,get:function(){return d.regexpCode}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return d.Name}});var r=t(57845);Object.defineProperty(a,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(a,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(a,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(a,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),a.operators={GT:new c._Code(">"),GTE:new c._Code(">="),LT:new c._Code("<"),LTE:new c._Code("<="),EQ:new c._Code("==="),NEQ:new c._Code("!=="),NOT:new c._Code("!"),OR:new c._Code("||"),AND:new c._Code("&&"),ADD:new c._Code("+")};class n{optimizeNodes(){return this}optimizeNames(e,a){return this}}class i extends n{constructor(e,a,t){super(),this.varKind=e,this.name=a,this.rhs=t}render({es5:e,_n:a}){const t=e?f.varKinds.var:this.varKind,c=void 0===this.rhs?"":` = ${this.rhs}`;return`${t} ${this.name}${c};`+a}optimizeNames(e,a){if(e[this.name.str])return this.rhs&&(this.rhs=k(this.rhs,e,a)),this}get names(){return this.rhs instanceof c._CodeOrName?this.rhs.names:{}}}class b extends n{constructor(e,a,t){super(),this.lhs=e,this.rhs=a,this.sideEffects=t}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,a){if(!(this.lhs instanceof c.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=k(this.rhs,e,a),this}get names(){return S(this.lhs instanceof c.Name?{}:{...this.lhs.names},this.rhs)}}class o extends b{constructor(e,a,t,c){super(e,t,c),this.op=a}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class s extends n{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class l extends n{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class u extends n{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class h extends n{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,a){return this.code=k(this.code,e,a),this}get names(){return this.code instanceof c._CodeOrName?this.code.names:{}}}class p extends n{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((a,t)=>a+t.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let a=e.length;for(;a--;){const t=e[a].optimizeNodes();Array.isArray(t)?e.splice(a,1,...t):t?e[a]=t:e.splice(a,1)}return e.length>0?this:void 0}optimizeNames(e,a){const{nodes:t}=this;let c=t.length;for(;c--;){const f=t[c];f.optimizeNames(e,a)||(N(e,f.names),t.splice(c,1))}return t.length>0?this:void 0}get names(){return this.nodes.reduce(((e,a)=>L(e,a.names)),{})}}class g extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends p{}class x extends g{}x.kind="else";class y extends g{constructor(e,a){super(a),this.condition=e}render(e){let a=`if(${this.condition})`+super.render(e);return this.else&&(a+="else "+this.else.render(e)),a}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let a=this.else;if(a){const e=a.optimizeNodes();a=this.else=Array.isArray(e)?new x(e):e}return a?!1===e?a instanceof y?a:a.nodes:this.nodes.length?this:new y(P(e),a instanceof y?[a]:a.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,a){var t;if(this.else=null===(t=this.else)||void 0===t?void 0:t.optimizeNames(e,a),super.optimizeNames(e,a)||this.else)return this.condition=k(this.condition,e,a),this}get names(){const e=super.names;return S(e,this.condition),this.else&&L(e,this.else.names),e}}y.kind="if";class A extends g{}A.kind="for";class v extends A{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,a){if(super.optimizeNames(e,a))return this.iteration=k(this.iteration,e,a),this}get names(){return L(super.names,this.iteration.names)}}class w extends A{constructor(e,a,t,c){super(),this.varKind=e,this.name=a,this.from=t,this.to=c}render(e){const a=e.es5?f.varKinds.var:this.varKind,{name:t,from:c,to:d}=this;return`for(${a} ${t}=${c}; ${t}<${d}; ${t}++)`+super.render(e)}get names(){const e=S(super.names,this.from);return S(e,this.to)}}class _ extends A{constructor(e,a,t,c){super(),this.loop=e,this.varKind=a,this.name=t,this.iterable=c}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,a){if(super.optimizeNames(e,a))return this.iterable=k(this.iterable,e,a),this}get names(){return L(super.names,this.iterable.names)}}class I extends g{constructor(e,a,t){super(),this.name=e,this.args=a,this.async=t}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}I.kind="func";class E extends p{render(e){return"return "+super.render(e)}}E.kind="return";class C extends g{render(e){let a="try"+super.render(e);return this.catch&&(a+=this.catch.render(e)),this.finally&&(a+=this.finally.render(e)),a}optimizeNodes(){var e,a;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(a=this.finally)||void 0===a||a.optimizeNodes(),this}optimizeNames(e,a){var t,c;return super.optimizeNames(e,a),null===(t=this.catch)||void 0===t||t.optimizeNames(e,a),null===(c=this.finally)||void 0===c||c.optimizeNames(e,a),this}get names(){const e=super.names;return this.catch&&L(e,this.catch.names),this.finally&&L(e,this.finally.names),e}}class M extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}M.kind="catch";class B extends g{render(e){return"finally"+super.render(e)}}function L(e,a){for(const t in a)e[t]=(e[t]||0)+(a[t]||0);return e}function S(e,a){return a instanceof c._CodeOrName?L(e,a.names):e}function k(e,a,t){return e instanceof c.Name?d(e):(f=e)instanceof c._Code&&f._items.some((e=>e instanceof c.Name&&1===a[e.str]&&void 0!==t[e.str]))?new c._Code(e._items.reduce(((e,a)=>(a instanceof c.Name&&(a=d(a)),a instanceof c._Code?e.push(...a._items):e.push(a),e)),[])):e;var f;function d(e){const c=t[e.str];return void 0===c||1!==a[e.str]?e:(delete a[e.str],c)}}function N(e,a){for(const t in a)e[t]=(e[t]||0)-(a[t]||0)}function P(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:c._`!${D(e)}`}B.kind="finally",a.CodeGen=class{constructor(e,a={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...a,_n:a.lines?"\n":""},this._extScope=e,this._scope=new f.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,a){const t=this._extScope.value(e,a);return(this._values[t.prefix]||(this._values[t.prefix]=new Set)).add(t),t}getScopeValue(e,a){return this._extScope.getValue(e,a)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,a,t,c){const f=this._scope.toName(a);return void 0!==t&&c&&(this._constants[f.str]=t),this._leafNode(new i(e,f,t)),f}const(e,a,t){return this._def(f.varKinds.const,e,a,t)}let(e,a,t){return this._def(f.varKinds.let,e,a,t)}var(e,a,t){return this._def(f.varKinds.var,e,a,t)}assign(e,a,t){return this._leafNode(new b(e,a,t))}add(e,t){return this._leafNode(new o(e,a.operators.ADD,t))}code(e){return"function"==typeof e?e():e!==c.nil&&this._leafNode(new h(e)),this}object(...e){const a=["{"];for(const[t,f]of e)a.length>1&&a.push(","),a.push(t),(t!==f||this.opts.es5)&&(a.push(":"),(0,c.addCodeArg)(a,f));return a.push("}"),new c._Code(a)}if(e,a,t){if(this._blockNode(new y(e)),a&&t)this.code(a).else().code(t).endIf();else if(a)this.code(a).endIf();else if(t)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new x)}endIf(){return this._endBlockNode(y,x)}_for(e,a){return this._blockNode(e),a&&this.code(a).endFor(),this}for(e,a){return this._for(new v(e),a)}forRange(e,a,t,c,d=(this.opts.es5?f.varKinds.var:f.varKinds.let)){const r=this._scope.toName(e);return this._for(new w(d,r,a,t),(()=>c(r)))}forOf(e,a,t,d=f.varKinds.const){const r=this._scope.toName(e);if(this.opts.es5){const e=a instanceof c.Name?a:this.var("_arr",a);return this.forRange("_i",0,c._`${e}.length`,(a=>{this.var(r,c._`${e}[${a}]`),t(r)}))}return this._for(new _("of",d,r,a),(()=>t(r)))}forIn(e,a,t,d=(this.opts.es5?f.varKinds.var:f.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,c._`Object.keys(${a})`,t);const r=this._scope.toName(e);return this._for(new _("in",d,r,a),(()=>t(r)))}endFor(){return this._endBlockNode(A)}label(e){return this._leafNode(new s(e))}break(e){return this._leafNode(new l(e))}return(e){const a=new E;if(this._blockNode(a),this.code(e),1!==a.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,a,t){if(!a&&!t)throw new Error('CodeGen: "try" without "catch" and "finally"');const c=new C;if(this._blockNode(c),this.code(e),a){const e=this.name("e");this._currNode=c.catch=new M(e),a(e)}return t&&(this._currNode=c.finally=new B,this.code(t)),this._endBlockNode(M,B)}throw(e){return this._leafNode(new u(e))}block(e,a){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(a),this}endBlock(e){const a=this._blockStarts.pop();if(void 0===a)throw new Error("CodeGen: not in self-balancing block");const t=this._nodes.length-a;if(t<0||void 0!==e&&t!==e)throw new Error(`CodeGen: wrong number of nodes: ${t} vs ${e} expected`);return this._nodes.length=a,this}func(e,a=c.nil,t,f){return this._blockNode(new I(e,a,t)),f&&this.code(f).endFunc(),this}endFunc(){return this._endBlockNode(I)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,a){const t=this._currNode;if(t instanceof e||a&&t instanceof a)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${a?`${e.kind}/${a.kind}`:e.kind}"`)}_elseNode(e){const a=this._currNode;if(!(a instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=a.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const a=this._nodes;a[a.length-1]=e}},a.not=P;const R=T(a.operators.AND);a.and=function(...e){return e.reduce(R)};const O=T(a.operators.OR);function T(e){return(a,t)=>a===c.nil?t:t===c.nil?a:c._`${D(a)} ${e} ${D(t)}`}function D(e){return e instanceof c.Name?e:c._`(${e})`}a.or=function(...e){return e.reduce(O)}},57845:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ValueScope=a.ValueScopeName=a.Scope=a.varKinds=a.UsedValueState=void 0;const c=t(41520);class f extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var d;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(d||(a.UsedValueState=d={})),a.varKinds={const:new c.Name("const"),let:new c.Name("let"),var:new c.Name("var")};class r{constructor({prefixes:e,parent:a}={}){this._names={},this._prefixes=e,this._parent=a}toName(e){return e instanceof c.Name?e:this.name(e)}name(e){return new c.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var a,t;if((null===(t=null===(a=this._parent)||void 0===a?void 0:a._prefixes)||void 0===t?void 0:t.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}a.Scope=r;class n extends c.Name{constructor(e,a){super(a),this.prefix=e}setValue(e,{property:a,itemIndex:t}){this.value=e,this.scopePath=c._`.${new c.Name(a)}[${t}]`}}a.ValueScopeName=n;const i=c._`\n`;a.ValueScope=class extends r{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?i:c.nil}}get(){return this._scope}name(e){return new n(e,this._newName(e))}value(e,a){var t;if(void 0===a.ref)throw new Error("CodeGen: ref must be passed in value");const c=this.toName(e),{prefix:f}=c,d=null!==(t=a.key)&&void 0!==t?t:a.ref;let r=this._values[f];if(r){const e=r.get(d);if(e)return e}else r=this._values[f]=new Map;r.set(d,c);const n=this._scope[f]||(this._scope[f]=[]),i=n.length;return n[i]=a.ref,c.setValue(a,{property:f,itemIndex:i}),c}getValue(e,a){const t=this._values[e];if(t)return t.get(a)}scopeRefs(e,a=this._values){return this._reduceValues(a,(a=>{if(void 0===a.scopePath)throw new Error(`CodeGen: name "${a}" has no value`);return c._`${e}${a.scopePath}`}))}scopeCode(e=this._values,a,t){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),a,t)}_reduceValues(e,t,r={},n){let i=c.nil;for(const b in e){const o=e[b];if(!o)continue;const s=r[b]=r[b]||new Map;o.forEach((e=>{if(s.has(e))return;s.set(e,d.Started);let r=t(e);if(r){const t=this.opts.es5?a.varKinds.var:a.varKinds.const;i=c._`${i}${t} ${e} = ${r};${this.opts._n}`}else{if(!(r=null==n?void 0:n(e)))throw new f(e);i=c._`${i}${r}${this.opts._n}`}s.set(e,d.Completed)}))}return i}}},48708:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extendErrors=a.resetErrorsCount=a.reportExtraError=a.reportError=a.keyword$DataError=a.keywordError=void 0;const c=t(99029),f=t(94227),d=t(42023);function r(e,a){const t=e.const("err",a);e.if(c._`${d.default.vErrors} === null`,(()=>e.assign(d.default.vErrors,c._`[${t}]`)),c._`${d.default.vErrors}.push(${t})`),e.code(c._`${d.default.errors}++`)}function n(e,a){const{gen:t,validateName:f,schemaEnv:d}=e;d.$async?t.throw(c._`new ${e.ValidationError}(${a})`):(t.assign(c._`${f}.errors`,a),t.return(!1))}a.keywordError={message:({keyword:e})=>c.str`must pass "${e}" keyword validation`},a.keyword$DataError={message:({keyword:e,schemaType:a})=>a?c.str`"${e}" keyword must be ${a} ($data)`:c.str`"${e}" keyword is invalid ($data)`},a.reportError=function(e,t=a.keywordError,f,d){const{it:i}=e,{gen:o,compositeRule:s,allErrors:l}=i,u=b(e,t,f);(null!=d?d:s||l)?r(o,u):n(i,c._`[${u}]`)},a.reportExtraError=function(e,t=a.keywordError,c){const{it:f}=e,{gen:i,compositeRule:o,allErrors:s}=f;r(i,b(e,t,c)),o||s||n(f,d.default.vErrors)},a.resetErrorsCount=function(e,a){e.assign(d.default.errors,a),e.if(c._`${d.default.vErrors} !== null`,(()=>e.if(a,(()=>e.assign(c._`${d.default.vErrors}.length`,a)),(()=>e.assign(d.default.vErrors,null)))))},a.extendErrors=function({gen:e,keyword:a,schemaValue:t,data:f,errsCount:r,it:n}){if(void 0===r)throw new Error("ajv implementation error");const i=e.name("err");e.forRange("i",r,d.default.errors,(r=>{e.const(i,c._`${d.default.vErrors}[${r}]`),e.if(c._`${i}.instancePath === undefined`,(()=>e.assign(c._`${i}.instancePath`,(0,c.strConcat)(d.default.instancePath,n.errorPath)))),e.assign(c._`${i}.schemaPath`,c.str`${n.errSchemaPath}/${a}`),n.opts.verbose&&(e.assign(c._`${i}.schema`,t),e.assign(c._`${i}.data`,f))}))};const i={keyword:new c.Name("keyword"),schemaPath:new c.Name("schemaPath"),params:new c.Name("params"),propertyName:new c.Name("propertyName"),message:new c.Name("message"),schema:new c.Name("schema"),parentSchema:new c.Name("parentSchema")};function b(e,a,t){const{createErrors:f}=e.it;return!1===f?c._`{}`:function(e,a,t={}){const{gen:f,it:r}=e,n=[o(r,t),s(e,t)];return function(e,{params:a,message:t},f){const{keyword:r,data:n,schemaValue:b,it:o}=e,{opts:s,propertyName:l,topSchemaRef:u,schemaPath:h}=o;f.push([i.keyword,r],[i.params,"function"==typeof a?a(e):a||c._`{}`]),s.messages&&f.push([i.message,"function"==typeof t?t(e):t]),s.verbose&&f.push([i.schema,b],[i.parentSchema,c._`${u}${h}`],[d.default.data,n]),l&&f.push([i.propertyName,l])}(e,a,n),f.object(...n)}(e,a,t)}function o({errorPath:e},{instancePath:a}){const t=a?c.str`${e}${(0,f.getErrorPath)(a,f.Type.Str)}`:e;return[d.default.instancePath,(0,c.strConcat)(d.default.instancePath,t)]}function s({keyword:e,it:{errSchemaPath:a}},{schemaPath:t,parentSchema:d}){let r=d?a:c.str`${a}/${e}`;return t&&(r=c.str`${r}${(0,f.getErrorPath)(t,f.Type.Str)}`),[i.schemaPath,r]}},73835:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.resolveSchema=a.getCompilingSchema=a.resolveRef=a.compileSchema=a.SchemaEnv=void 0;const c=t(99029),f=t(13558),d=t(42023),r=t(66939),n=t(94227),i=t(62586);class b{constructor(e){var a;let t;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(a=e.baseId)&&void 0!==a?a:(0,r.normalizeId)(null==t?void 0:t[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==t?void 0:t.$async,this.refs={}}}function o(e){const a=l.call(this,e);if(a)return a;const t=(0,r.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:b}=this.opts.code,{ownProperties:o}=this.opts,s=new c.CodeGen(this.scope,{es5:n,lines:b,ownProperties:o});let u;e.$async&&(u=s.scopeValue("Error",{ref:f.default,code:c._`require("ajv/dist/runtime/validation_error").default`}));const h=s.scopeName("validate");e.validateName=h;const p={gen:s,allErrors:this.opts.allErrors,data:d.default.data,parentData:d.default.parentData,parentDataProperty:d.default.parentDataProperty,dataNames:[d.default.data],dataPathArr:[c.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,c.stringify)(e.schema)}:{ref:e.schema}),validateName:h,ValidationError:u,schema:e.schema,schemaEnv:e,rootId:t,baseId:e.baseId||t,schemaPath:c.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:c._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,i.validateFunctionCode)(p),s.optimize(this.opts.code.optimize);const a=s.toString();g=`${s.scopeRefs(d.default.scope)}return ${a}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const t=new Function(`${d.default.self}`,`${d.default.scope}`,g)(this,this.scope.get());if(this.scope.value(h,{ref:t}),t.errors=null,t.schema=e.schema,t.schemaEnv=e,e.$async&&(t.$async=!0),!0===this.opts.code.source&&(t.source={validateName:h,validateCode:a,scopeValues:s._values}),this.opts.unevaluated){const{props:e,items:a}=p;t.evaluated={props:e instanceof c.Name?void 0:e,items:a instanceof c.Name?void 0:a,dynamicProps:e instanceof c.Name,dynamicItems:a instanceof c.Name},t.source&&(t.source.evaluated=(0,c.stringify)(t.evaluated))}return e.validate=t,e}catch(a){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),a}finally{this._compilations.delete(e)}}function s(e){return(0,r.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:o.call(this,e)}function l(e){for(const c of this._compilations)if(t=e,(a=c).schema===t.schema&&a.root===t.root&&a.baseId===t.baseId)return c;var a,t}function u(e,a){let t;for(;"string"==typeof(t=this.refs[a]);)a=t;return t||this.schemas[a]||h.call(this,e,a)}function h(e,a){const t=this.opts.uriResolver.parse(a),c=(0,r._getFullPath)(this.opts.uriResolver,t);let f=(0,r.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&c===f)return g.call(this,t,e);const d=(0,r.normalizeId)(c),n=this.refs[d]||this.schemas[d];if("string"==typeof n){const a=h.call(this,e,n);if("object"!=typeof(null==a?void 0:a.schema))return;return g.call(this,t,a)}if("object"==typeof(null==n?void 0:n.schema)){if(n.validate||o.call(this,n),d===(0,r.normalizeId)(a)){const{schema:a}=n,{schemaId:t}=this.opts,c=a[t];return c&&(f=(0,r.resolveUrl)(this.opts.uriResolver,f,c)),new b({schema:a,schemaId:t,root:e,baseId:f})}return g.call(this,t,n)}}a.SchemaEnv=b,a.compileSchema=o,a.resolveRef=function(e,a,t){var c;t=(0,r.resolveUrl)(this.opts.uriResolver,a,t);const f=e.refs[t];if(f)return f;let d=u.call(this,e,t);if(void 0===d){const f=null===(c=e.localRefs)||void 0===c?void 0:c[t],{schemaId:r}=this.opts;f&&(d=new b({schema:f,schemaId:r,root:e,baseId:a}))}return void 0!==d?e.refs[t]=s.call(this,d):void 0},a.getCompilingSchema=l,a.resolveSchema=h;const p=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:a,schema:t,root:c}){var f;if("/"!==(null===(f=e.fragment)||void 0===f?void 0:f[0]))return;for(const c of e.fragment.slice(1).split("/")){if("boolean"==typeof t)return;const e=t[(0,n.unescapeFragment)(c)];if(void 0===e)return;const f="object"==typeof(t=e)&&t[this.opts.schemaId];!p.has(c)&&f&&(a=(0,r.resolveUrl)(this.opts.uriResolver,a,f))}let d;if("boolean"!=typeof t&&t.$ref&&!(0,n.schemaHasRulesButRef)(t,this.RULES)){const e=(0,r.resolveUrl)(this.opts.uriResolver,a,t.$ref);d=h.call(this,c,e)}const{schemaId:i}=this.opts;return d=d||new b({schema:t,schemaId:i,root:c,baseId:a}),d.schema!==d.root.schema?d:void 0}},42023:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={data:new c.Name("data"),valCxt:new c.Name("valCxt"),instancePath:new c.Name("instancePath"),parentData:new c.Name("parentData"),parentDataProperty:new c.Name("parentDataProperty"),rootData:new c.Name("rootData"),dynamicAnchors:new c.Name("dynamicAnchors"),vErrors:new c.Name("vErrors"),errors:new c.Name("errors"),this:new c.Name("this"),self:new c.Name("self"),scope:new c.Name("scope"),json:new c.Name("json"),jsonPos:new c.Name("jsonPos"),jsonLen:new c.Name("jsonLen"),jsonPart:new c.Name("jsonPart")};a.default=f},34551:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(66939);class f extends Error{constructor(e,a,t,f){super(f||`can't resolve reference ${t} from id ${a}`),this.missingRef=(0,c.resolveUrl)(e,a,t),this.missingSchema=(0,c.normalizeId)((0,c.getFullPath)(e,this.missingRef))}}a.default=f},66939:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getSchemaRefs=a.resolveUrl=a.normalizeId=a._getFullPath=a.getFullPath=a.inlineRef=void 0;const c=t(94227),f=t(32017),d=t(7106),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);a.inlineRef=function(e,a=!0){return"boolean"==typeof e||(!0===a?!i(e):!!a&&b(e)<=a)};const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(e){for(const a in e){if(n.has(a))return!0;const t=e[a];if(Array.isArray(t)&&t.some(i))return!0;if("object"==typeof t&&i(t))return!0}return!1}function b(e){let a=0;for(const t in e){if("$ref"===t)return 1/0;if(a++,!r.has(t)&&("object"==typeof e[t]&&(0,c.eachItem)(e[t],(e=>a+=b(e))),a===1/0))return 1/0}return a}function o(e,a="",t){!1!==t&&(a=u(a));const c=e.parse(a);return s(e,c)}function s(e,a){return e.serialize(a).split("#")[0]+"#"}a.getFullPath=o,a._getFullPath=s;const l=/#\/?$/;function u(e){return e?e.replace(l,""):""}a.normalizeId=u,a.resolveUrl=function(e,a,t){return t=u(t),e.resolve(a,t)};const h=/^[a-z_][-a-z0-9._]*$/i;a.getSchemaRefs=function(e,a){if("boolean"==typeof e)return{};const{schemaId:t,uriResolver:c}=this.opts,r=u(e[t]||a),n={"":r},i=o(c,r,!1),b={},s=new Set;return d(e,{allKeys:!0},((e,a,c,f)=>{if(void 0===f)return;const d=i+a;let r=n[f];function o(a){const t=this.opts.uriResolver.resolve;if(a=u(r?t(r,a):a),s.has(a))throw p(a);s.add(a);let c=this.refs[a];return"string"==typeof c&&(c=this.refs[c]),"object"==typeof c?l(e,c.schema,a):a!==u(d)&&("#"===a[0]?(l(e,b[a],a),b[a]=e):this.refs[a]=d),a}function g(e){if("string"==typeof e){if(!h.test(e))throw new Error(`invalid anchor "${e}"`);o.call(this,`#${e}`)}}"string"==typeof e[t]&&(r=o.call(this,e[t])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),n[a]=r})),b;function l(e,a,t){if(void 0!==a&&!f(e,a))throw p(t)}function p(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},10396:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getRules=a.isJSONType=void 0;const t=new Set(["string","number","integer","boolean","null","object","array"]);a.isJSONType=function(e){return"string"==typeof e&&t.has(e)},a.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},94227:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.checkStrictMode=a.getErrorPath=a.Type=a.useFunc=a.setEvaluated=a.evaluatedPropsToName=a.mergeEvaluated=a.eachItem=a.unescapeJsonPointer=a.escapeJsonPointer=a.escapeFragment=a.unescapeFragment=a.schemaRefOrVal=a.schemaHasRulesButRef=a.schemaHasRules=a.checkUnknownRules=a.alwaysValidSchema=a.toHash=void 0;const c=t(99029),f=t(41520);function d(e,a=e.schema){const{opts:t,self:c}=e;if(!t.strictSchema)return;if("boolean"==typeof a)return;const f=c.RULES.keywords;for(const t in a)f[t]||h(e,`unknown keyword: "${t}"`)}function r(e,a){if("boolean"==typeof e)return!e;for(const t in e)if(a[t])return!0;return!1}function n(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function i(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function b({mergeNames:e,mergeToName:a,mergeValues:t,resultToName:f}){return(d,r,n,i)=>{const b=void 0===n?r:n instanceof c.Name?(r instanceof c.Name?e(d,r,n):a(d,r,n),n):r instanceof c.Name?(a(d,n,r),r):t(r,n);return i!==c.Name||b instanceof c.Name?b:f(d,b)}}function o(e,a){if(!0===a)return e.var("props",!0);const t=e.var("props",c._`{}`);return void 0!==a&&s(e,t,a),t}function s(e,a,t){Object.keys(t).forEach((t=>e.assign(c._`${a}${(0,c.getProperty)(t)}`,!0)))}a.toHash=function(e){const a={};for(const t of e)a[t]=!0;return a},a.alwaysValidSchema=function(e,a){return"boolean"==typeof a?a:0===Object.keys(a).length||(d(e,a),!r(a,e.self.RULES.all))},a.checkUnknownRules=d,a.schemaHasRules=r,a.schemaHasRulesButRef=function(e,a){if("boolean"==typeof e)return!e;for(const t in e)if("$ref"!==t&&a.all[t])return!0;return!1},a.schemaRefOrVal=function({topSchemaRef:e,schemaPath:a},t,f,d){if(!d){if("number"==typeof t||"boolean"==typeof t)return t;if("string"==typeof t)return c._`${t}`}return c._`${e}${a}${(0,c.getProperty)(f)}`},a.unescapeFragment=function(e){return i(decodeURIComponent(e))},a.escapeFragment=function(e){return encodeURIComponent(n(e))},a.escapeJsonPointer=n,a.unescapeJsonPointer=i,a.eachItem=function(e,a){if(Array.isArray(e))for(const t of e)a(t);else a(e)},a.mergeEvaluated={props:b({mergeNames:(e,a,t)=>e.if(c._`${t} !== true && ${a} !== undefined`,(()=>{e.if(c._`${a} === true`,(()=>e.assign(t,!0)),(()=>e.assign(t,c._`${t} || {}`).code(c._`Object.assign(${t}, ${a})`)))})),mergeToName:(e,a,t)=>e.if(c._`${t} !== true`,(()=>{!0===a?e.assign(t,!0):(e.assign(t,c._`${t} || {}`),s(e,t,a))})),mergeValues:(e,a)=>!0===e||{...e,...a},resultToName:o}),items:b({mergeNames:(e,a,t)=>e.if(c._`${t} !== true && ${a} !== undefined`,(()=>e.assign(t,c._`${a} === true ? true : ${t} > ${a} ? ${t} : ${a}`))),mergeToName:(e,a,t)=>e.if(c._`${t} !== true`,(()=>e.assign(t,!0===a||c._`${t} > ${a} ? ${t} : ${a}`))),mergeValues:(e,a)=>!0===e||Math.max(e,a),resultToName:(e,a)=>e.var("items",a)})},a.evaluatedPropsToName=o,a.setEvaluated=s;const l={};var u;function h(e,a,t=e.opts.strictSchema){if(t){if(a=`strict mode: ${a}`,!0===t)throw new Error(a);e.self.logger.warn(a)}}a.useFunc=function(e,a){return e.scopeValue("func",{ref:a,code:l[a.code]||(l[a.code]=new f._Code(a.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(u||(a.Type=u={})),a.getErrorPath=function(e,a,t){if(e instanceof c.Name){const f=a===u.Num;return t?f?c._`"[" + ${e} + "]"`:c._`"['" + ${e} + "']"`:f?c._`"/" + ${e}`:c._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,c.getProperty)(e).toString():"/"+n(e)},a.checkStrictMode=h},7887:(e,a)=>{"use strict";function t(e,a){return a.rules.some((a=>c(e,a)))}function c(e,a){var t;return void 0!==e[a.keyword]||(null===(t=a.definition.implements)||void 0===t?void 0:t.some((a=>void 0!==e[a])))}Object.defineProperty(a,"__esModule",{value:!0}),a.shouldUseRule=a.shouldUseGroup=a.schemaHasRulesForType=void 0,a.schemaHasRulesForType=function({schema:e,self:a},c){const f=a.RULES.types[c];return f&&!0!==f&&t(e,f)},a.shouldUseGroup=t,a.shouldUseRule=c},28727:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.boolOrEmptySchema=a.topBoolOrEmptySchema=void 0;const c=t(48708),f=t(99029),d=t(42023),r={message:"boolean schema is false"};function n(e,a){const{gen:t,data:f}=e,d={gen:t,keyword:"false schema",data:f,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,c.reportError)(d,r,void 0,a)}a.topBoolOrEmptySchema=function(e){const{gen:a,schema:t,validateName:c}=e;!1===t?n(e,!1):"object"==typeof t&&!0===t.$async?a.return(d.default.data):(a.assign(f._`${c}.errors`,null),a.return(!0))},a.boolOrEmptySchema=function(e,a){const{gen:t,schema:c}=e;!1===c?(t.var(a,!1),n(e)):t.var(a,!0)}},10208:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.reportTypeError=a.checkDataTypes=a.checkDataType=a.coerceAndCheckDataType=a.getJSONTypes=a.getSchemaTypes=a.DataType=void 0;const c=t(10396),f=t(7887),d=t(48708),r=t(99029),n=t(94227);var i;function b(e){const a=Array.isArray(e)?e:e?[e]:[];if(a.every(c.isJSONType))return a;throw new Error("type must be JSONType or JSONType[]: "+a.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(i||(a.DataType=i={})),a.getSchemaTypes=function(e){const a=b(e.type);if(a.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!a.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&a.push("null")}return a},a.getJSONTypes=b,a.coerceAndCheckDataType=function(e,a){const{gen:t,data:c,opts:d}=e,n=function(e,a){return a?e.filter((e=>o.has(e)||"array"===a&&"array"===e)):[]}(a,d.coerceTypes),b=a.length>0&&!(0===n.length&&1===a.length&&(0,f.schemaHasRulesForType)(e,a[0]));if(b){const f=l(a,c,d.strictNumbers,i.Wrong);t.if(f,(()=>{n.length?function(e,a,t){const{gen:c,data:f,opts:d}=e,n=c.let("dataType",r._`typeof ${f}`),i=c.let("coerced",r._`undefined`);"array"===d.coerceTypes&&c.if(r._`${n} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,(()=>c.assign(f,r._`${f}[0]`).assign(n,r._`typeof ${f}`).if(l(a,f,d.strictNumbers),(()=>c.assign(i,f))))),c.if(r._`${i} !== undefined`);for(const e of t)(o.has(e)||"array"===e&&"array"===d.coerceTypes)&&b(e);function b(e){switch(e){case"string":return void c.elseIf(r._`${n} == "number" || ${n} == "boolean"`).assign(i,r._`"" + ${f}`).elseIf(r._`${f} === null`).assign(i,r._`""`);case"number":return void c.elseIf(r._`${n} == "boolean" || ${f} === null || (${n} == "string" && ${f} && ${f} == +${f})`).assign(i,r._`+${f}`);case"integer":return void c.elseIf(r._`${n} === "boolean" || ${f} === null || (${n} === "string" && ${f} && ${f} == +${f} && !(${f} % 1))`).assign(i,r._`+${f}`);case"boolean":return void c.elseIf(r._`${f} === "false" || ${f} === 0 || ${f} === null`).assign(i,!1).elseIf(r._`${f} === "true" || ${f} === 1`).assign(i,!0);case"null":return c.elseIf(r._`${f} === "" || ${f} === 0 || ${f} === false`),void c.assign(i,null);case"array":c.elseIf(r._`${n} === "string" || ${n} === "number" || ${n} === "boolean" || ${f} === null`).assign(i,r._`[${f}]`)}}c.else(),h(e),c.endIf(),c.if(r._`${i} !== undefined`,(()=>{c.assign(f,i),function({gen:e,parentData:a,parentDataProperty:t},c){e.if(r._`${a} !== undefined`,(()=>e.assign(r._`${a}[${t}]`,c)))}(e,i)}))}(e,a,n):h(e)}))}return b};const o=new Set(["string","number","integer","boolean","null"]);function s(e,a,t,c=i.Correct){const f=c===i.Correct?r.operators.EQ:r.operators.NEQ;let d;switch(e){case"null":return r._`${a} ${f} null`;case"array":d=r._`Array.isArray(${a})`;break;case"object":d=r._`${a} && typeof ${a} == "object" && !Array.isArray(${a})`;break;case"integer":d=n(r._`!(${a} % 1) && !isNaN(${a})`);break;case"number":d=n();break;default:return r._`typeof ${a} ${f} ${e}`}return c===i.Correct?d:(0,r.not)(d);function n(e=r.nil){return(0,r.and)(r._`typeof ${a} == "number"`,e,t?r._`isFinite(${a})`:r.nil)}}function l(e,a,t,c){if(1===e.length)return s(e[0],a,t,c);let f;const d=(0,n.toHash)(e);if(d.array&&d.object){const e=r._`typeof ${a} != "object"`;f=d.null?e:r._`!${a} || ${e}`,delete d.null,delete d.array,delete d.object}else f=r.nil;d.number&&delete d.integer;for(const e in d)f=(0,r.and)(f,s(e,a,t,c));return f}a.checkDataType=s,a.checkDataTypes=l;const u={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:a})=>"string"==typeof e?r._`{type: ${e}}`:r._`{type: ${a}}`};function h(e){const a=function(e){const{gen:a,data:t,schema:c}=e,f=(0,n.schemaRefOrVal)(e,c,"type");return{gen:a,keyword:"type",data:t,schema:c.type,schemaCode:f,schemaValue:f,parentSchema:c,params:{},it:e}}(e);(0,d.reportError)(a,u)}a.reportTypeError=h},7870:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.assignDefaults=void 0;const c=t(99029),f=t(94227);function d(e,a,t){const{gen:d,compositeRule:r,data:n,opts:i}=e;if(void 0===t)return;const b=c._`${n}${(0,c.getProperty)(a)}`;if(r)return void(0,f.checkStrictMode)(e,`default is ignored for: ${b}`);let o=c._`${b} === undefined`;"empty"===i.useDefaults&&(o=c._`${o} || ${b} === null || ${b} === ""`),d.if(o,c._`${b} = ${(0,c.stringify)(t)}`)}a.assignDefaults=function(e,a){const{properties:t,items:c}=e.schema;if("object"===a&&t)for(const a in t)d(e,a,t[a].default);else"array"===a&&Array.isArray(c)&&c.forEach(((a,t)=>d(e,t,a.default)))}},62586:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getData=a.KeywordCxt=a.validateFunctionCode=void 0;const c=t(28727),f=t(10208),d=t(7887),r=t(10208),n=t(7870),i=t(33673),b=t(24495),o=t(99029),s=t(42023),l=t(66939),u=t(94227),h=t(48708);function p({gen:e,validateName:a,schema:t,schemaEnv:c,opts:f},d){f.code.es5?e.func(a,o._`${s.default.data}, ${s.default.valCxt}`,c.$async,(()=>{e.code(o._`"use strict"; ${g(t,f)}`),function(e,a){e.if(s.default.valCxt,(()=>{e.var(s.default.instancePath,o._`${s.default.valCxt}.${s.default.instancePath}`),e.var(s.default.parentData,o._`${s.default.valCxt}.${s.default.parentData}`),e.var(s.default.parentDataProperty,o._`${s.default.valCxt}.${s.default.parentDataProperty}`),e.var(s.default.rootData,o._`${s.default.valCxt}.${s.default.rootData}`),a.dynamicRef&&e.var(s.default.dynamicAnchors,o._`${s.default.valCxt}.${s.default.dynamicAnchors}`)}),(()=>{e.var(s.default.instancePath,o._`""`),e.var(s.default.parentData,o._`undefined`),e.var(s.default.parentDataProperty,o._`undefined`),e.var(s.default.rootData,s.default.data),a.dynamicRef&&e.var(s.default.dynamicAnchors,o._`{}`)}))}(e,f),e.code(d)})):e.func(a,o._`${s.default.data}, ${function(e){return o._`{${s.default.instancePath}="", ${s.default.parentData}, ${s.default.parentDataProperty}, ${s.default.rootData}=${s.default.data}${e.dynamicRef?o._`, ${s.default.dynamicAnchors}={}`:o.nil}}={}`}(f)}`,c.$async,(()=>e.code(g(t,f)).code(d)))}function g(e,a){const t="object"==typeof e&&e[a.schemaId];return t&&(a.code.source||a.code.process)?o._`/*# sourceURL=${t} */`:o.nil}function m({schema:e,self:a}){if("boolean"==typeof e)return!e;for(const t in e)if(a.RULES.all[t])return!0;return!1}function x(e){return"boolean"!=typeof e.schema}function y(e){(0,u.checkUnknownRules)(e),function(e){const{schema:a,errSchemaPath:t,opts:c,self:f}=e;a.$ref&&c.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(a,f.RULES)&&f.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}(e)}function A(e,a){if(e.opts.jtd)return w(e,[],!1,a);const t=(0,f.getSchemaTypes)(e.schema);w(e,t,!(0,f.coerceAndCheckDataType)(e,t),a)}function v({gen:e,schemaEnv:a,schema:t,errSchemaPath:c,opts:f}){const d=t.$comment;if(!0===f.$comment)e.code(o._`${s.default.self}.logger.log(${d})`);else if("function"==typeof f.$comment){const t=o.str`${c}/$comment`,f=e.scopeValue("root",{ref:a.root});e.code(o._`${s.default.self}.opts.$comment(${d}, ${t}, ${f}.schema)`)}}function w(e,a,t,c){const{gen:f,schema:n,data:i,allErrors:b,opts:l,self:h}=e,{RULES:p}=h;function g(u){(0,d.shouldUseGroup)(n,u)&&(u.type?(f.if((0,r.checkDataType)(u.type,i,l.strictNumbers)),_(e,u),1===a.length&&a[0]===u.type&&t&&(f.else(),(0,r.reportTypeError)(e)),f.endIf()):_(e,u),b||f.if(o._`${s.default.errors} === ${c||0}`))}!n.$ref||!l.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(n,p)?(l.jtd||function(e,a){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,a){a.length&&(e.dataTypes.length?(a.forEach((a=>{I(e.dataTypes,a)||E(e,`type "${a}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,a){const t=[];for(const c of e.dataTypes)I(a,c)?t.push(c):a.includes("integer")&&"number"===c&&t.push("integer");e.dataTypes=t}(e,a)):e.dataTypes=a)}(e,a),e.opts.allowUnionTypes||function(e,a){a.length>1&&(2!==a.length||!a.includes("null"))&&E(e,"use allowUnionTypes to allow union type keyword")}(e,a),function(e,a){const t=e.self.RULES.all;for(const c in t){const f=t[c];if("object"==typeof f&&(0,d.shouldUseRule)(e.schema,f)){const{type:t}=f.definition;t.length&&!t.some((e=>{return c=e,(t=a).includes(c)||"number"===c&&t.includes("integer");var t,c}))&&E(e,`missing type "${t.join(",")}" for keyword "${c}"`)}}}(e,e.dataTypes))}(e,a),f.block((()=>{for(const e of p.rules)g(e);g(p.post)}))):f.block((()=>M(e,"$ref",p.all.$ref.definition)))}function _(e,a){const{gen:t,schema:c,opts:{useDefaults:f}}=e;f&&(0,n.assignDefaults)(e,a.type),t.block((()=>{for(const t of a.rules)(0,d.shouldUseRule)(c,t)&&M(e,t.keyword,t.definition,a.type)}))}function I(e,a){return e.includes(a)||"integer"===a&&e.includes("number")}function E(e,a){a+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,u.checkStrictMode)(e,a,e.opts.strictTypes)}a.validateFunctionCode=function(e){x(e)&&(y(e),m(e))?function(e){const{schema:a,opts:t,gen:c}=e;p(e,(()=>{t.$comment&&a.$comment&&v(e),function(e){const{schema:a,opts:t}=e;void 0!==a.default&&t.useDefaults&&t.strictSchema&&(0,u.checkStrictMode)(e,"default is ignored in the schema root")}(e),c.let(s.default.vErrors,null),c.let(s.default.errors,0),t.unevaluated&&function(e){const{gen:a,validateName:t}=e;e.evaluated=a.const("evaluated",o._`${t}.evaluated`),a.if(o._`${e.evaluated}.dynamicProps`,(()=>a.assign(o._`${e.evaluated}.props`,o._`undefined`))),a.if(o._`${e.evaluated}.dynamicItems`,(()=>a.assign(o._`${e.evaluated}.items`,o._`undefined`)))}(e),A(e),function(e){const{gen:a,schemaEnv:t,validateName:c,ValidationError:f,opts:d}=e;t.$async?a.if(o._`${s.default.errors} === 0`,(()=>a.return(s.default.data)),(()=>a.throw(o._`new ${f}(${s.default.vErrors})`))):(a.assign(o._`${c}.errors`,s.default.vErrors),d.unevaluated&&function({gen:e,evaluated:a,props:t,items:c}){t instanceof o.Name&&e.assign(o._`${a}.props`,t),c instanceof o.Name&&e.assign(o._`${a}.items`,c)}(e),a.return(o._`${s.default.errors} === 0`))}(e)}))}(e):p(e,(()=>(0,c.topBoolOrEmptySchema)(e)))};class C{constructor(e,a,t){if((0,i.validateKeywordUsage)(e,a,t),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=t,this.data=e.data,this.schema=e.schema[t],this.$data=a.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u.schemaRefOrVal)(e,this.schema,t,this.$data),this.schemaType=a.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=a,this.$data)this.schemaCode=e.gen.const("vSchema",S(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,a.schemaType,a.allowUndefined))throw new Error(`${t} value must be ${JSON.stringify(a.schemaType)}`);("code"in a?a.trackErrors:!1!==a.errors)&&(this.errsCount=e.gen.const("_errs",s.default.errors))}result(e,a,t){this.failResult((0,o.not)(e),a,t)}failResult(e,a,t){this.gen.if(e),t?t():this.error(),a?(this.gen.else(),a(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,a){this.failResult((0,o.not)(e),void 0,a)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:a}=this;this.fail(o._`${a} !== undefined && (${(0,o.or)(this.invalid$data(),e)})`)}error(e,a,t){if(a)return this.setParams(a),this._error(e,t),void this.setParams({});this._error(e,t)}_error(e,a){(e?h.reportExtraError:h.reportError)(this,this.def.error,a)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,a){a?Object.assign(this.params,e):this.params=e}block$data(e,a,t=o.nil){this.gen.block((()=>{this.check$data(e,t),a()}))}check$data(e=o.nil,a=o.nil){if(!this.$data)return;const{gen:t,schemaCode:c,schemaType:f,def:d}=this;t.if((0,o.or)(o._`${c} === undefined`,a)),e!==o.nil&&t.assign(e,!0),(f.length||d.validateSchema)&&(t.elseIf(this.invalid$data()),this.$dataError(),e!==o.nil&&t.assign(e,!1)),t.else()}invalid$data(){const{gen:e,schemaCode:a,schemaType:t,def:c,it:f}=this;return(0,o.or)(function(){if(t.length){if(!(a instanceof o.Name))throw new Error("ajv implementation error");const e=Array.isArray(t)?t:[t];return o._`${(0,r.checkDataTypes)(e,a,f.opts.strictNumbers,r.DataType.Wrong)}`}return o.nil}(),function(){if(c.validateSchema){const t=e.scopeValue("validate$data",{ref:c.validateSchema});return o._`!${t}(${a})`}return o.nil}())}subschema(e,a){const t=(0,b.getSubschema)(this.it,e);(0,b.extendSubschemaData)(t,this.it,e),(0,b.extendSubschemaMode)(t,e);const f={...this.it,...t,items:void 0,props:void 0};return function(e,a){x(e)&&(y(e),m(e))?function(e,a){const{schema:t,gen:c,opts:f}=e;f.$comment&&t.$comment&&v(e),function(e){const a=e.schema[e.opts.schemaId];a&&(e.baseId=(0,l.resolveUrl)(e.opts.uriResolver,e.baseId,a))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const d=c.const("_errs",s.default.errors);A(e,d),c.var(a,o._`${d} === ${s.default.errors}`)}(e,a):(0,c.boolOrEmptySchema)(e,a)}(f,a),f}mergeEvaluated(e,a){const{it:t,gen:c}=this;t.opts.unevaluated&&(!0!==t.props&&void 0!==e.props&&(t.props=u.mergeEvaluated.props(c,e.props,t.props,a)),!0!==t.items&&void 0!==e.items&&(t.items=u.mergeEvaluated.items(c,e.items,t.items,a)))}mergeValidEvaluated(e,a){const{it:t,gen:c}=this;if(t.opts.unevaluated&&(!0!==t.props||!0!==t.items))return c.if(a,(()=>this.mergeEvaluated(e,o.Name))),!0}}function M(e,a,t,c){const f=new C(e,t,a);"code"in t?t.code(f,c):f.$data&&t.validate?(0,i.funcKeywordCode)(f,t):"macro"in t?(0,i.macroKeywordCode)(f,t):(t.compile||t.validate)&&(0,i.funcKeywordCode)(f,t)}a.KeywordCxt=C;const B=/^\/(?:[^~]|~0|~1)*$/,L=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function S(e,{dataLevel:a,dataNames:t,dataPathArr:c}){let f,d;if(""===e)return s.default.rootData;if("/"===e[0]){if(!B.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);f=e,d=s.default.rootData}else{const r=L.exec(e);if(!r)throw new Error(`Invalid JSON-pointer: ${e}`);const n=+r[1];if(f=r[2],"#"===f){if(n>=a)throw new Error(i("property/index",n));return c[a-n]}if(n>a)throw new Error(i("data",n));if(d=t[a-n],!f)return d}let r=d;const n=f.split("/");for(const e of n)e&&(d=o._`${d}${(0,o.getProperty)((0,u.unescapeJsonPointer)(e))}`,r=o._`${r} && ${d}`);return r;function i(e,t){return`Cannot access ${e} ${t} levels up, current level is ${a}`}}a.getData=S},33673:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateKeywordUsage=a.validSchemaType=a.funcKeywordCode=a.macroKeywordCode=void 0;const c=t(99029),f=t(42023),d=t(15765),r=t(48708);function n(e){const{gen:a,data:t,it:f}=e;a.if(f.parentData,(()=>a.assign(t,c._`${f.parentData}[${f.parentDataProperty}]`)))}function i(e,a,t){if(void 0===t)throw new Error(`keyword "${a}" failed to compile`);return e.scopeValue("keyword","function"==typeof t?{ref:t}:{ref:t,code:(0,c.stringify)(t)})}a.macroKeywordCode=function(e,a){const{gen:t,keyword:f,schema:d,parentSchema:r,it:n}=e,b=a.macro.call(n.self,d,r,n),o=i(t,f,b);!1!==n.opts.validateSchema&&n.self.validateSchema(b,!0);const s=t.name("valid");e.subschema({schema:b,schemaPath:c.nil,errSchemaPath:`${n.errSchemaPath}/${f}`,topSchemaRef:o,compositeRule:!0},s),e.pass(s,(()=>e.error(!0)))},a.funcKeywordCode=function(e,a){var t;const{gen:b,keyword:o,schema:s,parentSchema:l,$data:u,it:h}=e;!function({schemaEnv:e},a){if(a.async&&!e.$async)throw new Error("async keyword in sync schema")}(h,a);const p=!u&&a.compile?a.compile.call(h.self,s,l,h):a.validate,g=i(b,o,p),m=b.let("valid");function x(t=(a.async?c._`await `:c.nil)){const r=h.opts.passContext?f.default.this:f.default.self,n=!("compile"in a&&!u||!1===a.schema);b.assign(m,c._`${t}${(0,d.callValidateCode)(e,g,r,n)}`,a.modifying)}function y(e){var t;b.if((0,c.not)(null!==(t=a.valid)&&void 0!==t?t:m),e)}e.block$data(m,(function(){if(!1===a.errors)x(),a.modifying&&n(e),y((()=>e.error()));else{const t=a.async?function(){const e=b.let("ruleErrs",null);return b.try((()=>x(c._`await `)),(a=>b.assign(m,!1).if(c._`${a} instanceof ${h.ValidationError}`,(()=>b.assign(e,c._`${a}.errors`)),(()=>b.throw(a))))),e}():function(){const e=c._`${g}.errors`;return b.assign(e,null),x(c.nil),e}();a.modifying&&n(e),y((()=>function(e,a){const{gen:t}=e;t.if(c._`Array.isArray(${a})`,(()=>{t.assign(f.default.vErrors,c._`${f.default.vErrors} === null ? ${a} : ${f.default.vErrors}.concat(${a})`).assign(f.default.errors,c._`${f.default.vErrors}.length`),(0,r.extendErrors)(e)}),(()=>e.error()))}(e,t)))}})),e.ok(null!==(t=a.valid)&&void 0!==t?t:m)},a.validSchemaType=function(e,a,t=!1){return!a.length||a.some((a=>"array"===a?Array.isArray(e):"object"===a?e&&"object"==typeof e&&!Array.isArray(e):typeof e==a||t&&void 0===e))},a.validateKeywordUsage=function({schema:e,opts:a,self:t,errSchemaPath:c},f,d){if(Array.isArray(f.keyword)?!f.keyword.includes(d):f.keyword!==d)throw new Error("ajv implementation error");const r=f.dependencies;if(null==r?void 0:r.some((a=>!Object.prototype.hasOwnProperty.call(e,a))))throw new Error(`parent schema must have dependencies of ${d}: ${r.join(",")}`);if(f.validateSchema&&!f.validateSchema(e[d])){const e=`keyword "${d}" value is invalid at path "${c}": `+t.errorsText(f.validateSchema.errors);if("log"!==a.validateSchema)throw new Error(e);t.logger.error(e)}}},24495:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.extendSubschemaMode=a.extendSubschemaData=a.getSubschema=void 0;const c=t(99029),f=t(94227);a.getSubschema=function(e,{keyword:a,schemaProp:t,schema:d,schemaPath:r,errSchemaPath:n,topSchemaRef:i}){if(void 0!==a&&void 0!==d)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==a){const d=e.schema[a];return void 0===t?{schema:d,schemaPath:c._`${e.schemaPath}${(0,c.getProperty)(a)}`,errSchemaPath:`${e.errSchemaPath}/${a}`}:{schema:d[t],schemaPath:c._`${e.schemaPath}${(0,c.getProperty)(a)}${(0,c.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${a}/${(0,f.escapeFragment)(t)}`}}if(void 0!==d){if(void 0===r||void 0===n||void 0===i)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:r,topSchemaRef:i,errSchemaPath:n}}throw new Error('either "keyword" or "schema" must be passed')},a.extendSubschemaData=function(e,a,{dataProp:t,dataPropType:d,data:r,dataTypes:n,propertyName:i}){if(void 0!==r&&void 0!==t)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:b}=a;if(void 0!==t){const{errorPath:r,dataPathArr:n,opts:i}=a;o(b.let("data",c._`${a.data}${(0,c.getProperty)(t)}`,!0)),e.errorPath=c.str`${r}${(0,f.getErrorPath)(t,d,i.jsPropertySyntax)}`,e.parentDataProperty=c._`${t}`,e.dataPathArr=[...n,e.parentDataProperty]}function o(t){e.data=t,e.dataLevel=a.dataLevel+1,e.dataTypes=[],a.definedProperties=new Set,e.parentData=a.data,e.dataNames=[...a.dataNames,t]}void 0!==r&&(o(r instanceof c.Name?r:b.let("data",r,!0)),void 0!==i&&(e.propertyName=i)),n&&(e.dataTypes=n)},a.extendSubschemaMode=function(e,{jtdDiscriminator:a,jtdMetadata:t,compositeRule:c,createErrors:f,allErrors:d}){void 0!==c&&(e.compositeRule=c),void 0!==f&&(e.createErrors=f),void 0!==d&&(e.allErrors=d),e.jtdDiscriminator=a,e.jtdMetadata=t}},4042:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.CodeGen=a.Name=a.nil=a.stringify=a.str=a._=a.KeywordCxt=void 0;var c=t(62586);Object.defineProperty(a,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var f=t(99029);Object.defineProperty(a,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(a,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});const d=t(13558),r=t(34551),n=t(10396),i=t(73835),b=t(99029),o=t(66939),s=t(10208),l=t(94227),u=t(63837),h=t(55944),p=(e,a)=>new RegExp(e,a);p.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),x={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function A(e){var a,t,c,f,d,r,n,i,b,o,s,l,u,g,m,x,y,A,v,w,_,I,E,C,M;const B=e.strict,L=null===(a=e.code)||void 0===a?void 0:a.optimize,S=!0===L||void 0===L?1:L||0,k=null!==(c=null===(t=e.code)||void 0===t?void 0:t.regExp)&&void 0!==c?c:p,N=null!==(f=e.uriResolver)&&void 0!==f?f:h.default;return{strictSchema:null===(r=null!==(d=e.strictSchema)&&void 0!==d?d:B)||void 0===r||r,strictNumbers:null===(i=null!==(n=e.strictNumbers)&&void 0!==n?n:B)||void 0===i||i,strictTypes:null!==(o=null!==(b=e.strictTypes)&&void 0!==b?b:B)&&void 0!==o?o:"log",strictTuples:null!==(l=null!==(s=e.strictTuples)&&void 0!==s?s:B)&&void 0!==l?l:"log",strictRequired:null!==(g=null!==(u=e.strictRequired)&&void 0!==u?u:B)&&void 0!==g&&g,code:e.code?{...e.code,optimize:S,regExp:k}:{optimize:S,regExp:k},loopRequired:null!==(m=e.loopRequired)&&void 0!==m?m:200,loopEnum:null!==(x=e.loopEnum)&&void 0!==x?x:200,meta:null===(y=e.meta)||void 0===y||y,messages:null===(A=e.messages)||void 0===A||A,inlineRefs:null===(v=e.inlineRefs)||void 0===v||v,schemaId:null!==(w=e.schemaId)&&void 0!==w?w:"$id",addUsedSchema:null===(_=e.addUsedSchema)||void 0===_||_,validateSchema:null===(I=e.validateSchema)||void 0===I||I,validateFormats:null===(E=e.validateFormats)||void 0===E||E,unicodeRegExp:null===(C=e.unicodeRegExp)||void 0===C||C,int32range:null===(M=e.int32range)||void 0===M||M,uriResolver:N}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...A(e)};const{es5:a,lines:t}=this.opts.code;this.scope=new b.ValueScope({scope:{},prefixes:m,es5:a,lines:t}),this.logger=function(e){if(!1===e)return B;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const c=e.validateFormats;e.validateFormats=!1,this.RULES=(0,n.getRules)(),w.call(this,x,e,"NOT SUPPORTED"),w.call(this,y,e,"DEPRECATED","warn"),this._metaOpts=M.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&C.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),I.call(this),e.validateFormats=c}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:a,schemaId:t}=this.opts;let c=u;"id"===t&&(c={...u},c.id=c.$id,delete c.$id),a&&e&&this.addMetaSchema(c,c[t],!1)}defaultMeta(){const{meta:e,schemaId:a}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[a]||e:void 0}validate(e,a){let t;if("string"==typeof e){if(t=this.getSchema(e),!t)throw new Error(`no schema with key or ref "${e}"`)}else t=this.compile(e);const c=t(a);return"$async"in t||(this.errors=t.errors),c}compile(e,a){const t=this._addSchema(e,a);return t.validate||this._compileSchemaEnv(t)}compileAsync(e,a){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:t}=this.opts;return c.call(this,e,a);async function c(e,a){await f.call(this,e.$schema);const t=this._addSchema(e,a);return t.validate||d.call(this,t)}async function f(e){e&&!this.getSchema(e)&&await c.call(this,{$ref:e},!0)}async function d(e){try{return this._compileSchemaEnv(e)}catch(a){if(!(a instanceof r.default))throw a;return n.call(this,a),await i.call(this,a.missingSchema),d.call(this,e)}}function n({missingSchema:e,missingRef:a}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${a} cannot be resolved`)}async function i(e){const t=await b.call(this,e);this.refs[e]||await f.call(this,t.$schema),this.refs[e]||this.addSchema(t,e,a)}async function b(e){const a=this._loading[e];if(a)return a;try{return await(this._loading[e]=t(e))}finally{delete this._loading[e]}}}addSchema(e,a,t,c=this.opts.validateSchema){if(Array.isArray(e)){for(const a of e)this.addSchema(a,void 0,t,c);return this}let f;if("object"==typeof e){const{schemaId:a}=this.opts;if(f=e[a],void 0!==f&&"string"!=typeof f)throw new Error(`schema ${a} must be string`)}return a=(0,o.normalizeId)(a||f),this._checkUnique(a),this.schemas[a]=this._addSchema(e,t,a,c,!0),this}addMetaSchema(e,a,t=this.opts.validateSchema){return this.addSchema(e,a,!0,t),this}validateSchema(e,a){if("boolean"==typeof e)return!0;let t;if(t=e.$schema,void 0!==t&&"string"!=typeof t)throw new Error("$schema must be a string");if(t=t||this.opts.defaultMeta||this.defaultMeta(),!t)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const c=this.validate(t,e);if(!c&&a){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return c}getSchema(e){let a;for(;"string"==typeof(a=_.call(this,e));)e=a;if(void 0===a){const{schemaId:t}=this.opts,c=new i.SchemaEnv({schema:{},schemaId:t});if(a=i.resolveSchema.call(this,c,e),!a)return;this.refs[e]=a}return a.validate||this._compileSchemaEnv(a)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const a=_.call(this,e);return"object"==typeof a&&this._cache.delete(a.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const a=e;this._cache.delete(a);let t=e[this.opts.schemaId];return t&&(t=(0,o.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const a of e)this.addKeyword(a);return this}addKeyword(e,a){let t;if("string"==typeof e)t=e,"object"==typeof a&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),a.keyword=t);else{if("object"!=typeof e||void 0!==a)throw new Error("invalid addKeywords parameters");if(t=(a=e).keyword,Array.isArray(t)&&!t.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(S.call(this,t,a),!a)return(0,l.eachItem)(t,(e=>k.call(this,e))),this;P.call(this,a);const c={...a,type:(0,s.getJSONTypes)(a.type),schemaType:(0,s.getJSONTypes)(a.schemaType)};return(0,l.eachItem)(t,0===c.type.length?e=>k.call(this,e,c):e=>c.type.forEach((a=>k.call(this,e,c,a)))),this}getKeyword(e){const a=this.RULES.all[e];return"object"==typeof a?a.definition:!!a}removeKeyword(e){const{RULES:a}=this;delete a.keywords[e],delete a.all[e];for(const t of a.rules){const a=t.rules.findIndex((a=>a.keyword===e));a>=0&&t.rules.splice(a,1)}return this}addFormat(e,a){return"string"==typeof a&&(a=new RegExp(a)),this.formats[e]=a,this}errorsText(e=this.errors,{separator:a=", ",dataVar:t="data"}={}){return e&&0!==e.length?e.map((e=>`${t}${e.instancePath} ${e.message}`)).reduce(((e,t)=>e+a+t)):"No errors"}$dataMetaSchema(e,a){const t=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const c of a){const a=c.split("/").slice(1);let f=e;for(const e of a)f=f[e];for(const e in t){const a=t[e];if("object"!=typeof a)continue;const{$data:c}=a.definition,d=f[e];c&&d&&(f[e]=O(d))}}return e}_removeAllSchemas(e,a){for(const t in e){const c=e[t];a&&!a.test(t)||("string"==typeof c?delete e[t]:c&&!c.meta&&(this._cache.delete(c.schema),delete e[t]))}}_addSchema(e,a,t,c=this.opts.validateSchema,f=this.opts.addUsedSchema){let d;const{schemaId:r}=this.opts;if("object"==typeof e)d=e[r];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let n=this._cache.get(e);if(void 0!==n)return n;t=(0,o.normalizeId)(d||t);const b=o.getSchemaRefs.call(this,e,t);return n=new i.SchemaEnv({schema:e,schemaId:r,meta:a,baseId:t,localRefs:b}),this._cache.set(n.schema,n),f&&!t.startsWith("#")&&(t&&this._checkUnique(t),this.refs[t]=n),c&&this.validateSchema(e,!0),n}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):i.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const a=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,e)}finally{this.opts=a}}}function w(e,a,t,c="error"){for(const f in e){const d=f;d in a&&this.logger[c](`${t}: option ${f}. ${e[d]}`)}}function _(e){return e=(0,o.normalizeId)(e),this.schemas[e]||this.refs[e]}function I(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const a in e)this.addSchema(e[a],a)}function E(){for(const e in this.opts.formats){const a=this.opts.formats[e];a&&this.addFormat(e,a)}}function C(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const a in e){const t=e[a];t.keyword||(t.keyword=a),this.addKeyword(t)}}}function M(){const e={...this.opts};for(const a of g)delete e[a];return e}v.ValidationError=d.default,v.MissingRefError=r.default,a.default=v;const B={log(){},warn(){},error(){}},L=/^[a-z_$][a-z0-9_$:-]*$/i;function S(e,a){const{RULES:t}=this;if((0,l.eachItem)(e,(e=>{if(t.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!L.test(e))throw new Error(`Keyword ${e} has invalid name`)})),a&&a.$data&&!("code"in a)&&!("validate"in a))throw new Error('$data keyword must have "code" or "validate" function')}function k(e,a,t){var c;const f=null==a?void 0:a.post;if(t&&f)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:d}=this;let r=f?d.post:d.rules.find((({type:e})=>e===t));if(r||(r={type:t,rules:[]},d.rules.push(r)),d.keywords[e]=!0,!a)return;const n={keyword:e,definition:{...a,type:(0,s.getJSONTypes)(a.type),schemaType:(0,s.getJSONTypes)(a.schemaType)}};a.before?N.call(this,r,n,a.before):r.rules.push(n),d.all[e]=n,null===(c=a.implements)||void 0===c||c.forEach((e=>this.addKeyword(e)))}function N(e,a,t){const c=e.rules.findIndex((e=>e.keyword===t));c>=0?e.rules.splice(c,0,a):(e.rules.push(a),this.logger.warn(`rule ${t} is not defined`))}function P(e){let{metaSchema:a}=e;void 0!==a&&(e.$data&&this.opts.$data&&(a=O(a)),e.validateSchema=this.compile(a,!0))}const R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,R]}}},76250:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(32017);c.code='require("ajv/dist/runtime/equal").default',a.default=c},53853:(e,a)=>{"use strict";function t(e){const a=e.length;let t,c=0,f=0;for(;f=55296&&t<=56319&&f{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(48343);c.code='require("ajv/dist/runtime/uri").default',a.default=c},13558:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});class t extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}a.default=t},15457:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateAdditionalItems=void 0;const c=t(99029),f=t(94227),d={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>c.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>c._`{limit: ${e}}`},code(e){const{parentSchema:a,it:t}=e,{items:c}=a;Array.isArray(c)?r(e,c):(0,f.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas')}};function r(e,a){const{gen:t,schema:d,data:r,keyword:n,it:i}=e;i.items=!0;const b=t.const("len",c._`${r}.length`);if(!1===d)e.setParams({len:a.length}),e.pass(c._`${b} <= ${a.length}`);else if("object"==typeof d&&!(0,f.alwaysValidSchema)(i,d)){const d=t.var("valid",c._`${b} <= ${a.length}`);t.if((0,c.not)(d),(()=>function(d){t.forRange("i",a.length,b,(a=>{e.subschema({keyword:n,dataProp:a,dataPropType:f.Type.Num},d),i.allErrors||t.if((0,c.not)(d),(()=>t.break()))}))}(d))),e.ok(d)}}a.validateAdditionalItems=r,a.default=d},38660:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d=t(42023),r=t(94227),n={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>f._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:a,schema:t,parentSchema:n,data:i,errsCount:b,it:o}=e;if(!b)throw new Error("ajv implementation error");const{allErrors:s,opts:l}=o;if(o.props=!0,"all"!==l.removeAdditional&&(0,r.alwaysValidSchema)(o,t))return;const u=(0,c.allSchemaProperties)(n.properties),h=(0,c.allSchemaProperties)(n.patternProperties);function p(e){a.code(f._`delete ${i}[${e}]`)}function g(c){if("all"===l.removeAdditional||l.removeAdditional&&!1===t)p(c);else{if(!1===t)return e.setParams({additionalProperty:c}),e.error(),void(s||a.break());if("object"==typeof t&&!(0,r.alwaysValidSchema)(o,t)){const t=a.name("valid");"failing"===l.removeAdditional?(m(c,t,!1),a.if((0,f.not)(t),(()=>{e.reset(),p(c)}))):(m(c,t),s||a.if((0,f.not)(t),(()=>a.break())))}}}function m(a,t,c){const f={keyword:"additionalProperties",dataProp:a,dataPropType:r.Type.Str};!1===c&&Object.assign(f,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(f,t)}a.forIn("key",i,(t=>{u.length||h.length?a.if(function(t){let d;if(u.length>8){const e=(0,r.schemaRefOrVal)(o,n.properties,"properties");d=(0,c.isOwnProperty)(a,e,t)}else d=u.length?(0,f.or)(...u.map((e=>f._`${t} === ${e}`))):f.nil;return h.length&&(d=(0,f.or)(d,...h.map((a=>f._`${(0,c.usePattern)(e,a)}.test(${t})`)))),(0,f.not)(d)}(t),(()=>g(t))):g(t)})),e.ok(f._`${b} === ${d.default.errors}`)}};a.default=n},15844:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(94227),f={keyword:"allOf",schemaType:"array",code(e){const{gen:a,schema:t,it:f}=e;if(!Array.isArray(t))throw new Error("ajv implementation error");const d=a.name("valid");t.forEach(((a,t)=>{if((0,c.alwaysValidSchema)(f,a))return;const r=e.subschema({keyword:"allOf",schemaProp:t},d);e.ok(d),e.mergeEvaluated(r)}))}};a.default=f},16505:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:t(15765).validateUnion,error:{message:"must match a schema in anyOf"}};a.default=c},12661:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:a}})=>void 0===a?c.str`must contain at least ${e} valid item(s)`:c.str`must contain at least ${e} and no more than ${a} valid item(s)`,params:({params:{min:e,max:a}})=>void 0===a?c._`{minContains: ${e}}`:c._`{minContains: ${e}, maxContains: ${a}}`},code(e){const{gen:a,schema:t,parentSchema:d,data:r,it:n}=e;let i,b;const{minContains:o,maxContains:s}=d;n.opts.next?(i=void 0===o?1:o,b=s):i=1;const l=a.const("len",c._`${r}.length`);if(e.setParams({min:i,max:b}),void 0===b&&0===i)return void(0,f.checkStrictMode)(n,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==b&&i>b)return(0,f.checkStrictMode)(n,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,f.alwaysValidSchema)(n,t)){let a=c._`${l} >= ${i}`;return void 0!==b&&(a=c._`${a} && ${l} <= ${b}`),void e.pass(a)}n.items=!0;const u=a.name("valid");function h(){const e=a.name("_valid"),t=a.let("count",0);p(e,(()=>a.if(e,(()=>function(e){a.code(c._`${e}++`),void 0===b?a.if(c._`${e} >= ${i}`,(()=>a.assign(u,!0).break())):(a.if(c._`${e} > ${b}`,(()=>a.assign(u,!1).break())),1===i?a.assign(u,!0):a.if(c._`${e} >= ${i}`,(()=>a.assign(u,!0))))}(t)))))}function p(t,c){a.forRange("i",0,l,(a=>{e.subschema({keyword:"contains",dataProp:a,dataPropType:f.Type.Num,compositeRule:!0},t),c()}))}void 0===b&&1===i?p(u,(()=>a.if(u,(()=>a.break())))):0===i?(a.let(u,!0),void 0!==b&&a.if(c._`${r}.length > 0`,h)):(a.let(u,!1),h()),e.result(u,(()=>e.reset()))}};a.default=d},83025:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateSchemaDeps=a.validatePropertyDeps=a.error=void 0;const c=t(99029),f=t(94227),d=t(15765);a.error={message:({params:{property:e,depsCount:a,deps:t}})=>{const f=1===a?"property":"properties";return c.str`must have ${f} ${t} when property ${e} is present`},params:({params:{property:e,depsCount:a,deps:t,missingProperty:f}})=>c._`{property: ${e}, missingProperty: ${f}, depsCount: ${a}, - deps: ${t}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:a.error,code(e){const[a,t]=function({schema:e}){const a={},t={};for(const c in e)"__proto__"!==c&&((Array.isArray(e[c])?a:t)[c]=e[c]);return[a,t]}(e);n(e,a),i(e,t)}};function n(e,a=e.schema){const{gen:t,data:f,it:r}=e;if(0===Object.keys(a).length)return;const n=t.let("missing");for(const i in a){const b=a[i];if(0===b.length)continue;const o=(0,d.propertyInData)(t,f,i,r.opts.ownProperties);e.setParams({property:i,depsCount:b.length,deps:b.join(", ")}),r.allErrors?t.if(o,(()=>{for(const a of b)(0,d.checkReportMissingProp)(e,a)})):(t.if(c._`${o} && (${(0,d.checkMissingProp)(e,b,n)})`),(0,d.reportMissingProp)(e,n),t.else())}}function i(e,a=e.schema){const{gen:t,data:c,keyword:r,it:n}=e,i=t.name("valid");for(const b in a)(0,f.alwaysValidSchema)(n,a[b])||(t.if((0,d.propertyInData)(t,c,b,n.opts.ownProperties),(()=>{const a=e.subschema({keyword:r,schemaProp:b},i);e.mergeValidEvaluated(a,i)}),(()=>t.var(i,!0))),e.ok(i))}a.validatePropertyDeps=n,a.validateSchemaDeps=i,a.default=r},1239:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>c.str`must match "${e.ifClause}" schema`,params:({params:e})=>c._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:a,parentSchema:t,it:d}=e;void 0===t.then&&void 0===t.else&&(0,f.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const n=r(d,"then"),i=r(d,"else");if(!n&&!i)return;const b=a.let("valid",!0),o=a.name("_valid");if(function(){const a=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},o);e.mergeEvaluated(a)}(),e.reset(),n&&i){const t=a.let("ifClause");e.setParams({ifClause:t}),a.if(o,s("then",t),s("else",t))}else n?a.if(o,s("then")):a.if((0,c.not)(o),s("else"));function s(t,f){return()=>{const d=e.subschema({keyword:t},o);a.assign(b,o),e.mergeValidEvaluated(d,b),f?a.assign(f,c._`${t}`):e.setParams({ifClause:t})}}e.pass(b,(()=>e.error(!0)))}};function r(e,a){const t=e.schema[a];return void 0!==t&&!(0,f.alwaysValidSchema)(e,t)}a.default=d},56378:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15457),f=t(65354),d=t(20494),r=t(93966),n=t(12661),i=t(83025),b=t(19713),o=t(38660),s=t(40117),l=t(45333),u=t(57923),h=t(16505),p=t(96163),g=t(15844),m=t(1239),x=t(14426);a.default=function(e=!1){const a=[u.default,h.default,p.default,g.default,m.default,x.default,b.default,o.default,i.default,s.default,l.default];return e?a.push(f.default,r.default):a.push(c.default,d.default),a.push(n.default),a}},20494:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateTuple=void 0;const c=t(99029),f=t(94227),d=t(15765),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:a,it:t}=e;if(Array.isArray(a))return n(e,"additionalItems",a);t.items=!0,(0,f.alwaysValidSchema)(t,a)||e.ok((0,d.validateArray)(e))}};function n(e,a,t=e.schema){const{gen:d,parentSchema:r,data:n,keyword:i,it:b}=e;!function(e){const{opts:c,errSchemaPath:d}=b,r=t.length,n=r===e.minItems&&(r===e.maxItems||!1===e[a]);if(c.strictTuples&&!n){const e=`"${i}" is ${r}-tuple, but minItems or maxItems/${a} are not specified or different at path "${d}"`;(0,f.checkStrictMode)(b,e,c.strictTuples)}}(r),b.opts.unevaluated&&t.length&&!0!==b.items&&(b.items=f.mergeEvaluated.items(d,t.length,b.items));const o=d.name("valid"),s=d.const("len",c._`${n}.length`);t.forEach(((a,t)=>{(0,f.alwaysValidSchema)(b,a)||(d.if(c._`${s} > ${t}`,(()=>e.subschema({keyword:i,schemaProp:t,dataProp:t},o))),e.ok(o))}))}a.validateTuple=n,a.default=r},93966:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(15765),r=t(15457),n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>c.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>c._`{limit: ${e}}`},code(e){const{schema:a,parentSchema:t,it:c}=e,{prefixItems:n}=t;c.items=!0,(0,f.alwaysValidSchema)(c,a)||(n?(0,r.validateAdditionalItems)(e,n):e.ok((0,d.validateArray)(e)))}};a.default=n},57923:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(94227),f={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:a,schema:t,it:f}=e;if((0,c.alwaysValidSchema)(f,t))return void e.fail();const d=a.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},d),e.failResult(d,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};a.default=f},96163:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>c._`{passingSchemas: ${e.passing}}`},code(e){const{gen:a,schema:t,parentSchema:d,it:r}=e;if(!Array.isArray(t))throw new Error("ajv implementation error");if(r.opts.discriminator&&d.discriminator)return;const n=t,i=a.let("valid",!1),b=a.let("passing",null),o=a.name("_valid");e.setParams({passing:b}),a.block((function(){n.forEach(((t,d)=>{let n;(0,f.alwaysValidSchema)(r,t)?a.var(o,!0):n=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},o),d>0&&a.if(c._`${o} && ${i}`).assign(i,!1).assign(b,c._`[${b}, ${d}]`).else(),a.if(o,(()=>{a.assign(i,!0),a.assign(b,d),n&&e.mergeEvaluated(n,c.Name)}))}))})),e.result(i,(()=>e.reset()),(()=>e.error(!0)))}};a.default=d},45333:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d=t(94227),r=t(94227),n={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:a,schema:t,data:n,parentSchema:i,it:b}=e,{opts:o}=b,s=(0,c.allSchemaProperties)(t),l=s.filter((e=>(0,d.alwaysValidSchema)(b,t[e])));if(0===s.length||l.length===s.length&&(!b.opts.unevaluated||!0===b.props))return;const u=o.strictSchema&&!o.allowMatchingProperties&&i.properties,h=a.name("valid");!0===b.props||b.props instanceof f.Name||(b.props=(0,r.evaluatedPropsToName)(a,b.props));const{props:p}=b;function g(e){for(const a in u)new RegExp(e).test(a)&&(0,d.checkStrictMode)(b,`property ${a} matches pattern ${e} (use allowMatchingProperties)`)}function m(t){a.forIn("key",n,(d=>{a.if(f._`${(0,c.usePattern)(e,t)}.test(${d})`,(()=>{const c=l.includes(t);c||e.subschema({keyword:"patternProperties",schemaProp:t,dataProp:d,dataPropType:r.Type.Str},h),b.opts.unevaluated&&!0!==p?a.assign(f._`${p}[${d}]`,!0):c||b.allErrors||a.if((0,f.not)(h),(()=>a.break()))}))}))}!function(){for(const e of s)u&&g(e),b.allErrors?m(e):(a.var(h,!0),m(e),a.if(h))}()}};a.default=n},65354:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(20494),f={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,c.validateTuple)(e,"items")};a.default=f},40117:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(62586),f=t(15765),d=t(94227),r=t(38660),n={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:a,schema:t,parentSchema:n,data:i,it:b}=e;"all"===b.opts.removeAdditional&&void 0===n.additionalProperties&&r.default.code(new c.KeywordCxt(b,r.default,"additionalProperties"));const o=(0,f.allSchemaProperties)(t);for(const e of o)b.definedProperties.add(e);b.opts.unevaluated&&o.length&&!0!==b.props&&(b.props=d.mergeEvaluated.props(a,(0,d.toHash)(o),b.props));const s=o.filter((e=>!(0,d.alwaysValidSchema)(b,t[e])));if(0===s.length)return;const l=a.name("valid");for(const t of s)u(t)?h(t):(a.if((0,f.propertyInData)(a,i,t,b.opts.ownProperties)),h(t),b.allErrors||a.else().var(l,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(l);function u(e){return b.opts.useDefaults&&!b.compositeRule&&void 0!==t[e].default}function h(a){e.subschema({keyword:"properties",schemaProp:a,dataProp:a},l)}}};a.default=n},19713:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>c._`{propertyName: ${e.propertyName}}`},code(e){const{gen:a,schema:t,data:d,it:r}=e;if((0,f.alwaysValidSchema)(r,t))return;const n=a.name("valid");a.forIn("key",d,(t=>{e.setParams({propertyName:t}),e.subschema({keyword:"propertyNames",data:t,dataTypes:["string"],propertyName:t,compositeRule:!0},n),a.if((0,c.not)(n),(()=>{e.error(!0),r.allErrors||a.break()}))})),e.ok(n)}};a.default=d},14426:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(94227),f={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:a,it:t}){void 0===a.if&&(0,c.checkStrictMode)(t,`"${e}" without "if" is ignored`)}};a.default=f},15765:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateUnion=a.validateArray=a.usePattern=a.callValidateCode=a.schemaProperties=a.allSchemaProperties=a.noPropertyInData=a.propertyInData=a.isOwnProperty=a.hasPropFunc=a.reportMissingProp=a.checkMissingProp=a.checkReportMissingProp=void 0;const c=t(99029),f=t(94227),d=t(42023),r=t(94227);function n(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:c._`Object.prototype.hasOwnProperty`})}function i(e,a,t){return c._`${n(e)}.call(${a}, ${t})`}function b(e,a,t,f){const d=c._`${a}${(0,c.getProperty)(t)} === undefined`;return f?(0,c.or)(d,(0,c.not)(i(e,a,t))):d}function o(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}a.checkReportMissingProp=function(e,a){const{gen:t,data:f,it:d}=e;t.if(b(t,f,a,d.opts.ownProperties),(()=>{e.setParams({missingProperty:c._`${a}`},!0),e.error()}))},a.checkMissingProp=function({gen:e,data:a,it:{opts:t}},f,d){return(0,c.or)(...f.map((f=>(0,c.and)(b(e,a,f,t.ownProperties),c._`${d} = ${f}`))))},a.reportMissingProp=function(e,a){e.setParams({missingProperty:a},!0),e.error()},a.hasPropFunc=n,a.isOwnProperty=i,a.propertyInData=function(e,a,t,f){const d=c._`${a}${(0,c.getProperty)(t)} !== undefined`;return f?c._`${d} && ${i(e,a,t)}`:d},a.noPropertyInData=b,a.allSchemaProperties=o,a.schemaProperties=function(e,a){return o(a).filter((t=>!(0,f.alwaysValidSchema)(e,a[t])))},a.callValidateCode=function({schemaCode:e,data:a,it:{gen:t,topSchemaRef:f,schemaPath:r,errorPath:n},it:i},b,o,s){const l=s?c._`${e}, ${a}, ${f}${r}`:a,u=[[d.default.instancePath,(0,c.strConcat)(d.default.instancePath,n)],[d.default.parentData,i.parentData],[d.default.parentDataProperty,i.parentDataProperty],[d.default.rootData,d.default.rootData]];i.opts.dynamicRef&&u.push([d.default.dynamicAnchors,d.default.dynamicAnchors]);const h=c._`${l}, ${t.object(...u)}`;return o!==c.nil?c._`${b}.call(${o}, ${h})`:c._`${b}(${h})`};const s=c._`new RegExp`;a.usePattern=function({gen:e,it:{opts:a}},t){const f=a.unicodeRegExp?"u":"",{regExp:d}=a.code,n=d(t,f);return e.scopeValue("pattern",{key:n.toString(),ref:n,code:c._`${"new RegExp"===d.code?s:(0,r.useFunc)(e,d)}(${t}, ${f})`})},a.validateArray=function(e){const{gen:a,data:t,keyword:d,it:r}=e,n=a.name("valid");if(r.allErrors){const e=a.let("valid",!0);return i((()=>a.assign(e,!1))),e}return a.var(n,!0),i((()=>a.break())),n;function i(r){const i=a.const("len",c._`${t}.length`);a.forRange("i",0,i,(t=>{e.subschema({keyword:d,dataProp:t,dataPropType:f.Type.Num},n),a.if((0,c.not)(n),r)}))}},a.validateUnion=function(e){const{gen:a,schema:t,keyword:d,it:r}=e;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some((e=>(0,f.alwaysValidSchema)(r,e)))&&!r.opts.unevaluated)return;const n=a.let("valid",!1),i=a.name("_valid");a.block((()=>t.forEach(((t,f)=>{const r=e.subschema({keyword:d,schemaProp:f,compositeRule:!0},i);a.assign(n,c._`${n} || ${i}`),e.mergeValidEvaluated(r,i)||a.if((0,c.not)(n))})))),e.result(n,(()=>e.reset()),(()=>e.error(!0)))}},83463:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};a.default=t},72128:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(83463),f=t(13693),d=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",c.default,f.default];a.default=d},13693:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.callRef=a.getValidate=void 0;const c=t(34551),f=t(15765),d=t(99029),r=t(42023),n=t(73835),i=t(94227),b={keyword:"$ref",schemaType:"string",code(e){const{gen:a,schema:t,it:f}=e,{baseId:r,schemaEnv:i,validateName:b,opts:l,self:u}=f,{root:h}=i;if(("#"===t||"#/"===t)&&r===h.baseId)return function(){if(i===h)return s(e,b,i,i.$async);const t=a.scopeValue("root",{ref:h});return s(e,d._`${t}.validate`,h,h.$async)}();const p=n.resolveRef.call(u,h,r,t);if(void 0===p)throw new c.default(f.opts.uriResolver,r,t);return p instanceof n.SchemaEnv?function(a){const t=o(e,a);s(e,t,a,a.$async)}(p):function(c){const f=a.scopeValue("schema",!0===l.code.source?{ref:c,code:(0,d.stringify)(c)}:{ref:c}),r=a.name("valid"),n=e.subschema({schema:c,dataTypes:[],schemaPath:d.nil,topSchemaRef:f,errSchemaPath:t},r);e.mergeEvaluated(n),e.ok(r)}(p)}};function o(e,a){const{gen:t}=e;return a.validate?t.scopeValue("validate",{ref:a.validate}):d._`${t.scopeValue("wrapper",{ref:a})}.validate`}function s(e,a,t,c){const{gen:n,it:b}=e,{allErrors:o,schemaEnv:s,opts:l}=b,u=l.passContext?r.default.this:d.nil;function h(e){const a=d._`${e}.errors`;n.assign(r.default.vErrors,d._`${r.default.vErrors} === null ? ${a} : ${r.default.vErrors}.concat(${a})`),n.assign(r.default.errors,d._`${r.default.vErrors}.length`)}function p(e){var a;if(!b.opts.unevaluated)return;const c=null===(a=null==t?void 0:t.validate)||void 0===a?void 0:a.evaluated;if(!0!==b.props)if(c&&!c.dynamicProps)void 0!==c.props&&(b.props=i.mergeEvaluated.props(n,c.props,b.props));else{const a=n.var("props",d._`${e}.evaluated.props`);b.props=i.mergeEvaluated.props(n,a,b.props,d.Name)}if(!0!==b.items)if(c&&!c.dynamicItems)void 0!==c.items&&(b.items=i.mergeEvaluated.items(n,c.items,b.items));else{const a=n.var("items",d._`${e}.evaluated.items`);b.items=i.mergeEvaluated.items(n,a,b.items,d.Name)}}c?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const t=n.let("valid");n.try((()=>{n.code(d._`await ${(0,f.callValidateCode)(e,a,u)}`),p(a),o||n.assign(t,!0)}),(e=>{n.if(d._`!(${e} instanceof ${b.ValidationError})`,(()=>n.throw(e))),h(e),o||n.assign(t,!1)})),e.ok(t)}():e.result((0,f.callValidateCode)(e,a,u),(()=>p(a)),(()=>h(a)))}a.getValidate=o,a.callRef=s,a.default=b},36653:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(97652),d=t(73835),r=t(34551),n=t(94227),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:a}})=>e===f.DiscrError.Tag?`tag "${a}" must be string`:`value of tag "${a}" must be in oneOf`,params:({params:{discrError:e,tag:a,tagName:t}})=>c._`{error: ${e}, tag: ${t}, tagValue: ${a}}`},code(e){const{gen:a,data:t,schema:i,parentSchema:b,it:o}=e,{oneOf:s}=b;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=i.propertyName;if("string"!=typeof l)throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const u=a.let("valid",!1),h=a.const("tag",c._`${t}${(0,c.getProperty)(l)}`);function p(t){const f=a.name("valid"),d=e.subschema({keyword:"oneOf",schemaProp:t},f);return e.mergeEvaluated(d,c.Name),f}a.if(c._`typeof ${h} == "string"`,(()=>function(){const t=function(){var e;const a={},t=f(b);let c=!0;for(let a=0;ae.error(!1,{discrError:f.DiscrError.Tag,tag:h,tagName:l}))),e.ok(u)}};a.default=i},97652:(e,a)=>{"use strict";var t;Object.defineProperty(a,"__esModule",{value:!0}),a.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t||(a.DiscrError=t={}))},86144:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(72128),f=t(67060),d=t(56378),r=t(97532),n=t(69857),i=[c.default,f.default,(0,d.default)(),r.default,n.metadataVocabulary,n.contentVocabulary];a.default=i},94737:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>c.str`must match format "${e}"`,params:({schemaCode:e})=>c._`{format: ${e}}`},code(e,a){const{gen:t,data:f,$data:d,schema:r,schemaCode:n,it:i}=e,{opts:b,errSchemaPath:o,schemaEnv:s,self:l}=i;b.validateFormats&&(d?function(){const d=t.scopeValue("formats",{ref:l.formats,code:b.code.formats}),r=t.const("fDef",c._`${d}[${n}]`),i=t.let("fType"),o=t.let("format");t.if(c._`typeof ${r} == "object" && !(${r} instanceof RegExp)`,(()=>t.assign(i,c._`${r}.type || "string"`).assign(o,c._`${r}.validate`)),(()=>t.assign(i,c._`"string"`).assign(o,r))),e.fail$data((0,c.or)(!1===b.strictSchema?c.nil:c._`${n} && !${o}`,function(){const e=s.$async?c._`(${r}.async ? await ${o}(${f}) : ${o}(${f}))`:c._`${o}(${f})`,t=c._`(typeof ${o} == "function" ? ${e} : ${o}.test(${f}))`;return c._`${o} && ${o} !== true && ${i} === ${a} && !${t}`}()))}():function(){const d=l.formats[r];if(!d)return void function(){if(!1!==b.strictSchema)throw new Error(e());function e(){return`unknown format "${r}" ignored in schema at path "${o}"`}l.logger.warn(e())}();if(!0===d)return;const[n,i,u]=function(e){const a=e instanceof RegExp?(0,c.regexpCode)(e):b.code.formats?c._`${b.code.formats}${(0,c.getProperty)(r)}`:void 0,f=t.scopeValue("formats",{key:r,ref:e,code:a});return"object"!=typeof e||e instanceof RegExp?["string",e,f]:[e.type||"string",e.validate,c._`${f}.validate`]}(d);n===a&&e.pass(function(){if("object"==typeof d&&!(d instanceof RegExp)&&d.async){if(!s.$async)throw new Error("async format in sync schema");return c._`await ${u}(${f})`}return"function"==typeof i?c._`${u}(${f})`:c._`${u}.test(${f})`}())}())}};a.default=f},97532:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=[t(94737).default];a.default=c},69857:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.contentVocabulary=a.metadataVocabulary=void 0,a.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],a.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},27935:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(76250),r={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>c._`{allowedValue: ${e}}`},code(e){const{gen:a,data:t,$data:r,schemaCode:n,schema:i}=e;r||i&&"object"==typeof i?e.fail$data(c._`!${(0,f.useFunc)(a,d.default)}(${t}, ${n})`):e.fail(c._`${i} !== ${t}`)}};a.default=r},28643:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(76250),r={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>c._`{allowedValues: ${e}}`},code(e){const{gen:a,data:t,$data:r,schema:n,schemaCode:i,it:b}=e;if(!r&&0===n.length)throw new Error("enum must have non-empty array");const o=n.length>=b.opts.loopEnum;let s;const l=()=>null!=s?s:s=(0,f.useFunc)(a,d.default);let u;if(o||r)u=a.let("valid"),e.block$data(u,(function(){a.assign(u,!1),a.forOf("v",i,(e=>a.if(c._`${l()}(${t}, ${e})`,(()=>a.assign(u,!0).break()))))}));else{if(!Array.isArray(n))throw new Error("ajv implementation error");const e=a.const("vSchema",i);u=(0,c.or)(...n.map(((a,f)=>function(e,a){const f=n[a];return"object"==typeof f&&null!==f?c._`${l()}(${t}, ${e}[${a}])`:c._`${t} === ${f}`}(e,f))))}e.pass(u)}};a.default=r},67060:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(75882),f=t(63439),d=t(77307),r=t(90422),n=t(34486),i=t(34003),b=t(61163),o=t(60617),s=t(27935),l=t(28643),u=[c.default,f.default,d.default,r.default,n.default,i.default,b.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},s.default,l.default];a.default=u},61163:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:a}){const t="maxItems"===e?"more":"fewer";return c.str`must NOT have ${t} than ${a} items`},params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:a,data:t,schemaCode:f}=e,d="maxItems"===a?c.operators.GT:c.operators.LT;e.fail$data(c._`${t}.length ${d} ${f}`)}};a.default=f},77307:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(53853),r={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:a}){const t="maxLength"===e?"more":"fewer";return c.str`must NOT have ${t} than ${a} characters`},params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:a,data:t,schemaCode:r,it:n}=e,i="maxLength"===a?c.operators.GT:c.operators.LT,b=!1===n.opts.unicode?c._`${t}.length`:c._`${(0,f.useFunc)(e.gen,d.default)}(${t})`;e.fail$data(c._`${b} ${i} ${r}`)}};a.default=r},75882:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=c.operators,d={maximum:{okStr:"<=",ok:f.LTE,fail:f.GT},minimum:{okStr:">=",ok:f.GTE,fail:f.LT},exclusiveMaximum:{okStr:"<",ok:f.LT,fail:f.GTE},exclusiveMinimum:{okStr:">",ok:f.GT,fail:f.LTE}},r={message:({keyword:e,schemaCode:a})=>c.str`must be ${d[e].okStr} ${a}`,params:({keyword:e,schemaCode:a})=>c._`{comparison: ${d[e].okStr}, limit: ${a}}`},n={keyword:Object.keys(d),type:"number",schemaType:"number",$data:!0,error:r,code(e){const{keyword:a,data:t,schemaCode:f}=e;e.fail$data(c._`${t} ${d[a].fail} ${f} || isNaN(${t})`)}};a.default=n},34486:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:a}){const t="maxProperties"===e?"more":"fewer";return c.str`must NOT have ${t} than ${a} properties`},params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:a,data:t,schemaCode:f}=e,d="maxProperties"===a?c.operators.GT:c.operators.LT;e.fail$data(c._`Object.keys(${t}).length ${d} ${f}`)}};a.default=f},63439:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>c.str`must be multiple of ${e}`,params:({schemaCode:e})=>c._`{multipleOf: ${e}}`},code(e){const{gen:a,data:t,schemaCode:f,it:d}=e,r=d.opts.multipleOfPrecision,n=a.let("res"),i=r?c._`Math.abs(Math.round(${n}) - ${n}) > 1e-${r}`:c._`${n} !== parseInt(${n})`;e.fail$data(c._`(${f} === 0 || (${n} = ${t}/${f}, ${i}))`)}};a.default=f},90422:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>f.str`must match pattern "${e}"`,params:({schemaCode:e})=>f._`{pattern: ${e}}`},code(e){const{data:a,$data:t,schema:d,schemaCode:r,it:n}=e,i=n.opts.unicodeRegExp?"u":"",b=t?f._`(new RegExp(${r}, ${i}))`:(0,c.usePattern)(e,d);e.fail$data(f._`!${b}.test(${a})`)}};a.default=d},34003:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d=t(94227),r={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>f.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>f._`{missingProperty: ${e}}`},code(e){const{gen:a,schema:t,schemaCode:r,data:n,$data:i,it:b}=e,{opts:o}=b;if(!i&&0===t.length)return;const s=t.length>=o.loopRequired;if(b.allErrors?function(){if(s||i)e.block$data(f.nil,l);else for(const a of t)(0,c.checkReportMissingProp)(e,a)}():function(){const d=a.let("missing");if(s||i){const t=a.let("valid",!0);e.block$data(t,(()=>function(t,d){e.setParams({missingProperty:t}),a.forOf(t,r,(()=>{a.assign(d,(0,c.propertyInData)(a,n,t,o.ownProperties)),a.if((0,f.not)(d),(()=>{e.error(),a.break()}))}),f.nil)}(d,t))),e.ok(t)}else a.if((0,c.checkMissingProp)(e,t,d)),(0,c.reportMissingProp)(e,d),a.else()}(),o.strictRequired){const a=e.parentSchema.properties,{definedProperties:c}=e.it;for(const e of t)if(void 0===(null==a?void 0:a[e])&&!c.has(e)){const a=`required property "${e}" is not defined at "${b.schemaEnv.baseId+b.errSchemaPath}" (strictRequired)`;(0,d.checkStrictMode)(b,a,b.opts.strictRequired)}}function l(){a.forOf("prop",r,(t=>{e.setParams({missingProperty:t}),a.if((0,c.noPropertyInData)(a,n,t,o.ownProperties),(()=>e.error()))}))}}};a.default=r},60617:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(10208),f=t(99029),d=t(94227),r=t(76250),n={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:a}})=>f.str`must NOT have duplicate items (items ## ${a} and ${e} are identical)`,params:({params:{i:e,j:a}})=>f._`{i: ${e}, j: ${a}}`},code(e){const{gen:a,data:t,$data:n,schema:i,parentSchema:b,schemaCode:o,it:s}=e;if(!n&&!i)return;const l=a.let("valid"),u=b.items?(0,c.getSchemaTypes)(b.items):[];function h(d,r){const n=a.name("item"),i=(0,c.checkDataTypes)(u,n,s.opts.strictNumbers,c.DataType.Wrong),b=a.const("indices",f._`{}`);a.for(f._`;${d}--;`,(()=>{a.let(n,f._`${t}[${d}]`),a.if(i,f._`continue`),u.length>1&&a.if(f._`typeof ${n} == "string"`,f._`${n} += "_"`),a.if(f._`typeof ${b}[${n}] == "number"`,(()=>{a.assign(r,f._`${b}[${n}]`),e.error(),a.assign(l,!1).break()})).code(f._`${b}[${n}] = ${d}`)}))}function p(c,n){const i=(0,d.useFunc)(a,r.default),b=a.name("outer");a.label(b).for(f._`;${c}--;`,(()=>a.for(f._`${n} = ${c}; ${n}--;`,(()=>a.if(f._`${i}(${t}[${c}], ${t}[${n}])`,(()=>{e.error(),a.assign(l,!1).break(b)}))))))}e.block$data(l,(function(){const c=a.let("i",f._`${t}.length`),d=a.let("j");e.setParams({i:c,j:d}),a.assign(l,!0),a.if(f._`${c} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?h:p)(c,d)))}),f._`${o} === false`),e.ok(l)}};a.default=n},87568:(e,a,t)=>{var c=a;c.bignum=t(72344),c.define=t(47363).define,c.base=t(9673),c.constants=t(22153),c.decoders=t(22853),c.encoders=t(24669)},47363:(e,a,t)=>{var c=t(87568),f=t(56698);function d(e,a){this.name=e,this.body=a,this.decoders={},this.encoders={}}a.define=function(e,a){return new d(e,a)},d.prototype._createNamed=function(e){var a;try{a=t(68961).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){a=function(e){this._initNamed(e)}}return f(a,e),a.prototype._initNamed=function(a){e.call(this,a)},new a(this)},d.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(c.decoders[e])),this.decoders[e]},d.prototype.decode=function(e,a,t){return this._getDecoder(a).decode(e,t)},d.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(c.encoders[e])),this.encoders[e]},d.prototype.encode=function(e,a,t){return this._getEncoder(a).encode(e,t)}},47227:(e,a,t)=>{var c=t(56698),f=t(9673).Reporter,d=t(48287).Buffer;function r(e,a){f.call(this,a),d.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function n(e,a){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return e instanceof n||(e=new n(e,a)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return a.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=d.byteLength(e);else{if(!d.isBuffer(e))return a.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}c(r,f),a.t=r,r.prototype.save=function(){return{offset:this.offset,reporter:f.prototype.save.call(this)}},r.prototype.restore=function(e){var a=new r(this.base);return a.offset=e.offset,a.length=this.offset,this.offset=e.offset,f.prototype.restore.call(this,e.reporter),a},r.prototype.isEmpty=function(){return this.offset===this.length},r.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},r.prototype.skip=function(e,a){if(!(this.offset+e<=this.length))return this.error(a||"DecoderBuffer overrun");var t=new r(this.base);return t._reporterState=this._reporterState,t.offset=this.offset,t.length=this.offset+e,this.offset+=e,t},r.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},a.d=n,n.prototype.join=function(e,a){return e||(e=new d(this.length)),a||(a=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(t){t.join(e,a),a+=t.length})):("number"==typeof this.value?e[a]=this.value:"string"==typeof this.value?e.write(this.value,a):d.isBuffer(this.value)&&this.value.copy(e,a),a+=this.length)),e}},9673:(e,a,t)=>{var c=a;c.Reporter=t(89220).a,c.DecoderBuffer=t(47227).t,c.EncoderBuffer=t(47227).d,c.Node=t(90993)},90993:(e,a,t)=>{var c=t(9673).Reporter,f=t(9673).EncoderBuffer,d=t(9673).DecoderBuffer,r=t(43349),n=["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"],i=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(n);function b(e,a){var t={};this._baseState=t,t.enc=e,t.parent=a||null,t.children=null,t.tag=null,t.args=null,t.reverseArgs=null,t.choice=null,t.optional=!1,t.any=!1,t.obj=!1,t.use=null,t.useDecoder=null,t.key=null,t.default=null,t.explicit=null,t.implicit=null,t.contains=null,t.parent||(t.children=[],this._wrap())}e.exports=b;var o=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];b.prototype.clone=function(){var e=this._baseState,a={};o.forEach((function(t){a[t]=e[t]}));var t=new this.constructor(a.parent);return t._baseState=a,t},b.prototype._wrap=function(){var e=this._baseState;i.forEach((function(a){this[a]=function(){var t=new this.constructor(this);return e.children.push(t),t[a].apply(t,arguments)}}),this)},b.prototype._init=function(e){var a=this._baseState;r(null===a.parent),e.call(this),a.children=a.children.filter((function(e){return e._baseState.parent===this}),this),r.equal(a.children.length,1,"Root node can have only one child")},b.prototype._useArgs=function(e){var a=this._baseState,t=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==t.length&&(r(null===a.children),a.children=t,t.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(r(null===a.args),a.args=e,a.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;var a={};return Object.keys(e).forEach((function(t){t==(0|t)&&(t|=0);var c=e[t];a[c]=t})),a})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){b.prototype[e]=function(){var a=this._baseState;throw new Error(e+" not implemented for encoding: "+a.enc)}})),n.forEach((function(e){b.prototype[e]=function(){var a=this._baseState,t=Array.prototype.slice.call(arguments);return r(null===a.tag),a.tag=e,this._useArgs(t),this}})),b.prototype.use=function(e){r(e);var a=this._baseState;return r(null===a.use),a.use=e,this},b.prototype.optional=function(){return this._baseState.optional=!0,this},b.prototype.def=function(e){var a=this._baseState;return r(null===a.default),a.default=e,a.optional=!0,this},b.prototype.explicit=function(e){var a=this._baseState;return r(null===a.explicit&&null===a.implicit),a.explicit=e,this},b.prototype.implicit=function(e){var a=this._baseState;return r(null===a.explicit&&null===a.implicit),a.implicit=e,this},b.prototype.obj=function(){var e=this._baseState,a=Array.prototype.slice.call(arguments);return e.obj=!0,0!==a.length&&this._useArgs(a),this},b.prototype.key=function(e){var a=this._baseState;return r(null===a.key),a.key=e,this},b.prototype.any=function(){return this._baseState.any=!0,this},b.prototype.choice=function(e){var a=this._baseState;return r(null===a.choice),a.choice=e,this._useArgs(Object.keys(e).map((function(a){return e[a]}))),this},b.prototype.contains=function(e){var a=this._baseState;return r(null===a.use),a.contains=e,this},b.prototype._decode=function(e,a){var t=this._baseState;if(null===t.parent)return e.wrapResult(t.children[0]._decode(e,a));var c,f=t.default,r=!0,n=null;if(null!==t.key&&(n=e.enterKey(t.key)),t.optional){var i=null;if(null!==t.explicit?i=t.explicit:null!==t.implicit?i=t.implicit:null!==t.tag&&(i=t.tag),null!==i||t.any){if(r=this._peekTag(e,i,t.any),e.isError(r))return r}else{var b=e.save();try{null===t.choice?this._decodeGeneric(t.tag,e,a):this._decodeChoice(e,a),r=!0}catch(e){r=!1}e.restore(b)}}if(t.obj&&r&&(c=e.enterObject()),r){if(null!==t.explicit){var o=this._decodeTag(e,t.explicit);if(e.isError(o))return o;e=o}var s=e.offset;if(null===t.use&&null===t.choice){t.any&&(b=e.save());var l=this._decodeTag(e,null!==t.implicit?t.implicit:t.tag,t.any);if(e.isError(l))return l;t.any?f=e.raw(b):e=l}if(a&&a.track&&null!==t.tag&&a.track(e.path(),s,e.length,"tagged"),a&&a.track&&null!==t.tag&&a.track(e.path(),e.offset,e.length,"content"),t.any||(f=null===t.choice?this._decodeGeneric(t.tag,e,a):this._decodeChoice(e,a)),e.isError(f))return f;if(t.any||null!==t.choice||null===t.children||t.children.forEach((function(t){t._decode(e,a)})),t.contains&&("octstr"===t.tag||"bitstr"===t.tag)){var u=new d(f);f=this._getUse(t.contains,e._reporterState.obj)._decode(u,a)}}return t.obj&&r&&(f=e.leaveObject(c)),null===t.key||null===f&&!0!==r?null!==n&&e.exitKey(n):e.leaveKey(n,t.key,f),f},b.prototype._decodeGeneric=function(e,a,t){var c=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(a,e,c.args[0],t):/str$/.test(e)?this._decodeStr(a,e,t):"objid"===e&&c.args?this._decodeObjid(a,c.args[0],c.args[1],t):"objid"===e?this._decodeObjid(a,null,null,t):"gentime"===e||"utctime"===e?this._decodeTime(a,e,t):"null_"===e?this._decodeNull(a,t):"bool"===e?this._decodeBool(a,t):"objDesc"===e?this._decodeStr(a,e,t):"int"===e||"enum"===e?this._decodeInt(a,c.args&&c.args[0],t):null!==c.use?this._getUse(c.use,a._reporterState.obj)._decode(a,t):a.error("unknown tag: "+e)},b.prototype._getUse=function(e,a){var t=this._baseState;return t.useDecoder=this._use(e,a),r(null===t.useDecoder._baseState.parent),t.useDecoder=t.useDecoder._baseState.children[0],t.implicit!==t.useDecoder._baseState.implicit&&(t.useDecoder=t.useDecoder.clone(),t.useDecoder._baseState.implicit=t.implicit),t.useDecoder},b.prototype._decodeChoice=function(e,a){var t=this._baseState,c=null,f=!1;return Object.keys(t.choice).some((function(d){var r=e.save(),n=t.choice[d];try{var i=n._decode(e,a);if(e.isError(i))return!1;c={type:d,value:i},f=!0}catch(a){return e.restore(r),!1}return!0}),this),f?c:e.error("Choice not matched")},b.prototype._createEncoderBuffer=function(e){return new f(e,this.reporter)},b.prototype._encode=function(e,a,t){var c=this._baseState;if(null===c.default||c.default!==e){var f=this._encodeValue(e,a,t);if(void 0!==f&&!this._skipDefault(f,a,t))return f}},b.prototype._encodeValue=function(e,a,t){var f=this._baseState;if(null===f.parent)return f.children[0]._encode(e,a||new c);var d=null;if(this.reporter=a,f.optional&&void 0===e){if(null===f.default)return;e=f.default}var r=null,n=!1;if(f.any)d=this._createEncoderBuffer(e);else if(f.choice)d=this._encodeChoice(e,a);else if(f.contains)r=this._getUse(f.contains,t)._encode(e,a),n=!0;else if(f.children)r=f.children.map((function(t){if("null_"===t._baseState.tag)return t._encode(null,a,e);if(null===t._baseState.key)return a.error("Child should have a key");var c=a.enterKey(t._baseState.key);if("object"!=typeof e)return a.error("Child expected, but input is not object");var f=t._encode(e[t._baseState.key],a,e);return a.leaveKey(c),f}),this).filter((function(e){return e})),r=this._createEncoderBuffer(r);else if("seqof"===f.tag||"setof"===f.tag){if(!f.args||1!==f.args.length)return a.error("Too many args for : "+f.tag);if(!Array.isArray(e))return a.error("seqof/setof, but data is not Array");var i=this.clone();i._baseState.implicit=null,r=this._createEncoderBuffer(e.map((function(t){var c=this._baseState;return this._getUse(c.args[0],e)._encode(t,a)}),i))}else null!==f.use?d=this._getUse(f.use,t)._encode(e,a):(r=this._encodePrimitive(f.tag,e),n=!0);if(!f.any&&null===f.choice){var b=null!==f.implicit?f.implicit:f.tag,o=null===f.implicit?"universal":"context";null===b?null===f.use&&a.error("Tag could be omitted only for .use()"):null===f.use&&(d=this._encodeComposite(b,n,o,r))}return null!==f.explicit&&(d=this._encodeComposite(f.explicit,!1,"context",d)),d},b.prototype._encodeChoice=function(e,a){var t=this._baseState,c=t.choice[e.type];return c||r(!1,e.type+" not found in "+JSON.stringify(Object.keys(t.choice))),c._encode(e.value,a)},b.prototype._encodePrimitive=function(e,a){var t=this._baseState;if(/str$/.test(e))return this._encodeStr(a,e);if("objid"===e&&t.args)return this._encodeObjid(a,t.reverseArgs[0],t.args[1]);if("objid"===e)return this._encodeObjid(a,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(a,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(a,t.args&&t.reverseArgs[0]);if("bool"===e)return this._encodeBool(a);if("objDesc"===e)return this._encodeStr(a,e);throw new Error("Unsupported tag: "+e)},b.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},b.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},89220:(e,a,t)=>{var c=t(56698);function f(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function d(e,a){this.path=e,this.rethrow(a)}a.a=f,f.prototype.isError=function(e){return e instanceof d},f.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},f.prototype.restore=function(e){var a=this._reporterState;a.obj=e.obj,a.path=a.path.slice(0,e.pathLen)},f.prototype.enterKey=function(e){return this._reporterState.path.push(e)},f.prototype.exitKey=function(e){var a=this._reporterState;a.path=a.path.slice(0,e-1)},f.prototype.leaveKey=function(e,a,t){var c=this._reporterState;this.exitKey(e),null!==c.obj&&(c.obj[a]=t)},f.prototype.path=function(){return this._reporterState.path.join("/")},f.prototype.enterObject=function(){var e=this._reporterState,a=e.obj;return e.obj={},a},f.prototype.leaveObject=function(e){var a=this._reporterState,t=a.obj;return a.obj=e,t},f.prototype.error=function(e){var a,t=this._reporterState,c=e instanceof d;if(a=c?e:new d(t.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!t.options.partial)throw a;return c||t.errors.push(a),a},f.prototype.wrapResult=function(e){var a=this._reporterState;return a.options.partial?{result:this.isError(e)?null:e,errors:a.errors}:e},c(d,Error),d.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,d),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},74598:(e,a,t)=>{var c=t(22153);a.tagClass={0:"universal",1:"application",2:"context",3:"private"},a.tagClassByName=c._reverse(a.tagClass),a.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"},a.tagByName=c._reverse(a.tag)},22153:(e,a,t)=>{var c=a;c._reverse=function(e){var a={};return Object.keys(e).forEach((function(t){(0|t)==t&&(t|=0);var c=e[t];a[c]=t})),a},c.der=t(74598)},62010:(e,a,t)=>{var c=t(56698),f=t(87568),d=f.base,r=f.bignum,n=f.constants.der;function i(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new b,this.tree._init(e.body)}function b(e){d.Node.call(this,"der",e)}function o(e,a){var t=e.readUInt8(a);if(e.isError(t))return t;var c=n.tagClass[t>>6],f=!(32&t);if(31&~t)t&=31;else{var d=t;for(t=0;!(128&~d);){if(d=e.readUInt8(a),e.isError(d))return d;t<<=7,t|=127&d}}return{cls:c,primitive:f,tag:t,tagStr:n.tag[t]}}function s(e,a,t){var c=e.readUInt8(t);if(e.isError(c))return c;if(!a&&128===c)return null;if(!(128&c))return c;var f=127&c;if(f>4)return e.error("length octect is too long");c=0;for(var d=0;d{var c=a;c.der=t(62010),c.pem=t(58903)},58903:(e,a,t)=>{var c=t(56698),f=t(48287).Buffer,d=t(62010);function r(e){d.call(this,e),this.enc="pem"}c(r,d),e.exports=r,r.prototype.decode=function(e,a){for(var t=e.toString().split(/[\r\n]+/g),c=a.label.toUpperCase(),r=/^-----(BEGIN|END) ([^-]+)-----$/,n=-1,i=-1,b=0;b{var c=t(56698),f=t(48287).Buffer,d=t(87568),r=d.base,n=d.constants.der;function i(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new b,this.tree._init(e.body)}function b(e){r.Node.call(this,"der",e)}function o(e){return e<10?"0"+e:e}e.exports=i,i.prototype.encode=function(e,a){return this.tree._encode(e,a).join()},c(b,r.Node),b.prototype._encodeComposite=function(e,a,t,c){var d,r=function(e,a,t,c){var f;if("seqof"===e?e="seq":"setof"===e&&(e="set"),n.tagByName.hasOwnProperty(e))f=n.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return c.error("Unknown tag: "+e);f=e}return f>=31?c.error("Multi-octet tag encoding unsupported"):(a||(f|=32),f|=n.tagClassByName[t||"universal"]<<6)}(e,a,t,this.reporter);if(c.length<128)return(d=new f(2))[0]=r,d[1]=c.length,this._createEncoderBuffer([d,c]);for(var i=1,b=c.length;b>=256;b>>=8)i++;(d=new f(2+i))[0]=r,d[1]=128|i,b=1+i;for(var o=c.length;o>0;b--,o>>=8)d[b]=255&o;return this._createEncoderBuffer([d,c])},b.prototype._encodeStr=function(e,a){if("bitstr"===a)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===a){for(var t=new f(2*e.length),c=0;c=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var d=0;for(c=0;c=128;r>>=7)d++}var n=new f(d),i=n.length-1;for(c=e.length-1;c>=0;c--)for(r=e[c],n[i--]=127&r;(r>>=7)>0;)n[i--]=128|127&r;return this._createEncoderBuffer(n)},b.prototype._encodeTime=function(e,a){var t,c=new Date(e);return"gentime"===a?t=[o(c.getFullYear()),o(c.getUTCMonth()+1),o(c.getUTCDate()),o(c.getUTCHours()),o(c.getUTCMinutes()),o(c.getUTCSeconds()),"Z"].join(""):"utctime"===a?t=[o(c.getFullYear()%100),o(c.getUTCMonth()+1),o(c.getUTCDate()),o(c.getUTCHours()),o(c.getUTCMinutes()),o(c.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+a+" time is not supported yet"),this._encodeStr(t,"octstr")},b.prototype._encodeNull=function(){return this._createEncoderBuffer("")},b.prototype._encodeInt=function(e,a){if("string"==typeof e){if(!a)return this.reporter.error("String int or enum given, but no values map");if(!a.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=a[e]}if("number"!=typeof e&&!f.isBuffer(e)){var t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=new f(t)}if(f.isBuffer(e)){var c=e.length;0===e.length&&c++;var d=new f(c);return e.copy(d),0===e.length&&(d[0]=0),this._createEncoderBuffer(d)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);c=1;for(var r=e;r>=256;r>>=8)c++;for(r=(d=new Array(c)).length-1;r>=0;r--)d[r]=255&e,e>>=8;return 128&d[0]&&d.unshift(0),this._createEncoderBuffer(new f(d))},b.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},b.prototype._use=function(e,a){return"function"==typeof e&&(e=e(a)),e._getEncoder("der").tree},b.prototype._skipDefault=function(e,a,t){var c,f=this._baseState;if(null===f.default)return!1;var d=e.join();if(void 0===f.defaultBuffer&&(f.defaultBuffer=this._encodeValue(f.default,a,t).join()),d.length!==f.defaultBuffer.length)return!1;for(c=0;c{var c=a;c.der=t(70082),c.pem=t(90735)},90735:(e,a,t)=>{var c=t(56698),f=t(70082);function d(e){f.call(this,e),this.enc="pem"}c(d,f),e.exports=d,d.prototype.encode=function(e,a){for(var t=f.prototype.encode.call(this,e).toString("base64"),c=["-----BEGIN "+a.label+"-----"],d=0;d=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,D=R>>>13,T=0|r[9],F=8191&T,Q=T>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},94148:(e,a,t)=>{"use strict";function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function f(e,a){for(var t=0;t1?t-1:0),f=1;f1?t-1:0),f=1;f1?t-1:0),f=1;f1?t-1:0),f=1;f{"use strict";function c(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);a&&(c=c.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,c)}return t}function f(e){for(var a=1;ae.length)&&(t=e.length),e.substring(t-a.length,t)===a}var x="",y="",A="",v="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var a=Object.keys(e),t=Object.create(Object.getPrototypeOf(e));return a.forEach((function(a){t[a]=e[a]})),Object.defineProperty(t,"message",{value:e.message}),t}function I(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var E=function(e,a){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&l(e,a)}(E,e);var t,c,r,b,o=(t=E,c=s(),function(){var e,a=u(t);if(c){var f=u(this).constructor;e=Reflect.construct(a,arguments,f)}else e=a.apply(this,arguments);return n(this,e)});function E(e){var a;if(function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,E),"object"!==h(e)||null===e)throw new g("options","Object",e);var t=e.message,c=e.operator,f=e.stackStartFn,d=e.actual,r=e.expected,b=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=t)a=o.call(this,String(t));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&1!==process.stderr.getColorDepth()?(x="",y="",v="",A=""):(x="",y="",v="",A="")),"object"===h(d)&&null!==d&&"object"===h(r)&&null!==r&&"stack"in d&&d instanceof Error&&"stack"in r&&r instanceof Error&&(d=_(d),r=_(r)),"deepStrictEqual"===c||"strictEqual"===c)a=o.call(this,function(e,a,t){var c="",f="",d=0,r="",n=!1,i=I(e),b=i.split("\n"),o=I(a).split("\n"),s=0,l="";if("strictEqual"===t&&"object"===h(e)&&"object"===h(a)&&null!==e&&null!==a&&(t="strictEqualObject"),1===b.length&&1===o.length&&b[0]!==o[0]){var u=b[0].length+o[0].length;if(u<=10){if(!("object"===h(e)&&null!==e||"object"===h(a)&&null!==a||0===e&&0===a))return"".concat(w[t],"\n\n")+"".concat(b[0]," !== ").concat(o[0],"\n")}else if("strictEqualObject"!==t&&u<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;b[0][s]===o[0][s];)s++;s>2&&(l="\n ".concat(function(e,a){if(a=Math.floor(a),0==e.length||0==a)return"";var t=e.length*a;for(a=Math.floor(Math.log(a)/Math.log(2));a;)e+=e,a--;return e+e.substring(0,t-e.length)}(" ",s),"^"),s=0)}}for(var p=b[b.length-1],g=o[o.length-1];p===g&&(s++<2?r="\n ".concat(p).concat(r):c=p,b.pop(),o.pop(),0!==b.length&&0!==o.length);)p=b[b.length-1],g=o[o.length-1];var _=Math.max(b.length,o.length);if(0===_){var E=i.split("\n");if(E.length>30)for(E[26]="".concat(x,"...").concat(v);E.length>27;)E.pop();return"".concat(w.notIdentical,"\n\n").concat(E.join("\n"),"\n")}s>3&&(r="\n".concat(x,"...").concat(v).concat(r),n=!0),""!==c&&(r="\n ".concat(c).concat(r),c="");var C=0,M=w[t]+"\n".concat(y,"+ actual").concat(v," ").concat(A,"- expected").concat(v),B=" ".concat(x,"...").concat(v," Lines skipped");for(s=0;s<_;s++){var L=s-d;if(b.length1&&s>2&&(L>4?(f+="\n".concat(x,"...").concat(v),n=!0):L>3&&(f+="\n ".concat(o[s-2]),C++),f+="\n ".concat(o[s-1]),C++),d=s,c+="\n".concat(A,"-").concat(v," ").concat(o[s]),C++;else if(o.length1&&s>2&&(L>4?(f+="\n".concat(x,"...").concat(v),n=!0):L>3&&(f+="\n ".concat(b[s-2]),C++),f+="\n ".concat(b[s-1]),C++),d=s,f+="\n".concat(y,"+").concat(v," ").concat(b[s]),C++;else{var S=o[s],k=b[s],N=k!==S&&(!m(k,",")||k.slice(0,-1)!==S);N&&m(S,",")&&S.slice(0,-1)===k&&(N=!1,k+=","),N?(L>1&&s>2&&(L>4?(f+="\n".concat(x,"...").concat(v),n=!0):L>3&&(f+="\n ".concat(b[s-2]),C++),f+="\n ".concat(b[s-1]),C++),d=s,f+="\n".concat(y,"+").concat(v," ").concat(k),c+="\n".concat(A,"-").concat(v," ").concat(S),C+=2):(f+=c,c="",1!==L&&0!==s||(f+="\n ".concat(k),C++))}if(C>20&&s<_-2)return"".concat(M).concat(B,"\n").concat(f,"\n").concat(x,"...").concat(v).concat(c,"\n")+"".concat(x,"...").concat(v)}return"".concat(M).concat(n?B:"","\n").concat(f).concat(c).concat(r).concat(l)}(d,r,c));else if("notDeepStrictEqual"===c||"notStrictEqual"===c){var s=w[c],l=I(d).split("\n");if("notStrictEqual"===c&&"object"===h(d)&&null!==d&&(s=w.notStrictEqualObject),l.length>30)for(l[26]="".concat(x,"...").concat(v);l.length>27;)l.pop();a=1===l.length?o.call(this,"".concat(s," ").concat(l[0])):o.call(this,"".concat(s,"\n\n").concat(l.join("\n"),"\n"))}else{var u=I(d),p="",C=w[c];"notDeepEqual"===c||"notEqual"===c?(u="".concat(w[c],"\n\n").concat(u)).length>1024&&(u="".concat(u.slice(0,1021),"...")):(p="".concat(I(r)),u.length>512&&(u="".concat(u.slice(0,509),"...")),p.length>512&&(p="".concat(p.slice(0,509),"...")),"deepEqual"===c||"equal"===c?u="".concat(C,"\n\n").concat(u,"\n\nshould equal\n\n"):p=" ".concat(c," ").concat(p)),a=o.call(this,"".concat(u).concat(p))}return Error.stackTraceLimit=b,a.generatedMessage=!t,Object.defineProperty(i(a),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),a.code="ERR_ASSERTION",a.actual=d,a.expected=r,a.operator=c,Error.captureStackTrace&&Error.captureStackTrace(i(a),f),a.stack,a.name="AssertionError",n(a)}return r=E,(b=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:a,value:function(e,a){return p(this,f(f({},a),{},{customInspect:!1,depth:0}))}}])&&d(r.prototype,b),Object.defineProperty(r,"prototype",{writable:!1}),E}(b(Error),p.custom);e.exports=E},69597:(e,a,t)=>{"use strict";function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function f(e,a){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,a){return e.__proto__=a,e},f(e,a)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}var r,n,i={};function b(e,a,t){t||(t=Error);var r=function(t){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&f(e,a)}(o,t);var r,n,i,b=(n=o,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=d(n);if(i){var t=d(this).constructor;e=Reflect.construct(a,arguments,t)}else e=a.apply(this,arguments);return function(e,a){if(a&&("object"===c(a)||"function"==typeof a))return a;if(void 0!==a)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function o(t,c,f){var d;return function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,o),d=b.call(this,function(e,t,c){return"string"==typeof a?a:a(e,t,c)}(t,c,f)),d.code=e,d}return r=o,Object.defineProperty(r,"prototype",{writable:!1}),r}(t);i[e]=r}function o(e,a){if(Array.isArray(e)){var t=e.length;return e=e.map((function(e){return String(e)})),t>2?"one of ".concat(a," ").concat(e.slice(0,t-1).join(", "),", or ")+e[t-1]:2===t?"one of ".concat(a," ").concat(e[0]," or ").concat(e[1]):"of ".concat(a," ").concat(e[0])}return"of ".concat(a," ").concat(String(e))}b("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),b("ERR_INVALID_ARG_TYPE",(function(e,a,f){var d,n,i,b,s;if(void 0===r&&(r=t(94148)),r("string"==typeof e,"'name' must be a string"),"string"==typeof a&&(n="not ",a.substr(0,4)===n)?(d="must not be",a=a.replace(/^not /,"")):d="must be",function(e,a,t){return(void 0===t||t>e.length)&&(t=e.length),e.substring(t-9,t)===a}(e," argument"))i="The ".concat(e," ").concat(d," ").concat(o(a,"type"));else{var l=("number"!=typeof s&&(s=0),s+1>(b=e).length||-1===b.indexOf(".",s)?"argument":"property");i='The "'.concat(e,'" ').concat(l," ").concat(d," ").concat(o(a,"type"))}return i+". Received type ".concat(c(f))}),TypeError),b("ERR_INVALID_ARG_VALUE",(function(e,a){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===n&&(n=t(40537));var f=n.inspect(a);return f.length>128&&(f="".concat(f.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(c,". Received ").concat(f)}),TypeError,RangeError),b("ERR_INVALID_RETURN_VALUE",(function(e,a,t){var f;return f=t&&t.constructor&&t.constructor.name?"instance of ".concat(t.constructor.name):"type ".concat(c(t)),"Expected ".concat(e,' to be returned from the "').concat(a,'"')+" function but got ".concat(f,".")}),TypeError),b("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,a=new Array(e),c=0;c0,"At least one arg needs to be specified");var f="The ",d=a.length;switch(a=a.map((function(e){return'"'.concat(e,'"')})),d){case 1:f+="".concat(a[0]," argument");break;case 2:f+="".concat(a[0]," and ").concat(a[1]," arguments");break;default:f+=a.slice(0,d-1).join(", "),f+=", and ".concat(a[d-1]," arguments")}return"".concat(f," must be specified")}),TypeError),e.exports.codes=i},82299:(e,a,t)=>{"use strict";function c(e,a){return function(e){if(Array.isArray(e))return e}(e)||function(e,a){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var c,f,d,r,n=[],i=!0,b=!1;try{if(d=(t=t.call(e)).next,0===a){if(Object(t)!==t)return;i=!1}else for(;!(i=(c=d.call(t)).done)&&(n.push(c.value),n.length!==a);i=!0);}catch(e){b=!0,f=e}finally{try{if(!i&&null!=t.return&&(r=t.return(),Object(r)!==r))return}finally{if(b)throw f}}return n}}(e,a)||function(e,a){if(e){if("string"==typeof e)return f(e,a);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?f(e,a):void 0}}(e,a)||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.")}()}function f(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,c=new Array(a);t10)return!0;for(var a=0;a57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function P(e){return Object.keys(e).filter(N).concat(o(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function R(e,a){if(e===a)return 0;for(var t=e.length,c=a.length,f=0,d=Math.min(t,c);f{const c=t(36209),f=t(10943),d=t(51847),r=t(86679),n=t(65435),i=255===new Uint8Array(Uint16Array.of(255).buffer)[0];function b(e){switch(e){case"ascii":return c;case"base64":return f;case"hex":return d;case"utf8":case"utf-8":case void 0:return r;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n;default:throw new Error(`Unknown encoding: ${e}`)}}function o(e){return e instanceof Uint8Array}function s(e,a,t){return"string"==typeof e?function(e,a){const t=b(a),c=new Uint8Array(t.byteLength(e));return t.write(c,e,0,c.byteLength),c}(e,a):Array.isArray(e)?function(e){const a=new Uint8Array(e.length);return a.set(e),a}(e):ArrayBuffer.isView(e)?function(e){const a=new Uint8Array(e.byteLength);return a.set(e),a}(e):function(e,a,t){return new Uint8Array(e,a,t)}(e,a,t)}function l(e,a,t,c,f){if(0===e.byteLength)return-1;if("string"==typeof t?(c=t,t=0):void 0===t?t=f?0:e.length-1:t<0&&(t+=e.byteLength),t>=e.byteLength){if(f)return-1;t=e.byteLength-1}else if(t<0){if(!f)return-1;t=0}if("string"==typeof a)a=s(a,c);else if("number"==typeof a)return a&=255,f?e.indexOf(a,t):e.lastIndexOf(a,t);if(0===a.byteLength)return-1;if(f){let c=-1;for(let f=t;fe.byteLength&&(t=e.byteLength-a.byteLength);for(let c=t;c>=0;c--){let t=!0;for(let f=0;ff)return 1}return e.byteLength>a.byteLength?1:e.byteLengthe+a.byteLength),0));const t=new Uint8Array(a);let c=0;for(const a of e){if(c+a.byteLength>t.byteLength){const e=a.subarray(0,t.byteLength-c);return t.set(e,c),t}t.set(a,c),c+=a.byteLength}return t},copy:function(e,a,t=0,c=0,f=e.byteLength){if(f>0&&f=e.byteLength)throw new RangeError("sourceStart is out of range");if(f<0)throw new RangeError("sourceEnd is out of range");t>=a.byteLength&&(t=a.byteLength),f>e.byteLength&&(f=e.byteLength),a.byteLength-t=f||c<=t?"":(t<0&&(t=0),c>f&&(c=f),(0!==t||c{function a(e){return e.length}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;let t="";for(let c=0;c{const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256);for(let e=0;e<64;e++)t[a.charCodeAt(e)]=e;function c(e){let a=e.length;return 61===e.charCodeAt(a-1)&&a--,a>1&&61===e.charCodeAt(a-1)&&a--,3*a>>>2}t[45]=62,t[95]=63,e.exports={byteLength:c,toString:function(e){const t=e.byteLength;let c="";for(let f=0;f>2]+a[(3&e[f])<<4|e[f+1]>>4]+a[(15&e[f+1])<<2|e[f+2]>>6]+a[63&e[f+2]];return t%3==2?c=c.substring(0,c.length-1)+"=":t%3==1&&(c=c.substring(0,c.length-2)+"=="),c},write:function(e,a,f=0,d=c(a)){const r=Math.min(d,e.byteLength-f);for(let c=0,f=0;f>4,e[f++]=(15&r)<<4|n>>2,e[f++]=(3&n)<<6|63&i}return r}}},51847:e=>{function a(e){return e.length>>>1}function t(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:void 0}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;e=new DataView(e.buffer,e.byteOffset,a);let t="",c=0;for(let f=a-a%4;c{function a(e){return 2*e.length}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;let t="";for(let c=0;c>8,r=f%256;e[c+2*a]=r,e[c+2*a+1]=d}return d}}},86679:e=>{function a(e){let a=0;for(let t=0,c=e.length;t=55296&&f<=56319&&t+1=56320&&c<=57343){a+=4,t++;continue}}a+=f<=127?1:f<=2047?2:3}return a}let t,c;if("undefined"!=typeof TextDecoder){const e=new TextDecoder;t=function(a){return e.decode(a)}}else t=function(e){const a=e.byteLength;let t="",c=0;for(;c0){let a=0;for(;a>c,c-=6;c>=0;)e[n++]=128|a>>c&63,c-=6;r+=a>=65536?2:1}return d};e.exports={byteLength:a,toString:t,write:c}},67526:(e,a)=>{"use strict";a.byteLength=function(e){var a=n(e),t=a[0],c=a[1];return 3*(t+c)/4-c},a.toByteArray=function(e){var a,t,d=n(e),r=d[0],i=d[1],b=new f(function(e,a,t){return 3*(a+t)/4-t}(0,r,i)),o=0,s=i>0?r-4:r;for(t=0;t>16&255,b[o++]=a>>8&255,b[o++]=255&a;return 2===i&&(a=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,b[o++]=255&a),1===i&&(a=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,b[o++]=a>>8&255,b[o++]=255&a),b},a.fromByteArray=function(e){for(var a,c=e.length,f=c%3,d=[],r=16383,n=0,b=c-f;nb?b:n+r));return 1===f?(a=e[c-1],d.push(t[a>>2]+t[a<<4&63]+"==")):2===f&&(a=(e[c-2]<<8)+e[c-1],d.push(t[a>>10]+t[a>>4&63]+t[a<<2&63]+"=")),d.join("")};for(var t=[],c=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)t[r]=d[r],c[d.charCodeAt(r)]=r;function n(e){var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");return-1===t&&(t=a),[t,t===a?0:4-t%4]}function i(e,a,c){for(var f,d,r=[],n=a;n>18&63]+t[d>>12&63]+t[d>>6&63]+t[63&d]);return r.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},92096:(e,a,t)=>{var c;e=t.nmd(e);var f=function(e){"use strict";var a=1e7,t=9007199254740992,c=l(t),d="0123456789abcdefghijklmnopqrstuvwxyz",r="function"==typeof BigInt;function n(e,a,t,c){return void 0===e?n[0]:void 0===a||10==+a&&!t?Z(e):q(e,a,t,c)}function i(e,a){this.value=e,this.sign=a,this.isSmall=!1}function b(e){this.value=e,this.sign=e<0,this.isSmall=!0}function o(e){this.value=e}function s(e){return-t0?Math.floor(e):Math.ceil(e)}function m(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(f=0;f=b?1:0,n[f]=c-i*b;for(;f0&&n.push(i),n}function x(e,a){return e.length>=a.length?m(e,a):m(a,e)}function y(e,t){var c,f,d=e.length,r=new Array(d),n=a;for(f=0;f0;)r[f++]=t%n,t=Math.floor(t/n);return r}function A(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(c=0;c0;)r[f++]=i%n,i=Math.floor(i/n);return r}function I(e,a){for(var t=[];a-- >0;)t.push(0);return t.concat(e)}function E(e,a){var t=Math.max(e.length,a.length);if(t<=30)return w(e,a);t=Math.ceil(t/2);var c=e.slice(t),f=e.slice(0,t),d=a.slice(t),r=a.slice(0,t),n=E(f,r),i=E(c,d),b=E(x(f,c),x(r,d)),o=x(x(n,I(A(A(b,n),i),t)),I(i,2*t));return h(o),o}function C(e,t,c){return new i(e=0;--c)d=(r=d*b+e[c])-(f=g(r/t))*t,i[c]=0|f;return[i,0|d]}function L(e,t){var c,f=Z(t);if(r)return[new o(e.value/f.value),new o(e.value%f.value)];var d,s=e.value,m=f.value;if(0===m)throw new Error("Cannot divide by zero");if(e.isSmall)return f.isSmall?[new b(g(s/m)),new b(s%m)]:[n[0],e];if(f.isSmall){if(1===m)return[e,n[0]];if(-1==m)return[e.negate(),n[0]];var x=Math.abs(m);if(x=0;f--){for(c=l-1,x[f+s]!==g&&(c=Math.floor((x[f+s]*l+x[f+s-1])/g)),d=0,r=0,i=y.length,n=0;nb&&(d=(d+1)*l),c=Math.ceil(d/r);do{if(S(n=_(t,c),s)<=0)break;c--}while(c);o.push(c),s=A(s,n)}return o.reverse(),[u(o),u(s)]}(s,m),d=c[0];var w=e.sign!==f.sign,I=c[1],E=e.sign;return"number"==typeof d?(w&&(d=-d),d=new b(d)):d=new i(d,w),"number"==typeof I?(E&&(I=-I),I=new b(I)):I=new i(I,E),[d,I]}function S(e,a){if(e.length!==a.length)return e.length>a.length?1:-1;for(var t=e.length-1;t>=0;t--)if(e[t]!==a[t])return e[t]>a[t]?1:-1;return 0}function k(e){var a=e.abs();return!a.isUnit()&&(!!(a.equals(2)||a.equals(3)||a.equals(5))||!(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))&&(!!a.lesser(49)||void 0))}function N(e,a){for(var t,c,d,r=e.prev(),n=r,i=0;n.isEven();)n=n.divide(2),i++;e:for(c=0;c=0?c=A(e,a):(c=A(a,e),t=!t),"number"==typeof(c=u(c))?(t&&(c=-c),new b(c)):new i(c,t)}(t,c,this.sign)},i.prototype.minus=i.prototype.subtract,b.prototype.subtract=function(e){var a=Z(e),t=this.value;if(t<0!==a.sign)return this.add(a.negate());var c=a.value;return a.isSmall?new b(t-c):v(c,Math.abs(t),t>=0)},b.prototype.minus=b.prototype.subtract,o.prototype.subtract=function(e){return new o(this.value-Z(e).value)},o.prototype.minus=o.prototype.subtract,i.prototype.negate=function(){return new i(this.value,!this.sign)},b.prototype.negate=function(){var e=this.sign,a=new b(-this.value);return a.sign=!e,a},o.prototype.negate=function(){return new o(-this.value)},i.prototype.abs=function(){return new i(this.value,!1)},b.prototype.abs=function(){return new b(Math.abs(this.value))},o.prototype.abs=function(){return new o(this.value>=0?this.value:-this.value)},i.prototype.multiply=function(e){var t,c,f,d=Z(e),r=this.value,b=d.value,o=this.sign!==d.sign;if(d.isSmall){if(0===b)return n[0];if(1===b)return this;if(-1===b)return this.negate();if((t=Math.abs(b))0?E(r,b):w(r,b),o)},i.prototype.times=i.prototype.multiply,b.prototype._multiplyBySmall=function(e){return s(e.value*this.value)?new b(e.value*this.value):C(Math.abs(e.value),l(Math.abs(this.value)),this.sign!==e.sign)},i.prototype._multiplyBySmall=function(e){return 0===e.value?n[0]:1===e.value?this:-1===e.value?this.negate():C(Math.abs(e.value),this.value,this.sign!==e.sign)},b.prototype.multiply=function(e){return Z(e)._multiplyBySmall(this)},b.prototype.times=b.prototype.multiply,o.prototype.multiply=function(e){return new o(this.value*Z(e).value)},o.prototype.times=o.prototype.multiply,i.prototype.square=function(){return new i(M(this.value),!1)},b.prototype.square=function(){var e=this.value*this.value;return s(e)?new b(e):new i(M(l(Math.abs(this.value))),!1)},o.prototype.square=function(e){return new o(this.value*this.value)},i.prototype.divmod=function(e){var a=L(this,e);return{quotient:a[0],remainder:a[1]}},o.prototype.divmod=b.prototype.divmod=i.prototype.divmod,i.prototype.divide=function(e){return L(this,e)[0]},o.prototype.over=o.prototype.divide=function(e){return new o(this.value/Z(e).value)},b.prototype.over=b.prototype.divide=i.prototype.over=i.prototype.divide,i.prototype.mod=function(e){return L(this,e)[1]},o.prototype.mod=o.prototype.remainder=function(e){return new o(this.value%Z(e).value)},b.prototype.remainder=b.prototype.mod=i.prototype.remainder=i.prototype.mod,i.prototype.pow=function(e){var a,t,c,f=Z(e),d=this.value,r=f.value;if(0===r)return n[1];if(0===d)return n[0];if(1===d)return n[1];if(-1===d)return f.isEven()?n[1]:n[-1];if(f.sign)return n[0];if(!f.isSmall)throw new Error("The exponent "+f.toString()+" is too large.");if(this.isSmall&&s(a=Math.pow(d,r)))return new b(g(a));for(t=this,c=n[1];!0&r&&(c=c.times(t),--r),0!==r;)r/=2,t=t.square();return c},b.prototype.pow=i.prototype.pow,o.prototype.pow=function(e){var a=Z(e),t=this.value,c=a.value,f=BigInt(0),d=BigInt(1),r=BigInt(2);if(c===f)return n[1];if(t===f)return n[0];if(t===d)return n[1];if(t===BigInt(-1))return a.isEven()?n[1]:n[-1];if(a.isNegative())return new o(f);for(var i=this,b=n[1];(c&d)===d&&(b=b.times(i),--c),c!==f;)c/=r,i=i.square();return b},i.prototype.modPow=function(e,a){if(e=Z(e),(a=Z(a)).isZero())throw new Error("Cannot take modPow with modulus 0");var t=n[1],c=this.mod(a);for(e.isNegative()&&(e=e.multiply(n[-1]),c=c.modInv(a));e.isPositive();){if(c.isZero())return n[0];e.isOdd()&&(t=t.multiply(c).mod(a)),e=e.divide(2),c=c.square().mod(a)}return t},o.prototype.modPow=b.prototype.modPow=i.prototype.modPow,i.prototype.compareAbs=function(e){var a=Z(e),t=this.value,c=a.value;return a.isSmall?1:S(t,c)},b.prototype.compareAbs=function(e){var a=Z(e),t=Math.abs(this.value),c=a.value;return a.isSmall?t===(c=Math.abs(c))?0:t>c?1:-1:-1},o.prototype.compareAbs=function(e){var a=this.value,t=Z(e).value;return(a=a>=0?a:-a)===(t=t>=0?t:-t)?0:a>t?1:-1},i.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return this.sign!==a.sign?a.sign?1:-1:a.isSmall?this.sign?-1:1:S(t,c)*(this.sign?-1:1)},i.prototype.compareTo=i.prototype.compare,b.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return a.isSmall?t==c?0:t>c?1:-1:t<0!==a.sign?t<0?-1:1:t<0?1:-1},b.prototype.compareTo=b.prototype.compare,o.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=this.value,t=Z(e).value;return a===t?0:a>t?1:-1},o.prototype.compareTo=o.prototype.compare,i.prototype.equals=function(e){return 0===this.compare(e)},o.prototype.eq=o.prototype.equals=b.prototype.eq=b.prototype.equals=i.prototype.eq=i.prototype.equals,i.prototype.notEquals=function(e){return 0!==this.compare(e)},o.prototype.neq=o.prototype.notEquals=b.prototype.neq=b.prototype.notEquals=i.prototype.neq=i.prototype.notEquals,i.prototype.greater=function(e){return this.compare(e)>0},o.prototype.gt=o.prototype.greater=b.prototype.gt=b.prototype.greater=i.prototype.gt=i.prototype.greater,i.prototype.lesser=function(e){return this.compare(e)<0},o.prototype.lt=o.prototype.lesser=b.prototype.lt=b.prototype.lesser=i.prototype.lt=i.prototype.lesser,i.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},o.prototype.geq=o.prototype.greaterOrEquals=b.prototype.geq=b.prototype.greaterOrEquals=i.prototype.geq=i.prototype.greaterOrEquals,i.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},o.prototype.leq=o.prototype.lesserOrEquals=b.prototype.leq=b.prototype.lesserOrEquals=i.prototype.leq=i.prototype.lesserOrEquals,i.prototype.isEven=function(){return!(1&this.value[0])},b.prototype.isEven=function(){return!(1&this.value)},o.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},i.prototype.isOdd=function(){return!(1&~this.value[0])},b.prototype.isOdd=function(){return!(1&~this.value)},o.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},i.prototype.isPositive=function(){return!this.sign},b.prototype.isPositive=function(){return this.value>0},o.prototype.isPositive=b.prototype.isPositive,i.prototype.isNegative=function(){return this.sign},b.prototype.isNegative=function(){return this.value<0},o.prototype.isNegative=b.prototype.isNegative,i.prototype.isUnit=function(){return!1},b.prototype.isUnit=function(){return 1===Math.abs(this.value)},o.prototype.isUnit=function(){return this.abs().value===BigInt(1)},i.prototype.isZero=function(){return!1},b.prototype.isZero=function(){return 0===this.value},o.prototype.isZero=function(){return this.value===BigInt(0)},i.prototype.isDivisibleBy=function(e){var a=Z(e);return!a.isZero()&&(!!a.isUnit()||(0===a.compareAbs(2)?this.isEven():this.mod(a).isZero()))},o.prototype.isDivisibleBy=b.prototype.isDivisibleBy=i.prototype.isDivisibleBy,i.prototype.isPrime=function(a){var t=k(this);if(t!==e)return t;var c=this.abs(),d=c.bitLength();if(d<=64)return N(c,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var r=Math.log(2)*d.toJSNumber(),n=Math.ceil(!0===a?2*Math.pow(r,2):r),i=[],b=0;b-t?new b(e-1):new i(c,!0)},o.prototype.prev=function(){return new o(this.value-BigInt(1))};for(var P=[1];2*P[P.length-1]<=a;)P.push(2*P[P.length-1]);var R=P.length,O=P[R-1];function D(e){return Math.abs(e)<=a}function T(e,a,t){a=Z(a);for(var c=e.isNegative(),d=a.isNegative(),r=c?e.not():e,n=d?a.not():a,i=0,b=0,o=null,s=null,l=[];!r.isZero()||!n.isZero();)i=(o=L(r,O))[1].toJSNumber(),c&&(i=O-1-i),b=(s=L(n,O))[1].toJSNumber(),d&&(b=O-1-b),r=o[0],n=s[0],l.push(t(i,b));for(var u=0!==t(c?1:0,d?1:0)?f(-1):f(0),h=l.length-1;h>=0;h-=1)u=u.multiply(O).add(f(l[h]));return u}i.prototype.shiftLeft=function(e){var a=Z(e).toJSNumber();if(!D(a))throw new Error(String(a)+" is too large for shifting.");if(a<0)return this.shiftRight(-a);var t=this;if(t.isZero())return t;for(;a>=R;)t=t.multiply(O),a-=R-1;return t.multiply(P[a])},o.prototype.shiftLeft=b.prototype.shiftLeft=i.prototype.shiftLeft,i.prototype.shiftRight=function(e){var a,t=Z(e).toJSNumber();if(!D(t))throw new Error(String(t)+" is too large for shifting.");if(t<0)return this.shiftLeft(-t);for(var c=this;t>=R;){if(c.isZero()||c.isNegative()&&c.isUnit())return c;c=(a=L(c,O))[1].isNegative()?a[0].prev():a[0],t-=R-1}return(a=L(c,P[t]))[1].isNegative()?a[0].prev():a[0]},o.prototype.shiftRight=b.prototype.shiftRight=i.prototype.shiftRight,i.prototype.not=function(){return this.negate().prev()},o.prototype.not=b.prototype.not=i.prototype.not,i.prototype.and=function(e){return T(this,e,(function(e,a){return e&a}))},o.prototype.and=b.prototype.and=i.prototype.and,i.prototype.or=function(e){return T(this,e,(function(e,a){return e|a}))},o.prototype.or=b.prototype.or=i.prototype.or,i.prototype.xor=function(e){return T(this,e,(function(e,a){return e^a}))},o.prototype.xor=b.prototype.xor=i.prototype.xor;var F=1<<30;function Q(e){var t=e.value,c="number"==typeof t?t|F:"bigint"==typeof t?t|BigInt(F):t[0]+t[1]*a|1073758208;return c&-c}function U(e,a){if(a.compareTo(e)<=0){var t=U(e,a.square(a)),c=t.p,d=t.e,r=c.multiply(a);return r.compareTo(e)<=0?{p:r,e:2*d+1}:{p:c,e:2*d}}return{p:f(1),e:0}}function j(e,a){return e=Z(e),a=Z(a),e.greater(a)?e:a}function H(e,a){return e=Z(e),a=Z(a),e.lesser(a)?e:a}function $(e,a){if(e=Z(e).abs(),a=Z(a).abs(),e.equals(a))return e;if(e.isZero())return a;if(a.isZero())return e;for(var t,c,f=n[1];e.isEven()&&a.isEven();)t=H(Q(e),Q(a)),e=e.divide(t),a=a.divide(t),f=f.multiply(t);for(;e.isEven();)e=e.divide(Q(e));do{for(;a.isEven();)a=a.divide(Q(a));e.greater(a)&&(c=a,a=e,e=c),a=a.subtract(e)}while(!a.isZero());return f.isUnit()?e:e.multiply(f)}i.prototype.bitLength=function(){var e=this;return e.compareTo(f(0))<0&&(e=e.negate().subtract(f(1))),0===e.compareTo(f(0))?f(0):f(U(e,f(2)).e).add(f(1))},o.prototype.bitLength=b.prototype.bitLength=i.prototype.bitLength;var q=function(e,a,t,c){t=t||d,e=String(e),c||(e=e.toLowerCase(),t=t.toLowerCase());var f,r=e.length,n=Math.abs(a),i={};for(f=0;f=n){if("1"===s&&1===n)continue;throw new Error(s+" is not a valid digit in base "+a+".")}a=Z(a);var b=[],o="-"===e[0];for(f=o?1:0;f"!==e[f]&&f=0;c--)f=f.add(e[c].times(d)),d=d.times(a);return t?f.negate():f}function z(e,a){if((a=f(a)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(a.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var t=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return t.unshift([1]),{value:[].concat.apply([],t),isNegative:!1}}var c=!1;if(e.isNegative()&&a.isPositive()&&(c=!0,e=e.abs()),a.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:c};for(var d,r=[],n=e;n.isNegative()||n.compareAbs(a)>=0;){d=n.divmod(a),n=d.quotient;var i=d.remainder;i.isNegative()&&(i=a.minus(i).abs(),n=n.next()),r.push(i.toJSNumber())}return r.push(n.toJSNumber()),{value:r.reverse(),isNegative:c}}function K(e,a,t){var c=z(e,a);return(c.isNegative?"-":"")+c.value.map((function(e){return function(e,a){return e<(a=a||d).length?a[e]:"<"+e+">"}(e,t)})).join("")}function V(e){if(s(+e)){var a=+e;if(a===g(a))return r?new o(BigInt(a)):new b(a);throw new Error("Invalid integer: "+e)}var t="-"===e[0];t&&(e=e.slice(1));var c=e.split(/e/i);if(c.length>2)throw new Error("Invalid integer: "+c.join("e"));if(2===c.length){var f=c[1];if("+"===f[0]&&(f=f.slice(1)),(f=+f)!==g(f)||!s(f))throw new Error("Invalid integer: "+f+" is not a valid exponent.");var d=c[0],n=d.indexOf(".");if(n>=0&&(f-=d.length-n-1,d=d.slice(0,n)+d.slice(n+1)),f<0)throw new Error("Cannot include negative exponent part for integers");e=d+=new Array(f+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);if(r)return new o(BigInt(t?"-"+e:e));for(var l=[],u=e.length,p=u-7;u>0;)l.push(+e.slice(p,u)),(p-=7)<0&&(p=0),u-=7;return h(l),new i(l,t)}function Z(e){return"number"==typeof e?function(e){if(r)return new o(BigInt(e));if(s(e)){if(e!==g(e))throw new Error(e+" is not an integer.");return new b(e)}return V(e.toString())}(e):"string"==typeof e?V(e):"bigint"==typeof e?new o(e):e}i.prototype.toArray=function(e){return z(this,e)},b.prototype.toArray=function(e){return z(this,e)},o.prototype.toArray=function(e){return z(this,e)},i.prototype.toString=function(a,t){if(a===e&&(a=10),10!==a||t)return K(this,a,t);for(var c,f=this.value,d=f.length,r=String(f[--d]);--d>=0;)c=String(f[d]),r+="0000000".slice(c.length)+c;return(this.sign?"-":"")+r},b.prototype.toString=function(a,t){return a===e&&(a=10),10!=a||t?K(this,a,t):String(this.value)},o.prototype.toString=b.prototype.toString,o.prototype.toJSON=i.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()},i.prototype.valueOf=function(){return parseInt(this.toString(),10)},i.prototype.toJSNumber=i.prototype.valueOf,b.prototype.valueOf=function(){return this.value},b.prototype.toJSNumber=b.prototype.valueOf,o.prototype.valueOf=o.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var J=0;J<1e3;J++)n[J]=Z(J),J>0&&(n[-J]=Z(-J));return n.one=n[1],n.zero=n[0],n.minusOne=n[-1],n.max=j,n.min=H,n.gcd=$,n.lcm=function(e,a){return e=Z(e).abs(),a=Z(a).abs(),e.divide($(e,a)).multiply(a)},n.isInstance=function(e){return e instanceof i||e instanceof b||e instanceof o},n.randBetween=function(e,t,c){e=Z(e),t=Z(t);var f=c||Math.random,d=H(e,t),r=j(e,t).subtract(d).add(1);if(r.isSmall)return d.add(Math.floor(f()*r));for(var i=z(r,a).value,b=[],o=!0,s=0;s{e.exports=t(85702)(t(86989))},4315:(e,a,t)=>{var c=t(48287).Buffer;const f=t(28399).Transform;e.exports=class extends f{constructor(e,a){super(a),this._engine=e,this._finalized=!1}_transform(e,a,t){let c=null;try{this.update(e,a)}catch(e){c=e}t(c)}_flush(e){let a=null;try{this.push(this.digest())}catch(e){a=e}e(a)}update(e,a){if(!c.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return c.isBuffer(e)||(e=c.from(e,a)),this._engine.update(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;let a=this._engine.digest();return void 0!==e&&(a=a.toString(e)),a}}},85702:(e,a,t)=>{const c=t(4315);e.exports=e=>(a,t)=>{const f=(a=>{switch("string"==typeof a?a.toLowerCase():a){case"blake224":return e.Blake224;case"blake256":return e.Blake256;case"blake384":return e.Blake384;case"blake512":return e.Blake512;default:throw new Error("Invald algorithm: "+a)}})(a);return new c(new f,t)}},34588:(e,a,t)=>{var c=t(48287).Buffer;class f{_lengthCarry(e){for(let a=0;a=a.length;){for(let c=this._blockOffset;c{var c=t(48287).Buffer;const f=t(23287),d=c.from([0]),r=c.from([128]);e.exports=class extends f{constructor(){super(),this._h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],this._zo=d,this._oo=r}digest(){this._padding();const e=c.alloc(28);for(let a=0;a<7;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},23287:(e,a,t)=>{var c=t(48287).Buffer;const f=t(34588),d=c.from([1]),r=c.from([129]),n=(e,a)=>(e<<32-a|e>>>a)>>>0;function i(e,a,t,c,d,r,i,b){const o=f.sigma,s=f.u256;e[c]=e[c]+((a[o[t][b]]^s[o[t][b+1]])>>>0)+e[d]>>>0,e[i]=n(e[i]^e[c],16),e[r]=e[r]+e[i]>>>0,e[d]=n(e[d]^e[r],12),e[c]=e[c]+((a[o[t][b+1]]^s[o[t][b]])>>>0)+e[d]>>>0,e[i]=n(e[i]^e[c],8),e[r]=e[r]+e[i]>>>0,e[d]=n(e[d]^e[r],7)}e.exports=class extends f{constructor(){super(),this._h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this._s=[0,0,0,0],this._block=c.alloc(64),this._blockOffset=0,this._length=[0,0],this._nullt=!1,this._zo=d,this._oo=r}_compress(){const e=f.u256,a=new Array(16),t=new Array(16);let c;for(c=0;c<16;++c)t[c]=this._block.readUInt32BE(4*c);for(c=0;c<8;++c)a[c]=this._h[c]>>>0;for(c=8;c<12;++c)a[c]=(this._s[c-8]^e[c-8])>>>0;for(c=12;c<16;++c)a[c]=e[c-8];for(this._nullt||(a[12]=(a[12]^this._length[0])>>>0,a[13]=(a[13]^this._length[0])>>>0,a[14]=(a[14]^this._length[1])>>>0,a[15]=(a[15]^this._length[1])>>>0),c=0;c<14;++c)i(a,t,c,0,4,8,12,0),i(a,t,c,1,5,9,13,2),i(a,t,c,2,6,10,14,4),i(a,t,c,3,7,11,15,6),i(a,t,c,0,5,10,15,8),i(a,t,c,1,6,11,12,10),i(a,t,c,2,7,8,13,12),i(a,t,c,3,4,9,14,14);for(c=0;c<16;++c)this._h[c%8]=(this._h[c%8]^a[c])>>>0;for(c=0;c<8;++c)this._h[c]=(this._h[c]^this._s[c%4])>>>0}_padding(){let e=this._length[0]+8*this._blockOffset,a=this._length[1];e>=4294967296&&(e-=4294967296,a+=1);const t=c.alloc(8);t.writeUInt32BE(a,0),t.writeUInt32BE(e,4),55===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<55?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(55-this._blockOffset),this.update(f.padding.slice(0,55-this._blockOffset))):(this._length[0]-=8*(64-this._blockOffset),this.update(f.padding.slice(0,64-this._blockOffset)),this._length[0]-=440,this.update(f.padding.slice(1,56)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=64,this.update(t)}digest(){this._padding();const e=c.alloc(32);for(let a=0;a<8;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},399:(e,a,t)=>{var c=t(48287).Buffer;const f=t(61070),d=c.from([0]),r=c.from([128]);e.exports=class extends f{constructor(){super(),this._h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428],this._zo=d,this._oo=r}digest(){this._padding();const e=c.alloc(48);for(let a=0;a<12;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},61070:(e,a,t)=>{var c=t(48287).Buffer;const f=t(34588),d=c.from([1]),r=c.from([129]);function n(e,a,t,c){let f=e[2*a]^e[2*t],d=e[2*a+1]^e[2*t+1];c>=32&&(d^=f,f^=d,d^=f,c-=32),0===c?(e[2*a]=f>>>0,e[2*a+1]=d>>>0):(e[2*a]=(f>>>c|d<<32-c)>>>0,e[2*a+1]=(d>>>c|f<<32-c)>>>0)}function i(e,a,t,c,d,r,i,b){const o=f.sigma,s=f.u512;let l;l=e[2*c+1]+((a[2*o[t][b]+1]^s[2*o[t][b+1]+1])>>>0)+e[2*d+1],e[2*c]=e[2*c]+((a[2*o[t][b]]^s[2*o[t][b+1]])>>>0)+e[2*d]+~~(l/4294967296)>>>0,e[2*c+1]=l>>>0,n(e,i,c,32),l=e[2*r+1]+e[2*i+1],e[2*r]=e[2*r]+e[2*i]+~~(l/4294967296)>>>0,e[2*r+1]=l>>>0,n(e,d,r,25),l=e[2*c+1]+((a[2*o[t][b+1]+1]^s[2*o[t][b]+1])>>>0)+e[2*d+1],e[2*c]=e[2*c]+((a[2*o[t][b+1]]^s[2*o[t][b]])>>>0)+e[2*d]+~~(l/4294967296)>>>0,e[2*c+1]=l>>>0,n(e,i,c,16),l=e[2*r+1]+e[2*i+1],e[2*r]=e[2*r]+e[2*i]+~~(l/4294967296)>>>0,e[2*r+1]=l>>>0,n(e,d,r,11)}e.exports=class extends f{constructor(){super(),this._h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this._s=[0,0,0,0,0,0,0,0],this._block=c.alloc(128),this._blockOffset=0,this._length=[0,0,0,0],this._nullt=!1,this._zo=d,this._oo=r}_compress(){const e=f.u512,a=new Array(32),t=new Array(32);let c;for(c=0;c<32;++c)t[c]=this._block.readUInt32BE(4*c);for(c=0;c<16;++c)a[c]=this._h[c]>>>0;for(c=16;c<24;++c)a[c]=(this._s[c-16]^e[c-16])>>>0;for(c=24;c<32;++c)a[c]=e[c-16];for(this._nullt||(a[24]=(a[24]^this._length[1])>>>0,a[25]=(a[25]^this._length[0])>>>0,a[26]=(a[26]^this._length[1])>>>0,a[27]=(a[27]^this._length[0])>>>0,a[28]=(a[28]^this._length[3])>>>0,a[29]=(a[29]^this._length[2])>>>0,a[30]=(a[30]^this._length[3])>>>0,a[31]=(a[31]^this._length[2])>>>0),c=0;c<16;++c)i(a,t,c,0,4,8,12,0),i(a,t,c,1,5,9,13,2),i(a,t,c,2,6,10,14,4),i(a,t,c,3,7,11,15,6),i(a,t,c,0,5,10,15,8),i(a,t,c,1,6,11,12,10),i(a,t,c,2,7,8,13,12),i(a,t,c,3,4,9,14,14);for(c=0;c<16;++c)this._h[c%8*2]=(this._h[c%8*2]^a[2*c])>>>0,this._h[c%8*2+1]=(this._h[c%8*2+1]^a[2*c+1])>>>0;for(c=0;c<8;++c)this._h[2*c]=(this._h[2*c]^this._s[c%4*2])>>>0,this._h[2*c+1]=(this._h[2*c+1]^this._s[c%4*2+1])>>>0}_padding(){const e=this._length.slice();e[0]+=8*this._blockOffset,this._lengthCarry(e);const a=c.alloc(16);for(let t=0;t<4;++t)a.writeUInt32BE(e[3-t],4*t);111===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<111?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(111-this._blockOffset),this.update(f.padding.slice(0,111-this._blockOffset))):(this._length[0]-=8*(128-this._blockOffset),this.update(f.padding.slice(0,128-this._blockOffset)),this._length[0]-=888,this.update(f.padding.slice(1,112)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=128,this.update(a)}digest(){this._padding();const e=c.alloc(64);for(let a=0;a<16;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},86989:(e,a,t)=>{e.exports={Blake224:t(48746),Blake256:t(23287),Blake384:t(399),Blake512:t(61070)}},91892:e=>{var a,t,c=(()=>{for(var e=new Uint8Array(128),a=0;a<64;a++)e[a<26?a+65:a<52?a+71:a<62?a-4:4*a-205]=a;return a=>{for(var t=a.length,c=new Uint8Array(3*(t-("="==a[t-1])-("="==a[t-2]))/4|0),f=0,d=0;f>4,c[d++]=n<<4|i>>2,c[d++]=i<<6|b}return c}})(),f=(a={"wasm-binary:./blake2b.wat"(e,a){a.exports=c("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMKvz8EwAIAIABCADcDACAAQgA3AwggAEIANwMQIABCADcDGCAAQgA3AyAgAEIANwMoIABCADcDMCAAQgA3AzggAEIANwNAIABCADcDSCAAQgA3A1AgAEIANwNYIABCADcDYCAAQgA3A2ggAEIANwNwIABCADcDeCAAQoiS853/zPmE6gBBACkDAIU3A4ABIABCu86qptjQ67O7f0EIKQMAhTcDiAEgAEKr8NP0r+68tzxBECkDAIU3A5ABIABC8e30+KWn/aelf0EYKQMAhTcDmAEgAELRhZrv+s+Uh9EAQSApAwCFNwOgASAAQp/Y+dnCkdqCm39BKCkDAIU3A6gBIABC6/qG2r+19sEfQTApAwCFNwOwASAAQvnC+JuRo7Pw2wBBOCkDAIU3A7gBIABCADcDwAEgAEIANwPIASAAQgA3A9ABC20BA38gAEHAAWohAyAAQcgBaiEEIAQpAwCnIQUCQANAIAEgAkYNASAFQYABRgRAIAMgAykDACAFrXw3AwBBACEFIAAQAwsgACAFaiABLQAAOgAAIAVBAWohBSABQQFqIQEMAAsLIAQgBa03AwALYQEDfyAAQcABaiEBIABByAFqIQIgASABKQMAIAIpAwB8NwMAIABCfzcD0AEgAikDAKchAwJAA0AgA0GAAUYNASAAIANqQQA6AAAgA0EBaiEDDAALCyACIAOtNwMAIAAQAwuqOwIgfgl/IABBgAFqISEgAEGIAWohIiAAQZABaiEjIABBmAFqISQgAEGgAWohJSAAQagBaiEmIABBsAFqIScgAEG4AWohKCAhKQMAIQEgIikDACECICMpAwAhAyAkKQMAIQQgJSkDACEFICYpAwAhBiAnKQMAIQcgKCkDACEIQoiS853/zPmE6gAhCUK7zqqm2NDrs7t/IQpCq/DT9K/uvLc8IQtC8e30+KWn/aelfyEMQtGFmu/6z5SH0QAhDUKf2PnZwpHagpt/IQ5C6/qG2r+19sEfIQ9C+cL4m5Gjs/DbACEQIAApAwAhESAAKQMIIRIgACkDECETIAApAxghFCAAKQMgIRUgACkDKCEWIAApAzAhFyAAKQM4IRggACkDQCEZIAApA0ghGiAAKQNQIRsgACkDWCEcIAApA2AhHSAAKQNoIR4gACkDcCEfIAApA3ghICANIAApA8ABhSENIA8gACkD0AGFIQ8gASAFIBF8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSASfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgE3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBR8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAVfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBd8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAYfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgGXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBp8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAbfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgHHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIB18fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAefHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgH3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFICB8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAffHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgG3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBV8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAZfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHICB8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAefHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggF3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBJ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAdfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgEXx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBN8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAcfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGHx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBZ8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAUfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHHx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBl8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAdfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgEXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBZ8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByATfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggIHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIB58fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAbfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgH3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBR8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAXfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBJ8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAafHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFXx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBh8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAafHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFHx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBJ8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAefHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHXx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBx8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAffHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgE3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBd8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAWfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgG3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBV8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCARfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgIHx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBl8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAafHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEXx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBZ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAYfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgE3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBV8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAbfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggIHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIB98fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiASfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgHHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB18fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAXfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBR8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAefHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgE3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIB18fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAXfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgG3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBF8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAcfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggGXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBR8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAVfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBh8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAWfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggIHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB98fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSASfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgGnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB18fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAWfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgEnx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGICB8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAffHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBV8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAbfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBh8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAXfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBp8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCATfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGXx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBx8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAefHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgHHx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBh8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAffHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBJ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAUfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBZ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiARfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgIHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBV8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAZfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggF3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBN8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAbfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgF3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFICB8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAffHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGnx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBx8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAUfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggEXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBl8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAdfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgE3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIB58fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAYfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggEnx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBV8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAbfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBt8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSATfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgGXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBV8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAYfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgF3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBJ8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAWfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgIHx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBx8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAafHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgH3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBR8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAdfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgHnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBF8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgISAhKQMAIAEgCYWFNwMAICIgIikDACACIAqFhTcDACAjICMpAwAgAyALhYU3AwAgJCAkKQMAIAQgDIWFNwMAICUgJSkDACAFIA2FhTcDACAmICYpAwAgBiAOhYU3AwAgJyAnKQMAIAcgD4WFNwMAICggKCkDACAIIBCFhTcDAAs=")}},function(){return t||(0,a[Object.keys(a)[0]])((t={exports:{}}).exports,t),t.exports})(),d=WebAssembly.compile(f);e.exports=async e=>(await WebAssembly.instantiate(await d,e)).exports},51685:(e,a,t)=>{var c=t(86889),f=t(35682),d=null,r="undefined"!=typeof WebAssembly&&t(91892)().then((e=>{d=e})),n=64,i=[];e.exports=p;var b=e.exports.BYTES_MIN=16,o=e.exports.BYTES_MAX=64,s=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),l=e.exports.KEYBYTES_MAX=64,u=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),h=e.exports.PERSONALBYTES=16;function p(e,a,t,f,r){if(!(this instanceof p))return new p(e,a,t,f,r);if(!d)throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");e||(e=32),!0!==r&&(c(e>=b,"digestLength must be at least "+b+", was given "+e),c(e<=o,"digestLength must be at most "+o+", was given "+e),null!=a&&(c(a instanceof Uint8Array,"key must be Uint8Array or Buffer"),c(a.length>=s,"key must be at least "+s+", was given "+a.length),c(a.length<=l,"key must be at least "+l+", was given "+a.length)),null!=t&&(c(t instanceof Uint8Array,"salt must be Uint8Array or Buffer"),c(t.length===u,"salt must be exactly "+u+", was given "+t.length)),null!=f&&(c(f instanceof Uint8Array,"personal must be Uint8Array or Buffer"),c(f.length===h,"personal must be exactly "+h+", was given "+f.length))),i.length||(i.push(n),n+=216),this.digestLength=e,this.finalized=!1,this.pointer=i.pop(),this._memory=new Uint8Array(d.memory.buffer),this._memory.fill(0,0,64),this._memory[0]=this.digestLength,this._memory[1]=a?a.length:0,this._memory[2]=1,this._memory[3]=1,t&&this._memory.set(t,32),f&&this._memory.set(f,48),this.pointer+216>this._memory.length&&this._realloc(this.pointer+216),d.blake2b_init(this.pointer,this.digestLength),a&&(this.update(a),this._memory.fill(0,n,n+a.length),this._memory[this.pointer+200]=128)}function g(){}p.prototype._realloc=function(e){d.memory.grow(Math.max(0,Math.ceil(Math.abs(e-this._memory.length)/65536))),this._memory=new Uint8Array(d.memory.buffer)},p.prototype.update=function(e){return c(!1===this.finalized,"Hash instance finalized"),c(e instanceof Uint8Array,"input must be Uint8Array or Buffer"),n+e.length>this._memory.length&&this._realloc(n+e.length),this._memory.set(e,n),d.blake2b_update(this.pointer,n,n+e.length),this},p.prototype.digest=function(e){if(c(!1===this.finalized,"Hash instance finalized"),this.finalized=!0,i.push(this.pointer),d.blake2b_final(this.pointer),!e||"binary"===e)return this._memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if("string"==typeof e)return f.toString(this._memory,e,this.pointer+128,this.pointer+128+this.digestLength);c(e instanceof Uint8Array&&e.length>=this.digestLength,"input must be Uint8Array or Buffer");for(var a=0;ae()),e):e(new Error("WebAssembly not supported"))},p.prototype.ready=p.ready,p.prototype.getPartialHash=function(){return this._memory.slice(this.pointer,this.pointer+216)},p.prototype.setPartialHash=function(e){this._memory.set(e,this.pointer)}},72206:(e,a,t)=>{var c=t(86889),f=t(51685);function d(e,a,t){var c=e[a]+e[t],f=e[a+1]+e[t+1];c>=4294967296&&f++,e[a]=c,e[a+1]=f}function r(e,a,t,c){var f=e[a]+t;t<0&&(f+=4294967296);var d=e[a+1]+c;f>=4294967296&&d++,e[a]=f,e[a+1]=d}function n(e,a){return e[a]^e[a+1]<<8^e[a+2]<<16^e[a+3]<<24}function i(e,a,t,c,f,n){var i=l[f],b=l[f+1],o=l[n],u=l[n+1];d(s,e,a),r(s,e,i,b);var h=s[c]^s[e],p=s[c+1]^s[e+1];s[c]=p,s[c+1]=h,d(s,t,c),h=s[a]^s[t],p=s[a+1]^s[t+1],s[a]=h>>>24^p<<8,s[a+1]=p>>>24^h<<8,d(s,e,a),r(s,e,o,u),h=s[c]^s[e],p=s[c+1]^s[e+1],s[c]=h>>>16^p<<16,s[c+1]=p>>>16^h<<16,d(s,t,c),h=s[a]^s[t],p=s[a+1]^s[t+1],s[a]=p>>>31^h<<1,s[a+1]=h>>>31^p<<1}var b=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),o=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),s=new Uint32Array(32),l=new Uint32Array(32);function u(e,a){var t=0;for(t=0;t<16;t++)s[t]=e.h[t],s[t+16]=b[t];for(s[24]=s[24]^e.t,s[25]=s[25]^e.t/4294967296,a&&(s[28]=~s[28],s[29]=~s[29]),t=0;t<32;t++)l[t]=n(e.b,4*t);for(t=0;t<12;t++)i(0,8,16,24,o[16*t+0],o[16*t+1]),i(2,10,18,26,o[16*t+2],o[16*t+3]),i(4,12,20,28,o[16*t+4],o[16*t+5]),i(6,14,22,30,o[16*t+6],o[16*t+7]),i(0,10,20,30,o[16*t+8],o[16*t+9]),i(2,12,22,24,o[16*t+10],o[16*t+11]),i(4,14,16,26,o[16*t+12],o[16*t+13]),i(6,8,18,28,o[16*t+14],o[16*t+15]);for(t=0;t<16;t++)e.h[t]=e.h[t]^s[t]^s[t+16]}var h=new Uint8Array([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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,a,t,c){h.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=e,h[0]=e,a&&(h[1]=a.length),h[2]=1,h[3]=1,t&&h.set(t,32),c&&h.set(c,48);for(var f=0;f<16;f++)this.h[f]=b[f]^n(h,4*f);a&&(g(this,a),this.c=128)}function g(e,a){for(var t=0;t=this.outlen,"out must have at least outlen bytes of space"),function(e,a){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;u(e,!0);for(var t=0;t>2]>>8*(3&t)}(this,a),"hex"===e?function(e){for(var a="",t=0;t=x,"outlen must be at least "+x+", was given "+e),c(e<=y,"outlen must be at most "+y+", was given "+e),null!=a&&(c(a instanceof Uint8Array,"key must be Uint8Array or Buffer"),c(a.length>=A,"key must be at least "+A+", was given "+a.length),c(a.length<=v,"key must be at most "+v+", was given "+a.length)),null!=t&&(c(t instanceof Uint8Array,"salt must be Uint8Array or Buffer"),c(t.length===w,"salt must be exactly "+w+", was given "+t.length)),null!=f&&(c(f instanceof Uint8Array,"personal must be Uint8Array or Buffer"),c(f.length===_,"personal must be exactly "+_+", was given "+f.length))),new m(e,a,t,f)},e.exports.ready=function(e){f.ready((function(){e()}))},e.exports.WASM_SUPPORTED=f.SUPPORTED,e.exports.WASM_LOADED=!1;var x=e.exports.BYTES_MIN=16,y=e.exports.BYTES_MAX=64,A=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),v=e.exports.KEYBYTES_MAX=64,w=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),_=e.exports.PERSONALBYTES=16;f.ready((function(a){a||(e.exports.WASM_LOADED=!0,e.exports=f)}))},39404:function(e,a,t){!function(e,a){"use strict";function c(e,a){if(!e)throw new Error(a||"Assertion failed")}function f(e,a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}function d(e,a,t){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(t=a,a=10),this._init(e||0,a||10,t||"be"))}var r;"object"==typeof e?e.exports=d:a.BN=d,d.BN=d,d.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(47790).Buffer}catch(e){}function n(e,a){var t=e.charCodeAt(a);return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void c(!1,"Invalid character in "+e)}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,f){for(var d=0,r=0,n=Math.min(e.length,t),i=a;i=49?b-49+10:b>=17?b-17+10:b,c(b>=0&&r0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this._strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this._strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{d.prototype[Symbol.for("nodejs.util.inspect.custom")]=s}catch(e){d.prototype.inspect=s}else d.prototype.inspect=s;function s(){return(this.red?""}var l=["","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"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t._strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215,(f+=2)>=26&&(f-=26,r--),t=0!==d||r!==this.length-1?l[6-i.length]+i+t:i+t}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=u[e],o=h[e];t="";var s=this.clone();for(s.negative=0;!s.isZero();){var p=s.modrn(o).toString(e);t=(s=s.idivn(o)).isZero()?p+t:l[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16,2)},r&&(d.prototype.toBuffer=function(e,a){return this.toArrayLike(r,e,a)}),d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){this._strip();var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0");var r=function(e,a){return e.allocUnsafe?e.allocUnsafe(a):new e(a)}(e,d);return this["_toArrayLike"+("le"===a?"LE":"BE")](r,f),r},d.prototype._toArrayLikeLE=function(e,a){for(var t=0,c=0,f=0,d=0;f>8&255),t>16&255),6===d?(t>24&255),c=0,d=0):(c=r>>>24,d+=2)}if(t=0&&(e[t--]=r>>8&255),t>=0&&(e[t--]=r>>16&255),6===d?(t>=0&&(e[t--]=r>>24&255),c=0,d=0):(c=r>>>24,d+=2)}if(t>=0)for(e[t--]=c;t>=0;)e[t--]=0},Math.clz32?d.prototype._countBits=function(e){return 32-Math.clz32(e)}:d.prototype._countBits=function(e){var a=e,t=0;return a>=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this._strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,D=R>>>13,T=0|r[9],F=8191&T,Q=T>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function m(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t._strip()}function x(e,a,t){return m(e,a,t)}function y(e,a){this.x=e,this.y=a}Math.imul||(g=p),d.prototype.mulTo=function(e,a){var t=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,a):t<63?p(this,e,a):t<1024?m(this,e,a):x(this,e,a)},y.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},y.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,t+=d/67108864|0,t+=r>>>26,this.words[f]=67108863&r}return 0!==t&&(this.words[f]=t,this.length++),a?this.ineg():this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f&1}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this._strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this._strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n._strip(),c._strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modrn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modrn=function(e){var a=e<0;a&&(e=-e),c(e<=67108863);for(var t=(1<<26)%e,f=0,d=this.length-1;d>=0;d--)f=(t*f+(0|this.words[d]))%e;return a?-f:f},d.prototype.modn=function(e){return this.modrn(e)},d.prototype.idivn=function(e){var a=e<0;a&&(e=-e),c(e<=67108863);for(var t=0,f=this.length-1;f>=0;f--){var d=(0|this.words[f])+67108864*t;this.words[f]=d/e|0,t=d%e}return this._strip(),a?this.ineg():this},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this._strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new C(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var A={k256:null,p224:null,p192:null,p25519:null};function v(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function I(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}v.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},v.prototype.split=function(e,a){e.iushrn(this.n,0,a)},v.prototype.imulK=function(e){return e.imul(this.k)},f(w,v),w.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(A[e])return A[e];var a;if("k256"===e)a=new w;else if("p224"===e)a=new _;else if("p192"===e)a=new I;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new E}return A[e]=a,a},C.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(o(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},C.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},C.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},C.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},C.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},C.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},C.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},C.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},C.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new M(e)},f(M,C),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},M.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},M.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},15037:(e,a,t)=>{var c;function f(e){this.rand=e}if(e.exports=function(e){return c||(c=new f(null)),c.generate(e)},e.exports.Rand=f,f.prototype.generate=function(e){return this._rand(e)},f.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var a=new Uint8Array(e),t=0;t{var c=t(92861).Buffer;function f(e){c.isBuffer(e)||(e=c.from(e));for(var a=e.length/4|0,t=new Array(a),f=0;f>>24]^o[h>>>16&255]^s[p>>>8&255]^l[255&g]^a[m++],r=b[h>>>24]^o[p>>>16&255]^s[g>>>8&255]^l[255&u]^a[m++],n=b[p>>>24]^o[g>>>16&255]^s[u>>>8&255]^l[255&h]^a[m++],i=b[g>>>24]^o[u>>>16&255]^s[h>>>8&255]^l[255&p]^a[m++],u=d,h=r,p=n,g=i;return d=(c[u>>>24]<<24|c[h>>>16&255]<<16|c[p>>>8&255]<<8|c[255&g])^a[m++],r=(c[h>>>24]<<24|c[p>>>16&255]<<16|c[g>>>8&255]<<8|c[255&u])^a[m++],n=(c[p>>>24]<<24|c[g>>>16&255]<<16|c[u>>>8&255]<<8|c[255&h])^a[m++],i=(c[g>>>24]<<24|c[u>>>16&255]<<16|c[h>>>8&255]<<8|c[255&p])^a[m++],[d>>>=0,r>>>=0,n>>>=0,i>>>=0]}var n=[0,1,2,4,8,16,32,64,128,27,54],i=function(){for(var e=new Array(256),a=0;a<256;a++)e[a]=a<128?a<<1:a<<1^283;for(var t=[],c=[],f=[[],[],[],[]],d=[[],[],[],[]],r=0,n=0,i=0;i<256;++i){var b=n^n<<1^n<<2^n<<3^n<<4;b=b>>>8^255&b^99,t[r]=b,c[b]=r;var o=e[r],s=e[o],l=e[s],u=257*e[b]^16843008*b;f[0][r]=u<<24|u>>>8,f[1][r]=u<<16|u>>>16,f[2][r]=u<<8|u>>>24,f[3][r]=u,u=16843009*l^65537*s^257*o^16843008*r,d[0][b]=u<<24|u>>>8,d[1][b]=u<<16|u>>>16,d[2][b]=u<<8|u>>>24,d[3][b]=u,0===r?r=n=1:(r=o^e[e[e[l^o]]],n^=e[e[n]])}return{SBOX:t,INV_SBOX:c,SUB_MIX:f,INV_SUB_MIX:d}}();function b(e){this._key=f(e),this._reset()}b.blockSize=16,b.keySize=32,b.prototype.blockSize=b.blockSize,b.prototype.keySize=b.keySize,b.prototype._reset=function(){for(var e=this._key,a=e.length,t=a+6,c=4*(t+1),f=[],d=0;d>>24,r=i.SBOX[r>>>24]<<24|i.SBOX[r>>>16&255]<<16|i.SBOX[r>>>8&255]<<8|i.SBOX[255&r],r^=n[d/a|0]<<24):a>6&&d%a==4&&(r=i.SBOX[r>>>24]<<24|i.SBOX[r>>>16&255]<<16|i.SBOX[r>>>8&255]<<8|i.SBOX[255&r]),f[d]=f[d-a]^r}for(var b=[],o=0;o>>24]]^i.INV_SUB_MIX[1][i.SBOX[l>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[l>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[255&l]]}this._nRounds=t,this._keySchedule=f,this._invKeySchedule=b},b.prototype.encryptBlockRaw=function(e){return r(e=f(e),this._keySchedule,i.SUB_MIX,i.SBOX,this._nRounds)},b.prototype.encryptBlock=function(e){var a=this.encryptBlockRaw(e),t=c.allocUnsafe(16);return t.writeUInt32BE(a[0],0),t.writeUInt32BE(a[1],4),t.writeUInt32BE(a[2],8),t.writeUInt32BE(a[3],12),t},b.prototype.decryptBlock=function(e){var a=(e=f(e))[1];e[1]=e[3],e[3]=a;var t=r(e,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX,this._nRounds),d=c.allocUnsafe(16);return d.writeUInt32BE(t[0],0),d.writeUInt32BE(t[3],4),d.writeUInt32BE(t[2],8),d.writeUInt32BE(t[1],12),d},b.prototype.scrub=function(){d(this._keySchedule),d(this._invKeySchedule),d(this._key)},e.exports.AES=b},92356:(e,a,t)=>{var c=t(50462),f=t(92861).Buffer,d=t(56168),r=t(56698),n=t(25892),i=t(30295),b=t(45122);function o(e,a,t,r){d.call(this);var i=f.alloc(4,0);this._cipher=new c.AES(a);var o=this._cipher.encryptBlock(i);this._ghash=new n(o),t=function(e,a,t){if(12===a.length)return e._finID=f.concat([a,f.from([0,0,0,1])]),f.concat([a,f.from([0,0,0,2])]);var c=new n(t),d=a.length,r=d%16;c.update(a),r&&(r=16-r,c.update(f.alloc(r,0))),c.update(f.alloc(8,0));var i=8*d,o=f.alloc(8);o.writeUIntBE(i,0,8),c.update(o),e._finID=c.state;var s=f.from(e._finID);return b(s),s}(this,t,o),this._prev=f.from(t),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=r,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}r(o,d),o.prototype._update=function(e){if(!this._called&&this._alen){var a=16-this._alen%16;a<16&&(a=f.alloc(a,0),this._ghash.update(a))}this._called=!0;var t=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(t),this._len+=e.length,t},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=i(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,a){var t=0;e.length!==a.length&&t++;for(var c=Math.min(e.length,a.length),f=0;f{var c=t(25799),f=t(36171),d=t(3219);a.createCipher=a.Cipher=c.createCipher,a.createCipheriv=a.Cipheriv=c.createCipheriv,a.createDecipher=a.Decipher=f.createDecipher,a.createDecipheriv=a.Decipheriv=f.createDecipheriv,a.listCiphers=a.getCiphers=function(){return Object.keys(d)}},36171:(e,a,t)=>{var c=t(92356),f=t(92861).Buffer,d=t(530),r=t(50650),n=t(56168),i=t(50462),b=t(68078);function o(e,a,t){n.call(this),this._cache=new s,this._last=void 0,this._cipher=new i.AES(a),this._prev=f.from(t),this._mode=e,this._autopadding=!0}function s(){this.cache=f.allocUnsafe(0)}function l(e,a,t){var n=d[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=f.from(t)),"GCM"!==n.mode&&t.length!==n.iv)throw new TypeError("invalid iv length "+t.length);if("string"==typeof a&&(a=f.from(a)),a.length!==n.key/8)throw new TypeError("invalid key length "+a.length);return"stream"===n.type?new r(n.module,a,t,!0):"auth"===n.type?new c(n.module,a,t,!0):new o(n.module,a,t)}t(56698)(o,n),o.prototype._update=function(e){var a,t;this._cache.add(e);for(var c=[];a=this._cache.get(this._autopadding);)t=this._mode.decrypt(this,a),c.push(t);return f.concat(c)},o.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var a=e[15];if(a<1||a>16)throw new Error("unable to decrypt data");for(var t=-1;++t16)return a=this.cache.slice(0,16),this.cache=this.cache.slice(16),a}else if(this.cache.length>=16)return a=this.cache.slice(0,16),this.cache=this.cache.slice(16),a;return null},s.prototype.flush=function(){if(this.cache.length)return this.cache},a.createDecipher=function(e,a){var t=d[e.toLowerCase()];if(!t)throw new TypeError("invalid suite type");var c=b(a,!1,t.key,t.iv);return l(e,c.key,c.iv)},a.createDecipheriv=l},25799:(e,a,t)=>{var c=t(530),f=t(92356),d=t(92861).Buffer,r=t(50650),n=t(56168),i=t(50462),b=t(68078);function o(e,a,t){n.call(this),this._cache=new l,this._cipher=new i.AES(a),this._prev=d.from(t),this._mode=e,this._autopadding=!0}t(56698)(o,n),o.prototype._update=function(e){var a,t;this._cache.add(e);for(var c=[];a=this._cache.get();)t=this._mode.encrypt(this,a),c.push(t);return d.concat(c)};var s=d.alloc(16,16);function l(){this.cache=d.allocUnsafe(0)}function u(e,a,t){var n=c[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");if("string"==typeof a&&(a=d.from(a)),a.length!==n.key/8)throw new TypeError("invalid key length "+a.length);if("string"==typeof t&&(t=d.from(t)),"GCM"!==n.mode&&t.length!==n.iv)throw new TypeError("invalid iv length "+t.length);return"stream"===n.type?new r(n.module,a,t):"auth"===n.type?new f(n.module,a,t):new o(n.module,a,t)}o.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(s))throw this._cipher.scrub(),new Error("data not multiple of block length")},o.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},l.prototype.add=function(e){this.cache=d.concat([this.cache,e])},l.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},l.prototype.flush=function(){for(var e=16-this.cache.length,a=d.allocUnsafe(e),t=-1;++t{var c=t(92861).Buffer,f=c.alloc(16,0);function d(e){var a=c.allocUnsafe(16);return a.writeUInt32BE(e[0]>>>0,0),a.writeUInt32BE(e[1]>>>0,4),a.writeUInt32BE(e[2]>>>0,8),a.writeUInt32BE(e[3]>>>0,12),a}function r(e){this.h=e,this.state=c.alloc(16,0),this.cache=c.allocUnsafe(0)}r.prototype.ghash=function(e){for(var a=-1;++a0;a--)c[a]=c[a]>>>1|(1&c[a-1])<<31;c[0]=c[0]>>>1,t&&(c[0]=c[0]^225<<24)}this.state=d(f)},r.prototype.update=function(e){var a;for(this.cache=c.concat([this.cache,e]);this.cache.length>=16;)a=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(a)},r.prototype.final=function(e,a){return this.cache.length&&this.ghash(c.concat([this.cache,f],16)),this.ghash(d([0,e,0,a])),this.state},e.exports=r},45122:e=>{e.exports=function(e){for(var a,t=e.length;t--;){if(255!==(a=e.readUInt8(t))){a++,e.writeUInt8(a,t);break}e.writeUInt8(0,t)}}},92884:(e,a,t)=>{var c=t(30295);a.encrypt=function(e,a){var t=c(a,e._prev);return e._prev=e._cipher.encryptBlock(t),e._prev},a.decrypt=function(e,a){var t=e._prev;e._prev=a;var f=e._cipher.decryptBlock(a);return c(f,t)}},46383:(e,a,t)=>{var c=t(92861).Buffer,f=t(30295);function d(e,a,t){var d=a.length,r=f(a,e._cache);return e._cache=e._cache.slice(d),e._prev=c.concat([e._prev,t?a:r]),r}a.encrypt=function(e,a,t){for(var f,r=c.allocUnsafe(0);a.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=c.allocUnsafe(0)),!(e._cache.length<=a.length)){r=c.concat([r,d(e,a,t)]);break}f=e._cache.length,r=c.concat([r,d(e,a.slice(0,f),t)]),a=a.slice(f)}return r}},55264:(e,a,t)=>{var c=t(92861).Buffer;function f(e,a,t){for(var c,f,r=-1,n=0;++r<8;)c=a&1<<7-r?128:0,n+=(128&(f=e._cipher.encryptBlock(e._prev)[0]^c))>>r%8,e._prev=d(e._prev,t?c:f);return n}function d(e,a){var t=e.length,f=-1,d=c.allocUnsafe(e.length);for(e=c.concat([e,c.from([a])]);++f>7;return d}a.encrypt=function(e,a,t){for(var d=a.length,r=c.allocUnsafe(d),n=-1;++n{var c=t(92861).Buffer;function f(e,a,t){var f=e._cipher.encryptBlock(e._prev)[0]^a;return e._prev=c.concat([e._prev.slice(1),c.from([t?a:f])]),f}a.encrypt=function(e,a,t){for(var d=a.length,r=c.allocUnsafe(d),n=-1;++n{var c=t(30295),f=t(92861).Buffer,d=t(45122);function r(e){var a=e._cipher.encryptBlockRaw(e._prev);return d(e._prev),a}a.encrypt=function(e,a){var t=Math.ceil(a.length/16),d=e._cache.length;e._cache=f.concat([e._cache,f.allocUnsafe(16*t)]);for(var n=0;n{a.encrypt=function(e,a){return e._cipher.encryptBlock(a)},a.decrypt=function(e,a){return e._cipher.decryptBlock(a)}},530:(e,a,t)=>{var c={ECB:t(52632),CBC:t(92884),CFB:t(46383),CFB8:t(86975),CFB1:t(55264),OFB:t(46843),CTR:t(63053),GCM:t(63053)},f=t(3219);for(var d in f)f[d].module=c[f[d].mode];e.exports=f},46843:(e,a,t)=>{var c=t(48287).Buffer,f=t(30295);function d(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}a.encrypt=function(e,a){for(;e._cache.length{var c=t(50462),f=t(92861).Buffer,d=t(56168);function r(e,a,t,r){d.call(this),this._cipher=new c.AES(a),this._prev=f.from(t),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=r,this._mode=e}t(56698)(r,d),r.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},r.prototype._final=function(){this._cipher.scrub()},e.exports=r},30125:(e,a,t)=>{var c=t(84050),f=t(1241),d=t(530),r=t(32438),n=t(68078);function i(e,a,t){if(e=e.toLowerCase(),d[e])return f.createCipheriv(e,a,t);if(r[e])return new c({key:a,iv:t,mode:e});throw new TypeError("invalid suite type")}function b(e,a,t){if(e=e.toLowerCase(),d[e])return f.createDecipheriv(e,a,t);if(r[e])return new c({key:a,iv:t,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}a.createCipher=a.Cipher=function(e,a){var t,c;if(e=e.toLowerCase(),d[e])t=d[e].key,c=d[e].iv;else{if(!r[e])throw new TypeError("invalid suite type");t=8*r[e].key,c=r[e].iv}var f=n(a,!1,t,c);return i(e,f.key,f.iv)},a.createCipheriv=a.Cipheriv=i,a.createDecipher=a.Decipher=function(e,a){var t,c;if(e=e.toLowerCase(),d[e])t=d[e].key,c=d[e].iv;else{if(!r[e])throw new TypeError("invalid suite type");t=8*r[e].key,c=r[e].iv}var f=n(a,!1,t,c);return b(e,f.key,f.iv)},a.createDecipheriv=a.Decipheriv=b,a.listCiphers=a.getCiphers=function(){return Object.keys(r).concat(f.getCiphers())}},84050:(e,a,t)=>{var c=t(56168),f=t(29560),d=t(56698),r=t(92861).Buffer,n={"des-ede3-cbc":f.CBC.instantiate(f.EDE),"des-ede3":f.EDE,"des-ede-cbc":f.CBC.instantiate(f.EDE),"des-ede":f.EDE,"des-cbc":f.CBC.instantiate(f.DES),"des-ecb":f.DES};function i(e){c.call(this);var a,t=e.mode.toLowerCase(),f=n[t];a=e.decrypt?"decrypt":"encrypt";var d=e.key;r.isBuffer(d)||(d=r.from(d)),"des-ede"!==t&&"des-ede-cbc"!==t||(d=r.concat([d,d.slice(0,8)]));var i=e.iv;r.isBuffer(i)||(i=r.from(i)),this._des=f.create({key:d,iv:i,type:a})}n.des=n["des-cbc"],n.des3=n["des-ede3-cbc"],e.exports=i,d(i,c),i.prototype._update=function(e){return r.from(this._des.update(e))},i.prototype._final=function(){return r.from(this._des.final())}},32438:(e,a)=>{a["des-ecb"]={key:8,iv:0},a["des-cbc"]=a.des={key:8,iv:8},a["des-ede3-cbc"]=a.des3={key:24,iv:8},a["des-ede3"]={key:24,iv:0},a["des-ede-cbc"]={key:16,iv:8},a["des-ede"]={key:16,iv:0}},67332:(e,a,t)=>{var c=t(48287).Buffer,f=t(39404),d=t(53209);function r(e){var a,t=e.modulus.byteLength();do{a=new f(d(t))}while(a.cmp(e.modulus)>=0||!a.umod(e.prime1)||!a.umod(e.prime2));return a}function n(e,a){var t=function(e){var a=r(e);return{blinder:a.toRed(f.mont(e.modulus)).redPow(new f(e.publicExponent)).fromRed(),unblinder:a.invm(e.modulus)}}(a),d=a.modulus.byteLength(),n=new f(e).mul(t.blinder).umod(a.modulus),i=n.toRed(f.mont(a.prime1)),b=n.toRed(f.mont(a.prime2)),o=a.coefficient,s=a.prime1,l=a.prime2,u=i.redPow(a.exponent1).fromRed(),h=b.redPow(a.exponent2).fromRed(),p=u.isub(h).imul(o).umod(s).imul(l);return h.iadd(p).imul(t.unblinder).umod(a.modulus).toArrayLike(c,"be",d)}n.getr=r,e.exports=n},55715:(e,a,t)=>{"use strict";e.exports=t(62951)},20:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(47108),d=t(46737),r=t(56698),n=t(35359),i=t(74847),b=t(62951);function o(e){d.Writable.call(this);var a=b[e];if(!a)throw new Error("Unknown message digest");this._hashType=a.hash,this._hash=f(a.hash),this._tag=a.id,this._signType=a.sign}function s(e){d.Writable.call(this);var a=b[e];if(!a)throw new Error("Unknown message digest");this._hash=f(a.hash),this._tag=a.id,this._signType=a.sign}function l(e){return new o(e)}function u(e){return new s(e)}Object.keys(b).forEach((function(e){b[e].id=c.from(b[e].id,"hex"),b[e.toLowerCase()]=b[e]})),r(o,d.Writable),o.prototype._write=function(e,a,t){this._hash.update(e),t()},o.prototype.update=function(e,a){return this._hash.update("string"==typeof e?c.from(e,a):e),this},o.prototype.sign=function(e,a){this.end();var t=this._hash.digest(),c=n(t,e,this._hashType,this._signType,this._tag);return a?c.toString(a):c},r(s,d.Writable),s.prototype._write=function(e,a,t){this._hash.update(e),t()},s.prototype.update=function(e,a){return this._hash.update("string"==typeof e?c.from(e,a):e),this},s.prototype.verify=function(e,a,t){var f="string"==typeof a?c.from(a,t):a;this.end();var d=this._hash.digest();return i(f,d,e,this._signType,this._tag)},e.exports={Sign:l,Verify:u,createSign:l,createVerify:u}},35359:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(83507),d=t(67332),r=t(86729).ec,n=t(39404),i=t(78170),b=t(64589);function o(e,a,t,d){if((e=c.from(e.toArray())).length0&&t.ishrn(c),t}function l(e,a,t){var d,r;do{for(d=c.alloc(0);8*d.length{"use strict";var c=t(92861).Buffer,f=t(39404),d=t(86729).ec,r=t(78170),n=t(64589);function i(e,a){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(a)>=0)throw new Error("invalid sig")}e.exports=function(e,a,t,b,o){var s=r(t);if("ec"===s.type){if("ecdsa"!==b&&"ecdsa/rsa"!==b)throw new Error("wrong public key type");return function(e,a,t){var c=n[t.data.algorithm.curve.join(".")];if(!c)throw new Error("unknown curve "+t.data.algorithm.curve.join("."));var f=new d(c),r=t.data.subjectPrivateKey.data;return f.verify(a,e,r)}(e,a,s)}if("dsa"===s.type){if("dsa"!==b)throw new Error("wrong public key type");return function(e,a,t){var c=t.data.p,d=t.data.q,n=t.data.g,b=t.data.pub_key,o=r.signature.decode(e,"der"),s=o.s,l=o.r;i(s,d),i(l,d);var u=f.mont(c),h=s.invm(d);return 0===n.toRed(u).redPow(new f(a).mul(h).mod(d)).fromRed().mul(b.toRed(u).redPow(l.mul(h).mod(d)).fromRed()).mod(c).mod(d).cmp(l)}(e,a,s)}if("rsa"!==b&&"ecdsa/rsa"!==b)throw new Error("wrong public key type");a=c.concat([o,a]);for(var l=s.modulus.byteLength(),u=[1],h=0;a.length+u.length+2{var a={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==a.call(e)}},26248:(e,a,t)=>{"use strict";var c=t(33225),f=Object.keys||function(e){var a=[];for(var t in e)a.push(t);return a};e.exports=s;var d=Object.create(t(15622));d.inherits=t(56698);var r=t(30206),n=t(7314);d.inherits(s,r);for(var i=f(n.prototype),b=0;b{"use strict";e.exports=d;var c=t(81816),f=Object.create(t(15622));function d(e){if(!(this instanceof d))return new d(e);c.call(this,e)}f.inherits=t(56698),f.inherits(d,c),d.prototype._transform=function(e,a,t){t(null,e)}},30206:(e,a,t)=>{"use strict";var c=t(33225);e.exports=x;var f,d=t(32240);x.ReadableState=m,t(37007).EventEmitter;var r=function(e,a){return e.listeners(a).length},n=t(5567),i=t(24116).Buffer,b=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},o=Object.create(t(15622));o.inherits=t(56698);var s=t(92668),l=void 0;l=s&&s.debuglog?s.debuglog("stream"):function(){};var u,h=t(20672),p=t(36278);o.inherits(x,n);var g=["error","close","destroy","pause","resume"];function m(e,a){e=e||{};var c=a instanceof(f=f||t(26248));this.objectMode=!!e.objectMode,c&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var d=e.highWaterMark,r=e.readableHighWaterMark,n=this.objectMode?16:16384;this.highWaterMark=d||0===d?d:c&&(r||0===r)?r:n,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=t(6427).I),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function x(e){if(f=f||t(26248),!(this instanceof x))return new x(e);this._readableState=new m(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),n.call(this)}function y(e,a,t,c,f){var d,r=e._readableState;return null===a?(r.reading=!1,function(e,a){if(!a.ended){if(a.decoder){var t=a.decoder.end();t&&t.length&&(a.buffer.push(t),a.length+=a.objectMode?1:t.length)}a.ended=!0,_(e)}}(e,r)):(f||(d=function(e,a){var t,c;return c=a,i.isBuffer(c)||c instanceof b||"string"==typeof a||void 0===a||e.objectMode||(t=new TypeError("Invalid non-string/buffer chunk")),t}(r,a)),d?e.emit("error",d):r.objectMode||a&&a.length>0?("string"==typeof a||r.objectMode||Object.getPrototypeOf(a)===i.prototype||(a=function(e){return i.from(e)}(a)),c?r.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):A(e,r,a,!0):r.ended?e.emit("error",new Error("stream.push() after EOF")):(r.reading=!1,r.decoder&&!t?(a=r.decoder.write(a),r.objectMode||0!==a.length?A(e,r,a,!1):E(e,r)):A(e,r,a,!1))):c||(r.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtha.highWaterMark&&(a.highWaterMark=function(e){return e>=v?e=v:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0))}function _(e){var a=e._readableState;a.needReadable=!1,a.emittedReadable||(l("emitReadable",a.flowing),a.emittedReadable=!0,a.sync?c.nextTick(I,e):I(e))}function I(e){l("emit readable"),e.emit("readable"),L(e)}function E(e,a){a.readingMore||(a.readingMore=!0,c.nextTick(C,e,a))}function C(e,a){for(var t=a.length;!a.reading&&!a.flowing&&!a.ended&&a.length=a.length?(t=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.head.data:a.buffer.concat(a.length),a.buffer.clear()):t=function(e,a,t){var c;return ed.length?d.length:e;if(r===d.length?f+=d:f+=d.slice(0,e),0==(e-=r)){r===d.length?(++c,t.next?a.head=t.next:a.head=a.tail=null):(a.head=t,t.data=d.slice(r));break}++c}return a.length-=c,f}(e,a):function(e,a){var t=i.allocUnsafe(e),c=a.head,f=1;for(c.data.copy(t),e-=c.data.length;c=c.next;){var d=c.data,r=e>d.length?d.length:e;if(d.copy(t,t.length-e,0,r),0==(e-=r)){r===d.length?(++f,c.next?a.head=c.next:a.head=a.tail=null):(a.head=c,c.data=d.slice(r));break}++f}return a.length-=f,t}(e,a),c}(e,a.buffer,a.decoder),t);var t}function k(e){var a=e._readableState;if(a.length>0)throw new Error('"endReadable()" called on non-empty stream');a.endEmitted||(a.ended=!0,c.nextTick(N,a,e))}function N(e,a){e.endEmitted||0!==e.length||(e.endEmitted=!0,a.readable=!1,a.emit("end"))}function P(e,a){for(var t=0,c=e.length;t=a.highWaterMark||a.ended))return l("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?k(this):_(this),null;if(0===(e=w(e,a))&&a.ended)return 0===a.length&&k(this),null;var c,f=a.needReadable;return l("need readable",f),(0===a.length||a.length-e0?S(e,a):null)?(a.needReadable=!0,e=0):a.length-=e,0===a.length&&(a.ended||(a.needReadable=!0),t!==e&&a.ended&&k(this)),null!==c&&this.emit("data",c),c},x.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},x.prototype.pipe=function(e,a){var t=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1,l("pipe count=%d opts=%j",f.pipesCount,a);var n=a&&!1===a.end||e===process.stdout||e===process.stderr?m:i;function i(){l("onend"),e.end()}f.endEmitted?c.nextTick(n):t.once("end",n),e.on("unpipe",(function a(c,d){l("onunpipe"),c===t&&d&&!1===d.hasUnpiped&&(d.hasUnpiped=!0,l("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",b),e.removeListener("error",h),e.removeListener("unpipe",a),t.removeListener("end",i),t.removeListener("end",m),t.removeListener("data",u),o=!0,!f.awaitDrain||e._writableState&&!e._writableState.needDrain||b())}));var b=function(e){return function(){var a=e._readableState;l("pipeOnDrain",a.awaitDrain),a.awaitDrain&&a.awaitDrain--,0===a.awaitDrain&&r(e,"data")&&(a.flowing=!0,L(e))}}(t);e.on("drain",b);var o=!1,s=!1;function u(a){l("ondata"),s=!1,!1!==e.write(a)||s||((1===f.pipesCount&&f.pipes===e||f.pipesCount>1&&-1!==P(f.pipes,e))&&!o&&(l("false write response, pause",f.awaitDrain),f.awaitDrain++,s=!0),t.pause())}function h(a){l("onerror",a),m(),e.removeListener("error",h),0===r(e,"error")&&e.emit("error",a)}function p(){e.removeListener("finish",g),m()}function g(){l("onfinish"),e.removeListener("close",p),m()}function m(){l("unpipe"),t.unpipe(e)}return t.on("data",u),function(e,a,t){if("function"==typeof e.prependListener)return e.prependListener(a,t);e._events&&e._events[a]?d(e._events[a])?e._events[a].unshift(t):e._events[a]=[t,e._events[a]]:e.on(a,t)}(e,"error",h),e.once("close",p),e.once("finish",g),e.emit("pipe",t),f.flowing||(l("pipe resume"),t.resume()),e},x.prototype.unpipe=function(e){var a=this._readableState,t={hasUnpiped:!1};if(0===a.pipesCount)return this;if(1===a.pipesCount)return e&&e!==a.pipes||(e||(e=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,e&&e.emit("unpipe",this,t)),this;if(!e){var c=a.pipes,f=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var d=0;d{"use strict";e.exports=r;var c=t(26248),f=Object.create(t(15622));function d(e,a){var t=this._transformState;t.transforming=!1;var c=t.writecb;if(!c)return this.emit("error",new Error("write callback called multiple times"));t.writechunk=null,t.writecb=null,null!=a&&this.push(a),c(e);var f=this._readableState;f.reading=!1,(f.needReadable||f.length{"use strict";var c=t(33225);function f(e){var a=this;this.next=null,this.entry=null,this.finish=function(){!function(e,a){var t=e.entry;for(e.entry=null;t;){var c=t.callback;a.pendingcb--,c(undefined),t=t.next}a.corkedRequestsFree.next=e}(a,e)}}e.exports=g;var d,r=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:c.nextTick;g.WritableState=p;var n=Object.create(t(15622));n.inherits=t(56698);var i,b={deprecate:t(94643)},o=t(5567),s=t(24116).Buffer,l=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=t(36278);function h(){}function p(e,a){d=d||t(26248),e=e||{};var n=a instanceof d;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,b=e.writableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(b||0===b)?b:o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,a){var t=e._writableState,f=t.sync,d=t.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(t),a)!function(e,a,t,f,d){--a.pendingcb,t?(c.nextTick(d,f),c.nextTick(w,e,a),e._writableState.errorEmitted=!0,e.emit("error",f)):(d(f),e._writableState.errorEmitted=!0,e.emit("error",f),w(e,a))}(e,t,f,a,d);else{var n=A(t);n||t.corked||t.bufferProcessing||!t.bufferedRequest||y(e,t),f?r(x,e,t,n,d):x(e,t,n,d)}}(a,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}function g(e){if(d=d||t(26248),!(i.call(g,this)||this instanceof d))return new g(e);this._writableState=new p(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function m(e,a,t,c,f,d,r){a.writelen=c,a.writecb=r,a.writing=!0,a.sync=!0,t?e._writev(f,a.onwrite):e._write(f,d,a.onwrite),a.sync=!1}function x(e,a,t,c){t||function(e,a){0===a.length&&a.needDrain&&(a.needDrain=!1,e.emit("drain"))}(e,a),a.pendingcb--,c(),w(e,a)}function y(e,a){a.bufferProcessing=!0;var t=a.bufferedRequest;if(e._writev&&t&&t.next){var c=a.bufferedRequestCount,d=new Array(c),r=a.corkedRequestsFree;r.entry=t;for(var n=0,i=!0;t;)d[n]=t,t.isBuf||(i=!1),t=t.next,n+=1;d.allBuffers=i,m(e,a,!0,a.length,d,"",r.finish),a.pendingcb++,a.lastBufferedRequest=null,r.next?(a.corkedRequestsFree=r.next,r.next=null):a.corkedRequestsFree=new f(a),a.bufferedRequestCount=0}else{for(;t;){var b=t.chunk,o=t.encoding,s=t.callback;if(m(e,a,!1,a.objectMode?1:b.length,b,o,s),t=t.next,a.bufferedRequestCount--,a.writing)break}null===t&&(a.lastBufferedRequest=null)}a.bufferedRequest=t,a.bufferProcessing=!1}function A(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function v(e,a){e._final((function(t){a.pendingcb--,t&&e.emit("error",t),a.prefinished=!0,e.emit("prefinish"),w(e,a)}))}function w(e,a){var t=A(a);return t&&(function(e,a){a.prefinished||a.finalCalled||("function"==typeof e._final?(a.pendingcb++,a.finalCalled=!0,c.nextTick(v,e,a)):(a.prefinished=!0,e.emit("prefinish")))}(e,a),0===a.pendingcb&&(a.finished=!0,e.emit("finish"))),t}n.inherits(g,o),p.prototype.getBuffer=function(){for(var e=this.bufferedRequest,a=[];e;)a.push(e),e=e.next;return a},function(){try{Object.defineProperty(p.prototype,"buffer",{get:b.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===g&&e&&e._writableState instanceof p}})):i=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,a,t){var f,d=this._writableState,r=!1,n=!d.objectMode&&(f=e,s.isBuffer(f)||f instanceof l);return n&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"==typeof a&&(t=a,a=null),n?a="buffer":a||(a=d.defaultEncoding),"function"!=typeof t&&(t=h),d.ended?function(e,a){var t=new Error("write after end");e.emit("error",t),c.nextTick(a,t)}(this,t):(n||function(e,a,t,f){var d=!0,r=!1;return null===t?r=new TypeError("May not write null values to stream"):"string"==typeof t||void 0===t||a.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r&&(e.emit("error",r),c.nextTick(f,r),d=!1),d}(this,d,e,t))&&(d.pendingcb++,r=function(e,a,t,c,f,d){if(!t){var r=function(e,a,t){return e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=s.from(a,t)),a}(a,c,f);c!==r&&(t=!0,f="buffer",c=r)}var n=a.objectMode?1:c.length;a.length+=n;var i=a.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,a,t){t(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,a,t){var f=this._writableState;"function"==typeof e?(t=e,e=null,a=null):"function"==typeof a&&(t=a,a=null),null!=e&&this.write(e,a),f.corked&&(f.corked=1,this.uncork()),f.ending||function(e,a,t){a.ending=!0,w(e,a),t&&(a.finished?c.nextTick(t):e.once("finish",t)),a.ended=!0,e.writable=!1}(this,f,t)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=u.destroy,g.prototype._undestroy=u.undestroy,g.prototype._destroy=function(e,a){this.end(),a(e)}},20672:(e,a,t)=>{"use strict";var c=t(24116).Buffer,f=t(21638);e.exports=function(){function e(){!function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var a={data:e,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length},e.prototype.unshift=function(e){var a={data:e,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var a=this.head,t=""+a.data;a=a.next;)t+=e+a.data;return t},e.prototype.concat=function(e){if(0===this.length)return c.alloc(0);for(var a,t,f=c.allocUnsafe(e>>>0),d=this.head,r=0;d;)a=f,t=r,d.data.copy(a,t),r+=d.data.length,d=d.next;return f},e}(),f&&f.inspect&&f.inspect.custom&&(e.exports.prototype[f.inspect.custom]=function(){var e=f.inspect({length:this.length});return this.constructor.name+" "+e})},36278:(e,a,t)=>{"use strict";var c=t(33225);function f(e,a){e.emit("error",a)}e.exports={destroy:function(e,a){var t=this,d=this._readableState&&this._readableState.destroyed,r=this._writableState&&this._writableState.destroyed;return d||r?(a?a(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,c.nextTick(f,this,e)):c.nextTick(f,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!a&&e?t._writableState?t._writableState.errorEmitted||(t._writableState.errorEmitted=!0,c.nextTick(f,t,e)):c.nextTick(f,t,e):a&&a(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},5567:(e,a,t)=>{e.exports=t(37007).EventEmitter},24116:(e,a,t)=>{var c=t(48287),f=c.Buffer;function d(e,a){for(var t in e)a[t]=e[t]}function r(e,a,t){return f(e,a,t)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=c:(d(c,a),a.Buffer=r),d(f,r),r.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return f(e,a,t)},r.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var c=f(e);return void 0!==a?"string"==typeof t?c.fill(a,t):c.fill(a):c.fill(0),c},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return c.SlowBuffer(e)}},46737:(e,a,t)=>{(a=e.exports=t(30206)).Stream=a,a.Readable=a,a.Writable=t(7314),a.Duplex=t(26248),a.Transform=t(81816),a.PassThrough=t(75242)},6427:(e,a,t)=>{"use strict";var c=t(88393).Buffer,f=c.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function d(e){var a;switch(this.encoding=function(e){var a=function(e){if(!e)return"utf8";for(var a;;)switch(e){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 e;default:if(a)return;e=(""+e).toLowerCase(),a=!0}}(e);if("string"!=typeof a&&(c.isEncoding===f||!f(e)))throw new Error("Unknown encoding: "+e);return a||e}(e),this.encoding){case"utf16le":this.text=i,this.end=b,a=4;break;case"utf8":this.fillLast=n,a=4;break;case"base64":this.text=o,this.end=s,a=3;break;default:return this.write=l,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(a)}function r(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function n(e){var a=this.lastTotal-this.lastNeed,t=function(e,a){if(128!=(192&a[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&a.length>1){if(128!=(192&a[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&a.length>2&&128!=(192&a[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==t?t:this.lastNeed<=e.length?(e.copy(this.lastChar,a,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,a,0,e.length),void(this.lastNeed-=e.length))}function i(e,a){if((e.length-a)%2==0){var t=e.toString("utf16le",a);if(t){var c=t.charCodeAt(t.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",a,e.length-1)}function b(e){var a=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return a+this.lastChar.toString("utf16le",0,t)}return a}function o(e,a){var t=(e.length-a)%3;return 0===t?e.toString("base64",a):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",a,e.length-t))}function s(e){var a=e&&e.length?this.write(e):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function l(e){return e.toString(this.encoding)}function u(e){return e&&e.length?this.write(e):""}a.I=d,d.prototype.write=function(e){if(0===e.length)return"";var a,t;if(this.lastNeed){if(void 0===(a=this.fillLast(e)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t=0?(f>0&&(e.lastNeed=f-1),f):--c=0?(f>0&&(e.lastNeed=f-2),f):--c=0?(f>0&&(2===f?f=0:e.lastNeed=f-3),f):0}(this,e,a);if(!this.lastNeed)return e.toString("utf8",a);this.lastTotal=t;var c=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,c),e.toString("utf8",a,c)},d.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},88393:(e,a,t)=>{var c=t(48287),f=c.Buffer;function d(e,a){for(var t in e)a[t]=e[t]}function r(e,a,t){return f(e,a,t)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=c:(d(c,a),a.Buffer=r),d(f,r),r.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return f(e,a,t)},r.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var c=f(e);return void 0!==a?"string"==typeof t?c.fill(a,t):c.fill(a):c.fill(0),c},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return c.SlowBuffer(e)}},5974:(e,a,t)=>{"use strict";var c=t(48287).Buffer,f=t(94148),d=t(44442),r=t(58411),n=t(71447),i=t(19681);for(var b in i)a[b]=i[b];function o(e){if("number"!=typeof e||ea.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}a.NONE=0,a.DEFLATE=1,a.INFLATE=2,a.GZIP=3,a.GUNZIP=4,a.DEFLATERAW=5,a.INFLATERAW=6,a.UNZIP=7,o.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,f(this.init_done,"close before init"),f(this.mode<=a.UNZIP),this.mode===a.DEFLATE||this.mode===a.GZIP||this.mode===a.DEFLATERAW?r.deflateEnd(this.strm):this.mode!==a.INFLATE&&this.mode!==a.GUNZIP&&this.mode!==a.INFLATERAW&&this.mode!==a.UNZIP||n.inflateEnd(this.strm),this.mode=a.NONE,this.dictionary=null)},o.prototype.write=function(e,a,t,c,f,d,r){return this._write(!0,e,a,t,c,f,d,r)},o.prototype.writeSync=function(e,a,t,c,f,d,r){return this._write(!1,e,a,t,c,f,d,r)},o.prototype._write=function(e,t,d,r,n,i,b,o){if(f.equal(arguments.length,8),f(this.init_done,"write before init"),f(this.mode!==a.NONE,"already finalized"),f.equal(!1,this.write_in_progress,"write already in progress"),f.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,f.equal(!1,void 0===t,"must provide flush value"),this.write_in_progress=!0,t!==a.Z_NO_FLUSH&&t!==a.Z_PARTIAL_FLUSH&&t!==a.Z_SYNC_FLUSH&&t!==a.Z_FULL_FLUSH&&t!==a.Z_FINISH&&t!==a.Z_BLOCK)throw new Error("Invalid flush value");if(null==d&&(d=c.alloc(0),n=0,r=0),this.strm.avail_in=n,this.strm.input=d,this.strm.next_in=r,this.strm.avail_out=o,this.strm.output=i,this.strm.next_out=b,this.flush=t,!e)return this._process(),this._checkError()?this._afterSync():void 0;var s=this;return process.nextTick((function(){s._process(),s._after()})),this},o.prototype._afterSync=function(){var e=this.strm.avail_out,a=this.strm.avail_in;return this.write_in_progress=!1,[a,e]},o.prototype._process=function(){var e=null;switch(this.mode){case a.DEFLATE:case a.GZIP:case a.DEFLATERAW:this.err=r.deflate(this.strm,this.flush);break;case a.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=a.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=a.GUNZIP):this.mode=a.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case a.INFLATE:case a.GUNZIP:case a.INFLATERAW:for(this.err=n.inflate(this.strm,this.flush),this.err===a.Z_NEED_DICT&&this.dictionary&&(this.err=n.inflateSetDictionary(this.strm,this.dictionary),this.err===a.Z_OK?this.err=n.inflate(this.strm,this.flush):this.err===a.Z_DATA_ERROR&&(this.err=a.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===a.GUNZIP&&this.err===a.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=n.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},o.prototype._checkError=function(){switch(this.err){case a.Z_OK:case a.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===a.Z_FINISH)return this._error("unexpected end of file"),!1;break;case a.Z_STREAM_END:break;case a.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},o.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,a=this.strm.avail_in;this.write_in_progress=!1,this.callback(a,e),this.pending_close&&this.close()}},o.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},o.prototype.init=function(e,t,c,d,r){f(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),f(e>=8&&e<=15,"invalid windowBits"),f(t>=-1&&t<=9,"invalid compression level"),f(c>=1&&c<=9,"invalid memlevel"),f(d===a.Z_FILTERED||d===a.Z_HUFFMAN_ONLY||d===a.Z_RLE||d===a.Z_FIXED||d===a.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,c,d,r),this._setDictionary()},o.prototype.params=function(){throw new Error("deflateParams Not supported")},o.prototype.reset=function(){this._reset(),this._setDictionary()},o.prototype._init=function(e,t,c,f,i){switch(this.level=e,this.windowBits=t,this.memLevel=c,this.strategy=f,this.flush=a.Z_NO_FLUSH,this.err=a.Z_OK,this.mode!==a.GZIP&&this.mode!==a.GUNZIP||(this.windowBits+=16),this.mode===a.UNZIP&&(this.windowBits+=32),this.mode!==a.DEFLATERAW&&this.mode!==a.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new d,this.mode){case a.DEFLATE:case a.GZIP:case a.DEFLATERAW:this.err=r.deflateInit2(this.strm,this.level,a.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case a.INFLATE:case a.GUNZIP:case a.INFLATERAW:case a.UNZIP:this.err=n.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==a.Z_OK&&this._error("Init error"),this.dictionary=i,this.write_in_progress=!1,this.init_done=!0},o.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=a.Z_OK,this.mode){case a.DEFLATE:case a.DEFLATERAW:this.err=r.deflateSetDictionary(this.strm,this.dictionary)}this.err!==a.Z_OK&&this._error("Failed to set dictionary")}},o.prototype._reset=function(){switch(this.err=a.Z_OK,this.mode){case a.DEFLATE:case a.DEFLATERAW:case a.GZIP:this.err=r.deflateReset(this.strm);break;case a.INFLATE:case a.INFLATERAW:case a.GUNZIP:this.err=n.inflateReset(this.strm)}this.err!==a.Z_OK&&this._error("Failed to reset stream")},a.Zlib=o},78559:(e,a,t)=>{"use strict";var c=t(48287).Buffer,f=t(88310).Transform,d=t(5974),r=t(40537),n=t(94148).ok,i=t(48287).kMaxLength,b="Cannot create final Buffer. It would be larger than 0x"+i.toString(16)+" bytes";d.Z_MIN_WINDOWBITS=8,d.Z_MAX_WINDOWBITS=15,d.Z_DEFAULT_WINDOWBITS=15,d.Z_MIN_CHUNK=64,d.Z_MAX_CHUNK=1/0,d.Z_DEFAULT_CHUNK=16384,d.Z_MIN_MEMLEVEL=1,d.Z_MAX_MEMLEVEL=9,d.Z_DEFAULT_MEMLEVEL=8,d.Z_MIN_LEVEL=-1,d.Z_MAX_LEVEL=9,d.Z_DEFAULT_LEVEL=d.Z_DEFAULT_COMPRESSION;for(var o=Object.keys(d),s=0;s=i?r=new RangeError(b):a=c.concat(f,d),f=[],e.close(),t(r,a)}e.on("error",(function(a){e.removeListener("end",n),e.removeListener("readable",r),t(a)})),e.on("end",n),e.end(a),r()}function x(e,a){if("string"==typeof a&&(a=c.from(a)),!c.isBuffer(a))throw new TypeError("Not a string or buffer");var t=e._finishFlushFlag;return e._processChunk(a,t)}function y(e){if(!(this instanceof y))return new y(e);M.call(this,e,d.DEFLATE)}function A(e){if(!(this instanceof A))return new A(e);M.call(this,e,d.INFLATE)}function v(e){if(!(this instanceof v))return new v(e);M.call(this,e,d.GZIP)}function w(e){if(!(this instanceof w))return new w(e);M.call(this,e,d.GUNZIP)}function _(e){if(!(this instanceof _))return new _(e);M.call(this,e,d.DEFLATERAW)}function I(e){if(!(this instanceof I))return new I(e);M.call(this,e,d.INFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);M.call(this,e,d.UNZIP)}function C(e){return e===d.Z_NO_FLUSH||e===d.Z_PARTIAL_FLUSH||e===d.Z_SYNC_FLUSH||e===d.Z_FULL_FLUSH||e===d.Z_FINISH||e===d.Z_BLOCK}function M(e,t){var r=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||a.Z_DEFAULT_CHUNK,f.call(this,e),e.flush&&!C(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!C(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||d.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:d.Z_FINISH,e.chunkSize&&(e.chunkSizea.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsa.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levela.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevela.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=a.Z_FILTERED&&e.strategy!=a.Z_HUFFMAN_ONLY&&e.strategy!=a.Z_RLE&&e.strategy!=a.Z_FIXED&&e.strategy!=a.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!c.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new d.Zlib(t);var n=this;this._hadError=!1,this._handle.onerror=function(e,t){B(n),n._hadError=!0;var c=new Error(e);c.errno=t,c.code=a.codes[t],n.emit("error",c)};var i=a.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(i=e.level);var b=a.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(b=e.strategy),this._handle.init(e.windowBits||a.Z_DEFAULT_WINDOWBITS,i,e.memLevel||a.Z_DEFAULT_MEMLEVEL,b,e.dictionary),this._buffer=c.allocUnsafe(this._chunkSize),this._offset=0,this._level=i,this._strategy=b,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:!0,enumerable:!0})}function B(e,a){a&&process.nextTick(a),e._handle&&(e._handle.close(),e._handle=null)}function L(e){e.emit("close")}Object.defineProperty(a,"codes",{enumerable:!0,value:Object.freeze(u),writable:!1}),a.Deflate=y,a.Inflate=A,a.Gzip=v,a.Gunzip=w,a.DeflateRaw=_,a.InflateRaw=I,a.Unzip=E,a.createDeflate=function(e){return new y(e)},a.createInflate=function(e){return new A(e)},a.createDeflateRaw=function(e){return new _(e)},a.createInflateRaw=function(e){return new I(e)},a.createGzip=function(e){return new v(e)},a.createGunzip=function(e){return new w(e)},a.createUnzip=function(e){return new E(e)},a.deflate=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new y(a),e,t)},a.deflateSync=function(e,a){return x(new y(a),e)},a.gzip=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new v(a),e,t)},a.gzipSync=function(e,a){return x(new v(a),e)},a.deflateRaw=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new _(a),e,t)},a.deflateRawSync=function(e,a){return x(new _(a),e)},a.unzip=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new E(a),e,t)},a.unzipSync=function(e,a){return x(new E(a),e)},a.inflate=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new A(a),e,t)},a.inflateSync=function(e,a){return x(new A(a),e)},a.gunzip=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new w(a),e,t)},a.gunzipSync=function(e,a){return x(new w(a),e)},a.inflateRaw=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new I(a),e,t)},a.inflateRawSync=function(e,a){return x(new I(a),e)},r.inherits(M,f),M.prototype.params=function(e,t,c){if(ea.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=a.Z_FILTERED&&t!=a.Z_HUFFMAN_ONLY&&t!=a.Z_RLE&&t!=a.Z_FIXED&&t!=a.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var f=this;this.flush(d.Z_SYNC_FLUSH,(function(){n(f._handle,"zlib binding closed"),f._handle.params(e,t),f._hadError||(f._level=e,f._strategy=t,c&&c())}))}else process.nextTick(c)},M.prototype.reset=function(){return n(this._handle,"zlib binding closed"),this._handle.reset()},M.prototype._flush=function(e){this._transform(c.alloc(0),"",e)},M.prototype.flush=function(e,a){var t=this,f=this._writableState;("function"==typeof e||void 0===e&&!a)&&(a=e,e=d.Z_FULL_FLUSH),f.ended?a&&process.nextTick(a):f.ending?a&&this.once("end",a):f.needDrain?a&&this.once("drain",(function(){return t.flush(e,a)})):(this._flushFlag=e,this.write(c.alloc(0),"",a))},M.prototype.close=function(e){B(this,e),process.nextTick(L,this)},M.prototype._transform=function(e,a,t){var f,r=this._writableState,n=(r.ending||r.ended)&&(!e||r.length===e.length);return null===e||c.isBuffer(e)?this._handle?(n?f=this._finishFlushFlag:(f=this._flushFlag,e.length>=r.length&&(this._flushFlag=this._opts.flush||d.Z_NO_FLUSH)),void this._processChunk(e,f,t)):t(new Error("zlib binding closed")):t(new Error("invalid input"))},M.prototype._processChunk=function(e,a,t){var f=e&&e.length,d=this._chunkSize-this._offset,r=0,o=this,s="function"==typeof t;if(!s){var l,u=[],h=0;this.on("error",(function(e){l=e})),n(this._handle,"zlib binding closed");do{var p=this._handle.writeSync(a,e,r,f,this._buffer,this._offset,d)}while(!this._hadError&&x(p[0],p[1]));if(this._hadError)throw l;if(h>=i)throw B(this),new RangeError(b);var g=c.concat(u,h);return B(this),g}n(this._handle,"zlib binding closed");var m=this._handle.write(a,e,r,f,this._buffer,this._offset,d);function x(i,b){if(this&&(this.buffer=null,this.callback=null),!o._hadError){var l=d-b;if(n(l>=0,"have should not go down"),l>0){var p=o._buffer.slice(o._offset,o._offset+l);o._offset+=l,s?o.push(p):(u.push(p),h+=p.length)}if((0===b||o._offset>=o._chunkSize)&&(d=o._chunkSize,o._offset=0,o._buffer=c.allocUnsafe(o._chunkSize)),0===b){if(r+=f-i,f=i,!s)return!0;var g=o._handle.write(a,e,r,f,o._buffer,o._offset,o._chunkSize);return g.callback=x,void(g.buffer=e)}if(!s)return!1;t()}}m.buffer=e,m.callback=x},r.inherits(y,M),r.inherits(A,M),r.inherits(v,M),r.inherits(w,M),r.inherits(_,M),r.inherits(I,M),r.inherits(E,M)},30295:(e,a,t)=>{var c=t(48287).Buffer;e.exports=function(e,a){for(var t=Math.min(e.length,a.length),f=new c(t),d=0;d{"use strict";const c=t(67526),f=t(251),d="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=i,a.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},a.INSPECT_MAX_BYTES=50;const r=2147483647;function n(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');const a=new Uint8Array(e);return Object.setPrototypeOf(a,i.prototype),a}function i(e,a,t){if("number"==typeof e){if("string"==typeof a)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}return b(e,a,t)}function b(e,a,t){if("string"==typeof e)return function(e,a){if("string"==typeof a&&""!==a||(a="utf8"),!i.isEncoding(a))throw new TypeError("Unknown encoding: "+a);const t=0|p(e,a);let c=n(t);const f=c.write(e,a);return f!==t&&(c=c.slice(0,f)),c}(e,a);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const a=new Uint8Array(e);return u(a.buffer,a.byteOffset,a.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return u(e,a,t);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return u(e,a,t);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return i.from(c,a,t);const f=function(e){if(i.isBuffer(e)){const a=0|h(e.length),t=n(a);return 0===t.length||e.copy(t,0,0,a),t}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?n(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),a,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e){return o(e),n(e<0?0:0|h(e))}function l(e){const a=e.length<0?0:0|h(e.length),t=n(a);for(let c=0;c=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function p(e,a){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const t=e.length,c=arguments.length>2&&!0===arguments[2];if(!c&&0===t)return 0;let f=!1;for(;;)switch(a){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return K(e).length;default:if(f)return c?-1:z(e).length;a=(""+a).toLowerCase(),f=!0}}function g(e,a,t){let c=!1;if((void 0===a||a<0)&&(a=0),a>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(a>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,a,t);case"utf8":case"utf-8":return C(this,a,t);case"ascii":return B(this,a,t);case"latin1":case"binary":return L(this,a,t);case"base64":return E(this,a,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,a,t);default:if(c)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),c=!0}}function m(e,a,t){const c=e[a];e[a]=e[t],e[t]=c}function x(e,a,t,c,f){if(0===e.length)return-1;if("string"==typeof t?(c=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),J(t=+t)&&(t=f?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(f)return-1;t=e.length-1}else if(t<0){if(!f)return-1;t=0}if("string"==typeof a&&(a=i.from(a,c)),i.isBuffer(a))return 0===a.length?-1:y(e,a,t,c,f);if("number"==typeof a)return a&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,a,t):Uint8Array.prototype.lastIndexOf.call(e,a,t):y(e,[a],t,c,f);throw new TypeError("val must be string, number or Buffer")}function y(e,a,t,c,f){let d,r=1,n=e.length,i=a.length;if(void 0!==c&&("ucs2"===(c=String(c).toLowerCase())||"ucs-2"===c||"utf16le"===c||"utf-16le"===c)){if(e.length<2||a.length<2)return-1;r=2,n/=2,i/=2,t/=2}function b(e,a){return 1===r?e[a]:e.readUInt16BE(a*r)}if(f){let c=-1;for(d=t;dn&&(t=n-i),d=t;d>=0;d--){let t=!0;for(let c=0;cf&&(c=f):c=f;const d=a.length;let r;for(c>d/2&&(c=d/2),r=0;r>8,f=t%256,d.push(f),d.push(c);return d}(a,e.length-t),e,t,c)}function E(e,a,t){return 0===a&&t===e.length?c.fromByteArray(e):c.fromByteArray(e.slice(a,t))}function C(e,a,t){t=Math.min(e.length,t);const c=[];let f=a;for(;f239?4:a>223?3:a>191?2:1;if(f+r<=t){let t,c,n,i;switch(r){case 1:a<128&&(d=a);break;case 2:t=e[f+1],128==(192&t)&&(i=(31&a)<<6|63&t,i>127&&(d=i));break;case 3:t=e[f+1],c=e[f+2],128==(192&t)&&128==(192&c)&&(i=(15&a)<<12|(63&t)<<6|63&c,i>2047&&(i<55296||i>57343)&&(d=i));break;case 4:t=e[f+1],c=e[f+2],n=e[f+3],128==(192&t)&&128==(192&c)&&128==(192&n)&&(i=(15&a)<<18|(63&t)<<12|(63&c)<<6|63&n,i>65535&&i<1114112&&(d=i))}}null===d?(d=65533,r=1):d>65535&&(d-=65536,c.push(d>>>10&1023|55296),d=56320|1023&d),c.push(d),f+=r}return function(e){const a=e.length;if(a<=M)return String.fromCharCode.apply(String,e);let t="",c=0;for(;cc.length?(i.isBuffer(a)||(a=i.from(a)),a.copy(c,f)):Uint8Array.prototype.set.call(c,a,f);else{if(!i.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(c,f)}f+=a.length}return c},i.byteLength=p,i.prototype._isBuffer=!0,i.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let a=0;at&&(e+=" ... "),""},d&&(i.prototype[d]=i.prototype.inspect),i.prototype.compare=function(e,a,t,c,f){if(Z(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===a&&(a=0),void 0===t&&(t=e?e.length:0),void 0===c&&(c=0),void 0===f&&(f=this.length),a<0||t>e.length||c<0||f>this.length)throw new RangeError("out of range index");if(c>=f&&a>=t)return 0;if(c>=f)return-1;if(a>=t)return 1;if(this===e)return 0;let d=(f>>>=0)-(c>>>=0),r=(t>>>=0)-(a>>>=0);const n=Math.min(d,r),b=this.slice(c,f),o=e.slice(a,t);for(let e=0;e>>=0,isFinite(t)?(t>>>=0,void 0===c&&(c="utf8")):(c=t,t=void 0)}const f=this.length-a;if((void 0===t||t>f)&&(t=f),e.length>0&&(t<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");let d=!1;for(;;)switch(c){case"hex":return A(this,e,a,t);case"utf8":case"utf-8":return v(this,e,a,t);case"ascii":case"latin1":case"binary":return w(this,e,a,t);case"base64":return _(this,e,a,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,a,t);default:if(d)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),d=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const M=4096;function B(e,a,t){let c="";t=Math.min(e.length,t);for(let f=a;fc)&&(t=c);let f="";for(let c=a;ct)throw new RangeError("Trying to access beyond buffer length")}function P(e,a,t,c,f,d){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>f||ae.length)throw new RangeError("Index out of range")}function R(e,a,t,c,f){H(a,c,f,e,t,7);let d=Number(a&BigInt(4294967295));e[t++]=d,d>>=8,e[t++]=d,d>>=8,e[t++]=d,d>>=8,e[t++]=d;let r=Number(a>>BigInt(32)&BigInt(4294967295));return e[t++]=r,r>>=8,e[t++]=r,r>>=8,e[t++]=r,r>>=8,e[t++]=r,t}function O(e,a,t,c,f){H(a,c,f,e,t,7);let d=Number(a&BigInt(4294967295));e[t+7]=d,d>>=8,e[t+6]=d,d>>=8,e[t+5]=d,d>>=8,e[t+4]=d;let r=Number(a>>BigInt(32)&BigInt(4294967295));return e[t+3]=r,r>>=8,e[t+2]=r,r>>=8,e[t+1]=r,r>>=8,e[t]=r,t+8}function D(e,a,t,c,f,d){if(t+c>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function T(e,a,t,c,d){return a=+a,t>>>=0,d||D(e,0,t,4),f.write(e,a,t,c,23,4),t+4}function F(e,a,t,c,d){return a=+a,t>>>=0,d||D(e,0,t,8),f.write(e,a,t,c,52,8),t+8}i.prototype.slice=function(e,a){const t=this.length;(e=~~e)<0?(e+=t)<0&&(e=0):e>t&&(e=t),(a=void 0===a?t:~~a)<0?(a+=t)<0&&(a=0):a>t&&(a=t),a>>=0,a>>>=0,t||N(e,a,this.length);let c=this[e],f=1,d=0;for(;++d>>=0,a>>>=0,t||N(e,a,this.length);let c=this[e+--a],f=1;for(;a>0&&(f*=256);)c+=this[e+--a]*f;return c},i.prototype.readUint8=i.prototype.readUInt8=function(e,a){return e>>>=0,a||N(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,a){return e>>>=0,a||N(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,a){return e>>>=0,a||N(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,a){return e>>>=0,a||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,a){return e>>>=0,a||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readBigUInt64LE=Y((function(e){$(e>>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||q(e,this.length-8);const c=a+256*this[++e]+65536*this[++e]+this[++e]*2**24,f=this[++e]+256*this[++e]+65536*this[++e]+t*2**24;return BigInt(c)+(BigInt(f)<>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||q(e,this.length-8);const c=a*2**24+65536*this[++e]+256*this[++e]+this[++e],f=this[++e]*2**24+65536*this[++e]+256*this[++e]+t;return(BigInt(c)<>>=0,a>>>=0,t||N(e,a,this.length);let c=this[e],f=1,d=0;for(;++d=f&&(c-=Math.pow(2,8*a)),c},i.prototype.readIntBE=function(e,a,t){e>>>=0,a>>>=0,t||N(e,a,this.length);let c=a,f=1,d=this[e+--c];for(;c>0&&(f*=256);)d+=this[e+--c]*f;return f*=128,d>=f&&(d-=Math.pow(2,8*a)),d},i.prototype.readInt8=function(e,a){return e>>>=0,a||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,a){e>>>=0,a||N(e,2,this.length);const t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt16BE=function(e,a){e>>>=0,a||N(e,2,this.length);const t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt32LE=function(e,a){return e>>>=0,a||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,a){return e>>>=0,a||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readBigInt64LE=Y((function(e){$(e>>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||q(e,this.length-8);const c=this[e+4]+256*this[e+5]+65536*this[e+6]+(t<<24);return(BigInt(c)<>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||q(e,this.length-8);const c=(a<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(c)<>>=0,a||N(e,4,this.length),f.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,a){return e>>>=0,a||N(e,4,this.length),f.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,a){return e>>>=0,a||N(e,8,this.length),f.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,a){return e>>>=0,a||N(e,8,this.length),f.read(this,e,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,a,t,c){e=+e,a>>>=0,t>>>=0,c||P(this,e,a,t,Math.pow(2,8*t)-1,0);let f=1,d=0;for(this[a]=255&e;++d>>=0,t>>>=0,c||P(this,e,a,t,Math.pow(2,8*t)-1,0);let f=t-1,d=1;for(this[a+f]=255&e;--f>=0&&(d*=256);)this[a+f]=e/d&255;return a+t},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,1,255,0),this[a]=255&e,a+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,2,65535,0),this[a]=255&e,this[a+1]=e>>>8,a+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,2,65535,0),this[a]=e>>>8,this[a+1]=255&e,a+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,4,4294967295,0),this[a+3]=e>>>24,this[a+2]=e>>>16,this[a+1]=e>>>8,this[a]=255&e,a+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,4,4294967295,0),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},i.prototype.writeBigUInt64LE=Y((function(e,a=0){return R(this,e,a,BigInt(0),BigInt("0xffffffffffffffff"))})),i.prototype.writeBigUInt64BE=Y((function(e,a=0){return O(this,e,a,BigInt(0),BigInt("0xffffffffffffffff"))})),i.prototype.writeIntLE=function(e,a,t,c){if(e=+e,a>>>=0,!c){const c=Math.pow(2,8*t-1);P(this,e,a,t,c-1,-c)}let f=0,d=1,r=0;for(this[a]=255&e;++f>>=0,!c){const c=Math.pow(2,8*t-1);P(this,e,a,t,c-1,-c)}let f=t-1,d=1,r=0;for(this[a+f]=255&e;--f>=0&&(d*=256);)e<0&&0===r&&0!==this[a+f+1]&&(r=1),this[a+f]=(e/d|0)-r&255;return a+t},i.prototype.writeInt8=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,1,127,-128),e<0&&(e=255+e+1),this[a]=255&e,a+1},i.prototype.writeInt16LE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,2,32767,-32768),this[a]=255&e,this[a+1]=e>>>8,a+2},i.prototype.writeInt16BE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,2,32767,-32768),this[a]=e>>>8,this[a+1]=255&e,a+2},i.prototype.writeInt32LE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,4,2147483647,-2147483648),this[a]=255&e,this[a+1]=e>>>8,this[a+2]=e>>>16,this[a+3]=e>>>24,a+4},i.prototype.writeInt32BE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},i.prototype.writeBigInt64LE=Y((function(e,a=0){return R(this,e,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),i.prototype.writeBigInt64BE=Y((function(e,a=0){return O(this,e,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),i.prototype.writeFloatLE=function(e,a,t){return T(this,e,a,!0,t)},i.prototype.writeFloatBE=function(e,a,t){return T(this,e,a,!1,t)},i.prototype.writeDoubleLE=function(e,a,t){return F(this,e,a,!0,t)},i.prototype.writeDoubleBE=function(e,a,t){return F(this,e,a,!1,t)},i.prototype.copy=function(e,a,t,c){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(t||(t=0),c||0===c||(c=this.length),a>=e.length&&(a=e.length),a||(a=0),c>0&&c=this.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),e.length-a>>=0,t=void 0===t?this.length:t>>>0,e||(e=0),"number"==typeof e)for(f=a;f=c+4;t-=3)a=`_${e.slice(t-3,t)}${a}`;return`${e.slice(0,t)}${a}`}function H(e,a,t,c,f,d){if(e>t||e3?0===a||a===BigInt(0)?`>= 0${c} and < 2${c} ** ${8*(d+1)}${c}`:`>= -(2${c} ** ${8*(d+1)-1}${c}) and < 2 ** ${8*(d+1)-1}${c}`:`>= ${a}${c} and <= ${t}${c}`,new Q.ERR_OUT_OF_RANGE("value",f,e)}!function(e,a,t){$(a,"offset"),void 0!==e[a]&&void 0!==e[a+t]||q(a,e.length-(t+1))}(c,f,d)}function $(e,a){if("number"!=typeof e)throw new Q.ERR_INVALID_ARG_TYPE(a,"number",e)}function q(e,a,t){if(Math.floor(e)!==e)throw $(e,t),new Q.ERR_OUT_OF_RANGE(t||"offset","an integer",e);if(a<0)throw new Q.ERR_BUFFER_OUT_OF_BOUNDS;throw new Q.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${a}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,a){return`The "${e}" argument must be of type number. Received type ${typeof a}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(e,a,t){let c=`The value of "${e}" is out of range.`,f=t;return Number.isInteger(t)&&Math.abs(t)>2**32?f=j(String(t)):"bigint"==typeof t&&(f=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(f=j(f)),f+="n"),c+=` It must be ${a}. Received ${f}`,c}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function z(e,a){let t;a=a||1/0;const c=e.length;let f=null;const d=[];for(let r=0;r55295&&t<57344){if(!f){if(t>56319){(a-=3)>-1&&d.push(239,191,189);continue}if(r+1===c){(a-=3)>-1&&d.push(239,191,189);continue}f=t;continue}if(t<56320){(a-=3)>-1&&d.push(239,191,189),f=t;continue}t=65536+(f-55296<<10|t-56320)}else f&&(a-=3)>-1&&d.push(239,191,189);if(f=null,t<128){if((a-=1)<0)break;d.push(t)}else if(t<2048){if((a-=2)<0)break;d.push(t>>6|192,63&t|128)}else if(t<65536){if((a-=3)<0)break;d.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((a-=4)<0)break;d.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return d}function K(e){return c.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,a,t,c){let f;for(f=0;f=a.length||f>=e.length);++f)a[f+t]=e[f];return f}function Z(e,a){return e instanceof a||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===a.name}function J(e){return e!=e}const W=function(){const e="0123456789abcdef",a=new Array(256);for(let t=0;t<16;++t){const c=16*t;for(let f=0;f<16;++f)a[c+f]=e[t]+e[f]}return a}();function Y(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},86866:e=>{e.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"}},38075:(e,a,t)=>{"use strict";var c=t(70453),f=t(10487),d=f(c("String.prototype.indexOf"));e.exports=function(e,a){var t=c(e,!!a);return"function"==typeof t&&d(e,".prototype.")>-1?f(t):t}},10487:(e,a,t)=>{"use strict";var c=t(66743),f=t(70453),d=t(96897),r=t(69675),n=f("%Function.prototype.apply%"),i=f("%Function.prototype.call%"),b=f("%Reflect.apply%",!0)||c.call(i,n),o=t(30655),s=f("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new r("a function is required");var a=b(c,i,arguments);return d(a,1+s(0,e.length-(arguments.length-1)),!0)};var l=function(){return b(c,n,arguments)};o?o(e.exports,"apply",{value:l}):e.exports.apply=l},56168:(e,a,t)=>{var c=t(92861).Buffer,f=t(88310).Transform,d=t(83141).I;function r(e){f.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t(56698)(r,f),r.prototype.update=function(e,a,t){"string"==typeof e&&(e=c.from(e,a));var f=this._update(e);return this.hashMode?this:(t&&(f=this._toString(f,t)),f)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(e,a,t){var c;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){c=e}finally{t(c)}},r.prototype._flush=function(e){var a;try{this.push(this.__final())}catch(e){a=e}e(a)},r.prototype._finalOrDigest=function(e){var a=this.__final()||c.alloc(0);return e&&(a=this._toString(a,e,!0)),a},r.prototype._toString=function(e,a,t){if(this._decoder||(this._decoder=new d(a),this._encoding=a),this._encoding!==a)throw new Error("can't switch encodings");var c=this._decoder.write(e);return t&&(c+=this._decoder.end()),c},e.exports=r},15622:(e,a,t)=>{function c(e){return Object.prototype.toString.call(e)}a.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===c(e)},a.isBoolean=function(e){return"boolean"==typeof e},a.isNull=function(e){return null===e},a.isNullOrUndefined=function(e){return null==e},a.isNumber=function(e){return"number"==typeof e},a.isString=function(e){return"string"==typeof e},a.isSymbol=function(e){return"symbol"==typeof e},a.isUndefined=function(e){return void 0===e},a.isRegExp=function(e){return"[object RegExp]"===c(e)},a.isObject=function(e){return"object"==typeof e&&null!==e},a.isDate=function(e){return"[object Date]"===c(e)},a.isError=function(e){return"[object Error]"===c(e)||e instanceof Error},a.isFunction=function(e){return"function"==typeof e},a.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},a.isBuffer=t(48287).Buffer.isBuffer},61324:(e,a,t)=>{var c=t(48287).Buffer,f=t(86729),d=t(92801);e.exports=function(e){return new n(e)};var r={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 n(e){this.curveType=r[e],this.curveType||(this.curveType={name:e}),this.curve=new f.ec(this.curveType.name),this.keys=void 0}function i(e,a,t){Array.isArray(e)||(e=e.toArray());var f=new c(e);if(t&&f.length=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,D=R>>>13,T=0|r[9],F=8191&T,Q=T>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},47108:(e,a,t)=>{"use strict";var c=t(56698),f=t(88276),d=t(66011),r=t(62802),n=t(56168);function i(e){n.call(this,"digest"),this._hash=e}c(i,n),i.prototype._update=function(e){this._hash.update(e)},i.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new f:"rmd160"===e||"ripemd160"===e?new d:new i(r(e))}},20320:(e,a,t)=>{var c=t(88276);e.exports=function(e){return(new c).update(e).digest()}},83507:(e,a,t)=>{"use strict";var c=t(56698),f=t(41800),d=t(56168),r=t(92861).Buffer,n=t(20320),i=t(66011),b=t(62802),o=r.alloc(128);function s(e,a){d.call(this,"digest"),"string"==typeof a&&(a=r.from(a));var t="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=a,a.length>t?a=("rmd160"===e?new i:b(e)).update(a).digest():a.length{"use strict";var c=t(56698),f=t(92861).Buffer,d=t(56168),r=f.alloc(128),n=64;function i(e,a){d.call(this,"digest"),"string"==typeof a&&(a=f.from(a)),this._alg=e,this._key=a,a.length>n?a=e(a):a.length{var c="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==t.g&&t.g,f=function(){function e(){this.fetch=!1,this.DOMException=c.DOMException}return e.prototype=c,new e}();!function(e){!function(a){var t=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==t&&t,c="URLSearchParams"in t,f="Symbol"in t&&"iterator"in Symbol,d="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),r="FormData"in t,n="ArrayBuffer"in t;if(n)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],b=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function s(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var a={next:function(){var a=e.shift();return{done:void 0===a,value:a}}};return f&&(a[Symbol.iterator]=function(){return a}),a}function u(e){this.map={},e instanceof u?e.forEach((function(e,a){this.append(a,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(a){this.append(a,e[a])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(a,t){e.onload=function(){a(e.result)},e.onerror=function(){t(e.error)}}))}function g(e){var a=new FileReader,t=p(a);return a.readAsArrayBuffer(e),t}function m(e){if(e.slice)return e.slice(0);var a=new Uint8Array(e.byteLength);return a.set(new Uint8Array(e)),a.buffer}function x(){return this.bodyUsed=!1,this._initBody=function(e){var a;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:d&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:c&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():n&&d&&(a=e)&&DataView.prototype.isPrototypeOf(a)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n&&(ArrayBuffer.prototype.isPrototypeOf(e)||b(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},d&&(this.blob=function(){var e=h(this);if(e)return e;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?h(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(g)}),this.text=function(){var e,a,t,c=h(this);if(c)return c;if(this._bodyBlob)return e=this._bodyBlob,t=p(a=new FileReader),a.readAsText(e),t;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var a=new Uint8Array(e),t=new Array(a.length),c=0;c-1?c:t),this.mode=a.mode||this.mode||null,this.signal=a.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&f)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(f),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==a.cache&&"no-cache"!==a.cache)){var d=/([?&])_=[^&]*/;d.test(this.url)?this.url=this.url.replace(d,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function v(e){var a=new FormData;return e.trim().split("&").forEach((function(e){if(e){var t=e.split("="),c=t.shift().replace(/\+/g," "),f=t.join("=").replace(/\+/g," ");a.append(decodeURIComponent(c),decodeURIComponent(f))}})),a}function w(e,a){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');a||(a={}),this.type="default",this.status=void 0===a.status?200:a.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===a.statusText?"":""+a.statusText,this.headers=new u(a.headers),this.url=a.url||"",this._initBody(e)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},x.call(A.prototype),x.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];w.redirect=function(e,a){if(-1===_.indexOf(a))throw new RangeError("Invalid status code");return new w(null,{status:a,headers:{location:e}})},a.DOMException=t.DOMException;try{new a.DOMException}catch(e){a.DOMException=function(e,a){this.message=e,this.name=a;var t=Error(e);this.stack=t.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function I(e,c){return new Promise((function(f,r){var i=new A(e,c);if(i.signal&&i.signal.aborted)return r(new a.DOMException("Aborted","AbortError"));var b=new XMLHttpRequest;function o(){b.abort()}b.onload=function(){var e,a,t={status:b.status,statusText:b.statusText,headers:(e=b.getAllResponseHeaders()||"",a=new u,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var t=e.split(":"),c=t.shift().trim();if(c){var f=t.join(":").trim();a.append(c,f)}})),a)};t.url="responseURL"in b?b.responseURL:t.headers.get("X-Request-URL");var c="response"in b?b.response:b.responseText;setTimeout((function(){f(new w(c,t))}),0)},b.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},b.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},b.onabort=function(){setTimeout((function(){r(new a.DOMException("Aborted","AbortError"))}),0)},b.open(i.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(a){return e}}(i.url),!0),"include"===i.credentials?b.withCredentials=!0:"omit"===i.credentials&&(b.withCredentials=!1),"responseType"in b&&(d?b.responseType="blob":n&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(b.responseType="arraybuffer")),!c||"object"!=typeof c.headers||c.headers instanceof u?i.headers.forEach((function(e,a){b.setRequestHeader(a,e)})):Object.getOwnPropertyNames(c.headers).forEach((function(e){b.setRequestHeader(e,s(c.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",o),b.onreadystatechange=function(){4===b.readyState&&i.signal.removeEventListener("abort",o)}),b.send(void 0===i._bodyInit?null:i._bodyInit)}))}I.polyfill=!0,t.fetch||(t.fetch=I,t.Headers=u,t.Request=A,t.Response=w),a.Headers=u,a.Request=A,a.Response=w,a.fetch=I}({})}(f),f.fetch.ponyfill=!0,delete f.fetch.polyfill;var d=c.fetch?c:f;(a=d.fetch).default=d.fetch,a.fetch=d.fetch,a.Headers=d.Headers,a.Request=d.Request,a.Response=d.Response,e.exports=a},91565:(e,a,t)=>{"use strict";a.randomBytes=a.rng=a.pseudoRandomBytes=a.prng=t(53209),a.createHash=a.Hash=t(47108),a.createHmac=a.Hmac=t(83507);var c=t(55715),f=Object.keys(c),d=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(f);a.getHashes=function(){return d};var r=t(78396);a.pbkdf2=r.pbkdf2,a.pbkdf2Sync=r.pbkdf2Sync;var n=t(30125);a.Cipher=n.Cipher,a.createCipher=n.createCipher,a.Cipheriv=n.Cipheriv,a.createCipheriv=n.createCipheriv,a.Decipher=n.Decipher,a.createDecipher=n.createDecipher,a.Decipheriv=n.Decipheriv,a.createDecipheriv=n.createDecipheriv,a.getCiphers=n.getCiphers,a.listCiphers=n.listCiphers;var i=t(15380);a.DiffieHellmanGroup=i.DiffieHellmanGroup,a.createDiffieHellmanGroup=i.createDiffieHellmanGroup,a.getDiffieHellman=i.getDiffieHellman,a.createDiffieHellman=i.createDiffieHellman,a.DiffieHellman=i.DiffieHellman;var b=t(20);a.createSign=b.createSign,a.Sign=b.Sign,a.createVerify=b.createVerify,a.Verify=b.Verify,a.createECDH=t(61324);var o=t(97168);a.publicEncrypt=o.publicEncrypt,a.privateEncrypt=o.privateEncrypt,a.publicDecrypt=o.publicDecrypt,a.privateDecrypt=o.privateDecrypt;var s=t(76983);a.randomFill=s.randomFill,a.randomFillSync=s.randomFillSync,a.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},a.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}},17833:(e,a,t)=>{a.formatArgs=function(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;a.splice(1,0,t,"color: inherit");let c=0,f=0;a[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(c++,"%c"===e&&(f=c))})),a.splice(f,0,t)},a.save=function(e){try{e?a.storage.setItem("debug",e):a.storage.removeItem("debug")}catch(e){}},a.load=function(){let e;try{e=a.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},a.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},a.storage=function(){try{return localStorage}catch(e){}}(),a.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),a.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"],a.log=console.debug||console.log||(()=>{}),e.exports=t(40736)(a);const{formatters:c}=e.exports;c.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},40736:(e,a,t)=>{e.exports=function(e){function a(e){let t,f,d,r=null;function n(...e){if(!n.enabled)return;const c=n,f=Number(new Date),d=f-(t||f);c.diff=d,c.prev=t,c.curr=f,t=f,e[0]=a.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,f)=>{if("%%"===t)return"%";r++;const d=a.formatters[f];if("function"==typeof d){const a=e[r];t=d.call(c,a),e.splice(r,1),r--}return t})),a.formatArgs.call(c,e),(c.log||a.log).apply(c,e)}return n.namespace=e,n.useColors=a.useColors(),n.color=a.selectColor(e),n.extend=c,n.destroy=a.destroy,Object.defineProperty(n,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(f!==a.namespaces&&(f=a.namespaces,d=a.enabled(e)),d),set:e=>{r=e}}),"function"==typeof a.init&&a.init(n),n}function c(e,t){const c=a(this.namespace+(void 0===t?":":t)+e);return c.log=this.log,c}function f(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return a.debug=a,a.default=a,a.coerce=function(e){return e instanceof Error?e.stack||e.message:e},a.disable=function(){const e=[...a.names.map(f),...a.skips.map(f).map((e=>"-"+e))].join(",");return a.enable(""),e},a.enable=function(e){let t;a.save(e),a.namespaces=e,a.names=[],a.skips=[];const c=("string"==typeof e?e:"").split(/[\s,]+/),f=c.length;for(t=0;t{a[t]=e[t]})),a.names=[],a.skips=[],a.formatters={},a.selectColor=function(e){let t=0;for(let a=0;a{"use strict";var c=t(30655),f=t(58068),d=t(69675),r=t(75795);e.exports=function(e,a,t){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new d("`obj` must be an object or a function`");if("string"!=typeof a&&"symbol"!=typeof a)throw new d("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new d("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new d("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new d("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new d("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,b=arguments.length>5?arguments[5]:null,o=arguments.length>6&&arguments[6],s=!!r&&r(e,a);if(c)c(e,a,{configurable:null===b&&s?s.configurable:!b,enumerable:null===n&&s?s.enumerable:!n,value:t,writable:null===i&&s?s.writable:!i});else{if(!o&&(n||i||b))throw new f("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[a]=t}}},38452:(e,a,t)=>{"use strict";var c=t(1189),f="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),d=Object.prototype.toString,r=Array.prototype.concat,n=t(30041),i=t(30592)(),b=function(e,a,t,c){if(a in e)if(!0===c){if(e[a]===t)return}else if("function"!=typeof(f=c)||"[object Function]"!==d.call(f)||!c())return;var f;i?n(e,a,t,!0):n(e,a,t)},o=function(e,a){var t=arguments.length>2?arguments[2]:{},d=c(a);f&&(d=r.call(d,Object.getOwnPropertySymbols(a)));for(var n=0;n{"use strict";a.utils=t(87626),a.Cipher=t(82808),a.DES=t(82211),a.CBC=t(3389),a.EDE=t(65279)},3389:(e,a,t)=>{"use strict";var c=t(43349),f=t(56698),d={};function r(e){c.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var a=0;a{"use strict";var c=t(43349);function f(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}e.exports=f,f.prototype._init=function(){},f.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},f.prototype._buffer=function(e,a){for(var t=Math.min(this.buffer.length-this.bufferOff,e.length-a),c=0;c0;c--)a+=this._buffer(e,a),t+=this._flushBuffer(f,t);return a+=this._buffer(e,a),f},f.prototype.final=function(e){var a,t;return e&&(a=this.update(e)),t="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),a?a.concat(t):t},f.prototype._pad=function(e,a){if(0===a)return!1;for(;a{"use strict";var c=t(43349),f=t(56698),d=t(87626),r=t(82808);function n(){this.tmp=new Array(2),this.keys=null}function i(e){r.call(this,e);var a=new n;this._desState=a,this.deriveKeys(a,e.key)}f(i,r),e.exports=i,i.create=function(e){return new i(e)};var b=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];i.prototype.deriveKeys=function(e,a){e.keys=new Array(32),c.equal(a.length,this.blockSize,"Invalid key length");var t=d.readUInt32BE(a,0),f=d.readUInt32BE(a,4);d.pc1(t,f,e.tmp,0),t=e.tmp[0],f=e.tmp[1];for(var r=0;r>>1];t=d.r28shl(t,n),f=d.r28shl(f,n),d.pc2(t,f,e.keys,r)}},i.prototype._update=function(e,a,t,c){var f=this._desState,r=d.readUInt32BE(e,a),n=d.readUInt32BE(e,a+4);d.ip(r,n,f.tmp,0),r=f.tmp[0],n=f.tmp[1],"encrypt"===this.type?this._encrypt(f,r,n,f.tmp,0):this._decrypt(f,r,n,f.tmp,0),r=f.tmp[0],n=f.tmp[1],d.writeUInt32BE(t,r,c),d.writeUInt32BE(t,n,c+4)},i.prototype._pad=function(e,a){if(!1===this.padding)return!1;for(var t=e.length-a,c=a;c>>0,r=l}d.rip(n,r,c,f)},i.prototype._decrypt=function(e,a,t,c,f){for(var r=t,n=a,i=e.keys.length-2;i>=0;i-=2){var b=e.keys[i],o=e.keys[i+1];d.expand(r,e.tmp,0),b^=e.tmp[0],o^=e.tmp[1];var s=d.substitute(b,o),l=r;r=(n^d.permute(s))>>>0,n=l}d.rip(r,n,c,f)}},65279:(e,a,t)=>{"use strict";var c=t(43349),f=t(56698),d=t(82808),r=t(82211);function n(e,a){c.equal(a.length,24,"Invalid key length");var t=a.slice(0,8),f=a.slice(8,16),d=a.slice(16,24);this.ciphers="encrypt"===e?[r.create({type:"encrypt",key:t}),r.create({type:"decrypt",key:f}),r.create({type:"encrypt",key:d})]:[r.create({type:"decrypt",key:d}),r.create({type:"encrypt",key:f}),r.create({type:"decrypt",key:t})]}function i(e){d.call(this,e);var a=new n(this.type,this.options.key);this._edeState=a}f(i,d),e.exports=i,i.create=function(e){return new i(e)},i.prototype._update=function(e,a,t,c){var f=this._edeState;f.ciphers[0]._update(e,a,t,c),f.ciphers[1]._update(t,c,t,c),f.ciphers[2]._update(t,c,t,c)},i.prototype._pad=r.prototype._pad,i.prototype._unpad=r.prototype._unpad},87626:(e,a)=>{"use strict";a.readUInt32BE=function(e,a){return(e[0+a]<<24|e[1+a]<<16|e[2+a]<<8|e[3+a])>>>0},a.writeUInt32BE=function(e,a,t){e[0+t]=a>>>24,e[1+t]=a>>>16&255,e[2+t]=a>>>8&255,e[3+t]=255&a},a.ip=function(e,a,t,c){for(var f=0,d=0,r=6;r>=0;r-=2){for(var n=0;n<=24;n+=8)f<<=1,f|=a>>>n+r&1;for(n=0;n<=24;n+=8)f<<=1,f|=e>>>n+r&1}for(r=6;r>=0;r-=2){for(n=1;n<=25;n+=8)d<<=1,d|=a>>>n+r&1;for(n=1;n<=25;n+=8)d<<=1,d|=e>>>n+r&1}t[c+0]=f>>>0,t[c+1]=d>>>0},a.rip=function(e,a,t,c){for(var f=0,d=0,r=0;r<4;r++)for(var n=24;n>=0;n-=8)f<<=1,f|=a>>>n+r&1,f<<=1,f|=e>>>n+r&1;for(r=4;r<8;r++)for(n=24;n>=0;n-=8)d<<=1,d|=a>>>n+r&1,d<<=1,d|=e>>>n+r&1;t[c+0]=f>>>0,t[c+1]=d>>>0},a.pc1=function(e,a,t,c){for(var f=0,d=0,r=7;r>=5;r--){for(var n=0;n<=24;n+=8)f<<=1,f|=a>>n+r&1;for(n=0;n<=24;n+=8)f<<=1,f|=e>>n+r&1}for(n=0;n<=24;n+=8)f<<=1,f|=a>>n+r&1;for(r=1;r<=3;r++){for(n=0;n<=24;n+=8)d<<=1,d|=a>>n+r&1;for(n=0;n<=24;n+=8)d<<=1,d|=e>>n+r&1}for(n=0;n<=24;n+=8)d<<=1,d|=e>>n+r&1;t[c+0]=f>>>0,t[c+1]=d>>>0},a.r28shl=function(e,a){return e<>>28-a};var t=[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];a.pc2=function(e,a,c,f){for(var d=0,r=0,n=t.length>>>1,i=0;i>>t[i]&1;for(i=n;i>>t[i]&1;c[f+0]=d>>>0,c[f+1]=r>>>0},a.expand=function(e,a,t){var c=0,f=0;c=(1&e)<<5|e>>>27;for(var d=23;d>=15;d-=4)c<<=6,c|=e>>>d&63;for(d=11;d>=3;d-=4)f|=e>>>d&63,f<<=6;f|=(31&e)<<1|e>>>31,a[t+0]=c>>>0,a[t+1]=f>>>0};var c=[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];a.substitute=function(e,a){for(var t=0,f=0;f<4;f++)t<<=4,t|=c[64*f+(e>>>18-6*f&63)];for(f=0;f<4;f++)t<<=4,t|=c[256+64*f+(a>>>18-6*f&63)];return t>>>0};var f=[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];a.permute=function(e){for(var a=0,t=0;t>>f[t]&1;return a>>>0},a.padSplit=function(e,a,t){for(var c=e.toString(2);c.length{var c=t(48287).Buffer,f=t(4934),d=t(23241),r=t(14910),n={binary:!0,hex:!0,base64:!0};a.DiffieHellmanGroup=a.createDiffieHellmanGroup=a.getDiffieHellman=function(e){var a=new c(d[e].prime,"hex"),t=new c(d[e].gen,"hex");return new r(a,t)},a.createDiffieHellman=a.DiffieHellman=function e(a,t,d,i){return c.isBuffer(t)||void 0===n[t]?e(a,"binary",t,d):(t=t||"binary",i=i||"binary",d=d||new c([2]),c.isBuffer(d)||(d=new c(d,i)),"number"==typeof a?new r(f(a,d),d,!0):(c.isBuffer(a)||(a=new c(a,t)),new r(a,d,!0)))}},14910:(e,a,t)=>{var c=t(48287).Buffer,f=t(66473),d=new(t(52244)),r=new f(24),n=new f(11),i=new f(10),b=new f(3),o=new f(7),s=t(4934),l=t(53209);function u(e,a){return a=a||"utf8",c.isBuffer(e)||(e=new c(e,a)),this._pub=new f(e),this}function h(e,a){return a=a||"utf8",c.isBuffer(e)||(e=new c(e,a)),this._priv=new f(e),this}e.exports=g;var p={};function g(e,a,t){this.setGenerator(a),this.__prime=new f(e),this._prime=f.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,t?(this.setPublicKey=u,this.setPrivateKey=h):this._primeCode=8}function m(e,a){var t=new c(e.toArray());return a?t.toString(a):t}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,a){var t=a.toString("hex"),c=[t,e.toString(16)].join("_");if(c in p)return p[c];var f,l=0;if(e.isEven()||!s.simpleSieve||!s.fermatTest(e)||!d.test(e))return l+=1,l+="02"===t||"05"===t?8:4,p[c]=l,l;switch(d.test(e.shrn(1))||(l+=2),t){case"02":e.mod(r).cmp(n)&&(l+=8);break;case"05":(f=e.mod(i)).cmp(b)&&f.cmp(o)&&(l+=8);break;default:l+=4}return p[c]=l,l}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new f(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(e){var a=(e=(e=new f(e)).toRed(this._prime)).redPow(this._priv).fromRed(),t=new c(a.toArray()),d=this.getPrime();if(t.length{var c=t(53209);e.exports=x,x.simpleSieve=g,x.fermatTest=m;var f=t(66473),d=new f(24),r=new(t(52244)),n=new f(1),i=new f(2),b=new f(5),o=(new f(16),new f(8),new f(10)),s=new f(3),l=(new f(7),new f(11)),u=new f(4),h=(new f(12),null);function p(){if(null!==h)return h;var e=[];e[0]=2;for(var a=1,t=3;t<1048576;t+=2){for(var c=Math.ceil(Math.sqrt(t)),f=0;fe;)t.ishrn(1);if(t.isEven()&&t.iadd(n),t.testn(1)||t.iadd(i),a.cmp(i)){if(!a.cmp(b))for(;t.mod(o).cmp(s);)t.iadd(u)}else for(;t.mod(d).cmp(l);)t.iadd(u);if(g(h=t.shrn(1))&&g(t)&&m(h)&&m(t)&&r.test(h)&&r.test(t))return t}}},66473:function(e,a,t){!function(e,a){"use strict";function c(e,a){if(!e)throw new Error(a||"Assertion failed")}function f(e,a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}function d(e,a,t){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(t=a,a=10),this._init(e||0,a||10,t||"be"))}var r;"object"==typeof e?e.exports=d:a.BN=d,d.BN=d,d.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(66089).Buffer}catch(e){}function n(e,a){var t=e.charCodeAt(a);return t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,D=R>>>13,T=0|r[9],F=8191&T,Q=T>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},86729:(e,a,t)=>{"use strict";var c=a;c.version=t(1636).rE,c.utils=t(47011),c.rand=t(15037),c.curve=t(894),c.curves=t(60480),c.ec=t(57447),c.eddsa=t(8650)},36677:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011),d=f.getNAF,r=f.getJSF,n=f.assert;function i(e,a){this.type=e,this.p=new c(a.p,16),this.red=a.prime?c.red(a.prime):c.mont(this.p),this.zero=new c(0).toRed(this.red),this.one=new c(1).toRed(this.red),this.two=new c(2).toRed(this.red),this.n=a.n&&new c(a.n,16),this.g=a.g&&this.pointFromJSON(a.g,a.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 t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function b(e,a){this.curve=e,this.type=a,this.precomputed=null}e.exports=i,i.prototype.point=function(){throw new Error("Not implemented")},i.prototype.validate=function(){throw new Error("Not implemented")},i.prototype._fixedNafMul=function(e,a){n(e.precomputed);var t=e._getDoubles(),c=d(a,1,this._bitLength),f=(1<=r;o--)i=(i<<1)+c[o];b.push(i)}for(var s=this.jpoint(null,null,null),l=this.jpoint(null,null,null),u=f;u>0;u--){for(r=0;r=0;b--){for(var o=0;b>=0&&0===r[b];b--)o++;if(b>=0&&o++,i=i.dblp(o),b<0)break;var s=r[b];n(0!==s),i="affine"===e.type?s>0?i.mixedAdd(f[s-1>>1]):i.mixedAdd(f[-s-1>>1].neg()):s>0?i.add(f[s-1>>1]):i.add(f[-s-1>>1].neg())}return"affine"===e.type?i.toP():i},i.prototype._wnafMulAdd=function(e,a,t,c,f){var n,i,b,o=this._wnafT1,s=this._wnafT2,l=this._wnafT3,u=0;for(n=0;n=1;n-=2){var p=n-1,g=n;if(1===o[p]&&1===o[g]){var m=[a[p],null,null,a[g]];0===a[p].y.cmp(a[g].y)?(m[1]=a[p].add(a[g]),m[2]=a[p].toJ().mixedAdd(a[g].neg())):0===a[p].y.cmp(a[g].y.redNeg())?(m[1]=a[p].toJ().mixedAdd(a[g]),m[2]=a[p].add(a[g].neg())):(m[1]=a[p].toJ().mixedAdd(a[g]),m[2]=a[p].toJ().mixedAdd(a[g].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],y=r(t[p],t[g]);for(u=Math.max(y[0].length,u),l[p]=new Array(u),l[g]=new Array(u),i=0;i=0;n--){for(var I=0;n>=0;){var E=!0;for(i=0;i=0&&I++,w=w.dblp(I),n<0)break;for(i=0;i0?b=s[i][C-1>>1]:C<0&&(b=s[i][-C-1>>1].neg()),w="affine"===b.type?w.mixedAdd(b):w.add(b))}}for(n=0;n=Math.ceil((e.bitLength()+1)/a.step)},b.prototype._getDoubles=function(e,a){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var t=[this],c=this,f=0;f{"use strict";var c=t(47011),f=t(28490),d=t(56698),r=t(36677),n=c.assert;function i(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,r.call(this,"edwards",e),this.a=new f(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new f(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new f(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),n(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function b(e,a,t,c,d){r.BasePoint.call(this,e,"projective"),null===a&&null===t&&null===c?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new f(a,16),this.y=new f(t,16),this.z=c?new f(c,16):this.curve.one,this.t=d&&new f(d,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()))))}d(i,r),e.exports=i,i.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},i.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},i.prototype.jpoint=function(e,a,t,c){return this.point(e,a,t,c)},i.prototype.pointFromX=function(e,a){(e=new f(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr(),c=this.c2.redSub(this.a.redMul(t)),d=this.one.redSub(this.c2.redMul(this.d).redMul(t)),r=c.redMul(d.redInvm()),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(a&&!i||!a&&i)&&(n=n.redNeg()),this.point(e,n)},i.prototype.pointFromY=function(e,a){(e=new f(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr(),c=t.redSub(this.c2),d=t.redMul(this.d).redMul(this.c2).redSub(this.a),r=c.redMul(d.redInvm());if(0===r.cmp(this.zero)){if(a)throw new Error("invalid point");return this.point(this.zero,e)}var n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");return n.fromRed().isOdd()!==a&&(n=n.redNeg()),this.point(n,e)},i.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var a=e.x.redSqr(),t=e.y.redSqr(),c=a.redMul(this.a).redAdd(t),f=this.c2.redMul(this.one.redAdd(this.d.redMul(a).redMul(t)));return 0===c.cmp(f)},d(b,r.BasePoint),i.prototype.pointFromJSON=function(e){return b.fromJSON(this,e)},i.prototype.point=function(e,a,t,c){return new b(this,e,a,t,c)},b.fromJSON=function(e,a){return new b(e,a[0],a[1],a[2])},b.prototype.inspect=function(){return this.isInfinity()?"":""},b.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},b.prototype._extDbl=function(){var e=this.x.redSqr(),a=this.y.redSqr(),t=this.z.redSqr();t=t.redIAdd(t);var c=this.curve._mulA(e),f=this.x.redAdd(this.y).redSqr().redISub(e).redISub(a),d=c.redAdd(a),r=d.redSub(t),n=c.redSub(a),i=f.redMul(r),b=d.redMul(n),o=f.redMul(n),s=r.redMul(d);return this.curve.point(i,b,s,o)},b.prototype._projDbl=function(){var e,a,t,c,f,d,r=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),i=this.y.redSqr();if(this.curve.twisted){var b=(c=this.curve._mulA(n)).redAdd(i);this.zOne?(e=r.redSub(n).redSub(i).redMul(b.redSub(this.curve.two)),a=b.redMul(c.redSub(i)),t=b.redSqr().redSub(b).redSub(b)):(f=this.z.redSqr(),d=b.redSub(f).redISub(f),e=r.redSub(n).redISub(i).redMul(d),a=b.redMul(c.redSub(i)),t=b.redMul(d))}else c=n.redAdd(i),f=this.curve._mulC(this.z).redSqr(),d=c.redSub(f).redSub(f),e=this.curve._mulC(r.redISub(c)).redMul(d),a=this.curve._mulC(c).redMul(n.redISub(i)),t=c.redMul(d);return this.curve.point(e,a,t)},b.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},b.prototype._extAdd=function(e){var a=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),t=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),c=this.t.redMul(this.curve.dd).redMul(e.t),f=this.z.redMul(e.z.redAdd(e.z)),d=t.redSub(a),r=f.redSub(c),n=f.redAdd(c),i=t.redAdd(a),b=d.redMul(r),o=n.redMul(i),s=d.redMul(i),l=r.redMul(n);return this.curve.point(b,o,l,s)},b.prototype._projAdd=function(e){var a,t,c=this.z.redMul(e.z),f=c.redSqr(),d=this.x.redMul(e.x),r=this.y.redMul(e.y),n=this.curve.d.redMul(d).redMul(r),i=f.redSub(n),b=f.redAdd(n),o=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(d).redISub(r),s=c.redMul(i).redMul(o);return this.curve.twisted?(a=c.redMul(b).redMul(r.redSub(this.curve._mulA(d))),t=i.redMul(b)):(a=c.redMul(b).redMul(r.redSub(d)),t=this.curve._mulC(i).redMul(b)),this.curve.point(s,a,t)},b.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},b.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},b.prototype.mulAdd=function(e,a,t){return this.curve._wnafMulAdd(1,[this,a],[e,t],2,!1)},b.prototype.jmulAdd=function(e,a,t){return this.curve._wnafMulAdd(1,[this,a],[e,t],2,!0)},b.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},b.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},b.prototype.getX=function(){return this.normalize(),this.x.fromRed()},b.prototype.getY=function(){return this.normalize(),this.y.fromRed()},b.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},b.prototype.eqXToP=function(e){var a=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(a))return!0;for(var t=e.clone(),c=this.curve.redN.redMul(this.z);;){if(t.iadd(this.curve.n),t.cmp(this.curve.p)>=0)return!1;if(a.redIAdd(c),0===this.x.cmp(a))return!0}},b.prototype.toP=b.prototype.normalize,b.prototype.mixedAdd=b.prototype.add},894:(e,a,t)=>{"use strict";var c=a;c.base=t(36677),c.short=t(39188),c.mont=t(30370),c.edwards=t(31298)},30370:(e,a,t)=>{"use strict";var c=t(28490),f=t(56698),d=t(36677),r=t(47011);function n(e){d.call(this,"mont",e),this.a=new c(e.a,16).toRed(this.red),this.b=new c(e.b,16).toRed(this.red),this.i4=new c(4).toRed(this.red).redInvm(),this.two=new c(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(e,a,t){d.BasePoint.call(this,e,"projective"),null===a&&null===t?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new c(a,16),this.z=new c(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}f(n,d),e.exports=n,n.prototype.validate=function(e){var a=e.normalize().x,t=a.redSqr(),c=t.redMul(a).redAdd(t.redMul(this.a)).redAdd(a);return 0===c.redSqrt().redSqr().cmp(c)},f(i,d.BasePoint),n.prototype.decodePoint=function(e,a){return this.point(r.toArray(e,a),1)},n.prototype.point=function(e,a){return new i(this,e,a)},n.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(e,a){return new i(e,a[0],a[1]||e.one)},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),a=this.x.redSub(this.z).redSqr(),t=e.redSub(a),c=e.redMul(a),f=t.redMul(a.redAdd(this.curve.a24.redMul(t)));return this.curve.point(c,f)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(e,a){var t=this.x.redAdd(this.z),c=this.x.redSub(this.z),f=e.x.redAdd(e.z),d=e.x.redSub(e.z).redMul(t),r=f.redMul(c),n=a.z.redMul(d.redAdd(r).redSqr()),i=a.x.redMul(d.redISub(r).redSqr());return this.curve.point(n,i)},i.prototype.mul=function(e){for(var a=e.clone(),t=this,c=this.curve.point(null,null),f=[];0!==a.cmpn(0);a.iushrn(1))f.push(a.andln(1));for(var d=f.length-1;d>=0;d--)0===f[d]?(t=t.diffAdd(c,this),c=c.dbl()):(c=t.diffAdd(c,this),t=t.dbl());return c},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},39188:(e,a,t)=>{"use strict";var c=t(47011),f=t(28490),d=t(56698),r=t(36677),n=c.assert;function i(e){r.call(this,"short",e),this.a=new f(e.a,16).toRed(this.red),this.b=new f(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function b(e,a,t,c){r.BasePoint.call(this,e,"affine"),null===a&&null===t?(this.x=null,this.y=null,this.inf=!0):(this.x=new f(a,16),this.y=new f(t,16),c&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function o(e,a,t,c){r.BasePoint.call(this,e,"jacobian"),null===a&&null===t&&null===c?(this.x=this.curve.one,this.y=this.curve.one,this.z=new f(0)):(this.x=new f(a,16),this.y=new f(t,16),this.z=new f(c,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}d(i,r),e.exports=i,i.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var a,t;if(e.beta)a=new f(e.beta,16).toRed(this.red);else{var c=this._getEndoRoots(this.p);a=(a=c[0].cmp(c[1])<0?c[0]:c[1]).toRed(this.red)}if(e.lambda)t=new f(e.lambda,16);else{var d=this._getEndoRoots(this.n);0===this.g.mul(d[0]).x.cmp(this.g.x.redMul(a))?t=d[0]:(t=d[1],n(0===this.g.mul(t).x.cmp(this.g.x.redMul(a))))}return{beta:a,lambda:t,basis:e.basis?e.basis.map((function(e){return{a:new f(e.a,16),b:new f(e.b,16)}})):this._getEndoBasis(t)}}},i.prototype._getEndoRoots=function(e){var a=e===this.p?this.red:f.mont(e),t=new f(2).toRed(a).redInvm(),c=t.redNeg(),d=new f(3).toRed(a).redNeg().redSqrt().redMul(t);return[c.redAdd(d).fromRed(),c.redSub(d).fromRed()]},i.prototype._getEndoBasis=function(e){for(var a,t,c,d,r,n,i,b,o,s=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,u=this.n.clone(),h=new f(1),p=new f(0),g=new f(0),m=new f(1),x=0;0!==l.cmpn(0);){var y=u.div(l);b=u.sub(y.mul(l)),o=g.sub(y.mul(h));var A=m.sub(y.mul(p));if(!c&&b.cmp(s)<0)a=i.neg(),t=h,c=b.neg(),d=o;else if(c&&2==++x)break;i=b,u=l,l=b,g=h,h=o,m=p,p=A}r=b.neg(),n=o;var v=c.sqr().add(d.sqr());return r.sqr().add(n.sqr()).cmp(v)>=0&&(r=a,n=t),c.negative&&(c=c.neg(),d=d.neg()),r.negative&&(r=r.neg(),n=n.neg()),[{a:c,b:d},{a:r,b:n}]},i.prototype._endoSplit=function(e){var a=this.endo.basis,t=a[0],c=a[1],f=c.b.mul(e).divRound(this.n),d=t.b.neg().mul(e).divRound(this.n),r=f.mul(t.a),n=d.mul(c.a),i=f.mul(t.b),b=d.mul(c.b);return{k1:e.sub(r).sub(n),k2:i.add(b).neg()}},i.prototype.pointFromX=function(e,a){(e=new f(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),c=t.redSqrt();if(0!==c.redSqr().redSub(t).cmp(this.zero))throw new Error("invalid point");var d=c.fromRed().isOdd();return(a&&!d||!a&&d)&&(c=c.redNeg()),this.point(e,c)},i.prototype.validate=function(e){if(e.inf)return!0;var a=e.x,t=e.y,c=this.a.redMul(a),f=a.redSqr().redMul(a).redIAdd(c).redIAdd(this.b);return 0===t.redSqr().redISub(f).cmpn(0)},i.prototype._endoWnafMulAdd=function(e,a,t){for(var c=this._endoWnafT1,f=this._endoWnafT2,d=0;d":""},b.prototype.isInfinity=function(){return this.inf},b.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var a=this.y.redSub(e.y);0!==a.cmpn(0)&&(a=a.redMul(this.x.redSub(e.x).redInvm()));var t=a.redSqr().redISub(this.x).redISub(e.x),c=a.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,c)},b.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var a=this.curve.a,t=this.x.redSqr(),c=e.redInvm(),f=t.redAdd(t).redIAdd(t).redIAdd(a).redMul(c),d=f.redSqr().redISub(this.x.redAdd(this.x)),r=f.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,r)},b.prototype.getX=function(){return this.x.fromRed()},b.prototype.getY=function(){return this.y.fromRed()},b.prototype.mul=function(e){return e=new f(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},b.prototype.mulAdd=function(e,a,t){var c=[this,a],f=[e,t];return this.curve.endo?this.curve._endoWnafMulAdd(c,f):this.curve._wnafMulAdd(1,c,f,2)},b.prototype.jmulAdd=function(e,a,t){var c=[this,a],f=[e,t];return this.curve.endo?this.curve._endoWnafMulAdd(c,f,!0):this.curve._wnafMulAdd(1,c,f,2,!0)},b.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},b.prototype.neg=function(e){if(this.inf)return this;var a=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var t=this.precomputed,c=function(e){return e.neg()};a.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(c)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(c)}}}return a},b.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},d(o,r.BasePoint),i.prototype.jpoint=function(e,a,t){return new o(this,e,a,t)},o.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),a=e.redSqr(),t=this.x.redMul(a),c=this.y.redMul(a).redMul(e);return this.curve.point(t,c)},o.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},o.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var a=e.z.redSqr(),t=this.z.redSqr(),c=this.x.redMul(a),f=e.x.redMul(t),d=this.y.redMul(a.redMul(e.z)),r=e.y.redMul(t.redMul(this.z)),n=c.redSub(f),i=d.redSub(r);if(0===n.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var b=n.redSqr(),o=b.redMul(n),s=c.redMul(b),l=i.redSqr().redIAdd(o).redISub(s).redISub(s),u=i.redMul(s.redISub(l)).redISub(d.redMul(o)),h=this.z.redMul(e.z).redMul(n);return this.curve.jpoint(l,u,h)},o.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var a=this.z.redSqr(),t=this.x,c=e.x.redMul(a),f=this.y,d=e.y.redMul(a).redMul(this.z),r=t.redSub(c),n=f.redSub(d);if(0===r.cmpn(0))return 0!==n.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=r.redSqr(),b=i.redMul(r),o=t.redMul(i),s=n.redSqr().redIAdd(b).redISub(o).redISub(o),l=n.redMul(o.redISub(s)).redISub(f.redMul(b)),u=this.z.redMul(r);return this.curve.jpoint(s,l,u)},o.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var a;if(this.curve.zeroA||this.curve.threeA){var t=this;for(a=0;a=0)return!1;if(t.redIAdd(f),0===this.x.cmp(t))return!0}},o.prototype.inspect=function(){return this.isInfinity()?"":""},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},60480:(e,a,t)=>{"use strict";var c,f=a,d=t(77952),r=t(894),n=t(47011).assert;function i(e){"short"===e.type?this.curve=new r.short(e):"edwards"===e.type?this.curve=new r.edwards(e):this.curve=new r.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function b(e,a){Object.defineProperty(f,e,{configurable:!0,enumerable:!0,get:function(){var t=new i(a);return Object.defineProperty(f,e,{configurable:!0,enumerable:!0,value:t}),t}})}f.PresetCurve=i,b("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:d.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),b("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:d.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),b("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:d.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),b("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:d.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),b("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:d.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),b("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:d.sha256,gRed:!1,g:["9"]}),b("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:d.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{c=t(74011)}catch(e){c=void 0}b("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:d.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})},57447:(e,a,t)=>{"use strict";var c=t(28490),f=t(32723),d=t(47011),r=t(60480),n=t(15037),i=d.assert,b=t(61200),o=t(28545);function s(e){if(!(this instanceof s))return new s(e);"string"==typeof e&&(i(Object.prototype.hasOwnProperty.call(r,e),"Unknown curve "+e),e=r[e]),e instanceof r.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=s,s.prototype.keyPair=function(e){return new b(this,e)},s.prototype.keyFromPrivate=function(e,a){return b.fromPrivate(this,e,a)},s.prototype.keyFromPublic=function(e,a){return b.fromPublic(this,e,a)},s.prototype.genKeyPair=function(e){e||(e={});for(var a=new f({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||n(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),d=this.n.sub(new c(2));;){var r=new c(a.generate(t));if(!(r.cmp(d)>0))return r.iaddn(1),this.keyFromPrivate(r)}},s.prototype._truncateToN=function(e,a){var t=8*e.byteLength()-this.n.bitLength();return t>0&&(e=e.ushrn(t)),!a&&e.cmp(this.n)>=0?e.sub(this.n):e},s.prototype.sign=function(e,a,t,d){"object"==typeof t&&(d=t,t=null),d||(d={}),a=this.keyFromPrivate(a,t),e=this._truncateToN(new c(e,16));for(var r=this.n.byteLength(),n=a.getPrivate().toArray("be",r),i=e.toArray("be",r),b=new f({hash:this.hash,entropy:n,nonce:i,pers:d.pers,persEnc:d.persEnc||"utf8"}),s=this.n.sub(new c(1)),l=0;;l++){var u=d.k?d.k(l):new c(b.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(s)>=0)){var h=this.g.mul(u);if(!h.isInfinity()){var p=h.getX(),g=p.umod(this.n);if(0!==g.cmpn(0)){var m=u.invm(this.n).mul(g.mul(a.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var x=(h.getY().isOdd()?1:0)|(0!==p.cmp(g)?2:0);return d.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),x^=1),new o({r:g,s:m,recoveryParam:x})}}}}}},s.prototype.verify=function(e,a,t,f){e=this._truncateToN(new c(e,16)),t=this.keyFromPublic(t,f);var d=(a=new o(a,"hex")).r,r=a.s;if(d.cmpn(1)<0||d.cmp(this.n)>=0)return!1;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;var n,i=r.invm(this.n),b=i.mul(e).umod(this.n),s=i.mul(d).umod(this.n);return this.curve._maxwellTrick?!(n=this.g.jmulAdd(b,t.getPublic(),s)).isInfinity()&&n.eqXToP(d):!(n=this.g.mulAdd(b,t.getPublic(),s)).isInfinity()&&0===n.getX().umod(this.n).cmp(d)},s.prototype.recoverPubKey=function(e,a,t,f){i((3&t)===t,"The recovery param is more than two bits"),a=new o(a,f);var d=this.n,r=new c(e),n=a.r,b=a.s,s=1&t,l=t>>1;if(n.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");n=l?this.curve.pointFromX(n.add(this.curve.n),s):this.curve.pointFromX(n,s);var u=a.r.invm(d),h=d.sub(r).mul(u).umod(d),p=b.mul(u).umod(d);return this.g.mulAdd(h,n,p)},s.prototype.getKeyRecoveryParam=function(e,a,t,c){if(null!==(a=new o(a,c)).recoveryParam)return a.recoveryParam;for(var f=0;f<4;f++){var d;try{d=this.recoverPubKey(e,a,f)}catch(e){continue}if(d.eq(t))return f}throw new Error("Unable to find valid recovery factor")}},61200:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011).assert;function d(e,a){this.ec=e,this.priv=null,this.pub=null,a.priv&&this._importPrivate(a.priv,a.privEnc),a.pub&&this._importPublic(a.pub,a.pubEnc)}e.exports=d,d.fromPublic=function(e,a,t){return a instanceof d?a:new d(e,{pub:a,pubEnc:t})},d.fromPrivate=function(e,a,t){return a instanceof d?a:new d(e,{priv:a,privEnc:t})},d.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},d.prototype.getPublic=function(e,a){return"string"==typeof e&&(a=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),a?this.pub.encode(a,e):this.pub},d.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},d.prototype._importPrivate=function(e,a){this.priv=new c(e,a||16),this.priv=this.priv.umod(this.ec.curve.n)},d.prototype._importPublic=function(e,a){if(e.x||e.y)return"mont"===this.ec.curve.type?f(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||f(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,a)},d.prototype.derive=function(e){return e.validate()||f(e.validate(),"public point not validated"),e.mul(this.priv).getX()},d.prototype.sign=function(e,a,t){return this.ec.sign(e,this,a,t)},d.prototype.verify=function(e,a){return this.ec.verify(e,a,this)},d.prototype.inspect=function(){return""}},28545:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011),d=f.assert;function r(e,a){if(e instanceof r)return e;this._importDER(e,a)||(d(e.r&&e.s,"Signature without r or s"),this.r=new c(e.r,16),this.s=new c(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function n(){this.place=0}function i(e,a){var t=e[a.place++];if(!(128&t))return t;var c=15&t;if(0===c||c>4)return!1;if(0===e[a.place])return!1;for(var f=0,d=0,r=a.place;d>>=0;return!(f<=127)&&(a.place=r,f)}function b(e){for(var a=0,t=e.length-1;!e[a]&&!(128&e[a+1])&&a>>3);for(e.push(128|t);--t;)e.push(a>>>(t<<3)&255);e.push(a)}}e.exports=r,r.prototype._importDER=function(e,a){e=f.toArray(e,a);var t=new n;if(48!==e[t.place++])return!1;var d=i(e,t);if(!1===d)return!1;if(d+t.place!==e.length)return!1;if(2!==e[t.place++])return!1;var r=i(e,t);if(!1===r)return!1;if(128&e[t.place])return!1;var b=e.slice(t.place,r+t.place);if(t.place+=r,2!==e[t.place++])return!1;var o=i(e,t);if(!1===o)return!1;if(e.length!==o+t.place)return!1;if(128&e[t.place])return!1;var s=e.slice(t.place,o+t.place);if(0===b[0]){if(!(128&b[1]))return!1;b=b.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new c(b),this.s=new c(s),this.recoveryParam=null,!0},r.prototype.toDER=function(e){var a=this.r.toArray(),t=this.s.toArray();for(128&a[0]&&(a=[0].concat(a)),128&t[0]&&(t=[0].concat(t)),a=b(a),t=b(t);!(t[0]||128&t[1]);)t=t.slice(1);var c=[2];o(c,a.length),(c=c.concat(a)).push(2),o(c,t.length);var d=c.concat(t),r=[48];return o(r,d.length),r=r.concat(d),f.encode(r,e)}},8650:(e,a,t)=>{"use strict";var c=t(77952),f=t(60480),d=t(47011),r=d.assert,n=d.parseBytes,i=t(46661),b=t(90220);function o(e){if(r("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof o))return new o(e);e=f[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=c.sha512}e.exports=o,o.prototype.sign=function(e,a){e=n(e);var t=this.keyFromSecret(a),c=this.hashInt(t.messagePrefix(),e),f=this.g.mul(c),d=this.encodePoint(f),r=this.hashInt(d,t.pubBytes(),e).mul(t.priv()),i=c.add(r).umod(this.curve.n);return this.makeSignature({R:f,S:i,Rencoded:d})},o.prototype.verify=function(e,a,t){if(e=n(e),(a=this.makeSignature(a)).S().gte(a.eddsa.curve.n)||a.S().isNeg())return!1;var c=this.keyFromPublic(t),f=this.hashInt(a.Rencoded(),c.pubBytes(),e),d=this.g.mul(a.S());return a.R().add(c.pub().mul(f)).eq(d)},o.prototype.hashInt=function(){for(var e=this.hash(),a=0;a{"use strict";var c=t(47011),f=c.assert,d=c.parseBytes,r=c.cachedProperty;function n(e,a){this.eddsa=e,this._secret=d(a.secret),e.isPoint(a.pub)?this._pub=a.pub:this._pubBytes=d(a.pub)}n.fromPublic=function(e,a){return a instanceof n?a:new n(e,{pub:a})},n.fromSecret=function(e,a){return a instanceof n?a:new n(e,{secret:a})},n.prototype.secret=function(){return this._secret},r(n,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),r(n,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),r(n,"privBytes",(function(){var e=this.eddsa,a=this.hash(),t=e.encodingLength-1,c=a.slice(0,e.encodingLength);return c[0]&=248,c[t]&=127,c[t]|=64,c})),r(n,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),r(n,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),r(n,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),n.prototype.sign=function(e){return f(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},n.prototype.verify=function(e,a){return this.eddsa.verify(e,a,this)},n.prototype.getSecret=function(e){return f(this._secret,"KeyPair is public only"),c.encode(this.secret(),e)},n.prototype.getPublic=function(e){return c.encode(this.pubBytes(),e)},e.exports=n},90220:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011),d=f.assert,r=f.cachedProperty,n=f.parseBytes;function i(e,a){this.eddsa=e,"object"!=typeof a&&(a=n(a)),Array.isArray(a)&&(d(a.length===2*e.encodingLength,"Signature has invalid size"),a={R:a.slice(0,e.encodingLength),S:a.slice(e.encodingLength)}),d(a.R&&a.S,"Signature without R or S"),e.isPoint(a.R)&&(this._R=a.R),a.S instanceof c&&(this._S=a.S),this._Rencoded=Array.isArray(a.R)?a.R:a.Rencoded,this._Sencoded=Array.isArray(a.S)?a.S:a.Sencoded}r(i,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),r(i,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),r(i,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),r(i,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),i.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},i.prototype.toHex=function(){return f.encode(this.toBytes(),"hex").toUpperCase()},e.exports=i},74011:e=>{e.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"]]}}},47011:(e,a,t)=>{"use strict";var c=a,f=t(28490),d=t(43349),r=t(64367);c.assert=d,c.toArray=r.toArray,c.zero2=r.zero2,c.toHex=r.toHex,c.encode=r.encode,c.getNAF=function(e,a,t){var c,f=new Array(Math.max(e.bitLength(),t)+1);for(c=0;c(d>>1)-1?(d>>1)-i:i,r.isubn(n)):n=0,f[c]=n,r.iushrn(1)}return f},c.getJSF=function(e,a){var t=[[],[]];e=e.clone(),a=a.clone();for(var c,f=0,d=0;e.cmpn(-f)>0||a.cmpn(-d)>0;){var r,n,i=e.andln(3)+f&3,b=a.andln(3)+d&3;3===i&&(i=-1),3===b&&(b=-1),r=1&i?3!=(c=e.andln(7)+f&7)&&5!==c||2!==b?i:-i:0,t[0].push(r),n=1&b?3!=(c=a.andln(7)+d&7)&&5!==c||2!==i?b:-b:0,t[1].push(n),2*f===r+1&&(f=1-f),2*d===n+1&&(d=1-d),e.iushrn(1),a.iushrn(1)}return t},c.cachedProperty=function(e,a,t){var c="_"+a;e.prototype[a]=function(){return void 0!==this[c]?this[c]:this[c]=t.call(this)}},c.parseBytes=function(e){return"string"==typeof e?c.toArray(e,"hex"):e},c.intFromLE=function(e){return new f(e,"hex","le")}},28490:function(e,a,t){!function(e,a){"use strict";function c(e,a){if(!e)throw new Error(a||"Assertion failed")}function f(e,a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}function d(e,a,t){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(t=a,a=10),this._init(e||0,a||10,t||"be"))}var r;"object"==typeof e?e.exports=d:a.BN=d,d.BN=d,d.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(79368).Buffer}catch(e){}function n(e,a){var t=e.charCodeAt(a);return t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,D=R>>>13,T=0|r[9],F=8191&T,Q=T>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},30655:(e,a,t)=>{"use strict";var c=t(70453)("%Object.defineProperty%",!0)||!1;if(c)try{c({},"a",{value:1})}catch(e){c=!1}e.exports=c},41237:e=>{"use strict";e.exports=EvalError},69383:e=>{"use strict";e.exports=Error},79290:e=>{"use strict";e.exports=RangeError},79538:e=>{"use strict";e.exports=ReferenceError},58068:e=>{"use strict";e.exports=SyntaxError},69675:e=>{"use strict";e.exports=TypeError},35345:e=>{"use strict";e.exports=URIError},9723:(e,a,t)=>{"use strict";t.d(a,{AF:()=>r,B3:()=>d,JY:()=>n});var c=t(67418),f=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));class d{constructor({provider:e,onProgress:a,concurrencySize:t=10,batchSize:c=10,shouldRetry:f=!0,retryMax:d=5,retryOn:r=500}){this.provider=e,this.onProgress=a,this.concurrencySize=t,this.batchSize=c,this.shouldRetry=f,this.retryMax=d,this.retryOn=r}getBlock(e){return f(this,null,(function*(){const a=yield this.provider.getBlock(e);if(!a)throw new Error(`No block for ${e}`);return a}))}createBatchRequest(e){return e.map(((e,a)=>f(this,null,(function*(){return yield(0,c.yy)(20*a),(()=>f(this,null,(function*(){let a,t=0;for(;!this.shouldRetry&&0===t||this.shouldRetry&&tthis.getBlock(e))))}catch(e){t++,a=e,yield(0,c.yy)(this.retryOn)}throw a})))()}))))}getBatchBlocks(e){return f(this,null,(function*(){let a=0;const t=[];for(const f of(0,c.iv)(e,this.concurrencySize*this.batchSize)){const d=(yield Promise.all(this.createBatchRequest((0,c.iv)(f,this.batchSize)))).flat();t.push(...d),a+=f.length,"function"==typeof this.onProgress&&this.onProgress({percentage:a/e.length,currentIndex:a,totalIndex:e.length})}return t}))}}class r{constructor({provider:e,onProgress:a,concurrencySize:t=10,batchSize:c=10,shouldRetry:f=!0,retryMax:d=5,retryOn:r=500}){this.provider=e,this.onProgress=a,this.concurrencySize=t,this.batchSize=c,this.shouldRetry=f,this.retryMax=d,this.retryOn=r}getTransaction(e){return f(this,null,(function*(){const a=yield this.provider.getTransaction(e);if(!a)throw new Error(`No transaction for ${e}`);return a}))}createBatchRequest(e){return e.map(((e,a)=>f(this,null,(function*(){return yield(0,c.yy)(20*a),(()=>f(this,null,(function*(){let a,t=0;for(;!this.shouldRetry&&0===t||this.shouldRetry&&tthis.getTransaction(e))))}catch(e){t++,a=e,yield(0,c.yy)(this.retryOn)}throw a})))()}))))}getBatchTransactions(e){return f(this,null,(function*(){let a=0;const t=[];for(const f of(0,c.iv)(e,this.concurrencySize*this.batchSize)){const d=(yield Promise.all(this.createBatchRequest((0,c.iv)(f,this.batchSize)))).flat();t.push(...d),a+=f.length,"function"==typeof this.onProgress&&this.onProgress({percentage:a/e.length,currentIndex:a,totalIndex:e.length})}return t}))}}class n{constructor({provider:e,contract:a,onProgress:t,concurrencySize:c=10,blocksPerRequest:f=2e3,shouldRetry:d=!0,retryMax:r=5,retryOn:n=500}){this.provider=e,this.contract=a,this.onProgress=t,this.concurrencySize=c,this.blocksPerRequest=f,this.shouldRetry=d,this.retryMax=r,this.retryOn=n}getPastEvents(e){return f(this,arguments,(function*({fromBlock:e,toBlock:a,type:t}){let f,d=0;for(;!this.shouldRetry&&0===d||this.shouldRetry&&df(this,null,(function*(){return yield(0,c.yy)(20*a),this.getPastEvents(e)}))))}getBatchEvents(e){return f(this,arguments,(function*({fromBlock:e,toBlock:a,type:t="*"}){a||(a=yield this.provider.getBlockNumber());const f=[];for(let c=e;ca?a:c+this.blocksPerRequest-1;f.push({fromBlock:c,toBlock:e,type:t})}const d=[],r=(0,c.iv)(f,this.concurrencySize);let n=0;for(const e of r){n++;const a=(yield Promise.all(this.createBatchRequest(e))).flat();d.push(...a),"function"==typeof this.onProgress&&this.onProgress({percentage:n/r.length,type:t,fromBlock:e[0].fromBlock,toBlock:e[e.length-1].toBlock,count:a.length})}return d}))}}},7240:(e,a,t)=>{"use strict";t.d(a,{Hr:()=>r,dA:()=>n,qO:()=>i});var c=t(67418),f=t(85111),d=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));function r(e){return d(this,arguments,(function*({nullifier:e,secret:a}){const t=new Uint8Array([...(0,c.EI)(e),...(0,c.EI)(a)]),d=(0,c.$W)((0,c.Ju)(t),62),r=BigInt(yield(0,f.UB)(t)),n=(0,c.$W)(r),i=BigInt(yield(0,f.UB)((0,c.EI)(e)));return{preimage:t,noteHex:d,commitment:r,commitmentHex:n,nullifierHash:i,nullifierHex:(0,c.$W)(i)}}))}class n{constructor({currency:e,amount:a,netId:t,nullifier:c,secret:f,note:d,noteHex:r,invoice:n,commitmentHex:i,nullifierHex:b}){this.currency=e,this.amount=a,this.netId=t,this.nullifier=c,this.secret=f,this.note=d,this.noteHex=r,this.invoice=n,this.commitmentHex=i,this.nullifierHex=b}toString(){return JSON.stringify({currency:this.currency,amount:this.amount,netId:this.netId,nullifier:this.nullifier,secret:this.secret,note:this.note,noteHex:this.noteHex,invoice:this.invoice,commitmentHex:this.commitmentHex,nullifierHex:this.nullifierHex},null,2)}static createNote(e){return d(this,arguments,(function*({currency:e,amount:a,netId:t,nullifier:f,secret:d}){f||(f=(0,c.ib)(31)),d||(d=(0,c.ib)(31));const i=yield r({nullifier:f,secret:d});return new n({currency:e.toLowerCase(),amount:a,netId:t,note:`tornado-${e.toLowerCase()}-${a}-${t}-${i.noteHex}`,noteHex:i.noteHex,invoice:`tornadoInvoice-${e.toLowerCase()}-${a}-${t}-${i.commitmentHex}`,nullifier:f,secret:d,commitmentHex:i.commitmentHex,nullifierHex:i.nullifierHex})}))}static parseNote(e){return d(this,null,(function*(){const a=new RegExp("tornado-(?\\w+)-(?[\\d.]+)-(?\\d+)-0x(?[0-9a-fA-F]{124})","g").exec(e);if(!a)throw new Error("The note has invalid format");const t=null==a?void 0:a.groups,f=t.currency.toLowerCase(),d=t.amount,i=Number(t.netId),b=(0,c.jm)("0x"+t.note),o=BigInt((0,c.ae)(b.slice(0,31)).toString()),s=BigInt((0,c.ae)(b.slice(31,62)).toString()),l=yield r({nullifier:o,secret:s}),u=`tornadoInvoice-${f}-${d}-${i}-${l.commitmentHex}`;return new n({currency:f,amount:d,netId:i,note:e,noteHex:l.noteHex,invoice:u,nullifier:o,secret:s,commitmentHex:l.commitmentHex,nullifierHex:l.nullifierHex})}))}}class i{constructor(e){const a=new RegExp("tornadoInvoice-(?\\w+)-(?[\\d.]+)-(?\\d+)-0x(?[0-9a-fA-F]{64})","g").exec(e);if(!a)throw new Error("The note has invalid format");const t=null==a?void 0:a.groups,c=t.currency.toLowerCase(),f=t.amount,d=Number(t.netId);this.currency=c,this.amount=f,this.netId=d,this.commitment="0x"+t.commitment,this.invoice=e}toString(){return JSON.stringify({currency:this.currency,amount:this.amount,netId:this.netId,commitment:this.commitment,invoice:this.invoice},null,2)}}},33298:(e,a,t)=>{"use strict";t.d(a,{Ad:()=>b,Fr:()=>n,ol:()=>i});var c=t(51594),f=t(20415),d=t(30031),r=t(67418);function n({nonce:e,ephemPublicKey:a,ciphertext:t}){const c=(0,r.$W)((0,r.My)((0,r.Kp)(e)),24),f=(0,r.$W)((0,r.My)((0,r.Kp)(a)),32),d=(0,r.My)((0,r.Kp)(t)),n=(0,r.Id)((0,r.aT)(c),(0,r.aT)(f),(0,r.aT)(d));return(0,r.My)(n)}function i(e){const a=(0,r.aT)(e),t=(0,r.if)(a.slice(0,24)),c=(0,r.if)(a.slice(24,56)),f=(0,r.if)(a.slice(56));return{messageBuff:(0,r.My)(a),version:"x25519-xsalsa20-poly1305",nonce:t,ephemPublicKey:c,ciphertext:f}}class b{constructor({netId:e,blockNumber:a,recoveryKey:t,Echoer:d}){t||(t=(0,r.My)(r.Et.getRandomValues(new Uint8Array(32))).slice(2)),this.netId=Math.floor(Number(e)),this.blockNumber=a,this.recoveryKey=t,this.recoveryAddress=(0,f.K)("0x"+t),this.recoveryPublicKey=(0,c.getEncryptionPublicKey)(t),this.Echoer=d}static getWalletPublicKey(e){let{privateKey:a}=e;return a.startsWith("0x")&&(a=a.replace("0x","")),(0,c.getEncryptionPublicKey)(a)}getEncryptedAccount(e){const a=(0,c.encrypt)({publicKey:e,data:this.recoveryKey,version:"x25519-xsalsa20-poly1305"});return{encryptedData:a,data:n(a)}}decryptAccountsWithWallet(e,a){let{privateKey:t}=e;t.startsWith("0x")&&(t=t.replace("0x",""));const f=[];for(const e of a)try{const a=i(e.encryptedAccount),d=(0,c.decrypt)({encryptedData:a,privateKey:t});f.push(new b({netId:this.netId,blockNumber:e.blockNumber,recoveryKey:d,Echoer:this.Echoer}))}catch(e){continue}return f}decryptNotes(e){const a=[];for(const t of e)try{const e=i(t.encryptedNote),[f,r]=(0,c.decrypt)({encryptedData:e,privateKey:this.recoveryKey}).split("-");a.push({blockNumber:t.blockNumber,address:(0,d.b)(f),noteHex:r})}catch(e){continue}return a}encryptNote({address:e,noteHex:a}){return n((0,c.encrypt)({publicKey:this.recoveryPublicKey,data:`${e}-${a}`,version:"x25519-xsalsa20-poly1305"}))}}},71304:(e,a,t)=>{"use strict";t.d(a,{EU:()=>S,GS:()=>M,JJ:()=>L,Lx:()=>_,O_:()=>B,cE:()=>k,e0:()=>C,oW:()=>I,uw:()=>E});var c=t(30031),f=t(64563),d=t(99770),r=t(52049),n=t(9723),i=t(68434),b=t(57194),o=Object.defineProperty,s=Object.defineProperties,l=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,h=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,m=Reflect.get,x=(e,a,t)=>a in e?o(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,y=(e,a)=>{for(var t in a||(a={}))p.call(a,t)&&x(e,t,a[t]);if(u)for(var t of u(a))g.call(a,t)&&x(e,t,a[t]);return e},A=(e,a)=>s(e,l(a)),v=(e,a,t)=>m(h(e),t,a),w=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));const _="deposit",I="withdrawal";class E{constructor({netId:e,provider:a,graphApi:t,subgraphName:c,contract:f,type:d="",deployedBlock:r=0,fetchDataOptions:i,tovarishClient:b}){this.netId=e,this.provider=a,this.graphApi=t,this.subgraphName=c,this.fetchDataOptions=i,this.contract=f,this.type=d,this.deployedBlock=r,this.batchEventsService=new n.JY({provider:a,contract:f,onProgress:this.updateEventProgress}),this.tovarishClient=b}getInstanceName(){return""}getType(){return this.type||""}getTovarishType(){return String(this.getType()||"").toLowerCase()}getGraphMethod(){return""}getGraphParams(){return{graphApi:this.graphApi||"",subgraphName:this.subgraphName||"",fetchDataOptions:this.fetchDataOptions,onProgress:this.updateGraphProgress}}updateEventProgress({percentage:e,type:a,fromBlock:t,toBlock:c,count:f}){}updateBlockProgress({percentage:e,currentIndex:a,totalIndex:t}){}updateTransactionProgress({percentage:e,currentIndex:a,totalIndex:t}){}updateGraphProgress({type:e,fromBlock:a,toBlock:t,count:c}){}formatEvents(e){return w(this,null,(function*(){return yield new Promise((a=>a(e)))}))}getEventsFromDB(){return w(this,null,(function*(){return{events:[],lastBlock:null}}))}getEventsFromCache(){return w(this,null,(function*(){return{events:[],lastBlock:null,fromCache:!0}}))}getSavedEvents(){return w(this,null,(function*(){let e=yield this.getEventsFromDB();return e&&e.events.length||(e=yield this.getEventsFromCache()),e}))}getEventsFromGraph(e){return w(this,arguments,(function*({fromBlock:e,methodName:a=""}){if(!this.graphApi||!this.subgraphName)return{events:[],lastBlock:e};const{events:t,lastSyncBlock:c}=yield r[a||this.getGraphMethod()](y({fromBlock:e},this.getGraphParams()));return{events:t,lastBlock:c}}))}getEventsFromRpc(e){return w(this,arguments,(function*({fromBlock:e,toBlock:a}){try{return a||(a=yield this.provider.getBlockNumber()),e>=a?{events:[],lastBlock:a}:(this.updateEventProgress({percentage:0,type:this.getType()}),{events:yield this.formatEvents(yield this.batchEventsService.getBatchEvents({fromBlock:e,toBlock:a,type:this.getType()})),lastBlock:a})}catch(a){return console.log(a),{events:[],lastBlock:e}}}))}getLatestEvents(e){return w(this,arguments,(function*({fromBlock:e}){var a;if((null==(a=this.tovarishClient)?void 0:a.selectedRelayer)&&![_,I].includes(this.type.toLowerCase())){const{events:a,lastSyncBlock:t}=yield this.tovarishClient.getEvents({type:this.getTovarishType(),fromBlock:e});return{events:a,lastBlock:t}}const t=yield this.getEventsFromGraph({fromBlock:e}),c=t.lastBlock&&t.lastBlock>=e?t.lastBlock:e,f=yield this.getEventsFromRpc({fromBlock:c});return{events:[...t.events,...f.events],lastBlock:f.lastBlock}}))}validateEvents({events:e,lastBlock:a}){}saveEvents(e){return w(this,arguments,(function*({events:e,lastBlock:a}){}))}updateEvents(){return w(this,null,(function*(){var e;const a=yield this.getSavedEvents();let t=this.deployedBlock;a&&a.lastBlock&&(t=a.lastBlock+1);const c=yield this.getLatestEvents({fromBlock:t}),f=new Set,d=[...a.events,...c.events].sort(((e,a)=>e.blockNumber===a.blockNumber?e.logIndex-a.logIndex:e.blockNumber-a.blockNumber)).filter((({transactionHash:e,logIndex:a})=>{const t=`${e}_${a}`,c=f.has(t);return f.add(t),!c})),r=c.lastBlock||(null==(e=d[d.length-1])?void 0:e.blockNumber);return this.validateEvents({events:d,lastBlock:r}),(a.fromCache||c.events.length)&&(yield this.saveEvents({events:d,lastBlock:r})),{events:d,lastBlock:r}}))}}class C extends E{constructor({netId:e,provider:a,graphApi:t,subgraphName:c,Tornado:f,type:d,amount:r,currency:i,deployedBlock:b,fetchDataOptions:o,tovarishClient:s}){super({netId:e,provider:a,graphApi:t,subgraphName:c,contract:f,type:d,deployedBlock:b,fetchDataOptions:o,tovarishClient:s}),this.amount=r,this.currency=i,this.batchTransactionService=new n.AF({provider:a,onProgress:this.updateTransactionProgress}),this.batchBlockService=new n.B3({provider:a,onProgress:this.updateBlockProgress})}getInstanceName(){return`${this.getType().toLowerCase()}s_${this.netId}_${this.currency}_${this.amount}`}getGraphMethod(){return`getAll${this.getType()}s`}getGraphParams(){return{graphApi:this.graphApi||"",subgraphName:this.subgraphName||"",amount:this.amount,currency:this.currency,fetchDataOptions:this.fetchDataOptions,onProgress:this.updateGraphProgress}}formatEvents(e){return w(this,null,(function*(){if(this.getType().toLowerCase()===_){const a=e.map((({blockNumber:e,index:a,transactionHash:t,args:c})=>{const{commitment:f,leafIndex:d,timestamp:r}=c;return{blockNumber:e,logIndex:a,transactionHash:t,commitment:f,leafIndex:Number(d),timestamp:Number(r)}})),t=yield this.batchTransactionService.getBatchTransactions([...new Set(a.map((({transactionHash:e})=>e)))]);return a.map((e=>{const{from:a}=t.find((({hash:a})=>a===e.transactionHash));return A(y({},e),{from:a})}))}{const a=e.map((({blockNumber:e,index:a,transactionHash:t,args:f})=>{const{nullifierHash:d,to:r,fee:n}=f;return{blockNumber:e,logIndex:a,transactionHash:t,nullifierHash:String(d),to:(0,c.b)(r),fee:String(n)}})),t=yield this.batchBlockService.getBatchBlocks([...new Set(a.map((({blockNumber:e})=>e)))]);return a.map((e=>{const{timestamp:a}=t.find((({number:a})=>a===e.blockNumber));return A(y({},e),{timestamp:a})}))}}))}validateEvents({events:e}){if(e.length&&this.getType().toLowerCase()===_){const a=e[e.length-1];if(a.leafIndex!==e.length-1){const t=`Deposit events invalid wants ${e.length-1} leafIndex have ${a.leafIndex}`;throw new Error(t)}}}getLatestEvents(e){return w(this,arguments,(function*({fromBlock:e}){var a;if(null==(a=this.tovarishClient)?void 0:a.selectedRelayer){const{events:a,lastSyncBlock:t}=yield this.tovarishClient.getEvents({type:this.getTovarishType(),currency:this.currency,amount:this.amount,fromBlock:e});return{events:a,lastBlock:t}}return v(C.prototype,this,"getLatestEvents").call(this,{fromBlock:e})}))}}class M extends E{constructor({netId:e,provider:a,graphApi:t,subgraphName:c,Echoer:f,deployedBlock:d,fetchDataOptions:r,tovarishClient:n}){super({netId:e,provider:a,graphApi:t,subgraphName:c,contract:f,deployedBlock:d,fetchDataOptions:r,tovarishClient:n})}getInstanceName(){return`echo_${this.netId}`}getType(){return"Echo"}getGraphMethod(){return"getAllGraphEchoEvents"}formatEvents(e){return w(this,null,(function*(){return e.map((({blockNumber:e,index:a,transactionHash:t,args:c})=>{const{who:f,data:d}=c;if(f&&d)return A(y({},{blockNumber:e,logIndex:a,transactionHash:t}),{address:f,encryptedAccount:d})})).filter((e=>e))}))}getEventsFromGraph(e){return w(this,arguments,(function*({fromBlock:e}){return!this.graphApi||this.graphApi.includes("api.thegraph.com")?{events:[],lastBlock:e}:v(M.prototype,this,"getEventsFromGraph").call(this,{fromBlock:e})}))}}class B extends E{constructor({netId:e,provider:a,graphApi:t,subgraphName:c,Router:f,deployedBlock:d,fetchDataOptions:r,tovarishClient:n}){super({netId:e,provider:a,graphApi:t,subgraphName:c,contract:f,deployedBlock:d,fetchDataOptions:r,tovarishClient:n})}getInstanceName(){return`encrypted_notes_${this.netId}`}getType(){return"EncryptedNote"}getTovarishType(){return"encrypted_notes"}getGraphMethod(){return"getAllEncryptedNotes"}formatEvents(e){return w(this,null,(function*(){return e.map((({blockNumber:e,index:a,transactionHash:t,args:c})=>{const{encryptedNote:f}=c;if(f&&"0x"!==f)return A(y({},{blockNumber:e,logIndex:a,transactionHash:t}),{encryptedNote:f})})).filter((e=>e))}))}}class L extends E{constructor({netId:e,provider:a,graphApi:t,subgraphName:c,Governance:f,deployedBlock:d,fetchDataOptions:r,tovarishClient:i}){super({netId:e,provider:a,graphApi:t,subgraphName:c,contract:f,deployedBlock:d,fetchDataOptions:r,tovarishClient:i}),this.batchTransactionService=new n.AF({provider:a,onProgress:this.updateTransactionProgress})}getInstanceName(){return`governance_${this.netId}`}getType(){return"*"}getTovarishType(){return"governance"}getGraphMethod(){return"getAllGovernanceEvents"}formatEvents(e){return w(this,null,(function*(){const a=[],t=[],c=[],f=[];if(e.forEach((({blockNumber:e,index:d,transactionHash:r,args:n,eventName:i})=>{const b={blockNumber:e,logIndex:d,transactionHash:r,event:i};if("ProposalCreated"===i){const{id:e,proposer:t,target:c,startTime:f,endTime:d,description:r}=n;a.push(A(y({},b),{id:Number(e),proposer:t,target:c,startTime:Number(f),endTime:Number(d),description:r}))}if("Voted"===i){const{proposalId:e,voter:a,support:c,votes:f}=n;t.push(A(y({},b),{proposalId:Number(e),voter:a,support:c,votes:f,from:"",input:""}))}if("Delegated"===i){const{account:e,to:a}=n;c.push(A(y({},b),{account:e,delegateTo:a}))}if("Undelegated"===i){const{account:e,from:a}=n;f.push(A(y({},b),{account:e,delegateFrom:a}))}})),t.length){this.updateTransactionProgress({percentage:0});const e=yield this.batchTransactionService.getBatchTransactions([...new Set(t.map((({transactionHash:e})=>e)))]);t.forEach(((a,c)=>{let{data:f,from:d}=e.find((e=>e.hash===a.transactionHash));(!f||f.length>2048)&&(f=""),t[c].from=d,t[c].input=f}))}return[...a,...t,...c,...f]}))}getEventsFromGraph(e){return w(this,arguments,(function*({fromBlock:e}){return this.graphApi&&this.subgraphName&&!this.graphApi.includes("api.thegraph.com")?v(L.prototype,this,"getEventsFromGraph").call(this,{fromBlock:e}):{events:[],lastBlock:e}}))}}function S(e,a){return w(this,null,(function*(){yield Promise.all(a.filter((e=>e.tovarishHost)).map((a=>w(this,null,(function*(){var t,c;try{a.tovarishNetworks=yield(0,i.Fd)(a.tovarishHost,A(y({},e.fetchDataOptions),{headers:{"Content-Type":"application/json"},timeout:(null==(t=e.fetchDataOptions)?void 0:t.torPort)?1e4:3e3,maxRetry:(null==(c=e.fetchDataOptions)?void 0:c.torPort)?2:0}))}catch(e){a.tovarishNetworks=[]}})))))}))}class k extends E{constructor({netId:e,provider:a,graphApi:t,subgraphName:c,RelayerRegistry:f,Aggregator:d,relayerEnsSubdomains:r,deployedBlock:n,fetchDataOptions:i,tovarishClient:b}){super({netId:e,provider:a,graphApi:t,subgraphName:c,contract:f,deployedBlock:n,fetchDataOptions:i,tovarishClient:b}),this.Aggregator=d,this.relayerEnsSubdomains=r,this.updateInterval=86400}getInstanceName(){return`registered_${this.netId}`}getType(){return"RelayerRegistered"}getTovarishType(){return"registered"}getGraphMethod(){return"getAllRegisters"}formatEvents(e){return w(this,null,(function*(){return e.map((({blockNumber:e,index:a,transactionHash:t,args:c})=>A(y({},{blockNumber:e,logIndex:a,transactionHash:t}),{ensName:c.ensName,relayerAddress:c.relayerAddress})))}))}getRelayersFromDB(){return w(this,null,(function*(){return{lastBlock:0,timestamp:0,relayers:[]}}))}getRelayersFromCache(){return w(this,null,(function*(){return{lastBlock:0,timestamp:0,relayers:[],fromCache:!0}}))}getSavedRelayers(){return w(this,null,(function*(){let e=yield this.getRelayersFromDB();return e&&e.relayers.length||(e=yield this.getRelayersFromCache()),e}))}getLatestRelayers(){return w(this,null,(function*(){const{events:e,lastBlock:a}=yield this.updateEvents(),t=Object.values(this.relayerEnsSubdomains),c=new Set,r=e.filter((({ensName:e})=>!c.has(e)&&(c.add(e),!0))),n=r.map((e=>(0,f.kM)(e.ensName))),[i,o]=yield Promise.all([this.Aggregator.relayersData.staticCall(n,t.concat("tovarish-relayer")),this.provider.getBlock(a).then((e=>Number(null==e?void 0:e.timestamp)))]),s=i.map((({owner:e,balance:a,records:t,isRegistered:c},f)=>{const{ensName:n,relayerAddress:i}=r[f];let o;const s=t.reduce(((e,a,c)=>{if(a){if(c===t.length-1)return o=a,e;e[Number(Object.keys(this.relayerEnsSubdomains)[c])]=a}return e}),{}),l=!i||i===e,u=a>=b.pO;if(Object.keys(s).length&&l&&c&&u)return{ensName:n,relayerAddress:i,isRegistered:c,owner:e,stakeBalance:(0,d.ck)(a),hostnames:s,tovarishHost:o}})).filter((e=>e));return yield S(this,s),{lastBlock:a,timestamp:o,relayers:s}}))}saveRelayers(e){return w(this,arguments,(function*({lastBlock:e,timestamp:a,relayers:t}){}))}updateRelayers(){return w(this,null,(function*(){let{lastBlock:e,timestamp:a,relayers:t,fromCache:c}=yield this.getSavedRelayers(),f=null!=c&&c;return(!t.length||a+this.updateInterval{"use strict";t.r(a),t.d(a,{BaseEchoService:()=>d.GS,BaseEncryptedNotesService:()=>d.O_,BaseEventsService:()=>d.uw,BaseGovernanceService:()=>d.JJ,BaseRegistryService:()=>d.cE,BaseTornadoService:()=>d.e0,DEPOSIT:()=>d.Lx,WITHDRAWAL:()=>d.oW,getTovarishNetworks:()=>d.EU});var c=t(61060),f={};for(const e in c)"default"!==e&&(f[e]=()=>c[e]);t.d(a,f);var d=t(71304)},61060:()=>{},37182:(e,a,t)=>{"use strict";t.d(a,{N:()=>d,o:()=>r});var c=t(99770),f=t(79453);function d(e,a,t=18){const c=BigInt(10**Number(t));return BigInt(e)*c/BigInt(a)}class r{constructor(e){e&&(this.ovmGasPriceOracle=e)}fetchL1OptimismFee(e){return this.ovmGasPriceOracle?(e||(e={type:0,gasLimit:1e6,nonce:1024,data:"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",gasPrice:(0,c.XS)("1","gwei"),to:"0x1111111111111111111111111111111111111111"}),this.ovmGasPriceOracle.getL1Fee.staticCall(f.Z.from(e).unsignedSerialized)):new Promise((e=>e(BigInt(0))))}defaultEthRefund(e,a){return(e?BigInt(e):(0,c.XS)("30","gwei"))*BigInt(a||1e6)}calculateTokenAmount(e,a,t){return d(e,a,t)}calculateRelayerFee({gasPrice:e,gasLimit:a=6e5,l1Fee:t=0,denomination:c,ethRefund:f=BigInt(0),tokenPriceInWei:r,tokenDecimals:n=18,relayerFeePercent:i=.33,isEth:b=!0,premiumPercent:o=20}){const s=BigInt(e)*BigInt(a)+BigInt(t),l=BigInt(c)*BigInt(Math.floor(1e4*i))/BigInt(1e6);return b?(s+l)*BigInt(o?100+o:100)/BigInt(100):(d(s+BigInt(f),r,n)+l)*BigInt(o?100+o:100)/BigInt(100)}}},52049:(e,a,t)=>{"use strict";t.r(a),t.d(a,{GET_DEPOSITS:()=>i,GET_ECHO_EVENTS:()=>s,GET_ENCRYPTED_NOTES:()=>l,GET_GOVERNANCE_APY:()=>h,GET_GOVERNANCE_EVENTS:()=>u,GET_NOTE_ACCOUNTS:()=>o,GET_REGISTERED:()=>n,GET_STATISTIC:()=>d,GET_WITHDRAWALS:()=>b,_META:()=>r,getAllDeposits:()=>P,getAllEncryptedNotes:()=>U,getAllGovernanceEvents:()=>H,getAllGraphEchoEvents:()=>F,getAllRegisters:()=>k,getAllWithdrawals:()=>O,getDeposits:()=>N,getEncryptedNotes:()=>Q,getGovernanceEvents:()=>j,getGraphEchoEvents:()=>T,getMeta:()=>L,getNoteAccounts:()=>D,getRegisters:()=>S,getStatistic:()=>B,getWithdrawals:()=>R,queryGraph:()=>M});var c=t(30031),f=t(68434);const d="\n query getStatistic($currency: String!, $amount: String!, $first: Int, $orderBy: BigInt, $orderDirection: String) {\n deposits(first: $first, orderBy: $orderBy, orderDirection: $orderDirection, where: { currency: $currency, amount: $amount }) {\n index\n timestamp\n blockNumber\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",r="\n query getMeta {\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",n="\n query getRegistered($first: Int, $fromBlock: Int) {\n relayers(first: $first, orderBy: blockRegistration, orderDirection: asc, where: {\n blockRegistration_gte: $fromBlock\n }) {\n id\n address\n ensName\n blockRegistration\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",i="\n query getDeposits($currency: String!, $amount: String!, $first: Int, $fromBlock: Int) {\n deposits(first: $first, orderBy: index, orderDirection: asc, where: { \n amount: $amount,\n currency: $currency,\n blockNumber_gte: $fromBlock\n }) {\n id\n blockNumber\n commitment\n index\n timestamp\n from\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",b="\n query getWithdrawals($currency: String!, $amount: String!, $first: Int, $fromBlock: Int!) {\n withdrawals(first: $first, orderBy: blockNumber, orderDirection: asc, where: { \n currency: $currency,\n amount: $amount,\n blockNumber_gte: $fromBlock\n }) {\n id\n blockNumber\n nullifier\n to\n fee\n timestamp\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",o="\n query getNoteAccount($address: String!) {\n noteAccounts(where: { address: $address }) {\n id\n index\n address\n encryptedAccount\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",s="\n query getNoteAccounts($first: Int, $fromBlock: Int) {\n noteAccounts(first: $first, orderBy: blockNumber, orderDirection: asc, where: { blockNumber_gte: $fromBlock }) {\n id\n blockNumber\n address\n encryptedAccount\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",l="\n query getEncryptedNotes($first: Int, $fromBlock: Int) {\n encryptedNotes(first: $first, orderBy: blockNumber, orderDirection: asc, where: { blockNumber_gte: $fromBlock }) {\n blockNumber\n index\n transactionHash\n encryptedNote\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",u="\n query getGovernanceEvents($first: Int, $fromBlock: Int) {\n proposals(first: $first, orderBy: blockNumber, orderDirection: asc, where: { blockNumber_gte: $fromBlock }) {\n blockNumber\n logIndex\n transactionHash\n proposalId\n proposer\n target\n startTime\n endTime\n description\n }\n votes(first: $first, orderBy: blockNumber, orderDirection: asc, where: { blockNumber_gte: $fromBlock }) {\n blockNumber\n logIndex\n transactionHash\n proposalId\n voter\n support\n votes\n from\n input\n }\n delegates(first: $first, orderBy: blockNumber, orderDirection: asc, where: { blockNumber_gte: $fromBlock }) {\n blockNumber\n logIndex\n transactionHash\n account\n delegateTo\n }\n undelegates(first: $first, orderBy: blockNumber, orderDirection: asc, where: { blockNumber_gte: $fromBlock }) {\n blockNumber\n logIndex\n transactionHash\n account\n delegateFrom\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",h="\n stakeDailyBurns(first: 30, orderBy: date, orderDirection: desc) {\n id\n date\n dailyAmountBurned\n }\n";var p=Object.defineProperty,g=Object.defineProperties,m=Object.getOwnPropertyDescriptors,x=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,v=(e,a,t)=>a in e?p(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,w=(e,a)=>{for(var t in a||(a={}))y.call(a,t)&&v(e,t,a[t]);if(x)for(var t of x(a))A.call(a,t)&&v(e,t,a[t]);return e},_=(e,a)=>g(e,m(a)),I=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));const E=e=>!Array.isArray(e)||!e.length,C=1e3;function M(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,query:t,variables:c,fetchDataOptions:d}){var r;const n=`${e}/subgraphs/name/${a}`,{data:i,errors:b}=yield(0,f.Fd)(n,_(w({},d),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:t,variables:c})}));if(b)throw new Error(JSON.stringify(b));if(null==(r=null==i?void 0:i._meta)?void 0:r.hasIndexingErrors)throw new Error("Subgraph has indexing errors");return i}))}function B(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,currency:t,amount:c,fetchDataOptions:f}){try{const{deposits:r,_meta:{block:{number:n}}}=yield M({graphApi:e,subgraphName:a,query:d,variables:{currency:t,first:10,orderBy:"index",orderDirection:"desc",amount:c},fetchDataOptions:f}),i=r.map((e=>({timestamp:Number(e.timestamp),leafIndex:Number(e.index),blockNumber:Number(e.blockNumber)}))).reverse(),[b]=i.slice(-1);return{events:i,lastSyncBlock:b&&b.blockNumber>=n?b.blockNumber+1:n}}catch(e){return console.log("Error from getStatistic query"),console.log(e),{events:[],lastSyncBlock:null}}}))}function L(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,fetchDataOptions:t}){try{const{_meta:{block:{number:c},hasIndexingErrors:f}}=yield M({graphApi:e,subgraphName:a,query:r,fetchDataOptions:t});return{lastSyncBlock:c,hasIndexingErrors:f}}catch(e){return console.log("Error from getMeta query"),console.log(e),{lastSyncBlock:null,hasIndexingErrors:null}}}))}function S({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:c}){return M({graphApi:e,subgraphName:a,query:n,variables:{first:C,fromBlock:t},fetchDataOptions:c})}function k(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:f,onProgress:d}){try{const r=[];let n=t;for(;;){let{relayers:c,_meta:{block:{number:i}}}=yield S({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:f});if(n=i,E(c))break;const[b]=c,[o]=c.slice(-1);if("function"==typeof d&&d({type:"Registers",fromBlock:Number(b.blockRegistration),toBlock:Number(o.blockRegistration),count:c.length}),c.length<900){r.push(...c);break}c=c.filter((({blockRegistration:e})=>e!==o.blockRegistration)),t=Number(o.blockRegistration),r.push(...c)}return r.length?{events:r.map((({id:e,address:a,ensName:t,blockRegistration:f})=>{const[d,r]=e.split("-");return{blockNumber:Number(f),logIndex:Number(r),transactionHash:d,ensName:t,relayerAddress:(0,c.b)(a)}})),lastSyncBlock:n}:{events:[],lastSyncBlock:n}}catch(e){return console.log("Error from getAllRegisters query"),console.log(e),{events:[],lastSyncBlock:t}}}))}function N({graphApi:e,subgraphName:a,currency:t,amount:c,fromBlock:f,fetchDataOptions:d}){return M({graphApi:e,subgraphName:a,query:i,variables:{currency:t,amount:c,first:C,fromBlock:f},fetchDataOptions:d})}function P(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,currency:t,amount:f,fromBlock:d,fetchDataOptions:r,onProgress:n}){try{const i=[];let b=d;for(;;){let{deposits:c,_meta:{block:{number:o}}}=yield N({graphApi:e,subgraphName:a,currency:t,amount:f,fromBlock:d,fetchDataOptions:r});if(b=o,E(c))break;const[s]=c,[l]=c.slice(-1);if("function"==typeof n&&n({type:"Deposits",fromBlock:Number(s.blockNumber),toBlock:Number(l.blockNumber),count:c.length}),c.length<900){i.push(...c);break}c=c.filter((({blockNumber:e})=>e!==l.blockNumber)),d=Number(l.blockNumber),i.push(...c)}if(!i.length)return{events:[],lastSyncBlock:b};const o=i.map((({id:e,blockNumber:a,commitment:t,index:f,timestamp:d,from:r})=>{const[n,i]=e.split("-");return{blockNumber:Number(a),logIndex:Number(i),transactionHash:n,commitment:t,leafIndex:Number(f),timestamp:Number(d),from:(0,c.b)(r)}})),[s]=o.slice(-1);return{events:o,lastSyncBlock:s&&s.blockNumber>=b?s.blockNumber+1:b}}catch(e){return console.log("Error from getAllDeposits query"),console.log(e),{events:[],lastSyncBlock:d}}}))}function R({graphApi:e,subgraphName:a,currency:t,amount:c,fromBlock:f,fetchDataOptions:d}){return M({graphApi:e,subgraphName:a,query:b,variables:{currency:t,amount:c,first:C,fromBlock:f},fetchDataOptions:d})}function O(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,currency:t,amount:f,fromBlock:d,fetchDataOptions:r,onProgress:n}){try{const i=[];let b=d;for(;;){let{withdrawals:c,_meta:{block:{number:o}}}=yield R({graphApi:e,subgraphName:a,currency:t,amount:f,fromBlock:d,fetchDataOptions:r});if(b=o,E(c))break;const[s]=c,[l]=c.slice(-1);if("function"==typeof n&&n({type:"Withdrawals",fromBlock:Number(s.blockNumber),toBlock:Number(l.blockNumber),count:c.length}),c.length<900){i.push(...c);break}c=c.filter((({blockNumber:e})=>e!==l.blockNumber)),d=Number(l.blockNumber),i.push(...c)}if(!i.length)return{events:[],lastSyncBlock:b};const o=i.map((({id:e,blockNumber:a,nullifier:t,to:f,fee:d,timestamp:r})=>{const[n,i]=e.split("-");return{blockNumber:Number(a),logIndex:Number(i),transactionHash:n,nullifierHash:t,to:(0,c.b)(f),fee:d,timestamp:Number(r)}})),[s]=o.slice(-1);return{events:o,lastSyncBlock:s&&s.blockNumber>=b?s.blockNumber+1:b}}catch(e){return console.log("Error from getAllWithdrawals query"),console.log(e),{events:[],lastSyncBlock:d}}}))}function D(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,address:t,fetchDataOptions:c}){try{const{noteAccounts:f,_meta:{block:{number:d}}}=yield M({graphApi:e,subgraphName:a,query:o,variables:{address:t.toLowerCase()},fetchDataOptions:c});return{events:f,lastSyncBlock:d}}catch(e){return console.log("Error from getNoteAccounts query"),console.log(e),{events:[],lastSyncBlock:null}}}))}function T({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:c}){return M({graphApi:e,subgraphName:a,query:s,variables:{first:C,fromBlock:t},fetchDataOptions:c})}function F(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:f,onProgress:d}){try{const r=[];let n=t;for(;;){let{noteAccounts:c,_meta:{block:{number:i}}}=yield T({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:f});if(n=i,E(c))break;const[b]=c,[o]=c.slice(-1);if("function"==typeof d&&d({type:"EchoEvents",fromBlock:Number(b.blockNumber),toBlock:Number(o.blockNumber),count:c.length}),c.length<900){r.push(...c);break}c=c.filter((({blockNumber:e})=>e!==o.blockNumber)),t=Number(o.blockNumber),r.push(...c)}if(!r.length)return{events:[],lastSyncBlock:n};const i=r.map((e=>{const[a,t]=e.id.split("-");return{blockNumber:Number(e.blockNumber),logIndex:Number(t),transactionHash:a,address:(0,c.b)(e.address),encryptedAccount:e.encryptedAccount}})),[b]=i.slice(-1);return{events:i,lastSyncBlock:b&&b.blockNumber>=n?b.blockNumber+1:n}}catch(e){return console.log("Error from getAllGraphEchoEvents query"),console.log(e),{events:[],lastSyncBlock:t}}}))}function Q({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:c}){return M({graphApi:e,subgraphName:a,query:l,variables:{first:C,fromBlock:t},fetchDataOptions:c})}function U(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:c,onProgress:f}){try{const d=[];let r=t;for(;;){let{encryptedNotes:n,_meta:{block:{number:i}}}=yield Q({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:c});if(r=i,E(n))break;const[b]=n,[o]=n.slice(-1);if("function"==typeof f&&f({type:"EncryptedNotes",fromBlock:Number(b.blockNumber),toBlock:Number(o.blockNumber),count:n.length}),n.length<900){d.push(...n);break}n=n.filter((({blockNumber:e})=>e!==o.blockNumber)),t=Number(o.blockNumber),d.push(...n)}if(!d.length)return{events:[],lastSyncBlock:r};const n=d.map((e=>({blockNumber:Number(e.blockNumber),logIndex:Number(e.index),transactionHash:e.transactionHash,encryptedNote:e.encryptedNote}))),[i]=n.slice(-1);return{events:n,lastSyncBlock:i&&i.blockNumber>=r?i.blockNumber+1:r}}catch(e){return console.log("Error from getAllEncryptedNotes query"),console.log(e),{events:[],lastSyncBlock:t}}}))}function j({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:c}){return M({graphApi:e,subgraphName:a,query:u,variables:{first:C,fromBlock:t},fetchDataOptions:c})}function H(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:f,onProgress:d}){try{const r=[];let n=t;for(;;){const{proposals:i,votes:b,delegates:o,undelegates:s,_meta:{block:{number:l}}}=yield j({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:f});n=l;const u=i.length+b.length+o.length+s.length;if(0===u)break;const h=i.map((({blockNumber:e,logIndex:a,transactionHash:t,proposalId:f,proposer:d,target:r,startTime:n,endTime:i,description:b})=>({blockNumber:Number(e),logIndex:Number(a),transactionHash:t,event:"ProposalCreated",id:Number(f),proposer:(0,c.b)(d),target:(0,c.b)(r),startTime:Number(n),endTime:Number(i),description:b}))),p=b.map((({blockNumber:e,logIndex:a,transactionHash:t,proposalId:f,voter:d,support:r,votes:n,from:i,input:b})=>((!b||b.length>2048)&&(b=""),{blockNumber:Number(e),logIndex:Number(a),transactionHash:t,event:"Voted",proposalId:Number(f),voter:(0,c.b)(d),support:r,votes:n,from:(0,c.b)(i),input:b}))),g=o.map((({blockNumber:e,logIndex:a,transactionHash:t,account:f,delegateTo:d})=>({blockNumber:Number(e),logIndex:Number(a),transactionHash:t,event:"Delegated",account:(0,c.b)(f),delegateTo:(0,c.b)(d)}))),m=s.map((({blockNumber:e,logIndex:a,transactionHash:t,account:f,delegateFrom:d})=>({blockNumber:Number(e),logIndex:Number(a),transactionHash:t,event:"Undelegated",account:(0,c.b)(f),delegateFrom:(0,c.b)(d)})));let x=[...h,...p,...g,...m].sort(((e,a)=>e.blockNumber===a.blockNumber?e.logIndex-a.logIndex:e.blockNumber-a.blockNumber));if(u<900){r.push(...x);break}const[y]=x,[A]=x.slice(-1);"function"==typeof d&&d({type:"Governance Events",fromBlock:Number(y.blockNumber),toBlock:Number(A.blockNumber),count:u}),x=x.filter((({blockNumber:e})=>e!==A.blockNumber)),t=Number(A.blockNumber),r.push(...x)}const[i]=r.slice(-1);return{events:r,lastSyncBlock:i&&i.blockNumber>=n?i.blockNumber+1:n}}catch(e){return console.log("Error from getAllGovernance query"),console.log(e),{events:[],lastSyncBlock:t}}}))}},5217:(e,a,t)=>{"use strict";t.d(a,{s:()=>i});var c=t(47882),f=t(41217),d=t(67418),r=t(22901),n=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));class i{constructor({netId:e,amount:a,currency:t,Tornado:c,commitmentHex:f,merkleTreeHeight:d=20,emptyElement:r="21663839004416932945382355908790599225266501822907911457504978515578255421292",merkleWorkerPath:n}){const i=`${e}_${t}_${a}`;this.currency=t,this.amount=a,this.netId=Number(e),this.Tornado=c,this.instanceName=i,this.commitmentHex=f,this.merkleTreeHeight=d,this.emptyElement=r,this.merkleWorkerPath=n}createTree(e){return n(this,null,(function*(){const{hash:a}=yield r.f.getHash();if(this.merkleWorkerPath){console.log("Using merkleWorker\n");try{if(d.Ll){const t=new Promise(((a,t)=>{const f=new c.Worker(this.merkleWorkerPath,{workerData:{merkleTreeHeight:this.merkleTreeHeight,elements:e,zeroElement:this.emptyElement}});f.on("message",a),f.on("error",t),f.on("exit",(e=>{0!==e&&t(new Error(`Worker stopped with exit code ${e}`))}))}));return f.MerkleTree.deserialize(JSON.parse(yield t),a)}{const t=new Promise(((a,t)=>{const c=new Worker(this.merkleWorkerPath);c.onmessage=e=>{a(e.data)},c.onerror=e=>{t(e)},c.postMessage({merkleTreeHeight:this.merkleTreeHeight,elements:e,zeroElement:this.emptyElement})}));return f.MerkleTree.deserialize(JSON.parse(yield t),a)}}catch(e){console.log("merkleWorker failed, falling back to synchronous merkle tree"),console.log(e)}}return new f.MerkleTree(this.merkleTreeHeight,e,{zeroElement:this.emptyElement,hashFunction:a})}))}createPartialTree(e){return n(this,arguments,(function*({edge:e,elements:a}){const{hash:t}=yield r.f.getHash();if(this.merkleWorkerPath){console.log("Using merkleWorker\n");try{if(d.Ll){const d=new Promise(((t,f)=>{const d=new c.Worker(this.merkleWorkerPath,{workerData:{merkleTreeHeight:this.merkleTreeHeight,edge:e,elements:a,zeroElement:this.emptyElement}});d.on("message",t),d.on("error",f),d.on("exit",(e=>{0!==e&&f(new Error(`Worker stopped with exit code ${e}`))}))}));return f.PartialMerkleTree.deserialize(JSON.parse(yield d),t)}{const c=new Promise(((t,c)=>{const f=new Worker(this.merkleWorkerPath);f.onmessage=e=>{t(e.data)},f.onerror=e=>{c(e)},f.postMessage({merkleTreeHeight:this.merkleTreeHeight,edge:e,elements:a,zeroElement:this.emptyElement})}));return f.PartialMerkleTree.deserialize(JSON.parse(yield c),t)}}catch(e){console.log("merkleWorker failed, falling back to synchronous merkle tree"),console.log(e)}}return new f.PartialMerkleTree(this.merkleTreeHeight,e,a,{zeroElement:this.emptyElement,hashFunction:t})}))}verifyTree(e){return n(this,null,(function*(){console.log(`\nCreating deposit tree for ${this.netId} ${this.amount} ${this.currency.toUpperCase()} would take a while\n`),console.time("Created tree in");const a=yield this.createTree(e.map((({commitment:e})=>e)));if(console.timeEnd("Created tree in"),console.log(""),!(yield this.Tornado.isKnownRoot((0,d.$W)(BigInt(a.root))))){const e=`Deposit Event ${this.netId} ${this.amount} ${this.currency} is invalid`;throw new Error(e)}return a}))}}},22901:(e,a,t)=>{"use strict";t.d(a,{f:()=>r,p:()=>d});var c=t(90294),f=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));class d{constructor(){this.mimcPromise=this.initMimc()}initMimc(){return f(this,null,(function*(){this.sponge=yield(0,c.HI)(),this.hash=(e,a)=>{var t,c;return null==(c=this.sponge)?void 0:c.F.toString(null==(t=this.sponge)?void 0:t.multiHash([BigInt(e),BigInt(a)]))}}))}getHash(){return f(this,null,(function*(){return yield this.mimcPromise,{sponge:this.sponge,hash:this.hash}}))}}const r=new d},48486:(e,a,t)=>{"use strict";t.d(a,{C:()=>f});var c=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));function f(e,a){return c(this,null,(function*(){const t=a.map((e=>{var a,t,c;return{target:(null==(a=e.contract)?void 0:a.target)||e.address,callData:((null==(t=e.contract)?void 0:t.interface)||e.interface).encodeFunctionData(e.name,e.params),allowFailure:null!=(c=e.allowFailure)&&c}}));return(yield e.aggregate3.staticCall(t)).map(((e,t)=>{var c;const f=(null==(c=a[t].contract)?void 0:c.interface)||a[t].interface,[d,r]=e,n=d&&r&&"0x"!==r?f.decodeFunctionResult(a[t].name,r):null;return n?1===n.length?n[0]:n:null}))}))}},59499:(e,a,t)=>{"use strict";t.d(a,{AE:()=>u,Af:()=>s,RY:()=>h,Zh:()=>x,cX:()=>l,h9:()=>g,o2:()=>y,oY:()=>m,sb:()=>o,zj:()=>p,zr:()=>b});var c=Object.defineProperty,f=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(e,a,t)=>a in e?c(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,i=(e,a)=>{for(var t in a||(a={}))d.call(a,t)&&n(e,t,a[t]);if(f)for(var t of f(a))r.call(a,t)&&n(e,t,a[t]);return e},b=(e=>(e[e.MAINNET=1]="MAINNET",e[e.BSC=56]="BSC",e[e.POLYGON=137]="POLYGON",e[e.OPTIMISM=10]="OPTIMISM",e[e.ARBITRUM=42161]="ARBITRUM",e[e.GNOSIS=100]="GNOSIS",e[e.AVALANCHE=43114]="AVALANCHE",e[e.SEPOLIA=11155111]="SEPOLIA",e))(b||{});const o={1:{rpcCallRetryAttempt:15,gasPrices:{instant:80,fast:50,standard:25,low:8},nativeCurrency:"eth",currencyName:"ETH",explorerUrl:"https://etherscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Ethereum Mainnet",deployedBlock:9116966,rpcUrls:{mevblockerRPC:{name:"MevblockerRPC",url:"https://rpc.mevblocker.io"},keydonix:{name:"keydonix",url:"https://ethereum.keydonix.com/v1/mainnet"},SecureRpc:{name:"SecureRpc",url:"https://api.securerpc.com/v1"},meowrpc:{name:"Meow RPC",url:"https://eth.meowrpc.com"},stackup:{name:"Stackup RPC",url:"https://public.stackup.sh/api/v1/node/ethereum-mainnet"},oneRPC:{name:"1RPC",url:"https://1rpc.io/eth"}},multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0xd90e2f925DA726b50C4Ed8D0Fb90Ad053324F31b",echoContract:"0x9B27DD5Bb15d42DC224FCD0B7caEbBe16161Df42",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",tornContract:"0x77777FeDdddFfC19Ff86DB637967013e6C6A116C",governanceContract:"0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce",stakingRewardsContract:"0x5B3f656C80E8ddb9ec01Dd9018815576E9238c29",registryContract:"0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2",aggregatorContract:"0xE8F47A78A6D52D317D0D2FFFac56739fE14D1b49",reverseRecordsContract:"0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C",tornadoSubgraph:"tornadocash/mainnet-tornado-subgraph",registrySubgraph:"tornadocash/tornado-relayer-registry",governanceSubgraph:"tornadocash/tornado-governance",subgraphs:{},tokens:{eth:{instanceAddress:{.1:"0x12D66f87A04A9E220743712cE6d9bB1B5616B8Fc",1:"0x47CE0C6eD5B0Ce3d3A51fdb1C52DC66a7c3c2936",10:"0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF",100:"0xA160cdAB225685dA1d56aa342Ad8841c3b53f291"},symbol:"ETH",decimals:18},dai:{instanceAddress:{100:"0xD4B88Df4D29F5CedD6857912842cff3b20C8Cfa3",1e3:"0xFD8610d20aA15b7B2E3Be39B396a1bC3516c7144",1e4:"0x07687e702b410Fa43f4cB4Af7FA097918ffD2730",1e5:"0x23773E65ed146A459791799d01336DB287f25334"},tokenAddress:"0x6B175474E89094C44Da98b954EedeAC495271d0F",tokenGasLimit:7e4,symbol:"DAI",decimals:18,gasLimit:7e5},cdai:{instanceAddress:{5e3:"0x22aaA7720ddd5388A3c0A3333430953C68f1849b",5e4:"0x03893a7c7463AE47D46bc7f091665f1893656003",5e5:"0x2717c5e28cf931547B621a5dddb772Ab6A35B701",5e6:"0xD21be7248e0197Ee08E0c20D4a96DEBdaC3D20Af"},tokenAddress:"0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643",tokenGasLimit:2e5,symbol:"cDAI",decimals:8,gasLimit:7e5},usdc:{instanceAddress:{100:"0xd96f2B1c14Db8458374d9Aca76E26c3D18364307",1e3:"0x4736dCf1b7A3d580672CcE6E7c65cd5cc9cFBa9D"},tokenAddress:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",tokenGasLimit:7e4,symbol:"USDC",decimals:6,gasLimit:7e5},usdt:{instanceAddress:{100:"0x169AD27A470D064DEDE56a2D3ff727986b15D52B",1e3:"0x0836222F2B2B24A3F36f98668Ed8F0B38D1a872f"},tokenAddress:"0xdAC17F958D2ee523a2206206994597C13D831ec7",tokenGasLimit:7e4,symbol:"USDT",decimals:6,gasLimit:7e5},wbtc:{instanceAddress:{.1:"0x178169B423a011fff22B9e3F3abeA13414dDD0F1",1:"0x610B717796ad172B316836AC95a2ffad065CeaB4",10:"0xbB93e510BbCD0B7beb5A853875f9eC60275CF498"},tokenAddress:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",tokenGasLimit:7e4,symbol:"WBTC",decimals:8,gasLimit:7e5}},disabledTokens:["cdai","usdt","usdc"],relayerEnsSubdomain:"mainnet-tornado",pollInterval:15,constants:{GOVERNANCE_BLOCK:11474695,NOTE_ACCOUNT_BLOCK:11842486,ENCRYPTED_NOTES_BLOCK:12143762,REGISTRY_BLOCK:14173129,MINING_BLOCK_TIME:15}},56:{rpcCallRetryAttempt:15,gasPrices:{instant:5,fast:5,standard:5,low:5},nativeCurrency:"bnb",currencyName:"BNB",explorerUrl:"https://bscscan.com",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Binance Smart Chain",deployedBlock:8158799,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",tornadoSubgraph:"tornadocash/bsc-tornado-subgraph",subgraphs:{},rpcUrls:{bnbchain:{name:"BNB Chain",url:"https://bsc-dataseed.bnbchain.org"},ninicoin:{name:"ninicoin",url:"https://bsc-dataseed1.ninicoin.io"},nodereal:{name:"NodeReal",url:"https://binance.nodereal.io"},meowrpc:{name:"Meow RPC",url:"https://bsc.meowrpc.com"},stackup:{name:"Stackup RPC",url:"https://public.stackup.sh/api/v1/node/bsc-mainnet"},oneRPC:{name:"1RPC",url:"https://1rpc.io/bnb"}},tokens:{bnb:{instanceAddress:{.1:"0x84443CFd09A48AF6eF360C6976C5392aC5023a1F",1:"0xd47438C816c9E7f2E2888E060936a499Af9582b3",10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"},symbol:"BNB",decimals:18}},relayerEnsSubdomain:"bsc-tornado",pollInterval:10,constants:{NOTE_ACCOUNT_BLOCK:8159269,ENCRYPTED_NOTES_BLOCK:8159269}},137:{rpcCallRetryAttempt:15,gasPrices:{instant:100,fast:75,standard:50,low:30},nativeCurrency:"matic",currencyName:"MATIC",explorerUrl:"https://polygonscan.com",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Polygon (Matic) Network",deployedBlock:16257962,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",tornadoSubgraph:"tornadocash/matic-tornado-subgraph",subgraphs:{},rpcUrls:{oneRpc:{name:"1RPC",url:"https://1rpc.io/matic"},meowrpc:{name:"Meow RPC",url:"https://polygon.meowrpc.com"},stackup:{name:"Stackup RPC",url:"https://public.stackup.sh/api/v1/node/polygon-mainnet"}},tokens:{matic:{instanceAddress:{100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD",1e3:"0xdf231d99Ff8b6c6CBF4E9B9a945CBAcEF9339178",1e4:"0xaf4c0B70B2Ea9FB7487C7CbB37aDa259579fe040",1e5:"0xa5C2254e4253490C54cef0a4347fddb8f75A4998"},symbol:"MATIC",decimals:18}},relayerEnsSubdomain:"polygon-tornado",pollInterval:10,constants:{NOTE_ACCOUNT_BLOCK:16257996,ENCRYPTED_NOTES_BLOCK:16257996}},10:{rpcCallRetryAttempt:15,gasPrices:{instant:.001,fast:.001,standard:.001,low:.001},nativeCurrency:"eth",currencyName:"ETH",explorerUrl:"https://optimistic.etherscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Optimism",deployedBlock:2243689,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",ovmGasPriceOracleContract:"0x420000000000000000000000000000000000000F",tornadoSubgraph:"tornadocash/optimism-tornado-subgraph",subgraphs:{},rpcUrls:{optimism:{name:"Optimism",url:"https://mainnet.optimism.io"},meowrpc:{name:"Meow RPC",url:"https://optimism.meowrpc.com"},stackup:{name:"Stackup RPC",url:"https://public.stackup.sh/api/v1/node/optimism-mainnet"},oneRpc:{name:"1RPC",url:"https://1rpc.io/op"}},tokens:{eth:{instanceAddress:{.1:"0x84443CFd09A48AF6eF360C6976C5392aC5023a1F",1:"0xd47438C816c9E7f2E2888E060936a499Af9582b3",10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"},symbol:"ETH",decimals:18}},relayerEnsSubdomain:"optimism-tornado",pollInterval:15,constants:{NOTE_ACCOUNT_BLOCK:2243694,ENCRYPTED_NOTES_BLOCK:2243694}},42161:{rpcCallRetryAttempt:15,gasPrices:{instant:4,fast:3,standard:2.52,low:2.29},nativeCurrency:"eth",currencyName:"ETH",explorerUrl:"https://arbiscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Arbitrum One",deployedBlock:3430648,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",tornadoSubgraph:"tornadocash/arbitrum-tornado-subgraph",subgraphs:{},rpcUrls:{Arbitrum:{name:"Arbitrum RPC",url:"https://arb1.arbitrum.io/rpc"},meowrpc:{name:"Meow RPC",url:"https://arbitrum.meowrpc.com"},stackup:{name:"Stackup RPC",url:"https://public.stackup.sh/api/v1/node/arbitrum-one"},oneRpc:{name:"1rpc",url:"https://1rpc.io/arb"}},tokens:{eth:{instanceAddress:{.1:"0x84443CFd09A48AF6eF360C6976C5392aC5023a1F",1:"0xd47438C816c9E7f2E2888E060936a499Af9582b3",10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"},symbol:"ETH",decimals:18}},relayerEnsSubdomain:"arbitrum-tornado",pollInterval:15,constants:{NOTE_ACCOUNT_BLOCK:3430605,ENCRYPTED_NOTES_BLOCK:3430605}},100:{rpcCallRetryAttempt:15,gasPrices:{instant:6,fast:5,standard:4,low:1},nativeCurrency:"xdai",currencyName:"xDAI",explorerUrl:"https://gnosisscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Gnosis Chain",deployedBlock:17754561,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",tornadoSubgraph:"tornadocash/xdai-tornado-subgraph",subgraphs:{},rpcUrls:{gnosis:{name:"Gnosis",url:"https://rpc.gnosischain.com"},blockPi:{name:"BlockPi",url:"https://gnosis.blockpi.network/v1/rpc/public"},oneRpc:{name:"1rpc",url:"https://1rpc.io/gnosis"}},tokens:{xdai:{instanceAddress:{100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD",1e3:"0xdf231d99Ff8b6c6CBF4E9B9a945CBAcEF9339178",1e4:"0xaf4c0B70B2Ea9FB7487C7CbB37aDa259579fe040",1e5:"0xa5C2254e4253490C54cef0a4347fddb8f75A4998"},symbol:"xDAI",decimals:18}},relayerEnsSubdomain:"gnosis-tornado",pollInterval:15,constants:{NOTE_ACCOUNT_BLOCK:17754564,ENCRYPTED_NOTES_BLOCK:17754564}},43114:{rpcCallRetryAttempt:15,gasPrices:{instant:225,fast:35,standard:25,low:25},nativeCurrency:"avax",currencyName:"AVAX",explorerUrl:"https://snowtrace.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Avalanche Mainnet",deployedBlock:4429818,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",tornadoSubgraph:"tornadocash/avalanche-tornado-subgraph",subgraphs:{},rpcUrls:{publicRpc:{name:"Avalanche RPC",url:"https://api.avax.network/ext/bc/C/rpc"},meowRPC:{name:"Meow RPC",url:"https://avax.meowrpc.com"},oneRPC:{name:"OneRPC",url:"https://1rpc.io/avax/c"}},tokens:{avax:{instanceAddress:{10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD",500:"0xaf8d1839c3c67cf571aa74B5c12398d4901147B3"},symbol:"AVAX",decimals:18}},relayerEnsSubdomain:"avalanche-tornado",pollInterval:10,constants:{NOTE_ACCOUNT_BLOCK:4429813,ENCRYPTED_NOTES_BLOCK:4429813}},11155111:{rpcCallRetryAttempt:15,gasPrices:{instant:2,fast:2,standard:2,low:2},nativeCurrency:"eth",currencyName:"SepoliaETH",explorerUrl:"https://sepolia.etherscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Ethereum Sepolia",deployedBlock:5594395,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x1572AFE6949fdF51Cb3E0856216670ae9Ee160Ee",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",tornContract:"0x3AE6667167C0f44394106E197904519D808323cA",governanceContract:"0xe5324cD7602eeb387418e594B87aCADee08aeCAD",stakingRewardsContract:"0x6d0018890751Efd31feb8166711B16732E2b496b",registryContract:"0x1428e5d2356b13778A13108b10c440C83011dfB8",aggregatorContract:"0x4088712AC9fad39ea133cdb9130E465d235e9642",reverseRecordsContract:"0xEc29700C0283e5Be64AcdFe8077d6cC95dE23C23",tornadoSubgraph:"tornadocash/sepolia-tornado-subgraph",subgraphs:{},rpcUrls:{sepolia:{name:"Sepolia RPC",url:"https://rpc.sepolia.org"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/ethereum-sepolia"},onerpc:{name:"1rpc",url:"https://1rpc.io/sepolia"},ethpandaops:{name:"ethpandaops",url:"https://rpc.sepolia.ethpandaops.io"}},tokens:{eth:{instanceAddress:{.1:"0x8C4A04d872a6C1BE37964A21ba3a138525dFF50b",1:"0x8cc930096B4Df705A007c4A039BDFA1320Ed2508",10:"0x8D10d506D29Fc62ABb8A290B99F66dB27Fc43585",100:"0x44c5C92ed73dB43888210264f0C8b36Fd68D8379"},symbol:"ETH",decimals:18},dai:{instanceAddress:{100:"0x6921fd1a97441dd603a997ED6DDF388658daf754",1e3:"0x50a637770F5d161999420F7d70d888DE47207145",1e4:"0xecD649870407cD43923A816Cc6334a5bdf113621",1e5:"0x73B4BD04bF83206B6e979BE2507098F92EDf4F90"},tokenAddress:"0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357",tokenGasLimit:7e4,symbol:"DAI",decimals:18,gasLimit:7e5}},relayerEnsSubdomain:"sepolia-tornado",pollInterval:15,constants:{GOVERNANCE_BLOCK:5594395,NOTE_ACCOUNT_BLOCK:5594395,ENCRYPTED_NOTES_BLOCK:5594395,MINING_BLOCK_TIME:15}}},s=Object.values(b).filter((e=>"number"==typeof e));let l={};function u(e){s.push(...Object.keys(e).map((e=>Number(e))).filter((e=>!s.includes(e)))),l=i(i({},l),e)}function h(){const e=i(i({},o),l);return s.reduce(((a,t)=>(a[t]=e[t],a)),{})}function p(e){const a=h()[e];if(!a)throw new Error(`No config found for network ${e}!`);return a}function g(e){const{tokens:a,disabledTokens:t}=e;return Object.keys(a).filter((e=>!(null==t?void 0:t.includes(e))))}function m(e){const{tokens:a,disabledTokens:t}=e;return Object.entries(a).reduce(((e,[a,c])=>((null==t?void 0:t.includes(a))||(e[a]=c),e)),{})}function x(e,a){const{tokens:t,disabledTokens:c}=e;for(const[e,{instanceAddress:f}]of Object.entries(t))if(!(null==c?void 0:c.includes(e)))for(const[t,c]of Object.entries(f))if(c===a)return{amount:t,currency:e}}function y(){const e=h();return s.reduce(((a,t)=>(a[t]=e[t].relayerEnsSubdomain,a)),{})}},85111:(e,a,t)=>{"use strict";t.d(a,{Hr:()=>d,NO:()=>r,UB:()=>n});var c=t(90294),f=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));class d{constructor(){this.pedersenPromise=this.initPedersen()}initPedersen(){return f(this,null,(function*(){this.pedersenHash=yield(0,c.vu)(),this.babyJub=this.pedersenHash.babyJub}))}unpackPoint(e){return f(this,null,(function*(){var a,t;return yield this.pedersenPromise,null==(t=this.babyJub)?void 0:t.unpackPoint(null==(a=this.pedersenHash)?void 0:a.hash(e))}))}toStringBuffer(e){var a;return null==(a=this.babyJub)?void 0:a.F.toString(e)}}const r=new d;function n(e){return f(this,null,(function*(){const[a]=yield r.unpackPoint(e);return r.toStringBuffer(a)}))}},34525:(e,a,t)=>{"use strict";t.d(a,{T:()=>d});var c=t(99770),f=t(48486);class d{constructor(e,a,t){this.provider=e,this.multicall=a,this.oracle=t}fetchPrices(e){return a=this,t=function*(){return this.oracle?(yield(0,f.C)(this.multicall,e.map((({tokenAddress:e})=>({contract:this.oracle,name:"getRateToEth",params:[e,!0]}))))).map(((a,t)=>a*BigInt(10**e[t].decimals)/BigInt(10**18))):new Promise((a=>a(e.map((()=>(0,c.g5)("0.0001"))))))},new Promise(((e,c)=>{var f=e=>{try{r(t.next(e))}catch(e){c(e)}},d=e=>{try{r(t.throw(e))}catch(e){c(e)}},r=a=>a.done?e(a.value):Promise.resolve(a.value).then(f,d);r((t=t.apply(a,null)).next())}));var a,t}}},68434:(e,a,t)=>{"use strict";t.d(a,{D2:()=>of,Vr:()=>bf,Gd:()=>nf,nA:()=>rf,mJ:()=>Yc,hd:()=>Xc,Fd:()=>af,uY:()=>tf,WU:()=>ef,sO:()=>cf,MF:()=>ff,zr:()=>df});var c=t(74945),f=t.n(c),d=t(36212),r=t(57339),n=t(88081),i=t(87303);function b(e){return async function(e,a){(0,r.vA)(null==a||!a.cancelled,"request cancelled before sending","CANCELLED");const t=e.url.split(":")[0].toLowerCase();(0,r.vA)("http"===t||"https"===t,`unsupported protocol ${t}`,"UNSUPPORTED_OPERATION",{info:{protocol:t},operation:"request"}),(0,r.vA)("https"===t||!e.credentials||e.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let c=null;const f=new AbortController,d=setTimeout((()=>{c=(0,r.xz)("request timeout","TIMEOUT"),f.abort()}),e.timeout);a&&a.addListener((()=>{c=(0,r.xz)("request cancelled","CANCELLED"),f.abort()}));const n={method:e.method,headers:new Headers(Array.from(e)),body:e.body||void 0,signal:f.signal};let i;try{i=await fetch(e.url,n)}catch(e){if(clearTimeout(d),c)throw c;throw e}clearTimeout(d);const b={};i.headers.forEach(((e,a)=>{b[a.toLowerCase()]=e}));const o=await i.arrayBuffer(),s=null==o?null:new Uint8Array(o);return{statusCode:i.status,statusMessage:i.statusText,headers:b,body:s}}}b();let o=b();const s=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),l=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let u=!1;async function h(e,a){try{const a=e.match(s);if(!a)throw new Error("invalid data");return new v(200,"OK",{"content-type":a[1]||"text/plain"},a[2]?function(e){e=atob(e);const a=new Uint8Array(e.length);for(let t=0;tString.fromCharCode(parseInt(a,16)))))))}catch(a){return new v(599,"BAD REQUEST (invalid data: URI)",{},null,new A(e))}var t}function p(e){return async function(a,t){try{const t=a.match(l);if(!t)throw new Error("invalid link");return new A(`${e}${t[2]}`)}catch(e){return new v(599,"BAD REQUEST (invalid IPFS URI)",{},null,new A(a))}}}const g={data:h,ipfs:p("https://gateway.ipfs.io/ipfs/")},m=new WeakMap;class x{#e;#a;constructor(e){this.#e=[],this.#a=!1,m.set(e,(()=>{if(!this.#a){this.#a=!0;for(const e of this.#e)setTimeout((()=>{e()}),0);this.#e=[]}}))}addListener(e){(0,r.vA)(!this.#a,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#e.push(e)}get cancelled(){return this.#a}checkSignal(){(0,r.vA)(!this.cancelled,"cancelled","CANCELLED",{})}}function y(e){if(null==e)throw new Error("missing signal; should not happen");return e.checkSignal(),e}class A{#t;#c;#f;#d;#r;#n;#i;#b;#o;#s;#l;#u;#h;#p;#g;get url(){return this.#n}set url(e){this.#n=String(e)}get body(){return null==this.#i?null:new Uint8Array(this.#i)}set body(e){if(null==e)this.#i=void 0,this.#b=void 0;else if("string"==typeof e)this.#i=(0,i.YW)(e),this.#b="text/plain";else if(e instanceof Uint8Array)this.#i=e,this.#b="application/octet-stream";else{if("object"!=typeof e)throw new Error("invalid body");this.#i=(0,i.YW)(JSON.stringify(e)),this.#b="application/json"}}hasBody(){return null!=this.#i}get method(){return this.#d?this.#d:this.hasBody()?"POST":"GET"}set method(e){null==e&&(e=""),this.#d=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#f);return this.#o&&(e.authorization=`Basic ${function(e){const a=(0,d.q5)(e);let t="";for(let e=0;e{if(t=0,"timeout must be non-zero","timeout",e),this.#r=e}get preflightFunc(){return this.#s||null}set preflightFunc(e){this.#s=e}get processFunc(){return this.#l||null}set processFunc(e){this.#l=e}get retryFunc(){return this.#u||null}set retryFunc(e){this.#u=e}get getUrlFunc(){return this.#g||o}set getUrlFunc(e){this.#g=e}constructor(e){this.#n=String(e),this.#t=!1,this.#c=!0,this.#f={},this.#d="",this.#r=3e5,this.#p={slotInterval:250,maxAttempts:12},this.#g=null}toString(){return``}setThrottleParams(e){null!=e.slotInterval&&(this.#p.slotInterval=e.slotInterval),null!=e.maxAttempts&&(this.#p.maxAttempts=e.maxAttempts)}async#m(e,a,t,c,f){if(e>=this.#p.maxAttempts)return f.makeServerError("exceeded maximum retry limit");(0,r.vA)(w()<=a,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:c}),t>0&&await function(e){return new Promise((a=>setTimeout(a,e)))}(t);let d=this.clone();const n=(d.url.split(":")[0]||"").toLowerCase();if(n in g){const e=await g[n](d.url,y(c.#h));if(e instanceof v){let a=e;if(this.processFunc){y(c.#h);try{a=await this.processFunc(d,a)}catch(e){null!=e.throttle&&"number"==typeof e.stall||a.makeServerError("error in post-processing function",e).assertOk()}}return a}d=e}this.preflightFunc&&(d=await this.preflightFunc(d));const i=await this.getUrlFunc(d,y(c.#h));let b=new v(i.statusCode,i.statusMessage,i.headers,i.body,c);if(301===b.statusCode||302===b.statusCode){try{const t=b.headers.location||"";return d.redirect(t).#m(e+1,a,0,c,b)}catch(e){}return b}if(429===b.statusCode&&(null==this.retryFunc||await this.retryFunc(d,b,e))){const t=b.headers["retry-after"];let f=this.#p.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return"string"==typeof t&&t.match(/^[1-9][0-9]*$/)&&(f=parseInt(t)),d.clone().#m(e+1,a,f,c,b)}if(this.processFunc){y(c.#h);try{b=await this.processFunc(d,b)}catch(t){null!=t.throttle&&"number"==typeof t.stall||b.makeServerError("error in post-processing function",t).assertOk();let f=this.#p.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return t.stall>=0&&(f=t.stall),d.clone().#m(e+1,a,f,c,b)}}return b}send(){return(0,r.vA)(null==this.#h,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#h=new x(this),this.#m(0,w()+this.timeout,0,this,new v(0,"",{},null,this))}cancel(){(0,r.vA)(null!=this.#h,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=m.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const a=this.url.split(":")[0].toLowerCase(),t=e.split(":")[0].toLowerCase();(0,r.vA)("GET"===this.method&&("https"!==a||"http"!==t)&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const c=new A(e);return c.method="GET",c.allowGzip=this.allowGzip,c.timeout=this.timeout,c.#f=Object.assign({},this.#f),this.#i&&(c.#i=new Uint8Array(this.#i)),c.#b=this.#b,c}clone(){const e=new A(this.url);return e.#d=this.#d,this.#i&&(e.#i=this.#i),e.#b=this.#b,e.#f=Object.assign({},this.#f),e.#o=this.#o,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#s=this.#s,e.#l=this.#l,e.#u=this.#u,e.#p=Object.assign({},this.#p),e.#g=this.#g,e}static lockConfig(){u=!0}static getGateway(e){return g[e.toLowerCase()]||null}static registerGateway(e,a){if("http"===(e=e.toLowerCase())||"https"===e)throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(u)throw new Error("gateways locked");g[e]=a}static registerGetUrl(e){if(u)throw new Error("gateways locked");o=e}static createGetUrlFunc(e){return b()}static createDataGateway(){return h}static createIpfsGatewayFunc(e){return p(e)}}class v{#x;#y;#f;#i;#A;#v;toString(){return``}get statusCode(){return this.#x}get statusMessage(){return this.#y}get headers(){return Object.assign({},this.#f)}get body(){return null==this.#i?null:new Uint8Array(this.#i)}get bodyText(){try{return null==this.#i?"":(0,i._v)(this.#i)}catch(e){(0,r.vA)(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){(0,r.vA)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,a=Object.keys(e);let t=0;return{next:()=>{if(t(e[a.toLowerCase()]=String(t[a]),e)),{}),this.#i=null==c?null:new Uint8Array(c),this.#A=f||null,this.#v={message:""}}makeServerError(e,a){let t;t=e?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:`CLIENT ESCALATED SERVER ERROR (${e=`${this.statusCode} ${this.statusMessage}`})`;const c=new v(599,t,this.headers,this.body,this.#A||void 0);return c.#v={message:e,error:a},c}throwThrottleError(e,a){null==a?a=-1:(0,r.MR)(Number.isInteger(a)&&a>=0,"invalid stall timeout","stall",a);const t=new Error(e||"throttling requests");throw(0,n.n)(t,{stall:a,throttle:!0}),t}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return null!=this.#i}get request(){return this.#A}ok(){return""===this.#v.message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:a}=this.#v;""===e&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let t=null;this.request&&(t=this.request.url);let c=null;try{this.#i&&(c=(0,i._v)(this.#i))}catch(e){}(0,r.vA)(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:a,info:{requestUrl:t,responseBody:c,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function w(){return(new Date).getTime()}var _=t(35273),I=t(30031),E=t(41442),C=t(15539),M=t(27033),B=t(38264);const L=new Uint8Array(32);L.fill(0);const S=BigInt(-1),k=BigInt(0),N=BigInt(1),P=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),R=(0,M.up)(N,32),O=(0,M.up)(k,32),D={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},T=["name","version","chainId","verifyingContract","salt"];function F(e){return function(a){return(0,r.MR)("string"==typeof a,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,a),a}}const Q={name:F("name"),version:F("version"),chainId:function(e){const a=(0,M.Ab)(e,"domain.chainId");return(0,r.MR)(a>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(a)?Number(a):(0,M.nD)(a)},verifyingContract:function(e){try{return(0,I.b)(e).toLowerCase()}catch(e){}(0,r.MR)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const a=(0,d.q5)(e,"domain.salt");return(0,r.MR)(32===a.length,'invalid domain value "salt"',"domain.salt",e),(0,d.c$)(a)}};function U(e){{const a=e.match(/^(u?)int(\d+)$/);if(a){const t=""===a[1],c=parseInt(a[2]);(0,r.MR)(c%8==0&&0!==c&&c<=256&&a[2]===String(c),"invalid numeric width","type",e);const f=(0,M.dK)(P,t?c-1:c),d=t?(f+N)*S:k;return function(a){const c=(0,M.Ab)(a,"value");return(0,r.MR)(c>=d&&c<=f,`value out-of-bounds for ${e}`,"value",c),(0,M.up)(t?(0,M.JJ)(c,256):c,32)}}}{const a=e.match(/^bytes(\d+)$/);if(a){const t=parseInt(a[1]);return(0,r.MR)(0!==t&&t<=32&&a[1]===String(t),"invalid bytes width","type",e),function(a){const c=(0,d.q5)(a);return(0,r.MR)(c.length===t,`invalid length for ${e}`,"value",a),function(e){const a=(0,d.q5)(e),t=a.length%32;return t?(0,d.xW)([a,L.slice(t)]):(0,d.c$)(a)}(a)}}}switch(e){case"address":return function(e){return(0,d.nx)((0,I.b)(e),32)};case"bool":return function(e){return e?R:O};case"bytes":return function(e){return(0,C.S)(e)};case"string":return function(e){return(0,B.id)(e)}}return null}function j(e,a){return`${e}(${a.map((({name:e,type:a})=>a+" "+e)).join(",")})`}function H(e){const a=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return a?{base:a[1],index:a[2]+a[4],array:{base:a[1],prefix:a[1]+a[2],count:a[5]?parseInt(a[5]):-1}}:{base:e}}class ${primaryType;#w;get types(){return JSON.parse(this.#w)}#_;#I;constructor(e){this.#_=new Map,this.#I=new Map;const a=new Map,t=new Map,c=new Map,f={};Object.keys(e).forEach((d=>{f[d]=e[d].map((({name:a,type:t})=>{let{base:c,index:f}=H(t);return"int"!==c||e.int||(c="int256"),"uint"!==c||e.uint||(c="uint256"),{name:a,type:c+(f||"")}})),a.set(d,new Set),t.set(d,[]),c.set(d,new Set)})),this.#w=JSON.stringify(f);for(const c in f){const d=new Set;for(const n of f[c]){(0,r.MR)(!d.has(n.name),`duplicate variable name ${JSON.stringify(n.name)} in ${JSON.stringify(c)}`,"types",e),d.add(n.name);const f=H(n.type).base;(0,r.MR)(f!==c,`circular type reference to ${JSON.stringify(f)}`,"types",e),U(f)||((0,r.MR)(t.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),t.get(f).push(c),a.get(c).add(f))}}const d=Array.from(t.keys()).filter((e=>0===t.get(e).length));(0,r.MR)(0!==d.length,"missing primary type","types",e),(0,r.MR)(1===d.length,`ambiguous primary types or unused types: ${d.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),(0,n.n)(this,{primaryType:d[0]}),function f(d,n){(0,r.MR)(!n.has(d),`circular type reference to ${JSON.stringify(d)}`,"types",e),n.add(d);for(const e of a.get(d))if(t.has(e)){f(e,n);for(const a of n)c.get(a).add(e)}n.delete(d)}(this.primaryType,new Set);for(const[e,a]of c){const t=Array.from(a);t.sort(),this.#_.set(e,j(e,f[e])+t.map((e=>j(e,f[e]))).join(""))}}getEncoder(e){let a=this.#I.get(e);return a||(a=this.#E(e),this.#I.set(e,a)),a}#E(e){{const a=U(e);if(a)return a}const a=H(e).array;if(a){const e=a.prefix,t=this.getEncoder(e);return c=>{(0,r.MR)(-1===a.count||a.count===c.length,`array length mismatch; expected length ${a.count}`,"value",c);let f=c.map(t);return this.#_.has(e)&&(f=f.map(C.S)),(0,C.S)((0,d.xW)(f))}}const t=this.types[e];if(t){const a=(0,B.id)(this.#_.get(e));return e=>{const c=t.map((({name:a,type:t})=>{const c=this.getEncoder(t)(e[a]);return this.#_.has(t)?(0,C.S)(c):c}));return c.unshift(a),(0,d.xW)(c)}}(0,r.MR)(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const a=this.#_.get(e);return(0,r.MR)(a,`unknown type: ${JSON.stringify(e)}`,"name",e),a}encodeData(e,a){return this.getEncoder(e)(a)}hashStruct(e,a){return(0,C.S)(this.encodeData(e,a))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,a,t){if(U(e))return t(e,a);const c=H(e).array;if(c)return(0,r.MR)(-1===c.count||c.count===a.length,`array length mismatch; expected length ${c.count}`,"value",a),a.map((e=>this._visit(c.prefix,e,t)));const f=this.types[e];if(f)return f.reduce(((e,{name:c,type:f})=>(e[c]=this._visit(f,a[c],t),e)),{});(0,r.MR)(!1,`unknown type: ${e}`,"type",e)}visit(e,a){return this._visit(this.primaryType,e,a)}static from(e){return new $(e)}static getPrimaryType(e){return $.from(e).primaryType}static hashStruct(e,a,t){return $.from(a).hashStruct(e,t)}static hashDomain(e){const a=[];for(const t in e){if(null==e[t])continue;const c=D[t];(0,r.MR)(c,`invalid typed-data domain key: ${JSON.stringify(t)}`,"domain",e),a.push({name:t,type:c})}return a.sort(((e,a)=>T.indexOf(e.name)-T.indexOf(a.name))),$.hashStruct("EIP712Domain",{EIP712Domain:a},e)}static encode(e,a,t){return(0,d.xW)(["0x1901",$.hashDomain(e),$.from(a).hash(t)])}static hash(e,a,t){return(0,C.S)($.encode(e,a,t))}static async resolveNames(e,a,t,c){e=Object.assign({},e);for(const a in e)null==e[a]&&delete e[a];const f={};e.verifyingContract&&!(0,d.Lo)(e.verifyingContract,20)&&(f[e.verifyingContract]="0x");const r=$.from(a);r.visit(t,((e,a)=>("address"!==e||(0,d.Lo)(a,20)||(f[a]="0x"),a)));for(const e in f)f[e]=await c(e);return e.verifyingContract&&f[e.verifyingContract]&&(e.verifyingContract=f[e.verifyingContract]),{domain:e,value:t=r.visit(t,((e,a)=>"address"===e&&f[a]?f[a]:a))}}static getPayload(e,a,t){$.hashDomain(e);const c={},f=[];T.forEach((a=>{const t=e[a];null!=t&&(c[a]=Q[a](t),f.push({name:a,type:D[a]}))}));const n=$.from(a);a=n.types;const i=Object.assign({},a);return(0,r.MR)(null==i.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",a),i.EIP712Domain=f,n.encode(t),{types:i,domain:c,primaryType:n.primaryType,message:n.visit(t,((e,a)=>{if(e.match(/^bytes(\d*)/))return(0,d.c$)((0,d.q5)(a));if(e.match(/^u?int/))return(0,M.Ab)(a).toString();switch(e){case"address":return a.toLowerCase();case"bool":return!!a;case"string":return(0,r.MR)("string"==typeof a,"invalid string","value",a),a}(0,r.MR)(!1,"unsupported type","type",e)}))}}}var q=t(8177),G=t(98982),z=t(24391),K=t(64563),V=t(79453),Z=t(99381);const J="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let W=null;function Y(e){if(null==W){W={};for(let e=0;e<58;e++)W[J[e]]=BigInt(e)}const a=W[e];return(0,r.MR)(null!=a,"invalid base58 value","letter",e),a}const X=BigInt(0),ee=BigInt(58);function ae(e){const a=(0,d.q5)(e);let t=(0,M.Dg)(a),c="";for(;t;)c=J[Number(t%ee)]+c,t/=ee;for(let e=0;e{try{return await this.#M.supportsInterface("0x9061b923")}catch(e){if((0,r.bJ)(e,"CALL_EXCEPTION"))return!1;throw this.#C=null,e}})()),await this.#C}async#B(e,a){a=(a||[]).slice();const t=this.#M.interface;a.unshift((0,K.kM)(this.name));let c=null;await this.supportsWildcard()&&(c=t.getFunction(e),(0,r.vA)(c,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),a=[(0,K.Wh)(this.name,255),t.encodeFunctionData(c,a)],e="resolve(bytes,bytes)"),a.push({enableCcipRead:!0});try{const f=await this.#M[e](...a);return c?t.decodeFunctionResult(c,f)[0]:f}catch(e){if(!(0,r.bJ)(e,"CALL_EXCEPTION"))throw e}return null}async getAddress(e){if(null==e&&(e=60),60===e)try{const e=await this.#B("addr(bytes32)");return null==e||e===G.j?null:e}catch(e){if((0,r.bJ)(e,"CALL_EXCEPTION"))return null;throw e}if(e>=0&&e<2147483648){let a=e+2147483648;const t=await this.#B("addr(bytes32,uint)",[a]);if((0,d.Lo)(t,20))return(0,I.b)(t)}let a=null;for(const t of this.provider.plugins)if(t instanceof ce&&t.supportsCoinType(e)){a=t;break}if(null==a)return null;const t=await this.#B("addr(bytes32,uint)",[e]);if(null==t||"0x"===t)return null;const c=await a.decodeAddress(e,t);if(null!=c)return c;(0,r.vA)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:t}})}async getText(e){const a=await this.#B("text(bytes32,string)",[e]);return null==a||"0x"===a?null:a}async getContentHash(){const e=await this.#B("contenthash(bytes32)");if(null==e||"0x"===e)return null;const a=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(a){const e="e3010170"===a[1]?"ipfs":"ipns",t=parseInt(a[4],16);if(a[5].length===2*t)return`${e}://${ae("0x"+a[2])}`}const t=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(t&&64===t[1].length)return`bzz://${t[1]}`;(0,r.vA)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const a=await this.getText("avatar");if(null==a)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:a});for(let t=0;t{if(a&&null==t)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map((a=>e(a)))}}function le(e,a){return t=>{const c={};for(const f in e){let d=f;if(a&&f in a&&!(d in t))for(const e of a[f])if(e in t){d=e;break}try{const a=e[f](t[d]);void 0!==a&&(c[f]=a)}catch(e){const a=e instanceof Error?e.message:"not-an-error";(0,r.vA)(!1,`invalid value for value.${f} (${a})`,"BAD_DATA",{value:t})}}return c}}function ue(e){return(0,r.MR)((0,d.Lo)(e,!0),"invalid data","value",e),e}function he(e){return(0,r.MR)((0,d.Lo)(e,32),"invalid hash","value",e),e}const pe=le({address:I.b,blockHash:he,blockNumber:M.WZ,data:ue,index:M.WZ,removed:oe((function(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}(0,r.MR)(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)}),!1),topics:se(he),transactionHash:he,transactionIndex:M.WZ},{index:["logIndex"]}),ge=le({hash:oe(he),parentHash:he,parentBeaconBlockRoot:oe(he,null),number:M.WZ,timestamp:M.WZ,nonce:oe(ue),difficulty:M.Ab,gasLimit:M.Ab,gasUsed:M.Ab,stateRoot:oe(he,null),receiptsRoot:oe(he,null),blobGasUsed:oe(M.Ab,null),excessBlobGas:oe(M.Ab,null),miner:oe(I.b),prevRandao:oe(he,null),extraData:ue,baseFeePerGas:oe(M.Ab)},{prevRandao:["mixHash"]}),me=le({transactionIndex:M.WZ,blockNumber:M.WZ,transactionHash:he,address:I.b,topics:se(he),data:ue,index:M.WZ,blockHash:he},{index:["logIndex"]}),xe=le({to:oe(I.b,null),from:oe(I.b,null),contractAddress:oe(I.b,null),index:M.WZ,root:oe(d.c$),gasUsed:M.Ab,blobGasUsed:oe(M.Ab,null),logsBloom:oe(ue),blockHash:he,hash:he,logs:se((function(e){return me(e)})),blockNumber:M.WZ,cumulativeGasUsed:M.Ab,effectiveGasPrice:oe(M.Ab),blobGasPrice:oe(M.Ab,null),status:oe(M.WZ),type:oe(M.WZ,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function ye(e){e.to&&(0,M.Ab)(e.to)===be&&(e.to="0x0000000000000000000000000000000000000000");const a=le({hash:he,index:oe(M.WZ,void 0),type:e=>"0x"===e||null==e?0:(0,M.WZ)(e),accessList:oe(q.$,null),blobVersionedHashes:oe(se(he,!0),null),blockHash:oe(he,null),blockNumber:oe(M.WZ,null),transactionIndex:oe(M.WZ,null),from:I.b,gasPrice:oe(M.Ab),maxPriorityFeePerGas:oe(M.Ab),maxFeePerGas:oe(M.Ab),maxFeePerBlobGas:oe(M.Ab,null),gasLimit:M.Ab,to:oe(I.b,null),value:M.Ab,nonce:M.WZ,data:ue,creates:oe(I.b,null),chainId:oe(M.Ab,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(null==a.to&&null==a.creates&&(a.creates=function(e){const a=(0,I.b)(e.from);let t=(0,M.Ab)(e.nonce,"tx.nonce").toString(16);return t="0"===t?"0x":t.length%2?"0x0"+t:"0x"+t,(0,I.b)((0,d.ZG)((0,C.S)((0,ne.R)([a,t])),12))}(a)),1!==e.type&&2!==e.type||null!=e.accessList||(a.accessList=[]),e.signature?a.signature=ie.t.from(e.signature):a.signature=ie.t.from(e),null==a.chainId){const e=a.signature.legacyChainId;null!=e&&(a.chainId=e)}return a.blockHash&&(0,M.Ab)(a.blockHash)===be&&(a.blockHash=null),a}class Ae{name;constructor(e){(0,n.n)(this,{name:e})}clone(){return new Ae(this.name)}}class ve extends Ae{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,a){null==e&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const t={effectiveBlock:e};function c(e,c){let f=(a||{})[e];null==f&&(f=c),(0,r.MR)("number"==typeof f,`invalud value for ${e}`,"costs",a),t[e]=f}c("txBase",21e3),c("txCreate",32e3),c("txDataZero",4),c("txDataNonzero",16),c("txAccessListStorageKey",1900),c("txAccessListAddress",2400),(0,n.n)(this,t)}clone(){return new ve(this.effectiveBlock,this)}}class we extends Ae{address;targetNetwork;constructor(e,a){super("org.ethers.plugins.network.Ens"),(0,n.n)(this,{address:e||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==a?1:a})}clone(){return new we(this.address,this.targetNetwork)}}class _e extends Ae{#n;#S;get url(){return this.#n}get processFunc(){return this.#S}constructor(e,a){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#n=e,this.#S=a}clone(){return this}}const Ie=new Map;class Ee{#k;#N;#P;constructor(e,a){this.#k=e,this.#N=(0,M.Ab)(a),this.#P=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#k}set name(e){this.#k=e}get chainId(){return this.#N}set chainId(e){this.#N=(0,M.Ab)(e,"chainId")}matches(e){if(null==e)return!1;if("string"==typeof e){try{return this.chainId===(0,M.Ab)(e)}catch(e){}return this.name===e}if("number"==typeof e||"bigint"==typeof e){try{return this.chainId===(0,M.Ab)(e)}catch(e){}return!1}if("object"==typeof e){if(null!=e.chainId){try{return this.chainId===(0,M.Ab)(e.chainId)}catch(e){}return!1}return null!=e.name&&this.name===e.name}return!1}get plugins(){return Array.from(this.#P.values())}attachPlugin(e){if(this.#P.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#P.set(e.name,e.clone()),this}getPlugin(e){return this.#P.get(e)||null}getPlugins(e){return this.plugins.filter((a=>a.name.split("#")[0]===e))}clone(){const e=new Ee(this.name,this.chainId);return this.plugins.forEach((a=>{e.attachPlugin(a.clone())})),e}computeIntrinsicGas(e){const a=this.getPlugin("org.ethers.plugins.network.GasCost")||new ve;let t=a.txBase;if(null==e.to&&(t+=a.txCreate),e.data)for(let c=2;c{c.attachPlugin(e)})),c};Ee.register(e,c),Ee.register(a,c),t.altNames&&t.altNames.forEach((e=>{Ee.register(e,c)}))}Be||(Be=!0,e("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),e("ropsten",3,{ensNetwork:3}),e("rinkeby",4,{ensNetwork:4}),e("goerli",5,{ensNetwork:5}),e("kovan",42,{ensNetwork:42}),e("sepolia",11155111,{ensNetwork:11155111}),e("holesky",17e3,{ensNetwork:17e3}),e("classic",61,{}),e("classicKotti",6,{}),e("arbitrum",42161,{ensNetwork:1}),e("arbitrum-goerli",421613,{}),e("arbitrum-sepolia",421614,{}),e("base",8453,{ensNetwork:1}),e("base-goerli",84531,{}),e("base-sepolia",84532,{}),e("bnb",56,{ensNetwork:1}),e("bnbt",97,{}),e("linea",59144,{ensNetwork:1}),e("linea-goerli",59140,{}),e("linea-sepolia",59141,{}),e("matic",137,{ensNetwork:1,plugins:[Me("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Me("https://gasstation-testnet.polygon.technology/v2")]}),e("optimism",10,{ensNetwork:1,plugins:[]}),e("optimism-goerli",420,{}),e("optimism-sepolia",11155420,{}),e("xdai",100,{ensNetwork:1}))}(),null==e)return Ee.from("mainnet");if("number"==typeof e&&(e=BigInt(e)),"string"==typeof e||"bigint"==typeof e){const a=Ie.get(e);if(a)return a();if("bigint"==typeof e)return new Ee("unknown",e);(0,r.MR)(!1,"unknown network","network",e)}if("function"==typeof e.clone)return e.clone();if("object"==typeof e){(0,r.MR)("string"==typeof e.name&&"number"==typeof e.chainId,"invalid network object name or chainId","network",e);const a=new Ee(e.name,e.chainId);return(e.ensAddress||null!=e.ensNetwork)&&a.attachPlugin(new we(e.ensAddress,e.ensNetwork)),a}(0,r.MR)(!1,"invalid network","network",e)}static register(e,a){"number"==typeof e&&(e=BigInt(e));const t=Ie.get(e);t&&(0,r.MR)(!1,`conflicting network for ${JSON.stringify(t.name)}`,"nameOrChainId",e),Ie.set(e,a)}}function Ce(e,a){const t=String(e);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);const c=t.split(".");if(1===c.length&&c.push(""),2!==c.length)throw new Error(`invalid gwei value: ${e}`);for(;c[1].length9){let e=BigInt(c[1].substring(0,9));c[1].substring(9).match(/^0+$/)||e++,c[1]=e.toString()}return BigInt(c[0]+c[1])}function Me(e){return new _e(e,(async(e,a,t)=>{let c;t.setHeader("User-Agent","ethers");try{const[a,f]=await Promise.all([t.send(),e()]);c=a;const d=c.bodyJson.standard;return{gasPrice:f.gasPrice,maxFeePerGas:Ce(d.maxFee,9),maxPriorityFeePerGas:Ce(d.maxPriorityFee,9)}}catch(e){(0,r.vA)(!1,`error encountered with polygon gas station (${JSON.stringify(t.url)})`,"SERVER_ERROR",{request:t,response:c,error:e})}}))}let Be=!1;var Le=t(43948);function Se(e){return JSON.parse(JSON.stringify(e))}class ke{#R;#O;#D;#T;constructor(e){this.#R=e,this.#O=null,this.#D=4e3,this.#T=-2}get pollingInterval(){return this.#D}set pollingInterval(e){this.#D=e}async#F(){try{const e=await this.#R.getBlockNumber();if(-2===this.#T)return void(this.#T=e);if(e!==this.#T){for(let a=this.#T+1;a<=e;a++){if(null==this.#O)return;await this.#R.emit("block",a)}this.#T=e}}catch(e){}null!=this.#O&&(this.#O=this.#R._setTimeout(this.#F.bind(this),this.#D))}start(){this.#O||(this.#O=this.#R._setTimeout(this.#F.bind(this),this.#D),this.#F())}stop(){this.#O&&(this.#R._clearTimeout(this.#O),this.#O=null)}pause(e){this.stop(),e&&(this.#T=-2)}resume(){this.start()}}class Ne{#R;#F;#Q;constructor(e){this.#R=e,this.#Q=!1,this.#F=e=>{this._poll(e,this.#R)}}async _poll(e,a){throw new Error("sub-classes must override this")}start(){this.#Q||(this.#Q=!0,this.#F(-2),this.#R.on("block",this.#F))}stop(){this.#Q&&(this.#Q=!1,this.#R.off("block",this.#F))}pause(e){this.stop()}resume(){this.start()}}class Pe extends Ne{#U;#j;constructor(e,a){super(e),this.#U=a,this.#j=-2}pause(e){e&&(this.#j=-2),super.pause(e)}async _poll(e,a){const t=await a.getBlock(this.#U);null!=t&&(-2===this.#j?this.#j=t.number:t.number>this.#j&&(a.emit(this.#U,t.number),this.#j=t.number))}}class Re extends Ne{#H;constructor(e,a){super(e),this.#H=Se(a)}async _poll(e,a){throw new Error("@TODO")}}class Oe extends Ne{#$;constructor(e,a){super(e),this.#$=a}async _poll(e,a){const t=await a.getTransactionReceipt(this.#$);t&&a.emit(this.#$,t)}}class De{#R;#H;#O;#Q;#T;constructor(e,a){this.#R=e,this.#H=Se(a),this.#O=this.#F.bind(this),this.#Q=!1,this.#T=-2}async#F(e){if(-2===this.#T)return;const a=Se(this.#H);a.fromBlock=this.#T+1,a.toBlock=e;const t=await this.#R.getLogs(a);if(0!==t.length)for(const e of t)this.#R.emit(this.#H,e),this.#T=e.blockNumber;else this.#T{this.#T=e})),this.#R.on("block",this.#O))}stop(){this.#Q&&(this.#Q=!1,this.#R.off("block",this.#O))}pause(e){this.stop(),e&&(this.#T=-2)}resume(){this.start()}}const Te=BigInt(2);function Fe(e){return e&&"function"==typeof e.then}function Qe(e,a){return e+":"+JSON.stringify(a,((e,a)=>{if(null==a)return"null";if("bigint"==typeof a)return`bigint:${a.toString()}`;if("string"==typeof a)return a.toLowerCase();if("object"==typeof a&&!Array.isArray(a)){const e=Object.keys(a);return e.sort(),e.reduce(((e,t)=>(e[t]=a[t],e)),{})}return a}))}class Ue{name;constructor(e){(0,n.n)(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function je(e){return(e=Array.from(new Set(e).values())).sort(),e}async function He(e,a){if(null==e)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),"string"==typeof e)switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if((0,d.Lo)(e,32)){const a=e.toLowerCase();return{type:"transaction",tag:Qe("tx",{hash:a}),hash:a}}if(e.orphan){const a=e;return{type:"orphan",tag:Qe("orphan",a),filter:(t=a,JSON.parse(JSON.stringify(t)))}}var t;if(e.address||e.topics){const t=e,c={topics:(t.topics||[]).map((e=>null==e?null:Array.isArray(e)?je(e.map((e=>e.toLowerCase()))):e.toLowerCase()))};if(t.address){const e=[],f=[],r=t=>{(0,d.Lo)(t)?e.push(t):f.push((async()=>{e.push(await(0,E.tG)(t,a))})())};Array.isArray(t.address)?t.address.forEach(r):r(t.address),f.length&&await Promise.all(f),c.address=je(e.map((e=>e.toLowerCase())))}return{filter:c,tag:Qe("event",c),type:"event"}}(0,r.MR)(!1,"unknown ProviderEvent","event",e)}function $e(){return(new Date).getTime()}const qe={cacheTimeout:250,pollingInterval:4e3};class Ge{#q;#P;#G;#z;#K;#V;#Z;#J;#W;#Y;#X;#ee;constructor(e,a){if(this.#ee=Object.assign({},qe,a||{}),"any"===e)this.#V=!0,this.#K=null;else if(e){const a=Ee.from(e);this.#V=!1,this.#K=Promise.resolve(a),setTimeout((()=>{this.emit("network",a,null)}),0)}else this.#V=!1,this.#K=null;this.#J=-1,this.#Z=new Map,this.#q=new Map,this.#P=new Map,this.#G=null,this.#z=!1,this.#W=1,this.#Y=new Map,this.#X=!1}get pollingInterval(){return this.#ee.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#P.values())}attachPlugin(e){if(this.#P.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#P.set(e.name,e.connect(this)),this}getPlugin(e){return this.#P.get(e)||null}get disableCcipRead(){return this.#X}set disableCcipRead(e){this.#X=!!e}async#ae(e){const a=this.#ee.cacheTimeout;if(a<0)return await this._perform(e);const t=Qe(e.method,e);let c=this.#Z.get(t);return c||(c=this._perform(e),this.#Z.set(t,c),setTimeout((()=>{this.#Z.get(t)===c&&this.#Z.delete(t)}),a)),await c}async ccipReadFetch(e,a,t){if(this.disableCcipRead||0===t.length||null==e.to)return null;const c=e.to.toLowerCase(),f=a.toLowerCase(),d=[];for(let a=0;a=500,`response not found during CCIP fetch: ${o}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:n,errorMessage:o}}),d.push(o)}(0,r.vA)(!1,`error encountered during CCIP fetch: ${d.map((e=>JSON.stringify(e))).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:t,errorMessages:d}})}_wrapBlock(e,a){return new Le.eB(function(e){const a=ge(e);return a.transactions=e.transactions.map((e=>"string"==typeof e?e:ye(e))),a}(e),this)}_wrapLog(e,a){return new Le.tG(function(e){return pe(e)}(e),this)}_wrapTransactionReceipt(e,a){return new Le.z5(function(e){return xe(e)}(e),this)}_wrapTransactionResponse(e,a){return new Le.uI(ye(e),this)}_detectNetwork(){(0,r.vA)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){(0,r.vA)(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=(0,M.WZ)(await this.#ae({method:"getBlockNumber"}),"%response");return this.#J>=0&&(this.#J=e),e}_getAddress(e){return(0,E.tG)(e,this)}_getBlockTag(e){if(null==e)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}return(0,d.Lo)(e)?(0,d.Lo)(e,32)?e:(0,M.nD)(e):("bigint"==typeof e&&(e=(0,M.WZ)(e,"blockTag")),"number"==typeof e?e>=0?(0,M.nD)(e):this.#J>=0?(0,M.nD)(this.#J+e):this.getBlockNumber().then((a=>(0,M.nD)(a+e))):void(0,r.MR)(!1,"invalid blockTag","blockTag",e))}_getFilter(e){const a=(e.topics||[]).map((e=>null==e?null:Array.isArray(e)?je(e.map((e=>e.toLowerCase()))):e.toLowerCase())),t="blockHash"in e?e.blockHash:void 0,c=(e,c,f)=>{let d;switch(e.length){case 0:break;case 1:d=e[0];break;default:e.sort(),d=e}if(t&&(null!=c||null!=f))throw new Error("invalid filter");const r={};return d&&(r.address=d),a.length&&(r.topics=a),c&&(r.fromBlock=c),f&&(r.toBlock=f),t&&(r.blockHash=t),r};let f,d,r=[];if(e.address)if(Array.isArray(e.address))for(const a of e.address)r.push(this._getAddress(a));else r.push(this._getAddress(e.address));return"fromBlock"in e&&(f=this._getBlockTag(e.fromBlock)),"toBlock"in e&&(d=this._getBlockTag(e.toBlock)),r.filter((e=>"string"!=typeof e)).length||null!=f&&"string"!=typeof f||null!=d&&"string"!=typeof d?Promise.all([Promise.all(r),f,d]).then((e=>c(e[0],e[1],e[2]))):c(r,f,d)}_getTransactionRequest(e){const a=(0,Le.VS)(e),t=[];if(["to","from"].forEach((e=>{if(null==a[e])return;const c=(0,E.tG)(a[e],this);Fe(c)?t.push(async function(){a[e]=await c}()):a[e]=c})),null!=a.blockTag){const e=this._getBlockTag(a.blockTag);Fe(e)?t.push(async function(){a.blockTag=await e}()):a.blockTag=e}return t.length?async function(){return await Promise.all(t),a}():a}async getNetwork(){if(null==this.#K){const e=(async()=>{try{const e=await this._detectNetwork();return this.emit("network",e,null),e}catch(a){throw this.#K===e&&(this.#K=null),a}})();return this.#K=e,(await e).clone()}const e=this.#K,[a,t]=await Promise.all([e,this._detectNetwork()]);return a.chainId!==t.chainId&&(this.#V?(this.emit("network",t,a),this.#K===e&&(this.#K=Promise.resolve(t))):(0,r.vA)(!1,`network changed: ${a.chainId} => ${t.chainId} `,"NETWORK_ERROR",{event:"changed"})),a.clone()}async getFeeData(){const e=await this.getNetwork(),a=async()=>{const{_block:a,gasPrice:t,priorityFee:c}=await(0,n.k)({_block:this.#te("latest",!1),gasPrice:(async()=>{try{const e=await this.#ae({method:"getGasPrice"});return(0,M.Ab)(e,"%response")}catch(e){}return null})(),priorityFee:(async()=>{try{const e=await this.#ae({method:"getPriorityFee"});return(0,M.Ab)(e,"%response")}catch(e){}return null})()});let f=null,d=null;const r=this._wrapBlock(a,e);return r&&r.baseFeePerGas&&(d=null!=c?c:BigInt("1000000000"),f=r.baseFeePerGas*Te+d),new Le.J9(t,f,d)},t=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(t){const e=new A(t.url),c=await t.processFunc(a,this,e);return new Le.J9(c.gasPrice,c.maxFeePerGas,c.maxPriorityFeePerGas)}return await a()}async estimateGas(e){let a=this._getTransactionRequest(e);return Fe(a)&&(a=await a),(0,M.Ab)(await this.#ae({method:"estimateGas",transaction:a}),"%response")}async#ce(e,a,t){(0,r.vA)(t<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:a,enableCcipRead:!0})});const c=(0,Le.VS)(e);try{return(0,d.c$)(await this._perform({method:"call",transaction:c,blockTag:a}))}catch(e){if(!this.disableCcipRead&&(0,r.E)(e)&&e.data&&t>=0&&"latest"===a&&null!=c.to&&"0x556f1830"===(0,d.ZG)(e.data,0,4)){const f=e.data,n=await(0,E.tG)(c.to,this);let i;try{i=function(e){const a={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,r.vA)((0,d.pO)(e)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const t=(0,d.ZG)(e,0,32);(0,r.vA)((0,d.ZG)(t,0,12)===(0,d.ZG)(Ye,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),a.sender=(0,d.ZG)(t,12);try{const t=[],c=(0,M.WZ)((0,d.ZG)(e,32,64)),f=(0,M.WZ)((0,d.ZG)(e,c,c+32)),r=(0,d.ZG)(e,c+32);for(let e=0;ea[e])),a}((0,d.ZG)(e.data,4))}catch(e){(0,r.vA)(!1,e.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:c,info:{data:f}})}(0,r.vA)(i.sender.toLowerCase()===n.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:f,reason:"OffchainLookup",transaction:c,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:i.errorArgs}});const b=await this.ccipReadFetch(c,i.calldata,i.urls);(0,r.vA)(null!=b,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:c,info:{data:e.data,errorArgs:i.errorArgs}});const o={to:n,data:(0,d.xW)([i.selector,We([b,i.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:o});try{const e=await this.#ce(o,a,t+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},o),result:e}),e}catch(e){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},o),error:e}),e}}throw e}}async#fe(e){const{value:a}=await(0,n.k)({network:this.getNetwork(),value:e});return a}async call(e){const{tx:a,blockTag:t}=await(0,n.k)({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#fe(this.#ce(a,t,e.enableCcipRead?0:-1))}async#de(e,a,t){let c=this._getAddress(a),f=this._getBlockTag(t);return"string"==typeof c&&"string"==typeof f||([c,f]=await Promise.all([c,f])),await this.#fe(this.#ae(Object.assign(e,{address:c,blockTag:f})))}async getBalance(e,a){return(0,M.Ab)(await this.#de({method:"getBalance"},e,a),"%response")}async getTransactionCount(e,a){return(0,M.WZ)(await this.#de({method:"getTransactionCount"},e,a),"%response")}async getCode(e,a){return(0,d.c$)(await this.#de({method:"getCode"},e,a))}async getStorage(e,a,t){const c=(0,M.Ab)(a,"position");return(0,d.c$)(await this.#de({method:"getStorage",position:c},e,t))}async broadcastTransaction(e){const{blockNumber:a,hash:t,network:c}=await(0,n.k)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),f=V.Z.from(e);if(f.hash!==t)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(f,c).replaceableTransaction(a)}async#te(e,a){if((0,d.Lo)(e,32))return await this.#ae({method:"getBlock",blockHash:e,includeTransactions:a});let t=this._getBlockTag(e);return"string"!=typeof t&&(t=await t),await this.#ae({method:"getBlock",blockTag:t,includeTransactions:a})}async getBlock(e,a){const{network:t,params:c}=await(0,n.k)({network:this.getNetwork(),params:this.#te(e,!!a)});return null==c?null:this._wrapBlock(c,t)}async getTransaction(e){const{network:a,params:t}=await(0,n.k)({network:this.getNetwork(),params:this.#ae({method:"getTransaction",hash:e})});return null==t?null:this._wrapTransactionResponse(t,a)}async getTransactionReceipt(e){const{network:a,params:t}=await(0,n.k)({network:this.getNetwork(),params:this.#ae({method:"getTransactionReceipt",hash:e})});if(null==t)return null;if(null==t.gasPrice&&null==t.effectiveGasPrice){const a=await this.#ae({method:"getTransaction",hash:e});if(null==a)throw new Error("report this; could not find tx or effectiveGasPrice");t.effectiveGasPrice=a.gasPrice}return this._wrapTransactionReceipt(t,a)}async getTransactionResult(e){const{result:a}=await(0,n.k)({network:this.getNetwork(),result:this.#ae({method:"getTransactionResult",hash:e})});return null==a?null:(0,d.c$)(a)}async getLogs(e){let a=this._getFilter(e);Fe(a)&&(a=await a);const{network:t,params:c}=await(0,n.k)({network:this.getNetwork(),params:this.#ae({method:"getLogs",filter:a})});return c.map((e=>this._wrapLog(e,t)))}_getProvider(e){(0,r.vA)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await re.fromName(this,e)}async getAvatar(e){const a=await this.getResolver(e);return a?await a.getAvatar():null}async resolveName(e){const a=await this.getResolver(e);return a?await a.getAddress():null}async lookupAddress(e){e=(0,I.b)(e);const a=(0,K.kM)(e.substring(2).toLowerCase()+".addr.reverse");try{const t=await re.getEnsAddress(this),c=new z.NZ(t,["function resolver(bytes32) view returns (address)"],this),f=await c.resolver(a);if(null==f||f===G.j)return null;const d=new z.NZ(f,["function name(bytes32) view returns (string)"],this),r=await d.name(a);return await this.resolveName(r)!==e?null:r}catch(e){if((0,r.bJ)(e,"BAD_DATA")&&"0x"===e.value)return null;if((0,r.bJ)(e,"CALL_EXCEPTION"))return null;throw e}return null}async waitForTransaction(e,a,t){const c=null!=a?a:1;return 0===c?this.getTransactionReceipt(e):new Promise((async(a,f)=>{let d=null;const n=async t=>{try{const f=await this.getTransactionReceipt(e);if(null!=f&&t-f.blockNumber+1>=c)return a(f),void(d&&(clearTimeout(d),d=null))}catch(e){console.log("EEE",e)}this.once("block",n)};null!=t&&(d=setTimeout((()=>{null!=d&&(d=null,this.off("block",n),f((0,r.xz)("timeout","TIMEOUT",{reason:"timeout"})))}),t)),n(await this.getBlockNumber())}))}async waitForBlock(e){(0,r.vA)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const a=this.#Y.get(e);a&&(a.timer&&clearTimeout(a.timer),this.#Y.delete(e))}_setTimeout(e,a){null==a&&(a=0);const t=this.#W++,c=()=>{this.#Y.delete(t),e()};if(this.paused)this.#Y.set(t,{timer:null,func:c,time:a});else{const e=setTimeout(c,a);this.#Y.set(t,{timer:e,func:c,time:$e()})}return t}_forEachSubscriber(e){for(const a of this.#q.values())e(a.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Ue(e.type);case"block":{const e=new ke(this);return e.pollingInterval=this.pollingInterval,e}case"safe":case"finalized":return new Pe(this,e.type);case"event":return new De(this,e.filter);case"transaction":return new Oe(this,e.hash);case"orphan":return new Re(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,a){for(const t of this.#q.values())if(t.subscriber===e){t.started&&t.subscriber.stop(),t.subscriber=a,t.started&&a.start(),null!=this.#G&&a.pause(this.#G);break}}async#re(e,a){let t=await He(e,this);return"event"===t.type&&a&&a.length>0&&!0===a[0].removed&&(t=await He({orphan:"drop-log",log:a[0]},this)),this.#q.get(t.tag)||null}async#ne(e){const a=await He(e,this),t=a.tag;let c=this.#q.get(t);return c||(c={subscriber:this._getSubscriber(a),tag:t,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#q.set(t,c)),c}async on(e,a){const t=await this.#ne(e);return t.listeners.push({listener:a,once:!1}),t.started||(t.subscriber.start(),t.started=!0,null!=this.#G&&t.subscriber.pause(this.#G)),this}async once(e,a){const t=await this.#ne(e);return t.listeners.push({listener:a,once:!0}),t.started||(t.subscriber.start(),t.started=!0,null!=this.#G&&t.subscriber.pause(this.#G)),this}async emit(e,...a){const t=await this.#re(e,a);if(!t||0===t.listeners.length)return!1;const c=t.listeners.length;return t.listeners=t.listeners.filter((({listener:t,once:c})=>{const f=new Z.z(this,c?null:t,e);try{t.call(this,...a,f)}catch(e){}return!c})),0===t.listeners.length&&(t.started&&t.subscriber.stop(),this.#q.delete(t.tag)),c>0}async listenerCount(e){if(e){const a=await this.#re(e);return a?a.listeners.length:0}let a=0;for(const{listeners:e}of this.#q.values())a+=e.length;return a}async listeners(e){if(e){const a=await this.#re(e);return a?a.listeners.map((({listener:e})=>e)):[]}let a=[];for(const{listeners:e}of this.#q.values())a=a.concat(e.map((({listener:e})=>e)));return a}async off(e,a){const t=await this.#re(e);if(!t)return this;if(a){const e=t.listeners.map((({listener:e})=>e)).indexOf(a);e>=0&&t.listeners.splice(e,1)}return a&&0!==t.listeners.length||(t.started&&t.subscriber.stop(),this.#q.delete(t.tag)),this}async removeAllListeners(e){if(e){const{tag:a,started:t,subscriber:c}=await this.#ne(e);t&&c.stop(),this.#q.delete(a)}else for(const[e,{started:a,subscriber:t}]of this.#q)a&&t.stop(),this.#q.delete(e);return this}async addListener(e,a){return await this.on(e,a)}async removeListener(e,a){return this.off(e,a)}get destroyed(){return this.#z}destroy(){this.removeAllListeners();for(const e of this.#Y.keys())this._clearTimeout(e);this.#z=!0}get paused(){return null!=this.#G}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#J=-1,null!=this.#G){if(this.#G==!!e)return;(0,r.vA)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber((a=>a.pause(e))),this.#G=!!e;for(const e of this.#Y.values())e.timer&&clearTimeout(e.timer),e.time=$e()-e.time}resume(){if(null!=this.#G){this._forEachSubscriber((e=>e.resume())),this.#G=null;for(const e of this.#Y.values()){let a=e.time;a<0&&(a=0),e.time=$e(),setTimeout(e.func,a)}}}}function ze(e,a){try{const t=Ke(e,a);if(t)return(0,i._v)(t)}catch(e){}return null}function Ke(e,a){if("0x"===e)return null;try{const t=(0,M.WZ)((0,d.ZG)(e,a,a+32)),c=(0,M.WZ)((0,d.ZG)(e,t,t+32));return(0,d.ZG)(e,t+32,t+32+c)}catch(e){}return null}function Ve(e){const a=(0,M.c4)(e);if(a.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(a,32-a.length),t}function Ze(e){if(e.length%32==0)return e;const a=new Uint8Array(32*Math.ceil(e.length/32));return a.set(e),a}const Je=new Uint8Array([]);function We(e){const a=[];let t=0;for(let c=0;c((0,r.MR)(e.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),e)))}else t.from=e.getAddress();return await(0,n.k)(t)}class aa{provider;constructor(e){(0,n.n)(this,{provider:e||null})}async getNonce(e){return Xe(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await ea(this,e)}async populateTransaction(e){const a=Xe(this,"populateTransaction"),t=await ea(this,e);null==t.nonce&&(t.nonce=await this.getNonce("pending")),null==t.gasLimit&&(t.gasLimit=await this.estimateGas(t));const c=await this.provider.getNetwork();if(null!=t.chainId){const a=(0,M.Ab)(t.chainId);(0,r.MR)(a===c.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else t.chainId=c.chainId;const f=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!f?0!==t.type&&1!==t.type||!f||(0,r.MR)(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e):(0,r.MR)(!1,"eip-1559 transaction do not support gasPrice","tx",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type){const e=await a.getFeeData();(0,r.vA)(null!=e.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice)}else{const e=await a.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?((0,r.vA)(!f,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):(0,r.vA)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2!==t.type&&3!==t.type||(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return await(0,n.k)(t)}async estimateGas(e){return Xe(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Xe(this,"call").call(await this.populateCall(e))}async resolveName(e){const a=Xe(this,"resolveName");return await a.resolveName(e)}async sendTransaction(e){const a=Xe(this,"sendTransaction"),t=await this.populateTransaction(e);delete t.from;const c=V.Z.from(t);return await a.broadcastTransaction(await this.signTransaction(c))}}class ta extends aa{address;constructor(e,a){super(a),(0,n.n)(this,{address:e})}async getAddress(){return this.address}connect(e){return new ta(this.address,e)}#ie(e,a){(0,r.vA)(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:a})}async signTransaction(e){this.#ie("transactions","signTransaction")}async signMessage(e){this.#ie("messages","signMessage")}async signTypedData(e,a,t){this.#ie("typed-data","signTypedData")}}class ca{#R;#be;#O;#Q;#oe;#se;constructor(e){this.#R=e,this.#be=null,this.#O=this.#F.bind(this),this.#Q=!1,this.#oe=null,this.#se=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,a){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#F(e){try{null==this.#be&&(this.#be=this._subscribe(this.#R));let e=null;try{e=await this.#be}catch(e){if(!(0,r.bJ)(e,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==e.operation)throw e}if(null==e)return this.#be=null,void this.#R._recoverSubscriber(this,this._recover(this.#R));const a=await this.#R.getNetwork();if(this.#oe||(this.#oe=a),this.#oe.chainId!==a.chainId)throw new Error("chaid changed");if(this.#se)return;const t=await this.#R.send("eth_getFilterChanges",[e]);await this._emitResults(this.#R,t)}catch(e){console.log("@TODO",e)}this.#R.once("block",this.#O)}#le(){const e=this.#be;e&&(this.#be=null,e.then((e=>{this.#R.destroyed||this.#R.send("eth_uninstallFilter",[e])})))}start(){this.#Q||(this.#Q=!0,this.#F(-2))}stop(){this.#Q&&(this.#Q=!1,this.#se=!0,this.#le(),this.#R.off("block",this.#O))}pause(e){e&&this.#le(),this.#R.off("block",this.#O)}resume(){this.start()}}class fa extends ca{#ue;constructor(e,a){var t;super(e),this.#ue=(t=a,JSON.parse(JSON.stringify(t)))}_recover(e){return new De(e,this.#ue)}async _subscribe(e){return await e.send("eth_newFilter",[this.#ue])}async _emitResults(e,a){for(const t of a)e.emit(this.#ue,e._wrapLog(t,e._network))}}class da extends ca{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,a){for(const t of a)e.emit("pending",t)}}const ra="bigint,boolean,function,number,string,symbol".split(/,/g);function na(e){if(null==e||ra.indexOf(typeof e)>=0)return e;if("function"==typeof e.getAddress)return e;if(Array.isArray(e))return e.map(na);if("object"==typeof e)return Object.keys(e).reduce(((a,t)=>(a[t]=e[t],a)),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function ia(e){return new Promise((a=>{setTimeout(a,e)}))}function ba(e){return e?e.toLowerCase():e}function oa(e){return e&&"number"==typeof e.pollingInterval}const sa={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class la extends aa{address;constructor(e,a){super(e),a=(0,I.b)(a),(0,n.n)(this,{address:a})}connect(e){(0,r.vA)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const a=na(e),t=[];if(a.from){const c=a.from;t.push((async()=>{const t=await(0,E.tG)(c,this.provider);(0,r.MR)(null!=t&&t.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),a.from=t})())}else a.from=this.address;if(null==a.gasLimit&&t.push((async()=>{a.gasLimit=await this.provider.estimateGas({...a,from:this.address})})()),null!=a.to){const e=a.to;t.push((async()=>{a.to=await(0,E.tG)(e,this.provider)})())}t.length&&await Promise.all(t);const c=this.provider.getRpcTransaction(a);return this.provider.send("eth_sendTransaction",[c])}async sendTransaction(e){const a=await this.provider.getBlockNumber(),t=await this.sendUncheckedTransaction(e);return await new Promise(((e,c)=>{const f=[1e3,100];let d=0;const n=async()=>{try{const c=await this.provider.getTransaction(t);if(null!=c)return void e(c.replaceableTransaction(a))}catch(e){if((0,r.bJ)(e,"CANCELLED")||(0,r.bJ)(e,"BAD_DATA")||(0,r.bJ)(e,"NETWORK_ERROR"))return null==e.info&&(e.info={}),e.info.sendTransactionHash=t,void c(e);if((0,r.bJ)(e,"INVALID_ARGUMENT")&&(d++,null==e.info&&(e.info={}),e.info.sendTransactionHash=t,d>10))return void c(e);this.provider.emit("error",(0,r.xz)("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:e}))}this.provider._setTimeout((()=>{n()}),f.pop()||4e3)};n()}))}async signTransaction(e){const a=na(e);if(a.from){const t=await(0,E.tG)(a.from,this.provider);(0,r.MR)(null!=t&&t.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),a.from=t}else a.from=this.address;const t=this.provider.getRpcTransaction(a);return await this.provider.send("eth_signTransaction",[t])}async signMessage(e){const a="string"==typeof e?(0,i.YW)(e):e;return await this.provider.send("personal_sign",[(0,d.c$)(a),this.address.toLowerCase()])}async signTypedData(e,a,t){const c=na(t),f=await $.resolveNames(e,a,c,(async e=>{const a=await(0,E.tG)(e);return(0,r.MR)(null!=a,"TypedData does not support null address","value",e),a}));return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify($.getPayload(f.domain,a,f.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const a="string"==typeof e?(0,i.YW)(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,d.c$)(a)])}}class ua extends Ge{#ee;#he;#pe;#ge;#me;#oe;#xe;#ye(){if(this.#ge)return;const e=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");this.#ge=setTimeout((()=>{this.#ge=null;const e=this.#pe;for(this.#pe=[];e.length;){const a=[e.shift()];for(;e.length&&a.length!==this.#ee.batchMaxCount;)if(a.push(e.shift()),JSON.stringify(a.map((e=>e.payload))).length>this.#ee.batchMaxSize){e.unshift(a.pop());break}(async()=>{const e=1===a.length?a[0].payload:a.map((e=>e.payload));this.emit("debug",{action:"sendRpcPayload",payload:e});try{const t=await this._send(e);this.emit("debug",{action:"receiveRpcResult",result:t});for(const{resolve:e,reject:c,payload:f}of a){if(this.destroyed){c((0,r.xz)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:f.method}));continue}const a=t.filter((e=>e.id===f.id))[0];if(null!=a)"error"in a?c(this.getRpcError(f,a)):e(a.result);else{const e=(0,r.xz)("missing response for request","BAD_DATA",{value:t,info:{payload:f}});this.emit("error",e),c(e)}}}catch(e){this.emit("debug",{action:"receiveRpcError",error:e});for(const{reject:t}of a)t(e)}})()}}),e)}constructor(e,a){super(e,a),this.#he=1,this.#ee=Object.assign({},sa,a||{}),this.#pe=[],this.#ge=null,this.#oe=null,this.#xe=null;{let e=null;const a=new Promise((a=>{e=a}));this.#me={promise:a,resolve:e}}const t=this._getOption("staticNetwork");"boolean"==typeof t?((0,r.MR)(!t||"any"!==e,"staticNetwork cannot be used on special network 'any'","options",a),t&&null!=e&&(this.#oe=Ee.from(e))):t&&((0,r.MR)(null==e||t.matches(e),"staticNetwork MUST match network object","options",a),this.#oe=t)}_getOption(e){return this.#ee[e]}get _network(){return(0,r.vA)(this.#oe,"network is not available yet","NETWORK_ERROR"),this.#oe}async _perform(e){if("call"===e.method||"estimateGas"===e.method){let a=e.transaction;if(a&&null!=a.type&&(0,M.Ab)(a.type)&&null==a.maxFeePerGas&&null==a.maxPriorityFeePerGas){const t=await this.getFeeData();null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas&&(e=Object.assign({},e,{transaction:Object.assign({},a,{type:void 0})}))}}const a=this.getRpcRequest(e);return null!=a?await this.send(a.method,a.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e){if(!0!==e)return e;if(this.#oe)return this.#oe}return this.#xe?await this.#xe:this.ready?(this.#xe=(async()=>{try{const e=Ee.from((0,M.Ab)(await this.send("eth_chainId",[])));return this.#xe=null,e}catch(e){throw this.#xe=null,e}})(),await this.#xe):(this.#xe=(async()=>{const e={id:this.#he++,method:"eth_chainId",params:[],jsonrpc:"2.0"};let a;this.emit("debug",{action:"sendRpcPayload",payload:e});try{a=(await this._send(e))[0],this.#xe=null}catch(e){throw this.#xe=null,this.emit("debug",{action:"receiveRpcError",error:e}),e}if(this.emit("debug",{action:"receiveRpcResult",result:a}),"result"in a)return Ee.from((0,M.Ab)(a.result));throw this.getRpcError(e,a)})(),await this.#xe)}_start(){null!=this.#me&&null!=this.#me.resolve&&(this.#me.resolve(),this.#me=null,(async()=>{for(;null==this.#oe&&!this.destroyed;)try{this.#oe=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",(0,r.xz)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await ia(1e3)}this.#ye()})())}async _waitUntilReady(){if(null!=this.#me)return await this.#me.promise}_getSubscriber(e){return"pending"===e.type?new da(this):"event"===e.type?this._getOption("polling")?new De(this,e.filter):new fa(this,e.filter):"orphan"===e.type&&"drop-log"===e.filter.orphan?new Ue("orphan"):super._getSubscriber(e)}get ready(){return null==this.#me}getRpcTransaction(e){const a={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((t=>{if(null==e[t])return;let c=t;"gasLimit"===t&&(c="gas"),a[c]=(0,M.nD)((0,M.Ab)(e[t],`tx.${t}`))})),["from","to","data"].forEach((t=>{null!=e[t]&&(a[t]=(0,d.c$)(e[t]))})),e.accessList&&(a.accessList=(0,q.$)(e.accessList)),e.blobVersionedHashes&&(a.blobVersionedHashes=e.blobVersionedHashes.map((e=>e.toLowerCase()))),a}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[ba(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[ba(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[ba(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[ba(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&null!=e.filter.address&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(ba):e.filter.address=ba(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,a){const{method:t}=e,{error:c}=a;if("eth_estimateGas"===t&&c.message){const a=c.message;if(!a.match(/revert/i)&&a.match(/insufficient funds/i))return(0,r.xz)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:c}})}if("eth_call"===t||"eth_estimateGas"===t){const a=ga(c),f=_.y.getBuiltinCallException("eth_call"===t?"call":"estimateGas",e.params[0],a?a.data:null);return f.info={error:c,payload:e},f}const f=JSON.stringify(function(e){const a=[];return ma(e,a),a}(c));if("string"==typeof c.message&&c.message.match(/user denied|ethers-user-denied/i)){const a={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,r.xz)("user rejected action","ACTION_REJECTED",{action:a[t]||"unknown",reason:"rejected",info:{payload:e,error:c}})}if("eth_sendRawTransaction"===t||"eth_sendTransaction"===t){const a=e.params[0];if(f.match(/insufficient funds|base fee exceeds gas limit/i))return(0,r.xz)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:a,info:{error:c}});if(f.match(/nonce/i)&&f.match(/too low/i))return(0,r.xz)("nonce has already been used","NONCE_EXPIRED",{transaction:a,info:{error:c}});if(f.match(/replacement transaction/i)&&f.match(/underpriced/i))return(0,r.xz)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:a,info:{error:c}});if(f.match(/only replay-protected/i))return(0,r.xz)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:t,info:{transaction:a,info:{error:c}}})}let d=!!f.match(/the method .* does not exist/i);return d||c&&c.details&&c.details.startsWith("Unauthorized method:")&&(d=!0),d?(0,r.xz)("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:c,payload:e}}):(0,r.xz)("could not coalesce error","UNKNOWN_ERROR",{error:c,payload:e})}send(e,a){if(this.destroyed)return Promise.reject((0,r.xz)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const t=this.#he++,c=new Promise(((c,f)=>{this.#pe.push({resolve:c,reject:f,payload:{method:e,params:a,id:t,jsonrpc:"2.0"}})}));return this.#ye(),c}async getSigner(e){null==e&&(e=0);const a=this.send("eth_accounts",[]);if("number"==typeof e){const t=await a;if(e>=t.length)throw new Error("no such account");return new la(this,t[e])}const{accounts:t}=await(0,n.k)({network:this.getNetwork(),accounts:a});e=(0,I.b)(e);for(const a of t)if((0,I.b)(a)===e)return new la(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map((e=>new la(this,e)))}destroy(){this.#ge&&(clearTimeout(this.#ge),this.#ge=null);for(const{payload:e,reject:a}of this.#pe)a((0,r.xz)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#pe=[],super.destroy()}}class ha extends ua{#Ae;constructor(e,a){super(e,a);let t=this._getOption("pollingInterval");null==t&&(t=sa.pollingInterval),this.#Ae=t}_getSubscriber(e){const a=super._getSubscriber(e);return oa(a)&&(a.pollingInterval=this.#Ae),a}get pollingInterval(){return this.#Ae}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#Ae=e,this._forEachSubscriber((e=>{oa(e)&&(e.pollingInterval=this.#Ae)}))}}class pa extends ha{#ve;constructor(e,a,t){null==e&&(e="http://localhost:8545"),super(a,t),this.#ve="string"==typeof e?new A(e):e.clone()}_getConnection(){return this.#ve.clone()}async send(e,a){return await this._start(),await super.send(e,a)}async _send(e){const a=this._getConnection();a.body=JSON.stringify(e),a.setHeader("content-type","application/json");const t=await a.send();t.assertOk();let c=t.bodyJson;return Array.isArray(c)||(c=[c]),c}}function ga(e){if(null==e)return null;if("string"==typeof e.message&&e.message.match(/revert/i)&&(0,d.Lo)(e.data))return{message:e.message,data:e.data};if("object"==typeof e){for(const a in e){const t=ga(e[a]);if(t)return t}return null}if("string"==typeof e)try{return ga(JSON.parse(e))}catch(e){}return null}function ma(e,a){if(null!=e){if("string"==typeof e.message&&a.push(e.message),"object"==typeof e)for(const t in e)ma(e[t],a);if("string"==typeof e)try{return ma(JSON.parse(e),a)}catch(e){}}}var xa=t(15496);var ya=t(20415);class Aa extends aa{address;#we;constructor(e,a){super(a),(0,r.MR)(e&&"function"==typeof e.sign,"invalid private key","privateKey","[ REDACTED ]"),this.#we=e;const t=(0,ya.K)(this.signingKey.publicKey);(0,n.n)(this,{address:t})}get signingKey(){return this.#we}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new Aa(this.#we,e)}async signTransaction(e){e=(0,Le.VS)(e);const{to:a,from:t}=await(0,n.k)({to:e.to?(0,E.tG)(e.to,this.provider):void 0,from:e.from?(0,E.tG)(e.from,this.provider):void 0});null!=a&&(e.to=a),null!=t&&(e.from=t),null!=e.from&&((0,r.MR)((0,I.b)(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const c=V.Z.from(e);return c.signature=this.signingKey.sign(c.unsignedHash),c.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(function(e){return"string"==typeof e&&(e=(0,i.YW)(e)),(0,C.S)((0,d.xW)([(0,i.YW)("Ethereum Signed Message:\n"),(0,i.YW)(String(e.length)),e]))}(e)).serialized}async signTypedData(e,a,t){const c=await $.resolveNames(e,a,t,(async e=>{(0,r.vA)(null!=this.provider,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:e}});const a=await this.provider.resolveName(e);return(0,r.vA)(null!=a,"unconfigured ENS name","UNCONFIGURED_NAME",{value:e}),a}));return this.signingKey.sign($.hash(c.domain,a,c.value)).serialized}}var va=t(68650),wa=t(8180);let _a=!1;const Ia=function(e,a,t){return(0,wa.Gz)(e,a).update(t).digest()};let Ea=Ia;function Ca(e,a,t){const c=(0,d.q5)(a,"key"),f=(0,d.q5)(t,"data");return(0,d.c$)(Ea(e,c,f))}Ca._=Ia,Ca.lock=function(){_a=!0},Ca.register=function(e){if(_a)throw new Error("computeHmac is locked");Ea=e},Object.freeze(Ca);var Ma=t(37171),Ba=t(10750);const La=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Sa=Uint8Array.from({length:16},((e,a)=>a));let ka=[Sa],Na=[Sa.map((e=>(9*e+5)%16))];for(let e=0;e<4;e++)for(let a of[ka,Na])a.push(a[e].map((e=>La[e])));const Pa=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),Ra=ka.map(((e,a)=>e.map((e=>Pa[a][e])))),Oa=Na.map(((e,a)=>e.map((e=>Pa[a][e])))),Da=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Ta=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Fa=(e,a)=>e<>>32-a;function Qa(e,a,t,c){return 0===e?a^t^c:1===e?a&t|~a&c:2===e?(a|~t)^c:3===e?a&c|t&~c:a^(t|~c)}const Ua=new Uint32Array(16);class ja extends Ma.D{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:a,h2:t,h3:c,h4:f}=this;return[e,a,t,c,f]}set(e,a,t,c,f){this.h0=0|e,this.h1=0|a,this.h2=0|t,this.h3=0|c,this.h4=0|f}process(e,a){for(let t=0;t<16;t++,a+=4)Ua[t]=e.getUint32(a,!0);let t=0|this.h0,c=t,f=0|this.h1,d=f,r=0|this.h2,n=r,i=0|this.h3,b=i,o=0|this.h4,s=o;for(let e=0;e<5;e++){const a=4-e,l=Da[e],u=Ta[e],h=ka[e],p=Na[e],g=Ra[e],m=Oa[e];for(let a=0;a<16;a++){const c=Fa(t+Qa(e,f,r,i)+Ua[h[a]]+l,g[a])+o|0;t=o,o=i,i=0|Fa(r,10),r=f,f=c}for(let e=0;e<16;e++){const t=Fa(c+Qa(a,d,n,b)+Ua[p[e]]+u,m[e])+s|0;c=s,s=b,b=0|Fa(n,10),n=d,d=t}}this.set(this.h1+r+b|0,this.h2+i+s|0,this.h3+o+c|0,this.h4+t+d|0,this.h0+f+n|0)}roundClean(){Ua.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const Ha=(0,Ba.ld)((()=>new ja));let $a=!1;const qa=function(e){return Ha(e)};let Ga=qa;function za(e){const a=(0,d.q5)(e,"data");return(0,d.c$)(Ga(a))}za._=qa,za.lock=function(){$a=!0},za.register=function(e){if($a)throw new TypeError("ripemd160 is locked");Ga=e},Object.freeze(za);let Ka=!1;const Va=function(e){return new Uint8Array((0,wa.po)(e))};let Za=Va;function Ja(e){return Za(e)}Ja._=Va,Ja.lock=function(){Ka=!0},Ja.register=function(e){if(Ka)throw new Error("randomBytes is locked");Za=e},Object.freeze(Ja);const Wa=/^[a-z]*$/i;function Ya(e,a){let t=97;return e.reduce(((e,c)=>(c===a?t++:c.match(Wa)?e.push(String.fromCharCode(t)+c):(t=97,e.push(c)),e)),[])}class Xa{locale;constructor(e){(0,n.n)(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}class et extends Xa{#_e;#Ie;constructor(e,a,t){super(e),this.#_e=a,this.#Ie=t,this.#Ee=null}get _data(){return this.#_e}_decodeWords(){return e=this.#_e,(0,r.MR)("0"===e[0],"unsupported auwl data","data",e),function(e,a){for(let t=28;t>=0;t--)e=e.split(" !#$%&'()*+,-./<=>?@[]^_`{|}~"[t]).join(a.substring(2*t,2*t+2));const t=[],c=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,((e,a,c,f)=>{if(c)for(let e=parseInt(c);e>=0;e--)t.push(";");else t.push(a.toLowerCase());return""}));if(c)throw new Error(`leftovers: ${JSON.stringify(c)}`);return Ya(Ya(t,";"),":")}(e.substring(59),e.substring(1,59));var e}#Ee;#Ce(){if(null==this.#Ee){const e=this._decodeWords();if((0,B.id)(e.join("\n")+"\n")!==this.#Ie)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#Ee=e}return this.#Ee}getWord(e){const a=this.#Ce();return(0,r.MR)(e>=0&&eurAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}static wordlist(){return null==at&&(at=new tt),at}}let ct=!1;const ft=function(e,a,t,c,f){return(0,wa.T_)(e,a,t,c,f)};let dt=ft;function rt(e,a,t,c,f){const r=(0,d.q5)(e,"password"),n=(0,d.q5)(a,"salt");return(0,d.c$)(dt(r,n,t,c,f))}function nt(e){return(1<=12&&t.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const c=new Uint8Array(Math.ceil(11*t.length/8));let f=0;for(let e=0;e=0,`invalid mnemonic word at index ${e}`,"mnemonic","[ REDACTED ]");for(let e=0;e<11;e++)d&1<<10-e&&(c[f>>3]|=1<<7-f%8),f++}const n=32*t.length/3,i=nt(t.length/3),b=(0,d.q5)((0,va.s)(c.slice(0,n/8)))[0]&i;return(0,r.MR)(b===(c[c.length-1]&i),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,d.c$)(c.slice(0,n/8))}function bt(e,a){(0,r.MR)(e.length%4==0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),null==a&&(a=tt.wordlist());const t=[0];let c=11;for(let a=0;a8?(t[t.length-1]<<=8,t[t.length-1]|=e[a],c-=8):(t[t.length-1]<<=c,t[t.length-1]|=e[a]>>8-c,t.push(e[a]&(1<<8-c)-1&255),c+=3);const f=e.length/4,d=parseInt((0,va.s)(e).substring(2,4),16)&nt(f);return t[t.length-1]<<=f,t[t.length-1]|=d>>8-f,a.join(t.map((e=>a.getWord(e))))}rt._=ft,rt.lock=function(){ct=!0},rt.register=function(e){if(ct)throw new Error("pbkdf2 is locked");dt=e},Object.freeze(rt);const ot={};class st{phrase;password;wordlist;entropy;constructor(e,a,t,c,f){null==c&&(c=""),null==f&&(f=tt.wordlist()),(0,r.gk)(e,ot,"Mnemonic"),(0,n.n)(this,{phrase:t,password:c,wordlist:f,entropy:a})}computeSeed(){const e=(0,i.YW)("mnemonic"+this.password,"NFKD");return rt((0,i.YW)(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,a,t){const c=it(e,t);return e=bt((0,d.q5)(c),t),new st(ot,c,e,a,t)}static fromEntropy(e,a,t){const c=(0,d.q5)(e,"entropy"),f=bt(c,t);return new st(ot,(0,d.c$)(c),f,a,t)}static entropyToPhrase(e,a){return bt((0,d.q5)(e,"entropy"),a)}static phraseToEntropy(e,a){return it(e,a)}static isValidMnemonic(e,a){try{return it(e,a),!0}catch(e){}return!1}}var lt,ut,ht,pt=function(e,a,t,c){if("a"===t&&!c)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof a?e!==a||!c:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?c:"a"===t?c.call(e):c?c.value:a.get(e)},gt=function(e,a,t,c,f){if("m"===c)throw new TypeError("Private method is not writable");if("a"===c&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof a?e!==a||!f:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===c?f.call(e,t):f?f.value=t:a.set(e,t),t};const mt={16:10,24:12,32:14},xt=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],yt=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],At=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],vt=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],wt=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],_t=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],It=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Et=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Ct=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Mt=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Bt=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Lt=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],St=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],kt=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Nt=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Pt(e){const a=[];for(let t=0;t>2,pt(this,ht,"f")[d][e%4]=f[e],pt(this,ut,"f")[a-d][e%4]=f[e];let r,n=0,i=c;for(;i>16&255]<<24^yt[r>>8&255]<<16^yt[255&r]<<8^yt[r>>24&255]^xt[n]<<24,n+=1,8!=c)for(let e=1;e>8&255]<<8^yt[r>>16&255]<<16^yt[r>>24&255]<<24;for(let e=c/2+1;e>2,d=i%4,pt(this,ht,"f")[e][d]=f[b],pt(this,ut,"f")[a-e][d]=f[b++],i++}for(let e=1;e>24&255]^St[r>>16&255]^kt[r>>8&255]^Nt[255&r]}encrypt(e){if(16!=e.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const a=pt(this,ht,"f").length-1,t=[0,0,0,0];let c=Pt(e);for(let e=0;e<4;e++)c[e]^=pt(this,ht,"f")[0][e];for(let e=1;e>24&255]^wt[c[(a+1)%4]>>16&255]^_t[c[(a+2)%4]>>8&255]^It[255&c[(a+3)%4]]^pt(this,ht,"f")[e][a];c=t.slice()}const f=new Uint8Array(16);let d=0;for(let e=0;e<4;e++)d=pt(this,ht,"f")[a][e],f[4*e]=255&(yt[c[e]>>24&255]^d>>24),f[4*e+1]=255&(yt[c[(e+1)%4]>>16&255]^d>>16),f[4*e+2]=255&(yt[c[(e+2)%4]>>8&255]^d>>8),f[4*e+3]=255&(yt[255&c[(e+3)%4]]^d);return f}decrypt(e){if(16!=e.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const a=pt(this,ut,"f").length-1,t=[0,0,0,0];let c=Pt(e);for(let e=0;e<4;e++)c[e]^=pt(this,ut,"f")[0][e];for(let e=1;e>24&255]^Ct[c[(a+3)%4]>>16&255]^Mt[c[(a+2)%4]>>8&255]^Bt[255&c[(a+1)%4]]^pt(this,ut,"f")[e][a];c=t.slice()}const f=new Uint8Array(16);let d=0;for(let e=0;e<4;e++)d=pt(this,ut,"f")[a][e],f[4*e]=255&(At[c[e]>>24&255]^d>>24),f[4*e+1]=255&(At[c[(e+3)%4]>>16&255]^d>>16),f[4*e+2]=255&(At[c[(e+2)%4]>>8&255]^d>>8),f[4*e+3]=255&(At[255&c[(e+1)%4]]^d);return f}}lt=new WeakMap,ut=new WeakMap,ht=new WeakMap;class Ot{constructor(e,a,t){if(t&&!(this instanceof t))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new Rt(a)},name:{enumerable:!0,value:e}})}}var Dt,Tt,Ft=function(e,a,t,c,f){if("m"===c)throw new TypeError("Private method is not writable");if("a"===c&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof a?e!==a||!f:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===c?f.call(e,t):f?f.value=t:a.set(e,t),t},Qt=function(e,a,t,c){if("a"===t&&!c)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof a?e!==a||!c:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?c:"a"===t?c.call(e):c?c.value:a.get(e)};class Ut extends Ot{constructor(e,a){if(super("ECC",e,Ut),Dt.set(this,void 0),Tt.set(this,void 0),a){if(a.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Ft(this,Dt,new Uint8Array(a),"f")}else Ft(this,Dt,new Uint8Array(16),"f");Ft(this,Tt,this.iv,"f")}get iv(){return new Uint8Array(Qt(this,Dt,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const a=new Uint8Array(e.length);for(let t=0;tNumber.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let a=15;a>=0;--a)Gt(this,$t,"f")[a]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(16!==e.length)throw new TypeError("invalid counter initial Uint8Array value length");Gt(this,$t,"f").set(e)}increment(){for(let e=15;e>=0;e--){if(255!==Gt(this,$t,"f")[e]){Gt(this,$t,"f")[e]++;break}Gt(this,$t,"f")[e]=0}}encrypt(e){var a,t;const c=new Uint8Array(e);for(let e=0;ee<>>32-a;function Wt(e,a,t,c,f,d){let r=e[a++]^t[c++],n=e[a++]^t[c++],i=e[a++]^t[c++],b=e[a++]^t[c++],o=e[a++]^t[c++],s=e[a++]^t[c++],l=e[a++]^t[c++],u=e[a++]^t[c++],h=e[a++]^t[c++],p=e[a++]^t[c++],g=e[a++]^t[c++],m=e[a++]^t[c++],x=e[a++]^t[c++],y=e[a++]^t[c++],A=e[a++]^t[c++],v=e[a++]^t[c++],w=r,_=n,I=i,E=b,C=o,M=s,B=l,L=u,S=h,k=p,N=g,P=m,R=x,O=y,D=A,T=v;for(let e=0;e<8;e+=2)C^=Jt(w+R|0,7),S^=Jt(C+w|0,9),R^=Jt(S+C|0,13),w^=Jt(R+S|0,18),k^=Jt(M+_|0,7),O^=Jt(k+M|0,9),_^=Jt(O+k|0,13),M^=Jt(_+O|0,18),D^=Jt(N+B|0,7),I^=Jt(D+N|0,9),B^=Jt(I+D|0,13),N^=Jt(B+I|0,18),E^=Jt(T+P|0,7),L^=Jt(E+T|0,9),P^=Jt(L+E|0,13),T^=Jt(P+L|0,18),_^=Jt(w+E|0,7),I^=Jt(_+w|0,9),E^=Jt(I+_|0,13),w^=Jt(E+I|0,18),B^=Jt(M+C|0,7),L^=Jt(B+M|0,9),C^=Jt(L+B|0,13),M^=Jt(C+L|0,18),P^=Jt(N+k|0,7),S^=Jt(P+N|0,9),k^=Jt(S+P|0,13),N^=Jt(k+S|0,18),R^=Jt(T+D|0,7),O^=Jt(R+T|0,9),D^=Jt(O+R|0,13),T^=Jt(D+O|0,18);f[d++]=r+w|0,f[d++]=n+_|0,f[d++]=i+I|0,f[d++]=b+E|0,f[d++]=o+C|0,f[d++]=s+M|0,f[d++]=l+B|0,f[d++]=u+L|0,f[d++]=h+S|0,f[d++]=p+k|0,f[d++]=g+N|0,f[d++]=m+P|0,f[d++]=x+R|0,f[d++]=y+O|0,f[d++]=A+D|0,f[d++]=v+T|0}function Yt(e,a,t,c,f){let d=c+0,r=c+16*f;for(let c=0;c<16;c++)t[r+c]=e[a+16*(2*f-1)+c];for(let c=0;c0&&(r+=16),Wt(t,d,e,a+=16,t,r)}function Xt(e,a,t){const c=(0,Ba.tY)({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:f,r:d,p:r,dkLen:n,asyncTick:i,maxmem:b,onProgress:o}=c;if((0,Kt.ai)(f),(0,Kt.ai)(d),(0,Kt.ai)(r),(0,Kt.ai)(n),(0,Kt.ai)(i),(0,Kt.ai)(b),void 0!==o&&"function"!=typeof o)throw new Error("progressCb should be function");const s=128*d,l=s/4;if(f<=1||f&f-1||f>=2**(s/8)||f>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(r<0||r>137438953440/s)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(n<0||n>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const u=s*(f+r);if(u>b)throw new Error(`Scrypt: parameters too large, ${u} (128 * r * (N + p)) > ${b} (maxmem)`);const h=(0,Zt.A)(Vt.s,e,a,{c:1,dkLen:s*r}),p=(0,Ba.DH)(h),g=(0,Ba.DH)(new Uint8Array(s*f)),m=(0,Ba.DH)(new Uint8Array(s));let x=()=>{};if(o){const e=2*f*r,a=Math.max(Math.floor(e/1e4),1);let t=0;x=()=>{t++,!o||t%a&&t!==e||o(t/e)}}return{N:f,r:d,p:r,dkLen:n,blockSize32:l,V:g,B32:p,B:h,tmp:m,blockMixCb:x,asyncTick:i}}function ec(e,a,t,c,f){const d=(0,Zt.A)(Vt.s,e,t,{c:1,dkLen:a});return t.fill(0),c.fill(0),f.fill(0),d}let ac=!1,tc=!1;const cc=async function(e,a,t,c,f,d,r){return await async function(e,a,t){const{N:c,r:f,p:d,dkLen:r,blockSize32:n,V:i,B32:b,B:o,tmp:s,blockMixCb:l,asyncTick:u}=Xt(e,a,t);for(let e=0;e{Yt(i,t,i,t+=n,f),l()})),Yt(i,(c-1)*n,b,a,f),l(),await(0,Ba.$h)(c,u,(()=>{const e=b[a+n-16]%c;for(let t=0;t0&&!(c&c-1),"invalid kdf.N","kdf.N",c),(0,r.MR)(f>0&&d>0,"invalid kdf","kdf",a);const n=uc(e,"crypto.kdfparams.dklen:int!");return(0,r.MR)(32===n,"invalid kdf.dklen","kdf.dflen",n),{name:"scrypt",salt:t,N:c,r:f,p:d,dkLen:64}}if("pbkdf2"===a.toLowerCase()){const a=uc(e,"crypto.kdfparams.salt:data!"),t=uc(e,"crypto.kdfparams.prf:string!"),c=t.split("-").pop();(0,r.MR)("sha256"===c||"sha512"===c,"invalid kdf.pdf","kdf.pdf",t);const f=uc(e,"crypto.kdfparams.c:int!"),d=uc(e,"crypto.kdfparams.dklen:int!");return(0,r.MR)(32===d,"invalid kdf.dklen","kdf.dklen",d),{name:"pbkdf2",salt:a,count:f,dkLen:d,algorithm:c}}}(0,r.MR)(!1,"unsupported key-derivation function","kdf",a)}function yc(e){return new Promise((a=>{setTimeout((()=>{a()}),e)}))}function Ac(e){const a=null!=e.salt?(0,d.q5)(e.salt,"options.salt"):Ja(32);let t=1<<17,c=8,f=1;return e.scrypt&&(e.scrypt.N&&(t=e.scrypt.N),e.scrypt.r&&(c=e.scrypt.r),e.scrypt.p&&(f=e.scrypt.p)),(0,r.MR)("number"==typeof t&&t>0&&Number.isSafeInteger(t)&&(BigInt(t)&BigInt(t-1))===BigInt(0),"invalid scrypt N parameter","options.N",t),(0,r.MR)("number"==typeof c&&c>0&&Number.isSafeInteger(c),"invalid scrypt r parameter","options.r",c),(0,r.MR)("number"==typeof f&&f>0&&Number.isSafeInteger(f),"invalid scrypt p parameter","options.p",f),{name:"scrypt",dkLen:32,salt:a,N:t,r:c,p:f}}function vc(e,a,t,c){const f=(0,d.q5)(t.privateKey,"privateKey"),n=null!=c.iv?(0,d.q5)(c.iv,"options.iv"):Ja(16);(0,r.MR)(16===n.length,"invalid options.iv length","options.iv",c.iv);const i=null!=c.uuid?(0,d.q5)(c.uuid,"options.uuid"):Ja(16);(0,r.MR)(16===i.length,"invalid options.uuid length","options.uuid",c.iv);const b=e.slice(0,16),o=e.slice(16,32),s=new zt(b,n),l=(0,d.q5)(s.encrypt(f)),u=(0,C.S)((0,d.xW)([o,l])),h={address:t.address.substring(2).toLowerCase(),id:bc(i),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,d.c$)(n).substring(2)},ciphertext:(0,d.c$)(l).substring(2),kdf:"scrypt",kdfparams:{salt:(0,d.c$)(a.salt).substring(2),n:a.N,dklen:32,p:a.p,r:a.r},mac:u.substring(2)}};if(t.mnemonic){const a=null!=c.client?c.client:`ethers/${hc.r}`,f=t.mnemonic.path||pc,r=t.mnemonic.locale||"en",n=e.slice(32,64),i=(0,d.q5)(t.mnemonic.entropy,"account.mnemonic.entropy"),b=Ja(16),o=new zt(n,b),s=(0,d.q5)(o.encrypt(i)),l=new Date,u="UTC--"+l.getUTCFullYear()+"-"+sc(l.getUTCMonth()+1,2)+"-"+sc(l.getUTCDate(),2)+"T"+sc(l.getUTCHours(),2)+"-"+sc(l.getUTCMinutes(),2)+"-"+sc(l.getUTCSeconds(),2)+".0Z--"+h.address;h["x-ethers"]={client:a,gethFilename:u,path:f,locale:r,mnemonicCounter:(0,d.c$)(b).substring(2),mnemonicCiphertext:(0,d.c$)(s).substring(2),version:"0.1"}}return JSON.stringify(h)}function wc(e,a,t){null==t&&(t={});const c=lc(a),f=Ac(t),r=ic(c,f.salt,f.N,f.r,f.p,64);return vc((0,d.q5)(r),f,e,t)}async function _c(e,a,t){null==t&&(t={});const c=lc(a),f=Ac(t),r=await nc(c,f.salt,f.N,f.r,f.p,64,t.progressCallback);return vc((0,d.q5)(r),f,e,t)}const Ic="m/44'/60'/0'/0/0",Ec=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Cc=2147483648,Mc=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function Bc(e,a){let t="";for(;e;)t="0123456789abcdef"[e%16]+t,e=Math.trunc(e/16);for(;t.length<2*a;)t="0"+t;return"0x"+t}function Lc(e){const a=(0,d.q5)(e),t=(0,d.ZG)((0,va.s)((0,va.s)(a)),0,4);return ae((0,d.xW)([a,t]))}const Sc={};function kc(e,a,t,c){const f=new Uint8Array(37);e&Cc?((0,r.vA)(null!=c,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),f.set((0,d.q5)(c),1)):f.set((0,d.q5)(t));for(let a=24;a>=0;a-=8)f[33+(a>>3)]=e>>24-a&255;const n=(0,d.q5)(Ca("sha512",a,f));return{IL:n.slice(0,32),IR:n.slice(32)}}function Nc(e,a){const t=a.split("/");(0,r.MR)(t.length>0,"invalid path","path",a),"m"===t[0]&&((0,r.MR)(0===e.depth,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,"path",a),t.shift());let c=e;for(let e=0;e=16&&t.length<=64,"invalid seed","seed","[REDACTED]");const c=(0,d.q5)(Ca("sha512",Ec,t)),f=new xa.h((0,d.c$)(c.slice(0,32)));return new Pc(Sc,f,"0x00000000",(0,d.c$)(c.slice(32)),"m",0,0,a,null)}static fromExtendedKey(e){const a=(0,M.c4)(function(e){let a=X;for(let t=0;t16)throw new TypeError("PKCS#7 padding byte out of range");const t=e.length-a;for(let c=0;c{setTimeout((()=>{a()}),e)}))}class Fc extends Aa{constructor(e,a){"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),super("string"==typeof e?new xa.h(e):e,a)}connect(e){return new Fc(this.signingKey,e)}async encrypt(e,a){const t={address:this.address,privateKey:this.privateKey};return await _c(t,e,{progressCallback:a})}encryptSync(e){return wc({address:this.address,privateKey:this.privateKey},e)}static#Le(e){if((0,r.MR)(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&"en"===e.mnemonic.locale){const a=st.fromEntropy(e.mnemonic.entropy),t=Pc.fromMnemonic(a,e.mnemonic.path);if(t.address===e.address&&t.privateKey===e.privateKey)return t;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const a=new Fc(e.privateKey);return(0,r.MR)(a.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),a}static async fromEncryptedJson(e,a,t){let c=null;return gc(e)?c=await async function(e,a,t){const c=JSON.parse(e),f=lc(a),d=xc(c);if("pbkdf2"===d.name){t&&(t(0),await yc(0));const{salt:e,count:a,dkLen:r,algorithm:n}=d,i=rt(f,e,a,r,n);return t&&(t(1),await yc(0)),mc(c,i)}(0,r.vA)("scrypt"===d.name,"cannot be reached","UNKNOWN_ERROR",{params:d});const{salt:n,N:i,r:b,p:o,dkLen:s}=d;return mc(c,await nc(f,n,i,b,o,s,t))}(e,a,t):Oc(e)&&(t&&(t(0),await Tc(0)),c=Dc(e,a),t&&(t(1),await Tc(0))),Fc.#Le(c)}static fromEncryptedJsonSync(e,a){let t=null;return gc(e)?t=function(e,a){const t=JSON.parse(e),c=lc(a),f=xc(t);if("pbkdf2"===f.name){const{salt:e,count:a,dkLen:d,algorithm:r}=f;return mc(t,rt(c,e,a,d,r))}(0,r.vA)("scrypt"===f.name,"cannot be reached","UNKNOWN_ERROR",{params:f});const{salt:d,N:n,r:i,p:b,dkLen:o}=f;return mc(t,ic(c,d,n,i,b,o))}(e,a):Oc(e)?t=Dc(e,a):(0,r.MR)(!1,"invalid JSON wallet","json","[ REDACTED ]"),Fc.#Le(t)}static createRandom(e){const a=Pc.createRandom();return e?a.connect(e):a}static fromPhrase(e,a){const t=Pc.fromPhrase(e);return a?t.connect(a):t}}class Qc extends ha{#A;constructor(e,a,t){const c=Object.assign({},null!=t?t:{},{batchMaxCount:1});(0,r.MR)(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(a,c),this.#A=async(a,t)=>{const c={method:a,params:t};this.emit("debug",{action:"sendEip1193Request",payload:c});try{const a=await e.request(c);return this.emit("debug",{action:"receiveEip1193Result",result:a}),a}catch(e){const a=new Error(e.message);throw a.code=e.code,a.data=e.data,a.payload=c,this.emit("debug",{action:"receiveEip1193Error",error:a}),a}}}async send(e,a){return await this._start(),await super.send(e,a)}async _send(e){(0,r.MR)(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const a=await this.#A(e.method,e.params||[]);return[{id:e.id,result:a}]}catch(a){return[{id:e.id,error:{code:a.code,data:a.data,message:a.message}}]}}getRpcError(e,a){switch((a=JSON.parse(JSON.stringify(a))).error.code||-1){case 4001:a.error.message=`ethers-user-denied: ${a.error.message}`;break;case 4200:a.error.message=`ethers-unsupported: ${a.error.message}`}return super.getRpcError(e,a)}async hasSigner(e){null==e&&(e=0);const a=await this.send("eth_accounts",[]);return"number"==typeof e?a.length>e:(e=e.toLowerCase(),0!==a.filter((a=>a.toLowerCase()===e)).length)}async getSigner(e){if(null==e&&(e=0),!await this.hasSigner(e))try{await this.#A("eth_requestAccounts",[])}catch(e){const a=e.payload;throw this.getRpcError(a,{id:a.id,error:e})}return await super.getSigner(e)}}var Uc=t(67418),jc=Object.defineProperty,Hc=Object.defineProperties,$c=Object.getOwnPropertyDescriptors,qc=Object.getOwnPropertySymbols,Gc=Object.getPrototypeOf,zc=Object.prototype.hasOwnProperty,Kc=Object.prototype.propertyIsEnumerable,Vc=Reflect.get,Zc=(e,a,t)=>a in e?jc(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,Jc=(e,a,t)=>Vc(Gc(e),t,a),Wc=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));const Yc="Mozilla/5.0 (Windows NT 10.0; rv:109.0) Gecko/20100101 Firefox/115.0",Xc=f();function ef({fetchUrl:e,proxyUrl:a,torPort:c,retry:f}){const{HttpProxyAgent:d}=t(60513),{HttpsProxyAgent:r}=t(2378),{SocksProxyAgent:n}=t(60290);if(c)return new n(`socks5h://tor${f}@127.0.0.1:${c}`);if(!a)return;const i=e.includes("https://");return a.includes("socks://")||a.includes("socks4://")||a.includes("socks5://")?new n(a):a.includes("http://")||a.includes("https://")?i?new r(a):new d(a):void 0}function af(e){return Wc(this,arguments,(function*(e,a={}){var t,c,f;const d=null!=(t=a.maxRetry)?t:3,r=null!=(c=a.retryOn)?c:500,n=null!=(f=a.userAgent)?f:Yc;let i,b=0;for(a.method||(a.body?a.method="POST":a.method="GET"),a.headers||(a.headers={}),Uc.Ll&&!a.headers["User-Agent"]&&(a.headers["User-Agent"]=n);b{e.abort()}),a.timeout)}!a.agent&&Uc.Ll&&(a.proxy||a.torPort)&&(a.agent=ef({fetchUrl:e,proxyUrl:a.proxy,torPort:a.torPort,retry:b})),a.debug&&"function"==typeof a.debug&&a.debug("request",{url:e,retry:b,errorObject:i,options:a});try{const t=yield Xc(e,{method:a.method,headers:a.headers,body:a.body,redirect:a.redirect,signal:a.signal,agent:a.agent});if(a.debug&&"function"==typeof a.debug&&a.debug("response",t),!t.ok){const a=`Request to ${e} failed with error code ${t.status}:\n`+(yield t.text());throw new Error(a)}if(a.returnResponse)return t;const c=t.headers.get("content-type");return(null==c?void 0:c.includes("application/json"))?yield t.json():(null==c?void 0:c.includes("text"))?yield t.text():t}catch(e){t&&clearTimeout(t),i=e,b++,yield(0,Uc.yy)(r)}finally{t&&clearTimeout(t)}}throw a.debug&&"function"==typeof a.debug&&a.debug("error",i),i}))}const tf=(e={})=>(a,t)=>Wc(void 0,null,(function*(){let c;if(t){const e=new AbortController;c=e.signal,t.addListener((()=>{e.abort()}))}const f=(d=((e,a)=>{for(var t in a||(a={}))zc.call(a,t)&&Zc(e,t,a[t]);if(qc)for(var t of qc(a))Kc.call(a,t)&&Zc(e,t,a[t]);return e})({},e),r={method:a.method||"POST",headers:a.headers,body:a.body||void 0,signal:c,returnResponse:!0},Hc(d,$c(r)));var d,r;const n=yield af(a.url,f),i={};n.headers.forEach(((e,a)=>{i[a.toLowerCase()]=e}));const b=yield n.arrayBuffer(),o=null==b?null:new Uint8Array(b);return{statusCode:n.status,statusMessage:n.statusText,headers:i,body:o}}));function cf(e,a){return Wc(this,null,(function*(){const t=new A(e);t.getUrlFunc=tf(a);const c=yield new pa(t).getNetwork(),f=Number(c.chainId);if((null==a?void 0:a.netId)&&a.netId!==f){const t=`Wrong network for ${e}, wants ${a.netId} got ${f}`;throw new Error(t)}return new pa(t,c,{staticNetwork:c,pollingInterval:(null==a?void 0:a.pollingInterval)||1e3})}))}function ff(e,a,t,c){const{networkName:f,reverseRecordsContract:d,pollInterval:r}=t,n=Boolean(d),i=new A(a);i.getUrlFunc=tf(c);const b=new Ee(f,e);return n&&b.attachPlugin(new we(null,Number(e))),b.attachPlugin(new ve),new pa(i,b,{staticNetwork:b,pollingInterval:(null==c?void 0:c.pollingInterval)||1e3*r})}const df=(e,a)=>Wc(void 0,null,(function*(){const t=e.provider;if(a.from){if(a.from!==e.address){const t=`populateTransaction: signer mismatch for tx, wants ${a.from} have ${e.address}`;throw new Error(t)}}else a.from=e.address;const[c,f]=yield Promise.all([a.maxFeePerGas||a.gasPrice?void 0:t.getFeeData(),a.nonce?void 0:t.getTransactionCount(e.address,"pending")]);if(c&&(c.maxFeePerGas?(a.type||(a.type=2),a.maxFeePerGas=c.maxFeePerGas*(BigInt(1e4)+BigInt(e.gasPriceBump))/BigInt(1e4),a.maxPriorityFeePerGas=c.maxPriorityFeePerGas,delete a.gasPrice):c.gasPrice&&(a.type||(a.type=0),a.gasPrice=c.gasPrice,delete a.maxFeePerGas,delete a.maxPriorityFeePerGas)),f&&(a.nonce=f),!a.gasLimit)try{const c=yield t.estimateGas(a);a.gasLimit=c===BigInt(21e3)?c:c*(BigInt(1e4)+BigInt(e.gasLimitBump))/BigInt(1e4)}catch(t){if(!e.gasFailover)throw t;console.log("populateTransaction: warning gas estimation failed falling back to 3M gas"),a.gasLimit=BigInt("3000000")}return a}));class rf extends Fc{constructor(e,a,{gasPriceBump:t,gasLimitBump:c,gasFailover:f,bumpNonce:d}={}){super(e,a),this.gasPriceBump=null!=t?t:0,this.gasLimitBump=null!=c?c:3e3,this.gasFailover=null!=f&&f,this.bumpNonce=null!=d&&d}static fromMnemonic(e,a,t=0,c){const f=`m/44'/60'/0'/0/${t}`,{privateKey:d}=Pc.fromPhrase(e,void 0,f);return new rf(d,a,c)}populateTransaction(e){return Wc(this,null,(function*(){const a=yield df(this,e);return this.nonce=a.nonce,Jc(rf.prototype,this,"populateTransaction").call(this,a)}))}}class nf extends ta{constructor(e,a,{gasPriceBump:t,gasLimitBump:c,gasFailover:f,bumpNonce:d}={}){super(e,a),this.gasPriceBump=null!=t?t:0,this.gasLimitBump=null!=c?c:3e3,this.gasFailover=null!=f&&f,this.bumpNonce=null!=d&&d}populateTransaction(e){return Wc(this,null,(function*(){const a=yield df(this,e);return this.nonce=a.nonce,Jc(nf.prototype,this,"populateTransaction").call(this,a)}))}}class bf extends la{constructor(e,a,{gasPriceBump:t,gasLimitBump:c,gasFailover:f,bumpNonce:d}={}){super(e,a),this.gasPriceBump=null!=t?t:0,this.gasLimitBump=null!=c?c:3e3,this.gasFailover=null!=f&&f,this.bumpNonce=null!=d&&d}sendUncheckedTransaction(e){return Wc(this,null,(function*(){return Jc(bf.prototype,this,"sendUncheckedTransaction").call(this,yield df(this,e))}))}}class of extends Qc{constructor(e,a,t){super(e,a),this.options=t}getSigner(e){return Wc(this,null,(function*(){var a,t,c,f,d,r,n,i,b;const o=(yield Jc(of.prototype,this,"getSigner").call(this,e)).address;return(null==(a=this.options)?void 0:a.webChainId)&&(null==(t=this.options)?void 0:t.connectWallet)&&Number(yield Jc(of.prototype,this,"send").call(this,"eth_chainId",[]))!==Number(null==(c=this.options)?void 0:c.webChainId)&&(yield this.options.connectWallet()),(null==(f=this.options)?void 0:f.handleNetworkChanges)&&(null==(d=null==window?void 0:window.ethereum)||d.on("chainChanged",this.options.handleNetworkChanges)),(null==(r=this.options)?void 0:r.handleAccountChanges)&&(null==(n=null==window?void 0:window.ethereum)||n.on("accountsChanged",this.options.handleAccountChanges)),(null==(i=this.options)?void 0:i.handleAccountDisconnect)&&(null==(b=null==window?void 0:window.ethereum)||b.on("disconnect",this.options.handleAccountDisconnect)),new bf(this,o,this.options)}))}}},57194:(e,a,t)=>{"use strict";t.d(a,{KN:()=>A,OR:()=>C,Ss:()=>y,XF:()=>I,c$:()=>_,pO:()=>v,sN:()=>E,zy:()=>w});var c=t(99770),f=t(30031),d=t(67418),r=t(59499),n=t(68434),i=t(7613),b=Object.defineProperty,o=Object.defineProperties,s=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,p=(e,a,t)=>a in e?b(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,g=(e,a)=>{for(var t in a||(a={}))u.call(a,t)&&p(e,t,a[t]);if(l)for(var t of l(a))h.call(a,t)&&p(e,t,a[t]);return e},m=(e,a)=>o(e,s(a)),x=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));const y=.1,A=.9,v=(0,c.g5)("500");function w({stakeBalance:e,tornadoServiceFee:a}){if(a=A)return BigInt(0);const t=1-1/(A-y)**2*(a-y)**2;return BigInt(Math.floor(Number(e||"0")*t))}function _(e,a){for(let t=0;tObject.values(e))).flat().map((e=>(0,f.b)(e)))}function E(e){const a=e.map((e=>w(e))),t=a.reduce(((e,a)=>e+a),BigInt("0"));return e[_(a,BigInt(Math.floor(Number(t)*Math.random())))]}class C{constructor({netId:e,config:a,fetchDataOptions:t}){this.netId=e,this.config=a,this.fetchDataOptions=t,this.tovarish=!1}askRelayerStatus(e){return x(this,arguments,(function*({hostname:e,url:a,relayerAddress:t}){var c,f;!a&&e?a=`https://${e.endsWith("/")?e:e+"/"}`:a&&!a.endsWith("/")?a+="/":a="";const d=yield(0,n.Fd)(`${a}status`,m(g({},this.fetchDataOptions),{headers:{"Content-Type":"application/json, application/x-www-form-urlencoded"},timeout:(null==(c=this.fetchDataOptions)?void 0:c.torPort)?1e4:3e3,maxRetry:(null==(f=this.fetchDataOptions)?void 0:f.torPort)?2:0}));if(!i.SS.compile((0,i.c_)(this.netId,this.config,this.tovarish))(d))throw new Error("Invalid status schema");const b=m(g({},d),{url:a});if(b.currentQueue>5)throw new Error("Withdrawal queue is overloaded");if(b.netId!==this.netId)throw new Error("This relayer serves a different network");if(t&&this.netId===r.zr.MAINNET&&b.rewardAccount!==t)throw new Error("The Relayer reward address must match registered address");return b}))}filterRelayer(e){return x(this,null,(function*(){var a;const t=e.hostnames[this.netId],{ensName:c,relayerAddress:d}=e;if(t)try{const r=yield this.askRelayerStatus({hostname:t,relayerAddress:d});return{netId:r.netId,url:r.url,hostname:t,ensName:c,relayerAddress:d,rewardAccount:(0,f.b)(r.rewardAccount),instances:I(r.instances),stakeBalance:e.stakeBalance,gasPrice:null==(a=r.gasPrices)?void 0:a.fast,ethPrices:r.ethPrices,currentQueue:r.currentQueue,tornadoServiceFee:r.tornadoServiceFee}}catch(e){return{hostname:t,relayerAddress:d,errorMessage:e.message,hasError:!0}}}))}getValidRelayers(e){return x(this,null,(function*(){const a=[];return{validRelayers:(yield Promise.all(e.map((e=>this.filterRelayer(e))))).filter((e=>!(!e||e.hasError&&(a.push(e),1)))),invalidRelayers:a}}))}pickWeightedRandomRelayer(e){return E(e)}tornadoWithdraw(e,a){return x(this,arguments,(function*({contract:e,proof:a,args:t},c){const{url:f}=this.selectedRelayer,r=yield(0,n.Fd)(`${f}v1/tornadoWithdraw`,m(g({},this.fetchDataOptions),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contract:e,proof:a,args:t})})),{id:b,error:o}=r;if(o)throw new Error(o);let s;const l=`${f}v1/jobs/${b}`;for(console.log(`Job submitted: ${l}\n`);!s||!["FAILED","CONFIRMED"].includes(s);){const e=yield(0,n.Fd)(l,m(g({},this.fetchDataOptions),{method:"GET",headers:{"Content-Type":"application/json"}}));if(e.error)throw new Error(o);if(!i.SS.compile(i.Us)(e))throw new Error(`${l} has an invalid job response`);const{status:a,txHash:t,confirmations:f,failedReason:r}=e;if(s!==a){if("FAILED"===a)throw new Error(`Job ${a}: ${l} failed reason: ${r}`);"SENT"===a?console.log(`Job ${a}: ${l}, txhash: ${t}\n`):"MINED"===a||"CONFIRMED"===a?console.log(`Job ${a}: ${l}, txhash: ${t}, confirmations: ${f}\n`):console.log(`Job ${a}: ${l}\n`),s=a,"function"==typeof c&&c(e)}yield(0,d.yy)(3e3)}}))}}},7613:(e,a,t)=>{"use strict";t.d(a,{SS:()=>s,c_:()=>b,Us:()=>o});var c=t(63282),f=t.n(c),d=t(59499);const r={type:"string",pattern:"^0x[a-fA-F0-9]{40}$"},n={type:"string",BN:!0},i={type:"object",properties:{rewardAccount:r,gasPrices:{type:"object",properties:{fast:{type:"number"},additionalProperties:{type:"number"}},required:["fast"]},netId:{type:"integer"},tornadoServiceFee:{type:"number",maximum:20,minimum:0},latestBlock:{type:"number"},latestBalance:{type:"string",BN:!0},version:{type:"string"},health:{type:"object",properties:{status:{const:"true"},error:{type:"string"}},required:["status"]},syncStatus:{type:"object",properties:{events:{type:"boolean"},tokenPrice:{type:"boolean"},gasPrice:{type:"boolean"}},required:["events","tokenPrice","gasPrice"]},onSyncEvents:{type:"boolean"},currentQueue:{type:"number"}},required:["rewardAccount","instances","netId","tornadoServiceFee","version","health","currentQueue"]};function b(e,a,t){const{tokens:c,optionalTokens:f,disabledTokens:b,nativeCurrency:o}=a,s=JSON.parse(JSON.stringify(i)),l=Object.keys(c).reduce(((e,a)=>{const{instanceAddress:t,tokenAddress:d,symbol:n,decimals:i,optionalInstances:o=[]}=c[a],s=Object.keys(t),l={type:"object",properties:{instanceAddress:{type:"object",properties:s.reduce(((e,a)=>(e[a]=r,e)),{}),required:s.filter((e=>!o.includes(e)))},decimals:{enum:[i]}},required:["instanceAddress","decimals"].concat(d?["tokenAddress"]:[],n?["symbol"]:[])};return d&&(l.properties.tokenAddress=r),n&&(l.properties.symbol={enum:[n]}),e.properties[a]=l,(null==f?void 0:f.includes(a))||(null==b?void 0:b.includes(a))||e.required.push(a),e}),{type:"object",properties:{},required:[]});s.properties.instances=l;const u=Object.keys(c).filter((e=>{var t,c;return e!==o&&!(null==(t=a.optionalTokens)?void 0:t.includes(e))&&!(null==(c=a.disabledTokens)?void 0:c.includes(e))}));if(e===d.zr.MAINNET&&u.push("torn"),u.length){const e={type:"object",properties:u.reduce(((e,a)=>(e[a]=n,e)),{}),required:u};s.properties.ethPrices=e,s.required.push("ethPrices")}return t&&s.required.push("gasPrices","latestBlock","latestBalance","syncStatus","onSyncEvents"),s}const o={type:"object",properties:{error:{type:"string"},id:{type:"string"},type:{type:"string"},status:{type:"string"},contract:{type:"string"},proof:{type:"string"},args:{type:"array",items:{type:"string"}},txHash:{type:"string"},confirmations:{type:"number"},failedReason:{type:"string"}},required:["id","status"]},s=new(f())({allErrors:!0});s.addKeyword({keyword:"BN",validate:(e,a)=>{try{return BigInt(a),!0}catch(e){return!1}},errors:!0})},7393:(e,a,t)=>{"use strict";t.d(a,{H:()=>i});var c=t(98982),f=t(21278),d=t(67418),r=t(48486),n=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));function i(e){return n(this,arguments,(function*({provider:e,Multicall:a,currencyName:t,userAddress:n,tokenAddresses:i=[]}){const b=i.map((a=>{const t=f.Xc.connect(a,e);return[{contract:t,name:"balanceOf",params:[n]},{contract:t,name:"name"},{contract:t,name:"symbol"},{contract:t,name:"decimals"}]})).flat(),o=yield(0,r.C)(a,[{contract:a,name:"getEthBalance",params:[n]},...b.length?b:[]]),s=o[0],l=(o.slice(1).length?(0,d.iv)(o.slice(1),b.length/i.length):[]).map(((e,a)=>{const[t,c,f,d]=e;return{address:i[a],name:c,symbol:f,decimals:Number(d),balance:t}}));return[{address:c.j,name:t,symbol:t,decimals:18,balance:s},...l]}))}},96838:(e,a,t)=>{"use strict";t.d(a,{E:()=>x,o:()=>m});var c=t(30031),f=t(57194),d=t(68434),r=Object.defineProperty,n=Object.defineProperties,i=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=Reflect.get,h=(e,a,t)=>a in e?r(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,p=(e,a)=>{for(var t in a||(a={}))s.call(a,t)&&h(e,t,a[t]);if(b)for(var t of b(a))l.call(a,t)&&h(e,t,a[t]);return e},g=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));const m=5e3;class x extends f.OR{constructor({netId:e,config:a,fetchDataOptions:t}){super({netId:e,config:a,fetchDataOptions:t}),this.tovarish=!0}askRelayerStatus(e){return g(this,arguments,(function*({hostname:e,url:a,relayerAddress:t}){const c=yield(f=x.prototype,u(o(f),"askRelayerStatus",this)).call(this,{hostname:e,url:a,relayerAddress:t});var f;if(!c.version.includes("tovarish"))throw new Error("Not a tovarish relayer!");return c}))}filterRelayer(e){return g(this,null,(function*(){var a;const{ensName:t,relayerAddress:d,tovarishHost:r,tovarishNetworks:n}=e;if(r&&(null==n?void 0:n.includes(this.netId)))try{const n=yield this.askRelayerStatus({hostname:r,relayerAddress:d});return{netId:n.netId,url:n.url,hostname:r,ensName:t,relayerAddress:d,rewardAccount:(0,c.b)(n.rewardAccount),instances:(0,f.XF)(n.instances),stakeBalance:e.stakeBalance,gasPrice:null==(a=n.gasPrices)?void 0:a.fast,ethPrices:n.ethPrices,currentQueue:n.currentQueue,tornadoServiceFee:n.tornadoServiceFee,latestBlock:Number(n.latestBlock),latestBalance:n.latestBalance,version:n.version,events:n.events,syncStatus:n.syncStatus}}catch(e){return{hostname:r,relayerAddress:d,errorMessage:e.message,hasError:!0}}}))}getValidRelayers(e){return g(this,null,(function*(){const a=[];return{validRelayers:(yield Promise.all(e.map((e=>this.filterRelayer(e))))).filter((e=>!(!e||e.hasError&&(a.push(e),1)))),invalidRelayers:a}}))}getEvents(e){return g(this,arguments,(function*({type:e,currency:a,amount:t,fromBlock:c,recent:f}){var r;const b=`${null==(r=this.selectedRelayer)?void 0:r.url}events`;try{const r=[];let l=c;for(;;){let{events:u,lastSyncBlock:h}=yield(0,d.Fd)(b,(o=p({},this.fetchDataOptions),s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e,currency:a,amount:t,fromBlock:c,recent:f})},n(o,i(s))));if(l=h,!Array.isArray(u)||!u.length)break;u=u.sort(((e,a)=>e.blockNumber===a.blockNumber?e.logIndex-a.logIndex:e.blockNumber-a.blockNumber));const[g]=u.slice(-1);if(u.lengthe.blockNumber!==g.blockNumber)),c=Number(g.blockNumber),r.push(...u)}return{events:r,lastSyncBlock:l}}catch(e){return console.log("Error from TovarishClient events endpoint"),console.log(e),{events:[],lastSyncBlock:c}}var o,s}))}}},21278:(e,a,t)=>{"use strict";t.d(a,{p2:()=>n,Xc:()=>b,Q2:()=>s,Hk:()=>u,Ld:()=>p,Rp:()=>m,XB:()=>c});var c={};t.r(c),t.d(c,{ENS__factory:()=>n,ERC20__factory:()=>b,Multicall__factory:()=>s,OffchainOracle__factory:()=>u,OvmGasPriceOracle__factory:()=>p,ReverseRecords__factory:()=>m});var f=t(73622),d=t(24391);const r=[{constant:!0,inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"},{internalType:"string",name:"value",type:"string"}],name:"setText",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],name:"setPubkey",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"hash",type:"bytes"}],name:"setContenthash",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"isAuthorised",type:"bool"}],name:"setAuthorisation",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentType",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setABI",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"name",type:"string"}],name:"setName",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"},{internalType:"bytes",name:"a",type:"bytes"}],name:"setAddr",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"},{internalType:"address",name:"implementer",type:"address"}],name:"setInterface",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"authorisations",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"bool",name:"isAuthorised",type:"bool"}],name:"AuthorisationChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"}],name:"TextChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"uint256",name:"contentType",type:"uint256"}],name:"ABIChanged",type:"event"}];class n{static createInterface(){return new f.KA(r)}static connect(e,a){return new d.NZ(e,r,a)}}n.abi=r;const i=[{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"_totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"who",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"}];class b{static createInterface(){return new f.KA(i)}static connect(e,a){return new d.NZ(e,i,a)}}b.abi=i;const o=[{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes[]",name:"returnData",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3[]",name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3Value[]",name:"calls",type:"tuple[]"}],name:"aggregate3Value",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"blockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"getBasefee",outputs:[{internalType:"uint256",name:"basefee",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getBlockNumber",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getChainId",outputs:[{internalType:"uint256",name:"chainid",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockCoinbase",outputs:[{internalType:"address",name:"coinbase",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockDifficulty",outputs:[{internalType:"uint256",name:"difficulty",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockGasLimit",outputs:[{internalType:"uint256",name:"gaslimit",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"getEthBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"tryAggregate",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"tryBlockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"}];class s{static createInterface(){return new f.KA(o)}static connect(e,a){return new d.NZ(e,o,a)}}s.abi=o;const l=[{inputs:[{internalType:"contract MultiWrapper",name:"_multiWrapper",type:"address"},{internalType:"contract IOracle[]",name:"existingOracles",type:"address[]"},{internalType:"enum OffchainOracle.OracleType[]",name:"oracleTypes",type:"uint8[]"},{internalType:"contract IERC20[]",name:"existingConnectors",type:"address[]"},{internalType:"contract IERC20",name:"wBase",type:"address"},{internalType:"address",name:"owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ArraysLengthMismatch",type:"error"},{inputs:[],name:"ConnectorAlreadyAdded",type:"error"},{inputs:[],name:"InvalidOracleTokenKind",type:"error"},{inputs:[],name:"OracleAlreadyAdded",type:"error"},{inputs:[],name:"SameTokens",type:"error"},{inputs:[],name:"TooBigThreshold",type:"error"},{inputs:[],name:"UnknownConnector",type:"error"},{inputs:[],name:"UnknownOracle",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IERC20",name:"connector",type:"address"}],name:"ConnectorAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IERC20",name:"connector",type:"address"}],name:"ConnectorRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract MultiWrapper",name:"multiWrapper",type:"address"}],name:"MultiWrapperUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IOracle",name:"oracle",type:"address"},{indexed:!1,internalType:"enum OffchainOracle.OracleType",name:"oracleType",type:"uint8"}],name:"OracleAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IOracle",name:"oracle",type:"address"},{indexed:!1,internalType:"enum OffchainOracle.OracleType",name:"oracleType",type:"uint8"}],name:"OracleRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[{internalType:"contract IERC20",name:"connector",type:"address"}],name:"addConnector",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IOracle",name:"oracle",type:"address"},{internalType:"enum OffchainOracle.OracleType",name:"oracleKind",type:"uint8"}],name:"addOracle",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"connectors",outputs:[{internalType:"contract IERC20[]",name:"allConnectors",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"contract IERC20",name:"dstToken",type:"address"},{internalType:"bool",name:"useWrappers",type:"bool"}],name:"getRate",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"bool",name:"useSrcWrappers",type:"bool"}],name:"getRateToEth",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"bool",name:"useSrcWrappers",type:"bool"},{internalType:"contract IERC20[]",name:"customConnectors",type:"address[]"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateToEthWithCustomConnectors",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"bool",name:"useSrcWrappers",type:"bool"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateToEthWithThreshold",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"contract IERC20",name:"dstToken",type:"address"},{internalType:"bool",name:"useWrappers",type:"bool"},{internalType:"contract IERC20[]",name:"customConnectors",type:"address[]"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateWithCustomConnectors",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"contract IERC20",name:"dstToken",type:"address"},{internalType:"bool",name:"useWrappers",type:"bool"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateWithThreshold",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"multiWrapper",outputs:[{internalType:"contract MultiWrapper",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"oracles",outputs:[{internalType:"contract IOracle[]",name:"allOracles",type:"address[]"},{internalType:"enum OffchainOracle.OracleType[]",name:"oracleTypes",type:"uint8[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"connector",type:"address"}],name:"removeConnector",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IOracle",name:"oracle",type:"address"},{internalType:"enum OffchainOracle.OracleType",name:"oracleKind",type:"uint8"}],name:"removeOracle",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract MultiWrapper",name:"_multiWrapper",type:"address"}],name:"setMultiWrapper",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];class u{static createInterface(){return new f.KA(l)}static connect(e,a){return new d.NZ(e,l,a)}}u.abi=l;const h=[{inputs:[{internalType:"address",name:"_owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"DecimalsUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"GasPriceUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"L1BaseFeeUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"OverheadUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"ScalarUpdated",type:"event"},{inputs:[],name:"decimals",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"gasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"getL1Fee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"getL1GasUsed",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"l1BaseFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"overhead",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"scalar",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_decimals",type:"uint256"}],name:"setDecimals",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_gasPrice",type:"uint256"}],name:"setGasPrice",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_baseFee",type:"uint256"}],name:"setL1BaseFee",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_overhead",type:"uint256"}],name:"setOverhead",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_scalar",type:"uint256"}],name:"setScalar",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];class p{static createInterface(){return new f.KA(h)}static connect(e,a){return new d.NZ(e,h,a)}}p.abi=h;const g=[{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address[]",name:"addresses",type:"address[]"}],name:"getNames",outputs:[{internalType:"string[]",name:"r",type:"string[]"}],stateMutability:"view",type:"function"}];class m{static createInterface(){return new f.KA(g)}static connect(e,a){return new d.NZ(e,g,a)}}m.abi=g},67418:(e,a,t)=>{"use strict";t.d(a,{$W:()=>w,EI:()=>v,Et:()=>i,Id:()=>l,Ju:()=>x,Kp:()=>p,Ll:()=>n,My:()=>g,aT:()=>m,ae:()=>A,br:()=>M,gn:()=>E,ib:()=>I,if:()=>h,iv:()=>b,jm:()=>y,lY:()=>u,sY:()=>_,uU:()=>C,wv:()=>s,yy:()=>o});var c=t(91565),f=t(39404),d=t.n(f),r=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));BigInt.prototype.toJSON=function(){return this.toString()};const n=!process.browser&&void 0===globalThis.window,i=n?c.webcrypto:globalThis.crypto,b=(e,a)=>[...Array(Math.ceil(e.length/a))].map(((t,c)=>e.slice(a*c,a+a*c)));function o(e){return new Promise((a=>setTimeout(a,e)))}function s(e,a){try{const t=new URL(e);return!a||!a.length||a.map((e=>e.toLowerCase())).includes(t.protocol)}catch(e){return!1}}function l(...e){const a=e.reduce(((e,a)=>e+a.length),0),t=new Uint8Array(a);return e.forEach(((e,a,c)=>{const f=c.slice(0,a).reduce(((e,a)=>e+a.length),0);t.set(e,f)})),t}function u(e){return new Uint8Array(e.buffer)}function h(e){return btoa(e.reduce(((e,a)=>e+String.fromCharCode(a)),""))}function p(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function g(e){return"0x"+Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("")}function m(e){return"0x"===e.slice(0,2)&&(e=e.replace("0x","")),e.length%2!=0&&(e="0"+e),Uint8Array.from(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))}function x(e){return BigInt(g(e))}function y(e){let a="bigint"==typeof e?e.toString(16):e;return a.startsWith("0x")&&(a=a.replace("0x","")),a.length%2!=0&&(a="0"+a),Uint8Array.from(a.match(/.{1,2}/g).map((e=>parseInt(e,16))))}function A(e){return new(d())(e,16,"le")}function v(e){return Uint8Array.from(new(d())(e).toArray("le",31))}function w(e,a=32){return"0x"+BigInt(e).toString(16).padStart(2*a,"0")}function _(e,a=32){return"0x"+(e=e.replace("0x","")).padStart(2*a,"0")}function I(e=31){return x(i.getRandomValues(new Uint8Array(e)))}function E(e,a){return"bigint"==typeof a?a.toString():a}function C(e,a=10){return e.length<2*a?e:`${e.substring(0,a)}...${e.substring(e.length-a)}`}function M(e,a="SHA-384"){return r(this,null,(function*(){return new Uint8Array(yield i.subtle.digest(a,e))}))}},26746:(e,a,t)=>{"use strict";t.d(a,{O:()=>b,i:()=>o});var c=t(84276),f=t(36336),d=t.n(f),r=t(67418),n=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));let i;function b(){return n(this,null,(function*(){i||(i=yield d()({wasmInitialMemory:2e3}))}))}function o(e,a,t){return n(this,null,(function*(){i||(yield b());const f={root:e.root,nullifierHash:BigInt(e.nullifierHex).toString(),recipient:BigInt(e.recipient),relayer:BigInt(e.relayer),fee:e.fee,refund:e.refund,nullifier:e.nullifier,secret:e.secret,pathElements:e.pathElements,pathIndices:e.pathIndices};console.log("Start generating SNARK proof",f),console.time("SNARK proof time");const d=yield c.genWitnessAndProve(yield i,f,a,t),n=c.toSolidityInput(d).proof;return console.timeEnd("SNARK proof time"),{proof:n,args:[(0,r.$W)(e.root,32),(0,r.$W)(e.nullifierHex,32),e.recipient,e.relayer,(0,r.$W)(e.fee,32),(0,r.$W)(e.refund,32)]}}))}},32019:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.keccak512=a.keccak384=a.keccak256=a.keccak224=void 0;const c=t(32955),f=t(82672);a.keccak224=(0,f.wrapHash)(c.keccak_224),a.keccak256=(()=>{const e=(0,f.wrapHash)(c.keccak_256);return e.create=c.keccak_256.create,e})(),a.keccak384=(0,f.wrapHash)(c.keccak_384),a.keccak512=(0,f.wrapHash)(c.keccak_512)},26513:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.secp256k1=void 0;var c=t(8510);Object.defineProperty(a,"secp256k1",{enumerable:!0,get:function(){return c.secp256k1}})},82672:function(e,a,t){"use strict";e=t.nmd(e);var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.crypto=a.utf8ToBytes=a.createView=a.concatBytes=a.toHex=a.bytesToHex=a.assertBytes=a.assertBool=void 0,a.bytesToUtf8=function(e){if(!(e instanceof Uint8Array))throw new TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)},a.hexToBytes=function(e){const a=e.startsWith("0x")?e.substring(2):e;return(0,d.hexToBytes)(a)},a.equalsBytes=function(e,a){if(e.length!==a.length)return!1;for(let t=0;t(f.default.bytes(a),e(a))};const f=c(t(67557)),d=t(99175),r=f.default.bool;a.assertBool=r;const n=f.default.bytes;a.assertBytes=n;var i=t(99175);Object.defineProperty(a,"bytesToHex",{enumerable:!0,get:function(){return i.bytesToHex}}),Object.defineProperty(a,"toHex",{enumerable:!0,get:function(){return i.bytesToHex}}),Object.defineProperty(a,"concatBytes",{enumerable:!0,get:function(){return i.concatBytes}}),Object.defineProperty(a,"createView",{enumerable:!0,get:function(){return i.createView}}),Object.defineProperty(a,"utf8ToBytes",{enumerable:!0,get:function(){return i.utf8ToBytes}}),a.crypto=(()=>{const a="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,t="function"==typeof e.require&&e.require.bind(e);return{node:t&&!a?t("crypto"):void 0,web:a}})()},37007:e=>{"use strict";var a,t="object"==typeof Reflect?Reflect:null,c=t&&"function"==typeof t.apply?t.apply:function(e,a,t){return Function.prototype.apply.call(e,a,t)};a=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var f=Number.isNaN||function(e){return e!=e};function d(){d.init.call(this)}e.exports=d,e.exports.once=function(e,a){return new Promise((function(t,c){function f(t){e.removeListener(a,d),c(t)}function d(){"function"==typeof e.removeListener&&e.removeListener("error",f),t([].slice.call(arguments))}p(e,a,d,{once:!0}),"error"!==a&&function(e,a){"function"==typeof e.on&&p(e,"error",a,{once:!0})}(e,f)}))},d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var r=10;function n(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function i(e){return void 0===e._maxListeners?d.defaultMaxListeners:e._maxListeners}function b(e,a,t,c){var f,d,r,b;if(n(t),void 0===(d=e._events)?(d=e._events=Object.create(null),e._eventsCount=0):(void 0!==d.newListener&&(e.emit("newListener",a,t.listener?t.listener:t),d=e._events),r=d[a]),void 0===r)r=d[a]=t,++e._eventsCount;else if("function"==typeof r?r=d[a]=c?[t,r]:[r,t]:c?r.unshift(t):r.push(t),(f=i(e))>0&&r.length>f&&!r.warned){r.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=a,o.count=r.length,b=o,console&&console.warn&&console.warn(b)}return e}function o(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(e,a,t){var c={fired:!1,wrapFn:void 0,target:e,type:a,listener:t},f=o.bind(c);return f.listener=t,c.wrapFn=f,f}function l(e,a,t){var c=e._events;if(void 0===c)return[];var f=c[a];return void 0===f?[]:"function"==typeof f?t?[f.listener||f]:[f]:t?function(e){for(var a=new Array(e.length),t=0;t0&&(r=a[0]),r instanceof Error)throw r;var n=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw n.context=r,n}var i=d[e];if(void 0===i)return!1;if("function"==typeof i)c(i,this,a);else{var b=i.length,o=h(i,b);for(t=0;t=0;d--)if(t[d]===a||t[d].listener===a){r=t[d].listener,f=d;break}if(f<0)return this;0===f?t.shift():function(e,a){for(;a+1=0;c--)this.removeListener(e,a[c]);return this},d.prototype.listeners=function(e){return l(this,e,!0)},d.prototype.rawListeners=function(e){return l(this,e,!1)},d.listenerCount=function(e,a){return"function"==typeof e.listenerCount?e.listenerCount(a):u.call(e,a)},d.prototype.listenerCount=u,d.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},68078:(e,a,t)=>{var c=t(92861).Buffer,f=t(88276);e.exports=function(e,a,t,d){if(c.isBuffer(e)||(e=c.from(e,"binary")),a&&(c.isBuffer(a)||(a=c.from(a,"binary")),8!==a.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var r=t/8,n=c.alloc(r),i=c.alloc(d||0),b=c.alloc(0);r>0||d>0;){var o=new f;o.update(b),o.update(e),a&&o.update(a),b=o.digest();var s=0;if(r>0){var l=n.length-r;s=Math.min(r,b.length),b.copy(n,l,0,s),r-=s}if(s0){var u=i.length-d,h=Math.min(d,b.length-s);b.copy(i,u,s,s+h),d-=h}}return b.fill(0),{key:n,iv:i}}},32017:e=>{"use strict";e.exports=function e(a,t){if(a===t)return!0;if(a&&t&&"object"==typeof a&&"object"==typeof t){if(a.constructor!==t.constructor)return!1;var c,f,d;if(Array.isArray(a)){if((c=a.length)!=t.length)return!1;for(f=c;0!=f--;)if(!e(a[f],t[f]))return!1;return!0}if(a.constructor===RegExp)return a.source===t.source&&a.flags===t.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===t.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===t.toString();if((c=(d=Object.keys(a)).length)!==Object.keys(t).length)return!1;for(f=c;0!=f--;)if(!Object.prototype.hasOwnProperty.call(t,d[f]))return!1;for(f=c;0!=f--;){var r=d[f];if(!e(a[r],t[r]))return!1}return!0}return a!=a&&t!=t}},82682:(e,a,t)=>{"use strict";var c=t(69600),f=Object.prototype.toString,d=Object.prototype.hasOwnProperty;e.exports=function(e,a,t){if(!c(a))throw new TypeError("iterator must be a function");var r;arguments.length>=3&&(r=t),"[object Array]"===f.call(e)?function(e,a,t){for(var c=0,f=e.length;c{"use strict";var a=Object.prototype.toString,t=Math.max,c=function(e,a){for(var t=[],c=0;c{"use strict";var c=t(89353);e.exports=Function.prototype.bind||c},70453:(e,a,t)=>{"use strict";var c,f=t(69383),d=t(41237),r=t(79290),n=t(79538),i=t(58068),b=t(69675),o=t(35345),s=Function,l=function(e){try{return s('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var h=function(){throw new b},p=u?function(){try{return h}catch(e){try{return u(arguments,"callee").get}catch(e){return h}}}():h,g=t(64039)(),m=t(80024)(),x=Object.getPrototypeOf||(m?function(e){return e.__proto__}:null),y={},A="undefined"!=typeof Uint8Array&&x?x(Uint8Array):c,v={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?c:ArrayBuffer,"%ArrayIteratorPrototype%":g&&x?x([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?c:Atomics,"%BigInt%":"undefined"==typeof BigInt?c:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?c:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?c:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":f,"%eval%":eval,"%EvalError%":d,"%Float32Array%":"undefined"==typeof Float32Array?c:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?c:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?c:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?c:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?c:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&x?x(x([][Symbol.iterator]())):c,"%JSON%":"object"==typeof JSON?JSON:c,"%Map%":"undefined"==typeof Map?c:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&x?x((new Map)[Symbol.iterator]()):c,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?c:Promise,"%Proxy%":"undefined"==typeof Proxy?c:Proxy,"%RangeError%":r,"%ReferenceError%":n,"%Reflect%":"undefined"==typeof Reflect?c:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?c:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&x?x((new Set)[Symbol.iterator]()):c,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&x?x(""[Symbol.iterator]()):c,"%Symbol%":g?Symbol:c,"%SyntaxError%":i,"%ThrowTypeError%":p,"%TypedArray%":A,"%TypeError%":b,"%Uint8Array%":"undefined"==typeof Uint8Array?c:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?c:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?c:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?c:Uint32Array,"%URIError%":o,"%WeakMap%":"undefined"==typeof WeakMap?c:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?c:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?c:WeakSet};if(x)try{null.error}catch(e){var w=x(x(e));v["%Error.prototype%"]=w}var _=function e(a){var t;if("%AsyncFunction%"===a)t=l("async function () {}");else if("%GeneratorFunction%"===a)t=l("function* () {}");else if("%AsyncGeneratorFunction%"===a)t=l("async function* () {}");else if("%AsyncGenerator%"===a){var c=e("%AsyncGeneratorFunction%");c&&(t=c.prototype)}else if("%AsyncIteratorPrototype%"===a){var f=e("%AsyncGenerator%");f&&x&&(t=x(f.prototype))}return v[a]=t,t},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},E=t(66743),C=t(9957),M=E.call(Function.call,Array.prototype.concat),B=E.call(Function.apply,Array.prototype.splice),L=E.call(Function.call,String.prototype.replace),S=E.call(Function.call,String.prototype.slice),k=E.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,P=/\\(\\)?/g,R=function(e,a){var t,c=e;if(C(I,c)&&(c="%"+(t=I[c])[0]+"%"),C(v,c)){var f=v[c];if(f===y&&(f=_(c)),void 0===f&&!a)throw new b("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:t,name:c,value:f}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,a){if("string"!=typeof e||0===e.length)throw new b("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof a)throw new b('"allowMissing" argument must be a boolean');if(null===k(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=function(e){var a=S(e,0,1),t=S(e,-1);if("%"===a&&"%"!==t)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==a)throw new i("invalid intrinsic syntax, expected opening `%`");var c=[];return L(e,N,(function(e,a,t,f){c[c.length]=t?L(f,P,"$1"):a||e})),c}(e),c=t.length>0?t[0]:"",f=R("%"+c+"%",a),d=f.name,r=f.value,n=!1,o=f.alias;o&&(c=o[0],B(t,M([0,1],o)));for(var s=1,l=!0;s=t.length){var m=u(r,h);r=(l=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:r[h]}else l=C(r,h),r=r[h];l&&!n&&(v[d]=r)}}return r}},75795:(e,a,t)=>{"use strict";var c=t(70453)("%Object.getOwnPropertyDescriptor%",!0);if(c)try{c([],"length")}catch(e){c=null}e.exports=c},30592:(e,a,t)=>{"use strict";var c=t(30655),f=function(){return!!c};f.hasArrayLengthDefineBug=function(){if(!c)return null;try{return 1!==c([],"length",{value:1}).length}catch(e){return!0}},e.exports=f},80024:e=>{"use strict";var a={__proto__:null,foo:{}},t=Object;e.exports=function(){return{__proto__:a}.foo===a.foo&&!(a instanceof t)}},64039:(e,a,t)=>{"use strict";var c="undefined"!=typeof Symbol&&Symbol,f=t(41333);e.exports=function(){return"function"==typeof c&&"function"==typeof Symbol&&"symbol"==typeof c("foo")&&"symbol"==typeof Symbol("bar")&&f()}},41333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},a=Symbol("test"),t=Object(a);if("string"==typeof a)return!1;if("[object Symbol]"!==Object.prototype.toString.call(a))return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;for(a in e[a]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var c=Object.getOwnPropertySymbols(e);if(1!==c.length||c[0]!==a)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,a))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var f=Object.getOwnPropertyDescriptor(e,a);if(42!==f.value||!0!==f.enumerable)return!1}return!0}},49092:(e,a,t)=>{"use strict";var c=t(41333);e.exports=function(){return c()&&!!Symbol.toStringTag}},77952:(e,a,t)=>{var c=a;c.utils=t(67426),c.common=t(66166),c.sha=t(46229),c.ripemd=t(46784),c.hmac=t(28948),c.sha1=c.sha.sha1,c.sha256=c.sha.sha256,c.sha224=c.sha.sha224,c.sha384=c.sha.sha384,c.sha512=c.sha.sha512,c.ripemd160=c.ripemd.ripemd160},66166:(e,a,t)=>{"use strict";var c=t(67426),f=t(43349);function d(){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}a.BlockHash=d,d.prototype.update=function(e,a){if(e=c.toArray(e,a),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var t=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-t,e.length),0===this.pending.length&&(this.pending=null),e=c.join32(e,0,e.length-t,this.endian);for(var f=0;f>>24&255,c[f++]=e>>>16&255,c[f++]=e>>>8&255,c[f++]=255&e}else for(c[f++]=255&e,c[f++]=e>>>8&255,c[f++]=e>>>16&255,c[f++]=e>>>24&255,c[f++]=0,c[f++]=0,c[f++]=0,c[f++]=0,d=8;d{"use strict";var c=t(67426),f=t(43349);function d(e,a,t){if(!(this instanceof d))return new d(e,a,t);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(c.toArray(a,t))}e.exports=d,d.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),f(e.length<=this.blockSize);for(var a=e.length;a{"use strict";var c=t(67426),f=t(66166),d=c.rotl32,r=c.sum32,n=c.sum32_3,i=c.sum32_4,b=f.BlockHash;function o(){if(!(this instanceof o))return new o;b.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function s(e,a,t,c){return e<=15?a^t^c:e<=31?a&t|~a&c:e<=47?(a|~t)^c:e<=63?a&c|t&~c:a^(t|~c)}function l(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function u(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}c.inherits(o,b),a.ripemd160=o,o.blockSize=512,o.outSize=160,o.hmacStrength=192,o.padLength=64,o.prototype._update=function(e,a){for(var t=this.h[0],c=this.h[1],f=this.h[2],b=this.h[3],o=this.h[4],x=t,y=c,A=f,v=b,w=o,_=0;_<80;_++){var I=r(d(i(t,s(_,c,f,b),e[h[_]+a],l(_)),g[_]),o);t=o,o=b,b=d(f,10),f=c,c=I,I=r(d(i(x,s(79-_,y,A,v),e[p[_]+a],u(_)),m[_]),w),x=w,w=v,v=d(A,10),A=y,y=I}I=n(this.h[1],f,v),this.h[1]=n(this.h[2],b,w),this.h[2]=n(this.h[3],o,x),this.h[3]=n(this.h[4],t,y),this.h[4]=n(this.h[0],c,A),this.h[0]=I},o.prototype._digest=function(e){return"hex"===e?c.toHex32(this.h,"little"):c.split32(this.h,"little")};var h=[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],p=[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],g=[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],m=[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]},46229:(e,a,t)=>{"use strict";a.sha1=t(43917),a.sha224=t(47714),a.sha256=t(2287),a.sha384=t(21911),a.sha512=t(57766)},43917:(e,a,t)=>{"use strict";var c=t(67426),f=t(66166),d=t(66225),r=c.rotl32,n=c.sum32,i=c.sum32_5,b=d.ft_1,o=f.BlockHash,s=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}c.inherits(l,o),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,a){for(var t=this.W,c=0;c<16;c++)t[c]=e[a+c];for(;c{"use strict";var c=t(67426),f=t(2287);function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}c.inherits(d,f),e.exports=d,d.blockSize=512,d.outSize=224,d.hmacStrength=192,d.padLength=64,d.prototype._digest=function(e){return"hex"===e?c.toHex32(this.h.slice(0,7),"big"):c.split32(this.h.slice(0,7),"big")}},2287:(e,a,t)=>{"use strict";var c=t(67426),f=t(66166),d=t(66225),r=t(43349),n=c.sum32,i=c.sum32_4,b=c.sum32_5,o=d.ch32,s=d.maj32,l=d.s0_256,u=d.s1_256,h=d.g0_256,p=d.g1_256,g=f.BlockHash,m=[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 x(){if(!(this instanceof x))return new x;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}c.inherits(x,g),e.exports=x,x.blockSize=512,x.outSize=256,x.hmacStrength=192,x.padLength=64,x.prototype._update=function(e,a){for(var t=this.W,c=0;c<16;c++)t[c]=e[a+c];for(;c{"use strict";var c=t(67426),f=t(57766);function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}c.inherits(d,f),e.exports=d,d.blockSize=1024,d.outSize=384,d.hmacStrength=192,d.padLength=128,d.prototype._digest=function(e){return"hex"===e?c.toHex32(this.h.slice(0,12),"big"):c.split32(this.h.slice(0,12),"big")}},57766:(e,a,t)=>{"use strict";var c=t(67426),f=t(66166),d=t(43349),r=c.rotr64_hi,n=c.rotr64_lo,i=c.shr64_hi,b=c.shr64_lo,o=c.sum64,s=c.sum64_hi,l=c.sum64_lo,u=c.sum64_4_hi,h=c.sum64_4_lo,p=c.sum64_5_hi,g=c.sum64_5_lo,m=f.BlockHash,x=[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 y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=x,this.W=new Array(160)}function A(e,a,t,c,f){var d=e&t^~e&f;return d<0&&(d+=4294967296),d}function v(e,a,t,c,f,d){var r=a&c^~a&d;return r<0&&(r+=4294967296),r}function w(e,a,t,c,f){var d=e&t^e&f^t&f;return d<0&&(d+=4294967296),d}function _(e,a,t,c,f,d){var r=a&c^a&d^c&d;return r<0&&(r+=4294967296),r}function I(e,a){var t=r(e,a,28)^r(a,e,2)^r(a,e,7);return t<0&&(t+=4294967296),t}function E(e,a){var t=n(e,a,28)^n(a,e,2)^n(a,e,7);return t<0&&(t+=4294967296),t}function C(e,a){var t=n(e,a,14)^n(e,a,18)^n(a,e,9);return t<0&&(t+=4294967296),t}function M(e,a){var t=r(e,a,1)^r(e,a,8)^i(e,a,7);return t<0&&(t+=4294967296),t}function B(e,a){var t=n(e,a,1)^n(e,a,8)^b(e,a,7);return t<0&&(t+=4294967296),t}function L(e,a){var t=n(e,a,19)^n(a,e,29)^b(e,a,6);return t<0&&(t+=4294967296),t}c.inherits(y,m),e.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(e,a){for(var t=this.W,c=0;c<32;c++)t[c]=e[a+c];for(;c{"use strict";var c=t(67426).rotr32;function f(e,a,t){return e&a^~e&t}function d(e,a,t){return e&a^e&t^a&t}function r(e,a,t){return e^a^t}a.ft_1=function(e,a,t,c){return 0===e?f(a,t,c):1===e||3===e?r(a,t,c):2===e?d(a,t,c):void 0},a.ch32=f,a.maj32=d,a.p32=r,a.s0_256=function(e){return c(e,2)^c(e,13)^c(e,22)},a.s1_256=function(e){return c(e,6)^c(e,11)^c(e,25)},a.g0_256=function(e){return c(e,7)^c(e,18)^e>>>3},a.g1_256=function(e){return c(e,17)^c(e,19)^e>>>10}},67426:(e,a,t)=>{"use strict";var c=t(43349),f=t(56698);function d(e,a){return 55296==(64512&e.charCodeAt(a))&&!(a<0||a+1>=e.length)&&56320==(64512&e.charCodeAt(a+1))}function r(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function i(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}a.inherits=f,a.toArray=function(e,a){if(Array.isArray(e))return e.slice();if(!e)return[];var t=[];if("string"==typeof e)if(a){if("hex"===a)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),f=0;f>6|192,t[c++]=63&r|128):d(e,f)?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++f)),t[c++]=r>>18|240,t[c++]=r>>12&63|128,t[c++]=r>>6&63|128,t[c++]=63&r|128):(t[c++]=r>>12|224,t[c++]=r>>6&63|128,t[c++]=63&r|128)}else for(f=0;f>>0}return r},a.split32=function(e,a){for(var t=new Array(4*e.length),c=0,f=0;c>>24,t[f+1]=d>>>16&255,t[f+2]=d>>>8&255,t[f+3]=255&d):(t[f+3]=d>>>24,t[f+2]=d>>>16&255,t[f+1]=d>>>8&255,t[f]=255&d)}return t},a.rotr32=function(e,a){return e>>>a|e<<32-a},a.rotl32=function(e,a){return e<>>32-a},a.sum32=function(e,a){return e+a>>>0},a.sum32_3=function(e,a,t){return e+a+t>>>0},a.sum32_4=function(e,a,t,c){return e+a+t+c>>>0},a.sum32_5=function(e,a,t,c,f){return e+a+t+c+f>>>0},a.sum64=function(e,a,t,c){var f=e[a],d=c+e[a+1]>>>0,r=(d>>0,e[a+1]=d},a.sum64_hi=function(e,a,t,c){return(a+c>>>0>>0},a.sum64_lo=function(e,a,t,c){return a+c>>>0},a.sum64_4_hi=function(e,a,t,c,f,d,r,n){var i=0,b=a;return i+=(b=b+c>>>0)>>0)>>0)>>0},a.sum64_4_lo=function(e,a,t,c,f,d,r,n){return a+c+d+n>>>0},a.sum64_5_hi=function(e,a,t,c,f,d,r,n,i,b){var o=0,s=a;return o+=(s=s+c>>>0)>>0)>>0)>>0)>>0},a.sum64_5_lo=function(e,a,t,c,f,d,r,n,i,b){return a+c+d+n+b>>>0},a.rotr64_hi=function(e,a,t){return(a<<32-t|e>>>t)>>>0},a.rotr64_lo=function(e,a,t){return(e<<32-t|a>>>t)>>>0},a.shr64_hi=function(e,a,t){return e>>>t},a.shr64_lo=function(e,a,t){return(e<<32-t|a>>>t)>>>0}},9957:(e,a,t)=>{"use strict";var c=Function.prototype.call,f=Object.prototype.hasOwnProperty,d=t(66743);e.exports=d.call(c,f)},32723:(e,a,t)=>{"use strict";var c=t(77952),f=t(64367),d=t(43349);function r(e){if(!(this instanceof r))return new r(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var a=f.toArray(e.entropy,e.entropyEnc||"hex"),t=f.toArray(e.nonce,e.nonceEnc||"hex"),c=f.toArray(e.pers,e.persEnc||"hex");d(a.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(a,t,c)}e.exports=r,r.prototype._init=function(e,a,t){var c=e.concat(a).concat(t);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(t||[])),this._reseed=1},r.prototype.generate=function(e,a,t,c){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof a&&(c=t,t=a,a=null),t&&(t=f.toArray(t,c||"hex"),this._update(t));for(var d=[];d.length{var c=t(11568),f=t(23276),d=e.exports;for(var r in c)c.hasOwnProperty(r)&&(d[r]=c[r]);function n(e){if("string"==typeof e&&(e=f.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}d.request=function(e,a){return e=n(e),c.request.call(this,e,a)},d.get=function(e,a){return e=n(e),c.get.call(this,e,a)}},251:(e,a)=>{a.read=function(e,a,t,c,f){var d,r,n=8*f-c-1,i=(1<>1,o=-7,s=t?f-1:0,l=t?-1:1,u=e[a+s];for(s+=l,d=u&(1<<-o)-1,u>>=-o,o+=n;o>0;d=256*d+e[a+s],s+=l,o-=8);for(r=d&(1<<-o)-1,d>>=-o,o+=c;o>0;r=256*r+e[a+s],s+=l,o-=8);if(0===d)d=1-b;else{if(d===i)return r?NaN:1/0*(u?-1:1);r+=Math.pow(2,c),d-=b}return(u?-1:1)*r*Math.pow(2,d-c)},a.write=function(e,a,t,c,f,d){var r,n,i,b=8*d-f-1,o=(1<>1,l=23===f?Math.pow(2,-24)-Math.pow(2,-77):0,u=c?0:d-1,h=c?1:-1,p=a<0||0===a&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(n=isNaN(a)?1:0,r=o):(r=Math.floor(Math.log(a)/Math.LN2),a*(i=Math.pow(2,-r))<1&&(r--,i*=2),(a+=r+s>=1?l/i:l*Math.pow(2,1-s))*i>=2&&(r++,i/=2),r+s>=o?(n=0,r=o):r+s>=1?(n=(a*i-1)*Math.pow(2,f),r+=s):(n=a*Math.pow(2,s-1)*Math.pow(2,f),r=0));f>=8;e[t+u]=255&n,u+=h,n/=256,f-=8);for(r=r<0;e[t+u]=255&r,u+=h,r/=256,b-=8);e[t+u-h]|=128*p}},56698:e=>{"function"==typeof Object.create?e.exports=function(e,a){a&&(e.super_=a,e.prototype=Object.create(a.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,a){if(a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}}},47244:(e,a,t)=>{"use strict";var c=t(49092)(),f=t(38075)("Object.prototype.toString"),d=function(e){return!(c&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===f(e)},r=function(e){return!!d(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==f(e)&&"[object Function]"===f(e.callee)},n=function(){return d(arguments)}();d.isLegacyArguments=r,e.exports=n?d:r},69600:e=>{"use strict";var a,t,c=Function.prototype.toString,f="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof f&&"function"==typeof Object.defineProperty)try{a=Object.defineProperty({},"length",{get:function(){throw t}}),t={},f((function(){throw 42}),null,a)}catch(e){e!==t&&(f=null)}else f=null;var d=/^\s*class\b/,r=function(e){try{var a=c.call(e);return d.test(a)}catch(e){return!1}},n=function(e){try{return!r(e)&&(c.call(e),!0)}catch(e){return!1}},i=Object.prototype.toString,b="function"==typeof Symbol&&!!Symbol.toStringTag,o=!(0 in[,]),s=function(){return!1};if("object"==typeof document){var l=document.all;i.call(l)===i.call(document.all)&&(s=function(e){if((o||!e)&&(void 0===e||"object"==typeof e))try{var a=i.call(e);return("[object HTMLAllCollection]"===a||"[object HTML document.all class]"===a||"[object HTMLCollection]"===a||"[object Object]"===a)&&null==e("")}catch(e){}return!1})}e.exports=f?function(e){if(s(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{f(e,null,a)}catch(e){if(e!==t)return!1}return!r(e)&&n(e)}:function(e){if(s(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(b)return n(e);if(r(e))return!1;var a=i.call(e);return!("[object Function]"!==a&&"[object GeneratorFunction]"!==a&&!/^\[object HTML/.test(a))&&n(e)}},48184:(e,a,t)=>{"use strict";var c,f=Object.prototype.toString,d=Function.prototype.toString,r=/^\s*(?:function)?\*/,n=t(49092)(),i=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(r.test(d.call(e)))return!0;if(!n)return"[object GeneratorFunction]"===f.call(e);if(!i)return!1;if(void 0===c){var a=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch(e){}}();c=!!a&&i(a)}return i(e)===c}},13003:e=>{"use strict";e.exports=function(e){return e!=e}},24133:(e,a,t)=>{"use strict";var c=t(10487),f=t(38452),d=t(13003),r=t(76642),n=t(92464),i=c(r(),Number);f(i,{getPolyfill:r,implementation:d,shim:n}),e.exports=i},76642:(e,a,t)=>{"use strict";var c=t(13003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:c}},92464:(e,a,t)=>{"use strict";var c=t(38452),f=t(76642);e.exports=function(){var e=f();return c(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},35680:(e,a,t)=>{"use strict";var c=t(25767);e.exports=function(e){return!!c(e)}},31176:(e,a,t)=>{var c;!function(){"use strict";var f="input is invalid type",d="object"==typeof window,r=d?window:{};r.JS_SHA3_NO_WINDOW&&(d=!1);var n=!d&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=t.g:n&&(r=self);var i=!r.JS_SHA3_NO_COMMON_JS&&e.exports,b=t.amdO,o=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),l=[4,1024,262144,67108864],u=[0,8,16,24],h=[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],p=[224,256,384,512],g=[128,256],m=["hex","buffer","arrayBuffer","array","digest"],x={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!o||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var y=function(e,a,t){return function(c){return new R(e,a,e).update(c)[t]()}},A=function(e,a,t){return function(c,f){return new R(e,a,f).update(c)[t]()}},v=function(e,a,t){return function(a,c,f,d){return C["cshake"+e].update(a,c,f,d)[t]()}},w=function(e,a,t){return function(a,c,f,d){return C["kmac"+e].update(a,c,f,d)[t]()}},_=function(e,a,t,c){for(var f=0;f>5,this.byteCount=this.blockCount<<2,this.outputBlocks=t>>5,this.extraBytes=(31&t)>>3;for(var c=0;c<50;++c)this.s[c]=0}function O(e,a,t){R.call(this,e,a,t)}R.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var a,t=typeof e;if("string"!==t){if("object"!==t)throw new Error(f);if(null===e)throw new Error(f);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||o&&ArrayBuffer.isView(e)))throw new Error(f);a=!0}for(var c,d,r=this.blocks,n=this.byteCount,i=e.length,b=this.blockCount,s=0,l=this.s;s>2]|=e[s]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(r[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=n){for(this.start=c-n,this.block=r[b],c=0;c>=8);t>0;)f.unshift(t),t=255&(e>>=8),++c;return a?f.push(c):f.unshift(c),this.update(f),f.length},R.prototype.encodeString=function(e){var a,t=typeof e;if("string"!==t){if("object"!==t)throw new Error(f);if(null===e)throw new Error(f);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||o&&ArrayBuffer.isView(e)))throw new Error(f);a=!0}var c=0,d=e.length;if(a)c=d;else for(var r=0;r=57344?c+=3:(n=65536+((1023&n)<<10|1023&e.charCodeAt(++r)),c+=4)}return c+=this.encode(8*c),this.update(e),c},R.prototype.bytepad=function(e,a){for(var t=this.encode(a),c=0;c>2]|=this.padding[3&a],this.lastByteIndex===this.byteCount)for(e[0]=e[t],a=1;a>4&15]+s[15&e]+s[e>>12&15]+s[e>>8&15]+s[e>>20&15]+s[e>>16&15]+s[e>>28&15]+s[e>>24&15];r%a==0&&(D(t),d=0)}return f&&(e=t[d],n+=s[e>>4&15]+s[15&e],f>1&&(n+=s[e>>12&15]+s[e>>8&15]),f>2&&(n+=s[e>>20&15]+s[e>>16&15])),n},R.prototype.arrayBuffer=function(){this.finalize();var e,a=this.blockCount,t=this.s,c=this.outputBlocks,f=this.extraBytes,d=0,r=0,n=this.outputBits>>3;e=f?new ArrayBuffer(c+1<<2):new ArrayBuffer(n);for(var i=new Uint32Array(e);r>8&255,i[e+2]=a>>16&255,i[e+3]=a>>24&255;n%t==0&&D(c)}return d&&(e=n<<2,a=c[r],i[e]=255&a,d>1&&(i[e+1]=a>>8&255),d>2&&(i[e+2]=a>>16&255)),i},O.prototype=new R,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var D=function(e){var a,t,c,f,d,r,n,i,b,o,s,l,u,p,g,m,x,y,A,v,w,_,I,E,C,M,B,L,S,k,N,P,R,O,D,T,F,Q,U,j,H,$,q,G,z,K,V,Z,J,W,Y,X,ee,ae,te,ce,fe,de,re,ne,ie,be,oe;for(c=0;c<48;c+=2)f=e[0]^e[10]^e[20]^e[30]^e[40],d=e[1]^e[11]^e[21]^e[31]^e[41],r=e[2]^e[12]^e[22]^e[32]^e[42],n=e[3]^e[13]^e[23]^e[33]^e[43],i=e[4]^e[14]^e[24]^e[34]^e[44],b=e[5]^e[15]^e[25]^e[35]^e[45],o=e[6]^e[16]^e[26]^e[36]^e[46],s=e[7]^e[17]^e[27]^e[37]^e[47],a=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(r<<1|n>>>31),t=(u=e[9]^e[19]^e[29]^e[39]^e[49])^(n<<1|r>>>31),e[0]^=a,e[1]^=t,e[10]^=a,e[11]^=t,e[20]^=a,e[21]^=t,e[30]^=a,e[31]^=t,e[40]^=a,e[41]^=t,a=f^(i<<1|b>>>31),t=d^(b<<1|i>>>31),e[2]^=a,e[3]^=t,e[12]^=a,e[13]^=t,e[22]^=a,e[23]^=t,e[32]^=a,e[33]^=t,e[42]^=a,e[43]^=t,a=r^(o<<1|s>>>31),t=n^(s<<1|o>>>31),e[4]^=a,e[5]^=t,e[14]^=a,e[15]^=t,e[24]^=a,e[25]^=t,e[34]^=a,e[35]^=t,e[44]^=a,e[45]^=t,a=i^(l<<1|u>>>31),t=b^(u<<1|l>>>31),e[6]^=a,e[7]^=t,e[16]^=a,e[17]^=t,e[26]^=a,e[27]^=t,e[36]^=a,e[37]^=t,e[46]^=a,e[47]^=t,a=o^(f<<1|d>>>31),t=s^(d<<1|f>>>31),e[8]^=a,e[9]^=t,e[18]^=a,e[19]^=t,e[28]^=a,e[29]^=t,e[38]^=a,e[39]^=t,e[48]^=a,e[49]^=t,p=e[0],g=e[1],K=e[11]<<4|e[10]>>>28,V=e[10]<<4|e[11]>>>28,L=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,ne=e[31]<<9|e[30]>>>23,ie=e[30]<<9|e[31]>>>23,$=e[40]<<18|e[41]>>>14,q=e[41]<<18|e[40]>>>14,O=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,x=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,k=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,be=e[42]<<2|e[43]>>>30,oe=e[43]<<2|e[42]>>>30,ae=e[5]<<30|e[4]>>>2,te=e[4]<<30|e[5]>>>2,T=e[14]<<6|e[15]>>>26,F=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,W=e[34]<<15|e[35]>>>17,Y=e[35]<<15|e[34]>>>17,P=e[45]<<29|e[44]>>>3,R=e[44]<<29|e[45]>>>3,E=e[6]<<28|e[7]>>>4,C=e[7]<<28|e[6]>>>4,ce=e[17]<<23|e[16]>>>9,fe=e[16]<<23|e[17]>>>9,Q=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,v=e[36]<<21|e[37]>>>11,w=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,G=e[8]<<27|e[9]>>>5,z=e[9]<<27|e[8]>>>5,M=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,de=e[29]<<7|e[28]>>>25,re=e[28]<<7|e[29]>>>25,j=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,I=e[49]<<14|e[48]>>>18,e[0]=p^~m&y,e[1]=g^~x&A,e[10]=E^~M&L,e[11]=C^~B&S,e[20]=O^~T&Q,e[21]=D^~F&U,e[30]=G^~K&Z,e[31]=z^~V&J,e[40]=ae^~ce&de,e[41]=te^~fe&re,e[2]=m^~y&v,e[3]=x^~A&w,e[12]=M^~L&k,e[13]=B^~S&N,e[22]=T^~Q&j,e[23]=F^~U&H,e[32]=K^~Z&W,e[33]=V^~J&Y,e[42]=ce^~de&ne,e[43]=fe^~re&ie,e[4]=y^~v&_,e[5]=A^~w&I,e[14]=L^~k&P,e[15]=S^~N&R,e[24]=Q^~j&$,e[25]=U^~H&q,e[34]=Z^~W&X,e[35]=J^~Y&ee,e[44]=de^~ne&be,e[45]=re^~ie&oe,e[6]=v^~_&p,e[7]=w^~I&g,e[16]=k^~P&E,e[17]=N^~R&C,e[26]=j^~$&O,e[27]=H^~q&D,e[36]=W^~X&G,e[37]=Y^~ee&z,e[46]=ne^~be&ae,e[47]=ie^~oe&te,e[8]=_^~p&m,e[9]=I^~g&x,e[18]=P^~E&M,e[19]=R^~C&B,e[28]=$^~O&T,e[29]=q^~D&F,e[38]=X^~G&K,e[39]=ee^~z&V,e[48]=be^~ae&ce,e[49]=oe^~te&fe,e[0]^=h[c],e[1]^=h[c+1]};if(i)e.exports=C;else{for(B=0;B{"use strict";var a=e.exports=function(e,a,c){"function"==typeof a&&(c=a,a={}),t(a,"function"==typeof(c=a.cb||c)?c:c.pre||function(){},c.post||function(){},e,"",e)};function t(e,c,f,d,r,n,i,b,o,s){if(d&&"object"==typeof d&&!Array.isArray(d)){for(var l in c(d,r,n,i,b,o,s),d){var u=d[l];if(Array.isArray(u)){if(l in a.arrayKeywords)for(var h=0;h{"use strict";var c=t(56698),f=t(73726),d=t(92861).Buffer,r=new Array(16);function n(){f.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function i(e,a){return e<>>32-a}function b(e,a,t,c,f,d,r){return i(e+(a&t|~a&c)+f+d|0,r)+a|0}function o(e,a,t,c,f,d,r){return i(e+(a&c|t&~c)+f+d|0,r)+a|0}function s(e,a,t,c,f,d,r){return i(e+(a^t^c)+f+d|0,r)+a|0}function l(e,a,t,c,f,d,r){return i(e+(t^(a|~c))+f+d|0,r)+a|0}c(n,f),n.prototype._update=function(){for(var e=r,a=0;a<16;++a)e[a]=this._block.readInt32LE(4*a);var t=this._a,c=this._b,f=this._c,d=this._d;t=b(t,c,f,d,e[0],3614090360,7),d=b(d,t,c,f,e[1],3905402710,12),f=b(f,d,t,c,e[2],606105819,17),c=b(c,f,d,t,e[3],3250441966,22),t=b(t,c,f,d,e[4],4118548399,7),d=b(d,t,c,f,e[5],1200080426,12),f=b(f,d,t,c,e[6],2821735955,17),c=b(c,f,d,t,e[7],4249261313,22),t=b(t,c,f,d,e[8],1770035416,7),d=b(d,t,c,f,e[9],2336552879,12),f=b(f,d,t,c,e[10],4294925233,17),c=b(c,f,d,t,e[11],2304563134,22),t=b(t,c,f,d,e[12],1804603682,7),d=b(d,t,c,f,e[13],4254626195,12),f=b(f,d,t,c,e[14],2792965006,17),t=o(t,c=b(c,f,d,t,e[15],1236535329,22),f,d,e[1],4129170786,5),d=o(d,t,c,f,e[6],3225465664,9),f=o(f,d,t,c,e[11],643717713,14),c=o(c,f,d,t,e[0],3921069994,20),t=o(t,c,f,d,e[5],3593408605,5),d=o(d,t,c,f,e[10],38016083,9),f=o(f,d,t,c,e[15],3634488961,14),c=o(c,f,d,t,e[4],3889429448,20),t=o(t,c,f,d,e[9],568446438,5),d=o(d,t,c,f,e[14],3275163606,9),f=o(f,d,t,c,e[3],4107603335,14),c=o(c,f,d,t,e[8],1163531501,20),t=o(t,c,f,d,e[13],2850285829,5),d=o(d,t,c,f,e[2],4243563512,9),f=o(f,d,t,c,e[7],1735328473,14),t=s(t,c=o(c,f,d,t,e[12],2368359562,20),f,d,e[5],4294588738,4),d=s(d,t,c,f,e[8],2272392833,11),f=s(f,d,t,c,e[11],1839030562,16),c=s(c,f,d,t,e[14],4259657740,23),t=s(t,c,f,d,e[1],2763975236,4),d=s(d,t,c,f,e[4],1272893353,11),f=s(f,d,t,c,e[7],4139469664,16),c=s(c,f,d,t,e[10],3200236656,23),t=s(t,c,f,d,e[13],681279174,4),d=s(d,t,c,f,e[0],3936430074,11),f=s(f,d,t,c,e[3],3572445317,16),c=s(c,f,d,t,e[6],76029189,23),t=s(t,c,f,d,e[9],3654602809,4),d=s(d,t,c,f,e[12],3873151461,11),f=s(f,d,t,c,e[15],530742520,16),t=l(t,c=s(c,f,d,t,e[2],3299628645,23),f,d,e[0],4096336452,6),d=l(d,t,c,f,e[7],1126891415,10),f=l(f,d,t,c,e[14],2878612391,15),c=l(c,f,d,t,e[5],4237533241,21),t=l(t,c,f,d,e[12],1700485571,6),d=l(d,t,c,f,e[3],2399980690,10),f=l(f,d,t,c,e[10],4293915773,15),c=l(c,f,d,t,e[1],2240044497,21),t=l(t,c,f,d,e[8],1873313359,6),d=l(d,t,c,f,e[15],4264355552,10),f=l(f,d,t,c,e[6],2734768916,15),c=l(c,f,d,t,e[13],1309151649,21),t=l(t,c,f,d,e[4],4149444226,6),d=l(d,t,c,f,e[11],3174756917,10),f=l(f,d,t,c,e[2],718787259,15),c=l(c,f,d,t,e[9],3951481745,21),this._a=this._a+t|0,this._b=this._b+c|0,this._c=this._c+f|0,this._d=this._d+d|0},n.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 e=d.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=n},73726:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(28399).Transform;function d(e){f.call(this),this._block=c.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(56698)(d,f),d.prototype._transform=function(e,a,t){var c=null;try{this.update(e,a)}catch(e){c=e}t(c)},d.prototype._flush=function(e){var a=null;try{this.push(this.digest())}catch(e){a=e}e(a)},d.prototype.update=function(e,a){if(function(e){if(!c.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");c.isBuffer(e)||(e=c.from(e,a));for(var t=this._block,f=0;this._blockOffset+e.length-f>=this._blockSize;){for(var d=this._blockOffset;d0;++r)this._length[r]+=n,(n=this._length[r]/4294967296|0)>0&&(this._length[r]-=4294967296*n);return this},d.prototype._update=function(){throw new Error("_update is not implemented")},d.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();void 0!==e&&(a=a.toString(e)),this._block.fill(0),this._blockOffset=0;for(var t=0;t<4;++t)this._length[t]=0;return a},d.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=d},6215:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.InvalidStatusCodeError=a.InvalidCertError=void 0;const f=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class d extends Error{constructor(e,a){super(e),this.fingerprint256=a}}a.InvalidCertError=d;class r extends Error{constructor(e){super(`Request Failed. Status Code: ${e}`),this.statusCode=e}}function n(e,a){if(!a||"text"===a||"json"===a)try{let t=new TextDecoder("utf8",{fatal:!0}).decode(e);if("text"===a)return t;try{return JSON.parse(t)}catch(e){if("json"===a)throw e;return t}}catch(e){if("text"===a||"json"===a)throw e}return e}a.InvalidStatusCodeError=r;let i={};function b(e,a){let o={...f,...a};const s=t(11568),l=t(11083),u=t(78559),{promisify:h}=t(40537),{resolve:p}=t(59676),g=!!/^https/.test(e);let m={method:o.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const x=e=>e.replace(/:| /g,"").toLowerCase();if(o.keepAlive){const e={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},a=[g,g&&o.sslPinnedCertificates?.map((e=>x(e))).sort()].join();m.agent=i[a]||(i[a]=new(g?l:s).Agent(e))}return"json"===o.type&&(m.headers["Content-Type"]="application/json"),o.data&&(o.method||(m.method="POST"),m.body="json"===o.type?JSON.stringify(o.data):o.data),m.headers={...m.headers,...o.headers},o.sslAllowSelfSigned&&(m.rejectUnauthorized=!1),new Promise(((a,t)=>{const f=async a=>{if(a&&"DEPTH_ZERO_SELF_SIGNED_CERT"===a.code)try{await b(e,{...o,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(e){e&&e.fingerprint256&&(a=new d(`Self-signed SSL certificate: ${e.fingerprint256}`,e.fingerprint256))}t(a)},i=(g?l:s).request(e,m,(d=>{d.on("error",f),(async()=>{try{a(await(async a=>{const t=a.statusCode;if(o.redirect&&300<=t&&t<400&&a.headers.location){if(10==o._redirectCount)throw new Error("Request failed. Too much redirects.");return o._redirectCount+=1,await b(p(e,a.headers.location),o)}if(o.expectStatusCode&&t!==o.expectStatusCode)throw a.resume(),new r(t);let f=[];for await(const e of a)f.push(e);let d=c.concat(f);const i=a.headers["content-encoding"];"br"===i&&(d=await h(u.brotliDecompress)(d)),"gzip"!==i&&"deflate"!==i||(d=await h(u.unzip)(d));const s=n(d,o.type);return o.full?{headers:a.headers,status:t,body:s}:s})(d))}catch(e){t(e)}})()}));i.on("error",f);const y=o.sslPinnedCertificates?.map((e=>x(e))),A=e=>{const a=x(e.getPeerCertificate()?.fingerprint256||"");if((a||!e.isSessionReused())&&!y.includes(a))return i.emit("error",new d(`Invalid SSL certificate: ${a} Expected: ${y}`,a)),i.abort()};o.sslPinnedCertificates&&i.on("socket",(e=>{e.listeners("secureConnect").map((e=>(e.name||"").replace("bound ",""))).includes("mfetchSecureConnect")||e.on("secureConnect",A.bind(null,e))})),o.keepAlive&&i.setNoDelay(!0),m.body&&i.write(m.body),i.end()}))}const o=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map((e=>e.toLowerCase()))),s=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((e=>e.toLowerCase())));async function l(e,a){let t={...f,...a};const c=new Headers;"json"===t.type&&c.set("Content-Type","application/json");let d=new URL(e);if(d.username){const e=btoa(`${d.username}:${d.password}`);c.set("Authorization",`Basic ${e}`),d.username="",d.password=""}e=""+d;for(let e in t.headers){const a=e.toLowerCase();(o.has(a)||t.cors&&!s.has(a))&&c.set(e,t.headers[e])}let i={headers:c,redirect:t.redirect?"follow":"manual"};t.referrer||(i.referrerPolicy="no-referrer"),t.cors&&(i.mode="cors"),t.data&&(t.method||(i.method="POST"),i.body="json"===t.type?JSON.stringify(t.data):t.data);const b=await fetch(e,i);if(t.expectStatusCode&&b.status!==t.expectStatusCode)throw new r(b.status);const l=n(new Uint8Array(await b.arrayBuffer()),t.type);return t.full?{headers:Object.fromEntries(b.headers.entries()),status:b.status,body:l}:l}const u=!!("object"==typeof process&&process.versions&&process.versions.node&&process.versions.v8);a.default=function(e,a){return(u?b:l)(e,a)}},52244:(e,a,t)=>{var c=t(61158),f=t(15037);function d(e){this.rand=e||new f.Rand}e.exports=d,d.create=function(e){return new d(e)},d.prototype._randbelow=function(e){var a=e.bitLength(),t=Math.ceil(a/8);do{var f=new c(this.rand.generate(t))}while(f.cmp(e)>=0);return f},d.prototype._randrange=function(e,a){var t=a.sub(e);return e.add(this._randbelow(t))},d.prototype.test=function(e,a,t){var f=e.bitLength(),d=c.mont(e),r=new c(1).toRed(d);a||(a=Math.max(1,f/48|0));for(var n=e.subn(1),i=0;!n.testn(i);i++);for(var b=e.shrn(i),o=n.toRed(d);a>0;a--){var s=this._randrange(new c(2),n);t&&t(s);var l=s.toRed(d).redPow(b);if(0!==l.cmp(r)&&0!==l.cmp(o)){for(var u=1;u0;a--){var o=this._randrange(new c(2),r),s=e.gcd(o);if(0!==s.cmpn(1))return s;var l=o.toRed(f).redPow(i);if(0!==l.cmp(d)&&0!==l.cmp(b)){for(var u=1;u=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,D=R>>>13,T=0|r[9],F=8191&T,Q=T>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},43349:e=>{function a(e,a){if(!e)throw new Error(a||"Assertion failed")}e.exports=a,a.equal=function(e,a,t){if(e!=a)throw new Error(t||"Assertion failed: "+e+" != "+a)}},64367:(e,a)=>{"use strict";var t=a;function c(e){return 1===e.length?"0"+e:e}function f(e){for(var a="",t=0;t>8,r=255&f;d?t.push(d,r):t.push(r)}return t},t.zero2=c,t.toHex=f,t.encode=function(e,a){return"hex"===a?f(e):e}},6585:e=>{var a=1e3,t=60*a,c=60*t,f=24*c,d=7*f;function r(e,a,t,c){var f=a>=1.5*t;return Math.round(e/t)+" "+c+(f?"s":"")}e.exports=function(e,n){n=n||{};var i,b,o=typeof e;if("string"===o&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var n=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return n*d;case"days":case"day":case"d":return n*f;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*t;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===o&&isFinite(e))return n.long?(i=e,(b=Math.abs(i))>=f?r(i,b,f,"day"):b>=c?r(i,b,c,"hour"):b>=t?r(i,b,t,"minute"):b>=a?r(i,b,a,"second"):i+" ms"):function(e){var d=Math.abs(e);return d>=f?Math.round(e/f)+"d":d>=c?Math.round(e/c)+"h":d>=t?Math.round(e/t)+"m":d>=a?Math.round(e/a)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},86889:e=>{e.exports=function e(t,c){if(!t){var f=new a(c);throw Error.captureStackTrace&&Error.captureStackTrace(f,e),f}};class a extends Error{}a.prototype.name="AssertionError"},89211:e=>{"use strict";var a=function(e){return e!=e};e.exports=function(e,t){return 0===e&&0===t?1/e==1/t:e===t||!(!a(e)||!a(t))}},37653:(e,a,t)=>{"use strict";var c=t(38452),f=t(10487),d=t(89211),r=t(9394),n=t(36576),i=f(r(),Object);c(i,{getPolyfill:r,implementation:d,shim:n}),e.exports=i},9394:(e,a,t)=>{"use strict";var c=t(89211);e.exports=function(){return"function"==typeof Object.is?Object.is:c}},36576:(e,a,t)=>{"use strict";var c=t(9394),f=t(38452);e.exports=function(){var e=c();return f(Object,{is:e},{is:function(){return Object.is!==e}}),e}},28875:(e,a,t)=>{"use strict";var c;if(!Object.keys){var f=Object.prototype.hasOwnProperty,d=Object.prototype.toString,r=t(1093),n=Object.prototype.propertyIsEnumerable,i=!n.call({toString:null},"toString"),b=n.call((function(){}),"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(e){var a=e.constructor;return a&&a.prototype===e},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},u=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!l["$"+e]&&f.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{s(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();c=function(e){var a=null!==e&&"object"==typeof e,t="[object Function]"===d.call(e),c=r(e),n=a&&"[object String]"===d.call(e),l=[];if(!a&&!t&&!c)throw new TypeError("Object.keys called on a non-object");var h=b&&t;if(n&&e.length>0&&!f.call(e,0))for(var p=0;p0)for(var g=0;g{"use strict";var c=Array.prototype.slice,f=t(1093),d=Object.keys,r=d?function(e){return d(e)}:t(28875),n=Object.keys;r.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return f(e)?n(c.call(e)):n(e)})}else Object.keys=r;return Object.keys||r},e.exports=r},1093:e=>{"use strict";var a=Object.prototype.toString;e.exports=function(e){var t=a.call(e),c="[object Arguments]"===t;return c||(c="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===a.call(e.callee)),c}},38403:(e,a,t)=>{"use strict";var c=t(1189),f=t(41333)(),d=t(38075),r=Object,n=d("Array.prototype.push"),i=d("Object.prototype.propertyIsEnumerable"),b=f?Object.getOwnPropertySymbols:null;e.exports=function(e,a){if(null==e)throw new TypeError("target must be an object");var t=r(e);if(1===arguments.length)return t;for(var d=1;d{"use strict";var c=t(38403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",a=e.split(""),t={},c=0;c{"use strict";var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function c(e,a){return Object.prototype.hasOwnProperty.call(e,a)}a.assign=function(e){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var t=a.shift();if(t){if("object"!=typeof t)throw new TypeError(t+"must be non-object");for(var f in t)c(t,f)&&(e[f]=t[f])}}return e},a.shrinkBuf=function(e,a){return e.length===a?e:e.subarray?e.subarray(0,a):(e.length=a,e)};var f={arraySet:function(e,a,t,c,f){if(a.subarray&&e.subarray)e.set(a.subarray(t,t+c),f);else for(var d=0;d{"use strict";e.exports=function(e,a,t,c){for(var f=65535&e,d=e>>>16&65535,r=0;0!==t;){t-=r=t>2e3?2e3:t;do{d=d+(f=f+a[c++]|0)|0}while(--r);f%=65521,d%=65521}return f|d<<16}},19681:e=>{"use strict";e.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}},14823:e=>{"use strict";var a=function(){for(var e,a=[],t=0;t<256;t++){e=t;for(var c=0;c<8;c++)e=1&e?3988292384^e>>>1:e>>>1;a[t]=e}return a}();e.exports=function(e,t,c,f){var d=a,r=f+c;e^=-1;for(var n=f;n>>8^d[255&(e^t[n])];return~e}},58411:(e,a,t)=>{"use strict";var c,f=t(9805),d=t(23665),r=t(53269),n=t(14823),i=t(54674),b=-2,o=258,s=262,l=103,u=113,h=666;function p(e,a){return e.msg=i[a],a}function g(e){return(e<<1)-(e>4?9:0)}function m(e){for(var a=e.length;--a>=0;)e[a]=0}function x(e){var a=e.state,t=a.pending;t>e.avail_out&&(t=e.avail_out),0!==t&&(f.arraySet(e.output,a.pending_buf,a.pending_out,t,e.next_out),e.next_out+=t,a.pending_out+=t,e.total_out+=t,e.avail_out-=t,a.pending-=t,0===a.pending&&(a.pending_out=0))}function y(e,a){d._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,a),e.block_start=e.strstart,x(e.strm)}function A(e,a){e.pending_buf[e.pending++]=a}function v(e,a){e.pending_buf[e.pending++]=a>>>8&255,e.pending_buf[e.pending++]=255&a}function w(e,a){var t,c,f=e.max_chain_length,d=e.strstart,r=e.prev_length,n=e.nice_match,i=e.strstart>e.w_size-s?e.strstart-(e.w_size-s):0,b=e.window,l=e.w_mask,u=e.prev,h=e.strstart+o,p=b[d+r-1],g=b[d+r];e.prev_length>=e.good_match&&(f>>=2),n>e.lookahead&&(n=e.lookahead);do{if(b[(t=a)+r]===g&&b[t+r-1]===p&&b[t]===b[d]&&b[++t]===b[d+1]){d+=2,t++;do{}while(b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&dr){if(e.match_start=a,r=c,c>=n)break;p=b[d+r-1],g=b[d+r]}}}while((a=u[a&l])>i&&0!=--f);return r<=e.lookahead?r:e.lookahead}function _(e){var a,t,c,d,i,b,o,l,u,h,p=e.w_size;do{if(d=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-s)){f.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,a=t=e.hash_size;do{c=e.head[--a],e.head[a]=c>=p?c-p:0}while(--t);a=t=p;do{c=e.prev[--a],e.prev[a]=c>=p?c-p:0}while(--t);d+=p}if(0===e.strm.avail_in)break;if(b=e.strm,o=e.window,l=e.strstart+e.lookahead,u=d,h=void 0,(h=b.avail_in)>u&&(h=u),t=0===h?0:(b.avail_in-=h,f.arraySet(o,b.input,b.next_in,h,l),1===b.state.wrap?b.adler=r(b.adler,o,h,l):2===b.state.wrap&&(b.adler=n(b.adler,o,h,l)),b.next_in+=h,b.total_in+=h,h),e.lookahead+=t,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(c=d._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){f=e.strstart+e.lookahead-3,c=d._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=f&&(e.ins_h=(e.ins_h<15&&(n=2,c-=16),d<1||d>9||8!==t||c<8||c>15||a<0||a>9||r<0||r>4)return p(e,b);8===c&&(c=9);var i=new M;return e.state=i,i.strm=e,i.wrap=n,i.gzhead=null,i.w_bits=c,i.w_size=1<e.pending_buf_size-5&&(t=e.pending_buf_size-5);;){if(e.lookahead<=1){if(_(e),0===e.lookahead&&0===a)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var c=e.block_start+t;if((0===e.strstart||e.strstart>=c)&&(e.lookahead=e.strstart-c,e.strstart=c,y(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-s&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===a?(y(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(y(e,!1),e.strm.avail_out),1)})),new C(4,4,8,4,I),new C(4,5,16,8,I),new C(4,6,32,32,I),new C(4,4,16,16,E),new C(8,16,32,32,E),new C(8,16,128,128,E),new C(8,32,128,256,E),new C(32,128,258,1024,E),new C(32,258,258,4096,E)],a.deflateInit=function(e,a){return S(e,a,8,15,8,0)},a.deflateInit2=S,a.deflateReset=L,a.deflateResetKeep=B,a.deflateSetHeader=function(e,a){return e&&e.state?2!==e.state.wrap?b:(e.state.gzhead=a,0):b},a.deflate=function(e,a){var t,f,r,i;if(!e||!e.state||a>5||a<0)return e?p(e,b):b;if(f=e.state,!e.output||!e.input&&0!==e.avail_in||f.status===h&&4!==a)return p(e,0===e.avail_out?-5:b);if(f.strm=e,t=f.last_flush,f.last_flush=a,42===f.status)if(2===f.wrap)e.adler=0,A(f,31),A(f,139),A(f,8),f.gzhead?(A(f,(f.gzhead.text?1:0)+(f.gzhead.hcrc?2:0)+(f.gzhead.extra?4:0)+(f.gzhead.name?8:0)+(f.gzhead.comment?16:0)),A(f,255&f.gzhead.time),A(f,f.gzhead.time>>8&255),A(f,f.gzhead.time>>16&255),A(f,f.gzhead.time>>24&255),A(f,9===f.level?2:f.strategy>=2||f.level<2?4:0),A(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(A(f,255&f.gzhead.extra.length),A(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(e.adler=n(e.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(A(f,0),A(f,0),A(f,0),A(f,0),A(f,0),A(f,9===f.level?2:f.strategy>=2||f.level<2?4:0),A(f,3),f.status=u);else{var s=8+(f.w_bits-8<<4)<<8;s|=(f.strategy>=2||f.level<2?0:f.level<6?1:6===f.level?2:3)<<6,0!==f.strstart&&(s|=32),s+=31-s%31,f.status=u,v(f,s),0!==f.strstart&&(v(f,e.adler>>>16),v(f,65535&e.adler)),e.adler=1}if(69===f.status)if(f.gzhead.extra){for(r=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),x(e),r=f.pending,f.pending!==f.pending_buf_size));)A(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(73===f.status)if(f.gzhead.name){r=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),x(e),r=f.pending,f.pending===f.pending_buf_size)){i=1;break}i=f.gzindexr&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),0===i&&(f.gzindex=0,f.status=91)}else f.status=91;if(91===f.status)if(f.gzhead.comment){r=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),x(e),r=f.pending,f.pending===f.pending_buf_size)){i=1;break}i=f.gzindexr&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),0===i&&(f.status=l)}else f.status=l;if(f.status===l&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&x(e),f.pending+2<=f.pending_buf_size&&(A(f,255&e.adler),A(f,e.adler>>8&255),e.adler=0,f.status=u)):f.status=u),0!==f.pending){if(x(e),0===e.avail_out)return f.last_flush=-1,0}else if(0===e.avail_in&&g(a)<=g(t)&&4!==a)return p(e,-5);if(f.status===h&&0!==e.avail_in)return p(e,-5);if(0!==e.avail_in||0!==f.lookahead||0!==a&&f.status!==h){var w=2===f.strategy?function(e,a){for(var t;;){if(0===e.lookahead&&(_(e),0===e.lookahead)){if(0===a)return 1;break}if(e.match_length=0,t=d._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===a?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}(f,a):3===f.strategy?function(e,a){for(var t,c,f,r,n=e.window;;){if(e.lookahead<=o){if(_(e),e.lookahead<=o&&0===a)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(c=n[f=e.strstart-1])===n[++f]&&c===n[++f]&&c===n[++f]){r=e.strstart+o;do{}while(c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&fe.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(t=d._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=d._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===a?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}(f,a):c[f.level].func(f,a);if(3!==w&&4!==w||(f.status=h),1===w||3===w)return 0===e.avail_out&&(f.last_flush=-1),0;if(2===w&&(1===a?d._tr_align(f):5!==a&&(d._tr_stored_block(f,0,0,!1),3===a&&(m(f.head),0===f.lookahead&&(f.strstart=0,f.block_start=0,f.insert=0))),x(e),0===e.avail_out))return f.last_flush=-1,0}return 4!==a?0:f.wrap<=0?1:(2===f.wrap?(A(f,255&e.adler),A(f,e.adler>>8&255),A(f,e.adler>>16&255),A(f,e.adler>>24&255),A(f,255&e.total_in),A(f,e.total_in>>8&255),A(f,e.total_in>>16&255),A(f,e.total_in>>24&255)):(v(f,e.adler>>>16),v(f,65535&e.adler)),x(e),f.wrap>0&&(f.wrap=-f.wrap),0!==f.pending?0:1)},a.deflateEnd=function(e){var a;return e&&e.state?42!==(a=e.state.status)&&69!==a&&73!==a&&91!==a&&a!==l&&a!==u&&a!==h?p(e,b):(e.state=null,a===u?p(e,-3):0):b},a.deflateSetDictionary=function(e,a){var t,c,d,n,i,o,s,l,u=a.length;if(!e||!e.state)return b;if(2===(n=(t=e.state).wrap)||1===n&&42!==t.status||t.lookahead)return b;for(1===n&&(e.adler=r(e.adler,a,u,0)),t.wrap=0,u>=t.w_size&&(0===n&&(m(t.head),t.strstart=0,t.block_start=0,t.insert=0),l=new f.Buf8(t.w_size),f.arraySet(l,a,u-t.w_size,t.w_size,0),a=l,u=t.w_size),i=e.avail_in,o=e.next_in,s=e.input,e.avail_in=u,e.next_in=0,e.input=a,_(t);t.lookahead>=3;){c=t.strstart,d=t.lookahead-2;do{t.ins_h=(t.ins_h<{"use strict";e.exports=function(e,a){var t,c,f,d,r,n,i,b,o,s,l,u,h,p,g,m,x,y,A,v,w,_,I,E,C;t=e.state,c=e.next_in,E=e.input,f=c+(e.avail_in-5),d=e.next_out,C=e.output,r=d-(a-e.avail_out),n=d+(e.avail_out-257),i=t.dmax,b=t.wsize,o=t.whave,s=t.wnext,l=t.window,u=t.hold,h=t.bits,p=t.lencode,g=t.distcode,m=(1<>>=A=y>>>24,h-=A,0==(A=y>>>16&255))C[d++]=65535&y;else{if(!(16&A)){if(64&A){if(32&A){t.mode=12;break e}e.msg="invalid literal/length code",t.mode=30;break e}y=p[(65535&y)+(u&(1<>>=A,h-=A),h<15&&(u+=E[c++]<>>=A=y>>>24,h-=A,16&(A=y>>>16&255)){if(w=65535&y,h<(A&=15)&&(u+=E[c++]<i){e.msg="invalid distance too far back",t.mode=30;break e}if(u>>>=A,h-=A,w>(A=d-r)){if((A=w-A)>o&&t.sane){e.msg="invalid distance too far back",t.mode=30;break e}if(_=0,I=l,0===s){if(_+=b-A,A2;)C[d++]=I[_++],C[d++]=I[_++],C[d++]=I[_++],v-=3;v&&(C[d++]=I[_++],v>1&&(C[d++]=I[_++]))}else{_=d-w;do{C[d++]=C[_++],C[d++]=C[_++],C[d++]=C[_++],v-=3}while(v>2);v&&(C[d++]=C[_++],v>1&&(C[d++]=C[_++]))}break}if(64&A){e.msg="invalid distance code",t.mode=30;break e}y=g[(65535&y)+(u&(1<>3,u&=(1<<(h-=v<<3))-1,e.next_in=c,e.next_out=d,e.avail_in=c{"use strict";var c=t(9805),f=t(53269),d=t(14823),r=t(47293),n=t(21998),i=-2,b=12,o=30;function s(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function l(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,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 c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(e){var a;return e&&e.state?(a=e.state,e.total_in=e.total_out=a.total=0,e.msg="",a.wrap&&(e.adler=1&a.wrap),a.mode=1,a.last=0,a.havedict=0,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=a.lendyn=new c.Buf32(852),a.distcode=a.distdyn=new c.Buf32(592),a.sane=1,a.back=-1,0):i}function h(e){var a;return e&&e.state?((a=e.state).wsize=0,a.whave=0,a.wnext=0,u(e)):i}function p(e,a){var t,c;return e&&e.state?(c=e.state,a<0?(t=0,a=-a):(t=1+(a>>4),a<48&&(a&=15)),a&&(a<8||a>15)?i:(null!==c.window&&c.wbits!==a&&(c.window=null),c.wrap=t,c.wbits=a,h(e))):i}function g(e,a){var t,c;return e?(c=new l,e.state=c,c.window=null,0!==(t=p(e,a))&&(e.state=null),t):i}var m,x,y=!0;function A(e){if(y){var a;for(m=new c.Buf32(512),x=new c.Buf32(32),a=0;a<144;)e.lens[a++]=8;for(;a<256;)e.lens[a++]=9;for(;a<280;)e.lens[a++]=7;for(;a<288;)e.lens[a++]=8;for(n(1,e.lens,0,288,m,0,e.work,{bits:9}),a=0;a<32;)e.lens[a++]=5;n(2,e.lens,0,32,x,0,e.work,{bits:5}),y=!1}e.lencode=m,e.lenbits=9,e.distcode=x,e.distbits=5}function v(e,a,t,f){var d,r=e.state;return null===r.window&&(r.wsize=1<=r.wsize?(c.arraySet(r.window,a,t-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((d=r.wsize-r.wnext)>f&&(d=f),c.arraySet(r.window,a,t-f,d,r.wnext),(f-=d)?(c.arraySet(r.window,a,t-f,f,0),r.wnext=f,r.whave=r.wsize):(r.wnext+=d,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,t.check=d(t.check,F,2,0),x=0,y=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&x)<<8)+(x>>8))%31){e.msg="incorrect header check",t.mode=o;break}if(8!=(15&x)){e.msg="unknown compression method",t.mode=o;break}if(y-=4,P=8+(15&(x>>>=4)),0===t.wbits)t.wbits=P;else if(P>t.wbits){e.msg="invalid window size",t.mode=o;break}t.dmax=1<>8&1),512&t.flags&&(F[0]=255&x,F[1]=x>>>8&255,t.check=d(t.check,F,2,0)),x=0,y=0,t.mode=3;case 3:for(;y<32;){if(0===g)break e;g--,x+=l[h++]<>>8&255,F[2]=x>>>16&255,F[3]=x>>>24&255,t.check=d(t.check,F,4,0)),x=0,y=0,t.mode=4;case 4:for(;y<16;){if(0===g)break e;g--,x+=l[h++]<>8),512&t.flags&&(F[0]=255&x,F[1]=x>>>8&255,t.check=d(t.check,F,2,0)),x=0,y=0,t.mode=5;case 5:if(1024&t.flags){for(;y<16;){if(0===g)break e;g--,x+=l[h++]<>>8&255,t.check=d(t.check,F,2,0)),x=0,y=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&((I=t.length)>g&&(I=g),I&&(t.head&&(P=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),c.arraySet(t.head.extra,l,h,I,P)),512&t.flags&&(t.check=d(t.check,l,I,h)),g-=I,h+=I,t.length-=I),t.length))break e;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(0===g)break e;I=0;do{P=l[h+I++],t.head&&P&&t.length<65536&&(t.head.name+=String.fromCharCode(P))}while(P&&I>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=b;break;case 10:for(;y<32;){if(0===g)break e;g--,x+=l[h++]<>>=7&y,y-=7&y,t.mode=27;break}for(;y<3;){if(0===g)break e;g--,x+=l[h++]<>>=1)){case 0:t.mode=14;break;case 1:if(A(t),t.mode=20,6===a){x>>>=2,y-=2;break e}break;case 2:t.mode=17;break;case 3:e.msg="invalid block type",t.mode=o}x>>>=2,y-=2;break;case 14:for(x>>>=7&y,y-=7&y;y<32;){if(0===g)break e;g--,x+=l[h++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=o;break}if(t.length=65535&x,x=0,y=0,t.mode=15,6===a)break e;case 15:t.mode=16;case 16:if(I=t.length){if(I>g&&(I=g),I>m&&(I=m),0===I)break e;c.arraySet(u,l,h,I,p),g-=I,h+=I,m-=I,p+=I,t.length-=I;break}t.mode=b;break;case 17:for(;y<14;){if(0===g)break e;g--,x+=l[h++]<>>=5,y-=5,t.ndist=1+(31&x),x>>>=5,y-=5,t.ncode=4+(15&x),x>>>=4,y-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=o;break}t.have=0,t.mode=18;case 18:for(;t.have>>=3,y-=3}for(;t.have<19;)t.lens[Q[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,O={bits:t.lenbits},R=n(0,t.lens,0,19,t.lencode,0,t.work,O),t.lenbits=O.bits,R){e.msg="invalid code lengths set",t.mode=o;break}t.have=0,t.mode=19;case 19:for(;t.have>>16&255,L=65535&T,!((M=T>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>>=M,y-=M,t.lens[t.have++]=L;else{if(16===L){for(D=M+2;y>>=M,y-=M,0===t.have){e.msg="invalid bit length repeat",t.mode=o;break}P=t.lens[t.have-1],I=3+(3&x),x>>>=2,y-=2}else if(17===L){for(D=M+3;y>>=M)),x>>>=3,y-=3}else{for(D=M+7;y>>=M)),x>>>=7,y-=7}if(t.have+I>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=o;break}for(;I--;)t.lens[t.have++]=P}}if(t.mode===o)break;if(0===t.lens[256]){e.msg="invalid code -- missing end-of-block",t.mode=o;break}if(t.lenbits=9,O={bits:t.lenbits},R=n(1,t.lens,0,t.nlen,t.lencode,0,t.work,O),t.lenbits=O.bits,R){e.msg="invalid literal/lengths set",t.mode=o;break}if(t.distbits=6,t.distcode=t.distdyn,O={bits:t.distbits},R=n(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,O),t.distbits=O.bits,R){e.msg="invalid distances set",t.mode=o;break}if(t.mode=20,6===a)break e;case 20:t.mode=21;case 21:if(g>=6&&m>=258){e.next_out=p,e.avail_out=m,e.next_in=h,e.avail_in=g,t.hold=x,t.bits=y,r(e,_),p=e.next_out,u=e.output,m=e.avail_out,h=e.next_in,l=e.input,g=e.avail_in,x=t.hold,y=t.bits,t.mode===b&&(t.back=-1);break}for(t.back=0;B=(T=t.lencode[x&(1<>>16&255,L=65535&T,!((M=T>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>S)])>>>16&255,L=65535&T,!(S+(M=T>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>>=S,y-=S,t.back+=S}if(x>>>=M,y-=M,t.back+=M,t.length=L,0===B){t.mode=26;break}if(32&B){t.back=-1,t.mode=b;break}if(64&B){e.msg="invalid literal/length code",t.mode=o;break}t.extra=15&B,t.mode=22;case 22:if(t.extra){for(D=t.extra;y>>=t.extra,y-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;B=(T=t.distcode[x&(1<>>16&255,L=65535&T,!((M=T>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>S)])>>>16&255,L=65535&T,!(S+(M=T>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>>=S,y-=S,t.back+=S}if(x>>>=M,y-=M,t.back+=M,64&B){e.msg="invalid distance code",t.mode=o;break}t.offset=L,t.extra=15&B,t.mode=24;case 24:if(t.extra){for(D=t.extra;y>>=t.extra,y-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=o;break}t.mode=25;case 25:if(0===m)break e;if(I=_-m,t.offset>I){if((I=t.offset-I)>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=o;break}I>t.wnext?(I-=t.wnext,E=t.wsize-I):E=t.wnext-I,I>t.length&&(I=t.length),C=t.window}else C=u,E=p-t.offset,I=t.length;I>m&&(I=m),m-=I,t.length-=I;do{u[p++]=C[E++]}while(--I);0===t.length&&(t.mode=21);break;case 26:if(0===m)break e;u[p++]=t.length,m--,t.mode=21;break;case 27:if(t.wrap){for(;y<32;){if(0===g)break e;g--,x|=l[h++]<{"use strict";var c=t(9805),f=[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],d=[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],r=[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],n=[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];e.exports=function(e,a,t,i,b,o,s,l){var u,h,p,g,m,x,y,A,v,w=l.bits,_=0,I=0,E=0,C=0,M=0,B=0,L=0,S=0,k=0,N=0,P=null,R=0,O=new c.Buf16(16),D=new c.Buf16(16),T=null,F=0;for(_=0;_<=15;_++)O[_]=0;for(I=0;I=1&&0===O[C];C--);if(M>C&&(M=C),0===C)return b[o++]=20971520,b[o++]=20971520,l.bits=1,0;for(E=1;E0&&(0===e||1!==C))return-1;for(D[1]=0,_=1;_<15;_++)D[_+1]=D[_]+O[_];for(I=0;I852||2===e&&k>592)return 1;for(;;){y=_-L,s[I]x?(A=T[F+s[I]],v=P[R+s[I]]):(A=96,v=0),u=1<<_-L,E=h=1<>L)+(h-=u)]=y<<24|A<<16|v}while(0!==h);for(u=1<<_-1;N&u;)u>>=1;if(0!==u?(N&=u-1,N+=u):N=0,I++,0==--O[_]){if(_===C)break;_=a[t+s[I]]}if(_>M&&(N&g)!==p){for(0===L&&(L=M),m+=E,S=1<<(B=_-L);B+L852||2===e&&k>592)return 1;b[p=N&g]=M<<24|B<<16|m-o}}return 0!==N&&(b[m+N]=_-L<<24|64<<16),l.bits=M,0}},54674:e=>{"use strict";e.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"}},23665:(e,a,t)=>{"use strict";var c=t(9805);function f(e){for(var a=e.length;--a>=0;)e[a]=0}var d=[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],r=[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],n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],i=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],b=new Array(576);f(b);var o=new Array(60);f(o);var s=new Array(512);f(s);var l=new Array(256);f(l);var u=new Array(29);f(u);var h,p,g,m=new Array(30);function x(e,a,t,c,f){this.static_tree=e,this.extra_bits=a,this.extra_base=t,this.elems=c,this.max_length=f,this.has_stree=e&&e.length}function y(e,a){this.dyn_tree=e,this.max_code=0,this.stat_desc=a}function A(e){return e<256?s[e]:s[256+(e>>>7)]}function v(e,a){e.pending_buf[e.pending++]=255&a,e.pending_buf[e.pending++]=a>>>8&255}function w(e,a,t){e.bi_valid>16-t?(e.bi_buf|=a<>16-e.bi_valid,e.bi_valid+=t-16):(e.bi_buf|=a<>>=1,t<<=1}while(--a>0);return t>>>1}function E(e,a,t){var c,f,d=new Array(16),r=0;for(c=1;c<=15;c++)d[c]=r=r+t[c-1]<<1;for(f=0;f<=a;f++){var n=e[2*f+1];0!==n&&(e[2*f]=I(d[n]++,n))}}function C(e){var a;for(a=0;a<286;a++)e.dyn_ltree[2*a]=0;for(a=0;a<30;a++)e.dyn_dtree[2*a]=0;for(a=0;a<19;a++)e.bl_tree[2*a]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function M(e){e.bi_valid>8?v(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function B(e,a,t,c){var f=2*a,d=2*t;return e[f]>1;t>=1;t--)L(e,d,t);f=i;do{t=e.heap[1],e.heap[1]=e.heap[e.heap_len--],L(e,d,1),c=e.heap[1],e.heap[--e.heap_max]=t,e.heap[--e.heap_max]=c,d[2*f]=d[2*t]+d[2*c],e.depth[f]=(e.depth[t]>=e.depth[c]?e.depth[t]:e.depth[c])+1,d[2*t+1]=d[2*c+1]=f,e.heap[1]=f++,L(e,d,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,a){var t,c,f,d,r,n,i=a.dyn_tree,b=a.max_code,o=a.stat_desc.static_tree,s=a.stat_desc.has_stree,l=a.stat_desc.extra_bits,u=a.stat_desc.extra_base,h=a.stat_desc.max_length,p=0;for(d=0;d<=15;d++)e.bl_count[d]=0;for(i[2*e.heap[e.heap_max]+1]=0,t=e.heap_max+1;t<573;t++)(d=i[2*i[2*(c=e.heap[t])+1]+1]+1)>h&&(d=h,p++),i[2*c+1]=d,c>b||(e.bl_count[d]++,r=0,c>=u&&(r=l[c-u]),n=i[2*c],e.opt_len+=n*(d+r),s&&(e.static_len+=n*(o[2*c+1]+r)));if(0!==p){do{for(d=h-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[h]--,p-=2}while(p>0);for(d=h;0!==d;d--)for(c=e.bl_count[d];0!==c;)(f=e.heap[--t])>b||(i[2*f+1]!==d&&(e.opt_len+=(d-i[2*f+1])*i[2*f],i[2*f+1]=d),c--)}}(e,a),E(d,b,e.bl_count)}function N(e,a,t){var c,f,d=-1,r=a[1],n=0,i=7,b=4;for(0===r&&(i=138,b=3),a[2*(t+1)+1]=65535,c=0;c<=t;c++)f=r,r=a[2*(c+1)+1],++n>=7;c<30;c++)for(m[c]=f<<7,e=0;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var a,t=4093624447;for(a=0;a<=31;a++,t>>>=1)if(1&t&&0!==e.dyn_ltree[2*a])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(a=32;a<256;a++)if(0!==e.dyn_ltree[2*a])return 1;return 0}(e)),k(e,e.l_desc),k(e,e.d_desc),r=function(e){var a;for(N(e,e.dyn_ltree,e.l_desc.max_code),N(e,e.dyn_dtree,e.d_desc.max_code),k(e,e.bl_desc),a=18;a>=3&&0===e.bl_tree[2*i[a]+1];a--);return e.opt_len+=3*(a+1)+5+5+4,a}(e),f=e.opt_len+3+7>>>3,(d=e.static_len+3+7>>>3)<=f&&(f=d)):f=d=t+5,t+4<=f&&-1!==a?O(e,a,t,c):4===e.strategy||d===f?(w(e,2+(c?1:0),3),S(e,b,o)):(w(e,4+(c?1:0),3),function(e,a,t,c){var f;for(w(e,a-257,5),w(e,t-1,5),w(e,c-4,4),f=0;f>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&a,e.pending_buf[e.l_buf+e.last_lit]=255&t,e.last_lit++,0===a?e.dyn_ltree[2*t]++:(e.matches++,a--,e.dyn_ltree[2*(l[t]+256+1)]++,e.dyn_dtree[2*A(a)]++),e.last_lit===e.lit_bufsize-1},a._tr_align=function(e){w(e,2,3),_(e,256,b),function(e){16===e.bi_valid?(v(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},44442:e=>{"use strict";e.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}},21137:(e,a,t)=>{"use strict";var c=t(87568);a.certificate=t(36413);var f=c.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())}));a.RSAPrivateKey=f;var d=c.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));a.RSAPublicKey=d;var r=c.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())})),n=c.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(r),this.key("subjectPublicKey").bitstr())}));a.PublicKey=n;var i=c.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(r),this.key("subjectPrivateKey").octstr())}));a.PrivateKey=i;var b=c.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())}));a.EncryptedPrivateKey=b;var o=c.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())}));a.DSAPrivateKey=o,a.DSAparam=c.define("DSAparam",(function(){this.int()}));var s=c.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})})),l=c.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(s),this.key("publicKey").optional().explicit(1).bitstr())}));a.ECPrivateKey=l,a.signature=c.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},36413:(e,a,t)=>{"use strict";var c=t(87568),f=c.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),d=c.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),r=c.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),n=c.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(r),this.key("subjectPublicKey").bitstr())})),i=c.define("RelativeDistinguishedName",(function(){this.setof(d)})),b=c.define("RDNSequence",(function(){this.seqof(i)})),o=c.define("Name",(function(){this.choice({rdnSequence:this.use(b)})})),s=c.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(f),this.key("notAfter").use(f))})),l=c.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),u=c.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(r),this.key("issuer").use(o),this.key("validity").use(s),this.key("subject").use(o),this.key("subjectPublicKeyInfo").use(n),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())})),h=c.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(u),this.key("signatureAlgorithm").use(r),this.key("signatureValue").bitstr())}));e.exports=h},24101:(e,a,t)=>{"use strict";var c=/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,f=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,d=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,r=t(68078),n=t(1241),i=t(92861).Buffer;e.exports=function(e,a){var t,b=e.toString(),o=b.match(c);if(o){var s="aes"+o[1],l=i.from(o[2],"hex"),u=i.from(o[3].replace(/[\r\n]/g,""),"base64"),h=r(a,l.slice(0,8),parseInt(o[1],10)).key,p=[],g=n.createDecipheriv(s,h,l);p.push(g.update(u)),p.push(g.final()),t=i.concat(p)}else{var m=b.match(d);t=i.from(m[2].replace(/[\r\n]/g,""),"base64")}return{tag:b.match(f)[1],data:t}}},78170:(e,a,t)=>{"use strict";var c=t(21137),f=t(15579),d=t(24101),r=t(1241),n=t(78396),i=t(92861).Buffer;function b(e){var a;"object"!=typeof e||i.isBuffer(e)||(a=e.passphrase,e=e.key),"string"==typeof e&&(e=i.from(e));var t,b,o=d(e,a),s=o.tag,l=o.data;switch(s){case"CERTIFICATE":b=c.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(b||(b=c.PublicKey.decode(l,"der")),t=b.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return c.RSAPublicKey.decode(b.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return b.subjectPrivateKey=b.subjectPublicKey,{type:"ec",data:b};case"1.2.840.10040.4.1":return b.algorithm.params.pub_key=c.DSAparam.decode(b.subjectPublicKey.data,"der"),{type:"dsa",data:b.algorithm.params};default:throw new Error("unknown key id "+t)}case"ENCRYPTED PRIVATE KEY":l=function(e,a){var t=e.algorithm.decrypt.kde.kdeparams.salt,c=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),d=f[e.algorithm.decrypt.cipher.algo.join(".")],b=e.algorithm.decrypt.cipher.iv,o=e.subjectPrivateKey,s=parseInt(d.split("-")[1],10)/8,l=n.pbkdf2Sync(a,t,c,s,"sha1"),u=r.createDecipheriv(d,l,b),h=[];return h.push(u.update(o)),h.push(u.final()),i.concat(h)}(l=c.EncryptedPrivateKey.decode(l,"der"),a);case"PRIVATE KEY":switch(t=(b=c.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return c.RSAPrivateKey.decode(b.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:b.algorithm.curve,privateKey:c.ECPrivateKey.decode(b.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return b.algorithm.params.priv_key=c.DSAparam.decode(b.subjectPrivateKey,"der"),{type:"dsa",params:b.algorithm.params};default:throw new Error("unknown key id "+t)}case"RSA PUBLIC KEY":return c.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return c.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:c.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=c.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+s)}}b.signature=c.signature,e.exports=b},78396:(e,a,t)=>{a.pbkdf2=t(43832),a.pbkdf2Sync=t(21352)},43832:(e,a,t)=>{var c,f,d=t(92861).Buffer,r=t(64196),n=t(2455),i=t(21352),b=t(93382),o=t.g.crypto&&t.g.crypto.subtle,s={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"},l=[];function u(){return f||(f=t.g.process&&t.g.process.nextTick?t.g.process.nextTick:t.g.queueMicrotask?t.g.queueMicrotask:t.g.setImmediate?t.g.setImmediate:t.g.setTimeout)}function h(e,a,t,c,f){return o.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return o.deriveBits({name:"PBKDF2",salt:a,iterations:t,hash:{name:f}},e,c<<3)})).then((function(e){return d.from(e)}))}e.exports=function(e,a,f,p,g,m){"function"==typeof g&&(m=g,g=void 0);var x=s[(g=g||"sha1").toLowerCase()];if(x&&"function"==typeof t.g.Promise){if(r(f,p),e=b(e,n,"Password"),a=b(a,n,"Salt"),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");!function(e,a){e.then((function(e){u()((function(){a(null,e)}))}),(function(e){u()((function(){a(e)}))}))}(function(e){if(t.g.process&&!t.g.process.browser)return Promise.resolve(!1);if(!o||!o.importKey||!o.deriveBits)return Promise.resolve(!1);if(void 0!==l[e])return l[e];var a=h(c=c||d.alloc(8),c,10,128,e).then((function(){return!0})).catch((function(){return!1}));return l[e]=a,a}(x).then((function(t){return t?h(e,a,f,p,x):i(e,a,f,p,g)})),m)}else u()((function(){var t;try{t=i(e,a,f,p,g)}catch(e){return m(e)}m(null,t)}))}},2455:(e,a,t)=>{var c;c=t.g.process&&t.g.process.browser?"utf-8":t.g.process&&t.g.process.version?parseInt(process.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",e.exports=c},64196:e=>{var a=Math.pow(2,30)-1;e.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>a||t!=t)throw new TypeError("Bad key length")}},21352:(e,a,t)=>{var c=t(20320),f=t(66011),d=t(62802),r=t(92861).Buffer,n=t(64196),i=t(2455),b=t(93382),o=r.alloc(128),s={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(e,a,t){var n=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new f).update(e).digest()}:"md5"===e?c:function(a){return d(e).update(a).digest()}}(e),i="sha512"===e||"sha384"===e?128:64;a.length>i?a=n(a):a.length{var c=t(92861).Buffer;e.exports=function(e,a,t){if(c.isBuffer(e))return e;if("string"==typeof e)return c.from(e,a);if(ArrayBuffer.isView(e))return c.from(e.buffer);throw new TypeError(t+" must be a string, a Buffer, a typed array or a DataView")}},71843:(e,a,t)=>{"use strict";const{ErrorWithCause:c}=t(75832),{findCauseByReference:f,getErrorCause:d,messageWithCauses:r,stackWithCauses:n}=t(94306);e.exports={ErrorWithCause:c,findCauseByReference:f,getErrorCause:d,stackWithCauses:n,messageWithCauses:r}},75832:e=>{"use strict";class a extends Error{constructor(e,{cause:t}={}){super(e),this.name=a.name,t&&(this.cause=t),this.message=e}}e.exports={ErrorWithCause:a}},94306:e=>{"use strict";const a=e=>{if(e&&"object"==typeof e&&"cause"in e){if("function"==typeof e.cause){const a=e.cause();return a instanceof Error?a:void 0}return e.cause instanceof Error?e.cause:void 0}},t=(e,c)=>{if(!(e instanceof Error))return"";const f=e.stack||"";if(c.has(e))return f+"\ncauses have become circular...";const d=a(e);return d?(c.add(e),f+"\ncaused by: "+t(d,c)):f},c=(e,t,f)=>{if(!(e instanceof Error))return"";const d=f?"":e.message||"";if(t.has(e))return d+": ...";const r=a(e);if(r){t.add(e);const a="cause"in e&&"function"==typeof e.cause;return d+(a?"":": ")+c(r,t,a)}return d};e.exports={findCauseByReference:(e,t)=>{if(!e||!t)return;if(!(e instanceof Error))return;if(!(t.prototype instanceof Error)&&t!==Error)return;const c=new Set;let f=e;for(;f&&!c.has(f);){if(c.add(f),f instanceof t)return f;f=a(f)}},getErrorCause:a,stackWithCauses:e=>t(e,new Set),messageWithCauses:e=>c(e,new Set)}},76578:e=>{"use strict";e.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},33225:e=>{"use strict";"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?e.exports={nextTick:function(e,a,t,c){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var f,d,r=arguments.length;switch(r){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,a)}));case 3:return process.nextTick((function(){e.call(null,a,t)}));case 4:return process.nextTick((function(){e.call(null,a,t,c)}));default:for(f=new Array(r-1),d=0;d{a.publicEncrypt=t(28902),a.privateDecrypt=t(77362),a.privateEncrypt=function(e,t){return a.publicEncrypt(e,t,!0)},a.publicDecrypt=function(e,t){return a.privateDecrypt(e,t,!0)}},48206:(e,a,t)=>{var c=t(47108),f=t(92861).Buffer;function d(e){var a=f.allocUnsafe(4);return a.writeUInt32BE(e,0),a}e.exports=function(e,a){for(var t,r=f.alloc(0),n=0;r.length=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,D=R>>>13,T=0|r[9],F=8191&T,Q=T>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(D,j)|0,d=Math.imul(D,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(D,q)|0,d=d+Math.imul(D,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(D,K)|0,d=d+Math.imul(D,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(D,J)|0,d=d+Math.imul(D,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(D,X)|0,d=d+Math.imul(D,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(D,te)|0,d=d+Math.imul(D,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(D,de)|0,d=d+Math.imul(D,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(D,ie)|0,d=d+Math.imul(D,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(D,se)|0,d=d+Math.imul(D,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(D,he)|0))<<13)|0;b=((d=d+Math.imul(D,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},77362:(e,a,t)=>{var c=t(78170),f=t(48206),d=t(52061),r=t(82509),n=t(67332),i=t(47108),b=t(99247),o=t(92861).Buffer;e.exports=function(e,a,t){var s;s=e.padding?e.padding:t?1:4;var l,u=c(e),h=u.modulus.byteLength();if(a.length>h||new r(a).cmp(u.modulus)>=0)throw new Error("decryption error");l=t?b(new r(a),u):n(a,u);var p=o.alloc(h-l.length);if(l=o.concat([p,l],h),4===s)return function(e,a){var t=e.modulus.byteLength(),c=i("sha1").update(o.alloc(0)).digest(),r=c.length;if(0!==a[0])throw new Error("decryption error");var n=a.slice(1,r+1),b=a.slice(r+1),s=d(n,f(b,r)),l=d(b,f(s,t-r-1));if(function(e,a){e=o.from(e),a=o.from(a);var t=0,c=e.length;e.length!==a.length&&(t++,c=Math.min(e.length,a.length));for(var f=-1;++f=a.length){d++;break}var r=a.slice(2,f-1);if(("0002"!==c.toString("hex")&&!t||"0001"!==c.toString("hex")&&t)&&d++,r.length<8&&d++,d)throw new Error("decryption error");return a.slice(f)}(0,l,t);if(3===s)return l;throw new Error("unknown padding")}},28902:(e,a,t)=>{var c=t(78170),f=t(53209),d=t(47108),r=t(48206),n=t(52061),i=t(82509),b=t(99247),o=t(67332),s=t(92861).Buffer;e.exports=function(e,a,t){var l;l=e.padding?e.padding:t?1:4;var u,h=c(e);if(4===l)u=function(e,a){var t=e.modulus.byteLength(),c=a.length,b=d("sha1").update(s.alloc(0)).digest(),o=b.length,l=2*o;if(c>t-l-2)throw new Error("message too long");var u=s.alloc(t-c-l-2),h=t-o-1,p=f(o),g=n(s.concat([b,u,s.alloc(1,1),a],h),r(p,h)),m=n(p,r(g,o));return new i(s.concat([s.alloc(1),m,g],t))}(h,a);else if(1===l)u=function(e,a,t){var c,d=a.length,r=e.modulus.byteLength();if(d>r-11)throw new Error("message too long");return c=t?s.alloc(r-d-3,255):function(e){for(var a,t=s.allocUnsafe(e),c=0,d=f(2*e),r=0;c=0)throw new Error("data too long for modulus")}return t?o(u,h):b(u,h)}},99247:(e,a,t)=>{var c=t(82509),f=t(92861).Buffer;e.exports=function(e,a){return f.from(e.toRed(c.mont(a.modulus)).redPow(new c(a.publicExponent)).fromRed().toArray())}},52061:e=>{e.exports=function(e,a){for(var t=e.length,c=-1;++c{"use strict";var c=65536,f=t(92861).Buffer,d=t.g.crypto||t.g.msCrypto;d&&d.getRandomValues?e.exports=function(e,a){if(e>4294967295)throw new RangeError("requested too many random bytes");var t=f.allocUnsafe(e);if(e>0)if(e>c)for(var r=0;r{"use strict";function c(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var f=t(92861),d=t(53209),r=f.Buffer,n=f.kMaxLength,i=t.g.crypto||t.g.msCrypto,b=Math.pow(2,32)-1;function o(e,a){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>b||e<0)throw new TypeError("offset must be a uint32");if(e>n||e>a)throw new RangeError("offset out of range")}function s(e,a,t){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>b||e<0)throw new TypeError("size must be a uint32");if(e+a>t||e>n)throw new RangeError("buffer too small")}function l(e,a,t,c){if(process.browser){var f=e.buffer,r=new Uint8Array(f,a,t);return i.getRandomValues(r),c?void process.nextTick((function(){c(null,e)})):e}if(!c)return d(t).copy(e,a),e;d(t,(function(t,f){if(t)return c(t);f.copy(e,a),c(null,e)}))}i&&i.getRandomValues||!process.browser?(a.randomFill=function(e,a,c,f){if(!(r.isBuffer(e)||e instanceof t.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof a)f=a,a=0,c=e.length;else if("function"==typeof c)f=c,c=e.length-a;else if("function"!=typeof f)throw new TypeError('"cb" argument must be a function');return o(a,e.length),s(c,a,e.length),l(e,a,c,f)},a.randomFillSync=function(e,a,c){if(void 0===a&&(a=0),!(r.isBuffer(e)||e instanceof t.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return o(a,e.length),void 0===c&&(c=e.length-a),s(c,a,e.length),l(e,a,c)}):(a.randomFill=c,a.randomFillSync=c)},86048:e=>{"use strict";var a={};function t(e,t,c){c||(c=Error);var f=function(e){var a,c;function f(a,c,f){return e.call(this,function(e,a,c){return"string"==typeof t?t:t(e,a,c)}(a,c,f))||this}return c=e,(a=f).prototype=Object.create(c.prototype),a.prototype.constructor=a,a.__proto__=c,f}(c);f.prototype.name=c.name,f.prototype.code=e,a[e]=f}function c(e,a){if(Array.isArray(e)){var t=e.length;return e=e.map((function(e){return String(e)})),t>2?"one of ".concat(a," ").concat(e.slice(0,t-1).join(", "),", or ")+e[t-1]:2===t?"one of ".concat(a," ").concat(e[0]," or ").concat(e[1]):"of ".concat(a," ").concat(e[0])}return"of ".concat(a," ").concat(String(e))}t("ERR_INVALID_OPT_VALUE",(function(e,a){return'The value "'+a+'" is invalid for option "'+e+'"'}),TypeError),t("ERR_INVALID_ARG_TYPE",(function(e,a,t){var f,d,r,n,i;if("string"==typeof a&&(d="not ",a.substr(0,4)===d)?(f="must not be",a=a.replace(/^not /,"")):f="must be",function(e,a,t){return(void 0===t||t>e.length)&&(t=e.length),e.substring(t-9,t)===a}(e," argument"))r="The ".concat(e," ").concat(f," ").concat(c(a,"type"));else{var b=("number"!=typeof i&&(i=0),i+1>(n=e).length||-1===n.indexOf(".",i)?"argument":"property");r='The "'.concat(e,'" ').concat(b," ").concat(f," ").concat(c(a,"type"))}return r+". Received type ".concat(typeof t)}),TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=a},25382:(e,a,t)=>{"use strict";var c=Object.keys||function(e){var a=[];for(var t in e)a.push(t);return a};e.exports=b;var f=t(45412),d=t(16708);t(56698)(b,f);for(var r=c(d.prototype),n=0;n{"use strict";e.exports=f;var c=t(74610);function f(e){if(!(this instanceof f))return new f(e);c.call(this,e)}t(56698)(f,c),f.prototype._transform=function(e,a,t){t(null,e)}},45412:(e,a,t)=>{"use strict";var c;e.exports=I,I.ReadableState=_,t(37007).EventEmitter;var f,d=function(e,a){return e.listeners(a).length},r=t(40345),n=t(48287).Buffer,i=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},b=t(79838);f=b&&b.debuglog?b.debuglog("stream"):function(){};var o,s,l,u=t(80345),h=t(75896),p=t(65291).getHighWaterMark,g=t(86048).F,m=g.ERR_INVALID_ARG_TYPE,x=g.ERR_STREAM_PUSH_AFTER_EOF,y=g.ERR_METHOD_NOT_IMPLEMENTED,A=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;t(56698)(I,r);var v=h.errorOrDestroy,w=["error","close","destroy","pause","resume"];function _(e,a,f){c=c||t(25382),e=e||{},"boolean"!=typeof f&&(f=a instanceof c),this.objectMode=!!e.objectMode,f&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=p(this,e,"readableHighWaterMark",f),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=t(83141).I),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function I(e){if(c=c||t(25382),!(this instanceof I))return new I(e);var a=this instanceof c;this._readableState=new _(e,this,a),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),r.call(this)}function E(e,a,t,c,d){f("readableAddChunk",a);var r,b=e._readableState;if(null===a)b.reading=!1,function(e,a){if(f("onEofChunk"),!a.ended){if(a.decoder){var t=a.decoder.end();t&&t.length&&(a.buffer.push(t),a.length+=a.objectMode?1:t.length)}a.ended=!0,a.sync?L(e):(a.needReadable=!1,a.emittedReadable||(a.emittedReadable=!0,S(e)))}}(e,b);else if(d||(r=function(e,a){var t,c;return c=a,n.isBuffer(c)||c instanceof i||"string"==typeof a||void 0===a||e.objectMode||(t=new m("chunk",["string","Buffer","Uint8Array"],a)),t}(b,a)),r)v(e,r);else if(b.objectMode||a&&a.length>0)if("string"==typeof a||b.objectMode||Object.getPrototypeOf(a)===n.prototype||(a=function(e){return n.from(e)}(a)),c)b.endEmitted?v(e,new A):C(e,b,a,!0);else if(b.ended)v(e,new x);else{if(b.destroyed)return!1;b.reading=!1,b.decoder&&!t?(a=b.decoder.write(a),b.objectMode||0!==a.length?C(e,b,a,!1):k(e,b)):C(e,b,a,!1)}else c||(b.reading=!1,k(e,b));return!b.ended&&(b.lengtha.highWaterMark&&(a.highWaterMark=function(e){return e>=M?e=M:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0))}function L(e){var a=e._readableState;f("emitReadable",a.needReadable,a.emittedReadable),a.needReadable=!1,a.emittedReadable||(f("emitReadable",a.flowing),a.emittedReadable=!0,process.nextTick(S,e))}function S(e){var a=e._readableState;f("emitReadable_",a.destroyed,a.length,a.ended),a.destroyed||!a.length&&!a.ended||(e.emit("readable"),a.emittedReadable=!1),a.needReadable=!a.flowing&&!a.ended&&a.length<=a.highWaterMark,D(e)}function k(e,a){a.readingMore||(a.readingMore=!0,process.nextTick(N,e,a))}function N(e,a){for(;!a.reading&&!a.ended&&(a.length0,a.resumeScheduled&&!a.paused?a.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){f("readable nexttick read 0"),e.read(0)}function O(e,a){f("resume",a.reading),a.reading||e.read(0),a.resumeScheduled=!1,e.emit("resume"),D(e),a.flowing&&!a.reading&&e.read(0)}function D(e){var a=e._readableState;for(f("flow",a.flowing);a.flowing&&null!==e.read(););}function T(e,a){return 0===a.length?null:(a.objectMode?t=a.buffer.shift():!e||e>=a.length?(t=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.first():a.buffer.concat(a.length),a.buffer.clear()):t=a.buffer.consume(e,a.decoder),t);var t}function F(e){var a=e._readableState;f("endReadable",a.endEmitted),a.endEmitted||(a.ended=!0,process.nextTick(Q,a,e))}function Q(e,a){if(f("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,a.readable=!1,a.emit("end"),e.autoDestroy)){var t=a._writableState;(!t||t.autoDestroy&&t.finished)&&a.destroy()}}function U(e,a){for(var t=0,c=e.length;t=a.highWaterMark:a.length>0)||a.ended))return f("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?F(this):L(this),null;if(0===(e=B(e,a))&&a.ended)return 0===a.length&&F(this),null;var c,d=a.needReadable;return f("need readable",d),(0===a.length||a.length-e0?T(e,a):null)?(a.needReadable=a.length<=a.highWaterMark,e=0):(a.length-=e,a.awaitDrain=0),0===a.length&&(a.ended||(a.needReadable=!0),t!==e&&a.ended&&F(this)),null!==c&&this.emit("data",c),c},I.prototype._read=function(e){v(this,new y("_read()"))},I.prototype.pipe=function(e,a){var t=this,c=this._readableState;switch(c.pipesCount){case 0:c.pipes=e;break;case 1:c.pipes=[c.pipes,e];break;default:c.pipes.push(e)}c.pipesCount+=1,f("pipe count=%d opts=%j",c.pipesCount,a);var r=a&&!1===a.end||e===process.stdout||e===process.stderr?h:n;function n(){f("onend"),e.end()}c.endEmitted?process.nextTick(r):t.once("end",r),e.on("unpipe",(function a(d,r){f("onunpipe"),d===t&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,f("cleanup"),e.removeListener("close",l),e.removeListener("finish",u),e.removeListener("drain",i),e.removeListener("error",s),e.removeListener("unpipe",a),t.removeListener("end",n),t.removeListener("end",h),t.removeListener("data",o),b=!0,!c.awaitDrain||e._writableState&&!e._writableState.needDrain||i())}));var i=function(e){return function(){var a=e._readableState;f("pipeOnDrain",a.awaitDrain),a.awaitDrain&&a.awaitDrain--,0===a.awaitDrain&&d(e,"data")&&(a.flowing=!0,D(e))}}(t);e.on("drain",i);var b=!1;function o(a){f("ondata");var d=e.write(a);f("dest.write",d),!1===d&&((1===c.pipesCount&&c.pipes===e||c.pipesCount>1&&-1!==U(c.pipes,e))&&!b&&(f("false write response, pause",c.awaitDrain),c.awaitDrain++),t.pause())}function s(a){f("onerror",a),h(),e.removeListener("error",s),0===d(e,"error")&&v(e,a)}function l(){e.removeListener("finish",u),h()}function u(){f("onfinish"),e.removeListener("close",l),h()}function h(){f("unpipe"),t.unpipe(e)}return t.on("data",o),function(e,a,t){if("function"==typeof e.prependListener)return e.prependListener(a,t);e._events&&e._events[a]?Array.isArray(e._events[a])?e._events[a].unshift(t):e._events[a]=[t,e._events[a]]:e.on(a,t)}(e,"error",s),e.once("close",l),e.once("finish",u),e.emit("pipe",t),c.flowing||(f("pipe resume"),t.resume()),e},I.prototype.unpipe=function(e){var a=this._readableState,t={hasUnpiped:!1};if(0===a.pipesCount)return this;if(1===a.pipesCount)return e&&e!==a.pipes||(e||(e=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,e&&e.emit("unpipe",this,t)),this;if(!e){var c=a.pipes,f=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var d=0;d0,!1!==c.flowing&&this.resume()):"readable"===e&&(c.endEmitted||c.readableListening||(c.readableListening=c.needReadable=!0,c.flowing=!1,c.emittedReadable=!1,f("on readable",c.length,c.reading),c.length?L(this):c.reading||process.nextTick(R,this))),t},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(e,a){var t=r.prototype.removeListener.call(this,e,a);return"readable"===e&&process.nextTick(P,this),t},I.prototype.removeAllListeners=function(e){var a=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(P,this),a},I.prototype.resume=function(){var e=this._readableState;return e.flowing||(f("resume"),e.flowing=!e.readableListening,function(e,a){a.resumeScheduled||(a.resumeScheduled=!0,process.nextTick(O,e,a))}(this,e)),e.paused=!1,this},I.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},I.prototype.wrap=function(e){var a=this,t=this._readableState,c=!1;for(var d in e.on("end",(function(){if(f("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&a.push(e)}a.push(null)})),e.on("data",(function(d){f("wrapped data"),t.decoder&&(d=t.decoder.write(d)),t.objectMode&&null==d||(t.objectMode||d&&d.length)&&(a.push(d)||(c=!0,e.pause()))})),e)void 0===this[d]&&"function"==typeof e[d]&&(this[d]=function(a){return function(){return e[a].apply(e,arguments)}}(d));for(var r=0;r{"use strict";e.exports=o;var c=t(86048).F,f=c.ERR_METHOD_NOT_IMPLEMENTED,d=c.ERR_MULTIPLE_CALLBACK,r=c.ERR_TRANSFORM_ALREADY_TRANSFORMING,n=c.ERR_TRANSFORM_WITH_LENGTH_0,i=t(25382);function b(e,a){var t=this._transformState;t.transforming=!1;var c=t.writecb;if(null===c)return this.emit("error",new d);t.writechunk=null,t.writecb=null,null!=a&&this.push(a),c(e);var f=this._readableState;f.reading=!1,(f.needReadable||f.length{"use strict";function c(e){var a=this;this.next=null,this.entry=null,this.finish=function(){!function(e,a){var t=e.entry;for(e.entry=null;t;){var c=t.callback;a.pendingcb--,c(undefined),t=t.next}a.corkedRequestsFree.next=e}(a,e)}}var f;e.exports=I,I.WritableState=_;var d,r={deprecate:t(94643)},n=t(40345),i=t(48287).Buffer,b=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},o=t(75896),s=t(65291).getHighWaterMark,l=t(86048).F,u=l.ERR_INVALID_ARG_TYPE,h=l.ERR_METHOD_NOT_IMPLEMENTED,p=l.ERR_MULTIPLE_CALLBACK,g=l.ERR_STREAM_CANNOT_PIPE,m=l.ERR_STREAM_DESTROYED,x=l.ERR_STREAM_NULL_VALUES,y=l.ERR_STREAM_WRITE_AFTER_END,A=l.ERR_UNKNOWN_ENCODING,v=o.errorOrDestroy;function w(){}function _(e,a,d){f=f||t(25382),e=e||{},"boolean"!=typeof d&&(d=a instanceof f),this.objectMode=!!e.objectMode,d&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=s(this,e,"writableHighWaterMark",d),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var r=!1===e.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,a){var t=e._writableState,c=t.sync,f=t.writecb;if("function"!=typeof f)throw new p;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(t),a)!function(e,a,t,c,f){--a.pendingcb,t?(process.nextTick(f,c),process.nextTick(S,e,a),e._writableState.errorEmitted=!0,v(e,c)):(f(c),e._writableState.errorEmitted=!0,v(e,c),S(e,a))}(e,t,c,a,f);else{var d=B(t)||e.destroyed;d||t.corked||t.bufferProcessing||!t.bufferedRequest||M(e,t),c?process.nextTick(C,e,t,d,f):C(e,t,d,f)}}(a,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}function I(e){var a=this instanceof(f=f||t(25382));if(!a&&!d.call(I,this))return new I(e);this._writableState=new _(e,this,a),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),n.call(this)}function E(e,a,t,c,f,d,r){a.writelen=c,a.writecb=r,a.writing=!0,a.sync=!0,a.destroyed?a.onwrite(new m("write")):t?e._writev(f,a.onwrite):e._write(f,d,a.onwrite),a.sync=!1}function C(e,a,t,c){t||function(e,a){0===a.length&&a.needDrain&&(a.needDrain=!1,e.emit("drain"))}(e,a),a.pendingcb--,c(),S(e,a)}function M(e,a){a.bufferProcessing=!0;var t=a.bufferedRequest;if(e._writev&&t&&t.next){var f=a.bufferedRequestCount,d=new Array(f),r=a.corkedRequestsFree;r.entry=t;for(var n=0,i=!0;t;)d[n]=t,t.isBuf||(i=!1),t=t.next,n+=1;d.allBuffers=i,E(e,a,!0,a.length,d,"",r.finish),a.pendingcb++,a.lastBufferedRequest=null,r.next?(a.corkedRequestsFree=r.next,r.next=null):a.corkedRequestsFree=new c(a),a.bufferedRequestCount=0}else{for(;t;){var b=t.chunk,o=t.encoding,s=t.callback;if(E(e,a,!1,a.objectMode?1:b.length,b,o,s),t=t.next,a.bufferedRequestCount--,a.writing)break}null===t&&(a.lastBufferedRequest=null)}a.bufferedRequest=t,a.bufferProcessing=!1}function B(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function L(e,a){e._final((function(t){a.pendingcb--,t&&v(e,t),a.prefinished=!0,e.emit("prefinish"),S(e,a)}))}function S(e,a){var t=B(a);if(t&&(function(e,a){a.prefinished||a.finalCalled||("function"!=typeof e._final||a.destroyed?(a.prefinished=!0,e.emit("prefinish")):(a.pendingcb++,a.finalCalled=!0,process.nextTick(L,e,a)))}(e,a),0===a.pendingcb&&(a.finished=!0,e.emit("finish"),a.autoDestroy))){var c=e._readableState;(!c||c.autoDestroy&&c.endEmitted)&&e.destroy()}return t}t(56698)(I,n),_.prototype.getBuffer=function(){for(var e=this.bufferedRequest,a=[];e;)a.push(e),e=e.next;return a},function(){try{Object.defineProperty(_.prototype,"buffer",{get:r.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===I&&e&&e._writableState instanceof _}})):d=function(e){return e instanceof this},I.prototype.pipe=function(){v(this,new g)},I.prototype.write=function(e,a,t){var c,f=this._writableState,d=!1,r=!f.objectMode&&(c=e,i.isBuffer(c)||c instanceof b);return r&&!i.isBuffer(e)&&(e=function(e){return i.from(e)}(e)),"function"==typeof a&&(t=a,a=null),r?a="buffer":a||(a=f.defaultEncoding),"function"!=typeof t&&(t=w),f.ending?function(e,a){var t=new y;v(e,t),process.nextTick(a,t)}(this,t):(r||function(e,a,t,c){var f;return null===t?f=new x:"string"==typeof t||a.objectMode||(f=new u("chunk",["string","Buffer"],t)),!f||(v(e,f),process.nextTick(c,f),!1)}(this,f,e,t))&&(f.pendingcb++,d=function(e,a,t,c,f,d){if(!t){var r=function(e,a,t){return e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=i.from(a,t)),a}(a,c,f);c!==r&&(t=!0,f="buffer",c=r)}var n=a.objectMode?1:c.length;a.length+=n;var b=a.length-1))throw new A(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),I.prototype._write=function(e,a,t){t(new h("_write()"))},I.prototype._writev=null,I.prototype.end=function(e,a,t){var c=this._writableState;return"function"==typeof e?(t=e,e=null,a=null):"function"==typeof a&&(t=a,a=null),null!=e&&this.write(e,a),c.corked&&(c.corked=1,this.uncork()),c.ending||function(e,a,t){a.ending=!0,S(e,a),t&&(a.finished?process.nextTick(t):e.once("finish",t)),a.ended=!0,e.writable=!1}(this,c,t),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),I.prototype.destroy=o.destroy,I.prototype._undestroy=o.undestroy,I.prototype._destroy=function(e,a){a(e)}},2955:(e,a,t)=>{"use strict";var c;function f(e,a,t){return(a=function(e){var a=function(e){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var t=a.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof a?a:String(a)}(a))in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}var d=t(86238),r=Symbol("lastResolve"),n=Symbol("lastReject"),i=Symbol("error"),b=Symbol("ended"),o=Symbol("lastPromise"),s=Symbol("handlePromise"),l=Symbol("stream");function u(e,a){return{value:e,done:a}}function h(e){var a=e[r];if(null!==a){var t=e[l].read();null!==t&&(e[o]=null,e[r]=null,e[n]=null,a(u(t,!1)))}}function p(e){process.nextTick(h,e)}var g=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((f(c={get stream(){return this[l]},next:function(){var e=this,a=this[i];if(null!==a)return Promise.reject(a);if(this[b])return Promise.resolve(u(void 0,!0));if(this[l].destroyed)return new Promise((function(a,t){process.nextTick((function(){e[i]?t(e[i]):a(u(void 0,!0))}))}));var t,c=this[o];if(c)t=new Promise(function(e,a){return function(t,c){e.then((function(){a[b]?t(u(void 0,!0)):a[s](t,c)}),c)}}(c,this));else{var f=this[l].read();if(null!==f)return Promise.resolve(u(f,!1));t=new Promise(this[s])}return this[o]=t,t}},Symbol.asyncIterator,(function(){return this})),f(c,"return",(function(){var e=this;return new Promise((function(a,t){e[l].destroy(null,(function(e){e?t(e):a(u(void 0,!0))}))}))})),c),g);e.exports=function(e){var a,t=Object.create(m,(f(a={},l,{value:e,writable:!0}),f(a,r,{value:null,writable:!0}),f(a,n,{value:null,writable:!0}),f(a,i,{value:null,writable:!0}),f(a,b,{value:e._readableState.endEmitted,writable:!0}),f(a,s,{value:function(e,a){var c=t[l].read();c?(t[o]=null,t[r]=null,t[n]=null,e(u(c,!1))):(t[r]=e,t[n]=a)},writable:!0}),a));return t[o]=null,d(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var a=t[n];return null!==a&&(t[o]=null,t[r]=null,t[n]=null,a(e)),void(t[i]=e)}var c=t[r];null!==c&&(t[o]=null,t[r]=null,t[n]=null,c(u(void 0,!0))),t[b]=!0})),e.on("readable",p.bind(null,t)),t}},80345:(e,a,t)=>{"use strict";function c(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);a&&(c=c.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,c)}return t}function f(e){for(var a=1;a0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(e){var a={data:e,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var a=this.head,t=""+a.data;a=a.next;)t+=e+a.data;return t}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var a,t,c,f=i.allocUnsafe(e>>>0),d=this.head,r=0;d;)a=d.data,t=f,c=r,i.prototype.copy.call(a,t,c),r+=d.data.length,d=d.next;return f}},{key:"consume",value:function(e,a){var t;return ef.length?f.length:e;if(d===f.length?c+=f:c+=f.slice(0,e),0==(e-=d)){d===f.length?(++t,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=f.slice(d));break}++t}return this.length-=t,c}},{key:"_getBuffer",value:function(e){var a=i.allocUnsafe(e),t=this.head,c=1;for(t.data.copy(a),e-=t.data.length;t=t.next;){var f=t.data,d=e>f.length?f.length:e;if(f.copy(a,a.length-e,0,d),0==(e-=d)){d===f.length?(++c,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=f.slice(d));break}++c}return this.length-=c,a}},{key:o,value:function(e,a){return b(this,f(f({},a),{},{depth:0,customInspect:!1}))}}])&&r(a.prototype,t),Object.defineProperty(a,"prototype",{writable:!1}),e}()},75896:e=>{"use strict";function a(e,a){c(e,a),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function c(e,a){e.emit("error",a)}e.exports={destroy:function(e,f){var d=this,r=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return r||n?(f?f(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(c,this,e)):process.nextTick(c,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!f&&e?d._writableState?d._writableState.errorEmitted?process.nextTick(t,d):(d._writableState.errorEmitted=!0,process.nextTick(a,d,e)):process.nextTick(a,d,e):f?(process.nextTick(t,d),f(e)):process.nextTick(t,d)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,a){var t=e._readableState,c=e._writableState;t&&t.autoDestroy||c&&c.autoDestroy?e.destroy(a):e.emit("error",a)}}},86238:(e,a,t)=>{"use strict";var c=t(86048).F.ERR_STREAM_PREMATURE_CLOSE;function f(){}e.exports=function e(a,t,d){if("function"==typeof t)return e(a,null,t);t||(t={}),d=function(e){var a=!1;return function(){if(!a){a=!0;for(var t=arguments.length,c=new Array(t),f=0;f{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},57758:(e,a,t)=>{"use strict";var c,f=t(86048).F,d=f.ERR_MISSING_ARGS,r=f.ERR_STREAM_DESTROYED;function n(e){if(e)throw e}function i(e){e()}function b(e,a){return e.pipe(a)}e.exports=function(){for(var e=arguments.length,a=new Array(e),f=0;f0,(function(e){o||(o=e),e&&l.forEach(i),d||(l.forEach(i),s(o))}))}));return a.reduce(b)}},65291:(e,a,t)=>{"use strict";var c=t(86048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,a,t,f){var d=function(e,a,t){return null!=e.highWaterMark?e.highWaterMark:a?e[t]:null}(a,f,t);if(null!=d){if(!isFinite(d)||Math.floor(d)!==d||d<0)throw new c(f?t:"highWaterMark",d);return Math.floor(d)}return e.objectMode?16:16384}}},40345:(e,a,t)=>{e.exports=t(37007).EventEmitter},28399:(e,a,t)=>{(a=e.exports=t(45412)).Stream=a,a.Readable=a,a.Writable=t(16708),a.Duplex=t(25382),a.Transform=t(74610),a.PassThrough=t(63600),a.finished=t(86238),a.pipeline=t(57758)},66011:(e,a,t)=>{"use strict";var c=t(48287).Buffer,f=t(56698),d=t(51147),r=new Array(16),n=[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],i=[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],b=[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],o=[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],s=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function u(){d.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function h(e,a){return e<>>32-a}function p(e,a,t,c,f,d,r,n){return h(e+(a^t^c)+d+r|0,n)+f|0}function g(e,a,t,c,f,d,r,n){return h(e+(a&t|~a&c)+d+r|0,n)+f|0}function m(e,a,t,c,f,d,r,n){return h(e+((a|~t)^c)+d+r|0,n)+f|0}function x(e,a,t,c,f,d,r,n){return h(e+(a&c|t&~c)+d+r|0,n)+f|0}function y(e,a,t,c,f,d,r,n){return h(e+(a^(t|~c))+d+r|0,n)+f|0}f(u,d),u.prototype._update=function(){for(var e=r,a=0;a<16;++a)e[a]=this._block.readInt32LE(4*a);for(var t=0|this._a,c=0|this._b,f=0|this._c,d=0|this._d,u=0|this._e,A=0|this._a,v=0|this._b,w=0|this._c,_=0|this._d,I=0|this._e,E=0;E<80;E+=1){var C,M;E<16?(C=p(t,c,f,d,u,e[n[E]],s[0],b[E]),M=y(A,v,w,_,I,e[i[E]],l[0],o[E])):E<32?(C=g(t,c,f,d,u,e[n[E]],s[1],b[E]),M=x(A,v,w,_,I,e[i[E]],l[1],o[E])):E<48?(C=m(t,c,f,d,u,e[n[E]],s[2],b[E]),M=m(A,v,w,_,I,e[i[E]],l[2],o[E])):E<64?(C=x(t,c,f,d,u,e[n[E]],s[3],b[E]),M=g(A,v,w,_,I,e[i[E]],l[3],o[E])):(C=y(t,c,f,d,u,e[n[E]],s[4],b[E]),M=p(A,v,w,_,I,e[i[E]],l[4],o[E])),t=u,u=d,d=h(f,10),f=c,c=C,A=I,I=_,_=h(w,10),w=v,v=M}var B=this._b+f+_|0;this._b=this._c+d+I|0,this._c=this._d+u+A|0,this._d=this._e+t+v|0,this._e=this._a+c+w|0,this._a=B},u.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 e=c.alloc?c.alloc(20):new c(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=u},51147:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(28399).Transform;function d(e){f.call(this),this._block=c.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(56698)(d,f),d.prototype._transform=function(e,a,t){var c=null;try{this.update(e,a)}catch(e){c=e}t(c)},d.prototype._flush=function(e){var a=null;try{this.push(this.digest())}catch(e){a=e}e(a)},d.prototype.update=function(e,a){if(function(e){if(!c.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");c.isBuffer(e)||(e=c.from(e,a));for(var t=this._block,f=0;this._blockOffset+e.length-f>=this._blockSize;){for(var d=this._blockOffset;d0;++r)this._length[r]+=n,(n=this._length[r]/4294967296|0)>0&&(this._length[r]-=4294967296*n);return this},d.prototype._update=function(){throw new Error("_update is not implemented")},d.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();void 0!==e&&(a=a.toString(e)),this._block.fill(0),this._blockOffset=0;for(var t=0;t<4;++t)this._length[t]=0;return a},d.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=d},92861:(e,a,t)=>{var c=t(48287),f=c.Buffer;function d(e,a){for(var t in e)a[t]=e[t]}function r(e,a,t){return f(e,a,t)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=c:(d(c,a),a.Buffer=r),r.prototype=Object.create(f.prototype),d(f,r),r.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return f(e,a,t)},r.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var c=f(e);return void 0!==a?"string"==typeof t?c.fill(a,t):c.fill(a):c.fill(0),c},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return c.SlowBuffer(e)}},93904:(e,a,t)=>{const c=Symbol("SemVer ANY");class f{static get ANY(){return c}constructor(e,a){if(a=d(a),e instanceof f){if(e.loose===!!a.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),b("comparator",e,a),this.options=a,this.loose=!!a.loose,this.parse(e),this.semver===c?this.value="":this.value=this.operator+this.semver.version,b("comp",this)}parse(e){const a=this.options.loose?r[n.COMPARATORLOOSE]:r[n.COMPARATOR],t=e.match(a);if(!t)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),t[2]?this.semver=new o(t[2],this.options.loose):this.semver=c}toString(){return this.value}test(e){if(b("Comparator.test",e,this.options.loose),this.semver===c||e===c)return!0;if("string"==typeof e)try{e=new o(e,this.options)}catch(e){return!1}return i(e,this.operator,this.semver,this.options)}intersects(e,a){if(!(e instanceof f))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new s(e.value,a).test(this.value):""===e.operator?""===e.value||new s(this.value,a).test(e.semver):!((a=d(a)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!a.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(i(this.semver,"<",e.semver,a)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(i(this.semver,">",e.semver,a)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=f;const d=t(98587),{safeRe:r,t:n}=t(99718),i=t(72111),b=t(57272),o=t(53908),s=t(78311)},78311:(e,a,t)=>{const c=/\s+/g;class f{constructor(e,a){if(a=r(a),e instanceof f)return e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease?e:new f(e.raw,a);if(e instanceof n)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=e.trim().replace(c," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!m(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&x(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const a=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=a[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const a=((this.options.includePrerelease&&p)|(this.options.loose&&g))+":"+e,t=d.get(a);if(t)return t;const c=this.options.loose,f=c?o[s.HYPHENRANGELOOSE]:o[s.HYPHENRANGE];e=e.replace(f,S(this.options.includePrerelease)),i("hyphen replace",e),e=e.replace(o[s.COMPARATORTRIM],l),i("comparator trim",e),e=e.replace(o[s.TILDETRIM],u),i("tilde trim",e),e=e.replace(o[s.CARETTRIM],h),i("caret trim",e);let r=e.split(" ").map((e=>A(e,this.options))).join(" ").split(/\s+/).map((e=>L(e,this.options)));c&&(r=r.filter((e=>(i("loose invalid filter",e,this.options),!!e.match(o[s.COMPARATORLOOSE]))))),i("range list",r);const b=new Map,x=r.map((e=>new n(e,this.options)));for(const e of x){if(m(e))return[e];b.set(e.value,e)}b.size>1&&b.has("")&&b.delete("");const y=[...b.values()];return d.set(a,y),y}intersects(e,a){if(!(e instanceof f))throw new TypeError("a Range is required");return this.set.some((t=>y(t,a)&&e.set.some((e=>y(e,a)&&t.every((t=>e.every((e=>t.intersects(e,a)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new b(e,this.options)}catch(e){return!1}for(let a=0;a"<0.0.0-0"===e.value,x=e=>""===e.value,y=(e,a)=>{let t=!0;const c=e.slice();let f=c.pop();for(;t&&c.length;)t=c.every((e=>f.intersects(e,a))),f=c.pop();return t},A=(e,a)=>(i("comp",e,a),e=I(e,a),i("caret",e),e=w(e,a),i("tildes",e),e=C(e,a),i("xrange",e),e=B(e,a),i("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,a)=>e.trim().split(/\s+/).map((e=>_(e,a))).join(" "),_=(e,a)=>{const t=a.loose?o[s.TILDELOOSE]:o[s.TILDE];return e.replace(t,((a,t,c,f,d)=>{let r;return i("tilde",e,a,t,c,f,d),v(t)?r="":v(c)?r=`>=${t}.0.0 <${+t+1}.0.0-0`:v(f)?r=`>=${t}.${c}.0 <${t}.${+c+1}.0-0`:d?(i("replaceTilde pr",d),r=`>=${t}.${c}.${f}-${d} <${t}.${+c+1}.0-0`):r=`>=${t}.${c}.${f} <${t}.${+c+1}.0-0`,i("tilde return",r),r}))},I=(e,a)=>e.trim().split(/\s+/).map((e=>E(e,a))).join(" "),E=(e,a)=>{i("caret",e,a);const t=a.loose?o[s.CARETLOOSE]:o[s.CARET],c=a.includePrerelease?"-0":"";return e.replace(t,((a,t,f,d,r)=>{let n;return i("caret",e,a,t,f,d,r),v(t)?n="":v(f)?n=`>=${t}.0.0${c} <${+t+1}.0.0-0`:v(d)?n="0"===t?`>=${t}.${f}.0${c} <${t}.${+f+1}.0-0`:`>=${t}.${f}.0${c} <${+t+1}.0.0-0`:r?(i("replaceCaret pr",r),n="0"===t?"0"===f?`>=${t}.${f}.${d}-${r} <${t}.${f}.${+d+1}-0`:`>=${t}.${f}.${d}-${r} <${t}.${+f+1}.0-0`:`>=${t}.${f}.${d}-${r} <${+t+1}.0.0-0`):(i("no pr"),n="0"===t?"0"===f?`>=${t}.${f}.${d}${c} <${t}.${f}.${+d+1}-0`:`>=${t}.${f}.${d}${c} <${t}.${+f+1}.0-0`:`>=${t}.${f}.${d} <${+t+1}.0.0-0`),i("caret return",n),n}))},C=(e,a)=>(i("replaceXRanges",e,a),e.split(/\s+/).map((e=>M(e,a))).join(" ")),M=(e,a)=>{e=e.trim();const t=a.loose?o[s.XRANGELOOSE]:o[s.XRANGE];return e.replace(t,((t,c,f,d,r,n)=>{i("xRange",e,t,c,f,d,r,n);const b=v(f),o=b||v(d),s=o||v(r),l=s;return"="===c&&l&&(c=""),n=a.includePrerelease?"-0":"",b?t=">"===c||"<"===c?"<0.0.0-0":"*":c&&l?(o&&(d=0),r=0,">"===c?(c=">=",o?(f=+f+1,d=0,r=0):(d=+d+1,r=0)):"<="===c&&(c="<",o?f=+f+1:d=+d+1),"<"===c&&(n="-0"),t=`${c+f}.${d}.${r}${n}`):o?t=`>=${f}.0.0${n} <${+f+1}.0.0-0`:s&&(t=`>=${f}.${d}.0${n} <${f}.${+d+1}.0-0`),i("xRange return",t),t}))},B=(e,a)=>(i("replaceStars",e,a),e.trim().replace(o[s.STAR],"")),L=(e,a)=>(i("replaceGTE0",e,a),e.trim().replace(o[a.includePrerelease?s.GTE0PRE:s.GTE0],"")),S=e=>(a,t,c,f,d,r,n,i,b,o,s,l)=>`${t=v(c)?"":v(f)?`>=${c}.0.0${e?"-0":""}`:v(d)?`>=${c}.${f}.0${e?"-0":""}`:r?`>=${t}`:`>=${t}${e?"-0":""}`} ${i=v(b)?"":v(o)?`<${+b+1}.0.0-0`:v(s)?`<${b}.${+o+1}.0-0`:l?`<=${b}.${o}.${s}-${l}`:e?`<${b}.${o}.${+s+1}-0`:`<=${i}`}`.trim(),k=(e,a,t)=>{for(let t=0;t0){const c=e[t].semver;if(c.major===a.major&&c.minor===a.minor&&c.patch===a.patch)return!0}return!1}return!0}},53908:(e,a,t)=>{const c=t(57272),{MAX_LENGTH:f,MAX_SAFE_INTEGER:d}=t(16874),{safeRe:r,t:n}=t(99718),i=t(98587),{compareIdentifiers:b}=t(61123);class o{constructor(e,a){if(a=i(a),e instanceof o){if(e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>f)throw new TypeError(`version is longer than ${f} characters`);c("SemVer",e,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;const t=e.trim().match(a.loose?r[n.LOOSE]:r[n.FULL]);if(!t)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>d||this.major<0)throw new TypeError("Invalid major version");if(this.minor>d||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>d||this.patch<0)throw new TypeError("Invalid patch version");t[4]?this.prerelease=t[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const a=+e;if(a>=0&&a=0;)"number"==typeof this.prerelease[c]&&(this.prerelease[c]++,c=-2);if(-1===c){if(a===this.prerelease.join(".")&&!1===t)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(a){let c=[a,e];!1===t&&(c=[a]),0===b(this.prerelease[0],a)?isNaN(this.prerelease[1])&&(this.prerelease=c):this.prerelease=c}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=o},57414:(e,a,t)=>{const c=t(30144);e.exports=(e,a)=>{const t=c(e.trim().replace(/^[=v]+/,""),a);return t?t.version:null}},72111:(e,a,t)=>{const c=t(94641),f=t(13999),d=t(35580),r=t(54089),n=t(7059),i=t(25200);e.exports=(e,a,t,b)=>{switch(a){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e===t;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e!==t;case"":case"=":case"==":return c(e,t,b);case"!=":return f(e,t,b);case">":return d(e,t,b);case">=":return r(e,t,b);case"<":return n(e,t,b);case"<=":return i(e,t,b);default:throw new TypeError(`Invalid operator: ${a}`)}}},46170:(e,a,t)=>{const c=t(53908),f=t(30144),{safeRe:d,t:r}=t(99718);e.exports=(e,a)=>{if(e instanceof c)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let t=null;if((a=a||{}).rtl){const c=a.includePrerelease?d[r.COERCERTLFULL]:d[r.COERCERTL];let f;for(;(f=c.exec(e))&&(!t||t.index+t[0].length!==e.length);)t&&f.index+f[0].length===t.index+t[0].length||(t=f),c.lastIndex=f.index+f[1].length+f[2].length;c.lastIndex=-1}else t=e.match(a.includePrerelease?d[r.COERCEFULL]:d[r.COERCE]);if(null===t)return null;const n=t[2],i=t[3]||"0",b=t[4]||"0",o=a.includePrerelease&&t[5]?`-${t[5]}`:"",s=a.includePrerelease&&t[6]?`+${t[6]}`:"";return f(`${n}.${i}.${b}${o}${s}`,a)}},40909:(e,a,t)=>{const c=t(53908);e.exports=(e,a,t)=>{const f=new c(e,t),d=new c(a,t);return f.compare(d)||f.compareBuild(d)}},11763:(e,a,t)=>{const c=t(50560);e.exports=(e,a)=>c(e,a,!0)},50560:(e,a,t)=>{const c=t(53908);e.exports=(e,a,t)=>new c(e,t).compare(new c(a,t))},51832:(e,a,t)=>{const c=t(30144);e.exports=(e,a)=>{const t=c(e,null,!0),f=c(a,null,!0),d=t.compare(f);if(0===d)return null;const r=d>0,n=r?t:f,i=r?f:t,b=!!n.prerelease.length;if(i.prerelease.length&&!b)return i.patch||i.minor?n.patch?"patch":n.minor?"minor":"major":"major";const o=b?"pre":"";return t.major!==f.major?o+"major":t.minor!==f.minor?o+"minor":t.patch!==f.patch?o+"patch":"prerelease"}},94641:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>0===c(e,a,t)},35580:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>c(e,a,t)>0},54089:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>c(e,a,t)>=0},93007:(e,a,t)=>{const c=t(53908);e.exports=(e,a,t,f,d)=>{"string"==typeof t&&(d=f,f=t,t=void 0);try{return new c(e instanceof c?e.version:e,t).inc(a,f,d).version}catch(e){return null}}},7059:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>c(e,a,t)<0},25200:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>c(e,a,t)<=0},32938:(e,a,t)=>{const c=t(53908);e.exports=(e,a)=>new c(e,a).major},46254:(e,a,t)=>{const c=t(53908);e.exports=(e,a)=>new c(e,a).minor},13999:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>0!==c(e,a,t)},30144:(e,a,t)=>{const c=t(53908);e.exports=(e,a,t=!1)=>{if(e instanceof c)return e;try{return new c(e,a)}catch(e){if(!t)return null;throw e}}},24493:(e,a,t)=>{const c=t(53908);e.exports=(e,a)=>new c(e,a).patch},31729:(e,a,t)=>{const c=t(30144);e.exports=(e,a)=>{const t=c(e,a);return t&&t.prerelease.length?t.prerelease:null}},9970:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>c(a,e,t)},74277:(e,a,t)=>{const c=t(40909);e.exports=(e,a)=>e.sort(((e,t)=>c(t,e,a)))},97638:(e,a,t)=>{const c=t(78311);e.exports=(e,a,t)=>{try{a=new c(a,t)}catch(e){return!1}return a.test(e)}},43927:(e,a,t)=>{const c=t(40909);e.exports=(e,a)=>e.sort(((e,t)=>c(e,t,a)))},56953:(e,a,t)=>{const c=t(30144);e.exports=(e,a)=>{const t=c(e,a);return t?t.version:null}},99589:(e,a,t)=>{const c=t(99718),f=t(16874),d=t(53908),r=t(61123),n=t(30144),i=t(56953),b=t(57414),o=t(93007),s=t(51832),l=t(32938),u=t(46254),h=t(24493),p=t(31729),g=t(50560),m=t(9970),x=t(11763),y=t(40909),A=t(43927),v=t(74277),w=t(35580),_=t(7059),I=t(94641),E=t(13999),C=t(54089),M=t(25200),B=t(72111),L=t(46170),S=t(93904),k=t(78311),N=t(97638),P=t(77631),R=t(19628),O=t(270),D=t(41261),T=t(13874),F=t(97075),Q=t(75571),U=t(5342),j=t(76780),H=t(72525),$=t(75032);e.exports={parse:n,valid:i,clean:b,inc:o,diff:s,major:l,minor:u,patch:h,prerelease:p,compare:g,rcompare:m,compareLoose:x,compareBuild:y,sort:A,rsort:v,gt:w,lt:_,eq:I,neq:E,gte:C,lte:M,cmp:B,coerce:L,Comparator:S,Range:k,satisfies:N,toComparators:P,maxSatisfying:R,minSatisfying:O,minVersion:D,validRange:T,outside:F,gtr:Q,ltr:U,intersects:j,simplifyRange:H,subset:$,SemVer:d,re:c.re,src:c.src,tokens:c.t,SEMVER_SPEC_VERSION:f.SEMVER_SPEC_VERSION,RELEASE_TYPES:f.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers}},16874:e=>{const a=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:a,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},57272:e=>{const a="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=a},61123:e=>{const a=/^[0-9]+$/,t=(e,t)=>{const c=a.test(e),f=a.test(t);return c&&f&&(e=+e,t=+t),e===t?0:c&&!f?-1:f&&!c?1:et(a,e)}},68794:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const a=this.map.get(e);return void 0===a?void 0:(this.map.delete(e),this.map.set(e,a),a)}delete(e){return this.map.delete(e)}set(e,a){if(!this.delete(e)&&void 0!==a){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,a)}return this}}},98587:e=>{const a=Object.freeze({loose:!0}),t=Object.freeze({});e.exports=e=>e?"object"!=typeof e?a:e:t},99718:(e,a,t)=>{const{MAX_SAFE_COMPONENT_LENGTH:c,MAX_SAFE_BUILD_LENGTH:f,MAX_LENGTH:d}=t(16874),r=t(57272),n=(a=e.exports={}).re=[],i=a.safeRe=[],b=a.src=[],o=a.t={};let s=0;const l="[a-zA-Z0-9-]",u=[["\\s",1],["\\d",d],[l,f]],h=(e,a,t)=>{const c=(e=>{for(const[a,t]of u)e=e.split(`${a}*`).join(`${a}{0,${t}}`).split(`${a}+`).join(`${a}{1,${t}}`);return e})(a),f=s++;r(e,f,a),o[e]=f,b[f]=a,n[f]=new RegExp(a,t?"g":void 0),i[f]=new RegExp(c,t?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${l}*`),h("MAINVERSION",`(${b[o.NUMERICIDENTIFIER]})\\.(${b[o.NUMERICIDENTIFIER]})\\.(${b[o.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${b[o.NUMERICIDENTIFIERLOOSE]})\\.(${b[o.NUMERICIDENTIFIERLOOSE]})\\.(${b[o.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${b[o.NUMERICIDENTIFIER]}|${b[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${b[o.NUMERICIDENTIFIERLOOSE]}|${b[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${b[o.PRERELEASEIDENTIFIER]}(?:\\.${b[o.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${b[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${b[o.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${l}+`),h("BUILD",`(?:\\+(${b[o.BUILDIDENTIFIER]}(?:\\.${b[o.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${b[o.MAINVERSION]}${b[o.PRERELEASE]}?${b[o.BUILD]}?`),h("FULL",`^${b[o.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${b[o.MAINVERSIONLOOSE]}${b[o.PRERELEASELOOSE]}?${b[o.BUILD]}?`),h("LOOSE",`^${b[o.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${b[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${b[o.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${b[o.XRANGEIDENTIFIER]})(?:\\.(${b[o.XRANGEIDENTIFIER]})(?:\\.(${b[o.XRANGEIDENTIFIER]})(?:${b[o.PRERELEASE]})?${b[o.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${b[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[o.XRANGEIDENTIFIERLOOSE]})(?:${b[o.PRERELEASELOOSE]})?${b[o.BUILD]}?)?)?`),h("XRANGE",`^${b[o.GTLT]}\\s*${b[o.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${b[o.GTLT]}\\s*${b[o.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${c}})(?:\\.(\\d{1,${c}}))?(?:\\.(\\d{1,${c}}))?`),h("COERCE",`${b[o.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",b[o.COERCEPLAIN]+`(?:${b[o.PRERELEASE]})?`+`(?:${b[o.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",b[o.COERCE],!0),h("COERCERTLFULL",b[o.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${b[o.LONETILDE]}\\s+`,!0),a.tildeTrimReplace="$1~",h("TILDE",`^${b[o.LONETILDE]}${b[o.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${b[o.LONETILDE]}${b[o.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${b[o.LONECARET]}\\s+`,!0),a.caretTrimReplace="$1^",h("CARET",`^${b[o.LONECARET]}${b[o.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${b[o.LONECARET]}${b[o.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${b[o.GTLT]}\\s*(${b[o.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${b[o.GTLT]}\\s*(${b[o.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${b[o.GTLT]}\\s*(${b[o.LOOSEPLAIN]}|${b[o.XRANGEPLAIN]})`,!0),a.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${b[o.XRANGEPLAIN]})\\s+-\\s+(${b[o.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${b[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${b[o.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},75571:(e,a,t)=>{const c=t(97075);e.exports=(e,a,t)=>c(e,a,">",t)},76780:(e,a,t)=>{const c=t(78311);e.exports=(e,a,t)=>(e=new c(e,t),a=new c(a,t),e.intersects(a,t))},5342:(e,a,t)=>{const c=t(97075);e.exports=(e,a,t)=>c(e,a,"<",t)},19628:(e,a,t)=>{const c=t(53908),f=t(78311);e.exports=(e,a,t)=>{let d=null,r=null,n=null;try{n=new f(a,t)}catch(e){return null}return e.forEach((e=>{n.test(e)&&(d&&-1!==r.compare(e)||(d=e,r=new c(d,t)))})),d}},270:(e,a,t)=>{const c=t(53908),f=t(78311);e.exports=(e,a,t)=>{let d=null,r=null,n=null;try{n=new f(a,t)}catch(e){return null}return e.forEach((e=>{n.test(e)&&(d&&1!==r.compare(e)||(d=e,r=new c(d,t)))})),d}},41261:(e,a,t)=>{const c=t(53908),f=t(78311),d=t(35580);e.exports=(e,a)=>{e=new f(e,a);let t=new c("0.0.0");if(e.test(t))return t;if(t=new c("0.0.0-0"),e.test(t))return t;t=null;for(let a=0;a{const a=new c(e.semver.version);switch(e.operator){case">":0===a.prerelease.length?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":r&&!d(a,r)||(r=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!r||t&&!d(t,r)||(t=r)}return t&&e.test(t)?t:null}},97075:(e,a,t)=>{const c=t(53908),f=t(93904),{ANY:d}=f,r=t(78311),n=t(97638),i=t(35580),b=t(7059),o=t(25200),s=t(54089);e.exports=(e,a,t,l)=>{let u,h,p,g,m;switch(e=new c(e,l),a=new r(a,l),t){case">":u=i,h=o,p=b,g=">",m=">=";break;case"<":u=b,h=s,p=i,g="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(n(e,a,l))return!1;for(let t=0;t{e.semver===d&&(e=new f(">=0.0.0")),r=r||e,n=n||e,u(e.semver,r.semver,l)?r=e:p(e.semver,n.semver,l)&&(n=e)})),r.operator===g||r.operator===m)return!1;if((!n.operator||n.operator===g)&&h(e,n.semver))return!1;if(n.operator===m&&p(e,n.semver))return!1}return!0}},72525:(e,a,t)=>{const c=t(97638),f=t(50560);e.exports=(e,a,t)=>{const d=[];let r=null,n=null;const i=e.sort(((e,a)=>f(e,a,t)));for(const e of i)c(e,a,t)?(n=e,r||(r=e)):(n&&d.push([r,n]),n=null,r=null);r&&d.push([r,null]);const b=[];for(const[e,a]of d)e===a?b.push(e):a||e!==i[0]?a?e===i[0]?b.push(`<=${a}`):b.push(`${e} - ${a}`):b.push(`>=${e}`):b.push("*");const o=b.join(" || "),s="string"==typeof a.raw?a.raw:String(a);return o.length{const c=t(78311),f=t(93904),{ANY:d}=f,r=t(97638),n=t(50560),i=[new f(">=0.0.0-0")],b=[new f(">=0.0.0")],o=(e,a,t)=>{if(e===a)return!0;if(1===e.length&&e[0].semver===d){if(1===a.length&&a[0].semver===d)return!0;e=t.includePrerelease?i:b}if(1===a.length&&a[0].semver===d){if(t.includePrerelease)return!0;a=b}const c=new Set;let f,o,u,h,p,g,m;for(const a of e)">"===a.operator||">="===a.operator?f=s(f,a,t):"<"===a.operator||"<="===a.operator?o=l(o,a,t):c.add(a.semver);if(c.size>1)return null;if(f&&o){if(u=n(f.semver,o.semver,t),u>0)return null;if(0===u&&(">="!==f.operator||"<="!==o.operator))return null}for(const e of c){if(f&&!r(e,String(f),t))return null;if(o&&!r(e,String(o),t))return null;for(const c of a)if(!r(e,String(c),t))return!1;return!0}let x=!(!o||t.includePrerelease||!o.semver.prerelease.length)&&o.semver,y=!(!f||t.includePrerelease||!f.semver.prerelease.length)&&f.semver;x&&1===x.prerelease.length&&"<"===o.operator&&0===x.prerelease[0]&&(x=!1);for(const e of a){if(m=m||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,f)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(h=s(f,e,t),h===e&&h!==f)return!1}else if(">="===f.operator&&!r(f.semver,String(e),t))return!1;if(o)if(x&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===x.major&&e.semver.minor===x.minor&&e.semver.patch===x.patch&&(x=!1),"<"===e.operator||"<="===e.operator){if(p=l(o,e,t),p===e&&p!==o)return!1}else if("<="===o.operator&&!r(o.semver,String(e),t))return!1;if(!e.operator&&(o||f)&&0!==u)return!1}return!(f&&g&&!o&&0!==u||o&&m&&!f&&0!==u||y||x)},s=(e,a,t)=>{if(!e)return a;const c=n(e.semver,a.semver,t);return c>0?e:c<0||">"===a.operator&&">="===e.operator?a:e},l=(e,a,t)=>{if(!e)return a;const c=n(e.semver,a.semver,t);return c<0?e:c>0||"<"===a.operator&&"<="===e.operator?a:e};e.exports=(e,a,t={})=>{if(e===a)return!0;e=new c(e,t),a=new c(a,t);let f=!1;e:for(const c of e.set){for(const e of a.set){const a=o(c,e,t);if(f=f||null!==a,a)continue e}if(f)return!1}return!0}},77631:(e,a,t)=>{const c=t(78311);e.exports=(e,a)=>new c(e,a).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},13874:(e,a,t)=>{const c=t(78311);e.exports=(e,a)=>{try{return new c(e,a).range||"*"}catch(e){return null}}},96897:(e,a,t)=>{"use strict";var c=t(70453),f=t(30041),d=t(30592)(),r=t(75795),n=t(69675),i=c("%Math.floor%");e.exports=function(e,a){if("function"!=typeof e)throw new n("`fn` is not a function");if("number"!=typeof a||a<0||a>4294967295||i(a)!==a)throw new n("`length` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],c=!0,b=!0;if("length"in e&&r){var o=r(e,"length");o&&!o.configurable&&(c=!1),o&&!o.writable&&(b=!1)}return(c||b||!t)&&(d?f(e,"length",a,!0,!0):f(e,"length",a)),e}},90392:(e,a,t)=>{var c=t(92861).Buffer;function f(e,a){this._block=c.alloc(e),this._finalSize=a,this._blockSize=e,this._len=0}f.prototype.update=function(e,a){"string"==typeof e&&(a=a||"utf8",e=c.from(e,a));for(var t=this._block,f=this._blockSize,d=e.length,r=this._len,n=0;n=this._finalSize&&(this._update(this._block),this._block.fill(0));var t=8*this._len;if(t<=4294967295)this._block.writeUInt32BE(t,this._blockSize-4);else{var c=(4294967295&t)>>>0,f=(t-c)/4294967296;this._block.writeUInt32BE(f,this._blockSize-8),this._block.writeUInt32BE(c,this._blockSize-4)}this._update(this._block);var d=this._hash();return e?d.toString(e):d},f.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=f},62802:(e,a,t)=>{var c=e.exports=function(e){e=e.toLowerCase();var a=c[e];if(!a)throw new Error(e+" is not supported (we accept pull requests)");return new a};c.sha=t(27816),c.sha1=t(63737),c.sha224=t(26710),c.sha256=t(24107),c.sha384=t(32827),c.sha512=t(82890)},27816:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function i(){this.init(),this._w=n,f.call(this,64,56)}function b(e){return e<<30|e>>>2}function o(e,a,t,c){return 0===e?a&t|~a&c:2===e?a&t|a&c|t&c:a^t^c}c(i,f),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(e){for(var a,t=this._w,c=0|this._a,f=0|this._b,d=0|this._c,n=0|this._d,i=0|this._e,s=0;s<16;++s)t[s]=e.readInt32BE(4*s);for(;s<80;++s)t[s]=t[s-3]^t[s-8]^t[s-14]^t[s-16];for(var l=0;l<80;++l){var u=~~(l/20),h=0|((a=c)<<5|a>>>27)+o(u,f,d,n)+i+t[l]+r[u];i=n,n=d,d=b(f),f=c,c=h}this._a=c+this._a|0,this._b=f+this._b|0,this._c=d+this._c|0,this._d=n+this._d|0,this._e=i+this._e|0},i.prototype._hash=function(){var e=d.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=i},63737:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function i(){this.init(),this._w=n,f.call(this,64,56)}function b(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function s(e,a,t,c){return 0===e?a&t|~a&c:2===e?a&t|a&c|t&c:a^t^c}c(i,f),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(e){for(var a,t=this._w,c=0|this._a,f=0|this._b,d=0|this._c,n=0|this._d,i=0|this._e,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<80;++l)t[l]=(a=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|a>>>31;for(var u=0;u<80;++u){var h=~~(u/20),p=b(c)+s(h,f,d,n)+i+t[u]+r[h]|0;i=n,n=d,d=o(f),f=c,c=p}this._a=c+this._a|0,this._b=f+this._b|0,this._c=d+this._c|0,this._d=n+this._d|0,this._e=i+this._e|0},i.prototype._hash=function(){var e=d.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=i},26710:(e,a,t)=>{var c=t(56698),f=t(24107),d=t(90392),r=t(92861).Buffer,n=new Array(64);function i(){this.init(),this._w=n,d.call(this,64,56)}c(i,f),i.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},i.prototype._hash=function(){var e=r.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=i},24107:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[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],n=new Array(64);function i(){this.init(),this._w=n,f.call(this,64,56)}function b(e,a,t){return t^e&(a^t)}function o(e,a,t){return e&a|t&(e|a)}function s(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function l(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function u(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}c(i,f),i.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},i.prototype._update=function(e){for(var a,t=this._w,c=0|this._a,f=0|this._b,d=0|this._c,n=0|this._d,i=0|this._e,h=0|this._f,p=0|this._g,g=0|this._h,m=0;m<16;++m)t[m]=e.readInt32BE(4*m);for(;m<64;++m)t[m]=0|(((a=t[m-2])>>>17|a<<15)^(a>>>19|a<<13)^a>>>10)+t[m-7]+u(t[m-15])+t[m-16];for(var x=0;x<64;++x){var y=g+l(i)+b(i,h,p)+r[x]+t[x]|0,A=s(c)+o(c,f,d)|0;g=p,p=h,h=i,i=n+y|0,n=d,d=f,f=c,c=y+A|0}this._a=c+this._a|0,this._b=f+this._b|0,this._c=d+this._c|0,this._d=n+this._d|0,this._e=i+this._e|0,this._f=h+this._f|0,this._g=p+this._g|0,this._h=g+this._h|0},i.prototype._hash=function(){var e=d.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=i},32827:(e,a,t)=>{var c=t(56698),f=t(82890),d=t(90392),r=t(92861).Buffer,n=new Array(160);function i(){this.init(),this._w=n,d.call(this,128,112)}c(i,f),i.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},i.prototype._hash=function(){var e=r.allocUnsafe(48);function a(a,t,c){e.writeInt32BE(a,c),e.writeInt32BE(t,c+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),e},e.exports=i},82890:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[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],n=new Array(160);function i(){this.init(),this._w=n,f.call(this,128,112)}function b(e,a,t){return t^e&(a^t)}function o(e,a,t){return e&a|t&(e|a)}function s(e,a){return(e>>>28|a<<4)^(a>>>2|e<<30)^(a>>>7|e<<25)}function l(e,a){return(e>>>14|a<<18)^(e>>>18|a<<14)^(a>>>9|e<<23)}function u(e,a){return(e>>>1|a<<31)^(e>>>8|a<<24)^e>>>7}function h(e,a){return(e>>>1|a<<31)^(e>>>8|a<<24)^(e>>>7|a<<25)}function p(e,a){return(e>>>19|a<<13)^(a>>>29|e<<3)^e>>>6}function g(e,a){return(e>>>19|a<<13)^(a>>>29|e<<3)^(e>>>6|a<<26)}function m(e,a){return e>>>0>>0?1:0}c(i,f),i.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},i.prototype._update=function(e){for(var a=this._w,t=0|this._ah,c=0|this._bh,f=0|this._ch,d=0|this._dh,n=0|this._eh,i=0|this._fh,x=0|this._gh,y=0|this._hh,A=0|this._al,v=0|this._bl,w=0|this._cl,_=0|this._dl,I=0|this._el,E=0|this._fl,C=0|this._gl,M=0|this._hl,B=0;B<32;B+=2)a[B]=e.readInt32BE(4*B),a[B+1]=e.readInt32BE(4*B+4);for(;B<160;B+=2){var L=a[B-30],S=a[B-30+1],k=u(L,S),N=h(S,L),P=p(L=a[B-4],S=a[B-4+1]),R=g(S,L),O=a[B-14],D=a[B-14+1],T=a[B-32],F=a[B-32+1],Q=N+D|0,U=k+O+m(Q,N)|0;U=(U=U+P+m(Q=Q+R|0,R)|0)+T+m(Q=Q+F|0,F)|0,a[B]=U,a[B+1]=Q}for(var j=0;j<160;j+=2){U=a[j],Q=a[j+1];var H=o(t,c,f),$=o(A,v,w),q=s(t,A),G=s(A,t),z=l(n,I),K=l(I,n),V=r[j],Z=r[j+1],J=b(n,i,x),W=b(I,E,C),Y=M+K|0,X=y+z+m(Y,M)|0;X=(X=(X=X+J+m(Y=Y+W|0,W)|0)+V+m(Y=Y+Z|0,Z)|0)+U+m(Y=Y+Q|0,Q)|0;var ee=G+$|0,ae=q+H+m(ee,G)|0;y=x,M=C,x=i,C=E,i=n,E=I,n=d+X+m(I=_+Y|0,_)|0,d=f,_=w,f=c,w=v,c=t,v=A,t=X+ae+m(A=Y+ee|0,Y)|0}this._al=this._al+A|0,this._bl=this._bl+v|0,this._cl=this._cl+w|0,this._dl=this._dl+_|0,this._el=this._el+I|0,this._fl=this._fl+E|0,this._gl=this._gl+C|0,this._hl=this._hl+M|0,this._ah=this._ah+t+m(this._al,A)|0,this._bh=this._bh+c+m(this._bl,v)|0,this._ch=this._ch+f+m(this._cl,w)|0,this._dh=this._dh+d+m(this._dl,_)|0,this._eh=this._eh+n+m(this._el,I)|0,this._fh=this._fh+i+m(this._fl,E)|0,this._gh=this._gh+x+m(this._gl,C)|0,this._hh=this._hh+y+m(this._hl,M)|0},i.prototype._hash=function(){var e=d.allocUnsafe(64);function a(a,t,c){e.writeInt32BE(a,c),e.writeInt32BE(t,c+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),a(this._gh,this._gl,48),a(this._hh,this._hl,56),e},e.exports=i},88310:(e,a,t)=>{e.exports=f;var c=t(37007).EventEmitter;function f(){c.call(this)}t(56698)(f,c),f.Readable=t(45412),f.Writable=t(16708),f.Duplex=t(25382),f.Transform=t(74610),f.PassThrough=t(63600),f.finished=t(86238),f.pipeline=t(57758),f.Stream=f,f.prototype.pipe=function(e,a){var t=this;function f(a){e.writable&&!1===e.write(a)&&t.pause&&t.pause()}function d(){t.readable&&t.resume&&t.resume()}t.on("data",f),e.on("drain",d),e._isStdio||a&&!1===a.end||(t.on("end",n),t.on("close",i));var r=!1;function n(){r||(r=!0,e.end())}function i(){r||(r=!0,"function"==typeof e.destroy&&e.destroy())}function b(e){if(o(),0===c.listenerCount(this,"error"))throw e}function o(){t.removeListener("data",f),e.removeListener("drain",d),t.removeListener("end",n),t.removeListener("close",i),t.removeListener("error",b),e.removeListener("error",b),t.removeListener("end",o),t.removeListener("close",o),e.removeListener("close",o)}return t.on("error",b),e.on("error",b),t.on("end",o),t.on("close",o),e.on("close",o),e.emit("pipe",t),e}},11568:(e,a,t)=>{var c=t(55537),f=t(6917),d=t(57510),r=t(86866),n=t(59817),i=a;i.request=function(e,a){e="string"==typeof e?n.parse(e):d(e);var f=-1===t.g.location.protocol.search(/^https?:$/)?"http:":"",r=e.protocol||f,i=e.hostname||e.host,b=e.port,o=e.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),e.url=(i?r+"//"+i:"")+(b?":"+b:"")+o,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var s=new c(e);return a&&s.on("response",a),s},i.get=function(e,a){var t=i.request(e,a);return t.end(),t},i.ClientRequest=c,i.IncomingMessage=f.IncomingMessage,i.Agent=function(){},i.Agent.defaultMaxSockets=4,i.globalAgent=new i.Agent,i.STATUS_CODES=r,i.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"]},6688:(e,a,t)=>{var c;function f(){if(void 0!==c)return c;if(t.g.XMLHttpRequest){c=new t.g.XMLHttpRequest;try{c.open("GET",t.g.XDomainRequest?"/":"https://example.com")}catch(e){c=null}}else c=null;return c}function d(e){var a=f();if(!a)return!1;try{return a.responseType=e,a.responseType===e}catch(e){}return!1}function r(e){return"function"==typeof e}a.fetch=r(t.g.fetch)&&r(t.g.ReadableStream),a.writableStream=r(t.g.WritableStream),a.abortController=r(t.g.AbortController),a.arraybuffer=a.fetch||d("arraybuffer"),a.msstream=!a.fetch&&d("ms-stream"),a.mozchunkedarraybuffer=!a.fetch&&d("moz-chunked-arraybuffer"),a.overrideMimeType=a.fetch||!!f()&&r(f().overrideMimeType),c=null},55537:(e,a,t)=>{var c=t(48287).Buffer,f=t(6688),d=t(56698),r=t(6917),n=t(28399),i=r.IncomingMessage,b=r.readyStates,o=e.exports=function(e){var a,t=this;n.Writable.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+c.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(a){t.setHeader(a,e.headers[a])}));var d=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!f.abortController)d=!1,a=!0;else if("prefer-streaming"===e.mode)a=!1;else if("allow-wrong-content-type"===e.mode)a=!f.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");a=!0}t._mode=function(e,a){return f.fetch&&a?"fetch":f.mozchunkedarraybuffer?"moz-chunked-arraybuffer":f.msstream?"ms-stream":f.arraybuffer&&e?"arraybuffer":"text"}(a,d),t._fetchTimer=null,t._socketTimeout=null,t._socketTimer=null,t.on("finish",(function(){t._onFinish()}))};d(o,n.Writable),o.prototype.setHeader=function(e,a){var t=e.toLowerCase();-1===s.indexOf(t)&&(this._headers[t]={name:e,value:a})},o.prototype.getHeader=function(e){var a=this._headers[e.toLowerCase()];return a?a.value:null},o.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},o.prototype._onFinish=function(){var e=this;if(!e._destroyed){var a=e._opts;"timeout"in a&&0!==a.timeout&&e.setTimeout(a.timeout);var c=e._headers,d=null;"GET"!==a.method&&"HEAD"!==a.method&&(d=new Blob(e._body,{type:(c["content-type"]||{}).value||""}));var r=[];if(Object.keys(c).forEach((function(e){var a=c[e].name,t=c[e].value;Array.isArray(t)?t.forEach((function(e){r.push([a,e])})):r.push([a,t])})),"fetch"===e._mode){var n=null;if(f.abortController){var i=new AbortController;n=i.signal,e._fetchAbortController=i,"requestTimeout"in a&&0!==a.requestTimeout&&(e._fetchTimer=t.g.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),a.requestTimeout))}t.g.fetch(e._opts.url,{method:e._opts.method,headers:r,body:d||void 0,mode:"cors",credentials:a.withCredentials?"include":"same-origin",signal:n}).then((function(a){e._fetchResponse=a,e._resetTimers(!1),e._connect()}),(function(a){e._resetTimers(!0),e._destroyed||e.emit("error",a)}))}else{var o=e._xhr=new t.g.XMLHttpRequest;try{o.open(e._opts.method,e._opts.url,!0)}catch(a){return void process.nextTick((function(){e.emit("error",a)}))}"responseType"in o&&(o.responseType=e._mode),"withCredentials"in o&&(o.withCredentials=!!a.withCredentials),"text"===e._mode&&"overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in a&&(o.timeout=a.requestTimeout,o.ontimeout=function(){e.emit("requestTimeout")}),r.forEach((function(e){o.setRequestHeader(e[0],e[1])})),e._response=null,o.onreadystatechange=function(){switch(o.readyState){case b.LOADING:case b.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(o.onprogress=function(){e._onXHRProgress()}),o.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{o.send(d)}catch(a){return void process.nextTick((function(){e.emit("error",a)}))}}}},o.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var a=e.status;return null!==a&&0!==a}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},o.prototype._connect=function(){var e=this;e._destroyed||(e._response=new i(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(a){e.emit("error",a)})),e.emit("response",e._response))},o.prototype._write=function(e,a,t){this._body.push(e),t()},o.prototype._resetTimers=function(e){var a=this;t.g.clearTimeout(a._socketTimer),a._socketTimer=null,e?(t.g.clearTimeout(a._fetchTimer),a._fetchTimer=null):a._socketTimeout&&(a._socketTimer=t.g.setTimeout((function(){a.emit("timeout")}),a._socketTimeout))},o.prototype.abort=o.prototype.destroy=function(e){var a=this;a._destroyed=!0,a._resetTimers(!0),a._response&&(a._response._destroyed=!0),a._xhr?a._xhr.abort():a._fetchAbortController&&a._fetchAbortController.abort(),e&&a.emit("error",e)},o.prototype.end=function(e,a,t){"function"==typeof e&&(t=e,e=void 0),n.Writable.prototype.end.call(this,e,a,t)},o.prototype.setTimeout=function(e,a){var t=this;a&&t.once("timeout",a),t._socketTimeout=e,t._resetTimers(!1)},o.prototype.flushHeaders=function(){},o.prototype.setNoDelay=function(){},o.prototype.setSocketKeepAlive=function(){};var s=["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"]},6917:(e,a,t)=>{var c=t(48287).Buffer,f=t(6688),d=t(56698),r=t(28399),n=a.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i=a.IncomingMessage=function(e,a,t,d){var n=this;if(r.Readable.call(n),n._mode=t,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",(function(){process.nextTick((function(){n.emit("close")}))})),"fetch"===t){if(n._fetchResponse=a,n.url=a.url,n.statusCode=a.status,n.statusMessage=a.statusText,a.headers.forEach((function(e,a){n.headers[a.toLowerCase()]=e,n.rawHeaders.push(a,e)})),f.writableStream){var i=new WritableStream({write:function(e){return d(!1),new Promise((function(a,t){n._destroyed?t():n.push(c.from(e))?a():n._resumeFetch=a}))},close:function(){d(!0),n._destroyed||n.push(null)},abort:function(e){d(!0),n._destroyed||n.emit("error",e)}});try{return void a.body.pipeTo(i).catch((function(e){d(!0),n._destroyed||n.emit("error",e)}))}catch(e){}}var b=a.body.getReader();!function e(){b.read().then((function(a){n._destroyed||(d(a.done),a.done?n.push(null):(n.push(c.from(a.value)),e()))})).catch((function(e){d(!0),n._destroyed||n.emit("error",e)}))}()}else if(n._xhr=e,n._pos=0,n.url=e.responseURL,n.statusCode=e.status,n.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var a=e.match(/^([^:]+):\s*(.*)/);if(a){var t=a[1].toLowerCase();"set-cookie"===t?(void 0===n.headers[t]&&(n.headers[t]=[]),n.headers[t].push(a[2])):void 0!==n.headers[t]?n.headers[t]+=", "+a[2]:n.headers[t]=a[2],n.rawHeaders.push(a[1],a[2])}})),n._charset="x-user-defined",!f.overrideMimeType){var o=n.rawHeaders["mime-type"];if(o){var s=o.match(/;\s*charset=([^;])(;|$)/);s&&(n._charset=s[1].toLowerCase())}n._charset||(n._charset="utf-8")}};d(i,r.Readable),i.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},i.prototype._onXHRProgress=function(e){var a=this,f=a._xhr,d=null;switch(a._mode){case"text":if((d=f.responseText).length>a._pos){var r=d.substr(a._pos);if("x-user-defined"===a._charset){for(var i=c.alloc(r.length),b=0;ba._pos&&(a.push(c.from(new Uint8Array(o.result.slice(a._pos)))),a._pos=o.result.byteLength)},o.onload=function(){e(!0),a.push(null)},o.readAsArrayBuffer(d)}a._xhr.readyState===n.DONE&&"ms-stream"!==a._mode&&(e(!0),a.push(null))}},83141:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=c.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function d(e){var a;switch(this.encoding=function(e){var a=function(e){if(!e)return"utf8";for(var a;;)switch(e){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 e;default:if(a)return;e=(""+e).toLowerCase(),a=!0}}(e);if("string"!=typeof a&&(c.isEncoding===f||!f(e)))throw new Error("Unknown encoding: "+e);return a||e}(e),this.encoding){case"utf16le":this.text=i,this.end=b,a=4;break;case"utf8":this.fillLast=n,a=4;break;case"base64":this.text=o,this.end=s,a=3;break;default:return this.write=l,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(a)}function r(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function n(e){var a=this.lastTotal-this.lastNeed,t=function(e,a){if(128!=(192&a[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&a.length>1){if(128!=(192&a[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&a.length>2&&128!=(192&a[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==t?t:this.lastNeed<=e.length?(e.copy(this.lastChar,a,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,a,0,e.length),void(this.lastNeed-=e.length))}function i(e,a){if((e.length-a)%2==0){var t=e.toString("utf16le",a);if(t){var c=t.charCodeAt(t.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",a,e.length-1)}function b(e){var a=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return a+this.lastChar.toString("utf16le",0,t)}return a}function o(e,a){var t=(e.length-a)%3;return 0===t?e.toString("base64",a):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",a,e.length-t))}function s(e){var a=e&&e.length?this.write(e):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function l(e){return e.toString(this.encoding)}function u(e){return e&&e.length?this.write(e):""}a.I=d,d.prototype.write=function(e){if(0===e.length)return"";var a,t;if(this.lastNeed){if(void 0===(a=this.fillLast(e)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t=0?(f>0&&(e.lastNeed=f-1),f):--c=0?(f>0&&(e.lastNeed=f-2),f):--c=0?(f>0&&(2===f?f=0:e.lastNeed=f-3),f):0}(this,e,a);if(!this.lastNeed)return e.toString("utf8",a);this.lastTotal=t;var c=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,c),e.toString("utf8",a,c)},d.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},88947:(e,a,t)=>{!function(e){"use strict";var a=function(e){var a,t=new Float64Array(16);if(e)for(a=0;a>24&255,e[a+1]=t>>16&255,e[a+2]=t>>8&255,e[a+3]=255&t,e[a+4]=c>>24&255,e[a+5]=c>>16&255,e[a+6]=c>>8&255,e[a+7]=255&c}function p(e,a,t,c,f){var d,r=0;for(d=0;d>>8)-1}function g(e,a,t,c){return p(e,a,t,c,16)}function m(e,a,t,c){return p(e,a,t,c,32)}function x(e,a,t,c){!function(e,a,t,c){for(var f,d=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,r=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,n=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,i=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,b=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,o=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,s=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,l=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,h=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,p=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,g=255&t[16]|(255&t[17])<<8|(255&t[18])<<16|(255&t[19])<<24,m=255&t[20]|(255&t[21])<<8|(255&t[22])<<16|(255&t[23])<<24,x=255&t[24]|(255&t[25])<<8|(255&t[26])<<16|(255&t[27])<<24,y=255&t[28]|(255&t[29])<<8|(255&t[30])<<16|(255&t[31])<<24,A=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,v=d,w=r,_=n,I=i,E=b,C=o,M=s,B=l,L=u,S=h,k=p,N=g,P=m,R=x,O=y,D=A,T=0;T<20;T+=2)v^=(f=(P^=(f=(L^=(f=(E^=(f=v+P|0)<<7|f>>>25)+v|0)<<9|f>>>23)+E|0)<<13|f>>>19)+L|0)<<18|f>>>14,C^=(f=(w^=(f=(R^=(f=(S^=(f=C+w|0)<<7|f>>>25)+C|0)<<9|f>>>23)+S|0)<<13|f>>>19)+R|0)<<18|f>>>14,k^=(f=(M^=(f=(_^=(f=(O^=(f=k+M|0)<<7|f>>>25)+k|0)<<9|f>>>23)+O|0)<<13|f>>>19)+_|0)<<18|f>>>14,D^=(f=(N^=(f=(B^=(f=(I^=(f=D+N|0)<<7|f>>>25)+D|0)<<9|f>>>23)+I|0)<<13|f>>>19)+B|0)<<18|f>>>14,v^=(f=(I^=(f=(_^=(f=(w^=(f=v+I|0)<<7|f>>>25)+v|0)<<9|f>>>23)+w|0)<<13|f>>>19)+_|0)<<18|f>>>14,C^=(f=(E^=(f=(B^=(f=(M^=(f=C+E|0)<<7|f>>>25)+C|0)<<9|f>>>23)+M|0)<<13|f>>>19)+B|0)<<18|f>>>14,k^=(f=(S^=(f=(L^=(f=(N^=(f=k+S|0)<<7|f>>>25)+k|0)<<9|f>>>23)+N|0)<<13|f>>>19)+L|0)<<18|f>>>14,D^=(f=(O^=(f=(R^=(f=(P^=(f=D+O|0)<<7|f>>>25)+D|0)<<9|f>>>23)+P|0)<<13|f>>>19)+R|0)<<18|f>>>14;v=v+d|0,w=w+r|0,_=_+n|0,I=I+i|0,E=E+b|0,C=C+o|0,M=M+s|0,B=B+l|0,L=L+u|0,S=S+h|0,k=k+p|0,N=N+g|0,P=P+m|0,R=R+x|0,O=O+y|0,D=D+A|0,e[0]=v>>>0&255,e[1]=v>>>8&255,e[2]=v>>>16&255,e[3]=v>>>24&255,e[4]=w>>>0&255,e[5]=w>>>8&255,e[6]=w>>>16&255,e[7]=w>>>24&255,e[8]=_>>>0&255,e[9]=_>>>8&255,e[10]=_>>>16&255,e[11]=_>>>24&255,e[12]=I>>>0&255,e[13]=I>>>8&255,e[14]=I>>>16&255,e[15]=I>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=C>>>0&255,e[21]=C>>>8&255,e[22]=C>>>16&255,e[23]=C>>>24&255,e[24]=M>>>0&255,e[25]=M>>>8&255,e[26]=M>>>16&255,e[27]=M>>>24&255,e[28]=B>>>0&255,e[29]=B>>>8&255,e[30]=B>>>16&255,e[31]=B>>>24&255,e[32]=L>>>0&255,e[33]=L>>>8&255,e[34]=L>>>16&255,e[35]=L>>>24&255,e[36]=S>>>0&255,e[37]=S>>>8&255,e[38]=S>>>16&255,e[39]=S>>>24&255,e[40]=k>>>0&255,e[41]=k>>>8&255,e[42]=k>>>16&255,e[43]=k>>>24&255,e[44]=N>>>0&255,e[45]=N>>>8&255,e[46]=N>>>16&255,e[47]=N>>>24&255,e[48]=P>>>0&255,e[49]=P>>>8&255,e[50]=P>>>16&255,e[51]=P>>>24&255,e[52]=R>>>0&255,e[53]=R>>>8&255,e[54]=R>>>16&255,e[55]=R>>>24&255,e[56]=O>>>0&255,e[57]=O>>>8&255,e[58]=O>>>16&255,e[59]=O>>>24&255,e[60]=D>>>0&255,e[61]=D>>>8&255,e[62]=D>>>16&255,e[63]=D>>>24&255}(e,a,t,c)}function y(e,a,t,c){!function(e,a,t,c){for(var f,d=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,r=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,n=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,i=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,b=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,o=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,s=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,l=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,h=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,p=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,g=255&t[16]|(255&t[17])<<8|(255&t[18])<<16|(255&t[19])<<24,m=255&t[20]|(255&t[21])<<8|(255&t[22])<<16|(255&t[23])<<24,x=255&t[24]|(255&t[25])<<8|(255&t[26])<<16|(255&t[27])<<24,y=255&t[28]|(255&t[29])<<8|(255&t[30])<<16|(255&t[31])<<24,A=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,v=0;v<20;v+=2)d^=(f=(m^=(f=(u^=(f=(b^=(f=d+m|0)<<7|f>>>25)+d|0)<<9|f>>>23)+b|0)<<13|f>>>19)+u|0)<<18|f>>>14,o^=(f=(r^=(f=(x^=(f=(h^=(f=o+r|0)<<7|f>>>25)+o|0)<<9|f>>>23)+h|0)<<13|f>>>19)+x|0)<<18|f>>>14,p^=(f=(s^=(f=(n^=(f=(y^=(f=p+s|0)<<7|f>>>25)+p|0)<<9|f>>>23)+y|0)<<13|f>>>19)+n|0)<<18|f>>>14,A^=(f=(g^=(f=(l^=(f=(i^=(f=A+g|0)<<7|f>>>25)+A|0)<<9|f>>>23)+i|0)<<13|f>>>19)+l|0)<<18|f>>>14,d^=(f=(i^=(f=(n^=(f=(r^=(f=d+i|0)<<7|f>>>25)+d|0)<<9|f>>>23)+r|0)<<13|f>>>19)+n|0)<<18|f>>>14,o^=(f=(b^=(f=(l^=(f=(s^=(f=o+b|0)<<7|f>>>25)+o|0)<<9|f>>>23)+s|0)<<13|f>>>19)+l|0)<<18|f>>>14,p^=(f=(h^=(f=(u^=(f=(g^=(f=p+h|0)<<7|f>>>25)+p|0)<<9|f>>>23)+g|0)<<13|f>>>19)+u|0)<<18|f>>>14,A^=(f=(y^=(f=(x^=(f=(m^=(f=A+y|0)<<7|f>>>25)+A|0)<<9|f>>>23)+m|0)<<13|f>>>19)+x|0)<<18|f>>>14;e[0]=d>>>0&255,e[1]=d>>>8&255,e[2]=d>>>16&255,e[3]=d>>>24&255,e[4]=o>>>0&255,e[5]=o>>>8&255,e[6]=o>>>16&255,e[7]=o>>>24&255,e[8]=p>>>0&255,e[9]=p>>>8&255,e[10]=p>>>16&255,e[11]=p>>>24&255,e[12]=A>>>0&255,e[13]=A>>>8&255,e[14]=A>>>16&255,e[15]=A>>>24&255,e[16]=s>>>0&255,e[17]=s>>>8&255,e[18]=s>>>16&255,e[19]=s>>>24&255,e[20]=l>>>0&255,e[21]=l>>>8&255,e[22]=l>>>16&255,e[23]=l>>>24&255,e[24]=u>>>0&255,e[25]=u>>>8&255,e[26]=u>>>16&255,e[27]=u>>>24&255,e[28]=h>>>0&255,e[29]=h>>>8&255,e[30]=h>>>16&255,e[31]=h>>>24&255}(e,a,t,c)}var A=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function v(e,a,t,c,f,d,r){var n,i,b=new Uint8Array(16),o=new Uint8Array(64);for(i=0;i<16;i++)b[i]=0;for(i=0;i<8;i++)b[i]=d[i];for(;f>=64;){for(x(o,b,r,A),i=0;i<64;i++)e[a+i]=t[c+i]^o[i];for(n=1,i=8;i<16;i++)n=n+(255&b[i])|0,b[i]=255&n,n>>>=8;f-=64,a+=64,c+=64}if(f>0)for(x(o,b,r,A),i=0;i=64;){for(x(i,n,f,A),r=0;r<64;r++)e[a+r]=i[r];for(d=1,r=8;r<16;r++)d=d+(255&n[r])|0,n[r]=255&d,d>>>=8;t-=64,a+=64}if(t>0)for(x(i,n,f,A),r=0;r>>13|t<<3),c=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(t>>>10|c<<6),f=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(c>>>7|f<<9),d=255&e[8]|(255&e[9])<<8,this.r[4]=255&(f>>>4|d<<12),this.r[5]=d>>>1&8190,r=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(d>>>14|r<<2),n=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(r>>>11|n<<5),i=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(n>>>8|i<<8),this.r[9]=i>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function C(e,a,t,c,f,d){var r=new E(d);return r.update(t,c,f),r.finish(e,a),0}function M(e,a,t,c,f,d){var r=new Uint8Array(16);return C(r,0,t,c,f,d),g(e,a,r,0)}function B(e,a,t,c,f){var d;if(t<32)return-1;for(I(e,0,a,0,t,c,f),C(e,16,e,32,t-32,e),d=0;d<16;d++)e[d]=0;return 0}function L(e,a,t,c,f){var d,r=new Uint8Array(32);if(t<32)return-1;if(_(r,0,32,c,f),0!==M(a,16,a,32,t-32,r))return-1;for(I(e,0,a,0,t,c,f),d=0;d<32;d++)e[d]=0;return 0}function S(e,a){var t;for(t=0;t<16;t++)e[t]=0|a[t]}function k(e){var a,t,c=1;for(a=0;a<16;a++)t=e[a]+c+65535,c=Math.floor(t/65536),e[a]=t-65536*c;e[0]+=c-1+37*(c-1)}function N(e,a,t){for(var c,f=~(t-1),d=0;d<16;d++)c=f&(e[d]^a[d]),e[d]^=c,a[d]^=c}function P(e,t){var c,f,d,r=a(),n=a();for(c=0;c<16;c++)n[c]=t[c];for(k(n),k(n),k(n),f=0;f<2;f++){for(r[0]=n[0]-65517,c=1;c<15;c++)r[c]=n[c]-65535-(r[c-1]>>16&1),r[c-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1),d=r[15]>>16&1,r[14]&=65535,N(n,r,1-d)}for(c=0;c<16;c++)e[2*c]=255&n[c],e[2*c+1]=n[c]>>8}function R(e,a){var t=new Uint8Array(32),c=new Uint8Array(32);return P(t,e),P(c,a),m(t,0,c,0)}function O(e){var a=new Uint8Array(32);return P(a,e),1&a[0]}function D(e,a){var t;for(t=0;t<16;t++)e[t]=a[2*t]+(a[2*t+1]<<8);e[15]&=32767}function T(e,a,t){for(var c=0;c<16;c++)e[c]=a[c]+t[c]}function F(e,a,t){for(var c=0;c<16;c++)e[c]=a[c]-t[c]}function Q(e,a,t){var c,f,d=0,r=0,n=0,i=0,b=0,o=0,s=0,l=0,u=0,h=0,p=0,g=0,m=0,x=0,y=0,A=0,v=0,w=0,_=0,I=0,E=0,C=0,M=0,B=0,L=0,S=0,k=0,N=0,P=0,R=0,O=0,D=t[0],T=t[1],F=t[2],Q=t[3],U=t[4],j=t[5],H=t[6],$=t[7],q=t[8],G=t[9],z=t[10],K=t[11],V=t[12],Z=t[13],J=t[14],W=t[15];d+=(c=a[0])*D,r+=c*T,n+=c*F,i+=c*Q,b+=c*U,o+=c*j,s+=c*H,l+=c*$,u+=c*q,h+=c*G,p+=c*z,g+=c*K,m+=c*V,x+=c*Z,y+=c*J,A+=c*W,r+=(c=a[1])*D,n+=c*T,i+=c*F,b+=c*Q,o+=c*U,s+=c*j,l+=c*H,u+=c*$,h+=c*q,p+=c*G,g+=c*z,m+=c*K,x+=c*V,y+=c*Z,A+=c*J,v+=c*W,n+=(c=a[2])*D,i+=c*T,b+=c*F,o+=c*Q,s+=c*U,l+=c*j,u+=c*H,h+=c*$,p+=c*q,g+=c*G,m+=c*z,x+=c*K,y+=c*V,A+=c*Z,v+=c*J,w+=c*W,i+=(c=a[3])*D,b+=c*T,o+=c*F,s+=c*Q,l+=c*U,u+=c*j,h+=c*H,p+=c*$,g+=c*q,m+=c*G,x+=c*z,y+=c*K,A+=c*V,v+=c*Z,w+=c*J,_+=c*W,b+=(c=a[4])*D,o+=c*T,s+=c*F,l+=c*Q,u+=c*U,h+=c*j,p+=c*H,g+=c*$,m+=c*q,x+=c*G,y+=c*z,A+=c*K,v+=c*V,w+=c*Z,_+=c*J,I+=c*W,o+=(c=a[5])*D,s+=c*T,l+=c*F,u+=c*Q,h+=c*U,p+=c*j,g+=c*H,m+=c*$,x+=c*q,y+=c*G,A+=c*z,v+=c*K,w+=c*V,_+=c*Z,I+=c*J,E+=c*W,s+=(c=a[6])*D,l+=c*T,u+=c*F,h+=c*Q,p+=c*U,g+=c*j,m+=c*H,x+=c*$,y+=c*q,A+=c*G,v+=c*z,w+=c*K,_+=c*V,I+=c*Z,E+=c*J,C+=c*W,l+=(c=a[7])*D,u+=c*T,h+=c*F,p+=c*Q,g+=c*U,m+=c*j,x+=c*H,y+=c*$,A+=c*q,v+=c*G,w+=c*z,_+=c*K,I+=c*V,E+=c*Z,C+=c*J,M+=c*W,u+=(c=a[8])*D,h+=c*T,p+=c*F,g+=c*Q,m+=c*U,x+=c*j,y+=c*H,A+=c*$,v+=c*q,w+=c*G,_+=c*z,I+=c*K,E+=c*V,C+=c*Z,M+=c*J,B+=c*W,h+=(c=a[9])*D,p+=c*T,g+=c*F,m+=c*Q,x+=c*U,y+=c*j,A+=c*H,v+=c*$,w+=c*q,_+=c*G,I+=c*z,E+=c*K,C+=c*V,M+=c*Z,B+=c*J,L+=c*W,p+=(c=a[10])*D,g+=c*T,m+=c*F,x+=c*Q,y+=c*U,A+=c*j,v+=c*H,w+=c*$,_+=c*q,I+=c*G,E+=c*z,C+=c*K,M+=c*V,B+=c*Z,L+=c*J,S+=c*W,g+=(c=a[11])*D,m+=c*T,x+=c*F,y+=c*Q,A+=c*U,v+=c*j,w+=c*H,_+=c*$,I+=c*q,E+=c*G,C+=c*z,M+=c*K,B+=c*V,L+=c*Z,S+=c*J,k+=c*W,m+=(c=a[12])*D,x+=c*T,y+=c*F,A+=c*Q,v+=c*U,w+=c*j,_+=c*H,I+=c*$,E+=c*q,C+=c*G,M+=c*z,B+=c*K,L+=c*V,S+=c*Z,k+=c*J,N+=c*W,x+=(c=a[13])*D,y+=c*T,A+=c*F,v+=c*Q,w+=c*U,_+=c*j,I+=c*H,E+=c*$,C+=c*q,M+=c*G,B+=c*z,L+=c*K,S+=c*V,k+=c*Z,N+=c*J,P+=c*W,y+=(c=a[14])*D,A+=c*T,v+=c*F,w+=c*Q,_+=c*U,I+=c*j,E+=c*H,C+=c*$,M+=c*q,B+=c*G,L+=c*z,S+=c*K,k+=c*V,N+=c*Z,P+=c*J,R+=c*W,A+=(c=a[15])*D,r+=38*(w+=c*F),n+=38*(_+=c*Q),i+=38*(I+=c*U),b+=38*(E+=c*j),o+=38*(C+=c*H),s+=38*(M+=c*$),l+=38*(B+=c*q),u+=38*(L+=c*G),h+=38*(S+=c*z),p+=38*(k+=c*K),g+=38*(N+=c*V),m+=38*(P+=c*Z),x+=38*(R+=c*J),y+=38*(O+=c*W),d=(c=(d+=38*(v+=c*T))+(f=1)+65535)-65536*(f=Math.floor(c/65536)),r=(c=r+f+65535)-65536*(f=Math.floor(c/65536)),n=(c=n+f+65535)-65536*(f=Math.floor(c/65536)),i=(c=i+f+65535)-65536*(f=Math.floor(c/65536)),b=(c=b+f+65535)-65536*(f=Math.floor(c/65536)),o=(c=o+f+65535)-65536*(f=Math.floor(c/65536)),s=(c=s+f+65535)-65536*(f=Math.floor(c/65536)),l=(c=l+f+65535)-65536*(f=Math.floor(c/65536)),u=(c=u+f+65535)-65536*(f=Math.floor(c/65536)),h=(c=h+f+65535)-65536*(f=Math.floor(c/65536)),p=(c=p+f+65535)-65536*(f=Math.floor(c/65536)),g=(c=g+f+65535)-65536*(f=Math.floor(c/65536)),m=(c=m+f+65535)-65536*(f=Math.floor(c/65536)),x=(c=x+f+65535)-65536*(f=Math.floor(c/65536)),y=(c=y+f+65535)-65536*(f=Math.floor(c/65536)),A=(c=A+f+65535)-65536*(f=Math.floor(c/65536)),d=(c=(d+=f-1+37*(f-1))+(f=1)+65535)-65536*(f=Math.floor(c/65536)),r=(c=r+f+65535)-65536*(f=Math.floor(c/65536)),n=(c=n+f+65535)-65536*(f=Math.floor(c/65536)),i=(c=i+f+65535)-65536*(f=Math.floor(c/65536)),b=(c=b+f+65535)-65536*(f=Math.floor(c/65536)),o=(c=o+f+65535)-65536*(f=Math.floor(c/65536)),s=(c=s+f+65535)-65536*(f=Math.floor(c/65536)),l=(c=l+f+65535)-65536*(f=Math.floor(c/65536)),u=(c=u+f+65535)-65536*(f=Math.floor(c/65536)),h=(c=h+f+65535)-65536*(f=Math.floor(c/65536)),p=(c=p+f+65535)-65536*(f=Math.floor(c/65536)),g=(c=g+f+65535)-65536*(f=Math.floor(c/65536)),m=(c=m+f+65535)-65536*(f=Math.floor(c/65536)),x=(c=x+f+65535)-65536*(f=Math.floor(c/65536)),y=(c=y+f+65535)-65536*(f=Math.floor(c/65536)),A=(c=A+f+65535)-65536*(f=Math.floor(c/65536)),d+=f-1+37*(f-1),e[0]=d,e[1]=r,e[2]=n,e[3]=i,e[4]=b,e[5]=o,e[6]=s,e[7]=l,e[8]=u,e[9]=h,e[10]=p,e[11]=g,e[12]=m,e[13]=x,e[14]=y,e[15]=A}function U(e,a){Q(e,a,a)}function j(e,t){var c,f=a();for(c=0;c<16;c++)f[c]=t[c];for(c=253;c>=0;c--)U(f,f),2!==c&&4!==c&&Q(f,f,t);for(c=0;c<16;c++)e[c]=f[c]}function H(e,t){var c,f=a();for(c=0;c<16;c++)f[c]=t[c];for(c=250;c>=0;c--)U(f,f),1!==c&&Q(f,f,t);for(c=0;c<16;c++)e[c]=f[c]}function $(e,t,c){var f,d,r=new Uint8Array(32),n=new Float64Array(80),b=a(),o=a(),s=a(),l=a(),u=a(),h=a();for(d=0;d<31;d++)r[d]=t[d];for(r[31]=127&t[31]|64,r[0]&=248,D(n,c),d=0;d<16;d++)o[d]=n[d],l[d]=b[d]=s[d]=0;for(b[0]=l[0]=1,d=254;d>=0;--d)N(b,o,f=r[d>>>3]>>>(7&d)&1),N(s,l,f),T(u,b,s),F(b,b,s),T(s,o,l),F(o,o,l),U(l,u),U(h,b),Q(b,s,b),Q(s,o,u),T(u,b,s),F(b,b,s),U(o,b),F(s,l,h),Q(b,s,i),T(b,b,l),Q(s,s,b),Q(b,l,h),Q(l,o,n),U(o,u),N(b,o,f),N(s,l,f);for(d=0;d<16;d++)n[d+16]=b[d],n[d+32]=s[d],n[d+48]=o[d],n[d+64]=l[d];var p=n.subarray(32),g=n.subarray(16);return j(p,p),Q(g,g,p),P(e,g),0}function q(e,a){return $(e,a,d)}function G(e,a){return c(a,32),q(e,a)}function z(e,a,t){var c=new Uint8Array(32);return $(c,t,a),y(e,f,c,A)}E.prototype.blocks=function(e,a,t){for(var c,f,d,r,n,i,b,o,s,l,u,h,p,g,m,x,y,A,v,w=this.fin?0:2048,_=this.h[0],I=this.h[1],E=this.h[2],C=this.h[3],M=this.h[4],B=this.h[5],L=this.h[6],S=this.h[7],k=this.h[8],N=this.h[9],P=this.r[0],R=this.r[1],O=this.r[2],D=this.r[3],T=this.r[4],F=this.r[5],Q=this.r[6],U=this.r[7],j=this.r[8],H=this.r[9];t>=16;)l=s=0,l+=(_+=8191&(c=255&e[a+0]|(255&e[a+1])<<8))*P,l+=(I+=8191&(c>>>13|(f=255&e[a+2]|(255&e[a+3])<<8)<<3))*(5*H),l+=(E+=8191&(f>>>10|(d=255&e[a+4]|(255&e[a+5])<<8)<<6))*(5*j),l+=(C+=8191&(d>>>7|(r=255&e[a+6]|(255&e[a+7])<<8)<<9))*(5*U),s=(l+=(M+=8191&(r>>>4|(n=255&e[a+8]|(255&e[a+9])<<8)<<12))*(5*Q))>>>13,l&=8191,l+=(B+=n>>>1&8191)*(5*F),l+=(L+=8191&(n>>>14|(i=255&e[a+10]|(255&e[a+11])<<8)<<2))*(5*T),l+=(S+=8191&(i>>>11|(b=255&e[a+12]|(255&e[a+13])<<8)<<5))*(5*D),l+=(k+=8191&(b>>>8|(o=255&e[a+14]|(255&e[a+15])<<8)<<8))*(5*O),u=s+=(l+=(N+=o>>>5|w)*(5*R))>>>13,u+=_*R,u+=I*P,u+=E*(5*H),u+=C*(5*j),s=(u+=M*(5*U))>>>13,u&=8191,u+=B*(5*Q),u+=L*(5*F),u+=S*(5*T),u+=k*(5*D),s+=(u+=N*(5*O))>>>13,u&=8191,h=s,h+=_*O,h+=I*R,h+=E*P,h+=C*(5*H),s=(h+=M*(5*j))>>>13,h&=8191,h+=B*(5*U),h+=L*(5*Q),h+=S*(5*F),h+=k*(5*T),p=s+=(h+=N*(5*D))>>>13,p+=_*D,p+=I*O,p+=E*R,p+=C*P,s=(p+=M*(5*H))>>>13,p&=8191,p+=B*(5*j),p+=L*(5*U),p+=S*(5*Q),p+=k*(5*F),g=s+=(p+=N*(5*T))>>>13,g+=_*T,g+=I*D,g+=E*O,g+=C*R,s=(g+=M*P)>>>13,g&=8191,g+=B*(5*H),g+=L*(5*j),g+=S*(5*U),g+=k*(5*Q),m=s+=(g+=N*(5*F))>>>13,m+=_*F,m+=I*T,m+=E*D,m+=C*O,s=(m+=M*R)>>>13,m&=8191,m+=B*P,m+=L*(5*H),m+=S*(5*j),m+=k*(5*U),x=s+=(m+=N*(5*Q))>>>13,x+=_*Q,x+=I*F,x+=E*T,x+=C*D,s=(x+=M*O)>>>13,x&=8191,x+=B*R,x+=L*P,x+=S*(5*H),x+=k*(5*j),y=s+=(x+=N*(5*U))>>>13,y+=_*U,y+=I*Q,y+=E*F,y+=C*T,s=(y+=M*D)>>>13,y&=8191,y+=B*O,y+=L*R,y+=S*P,y+=k*(5*H),A=s+=(y+=N*(5*j))>>>13,A+=_*j,A+=I*U,A+=E*Q,A+=C*F,s=(A+=M*T)>>>13,A&=8191,A+=B*D,A+=L*O,A+=S*R,A+=k*P,v=s+=(A+=N*(5*H))>>>13,v+=_*H,v+=I*j,v+=E*U,v+=C*Q,s=(v+=M*F)>>>13,v&=8191,v+=B*T,v+=L*D,v+=S*O,v+=k*R,_=l=8191&(s=(s=((s+=(v+=N*P)>>>13)<<2)+s|0)+(l&=8191)|0),I=u+=s>>>=13,E=h&=8191,C=p&=8191,M=g&=8191,B=m&=8191,L=x&=8191,S=y&=8191,k=A&=8191,N=v&=8191,a+=16,t-=16;this.h[0]=_,this.h[1]=I,this.h[2]=E,this.h[3]=C,this.h[4]=M,this.h[5]=B,this.h[6]=L,this.h[7]=S,this.h[8]=k,this.h[9]=N},E.prototype.finish=function(e,a){var t,c,f,d,r=new Uint16Array(10);if(this.leftover){for(d=this.leftover,this.buffer[d++]=1;d<16;d++)this.buffer[d]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(t=this.h[1]>>>13,this.h[1]&=8191,d=2;d<10;d++)this.h[d]+=t,t=this.h[d]>>>13,this.h[d]&=8191;for(this.h[0]+=5*t,t=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=t,t=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=t,r[0]=this.h[0]+5,t=r[0]>>>13,r[0]&=8191,d=1;d<10;d++)r[d]=this.h[d]+t,t=r[d]>>>13,r[d]&=8191;for(r[9]-=8192,c=(1^t)-1,d=0;d<10;d++)r[d]&=c;for(c=~c,d=0;d<10;d++)this.h[d]=this.h[d]&c|r[d];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,d=1;d<8;d++)f=(this.h[d]+this.pad[d]|0)+(f>>>16)|0,this.h[d]=65535&f;e[a+0]=this.h[0]>>>0&255,e[a+1]=this.h[0]>>>8&255,e[a+2]=this.h[1]>>>0&255,e[a+3]=this.h[1]>>>8&255,e[a+4]=this.h[2]>>>0&255,e[a+5]=this.h[2]>>>8&255,e[a+6]=this.h[3]>>>0&255,e[a+7]=this.h[3]>>>8&255,e[a+8]=this.h[4]>>>0&255,e[a+9]=this.h[4]>>>8&255,e[a+10]=this.h[5]>>>0&255,e[a+11]=this.h[5]>>>8&255,e[a+12]=this.h[6]>>>0&255,e[a+13]=this.h[6]>>>8&255,e[a+14]=this.h[7]>>>0&255,e[a+15]=this.h[7]>>>8&255},E.prototype.update=function(e,a,t){var c,f;if(this.leftover){for((f=16-this.leftover)>t&&(f=t),c=0;c=16&&(f=t-t%16,this.blocks(e,a,f),a+=f,t-=f),t){for(c=0;c=128;){for(w=0;w<16;w++)_=8*w+V,S[w]=t[_+0]<<24|t[_+1]<<16|t[_+2]<<8|t[_+3],k[w]=t[_+4]<<24|t[_+5]<<16|t[_+6]<<8|t[_+7];for(w=0;w<80;w++)if(f=N,d=P,r=R,n=O,i=D,b=T,o=F,l=U,u=j,h=H,p=$,g=q,m=G,x=z,C=65535&(E=K),M=E>>>16,B=65535&(I=Q),L=I>>>16,C+=65535&(E=(q>>>14|D<<18)^(q>>>18|D<<14)^(D>>>9|q<<23)),M+=E>>>16,B+=65535&(I=(D>>>14|q<<18)^(D>>>18|q<<14)^(q>>>9|D<<23)),L+=I>>>16,C+=65535&(E=q&G^~q&z),M+=E>>>16,B+=65535&(I=D&T^~D&F),L+=I>>>16,C+=65535&(E=Z[2*w+1]),M+=E>>>16,B+=65535&(I=Z[2*w]),L+=I>>>16,I=S[w%16],M+=(E=k[w%16])>>>16,B+=65535&I,L+=I>>>16,B+=(M+=(C+=65535&E)>>>16)>>>16,C=65535&(E=v=65535&C|M<<16),M=E>>>16,B=65535&(I=A=65535&B|(L+=B>>>16)<<16),L=I>>>16,C+=65535&(E=(U>>>28|N<<4)^(N>>>2|U<<30)^(N>>>7|U<<25)),M+=E>>>16,B+=65535&(I=(N>>>28|U<<4)^(U>>>2|N<<30)^(U>>>7|N<<25)),L+=I>>>16,M+=(E=U&j^U&H^j&H)>>>16,B+=65535&(I=N&P^N&R^P&R),L+=I>>>16,s=65535&(B+=(M+=(C+=65535&E)>>>16)>>>16)|(L+=B>>>16)<<16,y=65535&C|M<<16,C=65535&(E=p),M=E>>>16,B=65535&(I=n),L=I>>>16,M+=(E=v)>>>16,B+=65535&(I=A),L+=I>>>16,P=f,R=d,O=r,D=n=65535&(B+=(M+=(C+=65535&E)>>>16)>>>16)|(L+=B>>>16)<<16,T=i,F=b,Q=o,N=s,j=l,H=u,$=h,q=p=65535&C|M<<16,G=g,z=m,K=x,U=y,w%16==15)for(_=0;_<16;_++)I=S[_],C=65535&(E=k[_]),M=E>>>16,B=65535&I,L=I>>>16,I=S[(_+9)%16],C+=65535&(E=k[(_+9)%16]),M+=E>>>16,B+=65535&I,L+=I>>>16,A=S[(_+1)%16],C+=65535&(E=((v=k[(_+1)%16])>>>1|A<<31)^(v>>>8|A<<24)^(v>>>7|A<<25)),M+=E>>>16,B+=65535&(I=(A>>>1|v<<31)^(A>>>8|v<<24)^A>>>7),L+=I>>>16,A=S[(_+14)%16],M+=(E=((v=k[(_+14)%16])>>>19|A<<13)^(A>>>29|v<<3)^(v>>>6|A<<26))>>>16,B+=65535&(I=(A>>>19|v<<13)^(v>>>29|A<<3)^A>>>6),L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,S[_]=65535&B|L<<16,k[_]=65535&C|M<<16;C=65535&(E=U),M=E>>>16,B=65535&(I=N),L=I>>>16,I=e[0],M+=(E=a[0])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[0]=N=65535&B|L<<16,a[0]=U=65535&C|M<<16,C=65535&(E=j),M=E>>>16,B=65535&(I=P),L=I>>>16,I=e[1],M+=(E=a[1])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[1]=P=65535&B|L<<16,a[1]=j=65535&C|M<<16,C=65535&(E=H),M=E>>>16,B=65535&(I=R),L=I>>>16,I=e[2],M+=(E=a[2])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[2]=R=65535&B|L<<16,a[2]=H=65535&C|M<<16,C=65535&(E=$),M=E>>>16,B=65535&(I=O),L=I>>>16,I=e[3],M+=(E=a[3])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[3]=O=65535&B|L<<16,a[3]=$=65535&C|M<<16,C=65535&(E=q),M=E>>>16,B=65535&(I=D),L=I>>>16,I=e[4],M+=(E=a[4])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[4]=D=65535&B|L<<16,a[4]=q=65535&C|M<<16,C=65535&(E=G),M=E>>>16,B=65535&(I=T),L=I>>>16,I=e[5],M+=(E=a[5])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[5]=T=65535&B|L<<16,a[5]=G=65535&C|M<<16,C=65535&(E=z),M=E>>>16,B=65535&(I=F),L=I>>>16,I=e[6],M+=(E=a[6])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[6]=F=65535&B|L<<16,a[6]=z=65535&C|M<<16,C=65535&(E=K),M=E>>>16,B=65535&(I=Q),L=I>>>16,I=e[7],M+=(E=a[7])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[7]=Q=65535&B|L<<16,a[7]=K=65535&C|M<<16,V+=128,c-=128}return c}function W(e,a,t){var c,f=new Int32Array(8),d=new Int32Array(8),r=new Uint8Array(256),n=t;for(f[0]=1779033703,f[1]=3144134277,f[2]=1013904242,f[3]=2773480762,f[4]=1359893119,f[5]=2600822924,f[6]=528734635,f[7]=1541459225,d[0]=4089235720,d[1]=2227873595,d[2]=4271175723,d[3]=1595750129,d[4]=2917565137,d[5]=725511199,d[6]=4215389547,d[7]=327033209,J(f,d,a,t),t%=128,c=0;c=0;--f)X(e,a,c=t[f/8|0]>>(7&f)&1),Y(a,e),Y(e,e),X(e,a,c)}function te(e,t){var c=[a(),a(),a(),a()];S(c[0],s),S(c[1],l),S(c[2],n),Q(c[3],s,l),ae(e,c,t)}function ce(e,t,f){var d,r=new Uint8Array(64),n=[a(),a(),a(),a()];for(f||c(t,32),W(r,t,32),r[0]&=248,r[31]&=127,r[31]|=64,te(n,r),ee(e,n),d=0;d<32;d++)t[d+32]=e[d];return 0}var fe=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 de(e,a){var t,c,f,d;for(c=63;c>=32;--c){for(t=0,f=c-32,d=c-12;f>4)*fe[f],t=a[f]>>8,a[f]&=255;for(f=0;f<32;f++)a[f]-=t*fe[f];for(c=0;c<32;c++)a[c+1]+=a[c]>>8,e[c]=255&a[c]}function re(e){var a,t=new Float64Array(64);for(a=0;a<64;a++)t[a]=e[a];for(a=0;a<64;a++)e[a]=0;de(e,t)}function ne(e,t,c,f){var d,r,n=new Uint8Array(64),i=new Uint8Array(64),b=new Uint8Array(64),o=new Float64Array(64),s=[a(),a(),a(),a()];W(n,f,32),n[0]&=248,n[31]&=127,n[31]|=64;var l=c+64;for(d=0;d>7&&F(e[0],r,e[0]),Q(e[3],e[0],e[1]),0)}(l,f))return-1;for(d=0;d=0},e.sign.keyPair=function(){var e=new Uint8Array(se),a=new Uint8Array(le);return ce(e,a),{publicKey:e,secretKey:a}},e.sign.keyPair.fromSecretKey=function(e){if(he(e),e.length!==le)throw new Error("bad secret key size");for(var a=new Uint8Array(se),t=0;t{function c(e){try{if(!t.g.localStorage)return!1}catch(e){return!1}var a=t.g.localStorage[e];return null!=a&&"true"===String(a).toLowerCase()}e.exports=function(e,a){if(c("noDeprecation"))return e;var t=!1;return function(){if(!t){if(c("throwDeprecation"))throw new Error(a);c("traceDeprecation")?console.trace(a):console.warn(a),t=!0}return e.apply(this,arguments)}}},81135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},49032:(e,a,t)=>{"use strict";var c=t(47244),f=t(48184),d=t(25767),r=t(35680);function n(e){return e.call.bind(e)}var i="undefined"!=typeof BigInt,b="undefined"!=typeof Symbol,o=n(Object.prototype.toString),s=n(Number.prototype.valueOf),l=n(String.prototype.valueOf),u=n(Boolean.prototype.valueOf);if(i)var h=n(BigInt.prototype.valueOf);if(b)var p=n(Symbol.prototype.valueOf);function g(e,a){if("object"!=typeof e)return!1;try{return a(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===o(e)}function x(e){return"[object Set]"===o(e)}function y(e){return"[object WeakMap]"===o(e)}function A(e){return"[object WeakSet]"===o(e)}function v(e){return"[object ArrayBuffer]"===o(e)}function w(e){return"undefined"!=typeof ArrayBuffer&&(v.working?v(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===o(e)}function I(e){return"undefined"!=typeof DataView&&(_.working?_(e):e instanceof DataView)}a.isArgumentsObject=c,a.isGeneratorFunction=f,a.isTypedArray=r,a.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},a.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):r(e)||I(e)},a.isUint8Array=function(e){return"Uint8Array"===d(e)},a.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===d(e)},a.isUint16Array=function(e){return"Uint16Array"===d(e)},a.isUint32Array=function(e){return"Uint32Array"===d(e)},a.isInt8Array=function(e){return"Int8Array"===d(e)},a.isInt16Array=function(e){return"Int16Array"===d(e)},a.isInt32Array=function(e){return"Int32Array"===d(e)},a.isFloat32Array=function(e){return"Float32Array"===d(e)},a.isFloat64Array=function(e){return"Float64Array"===d(e)},a.isBigInt64Array=function(e){return"BigInt64Array"===d(e)},a.isBigUint64Array=function(e){return"BigUint64Array"===d(e)},m.working="undefined"!=typeof Map&&m(new Map),a.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},x.working="undefined"!=typeof Set&&x(new Set),a.isSet=function(e){return"undefined"!=typeof Set&&(x.working?x(e):e instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),a.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(y.working?y(e):e instanceof WeakMap)},A.working="undefined"!=typeof WeakSet&&A(new WeakSet),a.isWeakSet=function(e){return A(e)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),a.isArrayBuffer=w,_.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),a.isDataView=I;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function C(e){return"[object SharedArrayBuffer]"===o(e)}function M(e){return void 0!==E&&(void 0===C.working&&(C.working=C(new E)),C.working?C(e):e instanceof E)}function B(e){return g(e,s)}function L(e){return g(e,l)}function S(e){return g(e,u)}function k(e){return i&&g(e,h)}function N(e){return b&&g(e,p)}a.isSharedArrayBuffer=M,a.isAsyncFunction=function(e){return"[object AsyncFunction]"===o(e)},a.isMapIterator=function(e){return"[object Map Iterator]"===o(e)},a.isSetIterator=function(e){return"[object Set Iterator]"===o(e)},a.isGeneratorObject=function(e){return"[object Generator]"===o(e)},a.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===o(e)},a.isNumberObject=B,a.isStringObject=L,a.isBooleanObject=S,a.isBigIntObject=k,a.isSymbolObject=N,a.isBoxedPrimitive=function(e){return B(e)||L(e)||S(e)||k(e)||N(e)},a.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(w(e)||M(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(a,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},40537:(e,a,t)=>{var c=Object.getOwnPropertyDescriptors||function(e){for(var a=Object.keys(e),t={},c=0;c=d)return e;switch(e){case"%s":return String(c[t++]);case"%d":return Number(c[t++]);case"%j":try{return JSON.stringify(c[t++])}catch(e){return"[Circular]"}default:return e}})),n=c[t];t=3&&(c.depth=arguments[2]),arguments.length>=4&&(c.colors=arguments[3]),p(t)?c.showHidden=t:t&&a._extend(c,t),y(c.showHidden)&&(c.showHidden=!1),y(c.depth)&&(c.depth=2),y(c.colors)&&(c.colors=!1),y(c.customInspect)&&(c.customInspect=!0),c.colors&&(c.stylize=b),s(c,e,c.depth)}function b(e,a){var t=i.styles[a];return t?"["+i.colors[t][0]+"m"+e+"["+i.colors[t][1]+"m":e}function o(e,a){return e}function s(e,t,c){if(e.customInspect&&t&&I(t.inspect)&&t.inspect!==a.inspect&&(!t.constructor||t.constructor.prototype!==t)){var f=t.inspect(c,e);return x(f)||(f=s(e,f,c)),f}var d=function(e,a){if(y(a))return e.stylize("undefined","undefined");if(x(a)){var t="'"+JSON.stringify(a).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}return m(a)?e.stylize(""+a,"number"):p(a)?e.stylize(""+a,"boolean"):g(a)?e.stylize("null","null"):void 0}(e,t);if(d)return d;var r=Object.keys(t),n=function(e){var a={};return e.forEach((function(e,t){a[e]=!0})),a}(r);if(e.showHidden&&(r=Object.getOwnPropertyNames(t)),_(t)&&(r.indexOf("message")>=0||r.indexOf("description")>=0))return l(t);if(0===r.length){if(I(t)){var i=t.name?": "+t.name:"";return e.stylize("[Function"+i+"]","special")}if(A(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(w(t))return e.stylize(Date.prototype.toString.call(t),"date");if(_(t))return l(t)}var b,o="",v=!1,E=["{","}"];return h(t)&&(v=!0,E=["[","]"]),I(t)&&(o=" [Function"+(t.name?": "+t.name:"")+"]"),A(t)&&(o=" "+RegExp.prototype.toString.call(t)),w(t)&&(o=" "+Date.prototype.toUTCString.call(t)),_(t)&&(o=" "+l(t)),0!==r.length||v&&0!=t.length?c<0?A(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),b=v?function(e,a,t,c,f){for(var d=[],r=0,n=a.length;r60?t[0]+(""===a?"":a+"\n ")+" "+e.join(",\n ")+" "+t[1]:t[0]+a+" "+e.join(", ")+" "+t[1]}(b,o,E)):E[0]+o+E[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function u(e,a,t,c,f,d){var r,n,i;if((i=Object.getOwnPropertyDescriptor(a,f)||{value:a[f]}).get?n=i.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):i.set&&(n=e.stylize("[Setter]","special")),B(c,f)||(r="["+f+"]"),n||(e.seen.indexOf(i.value)<0?(n=g(t)?s(e,i.value,null):s(e,i.value,t-1)).indexOf("\n")>-1&&(n=d?n.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+n.split("\n").map((function(e){return" "+e})).join("\n")):n=e.stylize("[Circular]","special")),y(r)){if(d&&f.match(/^\d+$/))return n;(r=JSON.stringify(""+f)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(r=r.slice(1,-1),r=e.stylize(r,"name")):(r=r.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),r=e.stylize(r,"string"))}return r+": "+n}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function x(e){return"string"==typeof e}function y(e){return void 0===e}function A(e){return v(e)&&"[object RegExp]"===E(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===E(e)}function _(e){return v(e)&&("[object Error]"===E(e)||e instanceof Error)}function I(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function C(e){return e<10?"0"+e.toString(10):e.toString(10)}a.debuglog=function(e){if(e=e.toUpperCase(),!d[e])if(r.test(e)){var t=process.pid;d[e]=function(){var c=a.format.apply(a,arguments);console.error("%s %d: %s",e,t,c)}}else d[e]=function(){};return d[e]},a.inspect=i,i.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]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},a.types=t(49032),a.isArray=h,a.isBoolean=p,a.isNull=g,a.isNullOrUndefined=function(e){return null==e},a.isNumber=m,a.isString=x,a.isSymbol=function(e){return"symbol"==typeof e},a.isUndefined=y,a.isRegExp=A,a.types.isRegExp=A,a.isObject=v,a.isDate=w,a.types.isDate=w,a.isError=_,a.types.isNativeError=_,a.isFunction=I,a.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},a.isBuffer=t(81135);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(e,a){return Object.prototype.hasOwnProperty.call(e,a)}a.log=function(){var e,t;console.log("%s - %s",(t=[C((e=new Date).getHours()),C(e.getMinutes()),C(e.getSeconds())].join(":"),[e.getDate(),M[e.getMonth()],t].join(" ")),a.format.apply(a,arguments))},a.inherits=t(56698),a._extend=function(e,a){if(!a||!v(a))return e;for(var t=Object.keys(a),c=t.length;c--;)e[t[c]]=a[t[c]];return e};var L="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function S(e,a){if(!e){var t=new Error("Promise was rejected with a falsy value");t.reason=e,e=t}return a(e)}a.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(L&&e[L]){var a;if("function"!=typeof(a=e[L]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(a,L,{value:a,enumerable:!1,writable:!1,configurable:!0}),a}function a(){for(var a,t,c=new Promise((function(e,c){a=e,t=c})),f=[],d=0;d{var indexOf=function(e,a){if(e.indexOf)return e.indexOf(a);for(var t=0;t{"use strict";var c=t(82682),f=t(39209),d=t(10487),r=t(38075),n=t(75795),i=r("Object.prototype.toString"),b=t(49092)(),o="undefined"==typeof globalThis?t.g:globalThis,s=f(),l=r("String.prototype.slice"),u=Object.getPrototypeOf,h=r("Array.prototype.indexOf",!0)||function(e,a){for(var t=0;t-1?a:"Object"===a&&function(e){var a=!1;return c(p,(function(t,c){if(!a)try{t(e),a=l(c,1)}catch(e){}})),a}(e)}return n?function(e){var a=!1;return c(p,(function(t,c){if(!a)try{"$"+t(e)===c&&(a=l(c,1))}catch(e){}})),a}(e):null}},57510:e=>{e.exports=function(){for(var e={},t=0;t{},78982:()=>{},47790:()=>{},73776:()=>{},21638:()=>{},92668:()=>{},77965:()=>{},66089:()=>{},79368:()=>{},23276:()=>{},59676:()=>{},64688:()=>{},51069:()=>{},15340:()=>{},79838:()=>{},59817:()=>{},71281:()=>{},60513:()=>{},2378:()=>{},60290:()=>{},47882:()=>{},27754:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.StructError=void 0;class t extends TypeError{constructor(e,a){let t;const{message:c,explanation:f,...d}=e,{path:r}=e,n=0===r.length?c:`At path: ${r.join(".")} -- ${c}`;super(f??n),null!=f&&(this.cause=n),Object.assign(this,d),this.name=this.constructor.name,this.failures=()=>t??(t=[e,...a()])}}a.StructError=t},35620:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(27754),a),f(t(99067),a),f(t(91704),a),f(t(50401),a),f(t(67792),a),f(t(65991),a)},99067:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validate=a.is=a.mask=a.create=a.assert=a.Struct=void 0;const c=t(27754),f=t(70639);function d(e,a,t){const c=b(e,a,{message:t});if(c[0])throw c[0]}function r(e,a,t){const c=b(e,a,{coerce:!0,message:t});if(c[0])throw c[0];return c[1]}function n(e,a,t){const c=b(e,a,{coerce:!0,mask:!0,message:t});if(c[0])throw c[0];return c[1]}function i(e,a){return!b(e,a)[0]}function b(e,a,t={}){const d=(0,f.run)(e,a,t),r=(0,f.shiftIterator)(d);return r[0]?[new c.StructError(r[0],(function*(){for(const e of d)e[0]&&(yield e[0])})),void 0]:[void 0,r[1]]}a.Struct=class{constructor(e){const{type:a,schema:t,validator:c,refiner:d,coercer:r=e=>e,entries:n=function*(){}}=e;this.type=a,this.schema=t,this.entries=n,this.coercer=r,this.validator=c?(e,a)=>{const t=c(e,a);return(0,f.toFailures)(t,a,this,e)}:()=>[],this.refiner=d?(e,a)=>{const t=d(e,a);return(0,f.toFailures)(t,a,this,e)}:()=>[]}assert(e,a){return d(e,this,a)}create(e,a){return r(e,this,a)}is(e){return i(e,this)}mask(e,a){return n(e,this,a)}validate(e,a={}){return b(e,this,a)}},a.assert=d,a.create=r,a.mask=n,a.is=i,a.validate=b},91704:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.trimmed=a.defaulted=a.coerce=void 0;const c=t(99067),f=t(70639),d=t(67792);function r(e,a,t){return new c.Struct({...e,coercer:(f,d)=>(0,c.is)(f,a)?e.coercer(t(f,d),d):e.coercer(f,d)})}a.coerce=r,a.defaulted=function(e,a,t={}){return r(e,(0,d.unknown)(),(e=>{const c="function"==typeof a?a():a;if(void 0===e)return c;if(!t.strict&&(0,f.isPlainObject)(e)&&(0,f.isPlainObject)(c)){const a={...e};let t=!1;for(const e in c)void 0===a[e]&&(a[e]=c[e],t=!0);if(t)return a}return e}))},a.trimmed=function(e){return r(e,(0,d.string)(),(e=>e.trim()))}},50401:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.refine=a.size=a.pattern=a.nonempty=a.min=a.max=a.empty=void 0;const c=t(99067),f=t(70639);function d(e){return e instanceof Map||e instanceof Set?e.size:e.length}function r(e,a,t){return new c.Struct({...e,*refiner(c,d){yield*e.refiner(c,d);const r=t(c,d),n=(0,f.toFailures)(r,d,e,c);for(const e of n)yield{...e,refinement:a}}})}a.empty=function(e){return r(e,"empty",(a=>{const t=d(a);return 0===t||`Expected an empty ${e.type} but received one with a size of \`${t}\``}))},a.max=function(e,a,t={}){const{exclusive:c}=t;return r(e,"max",(t=>c?tc?t>a:t>=a||`Expected a ${e.type} greater than ${c?"":"or equal to "}${a} but received \`${t}\``))},a.nonempty=function(e){return r(e,"nonempty",(a=>d(a)>0||`Expected a nonempty ${e.type} but received an empty one`))},a.pattern=function(e,a){return r(e,"pattern",(t=>a.test(t)||`Expected a ${e.type} matching \`/${a.source}/\` but received "${t}"`))},a.size=function(e,a,t=a){const c=`Expected a ${e.type}`,f=a===t?`of \`${a}\``:`between \`${a}\` and \`${t}\``;return r(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return a<=e&&e<=t||`${c} ${f} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:d}=e;return a<=d&&d<=t||`${c} with a size ${f} but received one with a size of \`${d}\``}const{length:d}=e;return a<=d&&d<=t||`${c} with a length ${f} but received one with a length of \`${d}\``}))},a.refine=r},67792:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.unknown=a.union=a.type=a.tuple=a.string=a.set=a.regexp=a.record=a.optional=a.object=a.number=a.nullable=a.never=a.map=a.literal=a.intersection=a.integer=a.instance=a.func=a.enums=a.date=a.boolean=a.bigint=a.array=a.any=void 0;const c=t(99067),f=t(70639),d=t(65991);function r(){return(0,d.define)("never",(()=>!1))}a.any=function(){return(0,d.define)("any",(()=>!0))},a.array=function(e){return new c.Struct({type:"array",schema:e,*entries(a){if(e&&Array.isArray(a))for(const[t,c]of a.entries())yield[t,c,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${(0,f.print)(e)}`})},a.bigint=function(){return(0,d.define)("bigint",(e=>"bigint"==typeof e))},a.boolean=function(){return(0,d.define)("boolean",(e=>"boolean"==typeof e))},a.date=function(){return(0,d.define)("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${(0,f.print)(e)}`))},a.enums=function(e){const a={},t=e.map((e=>(0,f.print)(e))).join();for(const t of e)a[t]=t;return new c.Struct({type:"enums",schema:a,validator:a=>e.includes(a)||`Expected one of \`${t}\`, but received: ${(0,f.print)(a)}`})},a.func=function(){return(0,d.define)("func",(e=>"function"==typeof e||`Expected a function, but received: ${(0,f.print)(e)}`))},a.instance=function(e){return(0,d.define)("instance",(a=>a instanceof e||`Expected a \`${e.name}\` instance, but received: ${(0,f.print)(a)}`))},a.integer=function(){return(0,d.define)("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${(0,f.print)(e)}`))},a.intersection=function(e){return new c.Struct({type:"intersection",schema:null,*entries(a,t){for(const{entries:c}of e)yield*c(a,t)},*validator(a,t){for(const{validator:c}of e)yield*c(a,t)},*refiner(a,t){for(const{refiner:c}of e)yield*c(a,t)}})},a.literal=function(e){const a=(0,f.print)(e),t=typeof e;return new c.Struct({type:"literal",schema:"string"===t||"number"===t||"boolean"===t?e:null,validator:t=>t===e||`Expected the literal \`${a}\`, but received: ${(0,f.print)(t)}`})},a.map=function(e,a){return new c.Struct({type:"map",schema:null,*entries(t){if(e&&a&&t instanceof Map)for(const[c,f]of t.entries())yield[c,c,e],yield[c,f,a]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${(0,f.print)(e)}`})},a.never=r,a.nullable=function(e){return new c.Struct({...e,validator:(a,t)=>null===a||e.validator(a,t),refiner:(a,t)=>null===a||e.refiner(a,t)})},a.number=function(){return(0,d.define)("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${(0,f.print)(e)}`))},a.object=function(e){const a=e?Object.keys(e):[],t=r();return new c.Struct({type:"object",schema:e??null,*entries(c){if(e&&(0,f.isObject)(c)){const f=new Set(Object.keys(c));for(const t of a)f.delete(t),yield[t,c[t],e[t]];for(const e of f)yield[e,c[e],t]}},validator:e=>(0,f.isObject)(e)||`Expected an object, but received: ${(0,f.print)(e)}`,coercer:e=>(0,f.isObject)(e)?{...e}:e})},a.optional=function(e){return new c.Struct({...e,validator:(a,t)=>void 0===a||e.validator(a,t),refiner:(a,t)=>void 0===a||e.refiner(a,t)})},a.record=function(e,a){return new c.Struct({type:"record",schema:null,*entries(t){if((0,f.isObject)(t))for(const c in t){const f=t[c];yield[c,c,e],yield[c,f,a]}},validator:e=>(0,f.isObject)(e)||`Expected an object, but received: ${(0,f.print)(e)}`})},a.regexp=function(){return(0,d.define)("regexp",(e=>e instanceof RegExp))},a.set=function(e){return new c.Struct({type:"set",schema:null,*entries(a){if(e&&a instanceof Set)for(const t of a)yield[t,t,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${(0,f.print)(e)}`})},a.string=function(){return(0,d.define)("string",(e=>"string"==typeof e||`Expected a string, but received: ${(0,f.print)(e)}`))},a.tuple=function(e){const a=r();return new c.Struct({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){const c=Math.max(e.length,t.length);for(let f=0;fArray.isArray(e)||`Expected an array, but received: ${(0,f.print)(e)}`})},a.type=function(e){const a=Object.keys(e);return new c.Struct({type:"type",schema:e,*entries(t){if((0,f.isObject)(t))for(const c of a)yield[c,t[c],e[c]]},validator:e=>(0,f.isObject)(e)||`Expected an object, but received: ${(0,f.print)(e)}`,coercer:e=>(0,f.isObject)(e)?{...e}:e})},a.union=function(e){const a=e.map((e=>e.type)).join(" | ");return new c.Struct({type:"union",schema:null,coercer(a){for(const t of e){const[e,c]=t.validate(a,{coerce:!0});if(!e)return c}return a},validator(t,c){const d=[];for(const a of e){const[...e]=(0,f.run)(t,a,c),[r]=e;if(!r?.[0])return[];for(const[a]of e)a&&d.push(a)}return[`Expected the value to satisfy a union of \`${a}\`, but received: ${(0,f.print)(t)}`,...d]}})},a.unknown=function(){return(0,d.define)("unknown",(()=>!0))}},65991:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.pick=a.partial=a.omit=a.lazy=a.dynamic=a.deprecated=a.define=a.assign=void 0;const c=t(99067),f=t(67792);a.assign=function(...e){const a="type"===e[0]?.type,t=e.map((({schema:e})=>e)),c=Object.assign({},...t);return a?(0,f.type)(c):(0,f.object)(c)},a.define=function(e,a){return new c.Struct({type:e,schema:null,validator:a})},a.deprecated=function(e,a){return new c.Struct({...e,refiner:(a,t)=>void 0===a||e.refiner(a,t),validator:(t,c)=>void 0===t||(a(t,c),e.validator(t,c))})},a.dynamic=function(e){return new c.Struct({type:"dynamic",schema:null,*entries(a,t){const c=e(a,t);yield*c.entries(a,t)},validator:(a,t)=>e(a,t).validator(a,t),coercer:(a,t)=>e(a,t).coercer(a,t),refiner:(a,t)=>e(a,t).refiner(a,t)})},a.lazy=function(e){let a;return new c.Struct({type:"lazy",schema:null,*entries(t,c){a??(a=e()),yield*a.entries(t,c)},validator:(t,c)=>(a??(a=e()),a.validator(t,c)),coercer:(t,c)=>(a??(a=e()),a.coercer(t,c)),refiner:(t,c)=>(a??(a=e()),a.refiner(t,c))})},a.omit=function(e,a){const{schema:t}=e,c={...t};for(const e of a)delete c[e];return"type"===e.type?(0,f.type)(c):(0,f.object)(c)},a.partial=function(e){const a=e instanceof c.Struct,t=a?{...e.schema}:{...e};for(const e in t)t[e]=(0,f.optional)(t[e]);return a&&"type"===e.type?(0,f.type)(t):(0,f.object)(t)},a.pick=function(e,a){const{schema:t}=e,c={};for(const e of a)c[e]=t[e];return"type"===e.type?(0,f.type)(c):(0,f.object)(c)}},70639:(e,a)=>{"use strict";function t(e){return"object"==typeof e&&null!==e}function c(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function f(e,a,t,f){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:d,branch:r}=a,{type:n}=t,{refinement:i,message:b=`Expected a value of type \`${n}\`${i?` with refinement \`${i}\``:""}, but received: \`${c(f)}\``}=e;return{value:f,type:n,refinement:i,key:d[d.length-1],path:d,branch:r,...e,message:b}}Object.defineProperty(a,"__esModule",{value:!0}),a.run=a.toFailures=a.toFailure=a.shiftIterator=a.print=a.isPlainObject=a.isObject=void 0,a.isObject=t,a.isPlainObject=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const a=Object.getPrototypeOf(e);return null===a||a===Object.prototype},a.print=c,a.shiftIterator=function(e){const{done:a,value:t}=e.next();return a?void 0:t},a.toFailure=f,a.toFailures=function*(e,a,c,d){(function(e){return t(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const t of e){const e=f(t,a,c,d);e&&(yield e)}},a.run=function*e(a,c,f={}){const{path:d=[],branch:r=[a],coerce:n=!1,mask:i=!1}=f,b={path:d,branch:r};if(n&&(a=c.coercer(a,b),i&&"type"!==c.type&&t(c.schema)&&t(a)&&!Array.isArray(a)))for(const e in a)void 0===c.schema[e]&&delete a[e];let o="valid";for(const e of c.validator(a,b))e.explanation=f.message,o="not_valid",yield[e,void 0];for(let[s,l,u]of c.entries(a,b)){const c=e(l,u,{path:void 0===s?d:[...d,s],branch:void 0===s?r:[...r,l],coerce:n,mask:i,message:f.message});for(const e of c)e[0]?(o=null===e[0].refinement||void 0===e[0].refinement?"not_valid":"not_refined",yield[e[0],void 0]):n&&(l=e[1],void 0===s?a=l:a instanceof Map?a.set(s,l):a instanceof Set?a.add(l):t(a)&&(void 0!==l||s in a)&&(a[s]=l))}if("not_valid"!==o)for(const e of c.refiner(a,b))e.explanation=f.message,o="not_refined",yield[e,void 0];"valid"===o&&(yield[void 0,a])}},22011:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.assertExhaustive=a.assertStruct=a.assert=a.AssertionError=void 0;const c=t(35620),f=t(75940);function d(e,a){return t=e,Boolean("string"==typeof t?.prototype?.constructor?.name)?new e({message:a}):e({message:a});var t}class r extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}a.AssertionError=r,a.assert=function(e,a="Assertion failed.",t=r){if(!e){if(a instanceof Error)throw a;throw d(t,a)}},a.assertStruct=function(e,a,t="Assertion failed",n=r){try{(0,c.assert)(e,a)}catch(e){throw d(n,`${t}: ${function(e){return(0,f.getErrorMessage)(e).replace(/\.$/u,"")}(e)}.`)}},a.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},20472:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.base64=void 0;const c=t(35620),f=t(22011);a.base64=(e,a={})=>{const t=a.paddingRequired??!1,d=a.characterSet??"base64";let r,n;return"base64"===d?r=String.raw`[A-Za-z0-9+\/]`:((0,f.assert)("base64url"===d),r=String.raw`[-_A-Za-z0-9]`),n=t?new RegExp(`^(?:${r}{4})*(?:${r}{3}=|${r}{2}==)?$`,"u"):new RegExp(`^(?:${r}{4})*(?:${r}{2,3}|${r}{3}=|${r}{2}==)?$`,"u"),(0,c.pattern)(e,n)}},77862:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.createDataView=a.concatBytes=a.valueToBytes=a.base64ToBytes=a.stringToBytes=a.numberToBytes=a.signedBigIntToBytes=a.bigIntToBytes=a.hexToBytes=a.bytesToBase64=a.bytesToString=a.bytesToNumber=a.bytesToSignedBigInt=a.bytesToBigInt=a.bytesToHex=a.assertIsBytes=a.isBytes=void 0;const f=t(63203),d=t(22011),r=t(93976),n=function(){const e=[];return()=>{if(0===e.length)for(let a=0;a<256;a++)e.push(a.toString(16).padStart(2,"0"));return e}}();function i(e){return e instanceof Uint8Array}function b(e){(0,d.assert)(i(e),"Value must be a Uint8Array.")}function o(e){if(b(e),0===e.length)return"0x";const a=n(),t=new Array(e.length);for(let c=0;c=BigInt(0),"Value must be a non-negative bigint."),l(e.toString(16))}function h(e){return(0,d.assert)("number"==typeof e,"Value must be a number."),(0,d.assert)(e>=0,"Value must be a non-negative number."),(0,d.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),l(e.toString(16))}function p(e){return(0,d.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function g(e){if("bigint"==typeof e)return u(e);if("number"==typeof e)return h(e);if("string"==typeof e)return e.startsWith("0x")?l(e):p(e);if(i(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}a.isBytes=i,a.assertIsBytes=b,a.bytesToHex=o,a.bytesToBigInt=s,a.bytesToSignedBigInt=function(e){b(e);let a=BigInt(0);for(const t of e)a=(a<0,"Byte length must be greater than 0."),(0,d.assert)(function(e,a){(0,d.assert)(a>0);const t=e>>BigInt(31);return!((~e&t)+(e&~t)>>BigInt(8*a-1))}(e,a),"Byte length is too small to represent the given value.");let t=e;const c=new Uint8Array(a);for(let e=0;e>=BigInt(8);return c.reverse()},a.numberToBytes=h,a.stringToBytes=p,a.base64ToBytes=function(e){return(0,d.assert)("string"==typeof e,"Value must be a string."),f.base64.decode(e)},a.valueToBytes=g,a.concatBytes=function(e){const a=new Array(e.length);let t=0;for(let c=0;c{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.toCaipChainId=a.parseCaipAccountId=a.parseCaipChainId=a.isCaipAccountAddress=a.isCaipAccountId=a.isCaipReference=a.isCaipNamespace=a.isCaipChainId=a.KnownCaipNamespace=a.CaipAccountAddressStruct=a.CaipAccountIdStruct=a.CaipReferenceStruct=a.CaipNamespaceStruct=a.CaipChainIdStruct=a.CAIP_ACCOUNT_ADDRESS_REGEX=a.CAIP_ACCOUNT_ID_REGEX=a.CAIP_REFERENCE_REGEX=a.CAIP_NAMESPACE_REGEX=a.CAIP_CHAIN_ID_REGEX=void 0;const c=t(35620);function f(e){return(0,c.is)(e,a.CaipNamespaceStruct)}function d(e){return(0,c.is)(e,a.CaipReferenceStruct)}var r;a.CAIP_CHAIN_ID_REGEX=/^(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})$/u,a.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,a.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,a.CAIP_ACCOUNT_ID_REGEX=/^(?(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})):(?[-.%a-zA-Z0-9]{1,128})$/u,a.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,a.CaipChainIdStruct=(0,c.pattern)((0,c.string)(),a.CAIP_CHAIN_ID_REGEX),a.CaipNamespaceStruct=(0,c.pattern)((0,c.string)(),a.CAIP_NAMESPACE_REGEX),a.CaipReferenceStruct=(0,c.pattern)((0,c.string)(),a.CAIP_REFERENCE_REGEX),a.CaipAccountIdStruct=(0,c.pattern)((0,c.string)(),a.CAIP_ACCOUNT_ID_REGEX),a.CaipAccountAddressStruct=(0,c.pattern)((0,c.string)(),a.CAIP_ACCOUNT_ADDRESS_REGEX),(r=a.KnownCaipNamespace||(a.KnownCaipNamespace={})).Eip155="eip155",r.Wallet="wallet",a.isCaipChainId=function(e){return(0,c.is)(e,a.CaipChainIdStruct)},a.isCaipNamespace=f,a.isCaipReference=d,a.isCaipAccountId=function(e){return(0,c.is)(e,a.CaipAccountIdStruct)},a.isCaipAccountAddress=function(e){return(0,c.is)(e,a.CaipAccountAddressStruct)},a.parseCaipChainId=function(e){const t=a.CAIP_CHAIN_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}},a.parseCaipAccountId=function(e){const t=a.CAIP_ACCOUNT_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},a.toCaipChainId=function(e,t){if(!f(e))throw new Error(`Invalid "namespace", must match: ${a.CAIP_NAMESPACE_REGEX.toString()}`);if(!d(t))throw new Error(`Invalid "reference", must match: ${a.CAIP_REFERENCE_REGEX.toString()}`);return`${e}:${t}`}},98860:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ChecksumStruct=void 0;const c=t(35620),f=t(20472);a.ChecksumStruct=(0,c.size)((0,f.base64)((0,c.string)(),{paddingRequired:!0}),44,44)},65211:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.createHex=a.createBytes=a.createBigInt=a.createNumber=void 0;const c=t(35620),f=t(22011),d=t(77862),r=t(93976),n=(0,c.union)([(0,c.number)(),(0,c.bigint)(),(0,c.string)(),r.StrictHexStruct]),i=(0,c.coerce)((0,c.number)(),n,Number),b=(0,c.coerce)((0,c.bigint)(),n,BigInt),o=((0,c.union)([r.StrictHexStruct,(0,c.instance)(Uint8Array)]),(0,c.coerce)((0,c.instance)(Uint8Array),(0,c.union)([r.StrictHexStruct]),d.hexToBytes)),s=(0,c.coerce)(r.StrictHexStruct,(0,c.instance)(Uint8Array),d.bytesToHex);a.createNumber=function(e){try{const a=(0,c.create)(e,i);return(0,f.assert)(Number.isFinite(a),`Expected a number-like value, got "${e}".`),a}catch(a){if(a instanceof c.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw a}},a.createBigInt=function(e){try{return(0,c.create)(e,b)}catch(e){if(e instanceof c.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},a.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,c.create)(e,o)}catch(e){if(e instanceof c.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},a.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,c.create)(e,s)}catch(e){if(e instanceof c.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}},44180:function(e,a){"use strict";var t,c,f=this&&this.__classPrivateFieldGet||function(e,a,t,c){if("a"===t&&!c)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof a?e!==a||!c:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?c:"a"===t?c.call(e):c?c.value:a.get(e)},d=this&&this.__classPrivateFieldSet||function(e,a,t,c,f){if("m"===c)throw new TypeError("Private method is not writable");if("a"===c&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof a?e!==a||!f:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===c?f.call(e,t):f?f.value=t:a.set(e,t),t};Object.defineProperty(a,"__esModule",{value:!0}),a.FrozenSet=a.FrozenMap=void 0;class r{get size(){return f(this,t,"f").size}[(t=new WeakMap,Symbol.iterator)](){return f(this,t,"f")[Symbol.iterator]()}constructor(e){t.set(this,void 0),d(this,t,new Map(e),"f"),Object.freeze(this)}entries(){return f(this,t,"f").entries()}forEach(e,a){return f(this,t,"f").forEach(((t,c,f)=>e.call(a,t,c,this)))}get(e){return f(this,t,"f").get(e)}has(e){return f(this,t,"f").has(e)}keys(){return f(this,t,"f").keys()}values(){return f(this,t,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,a])=>`${String(e)} => ${String(a)}`)).join(", ")} `:""}}`}}a.FrozenMap=r;class n{get size(){return f(this,c,"f").size}[(c=new WeakMap,Symbol.iterator)](){return f(this,c,"f")[Symbol.iterator]()}constructor(e){c.set(this,void 0),d(this,c,new Set(e),"f"),Object.freeze(this)}entries(){return f(this,c,"f").entries()}forEach(e,a){return f(this,c,"f").forEach(((t,c,f)=>e.call(a,t,c,this)))}has(e){return f(this,c,"f").has(e)}keys(){return f(this,c,"f").keys()}values(){return f(this,c,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}a.FrozenSet=n,Object.freeze(r),Object.freeze(r.prototype),Object.freeze(n),Object.freeze(n.prototype)},91630:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},75940:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.wrapError=a.getErrorMessage=a.isErrorWithStack=a.isErrorWithMessage=a.isErrorWithCode=void 0;const c=t(71843),f=t(33745);function d(e){return"object"==typeof e&&null!==e&&"code"in e}function r(e){return"object"==typeof e&&null!==e&&"message"in e}a.isErrorWithCode=d,a.isErrorWithMessage=r,a.isErrorWithStack=function(e){return"object"==typeof e&&null!==e&&"stack"in e},a.getErrorMessage=function(e){return r(e)&&"string"==typeof e.message?e.message:(0,f.isNullOrUndefined)(e)?"":String(e)},a.wrapError=function(e,a){if((t=e)instanceof Error||(0,f.isObject)(t)&&"Error"===t.constructor.name){let t;return t=2===Error.length?new Error(a,{cause:e}):new c.ErrorWithCause(a,{cause:e}),d(e)&&(t.code=e.code),t}var t;return a.length>0?new Error(`${String(e)}: ${a}`):new Error(String(e))}},93976:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.remove0x=a.add0x=a.isValidChecksumAddress=a.getChecksumAddress=a.isValidHexAddress=a.assertIsStrictHexString=a.assertIsHexString=a.isStrictHexString=a.isHexString=a.HexChecksumAddressStruct=a.HexAddressStruct=a.StrictHexStruct=a.HexStruct=void 0;const c=t(35620),f=t(2214),d=t(22011),r=t(77862);function n(e){return(0,c.is)(e,a.HexStruct)}function i(e){return(0,c.is)(e,a.StrictHexStruct)}function b(e){(0,d.assert)((0,c.is)(e,a.HexChecksumAddressStruct),"Invalid hex address.");const t=s(e.toLowerCase()),n=s((0,r.bytesToHex)((0,f.keccak_256)(t)));return`0x${t.split("").map(((e,a)=>{const t=n[a];return(0,d.assert)((0,c.is)(t,(0,c.string)()),"Hash shorter than address."),parseInt(t,16)>7?e.toUpperCase():e})).join("")}`}function o(e){return!!(0,c.is)(e,a.HexChecksumAddressStruct)&&b(e)===e}function s(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}a.HexStruct=(0,c.pattern)((0,c.string)(),/^(?:0x)?[0-9a-f]+$/iu),a.StrictHexStruct=(0,c.pattern)((0,c.string)(),/^0x[0-9a-f]+$/iu),a.HexAddressStruct=(0,c.pattern)((0,c.string)(),/^0x[0-9a-f]{40}$/u),a.HexChecksumAddressStruct=(0,c.pattern)((0,c.string)(),/^0x[0-9a-fA-F]{40}$/u),a.isHexString=n,a.isStrictHexString=i,a.assertIsHexString=function(e){(0,d.assert)(n(e),"Value must be a hexadecimal string.")},a.assertIsStrictHexString=function(e){(0,d.assert)(i(e),'Value must be a hexadecimal string, starting with "0x".')},a.isValidHexAddress=function(e){return(0,c.is)(e,a.HexAddressStruct)||o(e)},a.getChecksumAddress=b,a.isValidChecksumAddress=o,a.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},a.remove0x=s},52367:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(22011),a),f(t(20472),a),f(t(77862),a),f(t(87690),a),f(t(98860),a),f(t(65211),a),f(t(44180),a),f(t(91630),a),f(t(75940),a),f(t(93976),a),f(t(60087),a),f(t(24956),a),f(t(98912),a),f(t(33745),a),f(t(5770),a),f(t(3028),a),f(t(2812),a),f(t(32954),a),f(t(16871),a),f(t(49266),a)},60087:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getJsonRpcIdValidator=a.assertIsJsonRpcError=a.isJsonRpcError=a.assertIsJsonRpcFailure=a.isJsonRpcFailure=a.assertIsJsonRpcSuccess=a.isJsonRpcSuccess=a.assertIsJsonRpcResponse=a.isJsonRpcResponse=a.assertIsPendingJsonRpcResponse=a.isPendingJsonRpcResponse=a.JsonRpcResponseStruct=a.JsonRpcFailureStruct=a.JsonRpcSuccessStruct=a.PendingJsonRpcResponseStruct=a.assertIsJsonRpcRequest=a.isJsonRpcRequest=a.assertIsJsonRpcNotification=a.isJsonRpcNotification=a.JsonRpcNotificationStruct=a.JsonRpcRequestStruct=a.JsonRpcParamsStruct=a.JsonRpcErrorStruct=a.JsonRpcIdStruct=a.JsonRpcVersionStruct=a.jsonrpc2=a.getJsonSize=a.getSafeJson=a.isValidJson=a.JsonStruct=a.UnsafeJsonStruct=a.exactOptional=a.object=void 0;const c=t(35620),f=t(22011),d=t(33745);function r({path:e,branch:a}){const t=e[e.length-1];return(0,d.hasProperty)(a[a.length-2],t)}function n(e){return new c.Struct({...e,type:`optional ${e.type}`,validator:(a,t)=>!r(t)||e.validator(a,t),refiner:(a,t)=>!r(t)||e.refiner(a,t)})}function i(e){return(0,c.create)(e,a.JsonStruct)}a.object=e=>(0,c.object)(e),a.exactOptional=n,a.UnsafeJsonStruct=(0,c.union)([(0,c.literal)(null),(0,c.boolean)(),(0,c.define)("finite number",(e=>(0,c.is)(e,(0,c.number)())&&Number.isFinite(e))),(0,c.string)(),(0,c.array)((0,c.lazy)((()=>a.UnsafeJsonStruct))),(0,c.record)((0,c.string)(),(0,c.lazy)((()=>a.UnsafeJsonStruct)))]),a.JsonStruct=(0,c.coerce)(a.UnsafeJsonStruct,(0,c.any)(),(e=>((0,f.assertStruct)(e,a.UnsafeJsonStruct),JSON.parse(JSON.stringify(e,((e,a)=>{if("__proto__"!==e&&"constructor"!==e)return a})))))),a.isValidJson=function(e){try{return i(e),!0}catch{return!1}},a.getSafeJson=i,a.getJsonSize=function(e){(0,f.assertStruct)(e,a.JsonStruct,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},a.jsonrpc2="2.0",a.JsonRpcVersionStruct=(0,c.literal)(a.jsonrpc2),a.JsonRpcIdStruct=(0,c.nullable)((0,c.union)([(0,c.number)(),(0,c.string)()])),a.JsonRpcErrorStruct=(0,a.object)({code:(0,c.integer)(),message:(0,c.string)(),data:n(a.JsonStruct),stack:n((0,c.string)())}),a.JsonRpcParamsStruct=(0,c.union)([(0,c.record)((0,c.string)(),a.JsonStruct),(0,c.array)(a.JsonStruct)]),a.JsonRpcRequestStruct=(0,a.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,method:(0,c.string)(),params:n(a.JsonRpcParamsStruct)}),a.JsonRpcNotificationStruct=(0,a.object)({jsonrpc:a.JsonRpcVersionStruct,method:(0,c.string)(),params:n(a.JsonRpcParamsStruct)}),a.isJsonRpcNotification=function(e){return(0,c.is)(e,a.JsonRpcNotificationStruct)},a.assertIsJsonRpcNotification=function(e,t){(0,f.assertStruct)(e,a.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",t)},a.isJsonRpcRequest=function(e){return(0,c.is)(e,a.JsonRpcRequestStruct)},a.assertIsJsonRpcRequest=function(e,t){(0,f.assertStruct)(e,a.JsonRpcRequestStruct,"Invalid JSON-RPC request",t)},a.PendingJsonRpcResponseStruct=(0,c.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,result:(0,c.optional)((0,c.unknown)()),error:(0,c.optional)(a.JsonRpcErrorStruct)}),a.JsonRpcSuccessStruct=(0,a.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,result:a.JsonStruct}),a.JsonRpcFailureStruct=(0,a.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,error:a.JsonRpcErrorStruct}),a.JsonRpcResponseStruct=(0,c.union)([a.JsonRpcSuccessStruct,a.JsonRpcFailureStruct]),a.isPendingJsonRpcResponse=function(e){return(0,c.is)(e,a.PendingJsonRpcResponseStruct)},a.assertIsPendingJsonRpcResponse=function(e,t){(0,f.assertStruct)(e,a.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",t)},a.isJsonRpcResponse=function(e){return(0,c.is)(e,a.JsonRpcResponseStruct)},a.assertIsJsonRpcResponse=function(e,t){(0,f.assertStruct)(e,a.JsonRpcResponseStruct,"Invalid JSON-RPC response",t)},a.isJsonRpcSuccess=function(e){return(0,c.is)(e,a.JsonRpcSuccessStruct)},a.assertIsJsonRpcSuccess=function(e,t){(0,f.assertStruct)(e,a.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",t)},a.isJsonRpcFailure=function(e){return(0,c.is)(e,a.JsonRpcFailureStruct)},a.assertIsJsonRpcFailure=function(e,t){(0,f.assertStruct)(e,a.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",t)},a.isJsonRpcError=function(e){return(0,c.is)(e,a.JsonRpcErrorStruct)},a.assertIsJsonRpcError=function(e,t){(0,f.assertStruct)(e,a.JsonRpcErrorStruct,"Invalid JSON-RPC error",t)},a.getJsonRpcIdValidator=function(e){const{permitEmptyString:a,permitFractions:t,permitNull:c}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(t||Number.isInteger(e))||"string"==typeof e&&(a||e.length>0)||c&&null===e)}},24956:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},98912:function(e,a,t){"use strict";var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.createModuleLogger=a.createProjectLogger=void 0;const f=(0,c(t(17833)).default)("metamask");a.createProjectLogger=function(e){return f.extend(e)},a.createModuleLogger=function(e,a){return e.extend(a)}},33745:(e,a)=>{"use strict";function t(e){return e.charCodeAt(0)<=127}var c;Object.defineProperty(a,"__esModule",{value:!0}),a.calculateNumberSize=a.calculateStringSize=a.isASCII=a.isPlainObject=a.ESCAPE_CHARACTERS_REGEXP=a.JsonSize=a.getKnownPropertyNames=a.hasProperty=a.isObject=a.isNullOrUndefined=a.isNonEmptyArray=void 0,a.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},a.isNullOrUndefined=function(e){return null==e},a.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)},a.hasProperty=(e,a)=>Object.hasOwnProperty.call(e,a),a.getKnownPropertyNames=function(e){return Object.getOwnPropertyNames(e)},(c=a.JsonSize||(a.JsonSize={}))[c.Null=4]="Null",c[c.Comma=1]="Comma",c[c.Wrapper=1]="Wrapper",c[c.True=4]="True",c[c.False=5]="False",c[c.Quote=1]="Quote",c[c.Colon=1]="Colon",c[c.Date=24]="Date",a.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,a.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let a=e;for(;null!==Object.getPrototypeOf(a);)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(e)===a}catch(e){return!1}},a.isASCII=t,a.calculateStringSize=function(e){return e.split("").reduce(((e,a)=>t(a)?e+1:e+2),0)+(e.match(a.ESCAPE_CHARACTERS_REGEXP)??[]).length},a.calculateNumberSize=function(e){return e.toString().length}},5770:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.hexToBigInt=a.hexToNumber=a.bigIntToHex=a.numberToHex=void 0;const c=t(22011),f=t(93976);a.numberToHex=e=>((0,c.assert)("number"==typeof e,"Value must be a number."),(0,c.assert)(e>=0,"Value must be a non-negative number."),(0,c.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,f.add0x)(e.toString(16))),a.bigIntToHex=e=>((0,c.assert)("bigint"==typeof e,"Value must be a bigint."),(0,c.assert)(e>=0,"Value must be a non-negative bigint."),(0,f.add0x)(e.toString(16))),a.hexToNumber=e=>{(0,f.assertIsHexString)(e);const a=parseInt(e,16);return(0,c.assert)(Number.isSafeInteger(a),"Value is not a safe integer. Use `hexToBigInt` instead."),a},a.hexToBigInt=e=>((0,f.assertIsHexString)(e),BigInt((0,f.add0x)(e)))},3028:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},2812:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.createDeferredPromise=void 0,a.createDeferredPromise=function({suppressUnhandledRejection:e=!1}={}){let a,t;const c=new Promise(((e,c)=>{a=e,t=c}));return e&&c.catch((e=>{})),{promise:c,resolve:a,reject:t}}},32954:(e,a)=>{"use strict";var t;Object.defineProperty(a,"__esModule",{value:!0}),a.timeSince=a.inMilliseconds=a.Duration=void 0,(t=a.Duration||(a.Duration={}))[t.Millisecond=1]="Millisecond",t[t.Second=1e3]="Second",t[t.Minute=6e4]="Minute",t[t.Hour=36e5]="Hour",t[t.Day=864e5]="Day",t[t.Week=6048e5]="Week",t[t.Year=31536e6]="Year";const c=(e,a)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${a}" must be a non-negative integer. Received: "${e}".`)};a.inMilliseconds=function(e,a){return c(e,"count"),e*a},a.timeSince=function(e){return c(e,"timestamp"),Date.now()-e}},16871:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},49266:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.satisfiesVersionRange=a.gtRange=a.gtVersion=a.assertIsSemVerRange=a.assertIsSemVerVersion=a.isValidSemVerRange=a.isValidSemVerVersion=a.VersionRangeStruct=a.VersionStruct=void 0;const c=t(35620),f=t(99589),d=t(22011);a.VersionStruct=(0,c.refine)((0,c.string)(),"Version",(e=>null!==(0,f.valid)(e)||`Expected SemVer version, got "${e}"`)),a.VersionRangeStruct=(0,c.refine)((0,c.string)(),"Version range",(e=>null!==(0,f.validRange)(e)||`Expected SemVer range, got "${e}"`)),a.isValidSemVerVersion=function(e){return(0,c.is)(e,a.VersionStruct)},a.isValidSemVerRange=function(e){return(0,c.is)(e,a.VersionRangeStruct)},a.assertIsSemVerVersion=function(e){(0,d.assertStruct)(e,a.VersionStruct)},a.assertIsSemVerRange=function(e){(0,d.assertStruct)(e,a.VersionRangeStruct)},a.gtVersion=function(e,a){return(0,f.gt)(e,a)},a.gtRange=function(e,a){return(0,f.gtr)(e,a)},a.satisfiesVersionRange=function(e,a){return(0,f.satisfies)(e,a,{includePrerelease:!0})}},39209:(e,a,t)=>{"use strict";var c=t(76578),f="undefined"==typeof globalThis?t.g:globalThis;e.exports=function(){for(var e=[],a=0;a{"use strict";const{normalizeIPv6:c,normalizeIPv4:f,removeDotSegments:d,recomposeAuthority:r,normalizeComponentEncoding:n}=t(34834),i=t(343);function b(e,a,t,c){const f={};return c||(e=u(o(e,t),t),a=u(o(a,t),t)),!(t=t||{}).tolerant&&a.scheme?(f.scheme=a.scheme,f.userinfo=a.userinfo,f.host=a.host,f.port=a.port,f.path=d(a.path||""),f.query=a.query):(void 0!==a.userinfo||void 0!==a.host||void 0!==a.port?(f.userinfo=a.userinfo,f.host=a.host,f.port=a.port,f.path=d(a.path||""),f.query=a.query):(a.path?("/"===a.path.charAt(0)?f.path=d(a.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?f.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+a.path:f.path=a.path:f.path="/"+a.path,f.path=d(f.path)),f.query=a.query):(f.path=e.path,void 0!==a.query?f.query=a.query:f.query=e.query),f.userinfo=e.userinfo,f.host=e.host,f.port=e.port),f.scheme=e.scheme),f.fragment=a.fragment,f}function o(e,a){const t={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},c=Object.assign({},a),f=[],n=i[(c.scheme||t.scheme||"").toLowerCase()];n&&n.serialize&&n.serialize(t,c),void 0!==t.path&&(c.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),void 0!==t.scheme&&(t.path=t.path.split("%3A").join(":")))),"suffix"!==c.reference&&t.scheme&&(f.push(t.scheme),f.push(":"));const b=r(t,c);if(void 0!==b&&("suffix"!==c.reference&&f.push("//"),f.push(b),t.path&&"/"!==t.path.charAt(0)&&f.push("/")),void 0!==t.path){let e=t.path;c.absolutePath||n&&n.absolutePath||(e=d(e)),void 0===b&&(e=e.replace(/^\/\//u,"/%2F")),f.push(e)}return void 0!==t.query&&(f.push("?"),f.push(t.query)),void 0!==t.fragment&&(f.push("#"),f.push(t.fragment)),f.join("")}const s=Array.from({length:127},((e,a)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(a)))),l=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function u(e,a){const t=Object.assign({},a),d={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},r=-1!==e.indexOf("%");let n=!1;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);const b=e.match(l);if(b){if(d.scheme=b[1],d.userinfo=b[3],d.host=b[4],d.port=parseInt(b[5],10),d.path=b[6]||"",d.query=b[7],d.fragment=b[8],isNaN(d.port)&&(d.port=b[5]),d.host){const e=f(d.host);if(!1===e.isIPV4){const a=c(e.host,{isIPV4:!1});d.host=a.host.toLowerCase(),n=a.isIPV6}else d.host=e.host,n=!0}void 0!==d.scheme||void 0!==d.userinfo||void 0!==d.host||void 0!==d.port||d.path||void 0!==d.query?void 0===d.scheme?d.reference="relative":void 0===d.fragment?d.reference="absolute":d.reference="uri":d.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==d.reference&&(d.error=d.error||"URI is not a "+t.reference+" reference.");const e=i[(t.scheme||d.scheme||"").toLowerCase()];if(!(t.unicodeSupport||e&&e.unicodeSupport)&&d.host&&(t.domainHost||e&&e.domainHost)&&!1===n&&function(e){let a=0;for(let t=0,c=e.length;t126||s[a])return!0;return!1}(d.host))try{d.host=URL.domainToASCII(d.host.toLowerCase())}catch(e){d.error=d.error||"Host's domain name can not be converted to ASCII: "+e}(!e||e&&!e.skipNormalize)&&(r&&void 0!==d.scheme&&(d.scheme=unescape(d.scheme)),r&&void 0!==d.userinfo&&(d.userinfo=unescape(d.userinfo)),r&&void 0!==d.host&&(d.host=unescape(d.host)),void 0!==d.path&&d.path.length&&(d.path=escape(unescape(d.path))),void 0!==d.fragment&&d.fragment.length&&(d.fragment=encodeURI(decodeURIComponent(d.fragment)))),e&&e.parse&&e.parse(d,t)}else d.error=d.error||"URI can not be parsed.";return d}const h={SCHEMES:i,normalize:function(e,a){return"string"==typeof e?e=o(u(e,a),a):"object"==typeof e&&(e=u(o(e,a),a)),e},resolve:function(e,a,t){const c=Object.assign({scheme:"null"},t);return o(b(u(e,c),u(a,c),c,!0),{...c,skipEscape:!0})},resolveComponents:b,equal:function(e,a,t){return"string"==typeof e?(e=unescape(e),e=o(n(u(e,t),!0),{...t,skipEscape:!0})):"object"==typeof e&&(e=o(n(e,!0),{...t,skipEscape:!0})),"string"==typeof a?(a=unescape(a),a=o(n(u(a,t),!0),{...t,skipEscape:!0})):"object"==typeof a&&(a=o(n(a,!0),{...t,skipEscape:!0})),e.toLowerCase()===a.toLowerCase()},serialize:o,parse:u};e.exports=h,e.exports.default=h,e.exports.fastUri=h},343:e=>{"use strict";const a=/^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu,t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function c(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function f(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function d(e){const a="https"===String(e.scheme).toLowerCase();return e.port!==(a?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const r={scheme:"http",domainHost:!0,parse:f,serialize:d},n={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=c(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(c(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[a,t]=e.resourceName.split("?");e.path=a&&"/"!==a?a:void 0,e.query=t,e.resourceName=void 0}return e.fragment=void 0,e}},i={http:r,https:{scheme:"https",domainHost:r.domainHost,parse:f,serialize:d},ws:n,wss:{scheme:"wss",domainHost:n.domainHost,parse:n.parse,serialize:n.serialize},urn:{scheme:"urn",parse:function(e,a){if(!e.path)return e.error="URN can not be parsed",e;const c=e.path.match(t);if(c){const t=a.scheme||e.scheme||"urn";e.nid=c[1].toLowerCase(),e.nss=c[2];const f=`${t}:${a.nid||e.nid}`,d=i[f];e.path=void 0,d&&(e=d.parse(e,a))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,a){const t=a.scheme||e.scheme||"urn",c=e.nid.toLowerCase(),f=`${t}:${a.nid||c}`,d=i[f];d&&(e=d.serialize(e,a));const r=e,n=e.nss;return r.path=`${c||a.nid}:${n}`,a.skipEscape=!0,r},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){const c=e;return c.uuid=c.nss,c.nss=void 0,t.tolerant||c.uuid&&a.test(c.uuid)||(c.error=c.error||"UUID is not valid."),c},serialize:function(e){const a=e;return a.nss=(e.uuid||"").toLowerCase(),a},skipNormalize:!0}};e.exports=i},64914:e=>{"use strict";e.exports={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}},34834:(e,a,t)=>{"use strict";const{HEX:c}=t(64914);function f(e){if(i(e,".")<3)return{host:e,isIPV4:!1};const a=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[t]=a;return t?{host:n(t,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function d(e,a=!1){let t="",f=!0;for(const a of e){if(void 0===c[a])return;"0"!==a&&!0===f&&(f=!1),f||(t+=a)}return a&&0===t.length&&(t="0"),t}function r(e,a={}){if(i(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let a=0;const t={error:!1,address:"",zone:""},c=[],f=[];let r=!1,n=!1,i=!1;function b(){if(f.length){if(!1===r){const e=d(f);if(void 0===e)return t.error=!0,!1;c.push(e)}f.length=0}return!0}for(let d=0;d7){t.error=!0;break}d-1>=0&&":"===e[d-1]&&(n=!0)}}return f.length&&(r?t.zone=f.join(""):i?c.push(f.join("")):c.push(d(f))),t.address=c.join(""),t}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,a=t.address;return t.zone&&(e+="%"+t.zone,a+="%25"+t.zone),{host:e,escapedHost:a,isIPV6:!0}}}function n(e,a){let t="",c=!0;const f=e.length;for(let d=0;d{"use strict";t.d(a,{HI:()=>Bt,vu:()=>ct});const c=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];function f(e,a){return a&&10!=a?16==a?"0x"==e.slice(0,2)?BigInt(e):BigInt("0x"+e):void 0:BigInt(e)}const d=f;function r(e){const a=e.toString(16);return 4*(a.length-1)+c[parseInt(a[0],16)]}function n(e){return BigInt(e)>BigInt(a)}const o=i,s=b;function l(e){return(BigInt(e)&BigInt(1))==BigInt(1)}function u(e){if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("Number too big");return Number(e)}function h(e,a){return BigInt(e)+BigInt(a)}function p(e,a){return BigInt(e)-BigInt(a)}function g(e){return-BigInt(e)}function m(e,a){return BigInt(e)*BigInt(a)}function x(e,a){return BigInt(e)%BigInt(a)}function y(e,a){return BigInt(e)>BigInt(a)}function A(e,a){return BigInt(e)>=BigInt(a)}function v(e,a){return BigInt(e)&BigInt(a)}function w(e,a,t,c){const f="0000000"+t.toString(16),d=new Uint32Array(e.buffer,e.byteOffset+a,c/4),r=1+(4*(f.length-7)-1>>5);for(let e=0;ed[d.length-a-1]=e.toString(16).padStart(8,"0"))),f(d.join(""),16)}function I(e,a){return e.toString(a)}function E(e){const a=new Uint8Array(Math.floor((r(e)-1)/8)+1);return w(a,0,e,a.byteLength),a}const C=d(0),M=d(1);var B=Object.freeze({__proto__:null,abs:function(e){return BigInt(e)>=0?BigInt(e):-BigInt(e)},add:h,band:v,bitLength:r,bits:function(e){let a=BigInt(e);const t=[];for(;a;)a&BigInt(1)?t.push(1):t.push(0),a>>=BigInt(1);return t},bor:function(e,a){return BigInt(e)|BigInt(a)},bxor:function(e,a){return BigInt(e)^BigInt(a)},div:function(e,a){return BigInt(e)/BigInt(a)},e:d,eq:function(e,a){return BigInt(e)==BigInt(a)},exp:function(e,a){return BigInt(e)**BigInt(a)},fromArray:function(e,a){let t=BigInt(0);a=BigInt(a);for(let c=0;c>=BigInt(1)}return t},neg:g,neq:function(e,a){return BigInt(e)!=BigInt(a)},one:M,pow:function(e,a){return BigInt(e)**BigInt(a)},shiftLeft:i,shiftRight:b,shl:o,shr:s,square:function(e){return BigInt(e)*BigInt(e)},sub:p,toArray:function(e,a){const t=[];let c=BigInt(e);for(a=BigInt(a);c;)t.unshift(Number(c%a)),c/=a;return t},toLEBuff:E,toNumber:u,toRprBE:function(e,a,t,c){const f="0000000"+t.toString(16),d=new DataView(e.buffer,e.byteOffset+a,c),r=1+(4*(f.length-7)-1>>5);for(let e=0;e>=1;return t}function k(e,a,t,c,f){e[a]=e[a]+e[t]>>>0,e[f]=(e[f]^e[a])>>>0,e[f]=(e[f]<<16|e[f]>>>16&65535)>>>0,e[c]=e[c]+e[f]>>>0,e[t]=(e[t]^e[c])>>>0,e[t]=(e[t]<<12|e[t]>>>20&4095)>>>0,e[a]=e[a]+e[t]>>>0,e[f]=(e[f]^e[a])>>>0,e[f]=(e[f]<<8|e[f]>>>24&255)>>>0,e[c]=e[c]+e[f]>>>0,e[t]=(e[t]^e[c])>>>0,e[t]=(e[t]<<7|e[t]>>>25&127)>>>0}class N{constructor(e){e=e||[0,0,0,0,0,0,0,0],this.state=[1634760805,857760878,2036477234,1797285236,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],0,0,0,0],this.idx=16,this.buff=new Array(16)}nextU32(){return 16==this.idx&&this.update(),this.buff[this.idx++]}nextU64(){return h(m(this.nextU32(),4294967296),this.nextU32())}nextBool(){return!(1&~this.nextU32())}update(){for(let e=0;e<16;e++)this.buff[e]=this.state[e];for(let a=0;a<10;a++)k(e=this.buff,0,4,8,12),k(e,1,5,9,13),k(e,2,6,10,14),k(e,3,7,11,15),k(e,0,5,10,15),k(e,1,6,11,12),k(e,2,7,8,13),k(e,3,4,9,14);var e;for(let e=0;e<16;e++)this.buff[e]=this.buff[e]+this.state[e]>>>0;this.idx=0,this.state[12]=this.state[12]+1>>>0,0==this.state[12]&&(this.state[13]=this.state[13]+1>>>0,0==this.state[13]&&(this.state[14]=this.state[14]+1>>>0,0==this.state[14]&&(this.state[15]=this.state[15]+1>>>0)))}}let P=null;function R(){return P||(P=new N(function(){const e=function(e){let a=new Uint8Array(e);if(void 0!==globalThis.crypto)globalThis.crypto.getRandomValues(a);else for(let t=0;t>>0;return a}(32),a=new Uint32Array(e.buffer),t=[];for(let e=0;e<8;e++)t.push(a[e]);return t}()),P)}function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D={bigInt2BytesLE:function(e,a){const t=Array(a);let c=BigInt(e);for(let e=0;e>=8n;return t},bigInt2U32LE:function(e,a){const t=Array(a);let c=BigInt(e);for(let e=0;e>=32n;return t},isOcamNum:function(e){return!!Array.isArray(e)&&3==e.length&&"number"==typeof e[0]&&"number"==typeof e[1]&&!!Array.isArray(e[2])}},T=function(e,a,t,c,f,d,r){const n=e.addFunction(a);n.addParam("base","i32"),n.addParam("scalar","i32"),n.addParam("scalarLength","i32"),n.addParam("r","i32"),n.addLocal("i","i32"),n.addLocal("b","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(t));n.addCode(i.if(i.i32_eqz(i.getLocal("scalarLength")),[...i.call(r,i.getLocal("r")),...i.ret([])])),n.addCode(i.call(d,i.getLocal("base"),b)),n.addCode(i.call(r,i.getLocal("r"))),n.addCode(i.setLocal("i",i.getLocal("scalarLength"))),n.addCode(i.block(i.loop(i.setLocal("i",i.i32_sub(i.getLocal("i"),i.i32_const(1))),i.setLocal("b",i.i32_load8_u(i.i32_add(i.getLocal("scalar"),i.getLocal("i")))),...function(){const e=[];for(let a=0;a<8;a++)e.push(...i.call(f,i.getLocal("r"),i.getLocal("r")),...i.if(i.i32_ge_u(i.getLocal("b"),i.i32_const(128>>a)),[...i.setLocal("b",i.i32_sub(i.getLocal("b"),i.i32_const(128>>a))),...i.call(c,i.getLocal("r"),b,i.getLocal("r"))]));return e}(),i.br_if(1,i.i32_eqz(i.getLocal("i"))),i.br(0))))},F=function(e,a){const t=8*e.modules[a].n64,c=e.addFunction(a+"_batchInverse");c.addParam("pIn","i32"),c.addParam("inStep","i32"),c.addParam("n","i32"),c.addParam("pOut","i32"),c.addParam("outStep","i32"),c.addLocal("itAux","i32"),c.addLocal("itIn","i32"),c.addLocal("itOut","i32"),c.addLocal("i","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(t));c.addCode(f.setLocal("itAux",f.i32_load(f.i32_const(0))),f.i32_store(f.i32_const(0),f.i32_add(f.getLocal("itAux"),f.i32_mul(f.i32_add(f.getLocal("n"),f.i32_const(1)),f.i32_const(t))))),c.addCode(f.call(a+"_one",f.getLocal("itAux")),f.setLocal("itIn",f.getLocal("pIn")),f.setLocal("itAux",f.i32_add(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("i",f.i32_const(0)),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("i"),f.getLocal("n"))),f.if(f.call(a+"_isZero",f.getLocal("itIn")),f.call(a+"_copy",f.i32_sub(f.getLocal("itAux"),f.i32_const(t)),f.getLocal("itAux")),f.call(a+"_mul",f.getLocal("itIn"),f.i32_sub(f.getLocal("itAux"),f.i32_const(t)),f.getLocal("itAux"))),f.setLocal("itIn",f.i32_add(f.getLocal("itIn"),f.getLocal("inStep"))),f.setLocal("itAux",f.i32_add(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("i",f.i32_add(f.getLocal("i"),f.i32_const(1))),f.br(0))),f.setLocal("itIn",f.i32_sub(f.getLocal("itIn"),f.getLocal("inStep"))),f.setLocal("itAux",f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("itOut",f.i32_add(f.getLocal("pOut"),f.i32_mul(f.i32_sub(f.getLocal("n"),f.i32_const(1)),f.getLocal("outStep")))),f.call(a+"_inverse",f.getLocal("itAux"),f.getLocal("itAux")),f.block(f.loop(f.br_if(1,f.i32_eqz(f.getLocal("i"))),f.if(f.call(a+"_isZero",f.getLocal("itIn")),[...f.call(a+"_copy",f.getLocal("itAux"),f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),...f.call(a+"_zero",f.getLocal("itOut"))],[...f.call(a+"_copy",f.i32_sub(f.getLocal("itAux"),f.i32_const(t)),d),...f.call(a+"_mul",f.getLocal("itAux"),f.getLocal("itIn"),f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),...f.call(a+"_mul",f.getLocal("itAux"),d,f.getLocal("itOut"))]),f.setLocal("itIn",f.i32_sub(f.getLocal("itIn"),f.getLocal("inStep"))),f.setLocal("itOut",f.i32_sub(f.getLocal("itOut"),f.getLocal("outStep"))),f.setLocal("itAux",f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("i",f.i32_sub(f.getLocal("i"),f.i32_const(1))),f.br(0)))),c.addCode(f.i32_store(f.i32_const(0),f.getLocal("itAux")))},Q=function(e,a,t,c,f,d){void 0===d&&(d=ca?1:-1}function H(e){return e*e}function $(e){return e%2n!==0n}function q(e){return e%2n===0n}function G(e){return e<0n}function z(e){return e>0n}function K(e){return G(e)?e.toString(2).length-1:e.toString(2).length}function V(e){return e<0n?-e:e}function Z(e){return 1n===V(e)}function J(e,a){for(var t,c,f,d=0n,r=1n,n=a,i=V(e);0n!==i;)t=n/i,c=d,f=n,d=r,n=i,r=c-t*r,i=f-t*i;if(!Z(n))throw new Error(e.toString()+" and "+a.toString()+" are not co-prime");return-1===j(d,0n)&&(d+=a),G(e)?-d:d}function W(e,a,t){if(0n===t)throw new Error("Cannot take modPow with modulus 0");var c=1n,f=e%t;for(G(a)&&(a*=-1n,f=J(f,t));z(a);){if(0n===f)return 0n;$(a)&&(c=c*f%t),a/=2n,f=H(f)%t}return c}function Y(e,a){return 0n!==a&&(!!Z(a)||(0===function(e,a){return(e=e>=0n?e:-e)===(a=a>=0n?a:-a)?0:e>a?1:-1}(a,2n)?q(e):e%a===0n))}function X(e,a){for(var t,c,f,d=function(e){return e-1n}(e),r=d,n=0;q(r);)r/=2n,n++;e:for(c=0;c>1&&c>1,e>>1)))),a.addCode(t.setLocal(i,t.i64_add(t.getLocal(i),t.i64_shr_u(t.getLocal(n),t.i64_const(32)))))),e>0&&(a.addCode(t.setLocal(n,t.i64_add(t.i64_and(t.getLocal(n),t.i64_const(4294967295)),t.i64_and(t.getLocal(b),t.i64_const(4294967295))))),a.addCode(t.setLocal(i,t.i64_add(t.i64_add(t.getLocal(i),t.i64_shr_u(t.getLocal(n),t.i64_const(32))),t.getLocal(o))))),a.addCode(t.i64_store32(t.getLocal("r"),4*e,t.getLocal(n))),a.addCode(t.setLocal(b,t.getLocal(i)),t.setLocal(o,t.i64_shr_u(t.getLocal(b),t.i64_const(32))))}a.addCode(t.i64_store32(t.getLocal("r"),4*f*2-4,t.getLocal(b)))}(),function(){const a=e.addFunction(c+"_squareOld");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(c+"_mul",t.getLocal("x"),t.getLocal("x"),t.getLocal("r")))}(),function(){!function(){const a=e.addFunction(c+"__mul1");a.addParam("px","i32"),a.addParam("y","i64"),a.addParam("pr","i32"),a.addLocal("c","i64");const t=a.getCodeBuilder();a.addCode(t.setLocal("c",t.i64_mul(t.i64_load32_u(t.getLocal("px"),0,0),t.getLocal("y")))),a.addCode(t.i64_store32(t.getLocal("pr"),0,0,t.getLocal("c")));for(let e=1;e>1n,g=e.alloc(n,ee.bigInt2BytesLE(p,n)),m=p+1n,x=e.alloc(n,ee.bigInt2BytesLE(m,n));e.modules[i]={pq:o,pR2:s,n64:d,q:f,pOne:l,pZero:u,pePlusOne:x};let y=2n;if(ie(f))for(;ne(y,p,f)!==h;)y+=1n;let A=0,v=h;for(;!be(v)&&0n!==v;)A++,v>>=1n;const w=e.alloc(n,ee.bigInt2BytesLE(v,n)),_=ne(y,v,f),I=e.alloc(ee.bigInt2BytesLE((_<>1n,C=e.alloc(n,ee.bigInt2BytesLE(E,n));return e.exportFunction(b+"_copy",i+"_copy"),e.exportFunction(b+"_zero",i+"_zero"),e.exportFunction(b+"_isZero",i+"_isZero"),e.exportFunction(b+"_eq",i+"_eq"),function(){const a=e.addFunction(i+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder();a.addCode(t.ret(t.call(b+"_eq",t.getLocal("x"),t.i32_const(l))))}(),function(){const a=e.addFunction(i+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.if(t.call(b+"_add",t.getLocal("x"),t.getLocal("y"),t.getLocal("r")),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),t.if(t.call(b+"_gte",t.getLocal("r"),t.i32_const(o)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))))))}(),function(){const a=e.addFunction(i+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.if(t.call(b+"_sub",t.getLocal("x"),t.getLocal("y"),t.getLocal("r")),t.drop(t.call(b+"_add",t.getLocal("r"),t.i32_const(o),t.getLocal("r")))))}(),function(){const a=e.addFunction(i+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_sub",t.i32_const(u),t.getLocal("x"),t.getLocal("r")))}(),function(){const a=e.alloc(r*r*8),t=e.addFunction(i+"_mReduct");t.addParam("t","i32"),t.addParam("r","i32"),t.addLocal("np32","i64"),t.addLocal("c","i64"),t.addLocal("m","i64");const c=t.getCodeBuilder(),d=Number(0x100000000n-re(f,0x100000000n));t.addCode(c.setLocal("np32",c.i64_const(d)));for(let e=0;e=r&&a.addCode(t.i64_store32(t.getLocal("r"),4*(e-r),t.getLocal(h))),[h,p]=[p,h],a.addCode(t.setLocal(p,t.i64_shr_u(t.getLocal(h),t.i64_const(32))))}a.addCode(t.i64_store32(t.getLocal("r"),4*r-4,t.getLocal(h))),a.addCode(t.if(t.i32_wrap_i64(t.getLocal(p)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),t.if(t.call(b+"_gte",t.getLocal("r"),t.i32_const(o)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))))))}(),function(){const a=e.addFunction(i+"_square");a.addParam("x","i32"),a.addParam("r","i32"),a.addLocal("c0","i64"),a.addLocal("c1","i64"),a.addLocal("c0_old","i64"),a.addLocal("c1_old","i64"),a.addLocal("np32","i64");for(let e=0;e>1&&c>1,e>>1)))),a.addCode(t.setLocal(h,t.i64_add(t.getLocal(h),t.i64_shr_u(t.getLocal(u),t.i64_const(32)))))),e>0&&(a.addCode(t.setLocal(u,t.i64_add(t.i64_and(t.getLocal(u),t.i64_const(4294967295)),t.i64_and(t.getLocal(p),t.i64_const(4294967295))))),a.addCode(t.setLocal(h,t.i64_add(t.i64_add(t.getLocal(h),t.i64_shr_u(t.getLocal(u),t.i64_const(32))),t.getLocal(g)))));for(let c=Math.max(1,e-r+1);c<=e&&c=r&&a.addCode(t.i64_store32(t.getLocal("r"),4*(e-r),t.getLocal(u))),a.addCode(t.setLocal(p,t.getLocal(h)),t.setLocal(g,t.i64_shr_u(t.getLocal(p),t.i64_const(32))))}a.addCode(t.i64_store32(t.getLocal("r"),4*r-4,t.getLocal(p))),a.addCode(t.if(t.i32_wrap_i64(t.getLocal(g)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),t.if(t.call(b+"_gte",t.getLocal("r"),t.i32_const(o)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))))))}(),function(){const a=e.addFunction(i+"_squareOld");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_mul",t.getLocal("x"),t.getLocal("x"),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_mul",t.getLocal("x"),t.i32_const(s),t.getLocal("r")))}(),function(){const a=e.alloc(2*n),t=e.addFunction(i+"_fromMontgomery");t.addParam("x","i32"),t.addParam("r","i32");const c=t.getCodeBuilder();t.addCode(c.call(b+"_copy",c.getLocal("x"),c.i32_const(a))),t.addCode(c.call(b+"_zero",c.i32_const(a+n))),t.addCode(c.call(i+"_mReduct",c.i32_const(a),c.getLocal("r")))}(),function(){const a=e.addFunction(i+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n));a.addCode(t.call(i+"_fromMontgomery",t.getLocal("x"),c),t.call(b+"_gte",c,t.i32_const(x)))}(),function(){const a=e.addFunction(i+"_sign");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n));a.addCode(t.if(t.call(b+"_isZero",t.getLocal("x")),t.ret(t.i32_const(0))),t.call(i+"_fromMontgomery",t.getLocal("x"),c),t.if(t.call(b+"_gte",c,t.i32_const(x)),t.ret(t.i32_const(-1))),t.ret(t.i32_const(1)))}(),function(){const a=e.addFunction(i+"_inverse");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_fromMontgomery",t.getLocal("x"),t.getLocal("r"))),a.addCode(t.call(b+"_inverseMod",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),a.addCode(t.call(i+"_toMontgomery",t.getLocal("r"),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_one");a.addParam("pr","i32");const t=a.getCodeBuilder();a.addCode(t.call(b+"_copy",t.i32_const(l),t.getLocal("pr")))}(),function(){const a=e.addFunction(i+"_load");a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32"),a.addLocal("p","i32"),a.addLocal("l","i32"),a.addLocal("i","i32"),a.addLocal("j","i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n)),f=e.alloc(n),d=t.i32_const(f);a.addCode(t.call(b+"_zero",t.getLocal("r")),t.setLocal("i",t.i32_const(n)),t.setLocal("p",t.getLocal("scalar")),t.block(t.loop(t.br_if(1,t.i32_gt_u(t.getLocal("i"),t.getLocal("scalarLen"))),t.if(t.i32_eq(t.getLocal("i"),t.i32_const(n)),t.call(i+"_one",c),t.call(i+"_mul",c,t.i32_const(s),c)),t.call(i+"_mul",t.getLocal("p"),c,d),t.call(i+"_add",t.getLocal("r"),d,t.getLocal("r")),t.setLocal("p",t.i32_add(t.getLocal("p"),t.i32_const(n))),t.setLocal("i",t.i32_add(t.getLocal("i"),t.i32_const(n))),t.br(0))),t.setLocal("l",t.i32_rem_u(t.getLocal("scalarLen"),t.i32_const(n))),t.if(t.i32_eqz(t.getLocal("l")),t.ret([])),t.call(b+"_zero",d),t.setLocal("j",t.i32_const(0)),t.block(t.loop(t.br_if(1,t.i32_eq(t.getLocal("j"),t.getLocal("l"))),t.i32_store8(t.getLocal("j"),f,t.i32_load8_u(t.getLocal("p"))),t.setLocal("p",t.i32_add(t.getLocal("p"),t.i32_const(1))),t.setLocal("j",t.i32_add(t.getLocal("j"),t.i32_const(1))),t.br(0))),t.if(t.i32_eq(t.getLocal("i"),t.i32_const(n)),t.call(i+"_one",c),t.call(i+"_mul",c,t.i32_const(s),c)),t.call(i+"_mul",d,c,d),t.call(i+"_add",t.getLocal("r"),d,t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n));a.addCode(t.call(i+"_load",t.getLocal("scalar"),t.getLocal("scalarLen"),c),t.call(i+"_toMontgomery",c,c),t.call(i+"_mul",t.getLocal("x"),c,t.getLocal("r")))}(),te(e,i),ce(e,i+"_batchToMontgomery",i+"_toMontgomery",n,n),ce(e,i+"_batchFromMontgomery",i+"_fromMontgomery",n,n),ce(e,i+"_batchNeg",i+"_neg",n,n),fe(e,i+"_batchAdd",i+"_add",n,n),fe(e,i+"_batchSub",i+"_sub",n,n),fe(e,i+"_batchMul",i+"_mul",n,n),e.exportFunction(i+"_add"),e.exportFunction(i+"_sub"),e.exportFunction(i+"_neg"),e.exportFunction(i+"_isNegative"),e.exportFunction(i+"_isOne"),e.exportFunction(i+"_sign"),e.exportFunction(i+"_mReduct"),e.exportFunction(i+"_mul"),e.exportFunction(i+"_square"),e.exportFunction(i+"_squareOld"),e.exportFunction(i+"_fromMontgomery"),e.exportFunction(i+"_toMontgomery"),e.exportFunction(i+"_inverse"),e.exportFunction(i+"_one"),e.exportFunction(i+"_load"),e.exportFunction(i+"_timesScalar"),ae(e,i+"_exp",n,i+"_mul",i+"_square",b+"_copy",i+"_one"),e.exportFunction(i+"_exp"),e.exportFunction(i+"_batchInverse"),ie(f)&&(function(){const a=e.addFunction(i+"_sqrt");a.addParam("n","i32"),a.addParam("r","i32"),a.addLocal("m","i32"),a.addLocal("i","i32"),a.addLocal("j","i32");const t=a.getCodeBuilder(),c=t.i32_const(l),f=t.i32_const(e.alloc(n)),d=t.i32_const(e.alloc(n)),r=t.i32_const(e.alloc(n)),b=t.i32_const(e.alloc(n)),o=t.i32_const(e.alloc(n));a.addCode(t.if(t.call(i+"_isZero",t.getLocal("n")),t.ret(t.call(i+"_zero",t.getLocal("r")))),t.setLocal("m",t.i32_const(A)),t.call(i+"_copy",t.i32_const(I),f),t.call(i+"_exp",t.getLocal("n"),t.i32_const(w),t.i32_const(n),d),t.call(i+"_exp",t.getLocal("n"),t.i32_const(C),t.i32_const(n),r),t.block(t.loop(t.br_if(1,t.call(i+"_eq",d,c)),t.call(i+"_square",d,b),t.setLocal("i",t.i32_const(1)),t.block(t.loop(t.br_if(1,t.call(i+"_eq",b,c)),t.call(i+"_square",b,b),t.setLocal("i",t.i32_add(t.getLocal("i"),t.i32_const(1))),t.br(0))),t.call(i+"_copy",f,o),t.setLocal("j",t.i32_sub(t.i32_sub(t.getLocal("m"),t.getLocal("i")),t.i32_const(1))),t.block(t.loop(t.br_if(1,t.i32_eqz(t.getLocal("j"))),t.call(i+"_square",o,o),t.setLocal("j",t.i32_sub(t.getLocal("j"),t.i32_const(1))),t.br(0))),t.setLocal("m",t.getLocal("i")),t.call(i+"_square",o,f),t.call(i+"_mul",d,f,d),t.call(i+"_mul",r,o,r),t.br(0))),t.if(t.call(i+"_isNegative",r),t.call(i+"_neg",r,t.getLocal("r")),t.call(i+"_copy",r,t.getLocal("r"))))}(),function(){const a=e.addFunction(i+"_isSquare");a.addParam("n","i32"),a.setReturnType("i32");const t=a.getCodeBuilder(),c=t.i32_const(l),f=t.i32_const(e.alloc(n));a.addCode(t.if(t.call(i+"_isZero",t.getLocal("n")),t.ret(t.i32_const(1))),t.call(i+"_exp",t.getLocal("n"),t.i32_const(g),t.i32_const(n),f),t.call(i+"_eq",f,c))}(),e.exportFunction(i+"_sqrt"),e.exportFunction(i+"_isSquare")),e.exportFunction(i+"_batchToMontgomery"),e.exportFunction(i+"_batchFromMontgomery"),i};const le=se,{bitLength:ue}=U;var he=function(e,a,t,c,f){const d=BigInt(a),r=Math.floor((ue(d-1n)-1)/64)+1,n=8*r,i=t||"f1";if(e.modules[i])return i;e.modules[i]={n64:r};const b=f||"int",o=le(e,d,c,b),s=e.modules[o].pR2,l=e.modules[o].pq,u=e.modules[o].pePlusOne;return function(){const a=e.alloc(n),t=e.addFunction(i+"_mul");t.addParam("x","i32"),t.addParam("y","i32"),t.addParam("r","i32");const c=t.getCodeBuilder();t.addCode(c.call(o+"_mul",c.getLocal("x"),c.getLocal("y"),c.i32_const(a))),t.addCode(c.call(o+"_mul",c.i32_const(a),c.i32_const(s),c.getLocal("r")))}(),function(){const a=e.addFunction(i+"_square");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_mul",t.getLocal("x"),t.getLocal("x"),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_inverse");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(b+"_inverseMod",t.getLocal("x"),t.i32_const(l),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder();a.addCode(t.call(b+"_gte",t.getLocal("x"),t.i32_const(u)))}(),e.exportFunction(o+"_add",i+"_add"),e.exportFunction(o+"_sub",i+"_sub"),e.exportFunction(o+"_neg",i+"_neg"),e.exportFunction(i+"_mul"),e.exportFunction(i+"_square"),e.exportFunction(i+"_inverse"),e.exportFunction(i+"_isNegative"),e.exportFunction(o+"_copy",i+"_copy"),e.exportFunction(o+"_zero",i+"_zero"),e.exportFunction(o+"_one",i+"_one"),e.exportFunction(o+"_isZero",i+"_isZero"),e.exportFunction(o+"_eq",i+"_eq"),i};const pe=T,ge=F,me=D;var xe=function(e,a,t,c){if(e.modules[t])return t;const f=8*e.modules[c].n64,d=e.modules[c].q;return e.modules[t]={n64:2*e.modules[c].n64},function(){const a=e.addFunction(t+"_isZero");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.i32_and(d.call(c+"_isZero",r),d.call(c+"_isZero",n)))}(),function(){const a=e.addFunction(t+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.ret(d.i32_and(d.call(c+"_isOne",r),d.call(c+"_isZero",n))))}(),function(){const a=e.addFunction(t+"_zero");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.call(c+"_zero",r),d.call(c+"_zero",n))}(),function(){const a=e.addFunction(t+"_one");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.call(c+"_one",r),d.call(c+"_zero",n))}(),function(){const a=e.addFunction(t+"_copy");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_copy",r,i),d.call(c+"_copy",n,b))}(),function(){const d=e.addFunction(t+"_mul");d.addParam("x","i32"),d.addParam("y","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.getLocal("y"),o=r.i32_add(r.getLocal("y"),r.i32_const(f)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f)),p=r.i32_const(e.alloc(f)),g=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_mul",n,b,u),r.call(c+"_mul",i,o,h),r.call(c+"_add",n,i,p),r.call(c+"_add",b,o,g),r.call(c+"_mul",p,g,p),r.call(a,h,s),r.call(c+"_add",u,s,s),r.call(c+"_add",u,h,l),r.call(c+"_sub",p,l,l))}(),function(){const a=e.addFunction(t+"_mul1");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_mul",r,i,b),d.call(c+"_mul",n,i,o))}(),function(){const d=e.addFunction(t+"_square");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.getLocal("r"),o=r.i32_add(r.getLocal("r"),r.i32_const(f)),s=r.i32_const(e.alloc(f)),l=r.i32_const(e.alloc(f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_mul",n,i,s),r.call(c+"_add",n,i,l),r.call(a,i,u),r.call(c+"_add",n,u,u),r.call(a,s,h),r.call(c+"_add",h,s,h),r.call(c+"_mul",l,u,b),r.call(c+"_sub",b,h,b),r.call(c+"_add",s,s,o))}(),function(){const a=e.addFunction(t+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.i32_add(d.getLocal("y"),d.i32_const(f)),o=d.getLocal("r"),s=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_add",r,i,o),d.call(c+"_add",n,b,s))}(),function(){const a=e.addFunction(t+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.i32_add(d.getLocal("y"),d.i32_const(f)),o=d.getLocal("r"),s=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_sub",r,i,o),d.call(c+"_sub",n,b,s))}(),function(){const a=e.addFunction(t+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_neg",r,i),d.call(c+"_neg",n,b))}(),function(){const a=e.addFunction(t+"_conjugate");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_copy",r,i),d.call(c+"_neg",n,b))}(),function(){const a=e.addFunction(t+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_toMontgomery",r,i),d.call(c+"_toMontgomery",n,b))}(),function(){const a=e.addFunction(t+"_fromMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_fromMontgomery",r,i),d.call(c+"_fromMontgomery",n,b))}(),function(){const a=e.addFunction(t+"_eq");a.addParam("x","i32"),a.addParam("y","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.i32_add(d.getLocal("y"),d.i32_const(f));a.addCode(d.i32_and(d.call(c+"_eq",r,i),d.call(c+"_eq",n,b)))}(),function(){const d=e.addFunction(t+"_inverse");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.getLocal("r"),o=r.i32_add(r.getLocal("r"),r.i32_const(f)),s=r.i32_const(e.alloc(f)),l=r.i32_const(e.alloc(f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_square",n,s),r.call(c+"_square",i,l),r.call(a,l,u),r.call(c+"_sub",s,u,u),r.call(c+"_inverse",u,h),r.call(c+"_mul",n,h,b),r.call(c+"_mul",i,h,o),r.call(c+"_neg",o,o))}(),function(){const a=e.addFunction(t+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_timesScalar",r,d.getLocal("scalar"),d.getLocal("scalarLen"),i),d.call(c+"_timesScalar",n,d.getLocal("scalar"),d.getLocal("scalarLen"),b))}(),function(){const a=e.addFunction(t+"_sign");a.addParam("x","i32"),a.addLocal("s","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.setLocal("s",d.call(c+"_sign",n)),d.if(d.getLocal("s"),d.ret(d.getLocal("s"))),d.ret(d.call(c+"_sign",r)))}(),function(){const a=e.addFunction(t+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.if(d.call(c+"_isZero",n),d.ret(d.call(c+"_isNegative",r))),d.ret(d.call(c+"_isNegative",n)))}(),e.exportFunction(t+"_isZero"),e.exportFunction(t+"_isOne"),e.exportFunction(t+"_zero"),e.exportFunction(t+"_one"),e.exportFunction(t+"_copy"),e.exportFunction(t+"_mul"),e.exportFunction(t+"_mul1"),e.exportFunction(t+"_square"),e.exportFunction(t+"_add"),e.exportFunction(t+"_sub"),e.exportFunction(t+"_neg"),e.exportFunction(t+"_sign"),e.exportFunction(t+"_conjugate"),e.exportFunction(t+"_fromMontgomery"),e.exportFunction(t+"_toMontgomery"),e.exportFunction(t+"_eq"),e.exportFunction(t+"_inverse"),ge(e,t),pe(e,t+"_exp",2*f,t+"_mul",t+"_square",t+"_copy",t+"_one"),function(){const a=e.addFunction(t+"_sqrt");a.addParam("a","i32"),a.addParam("pr","i32");const r=a.getCodeBuilder(),n=r.i32_const(e.alloc(me.bigInt2BytesLE((BigInt(d||0)-3n)/4n,f))),i=r.i32_const(e.alloc(me.bigInt2BytesLE((BigInt(d||0)-1n)/2n,f))),b=r.getLocal("a"),o=r.i32_const(e.alloc(2*f)),s=r.i32_const(e.alloc(2*f)),l=r.i32_const(e.alloc(2*f)),u=e.alloc(2*f),h=r.i32_const(u),p=r.i32_const(u),g=r.i32_const(u+f),m=r.i32_const(e.alloc(2*f)),x=r.i32_const(e.alloc(2*f));a.addCode(r.call(t+"_one",h),r.call(t+"_neg",h,h),r.call(t+"_exp",b,n,r.i32_const(f),o),r.call(t+"_square",o,s),r.call(t+"_mul",b,s,s),r.call(t+"_conjugate",s,l),r.call(t+"_mul",l,s,l),r.if(r.call(t+"_eq",l,h),r.unreachable()),r.call(t+"_mul",o,b,m),r.if(r.call(t+"_eq",s,h),[...r.call(c+"_zero",p),...r.call(c+"_one",g),...r.call(t+"_mul",h,m,r.getLocal("pr"))],[...r.call(t+"_one",x),...r.call(t+"_add",x,s,x),...r.call(t+"_exp",x,i,r.i32_const(f),x),...r.call(t+"_mul",x,m,r.getLocal("pr"))]))}(),function(){const a=e.addFunction(t+"_isSquare");a.addParam("a","i32"),a.setReturnType("i32");const c=a.getCodeBuilder(),r=c.i32_const(e.alloc(me.bigInt2BytesLE((BigInt(d||0)-3n)/4n,f))),n=c.getLocal("a"),i=c.i32_const(e.alloc(2*f)),b=c.i32_const(e.alloc(2*f)),o=c.i32_const(e.alloc(2*f)),s=e.alloc(2*f),l=c.i32_const(s);a.addCode(c.call(t+"_one",l),c.call(t+"_neg",l,l),c.call(t+"_exp",n,r,c.i32_const(f),i),c.call(t+"_square",i,b),c.call(t+"_mul",n,b,b),c.call(t+"_conjugate",b,o),c.call(t+"_mul",o,b,o),c.if(c.call(t+"_eq",o,l),c.ret(c.i32_const(0))),c.ret(c.i32_const(1)))}(),e.exportFunction(t+"_exp"),e.exportFunction(t+"_timesScalar"),e.exportFunction(t+"_batchInverse"),e.exportFunction(t+"_sqrt"),e.exportFunction(t+"_isSquare"),e.exportFunction(t+"_isNegative"),t};const ye=T,Ae=F;var ve=function(e,a,t,c){if(e.modules[t])return t;const f=8*e.modules[c].n64;return e.modules[t]={n64:3*e.modules[c].n64},function(){const a=e.addFunction(t+"_isZero");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.i32_and(d.i32_and(d.call(c+"_isZero",r),d.call(c+"_isZero",n)),d.call(c+"_isZero",i)))}(),function(){const a=e.addFunction(t+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.ret(d.i32_and(d.i32_and(d.call(c+"_isOne",r),d.call(c+"_isZero",n)),d.call(c+"_isZero",i))))}(),function(){const a=e.addFunction(t+"_zero");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.call(c+"_zero",r),d.call(c+"_zero",n),d.call(c+"_zero",i))}(),function(){const a=e.addFunction(t+"_one");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.call(c+"_one",r),d.call(c+"_zero",n),d.call(c+"_zero",i))}(),function(){const a=e.addFunction(t+"_copy");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_copy",r,b),d.call(c+"_copy",n,o),d.call(c+"_copy",i,s))}(),function(){const d=e.addFunction(t+"_mul");d.addParam("x","i32"),d.addParam("y","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.i32_add(r.getLocal("x"),r.i32_const(2*f)),o=r.getLocal("y"),s=r.i32_add(r.getLocal("y"),r.i32_const(f)),l=r.i32_add(r.getLocal("y"),r.i32_const(2*f)),u=r.getLocal("r"),h=r.i32_add(r.getLocal("r"),r.i32_const(f)),p=r.i32_add(r.getLocal("r"),r.i32_const(2*f)),g=r.i32_const(e.alloc(f)),m=r.i32_const(e.alloc(f)),x=r.i32_const(e.alloc(f)),y=r.i32_const(e.alloc(f)),A=r.i32_const(e.alloc(f)),v=r.i32_const(e.alloc(f)),w=r.i32_const(e.alloc(f)),_=r.i32_const(e.alloc(f)),I=r.i32_const(e.alloc(f)),E=r.i32_const(e.alloc(f)),C=r.i32_const(e.alloc(f)),M=r.i32_const(e.alloc(f)),B=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_mul",n,o,g),r.call(c+"_mul",i,s,m),r.call(c+"_mul",b,l,x),r.call(c+"_add",n,i,y),r.call(c+"_add",o,s,A),r.call(c+"_add",n,b,v),r.call(c+"_add",o,l,w),r.call(c+"_add",i,b,_),r.call(c+"_add",s,l,I),r.call(c+"_add",g,m,E),r.call(c+"_add",g,x,C),r.call(c+"_add",m,x,M),r.call(c+"_mul",_,I,u),r.call(c+"_sub",u,M,u),r.call(a,u,u),r.call(c+"_add",g,u,u),r.call(c+"_mul",y,A,h),r.call(c+"_sub",h,E,h),r.call(a,x,B),r.call(c+"_add",h,B,h),r.call(c+"_mul",v,w,p),r.call(c+"_sub",p,C,p),r.call(c+"_add",p,m,p))}(),function(){const d=e.addFunction(t+"_square");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.i32_add(r.getLocal("x"),r.i32_const(2*f)),o=r.getLocal("r"),s=r.i32_add(r.getLocal("r"),r.i32_const(f)),l=r.i32_add(r.getLocal("r"),r.i32_const(2*f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f)),p=r.i32_const(e.alloc(f)),g=r.i32_const(e.alloc(f)),m=r.i32_const(e.alloc(f)),x=r.i32_const(e.alloc(f)),y=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_square",n,u),r.call(c+"_mul",n,i,h),r.call(c+"_add",h,h,p),r.call(c+"_sub",n,i,g),r.call(c+"_add",g,b,g),r.call(c+"_square",g,g),r.call(c+"_mul",i,b,m),r.call(c+"_add",m,m,x),r.call(c+"_square",b,y),r.call(a,x,o),r.call(c+"_add",u,o,o),r.call(a,y,s),r.call(c+"_add",p,s,s),r.call(c+"_add",u,y,l),r.call(c+"_sub",x,l,l),r.call(c+"_add",g,l,l),r.call(c+"_add",p,l,l))}(),function(){const a=e.addFunction(t+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("y"),o=d.i32_add(d.getLocal("y"),d.i32_const(f)),s=d.i32_add(d.getLocal("y"),d.i32_const(2*f)),l=d.getLocal("r"),u=d.i32_add(d.getLocal("r"),d.i32_const(f)),h=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_add",r,b,l),d.call(c+"_add",n,o,u),d.call(c+"_add",i,s,h))}(),function(){const a=e.addFunction(t+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("y"),o=d.i32_add(d.getLocal("y"),d.i32_const(f)),s=d.i32_add(d.getLocal("y"),d.i32_const(2*f)),l=d.getLocal("r"),u=d.i32_add(d.getLocal("r"),d.i32_const(f)),h=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_sub",r,b,l),d.call(c+"_sub",n,o,u),d.call(c+"_sub",i,s,h))}(),function(){const a=e.addFunction(t+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_neg",r,b),d.call(c+"_neg",n,o),d.call(c+"_neg",i,s))}(),function(){const a=e.addFunction(t+"_sign");a.addParam("x","i32"),a.addLocal("s","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.setLocal("s",d.call(c+"_sign",i)),d.if(d.getLocal("s"),d.ret(d.getLocal("s"))),d.setLocal("s",d.call(c+"_sign",n)),d.if(d.getLocal("s"),d.ret(d.getLocal("s"))),d.ret(d.call(c+"_sign",r)))}(),function(){const a=e.addFunction(t+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_toMontgomery",r,b),d.call(c+"_toMontgomery",n,o),d.call(c+"_toMontgomery",i,s))}(),function(){const a=e.addFunction(t+"_fromMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_fromMontgomery",r,b),d.call(c+"_fromMontgomery",n,o),d.call(c+"_fromMontgomery",i,s))}(),function(){const a=e.addFunction(t+"_eq");a.addParam("x","i32"),a.addParam("y","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("y"),o=d.i32_add(d.getLocal("y"),d.i32_const(f)),s=d.i32_add(d.getLocal("y"),d.i32_const(2*f));a.addCode(d.i32_and(d.i32_and(d.call(c+"_eq",r,b),d.call(c+"_eq",n,o)),d.call(c+"_eq",i,s)))}(),function(){const d=e.addFunction(t+"_inverse");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.i32_add(r.getLocal("x"),r.i32_const(2*f)),o=r.getLocal("r"),s=r.i32_add(r.getLocal("r"),r.i32_const(f)),l=r.i32_add(r.getLocal("r"),r.i32_const(2*f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f)),p=r.i32_const(e.alloc(f)),g=r.i32_const(e.alloc(f)),m=r.i32_const(e.alloc(f)),x=r.i32_const(e.alloc(f)),y=r.i32_const(e.alloc(f)),A=r.i32_const(e.alloc(f)),v=r.i32_const(e.alloc(f)),w=r.i32_const(e.alloc(f)),_=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_square",n,u),r.call(c+"_square",i,h),r.call(c+"_square",b,p),r.call(c+"_mul",n,i,g),r.call(c+"_mul",n,b,m),r.call(c+"_mul",i,b,x),r.call(a,x,y),r.call(c+"_sub",u,y,y),r.call(a,p,A),r.call(c+"_sub",A,g,A),r.call(c+"_sub",h,m,v),r.call(c+"_mul",b,A,w),r.call(c+"_mul",i,v,_),r.call(c+"_add",w,_,w),r.call(a,w,w),r.call(c+"_mul",n,y,_),r.call(c+"_add",_,w,w),r.call(c+"_inverse",w,w),r.call(c+"_mul",w,y,o),r.call(c+"_mul",w,A,s),r.call(c+"_mul",w,v,l))}(),function(){const a=e.addFunction(t+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_timesScalar",r,d.getLocal("scalar"),d.getLocal("scalarLen"),b),d.call(c+"_timesScalar",n,d.getLocal("scalar"),d.getLocal("scalarLen"),o),d.call(c+"_timesScalar",i,d.getLocal("scalar"),d.getLocal("scalarLen"),s))}(),function(){const a=e.addFunction(t+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.if(d.call(c+"_isZero",i),d.if(d.call(c+"_isZero",n),d.ret(d.call(c+"_isNegative",r)),d.ret(d.call(c+"_isNegative",n)))),d.ret(d.call(c+"_isNegative",i)))}(),e.exportFunction(t+"_isZero"),e.exportFunction(t+"_isOne"),e.exportFunction(t+"_zero"),e.exportFunction(t+"_one"),e.exportFunction(t+"_copy"),e.exportFunction(t+"_mul"),e.exportFunction(t+"_square"),e.exportFunction(t+"_add"),e.exportFunction(t+"_sub"),e.exportFunction(t+"_neg"),e.exportFunction(t+"_sign"),e.exportFunction(t+"_fromMontgomery"),e.exportFunction(t+"_toMontgomery"),e.exportFunction(t+"_eq"),e.exportFunction(t+"_inverse"),Ae(e,t),ye(e,t+"_exp",3*f,t+"_mul",t+"_square",t+"_copy",t+"_one"),e.exportFunction(t+"_exp"),e.exportFunction(t+"_timesScalar"),e.exportFunction(t+"_batchInverse"),e.exportFunction(t+"_isNegative"),t};const we=function(e,a,t,c,f,d,r,n){const i=e.addFunction(a);i.addParam("base","i32"),i.addParam("scalar","i32"),i.addParam("scalarLength","i32"),i.addParam("r","i32"),i.addLocal("old0","i32"),i.addLocal("nbits","i32"),i.addLocal("i","i32"),i.addLocal("last","i32"),i.addLocal("cur","i32"),i.addLocal("carry","i32"),i.addLocal("p","i32");const b=i.getCodeBuilder(),o=b.i32_const(e.alloc(t));function s(e){return b.i32_and(b.i32_shr_u(b.i32_load(b.i32_add(b.getLocal("scalar"),b.i32_and(b.i32_shr_u(e,b.i32_const(3)),b.i32_const(4294967292)))),b.i32_and(e,b.i32_const(31))),b.i32_const(1))}function l(e){return[...b.i32_store8(b.getLocal("p"),b.i32_const(e)),...b.setLocal("p",b.i32_add(b.getLocal("p"),b.i32_const(1)))]}i.addCode(b.if(b.i32_eqz(b.getLocal("scalarLength")),[...b.call(n,b.getLocal("r")),...b.ret([])]),b.setLocal("nbits",b.i32_shl(b.getLocal("scalarLength"),b.i32_const(3))),b.setLocal("old0",b.i32_load(b.i32_const(0))),b.setLocal("p",b.getLocal("old0")),b.i32_store(b.i32_const(0),b.i32_and(b.i32_add(b.i32_add(b.getLocal("old0"),b.i32_const(32)),b.getLocal("nbits")),b.i32_const(4294967288))),b.setLocal("i",b.i32_const(1)),b.setLocal("last",s(b.i32_const(0))),b.setLocal("carry",b.i32_const(0)),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("i"),b.getLocal("nbits"))),b.setLocal("cur",s(b.getLocal("i"))),b.if(b.getLocal("last"),b.if(b.getLocal("cur"),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(1)],[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(255)]),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(255)],[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(0)),...l(1)])),b.if(b.getLocal("cur"),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(0)],[...b.setLocal("last",b.i32_const(1)),...b.setLocal("carry",b.i32_const(0)),...l(0)]),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(1)),...b.setLocal("carry",b.i32_const(0)),...l(0)],[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(0)),...l(0)]))),b.setLocal("i",b.i32_add(b.getLocal("i"),b.i32_const(1))),b.br(0))),b.if(b.getLocal("last"),b.if(b.getLocal("carry"),[...l(255),...l(0),...l(1)],[...l(1)]),b.if(b.getLocal("carry"),[...l(0),...l(1)])),b.setLocal("p",b.i32_sub(b.getLocal("p"),b.i32_const(1))),b.call(r,b.getLocal("base"),o),b.call(n,b.getLocal("r")),b.block(b.loop(b.call(f,b.getLocal("r"),b.getLocal("r")),b.setLocal("cur",b.i32_load8_u(b.getLocal("p"))),b.if(b.getLocal("cur"),b.if(b.i32_eq(b.getLocal("cur"),b.i32_const(1)),b.call(c,b.getLocal("r"),o,b.getLocal("r")),b.call(d,b.getLocal("r"),o,b.getLocal("r")))),b.br_if(1,b.i32_eq(b.getLocal("old0"),b.getLocal("p"))),b.setLocal("p",b.i32_sub(b.getLocal("p"),b.i32_const(1))),b.br(0))),b.i32_store(b.i32_const(0),b.getLocal("old0")))},_e=Q,Ie=function(e,a,t,c,f){const d=8*e.modules[a].n64;!function(){const a=e.addFunction(t+"_getChunk");a.addParam("pScalar","i32"),a.addParam("scalarSize","i32"),a.addParam("startBit","i32"),a.addParam("chunkSize","i32"),a.addLocal("bitsToEnd","i32"),a.addLocal("mask","i32"),a.setReturnType("i32");const c=a.getCodeBuilder();a.addCode(c.setLocal("bitsToEnd",c.i32_sub(c.i32_mul(c.getLocal("scalarSize"),c.i32_const(8)),c.getLocal("startBit"))),c.if(c.i32_gt_s(c.getLocal("chunkSize"),c.getLocal("bitsToEnd")),c.setLocal("mask",c.i32_sub(c.i32_shl(c.i32_const(1),c.getLocal("bitsToEnd")),c.i32_const(1))),c.setLocal("mask",c.i32_sub(c.i32_shl(c.i32_const(1),c.getLocal("chunkSize")),c.i32_const(1)))),c.i32_and(c.i32_shr_u(c.i32_load(c.i32_add(c.getLocal("pScalar"),c.i32_shr_u(c.getLocal("startBit"),c.i32_const(3))),0,0),c.i32_and(c.getLocal("startBit"),c.i32_const(7))),c.getLocal("mask")))}(),function(){const c=e.addFunction(t+"_reduceTable");c.addParam("pTable","i32"),c.addParam("p","i32"),c.addLocal("half","i32"),c.addLocal("it1","i32"),c.addLocal("it2","i32"),c.addLocal("pAcc","i32");const f=c.getCodeBuilder();c.addCode(f.if(f.i32_eq(f.getLocal("p"),f.i32_const(1)),f.ret([])),f.setLocal("half",f.i32_shl(f.i32_const(1),f.i32_sub(f.getLocal("p"),f.i32_const(1)))),f.setLocal("it1",f.getLocal("pTable")),f.setLocal("it2",f.i32_add(f.getLocal("pTable"),f.i32_mul(f.getLocal("half"),f.i32_const(d)))),f.setLocal("pAcc",f.i32_sub(f.getLocal("it2"),f.i32_const(d))),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("it1"),f.getLocal("pAcc"))),f.call(a+"_add",f.getLocal("it1"),f.getLocal("it2"),f.getLocal("it1")),f.call(a+"_add",f.getLocal("pAcc"),f.getLocal("it2"),f.getLocal("pAcc")),f.setLocal("it1",f.i32_add(f.getLocal("it1"),f.i32_const(d))),f.setLocal("it2",f.i32_add(f.getLocal("it2"),f.i32_const(d))),f.br(0))),f.call(t+"_reduceTable",f.getLocal("pTable"),f.i32_sub(f.getLocal("p"),f.i32_const(1))),f.setLocal("p",f.i32_sub(f.getLocal("p"),f.i32_const(1))),f.block(f.loop(f.br_if(1,f.i32_eqz(f.getLocal("p"))),f.call(a+"_double",f.getLocal("pAcc"),f.getLocal("pAcc")),f.setLocal("p",f.i32_sub(f.getLocal("p"),f.i32_const(1))),f.br(0))),f.call(a+"_add",f.getLocal("pTable"),f.getLocal("pAcc"),f.getLocal("pTable")))}(),function(){const r=e.addFunction(t+"_chunk");r.addParam("pBases","i32"),r.addParam("pScalars","i32"),r.addParam("scalarSize","i32"),r.addParam("n","i32"),r.addParam("startBit","i32"),r.addParam("chunkSize","i32"),r.addParam("pr","i32"),r.addLocal("nChunks","i32"),r.addLocal("itScalar","i32"),r.addLocal("endScalar","i32"),r.addLocal("itBase","i32"),r.addLocal("i","i32"),r.addLocal("j","i32"),r.addLocal("nTable","i32"),r.addLocal("pTable","i32"),r.addLocal("idx","i32"),r.addLocal("pIdxTable","i32");const n=r.getCodeBuilder();r.addCode(n.if(n.i32_eqz(n.getLocal("n")),[...n.call(a+"_zero",n.getLocal("pr")),...n.ret([])]),n.setLocal("nTable",n.i32_shl(n.i32_const(1),n.getLocal("chunkSize"))),n.setLocal("pTable",n.i32_load(n.i32_const(0))),n.i32_store(n.i32_const(0),n.i32_add(n.getLocal("pTable"),n.i32_mul(n.getLocal("nTable"),n.i32_const(d)))),n.setLocal("j",n.i32_const(0)),n.block(n.loop(n.br_if(1,n.i32_eq(n.getLocal("j"),n.getLocal("nTable"))),n.call(a+"_zero",n.i32_add(n.getLocal("pTable"),n.i32_mul(n.getLocal("j"),n.i32_const(d)))),n.setLocal("j",n.i32_add(n.getLocal("j"),n.i32_const(1))),n.br(0))),n.setLocal("itBase",n.getLocal("pBases")),n.setLocal("itScalar",n.getLocal("pScalars")),n.setLocal("endScalar",n.i32_add(n.getLocal("pScalars"),n.i32_mul(n.getLocal("n"),n.getLocal("scalarSize")))),n.block(n.loop(n.br_if(1,n.i32_eq(n.getLocal("itScalar"),n.getLocal("endScalar"))),n.setLocal("idx",n.call(t+"_getChunk",n.getLocal("itScalar"),n.getLocal("scalarSize"),n.getLocal("startBit"),n.getLocal("chunkSize"))),n.if(n.getLocal("idx"),[...n.setLocal("pIdxTable",n.i32_add(n.getLocal("pTable"),n.i32_mul(n.i32_sub(n.getLocal("idx"),n.i32_const(1)),n.i32_const(d)))),...n.call(c,n.getLocal("pIdxTable"),n.getLocal("itBase"),n.getLocal("pIdxTable"))]),n.setLocal("itScalar",n.i32_add(n.getLocal("itScalar"),n.getLocal("scalarSize"))),n.setLocal("itBase",n.i32_add(n.getLocal("itBase"),n.i32_const(f))),n.br(0))),n.call(t+"_reduceTable",n.getLocal("pTable"),n.getLocal("chunkSize")),n.call(a+"_copy",n.getLocal("pTable"),n.getLocal("pr")),n.i32_store(n.i32_const(0),n.getLocal("pTable")))}(),function(){const c=e.addFunction(t);c.addParam("pBases","i32"),c.addParam("pScalars","i32"),c.addParam("scalarSize","i32"),c.addParam("n","i32"),c.addParam("pr","i32"),c.addLocal("chunkSize","i32"),c.addLocal("nChunks","i32"),c.addLocal("itScalar","i32"),c.addLocal("endScalar","i32"),c.addLocal("itBase","i32"),c.addLocal("itBit","i32"),c.addLocal("i","i32"),c.addLocal("j","i32"),c.addLocal("nTable","i32"),c.addLocal("pTable","i32"),c.addLocal("idx","i32"),c.addLocal("pIdxTable","i32");const f=c.getCodeBuilder(),r=f.i32_const(e.alloc(d)),n=e.alloc([17,17,17,17,17,17,17,17,17,17,16,16,15,14,13,13,12,11,10,9,8,7,7,6,5,4,3,2,1,1,1,1]);c.addCode(f.call(a+"_zero",f.getLocal("pr")),f.if(f.i32_eqz(f.getLocal("n")),f.ret([])),f.setLocal("chunkSize",f.i32_load8_u(f.i32_clz(f.getLocal("n")),n)),f.setLocal("nChunks",f.i32_add(f.i32_div_u(f.i32_sub(f.i32_shl(f.getLocal("scalarSize"),f.i32_const(3)),f.i32_const(1)),f.getLocal("chunkSize")),f.i32_const(1))),f.setLocal("itBit",f.i32_mul(f.i32_sub(f.getLocal("nChunks"),f.i32_const(1)),f.getLocal("chunkSize"))),f.block(f.loop(f.br_if(1,f.i32_lt_s(f.getLocal("itBit"),f.i32_const(0))),f.if(f.i32_eqz(f.call(a+"_isZero",f.getLocal("pr"))),[...f.setLocal("j",f.i32_const(0)),...f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("j"),f.getLocal("chunkSize"))),f.call(a+"_double",f.getLocal("pr"),f.getLocal("pr")),f.setLocal("j",f.i32_add(f.getLocal("j"),f.i32_const(1))),f.br(0)))]),f.call(t+"_chunk",f.getLocal("pBases"),f.getLocal("pScalars"),f.getLocal("scalarSize"),f.getLocal("n"),f.getLocal("itBit"),f.getLocal("chunkSize"),r),f.call(a+"_add",f.getLocal("pr"),r,f.getLocal("pr")),f.setLocal("itBit",f.i32_sub(f.getLocal("itBit"),f.getLocal("chunkSize"))),f.br(0))))}(),e.exportFunction(t),e.exportFunction(t+"_chunk")};var Ee=function(e,a,t,c){const f=e.modules[t].n64,d=8*f;return e.modules[a]||(e.modules[a]={n64:3*f},function(){const c=e.addFunction(a+"_isZeroAffine");c.addParam("p1","i32"),c.setReturnType("i32");const f=c.getCodeBuilder();c.addCode(f.i32_and(f.call(t+"_isZero",f.getLocal("p1")),f.call(t+"_isZero",f.i32_add(f.getLocal("p1"),f.i32_const(d)))))}(),function(){const c=e.addFunction(a+"_isZero");c.addParam("p1","i32"),c.setReturnType("i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_isZero",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))))}(),function(){const c=e.addFunction(a+"_zeroAffine");c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_zero",f.getLocal("pr"))),c.addCode(f.call(t+"_zero",f.i32_add(f.getLocal("pr"),f.i32_const(d))))}(),function(){const c=e.addFunction(a+"_zero");c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_zero",f.getLocal("pr"))),c.addCode(f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(d)))),c.addCode(f.call(t+"_zero",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))))}(),function(){const t=e.addFunction(a+"_copyAffine");t.addParam("ps","i32"),t.addParam("pd","i32");const c=t.getCodeBuilder();for(let e=0;e<2*f;e++)t.addCode(c.i64_store(c.getLocal("pd"),8*e,c.i64_load(c.getLocal("ps"),8*e)))}(),function(){const t=e.addFunction(a+"_copy");t.addParam("ps","i32"),t.addParam("pd","i32");const c=t.getCodeBuilder();for(let e=0;e<3*f;e++)t.addCode(c.i64_store(c.getLocal("pd"),8*e,c.i64_load(c.getLocal("ps"),8*e)))}(),function(){const c=e.addFunction(a+"_toJacobian");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.getLocal("pr"),b=f.i32_add(f.getLocal("pr"),f.i32_const(d)),o=f.i32_add(f.getLocal("pr"),f.i32_const(2*d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("p1")),f.call(a+"_zero",f.getLocal("pr")),[...f.call(t+"_one",o),...f.call(t+"_copy",n,b),...f.call(t+"_copy",r,i)]))}(),function(){const c=e.addFunction(a+"_eqAffine");c.addParam("p1","i32"),c.addParam("p2","i32"),c.setReturnType("i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder();c.addCode(f.ret(f.i32_and(f.call(t+"_eq",f.getLocal("p1"),f.getLocal("p2")),f.call(t+"_eq",f.i32_add(f.getLocal("p1"),f.i32_const(d)),f.i32_add(f.getLocal("p2"),f.i32_const(d))))))}(),function(){const c=e.addFunction(a+"_eqMixed");c.addParam("p1","i32"),c.addParam("p2","i32"),c.setReturnType("i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d)),s=f.i32_const(e.alloc(d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),f.ret(f.call(a+"_isZeroAffine",f.getLocal("p2")))),f.if(f.call(a+"_isZeroAffine",f.getLocal("p2")),f.ret(f.i32_const(0))),f.if(f.call(t+"_isOne",i),f.ret(f.call(a+"_eqAffine",f.getLocal("p1"),f.getLocal("p2")))),f.call(t+"_square",i,s),f.call(t+"_mul",b,s,l),f.call(t+"_mul",i,s,u),f.call(t+"_mul",o,u,h),f.if(f.call(t+"_eq",r,l),f.if(f.call(t+"_eq",n,h),f.ret(f.i32_const(1)))),f.ret(f.i32_const(0)))}(),function(){const c=e.addFunction(a+"_eq");c.addParam("p1","i32"),c.addParam("p2","i32"),c.setReturnType("i32"),c.addLocal("z1","i32"),c.addLocal("z2","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d));c.addCode(f.setLocal("z2",f.i32_add(f.getLocal("p2"),f.i32_const(2*d))));const s=f.getLocal("z2"),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),f.ret(f.call(a+"_isZero",f.getLocal("p2")))),f.if(f.call(a+"_isZero",f.getLocal("p2")),f.ret(f.i32_const(0))),f.if(f.call(t+"_isOne",i),f.ret(f.call(a+"_eqMixed",f.getLocal("p2"),f.getLocal("p1")))),f.if(f.call(t+"_isOne",s),f.ret(f.call(a+"_eqMixed",f.getLocal("p1"),f.getLocal("p2")))),f.call(t+"_square",i,l),f.call(t+"_square",s,u),f.call(t+"_mul",r,u,h),f.call(t+"_mul",b,l,p),f.call(t+"_mul",i,l,g),f.call(t+"_mul",s,u,m),f.call(t+"_mul",n,m,x),f.call(t+"_mul",o,g,y),f.if(f.call(t+"_eq",h,p),f.if(f.call(t+"_eq",x,y),f.ret(f.i32_const(1)))),f.ret(f.i32_const(0)))}(),function(){const c=e.addFunction(a+"_doubleAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.getLocal("pr"),b=f.i32_add(f.getLocal("pr"),f.i32_const(d)),o=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),s=f.i32_const(e.alloc(d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("p1")),[...f.call(a+"_toJacobian",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.call(t+"_square",r,s),f.call(t+"_square",n,l),f.call(t+"_square",l,u),f.call(t+"_add",r,l,h),f.call(t+"_square",h,h),f.call(t+"_sub",h,s,h),f.call(t+"_sub",h,u,h),f.call(t+"_add",h,h,h),f.call(t+"_add",s,s,p),f.call(t+"_add",p,s,p),f.call(t+"_add",n,n,o),f.call(t+"_square",p,i),f.call(t+"_sub",i,h,i),f.call(t+"_sub",i,h,i),f.call(t+"_add",u,u,g),f.call(t+"_add",g,g,g),f.call(t+"_add",g,g,g),f.call(t+"_sub",h,i,b),f.call(t+"_mul",b,p,b),f.call(t+"_sub",b,g,b))}(),function(){const c=e.addFunction(a+"_double");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(a+"_copy",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(t+"_isOne",i),[...f.ret(f.call(a+"_doubleAffine",f.getLocal("p1"),f.getLocal("pr"))),...f.ret([])]),f.call(t+"_square",r,l),f.call(t+"_square",n,u),f.call(t+"_square",u,h),f.call(t+"_add",r,u,p),f.call(t+"_square",p,p),f.call(t+"_sub",p,l,p),f.call(t+"_sub",p,h,p),f.call(t+"_add",p,p,p),f.call(t+"_add",l,l,g),f.call(t+"_add",g,l,g),f.call(t+"_square",g,m),f.call(t+"_mul",n,i,x),f.call(t+"_add",p,p,b),f.call(t+"_sub",m,b,b),f.call(t+"_add",h,h,y),f.call(t+"_add",y,y,y),f.call(t+"_add",y,y,y),f.call(t+"_sub",p,b,o),f.call(t+"_mul",o,g,o),f.call(t+"_sub",o,y,o),f.call(t+"_add",x,x,s))}(),function(){const c=e.addFunction(a+"_addAffine");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("p2"),b=f.i32_add(f.getLocal("p2"),f.i32_const(d)),o=f.getLocal("pr"),s=f.i32_add(f.getLocal("pr"),f.i32_const(d)),l=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),A=f.i32_const(e.alloc(d)),v=f.i32_const(e.alloc(d)),w=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("p1")),[...f.call(a+"_copyAffine",f.getLocal("p2"),f.getLocal("pr")),...f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))),...f.ret([])]),f.if(f.call(a+"_isZeroAffine",f.getLocal("p2")),[...f.call(a+"_copyAffine",f.getLocal("p1"),f.getLocal("pr")),...f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))),...f.ret([])]),f.if(f.call(t+"_eq",r,i),f.if(f.call(t+"_eq",n,b),[...f.call(a+"_doubleAffine",f.getLocal("p2"),f.getLocal("pr")),...f.ret([])])),f.call(t+"_sub",i,r,u),f.call(t+"_sub",b,n,p),f.call(t+"_square",u,h),f.call(t+"_add",h,h,g),f.call(t+"_add",g,g,g),f.call(t+"_mul",u,g,m),f.call(t+"_add",p,p,x),f.call(t+"_mul",r,g,A),f.call(t+"_square",x,y),f.call(t+"_add",A,A,v),f.call(t+"_sub",y,m,o),f.call(t+"_sub",o,v,o),f.call(t+"_mul",n,m,w),f.call(t+"_add",w,w,w),f.call(t+"_sub",A,o,s),f.call(t+"_mul",s,x,s),f.call(t+"_sub",s,w,s),f.call(t+"_add",u,u,l))}(),function(){const c=e.addFunction(a+"_addMixed");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d)),s=f.getLocal("pr"),l=f.i32_add(f.getLocal("pr"),f.i32_const(d)),u=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),A=f.i32_const(e.alloc(d)),v=f.i32_const(e.alloc(d)),w=f.i32_const(e.alloc(d)),_=f.i32_const(e.alloc(d)),I=f.i32_const(e.alloc(d)),E=f.i32_const(e.alloc(d)),C=f.i32_const(e.alloc(d)),M=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(a+"_copyAffine",f.getLocal("p2"),f.getLocal("pr")),...f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))),...f.ret([])]),f.if(f.call(a+"_isZeroAffine",f.getLocal("p2")),[...f.call(a+"_copy",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(t+"_isOne",i),[...f.call(a+"_addAffine",r,b,s),...f.ret([])]),f.call(t+"_square",i,h),f.call(t+"_mul",b,h,p),f.call(t+"_mul",i,h,g),f.call(t+"_mul",o,g,m),f.if(f.call(t+"_eq",r,p),f.if(f.call(t+"_eq",n,m),[...f.call(a+"_doubleAffine",f.getLocal("p2"),f.getLocal("pr")),...f.ret([])])),f.call(t+"_sub",p,r,x),f.call(t+"_sub",m,n,A),f.call(t+"_square",x,y),f.call(t+"_add",y,y,v),f.call(t+"_add",v,v,v),f.call(t+"_mul",x,v,w),f.call(t+"_add",A,A,_),f.call(t+"_mul",r,v,E),f.call(t+"_square",_,I),f.call(t+"_add",E,E,C),f.call(t+"_sub",I,w,s),f.call(t+"_sub",s,C,s),f.call(t+"_mul",n,w,M),f.call(t+"_add",M,M,M),f.call(t+"_sub",E,s,l),f.call(t+"_mul",l,_,l),f.call(t+"_sub",l,M,l),f.call(t+"_add",i,x,u),f.call(t+"_square",u,u),f.call(t+"_sub",u,h,u),f.call(t+"_sub",u,y,u))}(),function(){const c=e.addFunction(a+"_add");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32"),c.addLocal("z1","i32"),c.addLocal("z2","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d));c.addCode(f.setLocal("z2",f.i32_add(f.getLocal("p2"),f.i32_const(2*d))));const s=f.getLocal("z2"),l=f.getLocal("pr"),u=f.i32_add(f.getLocal("pr"),f.i32_const(d)),h=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),A=f.i32_const(e.alloc(d)),v=f.i32_const(e.alloc(d)),w=f.i32_const(e.alloc(d)),_=f.i32_const(e.alloc(d)),I=f.i32_const(e.alloc(d)),E=f.i32_const(e.alloc(d)),C=f.i32_const(e.alloc(d)),M=f.i32_const(e.alloc(d)),B=f.i32_const(e.alloc(d)),L=f.i32_const(e.alloc(d)),S=f.i32_const(e.alloc(d)),k=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(a+"_copy",f.getLocal("p2"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(a+"_isZero",f.getLocal("p2")),[...f.call(a+"_copy",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(t+"_isOne",i),[...f.call(a+"_addMixed",b,r,l),...f.ret([])]),f.if(f.call(t+"_isOne",s),[...f.call(a+"_addMixed",r,b,l),...f.ret([])]),f.call(t+"_square",i,p),f.call(t+"_square",s,g),f.call(t+"_mul",r,g,m),f.call(t+"_mul",b,p,x),f.call(t+"_mul",i,p,y),f.call(t+"_mul",s,g,A),f.call(t+"_mul",n,A,v),f.call(t+"_mul",o,y,w),f.if(f.call(t+"_eq",m,x),f.if(f.call(t+"_eq",v,w),[...f.call(a+"_double",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])])),f.call(t+"_sub",x,m,_),f.call(t+"_sub",w,v,I),f.call(t+"_add",_,_,E),f.call(t+"_square",E,E),f.call(t+"_mul",_,E,C),f.call(t+"_add",I,I,M),f.call(t+"_mul",m,E,L),f.call(t+"_square",M,B),f.call(t+"_add",L,L,S),f.call(t+"_sub",B,C,l),f.call(t+"_sub",l,S,l),f.call(t+"_mul",v,C,k),f.call(t+"_add",k,k,k),f.call(t+"_sub",L,l,u),f.call(t+"_mul",u,M,u),f.call(t+"_sub",u,k,u),f.call(t+"_add",i,s,h),f.call(t+"_square",h,h),f.call(t+"_sub",h,p,h),f.call(t+"_sub",h,g,h),f.call(t+"_mul",h,_,h))}(),function(){const c=e.addFunction(a+"_negAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.getLocal("pr"),b=f.i32_add(f.getLocal("pr"),f.i32_const(d));c.addCode(f.call(t+"_copy",r,i),f.call(t+"_neg",n,b))}(),function(){const c=e.addFunction(a+"_neg");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_add(f.getLocal("pr"),f.i32_const(2*d));c.addCode(f.call(t+"_copy",r,b),f.call(t+"_neg",n,o),f.call(t+"_copy",i,s))}(),function(){const t=e.addFunction(a+"_subAffine");t.addParam("p1","i32"),t.addParam("p2","i32"),t.addParam("pr","i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(3*d));t.addCode(c.call(a+"_negAffine",c.getLocal("p2"),f),c.call(a+"_addAffine",c.getLocal("p1"),f,c.getLocal("pr")))}(),function(){const t=e.addFunction(a+"_subMixed");t.addParam("p1","i32"),t.addParam("p2","i32"),t.addParam("pr","i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(3*d));t.addCode(c.call(a+"_negAffine",c.getLocal("p2"),f),c.call(a+"_addMixed",c.getLocal("p1"),f,c.getLocal("pr")))}(),function(){const t=e.addFunction(a+"_sub");t.addParam("p1","i32"),t.addParam("p2","i32"),t.addParam("pr","i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(3*d));t.addCode(c.call(a+"_neg",c.getLocal("p2"),f),c.call(a+"_add",c.getLocal("p1"),f,c.getLocal("pr")))}(),function(){const c=e.addFunction(a+"_fromMontgomeryAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_fromMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<2;e++)c.addCode(f.call(t+"_fromMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_fromMontgomery");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_fromMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<3;e++)c.addCode(f.call(t+"_fromMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_toMontgomeryAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_toMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<2;e++)c.addCode(f.call(t+"_toMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_toMontgomery");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_toMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<3;e++)c.addCode(f.call(t+"_toMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_toAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_const(e.alloc(d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(t+"_zero",b),...f.call(t+"_zero",o)],[...f.call(t+"_inverse",i,s),...f.call(t+"_square",s,l),...f.call(t+"_mul",s,l,u),...f.call(t+"_mul",r,l,b),...f.call(t+"_mul",n,u,o)]))}(),function(){const f=e.addFunction(a+"_inCurveAffine");f.addParam("pIn","i32"),f.setReturnType("i32");const r=f.getCodeBuilder(),n=r.getLocal("pIn"),i=r.i32_add(r.getLocal("pIn"),r.i32_const(d)),b=r.i32_const(e.alloc(d)),o=r.i32_const(e.alloc(d));f.addCode(r.call(t+"_square",i,b),r.call(t+"_square",n,o),r.call(t+"_mul",n,o,o),r.call(t+"_add",o,r.i32_const(c),o),r.ret(r.call(t+"_eq",b,o)))}(),function(){const t=e.addFunction(a+"_inCurve");t.addParam("pIn","i32"),t.setReturnType("i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(2*d));t.addCode(c.call(a+"_toAffine",c.getLocal("pIn"),f),c.ret(c.call(a+"_inCurveAffine",f)))}(),function(){const c=e.addFunction(a+"_batchToAffine");c.addParam("pIn","i32"),c.addParam("n","i32"),c.addParam("pOut","i32"),c.addLocal("pAux","i32"),c.addLocal("itIn","i32"),c.addLocal("itAux","i32"),c.addLocal("itOut","i32"),c.addLocal("i","i32");const f=c.getCodeBuilder(),r=f.i32_const(e.alloc(d));c.addCode(f.setLocal("pAux",f.i32_load(f.i32_const(0))),f.i32_store(f.i32_const(0),f.i32_add(f.getLocal("pAux"),f.i32_mul(f.getLocal("n"),f.i32_const(d)))),f.call(t+"_batchInverse",f.i32_add(f.getLocal("pIn"),f.i32_const(2*d)),f.i32_const(3*d),f.getLocal("n"),f.getLocal("pAux"),f.i32_const(d)),f.setLocal("itIn",f.getLocal("pIn")),f.setLocal("itAux",f.getLocal("pAux")),f.setLocal("itOut",f.getLocal("pOut")),f.setLocal("i",f.i32_const(0)),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("i"),f.getLocal("n"))),f.if(f.call(t+"_isZero",f.getLocal("itAux")),[...f.call(t+"_zero",f.getLocal("itOut")),...f.call(t+"_zero",f.i32_add(f.getLocal("itOut"),f.i32_const(d)))],[...f.call(t+"_mul",f.getLocal("itAux"),f.i32_add(f.getLocal("itIn"),f.i32_const(d)),r),...f.call(t+"_square",f.getLocal("itAux"),f.getLocal("itAux")),...f.call(t+"_mul",f.getLocal("itAux"),f.getLocal("itIn"),f.getLocal("itOut")),...f.call(t+"_mul",f.getLocal("itAux"),r,f.i32_add(f.getLocal("itOut"),f.i32_const(d)))]),f.setLocal("itIn",f.i32_add(f.getLocal("itIn"),f.i32_const(3*d))),f.setLocal("itOut",f.i32_add(f.getLocal("itOut"),f.i32_const(2*d))),f.setLocal("itAux",f.i32_add(f.getLocal("itAux"),f.i32_const(d))),f.setLocal("i",f.i32_add(f.getLocal("i"),f.i32_const(1))),f.br(0))),f.i32_store(f.i32_const(0),f.getLocal("pAux")))}(),function(){const c=e.addFunction(a+"_normalize");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),f.call(a+"_zero",f.getLocal("pr")),[...f.call(t+"_inverse",i,l),...f.call(t+"_square",l,u),...f.call(t+"_mul",l,u,h),...f.call(t+"_mul",r,u,b),...f.call(t+"_mul",n,h,o),...f.call(t+"_one",s)]))}(),function(){const t=e.addFunction(a+"__reverseBytes");t.addParam("pIn","i32"),t.addParam("n","i32"),t.addParam("pOut","i32"),t.addLocal("itOut","i32"),t.addLocal("itIn","i32");const c=t.getCodeBuilder();t.addCode(c.setLocal("itOut",c.i32_sub(c.i32_add(c.getLocal("pOut"),c.getLocal("n")),c.i32_const(1))),c.setLocal("itIn",c.getLocal("pIn")),c.block(c.loop(c.br_if(1,c.i32_lt_s(c.getLocal("itOut"),c.getLocal("pOut"))),c.i32_store8(c.getLocal("itOut"),c.i32_load8_u(c.getLocal("itIn"))),c.setLocal("itOut",c.i32_sub(c.getLocal("itOut"),c.i32_const(1))),c.setLocal("itIn",c.i32_add(c.getLocal("itIn"),c.i32_const(1))),c.br(0))))}(),function(){const t=e.addFunction(a+"_LEMtoU");t.addParam("pIn","i32"),t.addParam("pOut","i32");const c=t.getCodeBuilder(),f=e.alloc(2*d),r=c.i32_const(f),n=c.i32_const(f),i=c.i32_const(f+d);t.addCode(c.if(c.call(a+"_isZeroAffine",c.getLocal("pIn")),[...c.call(a+"_zeroAffine",c.getLocal("pOut")),...c.ret([])]),c.call(a+"_fromMontgomeryAffine",c.getLocal("pIn"),r),c.call(a+"__reverseBytes",n,c.i32_const(d),c.getLocal("pOut")),c.call(a+"__reverseBytes",i,c.i32_const(d),c.i32_add(c.getLocal("pOut"),c.i32_const(d))))}(),function(){const c=e.addFunction(a+"_LEMtoC");c.addParam("pIn","i32"),c.addParam("pOut","i32");const f=c.getCodeBuilder(),r=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("pIn")),[...f.call(t+"_zero",f.getLocal("pOut")),...f.i32_store8(f.getLocal("pOut"),f.i32_const(64)),...f.ret([])]),f.call(t+"_fromMontgomery",f.getLocal("pIn"),r),f.call(a+"__reverseBytes",r,f.i32_const(d),f.getLocal("pOut")),f.if(f.i32_eq(f.call(t+"_sign",f.i32_add(f.getLocal("pIn"),f.i32_const(d))),f.i32_const(-1)),f.i32_store8(f.getLocal("pOut"),f.i32_or(f.i32_load8_u(f.getLocal("pOut")),f.i32_const(128)))))}(),function(){const t=e.addFunction(a+"_UtoLEM");t.addParam("pIn","i32"),t.addParam("pOut","i32");const c=t.getCodeBuilder(),f=e.alloc(2*d),r=c.i32_const(f),n=c.i32_const(f),i=c.i32_const(f+d);t.addCode(c.if(c.i32_and(c.i32_load8_u(c.getLocal("pIn")),c.i32_const(64)),[...c.call(a+"_zeroAffine",c.getLocal("pOut")),...c.ret([])]),c.call(a+"__reverseBytes",c.getLocal("pIn"),c.i32_const(d),n),c.call(a+"__reverseBytes",c.i32_add(c.getLocal("pIn"),c.i32_const(d)),c.i32_const(d),i),c.call(a+"_toMontgomeryAffine",r,c.getLocal("pOut")))}(),function(){const f=e.addFunction(a+"_CtoLEM");f.addParam("pIn","i32"),f.addParam("pOut","i32"),f.addLocal("firstByte","i32"),f.addLocal("greatest","i32");const r=f.getCodeBuilder(),n=e.alloc(2*d),i=r.i32_const(n),b=r.i32_const(n+d);f.addCode(r.setLocal("firstByte",r.i32_load8_u(r.getLocal("pIn"))),r.if(r.i32_and(r.getLocal("firstByte"),r.i32_const(64)),[...r.call(a+"_zeroAffine",r.getLocal("pOut")),...r.ret([])]),r.setLocal("greatest",r.i32_and(r.getLocal("firstByte"),r.i32_const(128))),r.call(t+"_copy",r.getLocal("pIn"),b),r.i32_store8(b,r.i32_and(r.getLocal("firstByte"),r.i32_const(63))),r.call(a+"__reverseBytes",b,r.i32_const(d),i),r.call(t+"_toMontgomery",i,r.getLocal("pOut")),r.call(t+"_square",r.getLocal("pOut"),b),r.call(t+"_mul",r.getLocal("pOut"),b,b),r.call(t+"_add",b,r.i32_const(c),b),r.call(t+"_sqrt",b,b),r.call(t+"_neg",b,i),r.if(r.i32_eq(r.call(t+"_sign",b),r.i32_const(-1)),r.if(r.getLocal("greatest"),r.call(t+"_copy",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d))),r.call(t+"_neg",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d)))),r.if(r.getLocal("greatest"),r.call(t+"_neg",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d))),r.call(t+"_copy",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d))))))}(),_e(e,a+"_batchLEMtoU",a+"_LEMtoU",2*d,2*d),_e(e,a+"_batchLEMtoC",a+"_LEMtoC",2*d,d),_e(e,a+"_batchUtoLEM",a+"_UtoLEM",2*d,2*d),_e(e,a+"_batchCtoLEM",a+"_CtoLEM",d,2*d,!0),_e(e,a+"_batchToJacobian",a+"_toJacobian",2*d,3*d,!0),Ie(e,a,a+"_multiexp",a+"_add",3*d),Ie(e,a,a+"_multiexpAffine",a+"_addMixed",2*d),we(e,a+"_timesScalar",3*d,a+"_add",a+"_double",a+"_sub",a+"_copy",a+"_zero"),we(e,a+"_timesScalarAffine",2*d,a+"_addMixed",a+"_double",a+"_subMixed",a+"_copyAffine",a+"_zero"),e.exportFunction(a+"_isZero"),e.exportFunction(a+"_isZeroAffine"),e.exportFunction(a+"_eq"),e.exportFunction(a+"_eqMixed"),e.exportFunction(a+"_eqAffine"),e.exportFunction(a+"_copy"),e.exportFunction(a+"_copyAffine"),e.exportFunction(a+"_zero"),e.exportFunction(a+"_zeroAffine"),e.exportFunction(a+"_double"),e.exportFunction(a+"_doubleAffine"),e.exportFunction(a+"_add"),e.exportFunction(a+"_addMixed"),e.exportFunction(a+"_addAffine"),e.exportFunction(a+"_neg"),e.exportFunction(a+"_negAffine"),e.exportFunction(a+"_sub"),e.exportFunction(a+"_subMixed"),e.exportFunction(a+"_subAffine"),e.exportFunction(a+"_fromMontgomery"),e.exportFunction(a+"_fromMontgomeryAffine"),e.exportFunction(a+"_toMontgomery"),e.exportFunction(a+"_toMontgomeryAffine"),e.exportFunction(a+"_timesScalar"),e.exportFunction(a+"_timesScalarAffine"),e.exportFunction(a+"_normalize"),e.exportFunction(a+"_LEMtoU"),e.exportFunction(a+"_LEMtoC"),e.exportFunction(a+"_UtoLEM"),e.exportFunction(a+"_CtoLEM"),e.exportFunction(a+"_batchLEMtoU"),e.exportFunction(a+"_batchLEMtoC"),e.exportFunction(a+"_batchUtoLEM"),e.exportFunction(a+"_batchCtoLEM"),e.exportFunction(a+"_toAffine"),e.exportFunction(a+"_toJacobian"),e.exportFunction(a+"_batchToAffine"),e.exportFunction(a+"_batchToJacobian"),e.exportFunction(a+"_inCurve"),e.exportFunction(a+"_inCurveAffine")),a};const{isOdd:Ce,modInv:Me,modPow:Be}=U,Le=D;var Se=function(e,a,t,c,f){const d=8*e.modules[c].n64,r=8*e.modules[t].n64,n=e.modules[c].q;let i=n-1n,b=0;for(;!Ce(i);)b++,i>>=1n;let o=2n;for(;1n===Be(o,n>>1n,n);)o+=1n;const s=new Array(b+1);s[b]=Be(o,i,n);let l=b-1;for(;l>=0;)s[l]=Be(s[l+1],2n,n),l--;const u=[],h=(1n<>t);return a}const E=Array(256);for(let e=0;e<256;e++)E[e]=I(e);const C=e.alloc(E);!function(){const t=e.addFunction(a+"__rev");t.addParam("x","i32"),t.addParam("bits","i32"),t.setReturnType("i32");const c=t.getCodeBuilder();t.addCode(c.i32_rotl(c.i32_add(c.i32_add(c.i32_shl(c.i32_load8_u(c.i32_and(c.getLocal("x"),c.i32_const(255)),C,0),c.i32_const(24)),c.i32_shl(c.i32_load8_u(c.i32_and(c.i32_shr_u(c.getLocal("x"),c.i32_const(8)),c.i32_const(255)),C,0),c.i32_const(16))),c.i32_add(c.i32_shl(c.i32_load8_u(c.i32_and(c.i32_shr_u(c.getLocal("x"),c.i32_const(16)),c.i32_const(255)),C,0),c.i32_const(8)),c.i32_load8_u(c.i32_and(c.i32_shr_u(c.getLocal("x"),c.i32_const(24)),c.i32_const(255)),C,0))),c.getLocal("bits")))}(),function(){const c=e.addFunction(a+"__reversePermutation");c.addParam("px","i32"),c.addParam("bits","i32"),c.addLocal("n","i32"),c.addLocal("i","i32"),c.addLocal("ri","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(r));c.addCode(f.setLocal("n",f.i32_shl(f.i32_const(1),f.getLocal("bits"))),f.setLocal("i",f.i32_const(0)),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("i"),f.getLocal("n"))),f.setLocal("idx1",f.i32_add(f.getLocal("px"),f.i32_mul(f.getLocal("i"),f.i32_const(r)))),f.setLocal("ri",f.call(a+"__rev",f.getLocal("i"),f.getLocal("bits"))),f.setLocal("idx2",f.i32_add(f.getLocal("px"),f.i32_mul(f.getLocal("ri"),f.i32_const(r)))),f.if(f.i32_lt_u(f.getLocal("i"),f.getLocal("ri")),[...f.call(t+"_copy",f.getLocal("idx1"),d),...f.call(t+"_copy",f.getLocal("idx2"),f.getLocal("idx1")),...f.call(t+"_copy",d,f.getLocal("idx2"))]),f.setLocal("i",f.i32_add(f.getLocal("i"),f.i32_const(1))),f.br(0))))}(),function(){const d=e.addFunction(a+"__fftFinal");d.addParam("px","i32"),d.addParam("bits","i32"),d.addParam("reverse","i32"),d.addParam("mulFactor","i32"),d.addLocal("n","i32"),d.addLocal("ndiv2","i32"),d.addLocal("pInv2","i32"),d.addLocal("i","i32"),d.addLocal("mask","i32"),d.addLocal("idx1","i32"),d.addLocal("idx2","i32");const n=d.getCodeBuilder(),i=n.i32_const(e.alloc(r));d.addCode(n.if(n.i32_and(n.i32_eqz(n.getLocal("reverse")),n.call(c+"_isOne",n.getLocal("mulFactor"))),n.ret([])),n.setLocal("n",n.i32_shl(n.i32_const(1),n.getLocal("bits"))),n.setLocal("mask",n.i32_sub(n.getLocal("n"),n.i32_const(1))),n.setLocal("i",n.i32_const(1)),n.setLocal("ndiv2",n.i32_shr_u(n.getLocal("n"),n.i32_const(1))),n.block(n.loop(n.br_if(1,n.i32_ge_u(n.getLocal("i"),n.getLocal("ndiv2"))),n.setLocal("idx1",n.i32_add(n.getLocal("px"),n.i32_mul(n.getLocal("i"),n.i32_const(r)))),n.setLocal("idx2",n.i32_add(n.getLocal("px"),n.i32_mul(n.i32_sub(n.getLocal("n"),n.getLocal("i")),n.i32_const(r)))),n.if(n.getLocal("reverse"),n.if(n.call(c+"_isOne",n.getLocal("mulFactor")),[...n.call(t+"_copy",n.getLocal("idx1"),i),...n.call(t+"_copy",n.getLocal("idx2"),n.getLocal("idx1")),...n.call(t+"_copy",i,n.getLocal("idx2"))],[...n.call(t+"_copy",n.getLocal("idx1"),i),...n.call(f,n.getLocal("idx2"),n.getLocal("mulFactor"),n.getLocal("idx1")),...n.call(f,i,n.getLocal("mulFactor"),n.getLocal("idx2"))]),n.if(n.call(c+"_isOne",n.getLocal("mulFactor")),[],[...n.call(f,n.getLocal("idx1"),n.getLocal("mulFactor"),n.getLocal("idx1")),...n.call(f,n.getLocal("idx2"),n.getLocal("mulFactor"),n.getLocal("idx2"))])),n.setLocal("i",n.i32_add(n.getLocal("i"),n.i32_const(1))),n.br(0))),n.if(n.call(c+"_isOne",n.getLocal("mulFactor")),[],[...n.call(f,n.getLocal("px"),n.getLocal("mulFactor"),n.getLocal("px")),...n.setLocal("idx2",n.i32_add(n.getLocal("px"),n.i32_mul(n.getLocal("ndiv2"),n.i32_const(r)))),...n.call(f,n.getLocal("idx2"),n.getLocal("mulFactor"),n.getLocal("idx2"))]))}(),function(){const n=e.addFunction(a+"_rawfft");n.addParam("px","i32"),n.addParam("bits","i32"),n.addParam("reverse","i32"),n.addParam("mulFactor","i32"),n.addLocal("s","i32"),n.addLocal("k","i32"),n.addLocal("j","i32"),n.addLocal("m","i32"),n.addLocal("mdiv2","i32"),n.addLocal("n","i32"),n.addLocal("pwm","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r)),s=i.i32_const(e.alloc(r));n.addCode(i.call(a+"__reversePermutation",i.getLocal("px"),i.getLocal("bits")),i.setLocal("n",i.i32_shl(i.i32_const(1),i.getLocal("bits"))),i.setLocal("s",i.i32_const(1)),i.block(i.loop(i.br_if(1,i.i32_gt_u(i.getLocal("s"),i.getLocal("bits"))),i.setLocal("m",i.i32_shl(i.i32_const(1),i.getLocal("s"))),i.setLocal("pwm",i.i32_add(i.i32_const(p),i.i32_mul(i.getLocal("s"),i.i32_const(d)))),i.setLocal("k",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_ge_u(i.getLocal("k"),i.getLocal("n"))),i.call(c+"_one",b),i.setLocal("mdiv2",i.i32_shr_u(i.getLocal("m"),i.i32_const(1))),i.setLocal("j",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_ge_u(i.getLocal("j"),i.getLocal("mdiv2"))),i.setLocal("idx1",i.i32_add(i.getLocal("px"),i.i32_mul(i.i32_add(i.getLocal("k"),i.getLocal("j")),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("idx1"),i.i32_mul(i.getLocal("mdiv2"),i.i32_const(r)))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_copy",i.getLocal("idx1"),s),i.call(t+"_add",s,o,i.getLocal("idx1")),i.call(t+"_sub",s,o,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("pwm"),b),i.setLocal("j",i.i32_add(i.getLocal("j"),i.i32_const(1))),i.br(0))),i.setLocal("k",i.i32_add(i.getLocal("k"),i.getLocal("m"))),i.br(0))),i.setLocal("s",i.i32_add(i.getLocal("s"),i.i32_const(1))),i.br(0))),i.call(a+"__fftFinal",i.getLocal("px"),i.getLocal("bits"),i.getLocal("reverse"),i.getLocal("mulFactor")))}(),function(){const t=e.addFunction(a+"__log2");t.addParam("n","i32"),t.setReturnType("i32"),t.addLocal("bits","i32"),t.addLocal("aux","i32");const c=t.getCodeBuilder();t.addCode(c.setLocal("aux",c.i32_shr_u(c.getLocal("n"),c.i32_const(1)))),t.addCode(c.setLocal("bits",c.i32_const(0))),t.addCode(c.block(c.loop(c.br_if(1,c.i32_eqz(c.getLocal("aux"))),c.setLocal("aux",c.i32_shr_u(c.getLocal("aux"),c.i32_const(1))),c.setLocal("bits",c.i32_add(c.getLocal("bits"),c.i32_const(1))),c.br(0)))),t.addCode(c.if(c.i32_ne(c.getLocal("n"),c.i32_shl(c.i32_const(1),c.getLocal("bits"))),c.unreachable())),t.addCode(c.if(c.i32_gt_u(c.getLocal("bits"),c.i32_const(b)),c.unreachable())),t.addCode(c.getLocal("bits"))}(),function(){const t=e.addFunction(a+"_fft");t.addParam("px","i32"),t.addParam("n","i32"),t.addLocal("bits","i32");const f=t.getCodeBuilder(),r=f.i32_const(e.alloc(d));t.addCode(f.setLocal("bits",f.call(a+"__log2",f.getLocal("n"))),f.call(c+"_one",r),f.call(a+"_rawfft",f.getLocal("px"),f.getLocal("bits"),f.i32_const(0),r))}(),function(){const t=e.addFunction(a+"_ifft");t.addParam("px","i32"),t.addParam("n","i32"),t.addLocal("bits","i32"),t.addLocal("pInv2","i32");const c=t.getCodeBuilder();t.addCode(c.setLocal("bits",c.call(a+"__log2",c.getLocal("n"))),c.setLocal("pInv2",c.i32_add(c.i32_const(x),c.i32_mul(c.getLocal("bits"),c.i32_const(d)))),c.call(a+"_rawfft",c.getLocal("px"),c.getLocal("bits"),c.i32_const(1),c.getLocal("pInv2")))}(),function(){const n=e.addFunction(a+"_fftJoin");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r)),s=i.i32_const(e.alloc(r));n.addCode(i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_copy",i.getLocal("idx1"),s),i.call(t+"_add",s,o,i.getLocal("idx1")),i.call(t+"_sub",s,o,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const n=e.addFunction(a+"_fftJoinExt");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addParam("totalBits","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("pShiftToM","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r));n.addCode(i.setLocal("pShiftToM",i.i32_add(i.i32_const(w),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(t+"_add",i.getLocal("idx1"),i.getLocal("idx2"),o),i.call(f,i.getLocal("idx2"),i.getLocal("pShiftToM"),i.getLocal("idx2")),i.call(t+"_add",i.getLocal("idx1"),i.getLocal("idx2"),i.getLocal("idx2")),i.call(f,i.getLocal("idx2"),b,i.getLocal("idx2")),i.call(t+"_copy",o,i.getLocal("idx1")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const n=e.addFunction(a+"_fftJoinExtInv");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addParam("totalBits","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("pShiftToM","i32"),n.addLocal("pSConst","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r));n.addCode(i.setLocal("pShiftToM",i.i32_add(i.i32_const(w),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.setLocal("pSConst",i.i32_add(i.i32_const(_),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_sub",i.getLocal("idx1"),o,i.getLocal("idx2")),i.call(f,i.getLocal("idx2"),i.getLocal("pSConst"),i.getLocal("idx2")),i.call(f,i.getLocal("idx1"),i.getLocal("pShiftToM"),i.getLocal("idx1")),i.call(t+"_sub",o,i.getLocal("idx1"),i.getLocal("idx1")),i.call(f,i.getLocal("idx1"),i.getLocal("pSConst"),i.getLocal("idx1")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const n=e.addFunction(a+"_fftMix");n.addParam("pBuff","i32"),n.addParam("n","i32"),n.addParam("exp","i32"),n.addLocal("nGroups","i32"),n.addLocal("nPerGroup","i32"),n.addLocal("nPerGroupDiv2","i32"),n.addLocal("pairOffset","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("j","i32"),n.addLocal("pwm","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r)),s=i.i32_const(e.alloc(r));n.addCode(i.setLocal("nPerGroup",i.i32_shl(i.i32_const(1),i.getLocal("exp"))),i.setLocal("nPerGroupDiv2",i.i32_shr_u(i.getLocal("nPerGroup"),i.i32_const(1))),i.setLocal("nGroups",i.i32_shr_u(i.getLocal("n"),i.getLocal("exp"))),i.setLocal("pairOffset",i.i32_mul(i.getLocal("nPerGroupDiv2"),i.i32_const(r))),i.setLocal("pwm",i.i32_add(i.i32_const(p),i.i32_mul(i.getLocal("exp"),i.i32_const(d)))),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("nGroups"))),i.call(c+"_one",b),i.setLocal("j",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("j"),i.getLocal("nPerGroupDiv2"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff"),i.i32_mul(i.i32_add(i.i32_mul(i.getLocal("i"),i.getLocal("nPerGroup")),i.getLocal("j")),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("idx1"),i.getLocal("pairOffset"))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_copy",i.getLocal("idx1"),s),i.call(t+"_add",s,o,i.getLocal("idx1")),i.call(t+"_sub",s,o,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("pwm"),b),i.setLocal("j",i.i32_add(i.getLocal("j"),i.i32_const(1))),i.br(0))),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const c=e.addFunction(a+"_fftFinal");c.addParam("pBuff","i32"),c.addParam("n","i32"),c.addParam("factor","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32"),c.addLocal("ndiv2","i32");const d=c.getCodeBuilder(),n=d.i32_const(e.alloc(r));c.addCode(d.setLocal("ndiv2",d.i32_shr_u(d.getLocal("n"),d.i32_const(1))),d.if(d.i32_and(d.getLocal("n"),d.i32_const(1)),d.call(f,d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.getLocal("ndiv2"),d.i32_const(r))),d.getLocal("factor"),d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.getLocal("ndiv2"),d.i32_const(r))))),d.setLocal("i",d.i32_const(0)),d.block(d.loop(d.br_if(1,d.i32_ge_u(d.getLocal("i"),d.getLocal("ndiv2"))),d.setLocal("idx1",d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.getLocal("i"),d.i32_const(r)))),d.setLocal("idx2",d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.i32_sub(d.i32_sub(d.getLocal("n"),d.i32_const(1)),d.getLocal("i")),d.i32_const(r)))),d.call(f,d.getLocal("idx2"),d.getLocal("factor"),n),d.call(f,d.getLocal("idx1"),d.getLocal("factor"),d.getLocal("idx2")),d.call(t+"_copy",n,d.getLocal("idx1")),d.setLocal("i",d.i32_add(d.getLocal("i"),d.i32_const(1))),d.br(0))))}(),function(){const n=e.addFunction(a+"_prepareLagrangeEvaluation");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addParam("totalBits","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("pShiftToM","i32"),n.addLocal("pSConst","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r));n.addCode(i.setLocal("pShiftToM",i.i32_add(i.i32_const(w),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.setLocal("pSConst",i.i32_add(i.i32_const(_),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(f,i.getLocal("idx1"),i.getLocal("pShiftToM"),o),i.call(t+"_sub",i.getLocal("idx2"),o,o),i.call(t+"_sub",i.getLocal("idx1"),i.getLocal("idx2"),i.getLocal("idx2")),i.call(f,o,i.getLocal("pSConst"),i.getLocal("idx1")),i.call(f,i.getLocal("idx2"),b,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),e.exportFunction(a+"_fft"),e.exportFunction(a+"_ifft"),e.exportFunction(a+"_rawfft"),e.exportFunction(a+"_fftJoin"),e.exportFunction(a+"_fftJoinExt"),e.exportFunction(a+"_fftJoinExtInv"),e.exportFunction(a+"_fftMix"),e.exportFunction(a+"_fftFinal"),e.exportFunction(a+"_prepareLagrangeEvaluation")},ke=function(e,a,t){const c=8*e.modules[t].n64;return function(){const f=e.addFunction(a+"_zero");f.addParam("px","i32"),f.addParam("n","i32"),f.addLocal("lastp","i32"),f.addLocal("p","i32");const d=f.getCodeBuilder();f.addCode(d.setLocal("p",d.getLocal("px")),d.setLocal("lastp",d.i32_add(d.getLocal("px"),d.i32_mul(d.getLocal("n"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("p"),d.getLocal("lastp"))),d.call(t+"_zero",d.getLocal("p")),d.setLocal("p",d.i32_add(d.getLocal("p"),d.i32_const(c))),d.br(0))))}(),function(){const f=e.addFunction(a+"_constructLC");f.addParam("ppolynomials","i32"),f.addParam("psignals","i32"),f.addParam("nSignals","i32"),f.addParam("pres","i32"),f.addLocal("i","i32"),f.addLocal("j","i32"),f.addLocal("pp","i32"),f.addLocal("ps","i32"),f.addLocal("pd","i32"),f.addLocal("ncoefs","i32");const d=f.getCodeBuilder(),r=d.i32_const(e.alloc(c));f.addCode(d.setLocal("i",d.i32_const(0)),d.setLocal("pp",d.getLocal("ppolynomials")),d.setLocal("ps",d.getLocal("psignals")),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("i"),d.getLocal("nSignals"))),d.setLocal("ncoefs",d.i32_load(d.getLocal("pp"))),d.setLocal("pp",d.i32_add(d.getLocal("pp"),d.i32_const(4))),d.setLocal("j",d.i32_const(0)),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("j"),d.getLocal("ncoefs"))),d.setLocal("pd",d.i32_add(d.getLocal("pres"),d.i32_mul(d.i32_load(d.getLocal("pp")),d.i32_const(c)))),d.setLocal("pp",d.i32_add(d.getLocal("pp"),d.i32_const(4))),d.call(t+"_mul",d.getLocal("ps"),d.getLocal("pp"),r),d.call(t+"_add",r,d.getLocal("pd"),d.getLocal("pd")),d.setLocal("pp",d.i32_add(d.getLocal("pp"),d.i32_const(c))),d.setLocal("j",d.i32_add(d.getLocal("j"),d.i32_const(1))),d.br(0))),d.setLocal("ps",d.i32_add(d.getLocal("ps"),d.i32_const(c))),d.setLocal("i",d.i32_add(d.getLocal("i"),d.i32_const(1))),d.br(0))))}(),e.exportFunction(a+"_zero"),e.exportFunction(a+"_constructLC"),a},Ne=function(e,a,t){const c=8*e.modules[t].n64;return function(){const f=e.addFunction(a+"_buildABC");f.addParam("pCoefs","i32"),f.addParam("nCoefs","i32"),f.addParam("pWitness","i32"),f.addParam("pA","i32"),f.addParam("pB","i32"),f.addParam("pC","i32"),f.addParam("offsetOut","i32"),f.addParam("nOut","i32"),f.addParam("offsetWitness","i32"),f.addParam("nWitness","i32"),f.addLocal("it","i32"),f.addLocal("ita","i32"),f.addLocal("itb","i32"),f.addLocal("last","i32"),f.addLocal("m","i32"),f.addLocal("c","i32"),f.addLocal("s","i32"),f.addLocal("pOut","i32");const d=f.getCodeBuilder(),r=d.i32_const(e.alloc(c));f.addCode(d.setLocal("ita",d.getLocal("pA")),d.setLocal("itb",d.getLocal("pB")),d.setLocal("last",d.i32_add(d.getLocal("pA"),d.i32_mul(d.getLocal("nOut"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_zero",d.getLocal("ita")),d.call(t+"_zero",d.getLocal("itb")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.br(0))),d.setLocal("it",d.getLocal("pCoefs")),d.setLocal("last",d.i32_add(d.getLocal("pCoefs"),d.i32_mul(d.getLocal("nCoefs"),d.i32_const(c+12)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("it"),d.getLocal("last"))),d.setLocal("s",d.i32_load(d.getLocal("it"),8)),d.if(d.i32_or(d.i32_lt_u(d.getLocal("s"),d.getLocal("offsetWitness")),d.i32_ge_u(d.getLocal("s"),d.i32_add(d.getLocal("offsetWitness"),d.getLocal("nWitness")))),[...d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),...d.br(1)]),d.setLocal("m",d.i32_load(d.getLocal("it"))),d.if(d.i32_eq(d.getLocal("m"),d.i32_const(0)),d.setLocal("pOut",d.getLocal("pA")),d.if(d.i32_eq(d.getLocal("m"),d.i32_const(1)),d.setLocal("pOut",d.getLocal("pB")),[...d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),...d.br(1)])),d.setLocal("c",d.i32_load(d.getLocal("it"),4)),d.if(d.i32_or(d.i32_lt_u(d.getLocal("c"),d.getLocal("offsetOut")),d.i32_ge_u(d.getLocal("c"),d.i32_add(d.getLocal("offsetOut"),d.getLocal("nOut")))),[...d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),...d.br(1)]),d.setLocal("pOut",d.i32_add(d.getLocal("pOut"),d.i32_mul(d.i32_sub(d.getLocal("c"),d.getLocal("offsetOut")),d.i32_const(c)))),d.call(t+"_mul",d.i32_add(d.getLocal("pWitness"),d.i32_mul(d.i32_sub(d.getLocal("s"),d.getLocal("offsetWitness")),d.i32_const(c))),d.i32_add(d.getLocal("it"),d.i32_const(12)),r),d.call(t+"_add",d.getLocal("pOut"),r,d.getLocal("pOut")),d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),d.br(0))),d.setLocal("ita",d.getLocal("pA")),d.setLocal("itb",d.getLocal("pB")),d.setLocal("it",d.getLocal("pC")),d.setLocal("last",d.i32_add(d.getLocal("pA"),d.i32_mul(d.getLocal("nOut"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_mul",d.getLocal("ita"),d.getLocal("itb"),d.getLocal("it")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c))),d.br(0))))}(),function(){const f=e.addFunction(a+"_joinABC");f.addParam("pA","i32"),f.addParam("pB","i32"),f.addParam("pC","i32"),f.addParam("n","i32"),f.addParam("pP","i32"),f.addLocal("ita","i32"),f.addLocal("itb","i32"),f.addLocal("itc","i32"),f.addLocal("itp","i32"),f.addLocal("last","i32");const d=f.getCodeBuilder(),r=d.i32_const(e.alloc(c));f.addCode(d.setLocal("ita",d.getLocal("pA")),d.setLocal("itb",d.getLocal("pB")),d.setLocal("itc",d.getLocal("pC")),d.setLocal("itp",d.getLocal("pP")),d.setLocal("last",d.i32_add(d.getLocal("pA"),d.i32_mul(d.getLocal("n"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_mul",d.getLocal("ita"),d.getLocal("itb"),r),d.call(t+"_sub",r,d.getLocal("itc"),d.getLocal("itp")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.setLocal("itc",d.i32_add(d.getLocal("itc"),d.i32_const(c))),d.setLocal("itp",d.i32_add(d.getLocal("itp"),d.i32_const(c))),d.br(0))))}(),function(){const f=e.addFunction(a+"_batchAdd");f.addParam("pa","i32"),f.addParam("pb","i32"),f.addParam("n","i32"),f.addParam("pr","i32"),f.addLocal("ita","i32"),f.addLocal("itb","i32"),f.addLocal("itr","i32"),f.addLocal("last","i32");const d=f.getCodeBuilder();f.addCode(d.setLocal("ita",d.getLocal("pa")),d.setLocal("itb",d.getLocal("pb")),d.setLocal("itr",d.getLocal("pr")),d.setLocal("last",d.i32_add(d.getLocal("pa"),d.i32_mul(d.getLocal("n"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_add",d.getLocal("ita"),d.getLocal("itb"),d.getLocal("itr")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.setLocal("itr",d.i32_add(d.getLocal("itr"),d.i32_const(c))),d.br(0))))}(),e.exportFunction(a+"_buildABC"),e.exportFunction(a+"_joinABC"),e.exportFunction(a+"_batchAdd"),a},Pe=function(e,a,t,c,f,d,r,n){const i=e.addFunction(a);i.addParam("pIn","i32"),i.addParam("n","i32"),i.addParam("pFirst","i32"),i.addParam("pInc","i32"),i.addParam("pOut","i32"),i.addLocal("pOldFree","i32"),i.addLocal("i","i32"),i.addLocal("pFrom","i32"),i.addLocal("pTo","i32");const b=i.getCodeBuilder(),o=b.i32_const(e.alloc(r));i.addCode(b.setLocal("pFrom",b.getLocal("pIn")),b.setLocal("pTo",b.getLocal("pOut"))),i.addCode(b.call(c+"_copy",b.getLocal("pFirst"),o)),i.addCode(b.setLocal("i",b.i32_const(0)),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("i"),b.getLocal("n"))),b.call(n,b.getLocal("pFrom"),o,b.getLocal("pTo")),b.setLocal("pFrom",b.i32_add(b.getLocal("pFrom"),b.i32_const(f))),b.setLocal("pTo",b.i32_add(b.getLocal("pTo"),b.i32_const(d))),b.call(c+"_mul",o,b.getLocal("pInc"),o),b.setLocal("i",b.i32_add(b.getLocal("i"),b.i32_const(1))),b.br(0)))),e.exportFunction(a)};const Re=D,Oe=se,De=he,Te=xe,Fe=ve,Qe=Ee,Ue=Se,je=ke,He=Ne,$e=Pe,{bitLength:qe,modInv:Ge,isOdd:ze,isNegative:Ke}=U,Ve=D,Ze=se,Je=he,We=xe,Ye=ve,Xe=Ee,ea=Se,aa=ke,ta=Ne,ca=Pe,{bitLength:fa,isOdd:da,isNegative:ra}=U;var na=function(e,a){const t=a||"bn128";if(e.modules[t])return t;const c=21888242871839275222246405745257275088696311157297823662689037894645226208583n,f=21888242871839275222246405745257275088548364400416034343698204186575808495617n,d=Math.floor((qe(c-1n)-1)/64)+1,r=8*d,n=r,i=r,b=2*i,o=12*i,s=e.alloc(Re.bigInt2BytesLE(f,n)),l=Oe(e,c,"f1m");De(e,f,"fr","frm");const u=e.alloc(Re.bigInt2BytesLE(y(3n),i)),h=Qe(e,"g1m","f1m",u);Ue(e,"frm","frm","frm","frm_mul"),je(e,"pol","frm"),He(e,"qap","frm");const p=Te(e,"f1m_neg","f2m","f1m"),g=e.alloc([...Re.bigInt2BytesLE(y(19485874751759354771024239261021720505790618469301721065564631296452457478373n),i),...Re.bigInt2BytesLE(y(266929791119991161246907387137283842545076965332900288569378510910307636690n),i)]),m=Qe(e,"g2m","f2m",g);function x(a,t){const c=e.addFunction(a);c.addParam("pG","i32"),c.addParam("pFr","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(r));c.addCode(f.call("frm_fromMontgomery",f.getLocal("pFr"),d),f.call(t,f.getLocal("pG"),d,f.i32_const(r),f.getLocal("pr"))),e.exportFunction(a)}function y(e){return BigInt(e)*(1n<0n;)ze(e)?a.push(1):a.push(0),e>>=1n;return a}(),D=e.alloc(O),T=3*b,F=O.length-1,Q=O.reduce(((e,a)=>e+(0!=a?1:0)),0),U=6*r,j=3*r*2+(Q+F+1)*T;function H(a){const f=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[8376118865763821496583973867626364092589906065868298776909617916018768340080n,16469823323077808223889137241176536799009286646108169935659301613961712198316n],[21888242871839275220042445260109153167277707414472061641714758635765020556617n,0n],[11697423496358154304825782922584725312912383441159505038794027105778954184319n,303847389135065887422783454877609941456349188919719272345083954437860409601n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3321304630594332808241809054958361220322477375291206261884409189760185844239n,5722266937896532885780051958958348231143373700109372999374820235121374419868n],[21888242871839275222246405745257275088696311157297823662689037894645226208582n,0n],[13512124006075453725662431877630910996106405091429524885779419978626457868503n,5418419548761466998357268504080738289687024511189653727029736280683514010267n],[2203960485148121921418603742825762020974279258880205651966n,0n],[10190819375481120917420622822672549775783927716138318623895010788866272024264n,21584395482704209334823622290379665147239961968378104390343953940207365798982n],[2203960485148121921418603742825762020974279258880205651967n,0n],[18566938241244942414004596690298913868373833782006617400804628704885040364344n,16165975933942742336466353786298926857552937457188450663314217659523851788715n]]],d=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[21575463638280843010398324269430826099269044274347216827212613867836435027261n,10307601595873709700152284273816112264069230130616436755625194854815875713954n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3772000881919853776433695186713858239009073593817195771773381919316419345261n,2236595495967245188281701248203181795121068902605861227855261137820944008926n],[2203960485148121921418603742825762020974279258880205651966n,0n],[18429021223477853657660792034369865839114504446431234726392080002137598044644n,9344045779998320333812420223237981029506012124075525679208581902008406485703n]],[[1n,0n],[2581911344467009335267311115468803099551665605076196740867805258568234346338n,19937756971775647987995932169929341994314640652964949448313374472400716661030n],[2203960485148121921418603742825762020974279258880205651966n,0n],[5324479202449903542726783395506214481928257762400643279780343368557297135718n,16208900380737693084919495127334387981393726419856888799917914180988844123039n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[13981852324922362344252311234282257507216387789820983642040889267519694726527n,7629828391165209371577384193250820201684255241773809077146787135900891633097n]]],r=e.addFunction(t+"__frobeniusMap"+a);r.addParam("x","i32"),r.addParam("r","i32");const n=r.getCodeBuilder();for(let t=0;t<6;t++){const c=0==t?n.getLocal("x"):n.i32_add(n.getLocal("x"),n.i32_const(t*b)),s=c,u=n.i32_add(n.getLocal("x"),n.i32_const(t*b+i)),h=0==t?n.getLocal("r"):n.i32_add(n.getLocal("r"),n.i32_const(t*b)),g=h,m=n.i32_add(n.getLocal("r"),n.i32_const(t*b+i)),x=o(f[Math.floor(t/3)][a%12],d[t%3][a%6]),A=e.alloc([...Re.bigInt2BytesLE(y(x[0]),32),...Re.bigInt2BytesLE(y(x[1]),32)]);a%2==1?r.addCode(n.call(l+"_copy",s,g),n.call(l+"_neg",u,m),n.call(p+"_mul",h,n.i32_const(A),h)):r.addCode(n.call(p+"_mul",c,n.i32_const(A),h))}function o(e,a){const t=BigInt(e[0]),f=BigInt(e[1]),d=BigInt(a[0]),r=BigInt(a[1]),n=[(t*d-f*r)%c,(t*r+f*d)%c];return Ke(n[0])&&(n[0]=n[0]+c),n}}function $(){!function(){const a=e.addFunction(t+"__cyclotomicSquare");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.getLocal("x"),d=c.i32_add(c.getLocal("x"),c.i32_const(b)),r=c.i32_add(c.getLocal("x"),c.i32_const(2*b)),n=c.i32_add(c.getLocal("x"),c.i32_const(3*b)),i=c.i32_add(c.getLocal("x"),c.i32_const(4*b)),o=c.i32_add(c.getLocal("x"),c.i32_const(5*b)),s=c.getLocal("r"),l=c.i32_add(c.getLocal("r"),c.i32_const(b)),u=c.i32_add(c.getLocal("r"),c.i32_const(2*b)),h=c.i32_add(c.getLocal("r"),c.i32_const(3*b)),g=c.i32_add(c.getLocal("r"),c.i32_const(4*b)),m=c.i32_add(c.getLocal("r"),c.i32_const(5*b)),x=c.i32_const(e.alloc(b)),y=c.i32_const(e.alloc(b)),A=c.i32_const(e.alloc(b)),v=c.i32_const(e.alloc(b)),w=c.i32_const(e.alloc(b)),_=c.i32_const(e.alloc(b)),I=c.i32_const(e.alloc(b)),E=c.i32_const(e.alloc(b));a.addCode(c.call(p+"_mul",f,i,I),c.call(p+"_mul",i,c.i32_const(L),x),c.call(p+"_add",f,x,x),c.call(p+"_add",f,i,E),c.call(p+"_mul",E,x,x),c.call(p+"_mul",c.i32_const(L),I,E),c.call(p+"_add",I,E,E),c.call(p+"_sub",x,E,x),c.call(p+"_add",I,I,y),c.call(p+"_mul",n,r,I),c.call(p+"_mul",r,c.i32_const(L),A),c.call(p+"_add",n,A,A),c.call(p+"_add",n,r,E),c.call(p+"_mul",E,A,A),c.call(p+"_mul",c.i32_const(L),I,E),c.call(p+"_add",I,E,E),c.call(p+"_sub",A,E,A),c.call(p+"_add",I,I,v),c.call(p+"_mul",d,o,I),c.call(p+"_mul",o,c.i32_const(L),w),c.call(p+"_add",d,w,w),c.call(p+"_add",d,o,E),c.call(p+"_mul",E,w,w),c.call(p+"_mul",c.i32_const(L),I,E),c.call(p+"_add",I,E,E),c.call(p+"_sub",w,E,w),c.call(p+"_add",I,I,_),c.call(p+"_sub",x,f,s),c.call(p+"_add",s,s,s),c.call(p+"_add",x,s,s),c.call(p+"_add",y,i,g),c.call(p+"_add",g,g,g),c.call(p+"_add",y,g,g),c.call(p+"_mul",_,c.i32_const(k),E),c.call(p+"_add",E,n,h),c.call(p+"_add",h,h,h),c.call(p+"_add",E,h,h),c.call(p+"_sub",w,r,u),c.call(p+"_add",u,u,u),c.call(p+"_add",w,u,u),c.call(p+"_sub",A,d,l),c.call(p+"_add",l,l,l),c.call(p+"_add",A,l,l),c.call(p+"_add",v,o,m),c.call(p+"_add",m,m,m),c.call(p+"_add",v,m,m))}(),function(a,c){const f=function(e){let a=e;const t=[];for(;a>0n;){if(ze(a)){const e=2-Number(a%4n);t.push(e),a-=BigInt(e)}else t.push(0);a>>=1n}return t}(a).map((e=>-1==e?255:e)),d=e.alloc(f),r=e.addFunction(t+"__cyclotomicExp_"+c);r.addParam("x","i32"),r.addParam("r","i32"),r.addLocal("bit","i32"),r.addLocal("i","i32");const n=r.getCodeBuilder(),i=n.getLocal("x"),b=n.getLocal("r"),s=n.i32_const(e.alloc(o));r.addCode(n.call(R+"_conjugate",i,s),n.call(R+"_one",b),n.if(n.teeLocal("bit",n.i32_load8_s(n.i32_const(f.length-1),d)),n.if(n.i32_eq(n.getLocal("bit"),n.i32_const(1)),n.call(R+"_mul",b,i,b),n.call(R+"_mul",b,s,b))),n.setLocal("i",n.i32_const(f.length-2)),n.block(n.loop(n.call(t+"__cyclotomicSquare",b,b),n.if(n.teeLocal("bit",n.i32_load8_s(n.getLocal("i"),d)),n.if(n.i32_eq(n.getLocal("bit"),n.i32_const(1)),n.call(R+"_mul",b,i,b),n.call(R+"_mul",b,s,b))),n.br_if(1,n.i32_eqz(n.getLocal("i"))),n.setLocal("i",n.i32_sub(n.getLocal("i"),n.i32_const(1))),n.br(0))))}(4965661367192848881n,"w0");const a=e.addFunction(t+"__finalExponentiationLastChunk");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.getLocal("x"),d=c.getLocal("r"),r=c.i32_const(e.alloc(o)),n=c.i32_const(e.alloc(o)),i=c.i32_const(e.alloc(o)),s=c.i32_const(e.alloc(o)),l=c.i32_const(e.alloc(o)),u=c.i32_const(e.alloc(o)),h=c.i32_const(e.alloc(o)),g=c.i32_const(e.alloc(o)),m=c.i32_const(e.alloc(o)),x=c.i32_const(e.alloc(o)),y=c.i32_const(e.alloc(o)),A=c.i32_const(e.alloc(o)),v=c.i32_const(e.alloc(o)),w=c.i32_const(e.alloc(o)),_=c.i32_const(e.alloc(o)),I=c.i32_const(e.alloc(o)),E=c.i32_const(e.alloc(o)),C=c.i32_const(e.alloc(o)),M=c.i32_const(e.alloc(o)),B=c.i32_const(e.alloc(o)),S=c.i32_const(e.alloc(o));a.addCode(c.call(t+"__cyclotomicExp_w0",f,r),c.call(R+"_conjugate",r,r),c.call(t+"__cyclotomicSquare",r,n),c.call(t+"__cyclotomicSquare",n,i),c.call(R+"_mul",i,n,s),c.call(t+"__cyclotomicExp_w0",s,l),c.call(R+"_conjugate",l,l),c.call(t+"__cyclotomicSquare",l,u),c.call(t+"__cyclotomicExp_w0",u,h),c.call(R+"_conjugate",h,h),c.call(R+"_conjugate",s,g),c.call(R+"_conjugate",h,m),c.call(R+"_mul",m,l,x),c.call(R+"_mul",x,g,y),c.call(R+"_mul",y,n,A),c.call(R+"_mul",y,l,v),c.call(R+"_mul",v,f,w),c.call(t+"__frobeniusMap1",A,_),c.call(R+"_mul",_,w,I),c.call(t+"__frobeniusMap2",y,E),c.call(R+"_mul",E,I,C),c.call(R+"_conjugate",f,M),c.call(R+"_mul",M,A,B),c.call(t+"__frobeniusMap3",B,S),c.call(R+"_mul",S,C,d))}e.modules[t]={n64:d,pG1gen:v,pG1zero:_,pG1b:u,pG2gen:E,pG2zero:M,pG2b:g,pq:e.modules.f1m.pq,pr:s,pOneT:B,prePSize:U,preQSize:j,r:f.toString(),q:c.toString()};const q=e.alloc(U),G=e.alloc(j);function z(a){const c=e.addFunction(t+"_pairingEq"+a);for(let e=0;e0n;)da(e)?a.push(1):a.push(0),e>>=1n;return a}(),O=e.alloc(R),D=3*i,T=R.length-1,F=R.reduce(((e,a)=>e+(0!=a?1:0)),0),Q=6*r,U=3*r*2+(F+T+1)*D,j=15132376222941642752n;function H(a){const t=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n,151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n],[2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n,1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n,877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n,3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n,2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n,3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n]]],f=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[0n,4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[0n,1n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[0n,793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n]],[[1n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n]]],d=e.addFunction(P+"_frobeniusMap"+a);d.addParam("x","i32"),d.addParam("r","i32");const b=d.getCodeBuilder();for(let c=0;c<6;c++){const s=0==c?b.getLocal("x"):b.i32_add(b.getLocal("x"),b.i32_const(c*i)),l=s,u=b.i32_add(b.getLocal("x"),b.i32_const(c*i+n)),p=0==c?b.getLocal("r"):b.i32_add(b.getLocal("r"),b.i32_const(c*i)),g=p,x=b.i32_add(b.getLocal("r"),b.i32_const(c*i+n)),y=o(t[Math.floor(c/3)][a%12],f[c%3][a%6]),A=e.alloc([...Ve.bigInt2BytesLE(v(y[0]),r),...Ve.bigInt2BytesLE(v(y[1]),r)]);a%2==1?d.addCode(b.call(h+"_copy",l,g),b.call(h+"_neg",u,x),b.call(m+"_mul",p,b.i32_const(A),p)):d.addCode(b.call(m+"_mul",s,b.i32_const(A),p))}function o(e,a){const t=e[0],f=e[1],d=a[0],r=a[1],n=[(t*d-f*r)%c,(t*r+f*d)%c];return ra(n[0])&&(n[0]=n[0]+c),n}}e.modules[t]={n64q:d,n64r:o,n8q:r,n8r:s,pG1gen:_,pG1zero:E,pG1b:p,pG2gen:M,pG2zero:L,pG2b:x,pq:e.modules.f1m.pq,pr:u,pOneT:S,r:f,q:c,prePSize:Q,preQSize:U},function(){const a=e.addFunction(N+"_mul1");a.addParam("pA","i32"),a.addParam("pC1","i32"),a.addParam("pR","i32");const t=a.getCodeBuilder(),c=t.getLocal("pA"),f=t.i32_add(t.getLocal("pA"),t.i32_const(2*n)),d=t.i32_add(t.getLocal("pA"),t.i32_const(4*n)),r=t.getLocal("pC1"),i=t.getLocal("pR"),b=t.i32_add(t.getLocal("pR"),t.i32_const(2*n)),o=t.i32_add(t.getLocal("pR"),t.i32_const(4*n)),s=t.i32_const(e.alloc(2*n)),l=t.i32_const(e.alloc(2*n));a.addCode(t.call(m+"_add",c,f,s),t.call(m+"_add",f,d,l),t.call(m+"_mul",f,r,o),t.call(m+"_mul",l,r,i),t.call(m+"_sub",i,o,i),t.call(m+"_mulNR",i,i),t.call(m+"_mul",s,r,b),t.call(m+"_sub",b,o,b))}(),function(){const a=e.addFunction(N+"_mul01");a.addParam("pA","i32"),a.addParam("pC0","i32"),a.addParam("pC1","i32"),a.addParam("pR","i32");const t=a.getCodeBuilder(),c=t.getLocal("pA"),f=t.i32_add(t.getLocal("pA"),t.i32_const(2*n)),d=t.i32_add(t.getLocal("pA"),t.i32_const(4*n)),r=t.getLocal("pC0"),i=t.getLocal("pC1"),b=t.getLocal("pR"),o=t.i32_add(t.getLocal("pR"),t.i32_const(2*n)),s=t.i32_add(t.getLocal("pR"),t.i32_const(4*n)),l=t.i32_const(e.alloc(2*n)),u=t.i32_const(e.alloc(2*n)),h=t.i32_const(e.alloc(2*n)),p=t.i32_const(e.alloc(2*n));a.addCode(t.call(m+"_mul",c,r,l),t.call(m+"_mul",f,i,u),t.call(m+"_add",c,f,h),t.call(m+"_add",c,d,p),t.call(m+"_add",f,d,b),t.call(m+"_mul",b,i,b),t.call(m+"_sub",b,u,b),t.call(m+"_mulNR",b,b),t.call(m+"_add",b,l,b),t.call(m+"_add",r,i,o),t.call(m+"_mul",o,h,o),t.call(m+"_sub",o,l,o),t.call(m+"_sub",o,u,o),t.call(m+"_mul",p,r,s),t.call(m+"_sub",s,l,s),t.call(m+"_add",s,u,s))}(),function(){const a=e.addFunction(P+"_mul014");a.addParam("pA","i32"),a.addParam("pC0","i32"),a.addParam("pC1","i32"),a.addParam("pC4","i32"),a.addParam("pR","i32");const t=a.getCodeBuilder(),c=t.getLocal("pA"),f=t.i32_add(t.getLocal("pA"),t.i32_const(6*n)),d=t.getLocal("pC0"),r=t.getLocal("pC1"),i=t.getLocal("pC4"),b=t.i32_const(e.alloc(6*n)),o=t.i32_const(e.alloc(6*n)),s=t.i32_const(e.alloc(2*n)),l=t.getLocal("pR"),u=t.i32_add(t.getLocal("pR"),t.i32_const(6*n));a.addCode(t.call(N+"_mul01",c,d,r,b),t.call(N+"_mul1",f,i,o),t.call(m+"_add",r,i,s),t.call(N+"_add",f,c,u),t.call(N+"_mul01",u,d,s,u),t.call(N+"_sub",u,b,u),t.call(N+"_sub",u,o,u),t.call(N+"_copy",o,l),t.call(N+"_mulNR",l,l),t.call(N+"_add",l,b,l))}(),function(){const a=e.addFunction(t+"_ell");a.addParam("pP","i32"),a.addParam("pCoefs","i32"),a.addParam("pF","i32");const c=a.getCodeBuilder(),f=c.getLocal("pP"),d=c.i32_add(c.getLocal("pP"),c.i32_const(r)),i=c.getLocal("pF"),b=c.getLocal("pCoefs"),o=c.i32_add(c.getLocal("pCoefs"),c.i32_const(n)),s=c.i32_add(c.getLocal("pCoefs"),c.i32_const(2*n)),l=c.i32_add(c.getLocal("pCoefs"),c.i32_const(3*n)),u=c.i32_add(c.getLocal("pCoefs"),c.i32_const(4*n)),p=e.alloc(2*n),g=c.i32_const(p),m=c.i32_const(p),x=c.i32_const(p+n),y=e.alloc(2*n),A=c.i32_const(y),v=c.i32_const(y),w=c.i32_const(y+n);a.addCode(c.call(h+"_mul",b,d,m),c.call(h+"_mul",o,d,x),c.call(h+"_mul",s,f,v),c.call(h+"_mul",l,f,w),c.call(P+"_mul014",i,u,A,g,i))}();const $=e.alloc(Q),q=e.alloc(U);function G(a){const c=e.addFunction(t+"_pairingEq"+a);for(let e=0;e0n;){if(da(a)){const e=2-Number(a%4n);t.push(e),a-=BigInt(e)}else t.push(0);a>>=1n}return t}(a).map((e=>-1==e?255:e)),r=e.alloc(d),n=e.addFunction(t+"__cyclotomicExp_"+f);n.addParam("x","i32"),n.addParam("r","i32"),n.addLocal("bit","i32"),n.addLocal("i","i32");const i=n.getCodeBuilder(),o=i.getLocal("x"),s=i.getLocal("r"),l=i.i32_const(e.alloc(b));n.addCode(i.call(P+"_conjugate",o,l),i.call(P+"_one",s),i.if(i.teeLocal("bit",i.i32_load8_s(i.i32_const(d.length-1),r)),i.if(i.i32_eq(i.getLocal("bit"),i.i32_const(1)),i.call(P+"_mul",s,o,s),i.call(P+"_mul",s,l,s))),i.setLocal("i",i.i32_const(d.length-2)),i.block(i.loop(i.call(t+"__cyclotomicSquare",s,s),i.if(i.teeLocal("bit",i.i32_load8_s(i.getLocal("i"),r)),i.if(i.i32_eq(i.getLocal("bit"),i.i32_const(1)),i.call(P+"_mul",s,o,s),i.call(P+"_mul",s,l,s))),i.br_if(1,i.i32_eqz(i.getLocal("i"))),i.setLocal("i",i.i32_sub(i.getLocal("i"),i.i32_const(1))),i.br(0)))),c&&n.addCode(i.call(P+"_conjugate",s,s))}(j,!0,"w0");const a=e.addFunction(t+"_finalExponentiation");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.getLocal("x"),d=c.getLocal("r"),r=c.i32_const(e.alloc(b)),n=c.i32_const(e.alloc(b)),o=c.i32_const(e.alloc(b)),s=c.i32_const(e.alloc(b)),l=c.i32_const(e.alloc(b)),u=c.i32_const(e.alloc(b)),h=c.i32_const(e.alloc(b));a.addCode(c.call(P+"_frobeniusMap6",f,r),c.call(P+"_inverse",f,n),c.call(P+"_mul",r,n,o),c.call(P+"_copy",o,n),c.call(P+"_frobeniusMap2",o,o),c.call(P+"_mul",o,n,o),c.call(t+"__cyclotomicSquare",o,n),c.call(P+"_conjugate",n,n),c.call(t+"__cyclotomicExp_w0",o,s),c.call(t+"__cyclotomicSquare",s,l),c.call(P+"_mul",n,s,u),c.call(t+"__cyclotomicExp_w0",u,n),c.call(t+"__cyclotomicExp_w0",n,r),c.call(t+"__cyclotomicExp_w0",r,h),c.call(P+"_mul",h,l,h),c.call(t+"__cyclotomicExp_w0",h,l),c.call(P+"_conjugate",u,u),c.call(P+"_mul",l,u,l),c.call(P+"_mul",l,o,l),c.call(P+"_conjugate",o,u),c.call(P+"_mul",n,o,n),c.call(P+"_frobeniusMap3",n,n),c.call(P+"_mul",h,u,h),c.call(P+"_frobeniusMap1",h,h),c.call(P+"_mul",s,r,s),c.call(P+"_frobeniusMap2",s,s),c.call(P+"_mul",s,n,s),c.call(P+"_mul",s,h,s),c.call(P+"_mul",s,l,d))}();for(let a=1;a<=5;a++)G(a),e.exportFunction(t+"_pairingEq"+a);!function(){const a=e.addFunction(t+"_pairing");a.addParam("p","i32"),a.addParam("q","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.i32_const(e.alloc(b));a.addCode(c.call(t+"_prepareG1",c.getLocal("p"),c.i32_const($))),a.addCode(c.call(t+"_prepareG2",c.getLocal("q"),c.i32_const(q))),a.addCode(c.call(t+"_millerLoop",c.i32_const($),c.i32_const(q),f)),a.addCode(c.call(t+"_finalExponentiation",f,c.getLocal("r")))}(),e.exportFunction(t+"_pairing"),e.exportFunction(t+"_prepareG1"),e.exportFunction(t+"_prepareG2"),e.exportFunction(t+"_millerLoop"),e.exportFunction(t+"_finalExponentiation"),e.exportFunction(t+"_finalExponentiationOld"),e.exportFunction(t+"__cyclotomicSquare"),e.exportFunction(t+"__cyclotomicExp_w0"),e.exportFunction(N+"_mul1"),e.exportFunction(N+"_mul01"),e.exportFunction(P+"_mul014"),e.exportFunction(g+"_inGroupAffine"),e.exportFunction(g+"_inGroup"),e.exportFunction(y+"_inGroupAffine"),e.exportFunction(y+"_inGroup")};function ba(e,a){let t=e;void 0===a&&0==(a=Math.floor((r(e)-1)/8)+1)&&(a=1);const c=new Uint8Array(a),f=new DataView(c.buffer);let d=0;for(;d>=BigInt(32)):d+2<=a?(f.setUint16(d,Number(t&BigInt(65535)),!0),d+=2,t>>=BigInt(16)):(f.setUint8(d,Number(t&BigInt(255)),!0),d+=1,t>>=BigInt(8));if(t)throw new Error("Number does not fit in this length");return c}const oa=[];for(let e=0;e<256;e++)oa[e]=sa(e,8);function sa(e,a){let t=0,c=e;for(let e=0;e>=1;return t}function la(e,a){return(oa[e>>>24]|oa[e>>>16&255]<<8|oa[e>>>8&255]<<16|oa[255&e]<<24)>>>32-a}function ua(e){return(4294901760&e?(e&=4294901760,16):0)|(4278255360&e?(e&=4278255360,8):0)|(4042322160&e?(e&=4042322160,4):0)|(3435973836&e?(e&=3435973836,2):0)|!!(2863311530&e)}function ha(e,a){const t=e.byteLength/a,c=ua(t);if(t!=1<t){const c=e.slice(f*a,(f+1)*a);e.set(e.slice(t*a,(t+1)*a),f*a),e.set(c,t*a)}}}function pa(e,a){const t=new Uint8Array(a*e.length);for(let c=0;c0;)t>=4?(t-=4,a+=BigInt(f.getUint32(t))<=2?(t-=2,a+=BigInt(f.getUint16(t))<0;)d-4>=0?(d-=4,f.setUint32(d,Number(t&BigInt(4294967295))),t>>=BigInt(32)):d-2>=0?(d-=2,f.setUint16(d,Number(t&BigInt(65535))),t>>=BigInt(16)):(d-=1,f.setUint8(d,Number(t&BigInt(255))),t>>=BigInt(8));if(t)throw new Error("Number does not fit in this length");return c},bitReverse:la,buffReverseBits:ha,buffer2array:ga,leBuff2int:function(e){let a=BigInt(0),t=0;const c=new DataView(e.buffer,e.byteOffset,e.byteLength);for(;t{t[c]=e(a[c])})),t}return a},stringifyFElements:function e(a,t){if("bigint"==typeof t||void 0!==t.eq)return t.toString(10);if(t instanceof Uint8Array)return a.toString(a.e(t));if(Array.isArray(t))return t.map(e.bind(this,a));if("object"==typeof t){const c={};return Object.keys(t).forEach((f=>{c[f]=e(a,t[f])})),c}return t},unstringifyBigInts:function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return BigInt(a);if("string"==typeof a&&/^0x[0-9a-fA-F]+$/.test(a))return BigInt(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){if(null===a)return null;const t={};return Object.keys(a).forEach((c=>{t[c]=e(a[c])})),t}return a},unstringifyFElements:function e(a,t){if("string"==typeof t&&/^[0-9]+$/.test(t))return a.e(t);if("string"==typeof t&&/^0x[0-9a-fA-F]+$/.test(t))return a.e(t);if(Array.isArray(t))return t.map(e.bind(this,a));if("object"==typeof t){if(null===t)return null;const c={};return Object.keys(t).forEach((f=>{c[f]=e(a,t[f])})),c}return t}});const xa=1<<30;class ya{constructor(e){this.buffers=[],this.byteLength=e;for(let a=0;a0;){const e=r+n>xa?xa-r:n,a=new Uint8Array(this.buffers[d].buffer,this.buffers[d].byteOffset+r,e);if(e==t)return a.slice();f||(f=t<=xa?new Uint8Array(t):new ya(t)),f.set(a,t-n),n-=e,d++,r=0}return f}set(e,a){void 0===a&&(a=0);const t=e.byteLength;if(0==t)return;const c=Math.floor(a/xa);if(c==Math.floor((a+t-1)/xa))return e instanceof ya&&1==e.buffers.length?this.buffers[c].set(e.buffers[0],a%xa):this.buffers[c].set(e,a%xa);let f=c,d=a%xa,r=t;for(;r>0;){const a=d+r>xa?xa-d:r,c=e.slice(t-r,t-r+a);new Uint8Array(this.buffers[f].buffer,this.buffers[f].byteOffset+d,a).set(c),r-=a,f++,d=0}}}function Aa(e,a,t,c){return async function(f){const d=Math.floor(f.byteLength/t);if(d*t!==f.byteLength)throw new Error("Invalid buffer size");const r=Math.floor(d/e.concurrency),n=[];for(let i=0;i=0;e--)this.w[e]=this.square(this.w[e+1]);if(!this.eq(this.w[0],this.one))throw new Error("Error calculating roots of unity");this.batchToMontgomery=Aa(e,a+"_batchToMontgomery",this.n8,this.n8),this.batchFromMontgomery=Aa(e,a+"_batchFromMontgomery",this.n8,this.n8)}op2(e,a,t){return this.tm.setBuff(this.pOp1,a),this.tm.setBuff(this.pOp2,t),this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op2Bool(e,a,t){return this.tm.setBuff(this.pOp1,a),this.tm.setBuff(this.pOp2,t),!!this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp2)}op1(e,a){return this.tm.setBuff(this.pOp1,a),this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op1Bool(e,a){return this.tm.setBuff(this.pOp1,a),!!this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp3)}add(e,a){return this.op2("_add",e,a)}eq(e,a){return this.op2Bool("_eq",e,a)}isZero(e){return this.op1Bool("_isZero",e)}sub(e,a){return this.op2("_sub",e,a)}neg(e){return this.op1("_neg",e)}inv(e){return this.op1("_inverse",e)}toMontgomery(e){return this.op1("_toMontgomery",e)}fromMontgomery(e){return this.op1("_fromMontgomery",e)}mul(e,a){return this.op2("_mul",e,a)}div(e,a){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,a),this.tm.instance.exports[this.prefix+"_inverse"](this.pOp2,this.pOp2),this.tm.instance.exports[this.prefix+"_mul"](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}square(e){return this.op1("_square",e)}isSquare(e){return this.op1Bool("_isSquare",e)}sqrt(e){return this.op1("_sqrt",e)}exp(e,a){return a instanceof Uint8Array||(a=E(d(a))),this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,a),this.tm.instance.exports[this.prefix+"_exp"](this.pOp1,this.pOp2,a.byteLength,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}isNegative(e){return this.op1Bool("_isNegative",e)}e(e,a){if(e instanceof Uint8Array)return e;let t=d(e,a);n(t)?(t=g(t),y(t,this.p)&&(t=x(t,this.p)),t=p(this.p,t)):y(t,this.p)&&(t=x(t,this.p));const c=ba(t,this.n8);return this.toMontgomery(c)}toString(e,a){return I(_(this.fromMontgomery(e),0),a)}fromRng(e){let a;const t=new Uint8Array(this.n8);do{a=C;for(let t=0;t{this.reject=a,this.resolve=e}))}}const Ba="data:application/javascript;base64,"+globalThis.btoa('(function thread(self) {\n const MAXMEM = 32767;\n let instance;\n let memory;\n\n if (self) {\n self.onmessage = function(e) {\n let data;\n if (e.data) {\n data = e.data;\n } else {\n data = e;\n }\n\n if (data[0].cmd == "INIT") {\n init(data[0]).then(function() {\n self.postMessage(data.result);\n });\n } else if (data[0].cmd == "TERMINATE") {\n self.close();\n } else {\n const res = runTask(data);\n self.postMessage(res);\n }\n };\n }\n\n async function init(data) {\n const code = new Uint8Array(data.code);\n const wasmModule = await WebAssembly.compile(code);\n memory = new WebAssembly.Memory({initial:data.init, maximum: MAXMEM});\n\n instance = await WebAssembly.instantiate(wasmModule, {\n env: {\n "memory": memory\n }\n });\n }\n\n\n\n function alloc(length) {\n const u32 = new Uint32Array(memory.buffer, 0, 1);\n while (u32[0] & 3) u32[0]++; // Return always aligned pointers\n const res = u32[0];\n u32[0] += length;\n if (u32[0] + length > memory.buffer.byteLength) {\n const currentPages = memory.buffer.byteLength / 0x10000;\n let requiredPages = Math.floor((u32[0] + length) / 0x10000)+1;\n if (requiredPages>MAXMEM) requiredPages=MAXMEM;\n memory.grow(requiredPages-currentPages);\n }\n return res;\n }\n\n function allocBuffer(buffer) {\n const p = alloc(buffer.byteLength);\n setBuffer(p, buffer);\n return p;\n }\n\n function getBuffer(pointer, length) {\n const u8 = new Uint8Array(memory.buffer);\n return new Uint8Array(u8.buffer, u8.byteOffset + pointer, length);\n }\n\n function setBuffer(pointer, buffer) {\n const u8 = new Uint8Array(memory.buffer);\n u8.set(new Uint8Array(buffer), pointer);\n }\n\n function runTask(task) {\n if (task[0].cmd == "INIT") {\n return init(task[0]);\n }\n const ctx = {\n vars: [],\n out: []\n };\n const u32a = new Uint32Array(memory.buffer, 0, 1);\n const oldAlloc = u32a[0];\n for (let i=0; i0;e++)if(0==this.working[e]){const a=this.actionQueue.shift();this.postAction(e,a.data,a.transfers,a.deferred)}}queueAction(e,a){const t=new Ma;if(this.singleThread){const a=this.taskManager(e);t.resolve(a)}else this.actionQueue.push({data:e,transfers:a,deferred:t}),this.processWorks();return t.promise}resetMemory(){this.u32[0]=this.initalPFree}allocBuff(e){const a=this.alloc(e.byteLength);return this.setBuff(a,e),a}getBuff(e,a){return this.u8.slice(e,e+a)}setBuff(e,a){this.u8.set(new Uint8Array(a),e)}alloc(e){for(;3&this.u32[0];)this.u32[0]++;const a=this.u32[0];return this.u32[0]+=e,a}async terminate(){for(let e=0;esetTimeout(e,200)))}}function Sa(e,a){const t=e[a],c=e.Fr,f=e.tm;e[a].batchApplyKey=async function(e,d,r,n,i){let b,o,s,l,u;if(n=n||"affine",i=i||"affine","G1"==a)"jacobian"==n?(s=3*t.F.n8,b="g1m_batchApplyKey"):(s=2*t.F.n8,b="g1m_batchApplyKeyMixed"),l=3*t.F.n8,"jacobian"==i?u=3*t.F.n8:(o="g1m_batchToAffine",u=2*t.F.n8);else if("G2"==a)"jacobian"==n?(s=3*t.F.n8,b="g2m_batchApplyKey"):(s=2*t.F.n8,b="g2m_batchApplyKeyMixed"),l=3*t.F.n8,"jacobian"==i?u=3*t.F.n8:(o="g2m_batchToAffine",u=2*t.F.n8);else{if("Fr"!=a)throw new Error("Invalid group: "+a);b="frm_batchApplyKey",s=t.n8,l=t.n8,u=t.n8}const h=Math.floor(e.byteLength/s),p=Math.floor(h/f.concurrency),g=[];r=c.e(r);let m=c.e(d);for(let a=0;a=0;e--){if(!t.isZero(p))for(let e=0;eb&&(p=b),p<1024&&(p=1024);const g=[];for(let a=0;a(n&&n.debug(`Multiexp end: ${i}: ${a}/${s}`),e))))}const m=await Promise.all(g);let x=t.zero;for(let e=m.length-1;e>=0;e--)x=t.add(x,m[e]);return x}t.multiExp=async function(e,a,t,c){return await d(e,a,"jacobian",t,c)},t.multiExpAffine=async function(e,a,t,c){return await d(e,a,"affine",t,c)}}function Pa(e,a){const t=e[a],c=e.Fr,f=t.tm;async function d(e,n,i,b,o,s){let l,u,h,p,g,m,x,y;i=i||"affine",b=b||"affine","G1"==a?("affine"==i?(l=2*t.F.n8,p="g1m_batchToJacobian"):l=3*t.F.n8,u=3*t.F.n8,n&&(y="g1m_fftFinal"),x="g1m_fftJoin",m="g1m_fftMix","affine"==b?(h=2*t.F.n8,g="g1m_batchToAffine"):h=3*t.F.n8):"G2"==a?("affine"==i?(l=2*t.F.n8,p="g2m_batchToJacobian"):l=3*t.F.n8,u=3*t.F.n8,n&&(y="g2m_fftFinal"),x="g2m_fftJoin",m="g2m_fftMix","affine"==b?(h=2*t.F.n8,g="g2m_batchToAffine"):h=3*t.F.n8):"Fr"==a&&(l=t.n8,u=t.n8,h=t.n8,n&&(y="frm_fftFinal"),m="frm_fftMix",x="frm_fftJoin");let A=!1;Array.isArray(e)?(e=pa(e,l),A=!0):e=e.slice(0,e.byteLength);const v=e.byteLength/l,w=ua(v);if(1<1<<28?new ya(2*s[0].byteLength):new Uint8Array(2*s[0].byteLength),l.set(s[0]),l.set(s[1],s[0].byteLength),l}(e,i,b,o,s):await async function(e,a,t,f,n){let i,b;i=e.slice(0,e.byteLength/2),b=e.slice(e.byteLength/2,e.byteLength);const o=[];[i,b]=await r(i,b,"fftJoinExt",c.one,c.shift,a,"jacobian",f,n),o.push(d(i,!1,"jacobian",t,f,n)),o.push(d(b,!1,"jacobian",t,f,n));const s=await Promise.all(o);let l;return l=s[0].byteLength>1<<28?new ya(2*s[0].byteLength):new Uint8Array(2*s[0].byteLength),l.set(s[0]),l.set(s[1],s[0].byteLength),l}(e,i,b,o,s),A?ga(a,h):a}let _,I,E;n&&(_=c.inv(c.e(v))),ha(e,l);let C=Math.min(16384,v),M=v/C;for(;M=16;)M*=2,C/=2;const B=ua(C),L=[];for(let a=0;a(o&&o.debug(`${s}: fft ${w} mix end: ${a}/${M}`),e))))}E=await Promise.all(L);for(let e=0;e(o&&o.debug(`${s}: fft ${w} join ${e}/${w} ${r+1}/${a} ${n}/${t/2}`),c))))}const r=await Promise.all(d);for(let e=0;e0;a--)I.set(E[a],e),e+=C*h,delete E[a];I.set(E[0].slice(0,(C-1)*h),e),delete E[0]}else for(let e=0;e65536&&(A=65536);const v=[];for(let a=0;a(s&&s.debug(`${l}: fftJoinExt End: ${a}/${y}`),e))))}const w=await Promise.all(v);let _,I;y*g>1<<28?(_=new ya(y*g),I=new ya(y*g)):(_=new Uint8Array(y*g),I=new Uint8Array(y*g));let E=0;for(let e=0;ec.s+1)throw i&&i.error("lagrangeEvaluations input too big"),new Error("lagrangeEvaluations input too big");let u=e.slice(0,e.byteLength/2),h=e.slice(e.byteLength/2,e.byteLength);const p=c.exp(c.shift,s/2),g=c.inv(c.sub(c.one,p));[u,h]=await r(u,h,"prepareLagrangeEvaluation",g,c.shiftInv,f,"jacobian",i,b+" prep");const m=[];let x;return m.push(d(u,!0,"jacobian",n,i,b+" t0")),m.push(d(h,!0,"jacobian",n,i,b+" t1")),[u,h]=await Promise.all(m),x=u.byteLength>1<<28?new ya(2*u.byteLength):new Uint8Array(2*u.byteLength),x.set(u),x.set(h,u.byteLength),x},t.fftMix=async function(e){const d=3*t.F.n8;let r,n;if("G1"==a)r="g1m_fftMix",n="g1m_fftJoin";else if("G2"==a)r="g2m_fftMix",n="g2m_fftJoin";else{if("Fr"!=a)throw new Error("Invalid group");r="frm_fftMix",n="frm_fftJoin"}const i=Math.floor(e.byteLength/d),b=ua(i);let o=1<=0;e--)u.set(l[e][0],h),h+=l[e][0].byteLength;return u}}async function Ra(e){const a=await async function(e,a){const t=new La;t.memory=new WebAssembly.Memory({initial:Ca}),t.u8=new Uint8Array(t.memory.buffer),t.u32=new Uint32Array(t.memory.buffer);const c=await WebAssembly.compile(e.code);if(t.instance=await WebAssembly.instantiate(c,{env:{memory:t.memory}}),t.singleThread=a,t.initalPFree=t.u32[0],t.pq=e.pq,t.pr=e.pr,t.pG1gen=e.pG1gen,t.pG1zero=e.pG1zero,t.pG2gen=e.pG2gen,t.pG2zero=e.pG2zero,t.pOneT=e.pOneT,a)t.code=e.code,t.taskManager=function(){const e=32767;let a,t;async function c(c){const f=new Uint8Array(c.code),d=await WebAssembly.compile(f);t=new WebAssembly.Memory({initial:c.init,maximum:e}),a=await WebAssembly.instantiate(d,{env:{memory:t}})}function f(a){const c=new Uint32Array(t.buffer,0,1);for(;3&c[0];)c[0]++;const f=c[0];if(c[0]+=a,c[0]+a>t.buffer.byteLength){const f=t.buffer.byteLength/65536;let d=Math.floor((c[0]+a)/65536)+1;d>e&&(d=e),t.grow(d-f)}return f}function d(e){const a=f(e.byteLength);return n(a,e),a}function r(e,a){const c=new Uint8Array(t.buffer);return new Uint8Array(c.buffer,c.byteOffset+e,a)}function n(e,a){new Uint8Array(t.buffer).set(new Uint8Array(a),e)}function i(e){if("INIT"==e[0].cmd)return c(e[0]);const i={vars:[],out:[]},b=new Uint32Array(t.buffer,0,1)[0];for(let t=0;t64&&(a=64),t.concurrency=a;for(let e=0;e>8n&0xFFn)),a.push(Number(t>>16n&0xFFn)),a.push(Number(t>>24n&0xFFn)),a}function Qa(e){const a=function(e){for(var a=[],t=0;t>6,128|63&c):c<55296||c>=57344?a.push(224|c>>12,128|c>>6&63,128|63&c):(t++,c=65536+((1023&c)<<10|1023&e.charCodeAt(t)),a.push(240|c>>18,128|c>>12&63,128|c>>6&63,128|63&c))}return a}(e);return[...qa(a.length),...a]}function Ua(e){const a=[];let t=Oa(e);if(Da(t))throw new Error("Number cannot be negative");for(;!Ta(t);)a.push(Number(0x7Fn&t)),t>>=7n;0==a.length&&a.push(0);for(let e=0;e0xFFFFFFFFn)throw new Error("Number too big");if(a>0x7FFFFFFFn&&(a-=0x100000000n),a<-2147483648n)throw new Error("Number too small");return ja(a)}function $a(e){let a=Oa(e);if(a>0xFFFFFFFFFFFFFFFFn)throw new Error("Number too big");if(a>0x7FFFFFFFFFFFFFFFn&&(a-=0x10000000000000000n),a<-9223372036854775808n)throw new Error("Number too small");return ja(a)}function qa(e){let a=Oa(e);if(a>0xFFFFFFFFn)throw new Error("Number too big");return Ua(a)}function Ga(e){return Array.from(e,(function(e){return("0"+(255&e).toString(16)).slice(-2)})).join("")}class za{constructor(e){this.func=e,this.functionName=e.functionName,this.module=e.module}setLocal(e,a){const t=this.func.localIdxByName[e];if(void 0===t)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[...a,33,...qa(t)]}teeLocal(e,a){const t=this.func.localIdxByName[e];if(void 0===t)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[...a,34,...qa(t)]}getLocal(e){const a=this.func.localIdxByName[e];if(void 0===a)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[32,...qa(a)]}i64_load8_s(e,a,t){return[...e,48,void 0===t?0:t,...qa(a||0)]}i64_load8_u(e,a,t){return[...e,49,void 0===t?0:t,...qa(a||0)]}i64_load16_s(e,a,t){return[...e,50,void 0===t?1:t,...qa(a||0)]}i64_load16_u(e,a,t){return[...e,51,void 0===t?1:t,...qa(a||0)]}i64_load32_s(e,a,t){return[...e,52,void 0===t?2:t,...qa(a||0)]}i64_load32_u(e,a,t){return[...e,53,void 0===t?2:t,...qa(a||0)]}i64_load(e,a,t){return[...e,41,void 0===t?3:t,...qa(a||0)]}i64_store(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=3,r=a):Array.isArray(t)?(f=a,d=3,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,55,d,...qa(f)]}i64_store32(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=2,r=a):Array.isArray(t)?(f=a,d=2,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,62,d,...qa(f)]}i64_store16(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=1,r=a):Array.isArray(t)?(f=a,d=1,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,61,d,...qa(f)]}i64_store8(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=0,r=a):Array.isArray(t)?(f=a,d=0,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,60,d,...qa(f)]}i32_load8_s(e,a,t){return[...e,44,void 0===t?0:t,...qa(a||0)]}i32_load8_u(e,a,t){return[...e,45,void 0===t?0:t,...qa(a||0)]}i32_load16_s(e,a,t){return[...e,46,void 0===t?1:t,...qa(a||0)]}i32_load16_u(e,a,t){return[...e,47,void 0===t?1:t,...qa(a||0)]}i32_load(e,a,t){return[...e,40,void 0===t?2:t,...qa(a||0)]}i32_store(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=2,r=a):Array.isArray(t)?(f=a,d=2,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,54,d,...qa(f)]}i32_store16(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=1,r=a):Array.isArray(t)?(f=a,d=1,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,59,d,...qa(f)]}i32_store8(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=0,r=a):Array.isArray(t)?(f=a,d=0,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,58,d,...qa(f)]}call(e,...a){const t=this.module.functionIdxByName[e];if(void 0===t)throw new Error(`Function not defined: Function: ${e}`);return[...[].concat(...a),16,...qa(t)]}call_indirect(e,...a){return[...[].concat(...a),...e,17,0,0]}if(e,a,t){return t?[...e,4,64,...a,5,...t,11]:[...e,4,64,...a,11]}block(e){return[2,64,...e,11]}loop(...e){return[3,64,...[].concat(...e),11]}br_if(e,a){return[...a,13,...qa(e)]}br(e){return[12,...qa(e)]}ret(e){return[...e,15]}drop(e){return[...e,26]}i64_const(e){return[66,...$a(e)]}i32_const(e){return[65,...Ha(e)]}i64_eqz(e){return[...e,80]}i64_eq(e,a){return[...e,...a,81]}i64_ne(e,a){return[...e,...a,82]}i64_lt_s(e,a){return[...e,...a,83]}i64_lt_u(e,a){return[...e,...a,84]}i64_gt_s(e,a){return[...e,...a,85]}i64_gt_u(e,a){return[...e,...a,86]}i64_le_s(e,a){return[...e,...a,87]}i64_le_u(e,a){return[...e,...a,88]}i64_ge_s(e,a){return[...e,...a,89]}i64_ge_u(e,a){return[...e,...a,90]}i64_add(e,a){return[...e,...a,124]}i64_sub(e,a){return[...e,...a,125]}i64_mul(e,a){return[...e,...a,126]}i64_div_s(e,a){return[...e,...a,127]}i64_div_u(e,a){return[...e,...a,128]}i64_rem_s(e,a){return[...e,...a,129]}i64_rem_u(e,a){return[...e,...a,130]}i64_and(e,a){return[...e,...a,131]}i64_or(e,a){return[...e,...a,132]}i64_xor(e,a){return[...e,...a,133]}i64_shl(e,a){return[...e,...a,134]}i64_shr_s(e,a){return[...e,...a,135]}i64_shr_u(e,a){return[...e,...a,136]}i64_extend_i32_s(e){return[...e,172]}i64_extend_i32_u(e){return[...e,173]}i64_clz(e){return[...e,121]}i64_ctz(e){return[...e,122]}i32_eqz(e){return[...e,69]}i32_eq(e,a){return[...e,...a,70]}i32_ne(e,a){return[...e,...a,71]}i32_lt_s(e,a){return[...e,...a,72]}i32_lt_u(e,a){return[...e,...a,73]}i32_gt_s(e,a){return[...e,...a,74]}i32_gt_u(e,a){return[...e,...a,75]}i32_le_s(e,a){return[...e,...a,76]}i32_le_u(e,a){return[...e,...a,77]}i32_ge_s(e,a){return[...e,...a,78]}i32_ge_u(e,a){return[...e,...a,79]}i32_add(e,a){return[...e,...a,106]}i32_sub(e,a){return[...e,...a,107]}i32_mul(e,a){return[...e,...a,108]}i32_div_s(e,a){return[...e,...a,109]}i32_div_u(e,a){return[...e,...a,110]}i32_rem_s(e,a){return[...e,...a,111]}i32_rem_u(e,a){return[...e,...a,112]}i32_and(e,a){return[...e,...a,113]}i32_or(e,a){return[...e,...a,114]}i32_xor(e,a){return[...e,...a,115]}i32_shl(e,a){return[...e,...a,116]}i32_shr_s(e,a){return[...e,...a,117]}i32_shr_u(e,a){return[...e,...a,118]}i32_rotl(e,a){return[...e,...a,119]}i32_rotr(e,a){return[...e,...a,120]}i32_wrap_i64(e){return[...e,167]}i32_clz(e){return[...e,103]}i32_ctz(e){return[...e,104]}unreachable(){return[0]}current_memory(){return[63,0]}comment(){return[]}}const Ka={i32:127,i64:126,f32:125,f64:124,anyfunc:112,func:96,emptyblock:64};class Va{constructor(e,a,t,c,f){if("import"==t)this.fnType="import",this.moduleName=c,this.fieldName=f;else{if("internal"!=t)throw new Error("Invalid function fnType: "+t);this.fnType="internal"}this.module=e,this.fnName=a,this.params=[],this.locals=[],this.localIdxByName={},this.code=[],this.returnType=null,this.nextLocal=0}addParam(e,a){if(this.localIdxByName[e])throw new Error(`param already exists. Function: ${this.fnName}, Param: ${e} `);const t=this.nextLocal++;this.localIdxByName[e]=t,this.params.push({type:a})}addLocal(e,a,t){const c=t||1;if(this.localIdxByName[e])throw new Error(`local already exists. Function: ${this.fnName}, Param: ${e} `);const f=this.nextLocal++;this.localIdxByName[e]=f,this.locals.push({type:a,length:c})}setReturnType(e){if(this.returnType)throw new Error(`returnType already defined. Function: ${this.fnName}`);this.returnType=e}getSignature(){return[96,...qa(this.params.length),...this.params.map((e=>Ka[e.type])),...this.returnType?[1,Ka[this.returnType]]:[0]]}getBody(){const e=this.locals.map((e=>[...qa(e.length),Ka[e.type]])),a=[...qa(this.locals.length),...[].concat(...e),...this.code,11];return[...qa(a.length),...a]}addCode(...e){this.code.push(...[].concat(...e))}getCodeBuilder(){return new za(this)}}class Za{constructor(){this.functions=[],this.functionIdxByName={},this.nImportFunctions=0,this.nInternalFunctions=0,this.memory={pagesSize:1,moduleName:"env",fieldName:"memory"},this.free=8,this.datas=[],this.modules={},this.exports=[],this.functionsTable=[]}build(){return this._setSignatures(),new Uint8Array([...Fa(1836278016),...Fa(1),...this._buildType(),...this._buildImport(),...this._buildFunctionDeclarations(),...this._buildFunctionsTable(),...this._buildExports(),...this._buildElements(),...this._buildCode(),...this._buildData()])}addFunction(e){if(void 0!==this.functionIdxByName[e])throw new Error(`Function already defined: ${e}`);const a=this.functions.length;return this.functionIdxByName[e]=a,this.functions.push(new Va(this,e,"internal")),this.nInternalFunctions++,this.functions[a]}addIimportFunction(e,a,t){if(void 0!==this.functionIdxByName[e])throw new Error(`Function already defined: ${e}`);if(this.functions.length>0&&"internal"==this.functions[this.functions.length-1].type)throw new Error(`Import functions must be declared before internal: ${e}`);let c=t||e;const f=this.functions.length;return this.functionIdxByName[e]=f,this.functions.push(new Va(this,e,"import",a,c)),this.nImportFunctions++,this.functions[f]}setMemory(e,a,t){this.memory={pagesSize:e,moduleName:a||"env",fieldName:t||"memory"}}exportFunction(e,a){const t=a||e;if(void 0===this.functionIdxByName[e])throw new Error(`Function not defined: ${e}`);const c=this.functionIdxByName[e];t!=e&&(this.functionIdxByName[t]=c),this.exports.push({exportName:t,idx:c})}addFunctionToTable(e){const a=this.functionIdxByName[e];this.functionsTable.push(a)}addData(e,a){this.datas.push({offset:e,bytes:a})}alloc(e,a){let t,c;(Array.isArray(e)||ArrayBuffer.isView(e))&&void 0===a?(t=e.length,c=e):(t=e,c=a),t=1+(t-1>>3)<<3;const f=this.free;return this.free+=t,c&&this.addData(f,c),f}allocString(e){const a=(new globalThis.TextEncoder).encode(e);return this.alloc([...a,0])}_setSignatures(){this.signatures=[];const e={};if(this.functionsTable.length>0){const a=this.functions[this.functionsTable[0]].getSignature();e["s_"+Ga(a)]=0,this.signatures.push(a)}for(let a=0;a=0)c=await async function(e,a){if(!e&&globalThis.curve_bn128)return globalThis.curve_bn128;const t=new Za;t.setMemory(25),na(t),a&&a(t);const c={};c.code=t.build(),c.pq=t.modules.f1m.pq,c.pr=t.modules.frm.pq,c.pG1gen=t.modules.bn128.pG1gen,c.pG1zero=t.modules.bn128.pG1zero,c.pG1b=t.modules.bn128.pG1b,c.pG2gen=t.modules.bn128.pG2gen,c.pG2zero=t.modules.bn128.pG2zero,c.pG2b=t.modules.bn128.pG2b,c.pOneT=t.modules.bn128.pOneT,c.prePSize=t.modules.bn128.prePSize,c.preQSize=t.modules.bn128.preQSize,c.n8q=32,c.n8r=32,c.q=t.modules.bn128.q,c.r=t.modules.bn128.r;const f={name:"bn128",wasm:c,q:d("21888242871839275222246405745257275088696311157297823662689037894645226208583"),r:d("21888242871839275222246405745257275088548364400416034343698204186575808495617"),n8q:32,n8r:32,cofactorG2:d("30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d",16),singleThread:!!e},r=await Ra(f);return r.terminate=async function(){f.singleThread||(globalThis.curve_bn128=null,await this.tm.terminate())},e||(globalThis.curve_bn128=r),r}(a,t);else{if(!(["BLS12381"].indexOf(f)>=0))throw new Error(`Curve not supported: ${e}`);c=await async function(e,a){if(!e&&globalThis.curve_bls12381)return globalThis.curve_bls12381;const t=new Za;t.setMemory(25),ia(t),a&&a(t);const c={};c.code=t.build(),c.pq=t.modules.f1m.pq,c.pr=t.modules.frm.pq,c.pG1gen=t.modules.bls12381.pG1gen,c.pG1zero=t.modules.bls12381.pG1zero,c.pG1b=t.modules.bls12381.pG1b,c.pG2gen=t.modules.bls12381.pG2gen,c.pG2zero=t.modules.bls12381.pG2zero,c.pG2b=t.modules.bls12381.pG2b,c.pOneT=t.modules.bls12381.pOneT,c.prePSize=t.modules.bls12381.prePSize,c.preQSize=t.modules.bls12381.preQSize,c.n8q=48,c.n8r=32,c.q=t.modules.bls12381.q,c.r=t.modules.bls12381.r;const f={name:"bls12381",wasm:c,q:d("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),r:d("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),n8q:48,n8r:32,cofactorG1:d("0x396c8c005555e1568c00aaab0000aaab",16),cofactorG2:d("0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5",16),singleThread:!!e},r=await Ra(f);return r.terminate=async function(){f.singleThread||(globalThis.curve_bls12381=null,await this.tm.terminate())},e||(globalThis.curve_bls12381=r),r}(a,t)}return c}globalThis.curve_bn128=null,globalThis.curve_bls12381=null,d("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),d("21888242871839275222246405745257275088548364400416034343698204186575808495617"),d("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),d("21888242871839275222246405745257275088696311157297823662689037894645226208583");const Wa=B,Ya=ma;class Xa{constructor(e){this.F=e,this.p=Wa.fromString("21888242871839275222246405745257275088548364400416034343698204186575808495617"),this.pm1d2=Wa.div(Wa.sub(this.p,Wa.e(1)),Wa.e(2)),this.Generator=[e.e("995203441582195749578291179787384436505546430278305826713579947235728471134"),e.e("5472060717959818805561601436314318772137091100104008585924551046643952123905")],this.Base8=[e.e("5299619240641551281634865583518297030282874472190772894086521144482721001553"),e.e("16950150798460657717958625567821834550301663161624707787222815936182638968203")],this.order=Wa.fromString("21888242871839275222246405745257275088614511777268538073601725287587578984328"),this.subOrder=Wa.shiftRight(this.order,3),this.A=e.e("168700"),this.D=e.e("168696")}addPoint(e,a){const t=this.F,c=[],f=t.mul(e[0],a[1]),d=t.mul(e[1],a[0]),r=t.mul(t.sub(e[1],t.mul(this.A,e[0])),t.add(a[0],a[1])),n=t.mul(f,d),i=t.mul(this.D,n);return c[0]=t.div(t.add(f,d),t.add(t.one,i)),c[1]=t.div(t.add(r,t.sub(t.mul(this.A,f),d)),t.sub(t.one,i)),c}mulPointEscalar(e,a){const t=this.F;let c=[t.e("0"),t.e("1")],f=a,d=e;for(;!Wa.isZero(f);)Wa.isOdd(f)&&(c=this.addPoint(c,d)),d=this.addPoint(d,d),f=Wa.shiftRight(f,1);return c}inSubgroup(e){const a=this.F;if(!this.inCurve(e))return!1;const t=this.mulPointEscalar(e,this.subOrder);return a.isZero(t[0])&&a.eq(t[1],a.one)}inCurve(e){const a=this.F,t=a.square(e[0]),c=a.square(e[1]);return!!a.eq(a.add(a.mul(this.A,t),c),a.add(a.one,a.mul(a.mul(t,c),this.D)))}packPoint(e){const a=this.F,t=new Uint8Array(32);a.toRprLE(t,0,e[1]);const c=a.toObject(e[0]);return Wa.gt(c,this.pm1d2)&&(t[31]=128|t[31]),t}unpackPoint(e){const a=this.F;let t=!1;const c=new Array(2);if(128&e[31]&&(t=!0,e[31]=127&e[31]),c[1]=a.fromRprLE(e,0),Wa.gt(a.toObject(c[1]),this.p))return null;const f=a.square(c[1]),d=a.div(a.sub(a.one,f),a.sub(this.A,a.mul(this.D,f))),r=a.exp(d,a.half);if(!a.eq(a.one,r))return null;let n=a.sqrt(d);return null==n?null:(t&&(n=a.neg(n)),c[0]=n,c)}}var et=t(72206),at=t(60654),tt=t(48287).Buffer;async function ct(){const e=await async function(){const e=await Ja("bn128",!0);return new Xa(e.Fr)}();return new ft(e)}class ft{constructor(e){this.babyJub=e,this.bases=[]}baseHash(e,a){return"blake"==e?at("blake256").update(a).digest():"blake2b"==e?tt.from(et(32).update(tt.from(a)).digest()):void 0}hash(e,a){(a=a||{}).baseHash=a.baseHash||"blake";const t=this.babyJub,c=this.buffer2bits(e),f=Math.floor((c.length-1)/200)+1;let d=[t.F.zero,t.F.one];for(let e=0;e>1,a[8*t+2]=(4&c)>>2,a[8*t+3]=(8&c)>>3,a[8*t+4]=(16&c)>>4,a[8*t+5]=(32&c)>>5,a[8*t+6]=(64&c)>>6,a[8*t+7]=(128&c)>>7}return a}}var dt=t(31176),rt=t.n(dt);let nt=!1,it=!1;const bt={debug:1,default:2,info:2,warning:3,error:4,off:5};let ot=bt.default,st=null;const lt=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((a=>{try{if("test"!=="test".normalize(a))throw new Error("bad normalize")}catch(t){e.push(a)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var ut,ht;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(ut||(ut={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(ht||(ht={}));const pt="0123456789abcdef";class gt{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,a){const t=e.toLowerCase();null==bt[t]&&this.throwArgumentError("invalid log level name","logLevel",e),ot>bt[t]||console.log.apply(console,a)}debug(...e){this._log(gt.levels.DEBUG,e)}info(...e){this._log(gt.levels.INFO,e)}warn(...e){this._log(gt.levels.WARNING,e)}makeError(e,a,t){if(it)return this.makeError("censored error",a,{});a||(a=gt.errors.UNKNOWN_ERROR),t||(t={});const c=[];Object.keys(t).forEach((e=>{const a=t[e];try{if(a instanceof Uint8Array){let t="";for(let e=0;e>4],t+=pt[15&a[e]];c.push(e+"=Uint8Array(0x"+t+")")}else c.push(e+"="+JSON.stringify(a))}catch(a){c.push(e+"="+JSON.stringify(t[e].toString()))}})),c.push(`code=${a}`),c.push(`version=${this.version}`);const f=e;let d="";switch(a){case ht.NUMERIC_FAULT:{d="NUMERIC_FAULT";const a=e;switch(a){case"overflow":case"underflow":case"division-by-zero":d+="-"+a;break;case"negative-power":case"negative-width":d+="-unsupported";break;case"unbound-bitwise-result":d+="-unbound-result"}break}case ht.CALL_EXCEPTION:case ht.INSUFFICIENT_FUNDS:case ht.MISSING_NEW:case ht.NONCE_EXPIRED:case ht.REPLACEMENT_UNDERPRICED:case ht.TRANSACTION_REPLACED:case ht.UNPREDICTABLE_GAS_LIMIT:d=a}d&&(e+=" [ See: https://links.ethers.org/v5-errors-"+d+" ]"),c.length&&(e+=" ("+c.join(", ")+")");const r=new Error(e);return r.reason=f,r.code=a,Object.keys(t).forEach((function(e){r[e]=t[e]})),r}throwError(e,a,t){throw this.makeError(e,a,t)}throwArgumentError(e,a,t){return this.throwError(e,gt.errors.INVALID_ARGUMENT,{argument:a,value:t})}assert(e,a,t,c){e||this.throwError(a,t,c)}assertArgument(e,a,t,c){e||this.throwArgumentError(a,t,c)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),lt&&this.throwError("platform missing String.prototype.normalize",gt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:lt})}checkSafeUint53(e,a){"number"==typeof e&&(null==a&&(a="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(a,gt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(a,gt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,a,t){t=t?": "+t:"",ea&&this.throwError("too many arguments"+t,gt.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:a})}checkNew(e,a){e!==Object&&null!=e||this.throwError("missing new",gt.errors.MISSING_NEW,{name:a.name})}checkAbstract(e,a){e===a?this.throwError("cannot instantiate abstract class "+JSON.stringify(a.name)+" directly; use a sub-class",gt.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",gt.errors.MISSING_NEW,{name:a.name})}static globalLogger(){return st||(st=new gt("logger/5.7.0")),st}static setCensorship(e,a){if(!e&&a&&this.globalLogger().throwError("cannot permanently disable censorship",gt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),nt){if(!e)return;this.globalLogger().throwError("error censorship permanent",gt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}it=!!e,nt=!!a}static setLogLevel(e){const a=bt[e.toLowerCase()];null!=a?ot=a:gt.globalLogger().warn("invalid log level - "+e)}static from(e){return new gt(e)}}gt.errors=ht,gt.levels=ut;const mt=new gt("bytes/5.7.0");function xt(e){return e.slice||(e.slice=function(){const a=Array.prototype.slice.call(arguments);return xt(new Uint8Array(Array.prototype.slice.apply(e,a)))}),e}function yt(e){return"number"==typeof e&&e==e&&e%1==0}function At(e,a){if(a||(a={}),"number"==typeof e){mt.checkSafeUint53(e,"invalid arrayify value");const a=[];for(;e;)a.unshift(255&e),e=parseInt(String(e/256));return 0===a.length&&a.push(0),xt(new Uint8Array(a))}if(a.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),function(e){return!!e.toHexString}(e)&&(e=e.toHexString()),function(e,a){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||a&&e.length!==2+2*a)}(e)){let t=e.substring(2);t.length%2&&("left"===a.hexPad?t="0"+t:"right"===a.hexPad?t+="0":mt.throwArgumentError("hex data is odd-length","value",e));const c=[];for(let e=0;e=256)return!1}return!0}(e)?xt(new Uint8Array(e)):mt.throwArgumentError("invalid arrayify value","value",e)}function vt(e){return"0x"+rt().keccak_256(At(e))}const wt=new gt("strings/5.7.0");var _t,It;function Et(e,a,t,c,f){if(e===It.BAD_PREFIX||e===It.UNEXPECTED_CONTINUE){let e=0;for(let c=a+1;c>6==2;c++)e++;return e}return e===It.OVERRUN?t.length-a-1:0}function Ct(e,a=_t.current){a!=_t.current&&(wt.checkNormalize(),e=e.normalize(a));let t=[];for(let a=0;a>6|192),t.push(63&c|128);else if(55296==(64512&c)){a++;const f=e.charCodeAt(a);if(a>=e.length||56320!=(64512&f))throw new Error("invalid utf-8 string");const d=65536+((1023&c)<<10)+(1023&f);t.push(d>>18|240),t.push(d>>12&63|128),t.push(d>>6&63|128),t.push(63&d|128)}else t.push(c>>12|224),t.push(c>>6&63|128),t.push(63&c|128)}return At(t)}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(_t||(_t={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(It||(It={})),Object.freeze({error:function(e,a,t,c,f){return wt.throwArgumentError(`invalid codepoint at offset ${a}; ${e}`,"bytes",t)},ignore:Et,replace:function(e,a,t,c,f){return e===It.OVERLONG?(c.push(f),0):(c.push(65533),Et(e,a,t))}});const Mt="mimcsponge";async function Bt(){const e=await Ja("bn128",!0);return new Lt(e.Fr)}class Lt{constructor(e){this.F=e,this.cts=this.getConstants(Mt,220)}getIV(e){const a=this.F;void 0===e&&(e=Mt);const t=vt(Ct(e+"_iv"));return Wa.e(t).mod(a.p)}getConstants(e,a){const t=this.F;void 0===e&&(e=Mt),void 0===a&&(a=220);const c=new Array(a);let f=vt(Ct(Mt));for(let e=1;e{"use strict";t.d(a,{r:()=>c});const c="6.13.2"},35273:(e,a,t)=>{"use strict";t.d(a,{y:()=>R});var c=t(57339),f=t(21228),d=t(30031),r=t(27033),n=t(19353);class i extends f.Ue{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,a){let t=n.V.dereference(a,"string");try{t=(0,d.b)(t)}catch(e){return this._throwError(e.message,a)}return e.writeValue(t)}decode(e){return(0,d.b)((0,r.up)(e.readValue(),20))}}var b=t(88081);class o extends f.Ue{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,a){return this.coder.encode(e,a)}decode(e){return this.coder.decode(e)}}function s(e,a,t){let d=[];if(Array.isArray(t))d=t;else if(t&&"object"==typeof t){let e={};d=a.map((a=>{const f=a.localName;return(0,c.vA)(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:a},value:t}),(0,c.vA)(!e[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:a},value:t}),e[f]=!0,t[f]}))}else(0,c.MR)(!1,"invalid tuple value","tuple",t);(0,c.MR)(a.length===d.length,"types/value length mismatch","tuple",t);let r=new f.AU,n=new f.AU,i=[];a.forEach(((e,a)=>{let t=d[a];if(e.dynamic){let a=n.length;e.encode(n,t);let c=r.writeUpdatableValue();i.push((e=>{c(e+a)}))}else e.encode(r,t)})),i.forEach((e=>{e(r.length)}));let b=e.appendWriter(r);return b+=e.appendWriter(n),b}function l(e,a){let t=[],d=[],r=e.subReader(0);return a.forEach((a=>{let f=null;if(a.dynamic){let t=e.readIndex(),d=r.subReader(t);try{f=a.decode(d)}catch(e){if((0,c.bJ)(e,"BUFFER_OVERRUN"))throw e;f=e,f.baseType=a.name,f.name=a.localName,f.type=a.type}}else try{f=a.decode(e)}catch(e){if((0,c.bJ)(e,"BUFFER_OVERRUN"))throw e;f=e,f.baseType=a.name,f.name=a.localName,f.type=a.type}if(null==f)throw new Error("investigate");t.push(f),d.push(a.localName||null)})),f.Q7.fromItems(t,d)}class u extends f.Ue{coder;length;constructor(e,a,t){super("array",e.type+"["+(a>=0?a:"")+"]",t,-1===a||e.dynamic),(0,b.n)(this,{coder:e,length:a})}defaultValue(){const e=this.coder.defaultValue(),a=[];for(let t=0;te||t<-(e+w))&&this._throwError("value out-of-bounds",a),t=(0,r.JJ)(t,8*f.Yx)}else(t(0,r.dK)(c,8*this.size))&&this._throwError("value out-of-bounds",a);return e.writeValue(t)}decode(e){let a=(0,r.dK)(e.readValue(),8*this.size);return this.signed&&(a=(0,r.ST)(a,8*this.size)),a}}var E=t(87303);class C extends g{constructor(e){super("string",e)}defaultValue(){return""}encode(e,a){return super.encode(e,(0,E.YW)(n.V.dereference(a,"string")))}decode(e){return(0,E._v)(super.decode(e))}}class M extends f.Ue{coders;constructor(e,a){let t=!1;const c=[];e.forEach((e=>{e.dynamic&&(t=!0),c.push(e.type)})),super("tuple","tuple("+c.join(",")+")",a,t),(0,b.n)(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach((a=>{e.push(a.defaultValue())}));const a=this.coders.reduce(((e,a)=>{const t=a.localName;return t&&(e[t]||(e[t]=0),e[t]++),e}),{});return this.coders.forEach(((t,c)=>{let f=t.localName;f&&1===a[f]&&("length"===f&&(f="_length"),null==e[f]&&(e[f]=e[c]))})),Object.freeze(e)}encode(e,a){const t=n.V.dereference(a,"tuple");return s(e,this.coders,t)}decode(e){return l(e,this.coders)}}var B=t(76124);const L=new Map;L.set(0,"GENERIC_PANIC"),L.set(1,"ASSERT_FALSE"),L.set(17,"OVERFLOW"),L.set(18,"DIVIDE_BY_ZERO"),L.set(33,"ENUM_RANGE_ERROR"),L.set(34,"BAD_STORAGE_DATA"),L.set(49,"STACK_UNDERFLOW"),L.set(50,"ARRAY_RANGE_ERROR"),L.set(65,"OUT_OF_MEMORY"),L.set(81,"UNINITIALIZED_FUNCTION_CALL");const S=new RegExp(/^bytes([0-9]*)$/),k=new RegExp(/^(u?int)([0-9]*)$/);let N=null,P=1024;class R{#Se(e){if(e.isArray())return new u(this.#Se(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new M(e.components.map((e=>this.#Se(e))),e.name);switch(e.baseType){case"address":return new i(e.name);case"bool":return new h(e.name);case"string":return new C(e.name);case"bytes":return new m(e.name);case"":return new A(e.name)}let a=e.type.match(k);if(a){let t=parseInt(a[2]||"256");return(0,c.MR)(0!==t&&t<=256&&t%8==0,"invalid "+a[1]+" bit length","param",e),new I(t/8,"int"===a[1],e.name)}if(a=e.type.match(S),a){let t=parseInt(a[1]);return(0,c.MR)(0!==t&&t<=32,"invalid bytes length","param",e),new x(t,e.name)}(0,c.MR)(!1,"invalid type","type",e.type)}getDefaultValue(e){const a=e.map((e=>this.#Se(B.aX.from(e))));return new M(a,"_").defaultValue()}encode(e,a){(0,c.dd)(a.length,e.length,"types/values length mismatch");const t=e.map((e=>this.#Se(B.aX.from(e)))),d=new M(t,"_"),r=new f.AU;return d.encode(r,a),r.data}decode(e,a,t){const c=e.map((e=>this.#Se(B.aX.from(e))));return new M(c,"_").decode(new f.mP(a,t,P))}static _setDefaultMaxInflation(e){(0,c.MR)("number"==typeof e&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),P=e}static defaultAbiCoder(){return null==N&&(N=new R),N}static getBuiltinCallException(e,a,t){return function(e,a,t,f){let r="missing revert data",n=null,i=null;if(t){r="execution reverted";const e=(0,p.q5)(t);if(t=(0,p.c$)(t),0===e.length)r+=" (no data present; likely require(false) occurred",n="require(false)";else if(e.length%32!=4)r+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===(0,p.c$)(e.slice(0,4)))try{n=f.decode(["string"],e.slice(4))[0],i={signature:"Error(string)",name:"Error",args:[n]},r+=`: ${JSON.stringify(n)}`}catch(e){r+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===(0,p.c$)(e.slice(0,4)))try{const a=Number(f.decode(["uint256"],e.slice(4))[0]);i={signature:"Panic(uint256)",name:"Panic",args:[a]},n=`Panic due to ${L.get(a)||"UNKNOWN"}(${a})`,r+=`: ${n}`}catch(e){r+=" (could not decode panic code)"}else r+=" (unknown custom error)"}const b={to:a.to?(0,d.b)(a.to):null,data:a.data||"0x"};return a.from&&(b.from=(0,d.b)(a.from)),(0,c.xz)(r,"CALL_EXCEPTION",{action:e,data:t,reason:n,transaction:b,invocation:null,revert:i})}(e,a,t,R.defaultAbiCoder())}}},21228:(e,a,t)=>{"use strict";t.d(a,{AU:()=>y,Q7:()=>g,Ue:()=>x,Yx:()=>n,mP:()=>A});var c=t(27033),f=t(57339),d=t(36212),r=t(88081);const n=32,i=new Uint8Array(n),b=["then"],o={},s=new WeakMap;function l(e){return s.get(e)}function u(e,a){s.set(e,a)}function h(e,a){const t=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw t.error=a,t}function p(e,a,t){return e.indexOf(null)>=0?a.map(((e,a)=>e instanceof g?p(l(e),e,t):e)):e.reduce(((e,c,f)=>{let d=a.getValue(c);return c in e||(t&&d instanceof g&&(d=p(l(d),d,t)),e[c]=d),e}),{})}class g extends Array{#ke;constructor(...e){const a=e[0];let t=e[1],f=(e[2]||[]).slice(),d=!0;a!==o&&(t=e,f=[],d=!1),super(t.length),t.forEach(((e,a)=>{this[a]=e}));const r=f.reduce(((e,a)=>("string"==typeof a&&e.set(a,(e.get(a)||0)+1),e)),new Map);if(u(this,Object.freeze(t.map(((e,a)=>{const t=f[a];return null!=t&&1===r.get(t)?t:null})))),this.#ke=[],null==this.#ke&&this.#ke,!d)return;Object.freeze(this);const n=new Proxy(this,{get:(e,a,t)=>{if("string"==typeof a){if(a.match(/^[0-9]+$/)){const t=(0,c.WZ)(a,"%index");if(t<0||t>=this.length)throw new RangeError("out of result range");const f=e[t];return f instanceof Error&&h(`index ${t}`,f),f}if(b.indexOf(a)>=0)return Reflect.get(e,a,t);const f=e[a];if(f instanceof Function)return function(...a){return f.apply(this===t?e:this,a)};if(!(a in e))return e.getValue.apply(this===t?e:this,[a])}return Reflect.get(e,a,t)}});return u(n,l(this)),n}toArray(e){const a=[];return this.forEach(((t,c)=>{t instanceof Error&&h(`index ${c}`,t),e&&t instanceof g&&(t=t.toArray(e)),a.push(t)})),a}toObject(e){const a=l(this);return a.reduce(((t,c,d)=>((0,f.vA)(null!=c,`value at index ${d} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),p(a,this,e))),{})}slice(e,a){null==e&&(e=0),e<0&&(e+=this.length)<0&&(e=0),null==a&&(a=this.length),a<0&&(a+=this.length)<0&&(a=0),a>this.length&&(a=this.length);const t=l(this),c=[],f=[];for(let d=e;d{this.#_e[e]=m(a)}}}class A{allowLoose;#_e;#Re;#Oe;#De;#Te;constructor(e,a,t){(0,r.n)(this,{allowLoose:!!a}),this.#_e=(0,d.Lm)(e),this.#Oe=0,this.#De=null,this.#Te=null!=t?t:1024,this.#Re=0}get data(){return(0,d.c$)(this.#_e)}get dataLength(){return this.#_e.length}get consumed(){return this.#Re}get bytes(){return new Uint8Array(this.#_e)}#Fe(e){if(this.#De)return this.#De.#Fe(e);this.#Oe+=e,(0,f.vA)(this.#Te<1||this.#Oe<=this.#Te*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#Te} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,d.Lm)(this.#_e),offset:this.#Re,length:e,info:{bytesRead:this.#Oe,dataLength:this.dataLength}})}#Qe(e,a,t){let c=Math.ceil(a/n)*n;return this.#Re+c>this.#_e.length&&(this.allowLoose&&t&&this.#Re+a<=this.#_e.length?c=a:(0,f.vA)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,d.Lm)(this.#_e),length:this.#_e.length,offset:this.#Re+c})),this.#_e.slice(this.#Re,this.#Re+c)}subReader(e){const a=new A(this.#_e.slice(this.#Re+e),this.allowLoose,this.#Te);return a.#De=this,a}readBytes(e,a){let t=this.#Qe(0,e,!!a);return this.#Fe(e),this.#Re+=t.length,t.slice(0,e)}readValue(){return(0,c.Dg)(this.readBytes(n))}readIndex(){return(0,c.Ro)(this.readBytes(n))}}},76124:(e,a,t)=>{"use strict";t.d(a,{FK:()=>$,Pw:()=>V,Zp:()=>K,aX:()=>H,bp:()=>z,hc:()=>J});var c=t(27033),f=t(57339),d=t(88081),r=t(38264);function n(e){const a=new Set;return e.forEach((e=>a.add(e))),Object.freeze(a)}const i=n("external public payable override".split(" ")),b="constant external internal payable private public pure view override",o=n(b.split(" ")),s="constructor error event fallback function receive struct",l=n(s.split(" ")),u="calldata memory storage payable indexed",h=n(u.split(" ")),p=n([s,u,"tuple returns",b].join(" ").split(" ")),g={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},m=new RegExp("^(\\s*)"),x=new RegExp("^([0-9]+)"),y=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),A=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),v=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class w{#Re;#Ue;get offset(){return this.#Re}get length(){return this.#Ue.length-this.#Re}constructor(e){this.#Re=0,this.#Ue=e.slice()}clone(){return new w(this.#Ue)}reset(){this.#Re=0}#je(e=0,a=0){return new w(this.#Ue.slice(e,a).map((a=>Object.freeze(Object.assign({},a,{match:a.match-e,linkBack:a.linkBack-e,linkNext:a.linkNext-e})))))}popKeyword(e){const a=this.peek();if("KEYWORD"!==a.type||!e.has(a.text))throw new Error(`expected keyword ${a.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const a=this.peek();throw new Error(`expected ${e}; got ${a.type} ${JSON.stringify(a.text)}`)}return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const a=this.#je(this.#Re+1,e.match+1);return this.#Re=e.match+1,a}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const a=[];for(;this.#Re=this.#Ue.length)throw new Error("out-of-bounds");return this.#Ue[this.#Re]}peekKeyword(e){const a=this.peekType("KEYWORD");return null!=a&&e.has(a)?a:null}peekType(e){if(0===this.length)return null;const a=this.peek();return a.type===e?a.text:null}pop(){const e=this.peek();return this.#Re++,e}toString(){const e=[];for(let a=this.#Re;a`}}function _(e){const a=[],t=a=>{const t=r0&&"NUMBER"===a[a.length-1].type){const t=a.pop().text;e=t+e,a[a.length-1].value=(0,c.WZ)(t)}if(0===a.length||"BRACKET"!==a[a.length-1].type)throw new Error("missing opening bracket");a[a.length-1].text+=e}}else if(i=n.match(y),i){if(b.text=i[1],r+=b.text.length,p.has(b.text)){b.type="KEYWORD";continue}if(b.text.match(v)){b.type="TYPE";continue}b.type="ID"}else{if(i=n.match(x),!i)throw new Error(`unexpected token ${JSON.stringify(n[0])} at position ${r}`);b.text=i[1],b.type="NUMBER",r+=b.text.length}}return new w(a.map((e=>Object.freeze(e))))}function I(e,a){let t=[];for(const c in a.keys())e.has(c)&&t.push(c);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function E(e,a){if(a.peekKeyword(l)){const t=a.pop().text;if(t!==e)throw new Error(`expected ${e}, got ${t}`)}return a.popType("ID")}function C(e,a){const t=new Set;for(;;){const c=e.peekType("KEYWORD");if(null==c||a&&!a.has(c))break;if(e.pop(),t.has(c))throw new Error(`duplicate keywords: ${JSON.stringify(c)}`);t.add(c)}return Object.freeze(t)}function M(e){let a=C(e,o);return I(a,n("constant payable nonpayable".split(" "))),I(a,n("pure view payable nonpayable".split(" "))),a.has("view")?"view":a.has("pure")?"pure":a.has("payable")?"payable":a.has("nonpayable")?"nonpayable":a.has("constant")?"view":"nonpayable"}function B(e,a){return e.popParams().map((e=>H.from(e,a)))}function L(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return(0,c.Ab)(e.pop().text);throw new Error("invalid gas")}return null}function S(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}const k=new RegExp(/^(.*)\[([0-9]*)\]$/);function N(e){const a=e.match(v);if((0,f.MR)(a,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(a[2]){const t=parseInt(a[2]);(0,f.MR)(0!==t&&t<=32,"invalid bytes length","type",e)}else if(a[3]){const t=parseInt(a[3]);(0,f.MR)(0!==t&&t<=256&&t%8==0,"invalid numeric width","type",e)}return e}const P={},R=Symbol.for("_ethers_internal"),O="_ParamTypeInternal",D="_ErrorInternal",T="_EventInternal",F="_ConstructorInternal",Q="_FallbackInternal",U="_FunctionInternal",j="_StructInternal";class H{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,a,t,c,r,n,i,b){if((0,f.gk)(e,P,"ParamType"),Object.defineProperty(this,R,{value:O}),n&&(n=Object.freeze(n.slice())),"array"===c){if(null==i||null==b)throw new Error("")}else if(null!=i||null!=b)throw new Error("");if("tuple"===c){if(null==n)throw new Error("")}else if(null!=n)throw new Error("");(0,d.n)(this,{name:a,type:t,baseType:c,indexed:r,components:n,arrayLength:i,arrayChildren:b})}format(e){if(null==e&&(e="sighash"),"json"===e){const a=this.name||"";if(this.isArray()){const e=JSON.parse(this.arrayChildren.format("json"));return e.name=a,e.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(e)}const t={type:"tuple"===this.baseType?"tuple":this.type,name:a};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.isTuple()&&(t.components=this.components.map((a=>JSON.parse(a.format(e))))),JSON.stringify(t)}let a="";return this.isArray()?(a+=this.arrayChildren.format(e),a+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?a+="("+this.components.map((a=>a.format(e))).join("full"===e?", ":",")+")":a+=this.type,"sighash"!==e&&(!0===this.indexed&&(a+=" indexed"),"full"===e&&this.name&&(a+=" "+this.name)),a}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,a){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const t=this;return e.map((e=>t.arrayChildren.walk(e,a)))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const t=this;return e.map(((e,c)=>t.components[c].walk(e,a)))}return a(this.type,e)}#He(e,a,t,c){if(this.isArray()){if(!Array.isArray(a))throw new Error("invalid array value");if(-1!==this.arrayLength&&a.length!==this.arrayLength)throw new Error("array is wrong length");const f=this.arrayChildren,d=a.slice();return d.forEach(((a,c)=>{f.#He(e,a,t,(e=>{d[c]=e}))})),void c(d)}if(this.isTuple()){const f=this.components;let d;if(Array.isArray(a))d=a.slice();else{if(null==a||"object"!=typeof a)throw new Error("invalid tuple value");d=f.map((e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in a))throw new Error(`missing value for component ${e.name}`);return a[e.name]}))}if(d.length!==this.components.length)throw new Error("array is wrong length");return d.forEach(((a,c)=>{f[c].#He(e,a,t,(e=>{d[c]=e}))})),void c(d)}const f=t(this.type,a);f.then?e.push(async function(){c(await f)}()):c(f)}async walkAsync(e,a){const t=[],c=[e];return this.#He(t,e,a,(e=>{c[0]=e})),t.length&&await Promise.all(t),c[0]}static from(e,a){if(H.isParamType(e))return e;if("string"==typeof e)try{return H.from(_(e),a)}catch(a){(0,f.MR)(!1,"invalid param type","obj",e)}else if(e instanceof w){let t="",c="",f=null;C(e,n(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",f=e.popParams().map((e=>H.from(e))),t=`tuple(${f.map((e=>e.format())).join(",")})`):(t=N(e.popType("TYPE")),c=t);let d=null,r=null;for(;e.length&&e.peekType("BRACKET");){const a=e.pop();d=new H(P,"",t,c,null,f,r,d),r=a.value,t+=a.text,c="array",f=null}let i=null;if(C(e,h).has("indexed")){if(!a)throw new Error("");i=!0}const b=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new H(P,b,t,c,i,f,r,d)}const t=e.name;(0,f.MR)(!t||"string"==typeof t&&t.match(A),"invalid name","obj.name",t);let c=e.indexed;null!=c&&((0,f.MR)(a,"parameter cannot be indexed","obj.indexed",e.indexed),c=!!c);let d=e.type,r=d.match(k);if(r){const a=parseInt(r[2]||"-1"),f=H.from({type:r[1],components:e.components});return new H(P,t||"",d,"array",c,null,a,f)}if("tuple"===d||d.startsWith("tuple(")||d.startsWith("(")){const a=null!=e.components?e.components.map((e=>H.from(e))):null;return new H(P,t||"",d,"tuple",c,a,null,null)}return d=N(e.type),new H(P,t||"",d,d,c,null,null,null)}static isParamType(e){return e&&e[R]===O}}class ${type;inputs;constructor(e,a,t){(0,f.gk)(e,P,"Fragment"),t=Object.freeze(t.slice()),(0,d.n)(this,{type:a,inputs:t})}static from(e){if("string"==typeof e){try{$.from(JSON.parse(e))}catch(e){}return $.from(_(e))}if(e instanceof w)switch(e.peekKeyword(l)){case"constructor":return V.from(e);case"error":return z.from(e);case"event":return K.from(e);case"fallback":case"receive":return Z.from(e);case"function":return J.from(e);case"struct":return W.from(e)}else if("object"==typeof e){switch(e.type){case"constructor":return V.from(e);case"error":return z.from(e);case"event":return K.from(e);case"fallback":case"receive":return Z.from(e);case"function":return J.from(e);case"struct":return W.from(e)}(0,f.vA)(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,f.MR)(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return V.isFragment(e)}static isError(e){return z.isFragment(e)}static isEvent(e){return K.isFragment(e)}static isFunction(e){return J.isFragment(e)}static isStruct(e){return W.isFragment(e)}}class q extends ${name;constructor(e,a,t,c){super(e,a,c),(0,f.MR)("string"==typeof t&&t.match(A),"invalid identifier","name",t),c=Object.freeze(c.slice()),(0,d.n)(this,{name:t})}}function G(e,a){return"("+a.map((a=>a.format(e))).join("full"===e?", ":",")+")"}class z extends q{constructor(e,a,t){super(e,"error",a,t),Object.defineProperty(this,R,{value:D})}get selector(){return(0,r.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((a=>JSON.parse(a.format(e))))});const a=[];return"sighash"!==e&&a.push("error"),a.push(this.name+G(e,this.inputs)),a.join(" ")}static from(e){if(z.isFragment(e))return e;if("string"==typeof e)return z.from(_(e));if(e instanceof w){const a=E("error",e),t=B(e);return S(e),new z(P,a,t)}return new z(P,e.name,e.inputs?e.inputs.map(H.from):[])}static isFragment(e){return e&&e[R]===D}}class K extends q{anonymous;constructor(e,a,t,c){super(e,"event",a,t),Object.defineProperty(this,R,{value:T}),(0,d.n)(this,{anonymous:c})}get topicHash(){return(0,r.id)(this.format("sighash"))}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((a=>JSON.parse(a.format(e))))});const a=[];return"sighash"!==e&&a.push("event"),a.push(this.name+G(e,this.inputs)),"sighash"!==e&&this.anonymous&&a.push("anonymous"),a.join(" ")}static getTopicHash(e,a){return a=(a||[]).map((e=>H.from(e))),new K(P,e,a,!1).topicHash}static from(e){if(K.isFragment(e))return e;if("string"==typeof e)try{return K.from(_(e))}catch(a){(0,f.MR)(!1,"invalid event fragment","obj",e)}else if(e instanceof w){const a=E("event",e),t=B(e,!0),c=!!C(e,n(["anonymous"])).has("anonymous");return S(e),new K(P,a,t,c)}return new K(P,e.name,e.inputs?e.inputs.map((e=>H.from(e,!0))):[],!!e.anonymous)}static isFragment(e){return e&&e[R]===T}}class V extends ${payable;gas;constructor(e,a,t,c,f){super(e,a,t),Object.defineProperty(this,R,{value:F}),(0,d.n)(this,{payable:c,gas:f})}format(e){if((0,f.vA)(null!=e&&"sighash"!==e,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===e)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((a=>JSON.parse(a.format(e))))});const a=[`constructor${G(e,this.inputs)}`];return this.payable&&a.push("payable"),null!=this.gas&&a.push(`@${this.gas.toString()}`),a.join(" ")}static from(e){if(V.isFragment(e))return e;if("string"==typeof e)try{return V.from(_(e))}catch(a){(0,f.MR)(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof w){C(e,n(["constructor"]));const a=B(e),t=!!C(e,i).has("payable"),c=L(e);return S(e),new V(P,"constructor",a,t,c)}return new V(P,"constructor",e.inputs?e.inputs.map(H.from):[],!!e.payable,null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[R]===F}}class Z extends ${payable;constructor(e,a,t){super(e,"fallback",a),Object.defineProperty(this,R,{value:Q}),(0,d.n)(this,{payable:t})}format(e){const a=0===this.inputs.length?"receive":"fallback";if("json"===e){const e=this.payable?"payable":"nonpayable";return JSON.stringify({type:a,stateMutability:e})}return`${a}()${this.payable?" payable":""}`}static from(e){if(Z.isFragment(e))return e;if("string"==typeof e)try{return Z.from(_(e))}catch(a){(0,f.MR)(!1,"invalid fallback fragment","obj",e)}else if(e instanceof w){const a=e.toString(),t=e.peekKeyword(n(["fallback","receive"]));if((0,f.MR)(t,"type must be fallback or receive","obj",a),"receive"===e.popKeyword(n(["fallback","receive"]))){const a=B(e);return(0,f.MR)(0===a.length,"receive cannot have arguments","obj.inputs",a),C(e,n(["payable"])),S(e),new Z(P,[],!0)}let c=B(e);c.length?(0,f.MR)(1===c.length&&"bytes"===c[0].type,"invalid fallback inputs","obj.inputs",c.map((e=>e.format("minimal"))).join(", ")):c=[H.from("bytes")];const d=M(e);if((0,f.MR)("nonpayable"===d||"payable"===d,"fallback cannot be constants","obj.stateMutability",d),C(e,n(["returns"])).has("returns")){const a=B(e);(0,f.MR)(1===a.length&&"bytes"===a[0].type,"invalid fallback outputs","obj.outputs",a.map((e=>e.format("minimal"))).join(", "))}return S(e),new Z(P,c,"payable"===d)}if("receive"===e.type)return new Z(P,[],!0);if("fallback"===e.type){const a=[H.from("bytes")],t="payable"===e.stateMutability;return new Z(P,a,t)}(0,f.MR)(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[R]===Q}}class J extends q{constant;outputs;stateMutability;payable;gas;constructor(e,a,t,c,f,r){super(e,"function",a,c),Object.defineProperty(this,R,{value:U}),f=Object.freeze(f.slice());const n="view"===t||"pure"===t,i="payable"===t;(0,d.n)(this,{constant:n,gas:r,outputs:f,payable:i,stateMutability:t})}get selector(){return(0,r.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((a=>JSON.parse(a.format(e)))),outputs:this.outputs.map((a=>JSON.parse(a.format(e))))});const a=[];return"sighash"!==e&&a.push("function"),a.push(this.name+G(e,this.inputs)),"sighash"!==e&&("nonpayable"!==this.stateMutability&&a.push(this.stateMutability),this.outputs&&this.outputs.length&&(a.push("returns"),a.push(G(e,this.outputs))),null!=this.gas&&a.push(`@${this.gas.toString()}`)),a.join(" ")}static getSelector(e,a){return a=(a||[]).map((e=>H.from(e))),new J(P,e,"view",a,[],null).selector}static from(e){if(J.isFragment(e))return e;if("string"==typeof e)try{return J.from(_(e))}catch(a){(0,f.MR)(!1,"invalid function fragment","obj",e)}else if(e instanceof w){const a=E("function",e),t=B(e),c=M(e);let f=[];C(e,n(["returns"])).has("returns")&&(f=B(e));const d=L(e);return S(e),new J(P,a,c,t,f,d)}let a=e.stateMutability;return null==a&&(a="payable","boolean"==typeof e.constant?(a="view",e.constant||(a="payable","boolean"!=typeof e.payable||e.payable||(a="nonpayable"))):"boolean"!=typeof e.payable||e.payable||(a="nonpayable")),new J(P,e.name,a,e.inputs?e.inputs.map(H.from):[],e.outputs?e.outputs.map(H.from):[],null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[R]===U}}class W extends q{constructor(e,a,t){super(e,"struct",a,t),Object.defineProperty(this,R,{value:j})}format(){throw new Error("@TODO")}static from(e){if("string"==typeof e)try{return W.from(_(e))}catch(a){(0,f.MR)(!1,"invalid struct fragment","obj",e)}else if(e instanceof w){const a=E("struct",e),t=B(e);return S(e),new W(P,a,t)}return new W(P,e.name,e.inputs?e.inputs.map(H.from):[])}static isFragment(e){return e&&e[R]===j}}},73622:(e,a,t)=>{"use strict";t.d(a,{KA:()=>y});var c=t(15539),f=t(38264),d=t(88081),r=t(57339),n=t(36212),i=t(27033),b=t(35273),o=t(21228),s=t(76124),l=t(19353);class u{fragment;name;signature;topic;args;constructor(e,a,t){const c=e.name,f=e.format();(0,d.n)(this,{fragment:e,name:c,signature:f,topic:a,args:t})}}class h{fragment;name;args;signature;selector;value;constructor(e,a,t,c){const f=e.name,r=e.format();(0,d.n)(this,{fragment:e,name:f,args:t,signature:r,selector:a,value:c})}}class p{fragment;name;args;signature;selector;constructor(e,a,t){const c=e.name,f=e.format();(0,d.n)(this,{fragment:e,name:c,args:t,signature:f,selector:a})}}class g{hash;_isIndexed;static isIndexed(e){return!(!e||!e._isIndexed)}constructor(e){(0,d.n)(this,{hash:e,_isIndexed:!0})}}const m={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},x={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let a="unknown panic code";return e>=0&&e<=255&&m[e.toString()]&&(a=m[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${a})`}}};class y{fragments;deploy;fallback;receive;#$e;#qe;#Ge;#ze;constructor(e){let a=[];a="string"==typeof e?JSON.parse(e):e,this.#Ge=new Map,this.#$e=new Map,this.#qe=new Map;const t=[];for(const e of a)try{t.push(s.FK.from(e))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(e)}:`,a.message)}(0,d.n)(this,{fragments:Object.freeze(t)});let c=null,f=!1;this.#ze=this.getAbiCoder(),this.fragments.forEach(((e,a)=>{let t;switch(e.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void(0,d.n)(this,{deploy:e});case"fallback":return void(0===e.inputs.length?f=!0:((0,r.MR)(!c||e.payable!==c.payable,"conflicting fallback fragments",`fragments[${a}]`,e),c=e,f=c.payable));case"function":t=this.#Ge;break;case"event":t=this.#qe;break;case"error":t=this.#$e;break;default:return}const n=e.format();t.has(n)||t.set(n,e)})),this.deploy||(0,d.n)(this,{deploy:s.Pw.from("constructor()")}),(0,d.n)(this,{fallback:c,receive:f})}format(e){const a=e?"minimal":"full";return this.fragments.map((e=>e.format(a)))}formatJson(){const e=this.fragments.map((e=>e.format("json")));return JSON.stringify(e.map((e=>JSON.parse(e))))}getAbiCoder(){return b.y.defaultAbiCoder()}#Ke(e,a,t){if((0,n.Lo)(e)){const a=e.toLowerCase();for(const e of this.#Ge.values())if(a===e.selector)return e;return null}if(-1===e.indexOf("(")){const c=[];for(const[a,t]of this.#Ge)a.split("(")[0]===e&&c.push(t);if(a){const e=a.length>0?a[a.length-1]:null;let t=a.length,f=!0;l.V.isTyped(e)&&"overrides"===e.type&&(f=!1,t--);for(let e=c.length-1;e>=0;e--){const a=c[e].inputs.length;a===t||f&&a===t-1||c.splice(e,1)}for(let e=c.length-1;e>=0;e--){const t=c[e].inputs;for(let f=0;f=t.length){if("overrides"===a[f].type)continue;c.splice(e,1);break}if(a[f].type!==t[f].baseType){c.splice(e,1);break}}}}if(1===c.length&&a&&a.length!==c[0].inputs.length){const e=a[a.length-1];(null==e||Array.isArray(e)||"object"!=typeof e)&&c.splice(0,1)}if(0===c.length)return null;if(c.length>1&&t){const a=c.map((e=>JSON.stringify(e.format()))).join(", ");(0,r.MR)(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return c[0]}return this.#Ge.get(s.hc.from(e).format())||null}getFunctionName(e){const a=this.#Ke(e,null,!1);return(0,r.MR)(a,"no matching function","key",e),a.name}hasFunction(e){return!!this.#Ke(e,null,!1)}getFunction(e,a){return this.#Ke(e,a||null,!0)}forEachFunction(e){const a=Array.from(this.#Ge.keys());a.sort(((e,a)=>e.localeCompare(a)));for(let t=0;t=0;e--)c[e].inputs.length=0;e--){const t=c[e].inputs;for(let f=0;f1&&t){const a=c.map((e=>JSON.stringify(e.format()))).join(", ");(0,r.MR)(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return c[0]}return this.#qe.get(s.Zp.from(e).format())||null}getEventName(e){const a=this.#Ve(e,null,!1);return(0,r.MR)(a,"no matching event","key",e),a.name}hasEvent(e){return!!this.#Ve(e,null,!1)}getEvent(e,a){return this.#Ve(e,a||null,!0)}forEachEvent(e){const a=Array.from(this.#qe.keys());a.sort(((e,a)=>e.localeCompare(a)));for(let t=0;t1){const t=a.map((e=>JSON.stringify(e.format()))).join(", ");(0,r.MR)(!1,`ambiguous error description (i.e. ${t})`,"name",e)}return a[0]}if("Error(string)"===(e=s.bp.from(e).format()))return s.bp.from("error Error(string)");if("Panic(uint256)"===e)return s.bp.from("error Panic(uint256)");return this.#$e.get(e)||null}forEachError(e){const a=Array.from(this.#$e.keys());a.sort(((e,a)=>e.localeCompare(a)));for(let t=0;t"string"===e.type?(0,f.id)(a):"bytes"===e.type?(0,c.S)((0,n.c$)(a)):("bool"===e.type&&"boolean"==typeof a?a=a?"0x01":"0x00":e.type.match(/^u?int/)?a=(0,i.up)(a):e.type.match(/^bytes/)?a=(0,n.X_)(a,32):"address"===e.type&&this.#ze.encode(["address"],[a]),(0,n.nx)((0,n.c$)(a),32));for(a.forEach(((a,c)=>{const f=e.inputs[c];f.indexed?null==a?t.push(null):"array"===f.baseType||"tuple"===f.baseType?(0,r.MR)(!1,"filtering with tuples or arrays not supported","contract."+f.name,a):Array.isArray(a)?t.push(a.map((e=>d(f,e)))):t.push(d(f,a)):(0,r.MR)(null==a,"cannot filter non-indexed parameters; must be null","contract."+f.name,a)}));t.length&&null===t[t.length-1];)t.pop();return t}encodeEventLog(e,a){if("string"==typeof e){const a=this.getEvent(e);(0,r.MR)(a,"unknown event","eventFragment",e),e=a}const t=[],d=[],n=[];return e.anonymous||t.push(e.topicHash),(0,r.MR)(a.length===e.inputs.length,"event arguments/values mismatch","values",a),e.inputs.forEach(((e,r)=>{const i=a[r];if(e.indexed)if("string"===e.type)t.push((0,f.id)(i));else if("bytes"===e.type)t.push((0,c.S)(i));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");t.push(this.#ze.encode([e.type],[i]))}else d.push(e),n.push(i)})),{data:this.#ze.encode(d,n),topics:t}}decodeEventLog(e,a,t){if("string"==typeof e){const a=this.getEvent(e);(0,r.MR)(a,"unknown event","eventFragment",e),e=a}if(null!=t&&!e.anonymous){const a=e.topicHash;(0,r.MR)((0,n.Lo)(t[0],32)&&t[0].toLowerCase()===a,"fragment/topic mismatch","topics[0]",t[0]),t=t.slice(1)}const c=[],f=[],d=[];e.inputs.forEach(((e,a)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(c.push(s.aX.from({type:"bytes32",name:e.name})),d.push(!0)):(c.push(e),d.push(!1)):(f.push(e),d.push(!1))}));const i=null!=t?this.#ze.decode(c,(0,n.xW)(t)):null,b=this.#ze.decode(f,a,!0),l=[],u=[];let h=0,p=0;return e.inputs.forEach(((e,a)=>{let t=null;if(e.indexed)if(null==i)t=new g(null);else if(d[a])t=new g(i[p++]);else try{t=i[p++]}catch(e){t=e}else try{t=b[h++]}catch(e){t=e}l.push(t),u.push(e.name||null)})),o.Q7.fromItems(l,u)}parseTransaction(e){const a=(0,n.q5)(e.data,"tx.data"),t=(0,i.Ab)(null!=e.value?e.value:0,"tx.value"),c=this.getFunction((0,n.c$)(a.slice(0,4)));if(!c)return null;const f=this.#ze.decode(c.inputs,a.slice(4));return new h(c,c.selector,f,t)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const a=this.getEvent(e.topics[0]);return!a||a.anonymous?null:new u(a,a.topicHash,this.decodeEventLog(a,e.data,e.topics))}parseError(e){const a=(0,n.c$)(e),t=this.getError((0,n.ZG)(a,0,4));if(!t)return null;const c=this.#ze.decode(t.inputs,(0,n.ZG)(a,4));return new p(t,t.selector,c)}static from(e){return e instanceof y?e:"string"==typeof e?new y(JSON.parse(e)):"function"==typeof e.formatJson?new y(e.formatJson()):"function"==typeof e.format?new y(e.format("json")):new y(e)}}},19353:(e,a,t)=>{"use strict";t.d(a,{V:()=>b});var c=t(57339),f=t(88081);const d={};function r(e,a){let t=!1;return a<0&&(t=!0,a*=-1),new b(d,`${t?"":"u"}int${a}`,e,{signed:t,width:a})}function n(e,a){return new b(d,`bytes${a||""}`,e,{size:a})}const i=Symbol.for("_ethers_typed");class b{type;value;#ee;_typedSymbol;constructor(e,a,t,r){null==r&&(r=null),(0,c.gk)(d,e,"Typed"),(0,f.n)(this,{_typedSymbol:i,type:a,value:t}),this.#ee=r,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map((e=>e.format())).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return this.#ee}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===this.#ee?-1:!1===this.#ee?this.value.length:null}static from(e,a){return new b(d,e,a)}static uint8(e){return r(e,8)}static uint16(e){return r(e,16)}static uint24(e){return r(e,24)}static uint32(e){return r(e,32)}static uint40(e){return r(e,40)}static uint48(e){return r(e,48)}static uint56(e){return r(e,56)}static uint64(e){return r(e,64)}static uint72(e){return r(e,72)}static uint80(e){return r(e,80)}static uint88(e){return r(e,88)}static uint96(e){return r(e,96)}static uint104(e){return r(e,104)}static uint112(e){return r(e,112)}static uint120(e){return r(e,120)}static uint128(e){return r(e,128)}static uint136(e){return r(e,136)}static uint144(e){return r(e,144)}static uint152(e){return r(e,152)}static uint160(e){return r(e,160)}static uint168(e){return r(e,168)}static uint176(e){return r(e,176)}static uint184(e){return r(e,184)}static uint192(e){return r(e,192)}static uint200(e){return r(e,200)}static uint208(e){return r(e,208)}static uint216(e){return r(e,216)}static uint224(e){return r(e,224)}static uint232(e){return r(e,232)}static uint240(e){return r(e,240)}static uint248(e){return r(e,248)}static uint256(e){return r(e,256)}static uint(e){return r(e,256)}static int8(e){return r(e,-8)}static int16(e){return r(e,-16)}static int24(e){return r(e,-24)}static int32(e){return r(e,-32)}static int40(e){return r(e,-40)}static int48(e){return r(e,-48)}static int56(e){return r(e,-56)}static int64(e){return r(e,-64)}static int72(e){return r(e,-72)}static int80(e){return r(e,-80)}static int88(e){return r(e,-88)}static int96(e){return r(e,-96)}static int104(e){return r(e,-104)}static int112(e){return r(e,-112)}static int120(e){return r(e,-120)}static int128(e){return r(e,-128)}static int136(e){return r(e,-136)}static int144(e){return r(e,-144)}static int152(e){return r(e,-152)}static int160(e){return r(e,-160)}static int168(e){return r(e,-168)}static int176(e){return r(e,-176)}static int184(e){return r(e,-184)}static int192(e){return r(e,-192)}static int200(e){return r(e,-200)}static int208(e){return r(e,-208)}static int216(e){return r(e,-216)}static int224(e){return r(e,-224)}static int232(e){return r(e,-232)}static int240(e){return r(e,-240)}static int248(e){return r(e,-248)}static int256(e){return r(e,-256)}static int(e){return r(e,-256)}static bytes1(e){return n(e,1)}static bytes2(e){return n(e,2)}static bytes3(e){return n(e,3)}static bytes4(e){return n(e,4)}static bytes5(e){return n(e,5)}static bytes6(e){return n(e,6)}static bytes7(e){return n(e,7)}static bytes8(e){return n(e,8)}static bytes9(e){return n(e,9)}static bytes10(e){return n(e,10)}static bytes11(e){return n(e,11)}static bytes12(e){return n(e,12)}static bytes13(e){return n(e,13)}static bytes14(e){return n(e,14)}static bytes15(e){return n(e,15)}static bytes16(e){return n(e,16)}static bytes17(e){return n(e,17)}static bytes18(e){return n(e,18)}static bytes19(e){return n(e,19)}static bytes20(e){return n(e,20)}static bytes21(e){return n(e,21)}static bytes22(e){return n(e,22)}static bytes23(e){return n(e,23)}static bytes24(e){return n(e,24)}static bytes25(e){return n(e,25)}static bytes26(e){return n(e,26)}static bytes27(e){return n(e,27)}static bytes28(e){return n(e,28)}static bytes29(e){return n(e,29)}static bytes30(e){return n(e,30)}static bytes31(e){return n(e,31)}static bytes32(e){return n(e,32)}static address(e){return new b(d,"address",e)}static bool(e){return new b(d,"bool",!!e)}static bytes(e){return new b(d,"bytes",e)}static string(e){return new b(d,"string",e)}static array(e,a){throw new Error("not implemented yet")}static tuple(e,a){throw new Error("not implemented yet")}static overrides(e){return new b(d,"overrides",Object.assign({},e))}static isTyped(e){return e&&"object"==typeof e&&"_typedSymbol"in e&&e._typedSymbol===i}static dereference(e,a){if(b.isTyped(e)){if(e.type!==a)throw new Error(`invalid type: expecetd ${a}, got ${e.type}`);return e.value}return e}}},30031:(e,a,t)=>{"use strict";t.d(a,{b:()=>l});var c=t(15539),f=t(36212),d=t(57339);const r=BigInt(0),n=BigInt(36);function i(e){const a=(e=e.toLowerCase()).substring(2).split(""),t=new Uint8Array(40);for(let e=0;e<40;e++)t[e]=a[e].charCodeAt(0);const d=(0,f.q5)((0,c.S)(t));for(let e=0;e<40;e+=2)d[e>>1]>>4>=8&&(a[e]=a[e].toUpperCase()),(15&d[e>>1])>=8&&(a[e+1]=a[e+1].toUpperCase());return"0x"+a.join("")}const b={};for(let e=0;e<10;e++)b[String(e)]=String(e);for(let e=0;e<26;e++)b[String.fromCharCode(65+e)]=String(10+e);const o=15;const s=function(){const e={};for(let a=0;a<36;a++)e["0123456789abcdefghijklmnopqrstuvwxyz"[a]]=BigInt(a);return e}();function l(e){if((0,d.MR)("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const a=i(e);return(0,d.MR)(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||a===e,"bad address checksum","address",e),a}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,d.MR)(e.substring(2,4)===function(e){let a=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>b[e])).join("");for(;a.length>=o;){let e=a.substring(0,o);a=parseInt(e,10)%97+a.substring(e.length)}let t=String(98-parseInt(a,10)%97);for(;t.length<2;)t="0"+t;return t}(e),"bad icap checksum","address",e);let a=function(e){e=e.toLowerCase();let a=r;for(let t=0;t{"use strict";t.d(a,{$C:()=>d,tG:()=>n});var c=t(57339),f=t(30031);function d(e){return e&&"function"==typeof e.getAddress}async function r(e,a){const t=await a;return null!=t&&"0x0000000000000000000000000000000000000000"!==t||((0,c.vA)("string"!=typeof e,"unconfigured name","UNCONFIGURED_NAME",{value:e}),(0,c.MR)(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),(0,f.b)(t)}function n(e,a){return"string"==typeof e?e.match(/^0x[0-9a-f]{40}$/i)?(0,f.b)(e):((0,c.vA)(null!=a,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),r(e,a.resolveName(e))):d(e)?r(e,e.getAddress()):e&&"function"==typeof e.then?r(e,e):void(0,c.MR)(!1,"unsupported addressable value","target",e)}},98982:(e,a,t)=>{"use strict";t.d(a,{j:()=>c});const c="0x0000000000000000000000000000000000000000"},24391:(e,a,t)=>{"use strict";t.d(a,{NZ:()=>Q});var c=t(19353),f=t(73622),d=t(41442),r=t(43948),n=t(88081),i=t(57339),b=t(27033),o=t(36212),s=t(99381);class l extends r.tG{interface;fragment;args;constructor(e,a,t){super(e,e.provider);const c=a.decodeEventLog(t,e.data,e.topics);(0,n.n)(this,{args:c,fragment:t,interface:a})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class u extends r.tG{error;constructor(e,a){super(e,e.provider),(0,n.n)(this,{error:a})}}class h extends r.z5{#Ze;constructor(e,a,t){super(t,a),this.#Ze=e}get logs(){return super.logs.map((e=>{const a=e.topics.length?this.#Ze.getEvent(e.topics[0]):null;if(a)try{return new l(e,this.#Ze,a)}catch(a){return new u(e,a)}return e}))}}class p extends r.uI{#Ze;constructor(e,a,t){super(t,a),this.#Ze=e}async wait(e,a){const t=await super.wait(e,a);return null==t?null:new h(this.#Ze,this.provider,t)}}class g extends s.z{log;constructor(e,a,t,c){super(e,a,t),(0,n.n)(this,{log:c})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class m extends g{constructor(e,a,t,c,f){super(e,a,t,new l(f,e.interface,c));const d=e.interface.decodeEventLog(c,this.log.data,this.log.topics);(0,n.n)(this,{args:d,fragment:c})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const x=BigInt(0);function y(e){return e&&"function"==typeof e.call}function A(e){return e&&"function"==typeof e.estimateGas}function v(e){return e&&"function"==typeof e.resolveName}function w(e){return e&&"function"==typeof e.sendTransaction}function _(e){if(null!=e){if(v(e))return e;if(e.provider)return e.provider}}class I{#H;fragment;constructor(e,a,t){if((0,n.n)(this,{fragment:a}),a.inputs.lengthnull==t[a]?null:e.walkAsync(t[a],((e,a)=>"address"===e?Array.isArray(a)?Promise.all(a.map((e=>(0,d.tG)(e,f)))):(0,d.tG)(a,f):a)))));return e.interface.encodeFilterTopics(a,c)}()}getTopicFilter(){return this.#H}}function E(e,a){return null==e?null:"function"==typeof e[a]?e:e.provider&&"function"==typeof e.provider[a]?e.provider:null}function C(e){return null==e?null:e.provider||null}async function M(e,a){const t=c.V.dereference(e,"overrides");(0,i.MR)("object"==typeof t,"invalid overrides parameter","overrides",e);const f=(0,r.VS)(t);return(0,i.MR)(null==f.to||(a||[]).indexOf("to")>=0,"cannot override to","overrides.to",f.to),(0,i.MR)(null==f.data||(a||[]).indexOf("data")>=0,"cannot override data","overrides.data",f.data),f.from&&(f.from=f.from),f}function B(e){const a=async function(a){const t=await M(a,["data"]);t.to=await e.getAddress(),t.from&&(t.from=await(0,d.tG)(t.from,_(e.runner)));const c=e.interface,f=(0,b.Ab)(t.value||x,"overrides.value")===x,r="0x"===(t.data||"0x");!c.fallback||c.fallback.payable||!c.receive||r||f||(0,i.MR)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),(0,i.MR)(c.fallback||r,"cannot send data to receive-only contract","overrides.data",t.data);const n=c.receive||c.fallback&&c.fallback.payable;return(0,i.MR)(n||f,"cannot send value to non-payable fallback","overrides.value",t.value),(0,i.MR)(c.fallback||r,"cannot send data to receive-only contract","overrides.data",t.data),t},t=async function(t){const c=e.runner;(0,i.vA)(w(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await c.sendTransaction(await a(t)),d=C(e.runner);return new p(e.interface,d,f)},c=async e=>await t(e);return(0,n.n)(c,{_contract:e,estimateGas:async function(t){const c=E(e.runner,"estimateGas");return(0,i.vA)(A(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await a(t))},populateTransaction:a,send:t,staticCall:async function(t){const c=E(e.runner,"call");(0,i.vA)(y(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await a(t);try{return await c.call(f)}catch(a){if((0,i.E)(a)&&a.data)throw e.interface.makeError(a.data,f);throw a}}}),c}const L=Symbol.for("_ethersInternal_contract"),S=new WeakMap;function k(e){return S.get(e[L])}async function N(e,a){let t,c=null;if(Array.isArray(a)){const c=function(a){if((0,o.Lo)(a,32))return a;const t=e.interface.getEvent(a);return(0,i.MR)(t,"unknown fragment","name",a),t.topicHash};t=a.map((e=>null==e?null:Array.isArray(e)?e.map(c):c(e)))}else"*"===a?t=[null]:"string"==typeof a?(0,o.Lo)(a,32)?t=[a]:(c=e.interface.getEvent(a),(0,i.MR)(c,"unknown fragment","event",a),t=[c.topicHash]):(f=a)&&"object"==typeof f&&"getTopicFilter"in f&&"function"==typeof f.getTopicFilter&&f.fragment?t=await a.getTopicFilter():"fragment"in a?(c=a.fragment,t=[c.topicHash]):(0,i.MR)(!1,"unknown event name","event",a);var f;return t=t.map((e=>{if(null==e)return null;if(Array.isArray(e)){const a=Array.from(new Set(e.map((e=>e.toLowerCase()))).values());return 1===a.length?a[0]:(a.sort(),a)}return e.toLowerCase()})),{fragment:c,tag:t.map((e=>null==e?"null":Array.isArray(e)?e.join("|"):e)).join("&"),topics:t}}async function P(e,a){const{subs:t}=k(e);return t.get((await N(e,a)).tag)||null}async function R(e,a,t){const c=C(e.runner);(0,i.vA)(c,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:a});const{fragment:f,tag:d,topics:r}=await N(e,t),{addr:n,subs:b}=k(e);let o=b.get(d);if(!o){const a={address:n||e,topics:r},i=a=>{let c=f;if(null==c)try{c=e.interface.getEvent(a.topics[0])}catch(e){}if(c){const d=c,r=f?e.interface.decodeEventLog(f,a.data,a.topics):[];D(e,t,r,(c=>new m(e,c,t,d,a)))}else D(e,t,[],(c=>new g(e,c,t,a)))};let s=[];o={tag:d,listeners:[],start:()=>{s.length||s.push(c.on(a,i))},stop:async()=>{if(0==s.length)return;let e=s;s=[],await Promise.all(e),c.off(a,i)}},b.set(d,o)}return o}let O=Promise.resolve();async function D(e,a,t,c){try{await O}catch(e){}const f=async function(e,a,t,c){await O;const f=await P(e,a);if(!f)return!1;const d=f.listeners.length;return f.listeners=f.listeners.filter((({listener:a,once:f})=>{const d=Array.from(t);c&&d.push(c(f?null:a));try{a.call(e,...d)}catch(e){}return!f})),0===f.listeners.length&&(f.stop(),k(e).subs.delete(f.tag)),d>0}(e,a,t,c);return O=f,await f}const T=["then"];class F{target;interface;runner;filters;[L];fallback;constructor(e,a,t,c){(0,i.MR)("string"==typeof e||(0,d.$C)(e),"invalid value for Contract target","target",e),null==t&&(t=null);const r=f.KA.from(a);let b;(0,n.n)(this,{target:e,runner:t,interface:r}),Object.defineProperty(this,L,{value:{}});let s=null,l=null;if(c){const e=C(t);l=new p(this.interface,e,c)}let u=new Map;if("string"==typeof e)if((0,o.Lo)(e))s=e,b=Promise.resolve(e);else{const a=E(t,"resolveName");if(!v(a))throw(0,i.xz)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});b=a.resolveName(e).then((a=>{if(null==a)throw(0,i.xz)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return k(this).addr=a,a}))}else b=e.getAddress().then((e=>{if(null==e)throw new Error("TODO");return k(this).addr=e,e}));var h;h={addrPromise:b,addr:s,deployTx:l,subs:u},S.set(this[L],h);const g=new Proxy({},{get:(e,a,t)=>{if("symbol"==typeof a||T.indexOf(a)>=0)return Reflect.get(e,a,t);try{return this.getEvent(a)}catch(e){if(!(0,i.bJ)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,a)=>T.indexOf(a)>=0?Reflect.has(e,a):Reflect.has(e,a)||this.interface.hasEvent(String(a))});return(0,n.n)(this,{filters:g}),(0,n.n)(this,{fallback:r.receive||r.fallback?B(this):null}),new Proxy(this,{get:(e,a,t)=>{if("symbol"==typeof a||a in e||T.indexOf(a)>=0)return Reflect.get(e,a,t);try{return e.getFunction(a)}catch(e){if(!(0,i.bJ)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,a)=>"symbol"==typeof a||a in e||T.indexOf(a)>=0?Reflect.has(e,a):e.interface.hasFunction(a)})}connect(e){return new F(this.target,this.interface,e)}attach(e){return new F(e,this.interface,this.runner)}async getAddress(){return await k(this).addrPromise}async getDeployedCode(){const e=C(this.runner);(0,i.vA)(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const a=await e.getCode(await this.getAddress());return"0x"===a?null:a}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(null!=await this.getDeployedCode())return this;const a=C(this.runner);return(0,i.vA)(null!=a,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise(((e,t)=>{const c=async()=>{try{if(null!=await this.getDeployedCode())return e(this);a.once("block",c)}catch(e){t(e)}};c()}))}deploymentTransaction(){return k(this).deployTx}getFunction(e){return"string"!=typeof e&&(e=e.format()),function(e,a){const t=function(...t){const c=e.interface.getFunction(a,t);return(0,i.vA)(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a,args:t}}),c},f=async function(...a){const f=t(...a);let r={};if(f.inputs.length+1===a.length&&(r=await M(a.pop()),r.from&&(r.from=await(0,d.tG)(r.from,_(e.runner)))),f.inputs.length!==a.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const i=await async function(e,a,t){const f=E(e,"resolveName"),r=v(f)?f:null;return await Promise.all(a.map(((e,a)=>e.walkAsync(t[a],((e,a)=>(a=c.V.dereference(a,e),"address"===e?(0,d.tG)(a,r):a))))))}(e.runner,f.inputs,a);return Object.assign({},r,await(0,n.k)({to:e.getAddress(),data:e.interface.encodeFunctionData(f,i)}))},r=async function(...e){const a=await o(...e);return 1===a.length?a[0]:a},b=async function(...a){const t=e.runner;(0,i.vA)(w(t),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await t.sendTransaction(await f(...a)),d=C(e.runner);return new p(e.interface,d,c)},o=async function(...a){const c=E(e.runner,"call");(0,i.vA)(y(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const d=await f(...a);let r="0x";try{r=await c.call(d)}catch(a){if((0,i.E)(a)&&a.data)throw e.interface.makeError(a.data,d);throw a}const n=t(...a);return e.interface.decodeFunctionResult(n,r)},s=async(...e)=>t(...e).constant?await r(...e):await b(...e);return(0,n.n)(s,{name:e.interface.getFunctionName(a),_contract:e,_key:a,getFragment:t,estimateGas:async function(...a){const t=E(e.runner,"estimateGas");return(0,i.vA)(A(t),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await t.estimateGas(await f(...a))},populateTransaction:f,send:b,staticCall:r,staticCallResult:o}),Object.defineProperty(s,"fragment",{configurable:!1,enumerable:!0,get:()=>{const t=e.interface.getFunction(a);return(0,i.vA)(t,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a}}),t}}),s}(this,e)}getEvent(e){return"string"!=typeof e&&(e=e.format()),function(e,a){const t=function(...t){const c=e.interface.getEvent(a,t);return(0,i.vA)(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a,args:t}}),c},c=function(...a){return new I(e,t(...a),a)};return(0,n.n)(c,{name:e.interface.getEventName(a),_contract:e,_key:a,getFragment:t}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const t=e.interface.getEvent(a);return(0,i.vA)(t,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a}}),t}}),c}(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,a,t){null==a&&(a=0),null==t&&(t="latest");const{addr:c,addrPromise:f}=k(this),d=c||await f,{fragment:n,topics:b}=await N(this,e),o={address:d,topics:b,fromBlock:a,toBlock:t},s=C(this.runner);return(0,i.vA)(s,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await s.getLogs(o)).map((e=>{let a=n;if(null==a)try{a=this.interface.getEvent(e.topics[0])}catch(e){}if(a)try{return new l(e,this.interface,a)}catch(a){return new u(e,a)}return new r.tG(e,s)}))}async on(e,a){const t=await R(this,"on",e);return t.listeners.push({listener:a,once:!1}),t.start(),this}async once(e,a){const t=await R(this,"once",e);return t.listeners.push({listener:a,once:!0}),t.start(),this}async emit(e,...a){return await D(this,e,a,null)}async listenerCount(e){if(e){const a=await P(this,e);return a?a.listeners.length:0}const{subs:a}=k(this);let t=0;for(const{listeners:e}of a.values())t+=e.length;return t}async listeners(e){if(e){const a=await P(this,e);return a?a.listeners.map((({listener:e})=>e)):[]}const{subs:a}=k(this);let t=[];for(const{listeners:e}of a.values())t=t.concat(e.map((({listener:e})=>e)));return t}async off(e,a){const t=await P(this,e);if(!t)return this;if(a){const e=t.listeners.map((({listener:e})=>e)).indexOf(a);e>=0&&t.listeners.splice(e,1)}return null!=a&&0!==t.listeners.length||(t.stop(),k(this).subs.delete(t.tag)),this}async removeAllListeners(e){if(e){const a=await P(this,e);if(!a)return this;a.stop(),k(this).subs.delete(a.tag)}else{const{subs:e}=k(this);for(const{tag:a,stop:t}of e.values())t(),e.delete(a)}return this}async addListener(e,a){return await this.on(e,a)}async removeListener(e,a){return await this.off(e,a)}static buildClass(e){return class extends F{constructor(a,t=null){super(a,e,t)}}}static from(e,a,t){return null==t&&(t=null),new this(e,a,t)}}class Q extends(function(){return F}()){}},8180:(e,a,t)=>{"use strict";t.d(a,{n1:()=>x,Gz:()=>y,T_:()=>A,po:()=>v});var c=t(4655),f=t(84877),d=t(3439),r=t(37171),n=t(86558),i=t(10750);const[b,o]=(()=>n.Ay.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),s=new Uint32Array(80),l=new Uint32Array(80);class u extends r.D{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:a,Bh:t,Bl:c,Ch:f,Cl:d,Dh:r,Dl:n,Eh:i,El:b,Fh:o,Fl:s,Gh:l,Gl:u,Hh:h,Hl:p}=this;return[e,a,t,c,f,d,r,n,i,b,o,s,l,u,h,p]}set(e,a,t,c,f,d,r,n,i,b,o,s,l,u,h,p){this.Ah=0|e,this.Al=0|a,this.Bh=0|t,this.Bl=0|c,this.Ch=0|f,this.Cl=0|d,this.Dh=0|r,this.Dl=0|n,this.Eh=0|i,this.El=0|b,this.Fh=0|o,this.Fl=0|s,this.Gh=0|l,this.Gl=0|u,this.Hh=0|h,this.Hl=0|p}process(e,a){for(let t=0;t<16;t++,a+=4)s[t]=e.getUint32(a),l[t]=e.getUint32(a+=4);for(let e=16;e<80;e++){const a=0|s[e-15],t=0|l[e-15],c=n.Ay.rotrSH(a,t,1)^n.Ay.rotrSH(a,t,8)^n.Ay.shrSH(a,t,7),f=n.Ay.rotrSL(a,t,1)^n.Ay.rotrSL(a,t,8)^n.Ay.shrSL(a,t,7),d=0|s[e-2],r=0|l[e-2],i=n.Ay.rotrSH(d,r,19)^n.Ay.rotrBH(d,r,61)^n.Ay.shrSH(d,r,6),b=n.Ay.rotrSL(d,r,19)^n.Ay.rotrBL(d,r,61)^n.Ay.shrSL(d,r,6),o=n.Ay.add4L(f,b,l[e-7],l[e-16]),u=n.Ay.add4H(o,c,i,s[e-7],s[e-16]);s[e]=0|u,l[e]=0|o}let{Ah:t,Al:c,Bh:f,Bl:d,Ch:r,Cl:i,Dh:u,Dl:h,Eh:p,El:g,Fh:m,Fl:x,Gh:y,Gl:A,Hh:v,Hl:w}=this;for(let e=0;e<80;e++){const a=n.Ay.rotrSH(p,g,14)^n.Ay.rotrSH(p,g,18)^n.Ay.rotrBH(p,g,41),_=n.Ay.rotrSL(p,g,14)^n.Ay.rotrSL(p,g,18)^n.Ay.rotrBL(p,g,41),I=p&m^~p&y,E=g&x^~g&A,C=n.Ay.add5L(w,_,E,o[e],l[e]),M=n.Ay.add5H(C,v,a,I,b[e],s[e]),B=0|C,L=n.Ay.rotrSH(t,c,28)^n.Ay.rotrBH(t,c,34)^n.Ay.rotrBH(t,c,39),S=n.Ay.rotrSL(t,c,28)^n.Ay.rotrBL(t,c,34)^n.Ay.rotrBL(t,c,39),k=t&f^t&r^f&r,N=c&d^c&i^d&i;v=0|y,w=0|A,y=0|m,A=0|x,m=0|p,x=0|g,({h:p,l:g}=n.Ay.add(0|u,0|h,0|M,0|B)),u=0|r,h=0|i,r=0|f,i=0|d,f=0|t,d=0|c;const P=n.Ay.add3L(B,S,N);t=n.Ay.add3H(P,M,L,k),c=0|P}({h:t,l:c}=n.Ay.add(0|this.Ah,0|this.Al,0|t,0|c)),({h:f,l:d}=n.Ay.add(0|this.Bh,0|this.Bl,0|f,0|d)),({h:r,l:i}=n.Ay.add(0|this.Ch,0|this.Cl,0|r,0|i)),({h:u,l:h}=n.Ay.add(0|this.Dh,0|this.Dl,0|u,0|h)),({h:p,l:g}=n.Ay.add(0|this.Eh,0|this.El,0|p,0|g)),({h:m,l:x}=n.Ay.add(0|this.Fh,0|this.Fl,0|m,0|x)),({h:y,l:A}=n.Ay.add(0|this.Gh,0|this.Gl,0|y,0|A)),({h:v,l:w}=n.Ay.add(0|this.Hh,0|this.Hl,0|v,0|w)),this.set(t,c,f,d,r,i,u,h,p,g,m,x,y,A,v,w)}roundClean(){s.fill(0),l.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const h=(0,i.ld)((()=>new u));var p=t(57339);const g=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}(),m=g.crypto||g.msCrypto;function x(e){switch(e){case"sha256":return d.s.create();case"sha512":return h.create()}(0,p.MR)(!1,"invalid hashing algorithm name","algorithm",e)}function y(e,a){const t={sha256:d.s,sha512:h}[e];return(0,p.MR)(null!=t,"invalid hmac algorithm","algorithm",e),c.w.create(t,a)}function A(e,a,t,c,r){const n={sha256:d.s,sha512:h}[r];return(0,p.MR)(null!=n,"invalid pbkdf2 algorithm","algorithm",r),(0,f.A)(n,e,a,{c:t,dkLen:c})}function v(e){(0,p.vA)(null!=m,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,p.MR)(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const a=new Uint8Array(e);return m.getRandomValues(a),a}},15539:(e,a,t)=>{"use strict";t.d(a,{S:()=>E});var c=t(27125),f=t(86558),d=t(10750);const[r,n,i]=[[],[],[]],b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(7),u=BigInt(256),h=BigInt(113);for(let e=0,a=o,t=1,c=0;e<24;e++){[t,c]=[c,(2*t+3*c)%5],r.push(2*(5*c+t)),n.push((e+1)*(e+2)/2%64);let f=b;for(let e=0;e<7;e++)a=(a<>l)*h)%u,a&s&&(f^=o<<(o<t>32?(0,f.WM)(e,a,t):(0,f.P5)(e,a,t),x=(e,a,t)=>t>32?(0,f.im)(e,a,t):(0,f.B4)(e,a,t);class y extends d.Vw{constructor(e,a,t,f=!1,r=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=t,this.enableXOF=f,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,c.ai)(t),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,d.DH)(this.state)}keccak(){!function(e,a=24){const t=new Uint32Array(10);for(let c=24-a;c<24;c++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const c=(a+8)%10,f=(a+2)%10,d=t[f],r=t[f+1],n=m(d,r,1)^t[c],i=x(d,r,1)^t[c+1];for(let t=0;t<50;t+=10)e[a+t]^=n,e[a+t+1]^=i}let a=e[2],f=e[3];for(let t=0;t<24;t++){const c=n[t],d=m(a,f,c),i=x(a,f,c),b=r[t];a=e[b],f=e[b+1],e[b]=d,e[b+1]=i}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)t[c]=e[a+c];for(let c=0;c<10;c++)e[a+c]^=~t[(c+2)%10]&t[(c+4)%10]}e[0]^=p[c],e[1]^=g[c]}t.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,c.t2)(this);const{blockLen:a,state:t}=this,f=(e=(0,d.ZJ)(e)).length;for(let c=0;c=t&&this.keccak();const d=Math.min(t-this.posOut,f-c);e.set(a.subarray(this.posOut,this.posOut+d),c),this.posOut+=d,c+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,c.ai)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,c.CG)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:t,outputLen:c,rounds:f,enableXOF:d}=this;return e||(e=new y(a,t,c,d,f)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=f,e.suffix=t,e.outputLen=c,e.enableXOF=d,e.destroyed=this.destroyed,e}}const A=((e,a,t)=>(0,d.ld)((()=>new y(a,e,t))))(1,136,32);var v=t(36212);let w=!1;const _=function(e){return A(e)};let I=_;function E(e){const a=(0,v.q5)(e,"data");return(0,v.c$)(I(a))}E._=_,E.lock=function(){w=!0},E.register=function(e){if(w)throw new TypeError("keccak256 is locked");I=e},Object.freeze(E)},68650:(e,a,t)=>{"use strict";t.d(a,{s:()=>s});var c=t(8180),f=t(36212);const d=function(e){return(0,c.n1)("sha256").update(e).digest()},r=function(e){return(0,c.n1)("sha512").update(e).digest()};let n=d,i=r,b=!1,o=!1;function s(e){const a=(0,f.q5)(e,"data");return(0,f.c$)(n(a))}function l(e){const a=(0,f.q5)(e,"data");return(0,f.c$)(i(a))}s._=d,s.lock=function(){b=!0},s.register=function(e){if(b)throw new Error("sha256 is locked");n=e},Object.freeze(s),l._=r,l.lock=function(){o=!0},l.register=function(e){if(o)throw new Error("sha512 is locked");i=e},Object.freeze(s)},20260:(e,a,t)=>{"use strict";t.d(a,{t:()=>p});const c="0x0000000000000000000000000000000000000000000000000000000000000000";var f=t(36212),d=t(27033),r=t(57339);const n=BigInt(0),i=BigInt(1),b=BigInt(2),o=BigInt(27),s=BigInt(28),l=BigInt(35),u={};function h(e){return(0,f.nx)((0,d.c4)(e),32)}class p{#Je;#We;#Ye;#Xe;get r(){return this.#Je}set r(e){(0,r.MR)(32===(0,f.pO)(e),"invalid r","value",e),this.#Je=(0,f.c$)(e)}get s(){return this.#We}set s(e){(0,r.MR)(32===(0,f.pO)(e),"invalid s","value",e);const a=(0,f.c$)(e);(0,r.MR)(parseInt(a.substring(0,3))<8,"non-canonical s","value",a),this.#We=a}get v(){return this.#Ye}set v(e){const a=(0,d.WZ)(e,"value");(0,r.MR)(27===a||28===a,"invalid v","v",e),this.#Ye=a}get networkV(){return this.#Xe}get legacyChainId(){const e=this.networkV;return null==e?null:p.getChainId(e)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=(0,f.q5)(this.s);return this.yParity&&(e[0]|=128),(0,f.c$)(e)}get compactSerialized(){return(0,f.xW)([this.r,this.yParityAndS])}get serialized(){return(0,f.xW)([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,a,t,c){(0,r.gk)(e,u,"Signature"),this.#Je=a,this.#We=t,this.#Ye=c,this.#Xe=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new p(u,this.r,this.s,this.v);return this.networkV&&(e.#Xe=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:null!=e?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const a=(0,d.Ab)(e,"v");return a==o||a==s?n:((0,r.MR)(a>=l,"invalid EIP-155 v","v",e),(a-l)/b)}static getChainIdV(e,a){return(0,d.Ab)(e)*b+BigInt(35+a-27)}static getNormalizedV(e){const a=(0,d.Ab)(e);return a===n||a===o?27:a===i||a===s?28:((0,r.MR)(a>=l,"invalid v","v",e),a&i?27:28)}static from(e){function a(a,t){(0,r.MR)(a,t,"signature",e)}if(null==e)return new p(u,c,c,27);if("string"==typeof e){const t=(0,f.q5)(e,"signature");if(64===t.length){const e=(0,f.c$)(t.slice(0,32)),a=t.slice(32,64),c=128&a[0]?28:27;return a[0]&=127,new p(u,e,(0,f.c$)(a),c)}if(65===t.length){const e=(0,f.c$)(t.slice(0,32)),c=t.slice(32,64);a(!(128&c[0]),"non-canonical s");const d=p.getNormalizedV(t[64]);return new p(u,e,(0,f.c$)(c),d)}a(!1,"invalid raw signature length")}if(e instanceof p)return e.clone();const t=e.r;a(null!=t,"missing r");const n=h(t),i=function(e,t){if(null!=e)return h(e);if(null!=t){a((0,f.Lo)(t,32),"invalid yParityAndS");const e=(0,f.q5)(t);return e[0]&=127,(0,f.c$)(e)}a(!1,"missing s")}(e.s,e.yParityAndS);a(!(128&(0,f.q5)(i)[0]),"non-canonical s");const{networkV:b,v:o}=function(e,t,c){if(null!=e){const a=(0,d.Ab)(e);return{networkV:a>=l?a:void 0,v:p.getNormalizedV(a)}}if(null!=t)return a((0,f.Lo)(t,32),"invalid yParityAndS"),{v:128&(0,f.q5)(t)[0]?28:27};if(null!=c){switch((0,d.WZ)(c,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}a(!1,"invalid yParity")}a(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),s=new p(u,n,i,o);return b&&(s.#Xe=b),a(null==e.yParity||(0,d.WZ)(e.yParity,"sig.yParity")===s.yParity,"yParity mismatch"),a(null==e.yParityAndS||e.yParityAndS===s.yParityAndS,"yParityAndS mismatch"),s}}},15496:(e,a,t)=>{"use strict";t.d(a,{h:()=>be});var c={};t.r(c),t.d(c,{OG:()=>x,My:()=>b,Ph:()=>l,lX:()=>u,Id:()=>m,fg:()=>v,qj:()=>g,aT:()=>s,lq:()=>h,z:()=>p,Q5:()=>_});var f=t(3439);BigInt(0);const d=BigInt(1),r=BigInt(2),n=e=>e instanceof Uint8Array,i=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function b(e){if(!n(e))throw new Error("Uint8Array expected");let a="";for(let t=0;te+a.length),0));let t=0;return e.forEach((e=>{if(!n(e))throw new Error("Uint8Array expected");a.set(e,t),t+=e.length})),a}const x=e=>(r<new Uint8Array(e),A=e=>Uint8Array.from(e);function v(e,a,t){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof a||a<2)throw new Error("qByteLen must be a number");if("function"!=typeof t)throw new Error("hmacFn must be a function");let c=y(e),f=y(e),d=0;const r=()=>{c.fill(1),f.fill(0),d=0},n=(...e)=>t(f,c,...e),i=(e=y())=>{f=n(A([0]),e),c=n(),0!==e.length&&(f=n(A([1]),e),c=n())},b=()=>{if(d++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const t=[];for(;e{let t;for(r(),i(e);!(t=a(b()));)i();return r(),t}}const w={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,a)=>a.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function _(e,a,t={}){const c=(a,t,c)=>{const f=w[t];if("function"!=typeof f)throw new Error(`Invalid validator "${t}", expected function`);const d=e[a];if(!(c&&void 0===d||f(d,e)))throw new Error(`Invalid param ${String(a)}=${d} (${typeof d}), expected ${t}`)};for(const[e,t]of Object.entries(a))c(e,t,!1);for(const[e,a]of Object.entries(t))c(e,a,!0);return e}const I=BigInt(0),E=BigInt(1),C=BigInt(2),M=BigInt(3),B=BigInt(4),L=BigInt(5),S=BigInt(8);function k(e,a){const t=e%a;return t>=I?t:a+t}function N(e,a,t){if(t<=I||a 0");if(t===E)return I;let c=E;for(;a>I;)a&E&&(c=c*e%t),e=e*e%t,a>>=E;return c}function P(e,a,t){let c=e;for(;a-- >I;)c*=c,c%=t;return c}function R(e,a){if(e===I||a<=I)throw new Error(`invert: expected positive integers, got n=${e} mod=${a}`);let t=k(e,a),c=a,f=I,d=E,r=E,n=I;for(;t!==I;){const e=c/t,a=c%t,i=f-r*e,b=d-n*e;c=t,t=a,f=r,d=n,r=i,n=b}if(c!==E)throw new Error("invert: does not exist");return k(f,a)}BigInt(9),BigInt(16);const O=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function D(e,a){const t=void 0!==a?a:e.toString(2).length;return{nBitLength:t,nByteLength:Math.ceil(t/8)}}function T(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const a=e.toString(2).length;return Math.ceil(a/8)}function F(e){const a=T(e);return a+Math.ceil(a/2)}var Q=t(4655),U=t(10750);const j=BigInt(0),H=BigInt(1);function $(e){return _(e.Fp,O.reduce(((e,a)=>(e[a]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),_(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...D(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:q,aT:G}=c,z={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:a}=z;if(e.length<2||2!==e[0])throw new a("Invalid signature integer tag");const t=e[1],c=e.subarray(2,t+2);if(!t||c.length!==t)throw new a("Invalid signature integer: wrong length");if(128&c[0])throw new a("Invalid signature integer: negative");if(0===c[0]&&!(128&c[1]))throw new a("Invalid signature integer: unnecessary leading zero");return{d:q(c),l:e.subarray(t+2)}},toSig(e){const{Err:a}=z,t="string"==typeof e?G(e):e;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let c=t.length;if(c<2||48!=t[0])throw new a("Invalid signature tag");if(t[1]!==c-2)throw new a("Invalid signature: incorrect length");const{d:f,l:d}=z._parseInt(t.subarray(2)),{d:r,l:n}=z._parseInt(d);if(n.length)throw new a("Invalid signature: left bytes after parsing");return{r:f,s:r}},hexFromSig(e){const a=e=>8&Number.parseInt(e[0],16)?"00"+e:e,t=e=>{const a=e.toString(16);return 1&a.length?`0${a}`:a},c=a(t(e.s)),f=a(t(e.r)),d=c.length/2,r=f.length/2,n=t(d),i=t(r);return`30${t(r+d+4)}02${i}${f}02${n}${c}`}},K=BigInt(0),V=BigInt(1),Z=(BigInt(2),BigInt(3));function J(e){const a=function(e){const a=$(e);return _(a,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...a})}(e),{Fp:t,n:c}=a,f=t.BYTES+1,d=2*t.BYTES+1;function r(e){return k(e,c)}function n(e){return R(e,c)}const{ProjectivePoint:i,normPrivateKeyToScalar:o,weierstrassEquation:y,isWithinCurveOrder:A}=function(e){const a=function(e){const a=$(e);_(a,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:c,a:f}=a;if(t){if(!c.eql(f,c.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof t||"bigint"!=typeof t.beta||"function"!=typeof t.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...a})}(e),{Fp:t}=a,c=a.toBytes||((e,a,c)=>{const f=a.toAffine();return m(Uint8Array.from([4]),t.toBytes(f.x),t.toBytes(f.y))}),f=a.fromBytes||(e=>{const a=e.subarray(1);return{x:t.fromBytes(a.subarray(0,t.BYTES)),y:t.fromBytes(a.subarray(t.BYTES,2*t.BYTES))}});function d(e){const{a:c,b:f}=a,d=t.sqr(e),r=t.mul(d,e);return t.add(t.add(r,t.mul(e,c)),f)}if(!t.eql(t.sqr(a.Gy),d(a.Gx)))throw new Error("bad generator point: equation left != right");function r(e){return"bigint"==typeof e&&Kt.eql(e,t.ZERO);return f(a)&&f(c)?u.ZERO:new u(a,c,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(u.fromAffine)}static fromHex(e){const a=u.fromAffine(f(g("pointHex",e)));return a.assertValidity(),a}static fromPrivateKey(e){return u.BASE.multiply(i(e))}_setWindowSize(e){this._WINDOW_SIZE=e,o.delete(this)}assertValidity(){if(this.is0()){if(a.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:c}=this.toAffine();if(!t.isValid(e)||!t.isValid(c))throw new Error("bad point: x or y not FE");const f=t.sqr(c),r=d(e);if(!t.eql(f,r))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(t.isOdd)return!t.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){s(e);const{px:a,py:c,pz:f}=this,{px:d,py:r,pz:n}=e,i=t.eql(t.mul(a,n),t.mul(d,f)),b=t.eql(t.mul(c,n),t.mul(r,f));return i&&b}negate(){return new u(this.px,t.neg(this.py),this.pz)}double(){const{a:e,b:c}=a,f=t.mul(c,Z),{px:d,py:r,pz:n}=this;let i=t.ZERO,b=t.ZERO,o=t.ZERO,s=t.mul(d,d),l=t.mul(r,r),h=t.mul(n,n),p=t.mul(d,r);return p=t.add(p,p),o=t.mul(d,n),o=t.add(o,o),i=t.mul(e,o),b=t.mul(f,h),b=t.add(i,b),i=t.sub(l,b),b=t.add(l,b),b=t.mul(i,b),i=t.mul(p,i),o=t.mul(f,o),h=t.mul(e,h),p=t.sub(s,h),p=t.mul(e,p),p=t.add(p,o),o=t.add(s,s),s=t.add(o,s),s=t.add(s,h),s=t.mul(s,p),b=t.add(b,s),h=t.mul(r,n),h=t.add(h,h),s=t.mul(h,p),i=t.sub(i,s),o=t.mul(h,l),o=t.add(o,o),o=t.add(o,o),new u(i,b,o)}add(e){s(e);const{px:c,py:f,pz:d}=this,{px:r,py:n,pz:i}=e;let b=t.ZERO,o=t.ZERO,l=t.ZERO;const h=a.a,p=t.mul(a.b,Z);let g=t.mul(c,r),m=t.mul(f,n),x=t.mul(d,i),y=t.add(c,f),A=t.add(r,n);y=t.mul(y,A),A=t.add(g,m),y=t.sub(y,A),A=t.add(c,d);let v=t.add(r,i);return A=t.mul(A,v),v=t.add(g,x),A=t.sub(A,v),v=t.add(f,d),b=t.add(n,i),v=t.mul(v,b),b=t.add(m,x),v=t.sub(v,b),l=t.mul(h,A),b=t.mul(p,x),l=t.add(b,l),b=t.sub(m,l),l=t.add(m,l),o=t.mul(b,l),m=t.add(g,g),m=t.add(m,g),x=t.mul(h,x),A=t.mul(p,A),m=t.add(m,x),x=t.sub(g,x),x=t.mul(h,x),A=t.add(A,x),g=t.mul(m,A),o=t.add(o,g),g=t.mul(v,A),b=t.mul(y,b),b=t.sub(b,g),g=t.mul(y,m),l=t.mul(v,l),l=t.add(l,g),new u(b,o,l)}subtract(e){return this.add(e.negate())}is0(){return this.equals(u.ZERO)}wNAF(e){return p.wNAFCached(this,o,e,(e=>{const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(u.fromAffine)}))}multiplyUnsafe(e){const c=u.ZERO;if(e===K)return c;if(n(e),e===V)return this;const{endo:f}=a;if(!f)return p.unsafeLadder(this,e);let{k1neg:d,k1:r,k2neg:i,k2:b}=f.splitScalar(e),o=c,s=c,l=this;for(;r>K||b>K;)r&V&&(o=o.add(l)),b&V&&(s=s.add(l)),l=l.double(),r>>=V,b>>=V;return d&&(o=o.negate()),i&&(s=s.negate()),s=new u(t.mul(s.px,f.beta),s.py,s.pz),o.add(s)}multiply(e){n(e);let c,f,d=e;const{endo:r}=a;if(r){const{k1neg:e,k1:a,k2neg:n,k2:i}=r.splitScalar(d);let{p:b,f:o}=this.wNAF(a),{p:s,f:l}=this.wNAF(i);b=p.constTimeNegate(e,b),s=p.constTimeNegate(n,s),s=new u(t.mul(s.px,r.beta),s.py,s.pz),c=b.add(s),f=o.add(l)}else{const{p:e,f:a}=this.wNAF(d);c=e,f=a}return u.normalizeZ([c,f])[0]}multiplyAndAddUnsafe(e,a,t){const c=u.BASE,f=(e,a)=>a!==K&&a!==V&&e.equals(c)?e.multiply(a):e.multiplyUnsafe(a),d=f(this,a).add(f(e,t));return d.is0()?void 0:d}toAffine(e){const{px:a,py:c,pz:f}=this,d=this.is0();null==e&&(e=d?t.ONE:t.inv(f));const r=t.mul(a,e),n=t.mul(c,e),i=t.mul(f,e);if(d)return{x:t.ZERO,y:t.ZERO};if(!t.eql(i,t.ONE))throw new Error("invZ was invalid");return{x:r,y:n}}isTorsionFree(){const{h:e,isTorsionFree:t}=a;if(e===V)return!0;if(t)return t(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:t}=a;return e===V?this:t?t(u,this):this.multiplyUnsafe(a.h)}toRawBytes(e=!0){return this.assertValidity(),c(u,this,e)}toHex(e=!0){return b(this.toRawBytes(e))}}u.BASE=new u(a.Gx,a.Gy,t.ONE),u.ZERO=new u(t.ZERO,t.ONE,t.ZERO);const h=a.nBitLength,p=function(e,a){const t=(e,a)=>{const t=a.negate();return e?t:a},c=e=>({windows:Math.ceil(a/e)+1,windowSize:2**(e-1)});return{constTimeNegate:t,unsafeLadder(a,t){let c=e.ZERO,f=a;for(;t>j;)t&H&&(c=c.add(f)),f=f.double(),t>>=H;return c},precomputeWindow(e,a){const{windows:t,windowSize:f}=c(a),d=[];let r=e,n=r;for(let e=0;e>=l,c>n&&(c-=s,d+=H);const r=a,u=a+Math.abs(c)-1,h=e%2!=0,p=c<0;0===c?b=b.add(t(h,f[r])):i=i.add(t(p,f[u]))}return{p:i,f:b}},wNAFCached(e,a,t,c){const f=e._WINDOW_SIZE||1;let d=a.get(e);return d||(d=this.precomputeWindow(e,f),1!==f&&a.set(e,c(d))),this.wNAF(f,d,t)}}}(u,a.endo?Math.ceil(h/2):h);return{CURVE:a,ProjectivePoint:u,normPrivateKeyToScalar:i,weierstrassEquation:d,isWithinCurveOrder:r}}({...a,toBytes(e,a,c){const f=a.toAffine(),d=t.toBytes(f.x),r=m;return c?r(Uint8Array.from([a.hasEvenY()?2:3]),d):r(Uint8Array.from([4]),d,t.toBytes(f.y))},fromBytes(e){const a=e.length,c=e[0],r=e.subarray(1);if(a!==f||2!==c&&3!==c){if(a===d&&4===c)return{x:t.fromBytes(r.subarray(0,t.BYTES)),y:t.fromBytes(r.subarray(t.BYTES,2*t.BYTES))};throw new Error(`Point of length ${a} was invalid. Expected ${f} compressed bytes or ${d} uncompressed bytes`)}{const e=l(r);if(!(K<(n=e)&&nb(h(e,a.nByteLength));function I(e){return e>c>>V}const C=(e,a,t)=>l(e.slice(a,t));class M{constructor(e,a,t){this.r=e,this.s=a,this.recovery=t,this.assertValidity()}static fromCompact(e){const t=a.nByteLength;return e=g("compactSignature",e,2*t),new M(C(e,0,t),C(e,t,2*t))}static fromDER(e){const{r:a,s:t}=z.toSig(g("DER",e));return new M(a,t)}assertValidity(){if(!A(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!A(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new M(this.r,this.s,e)}recoverPublicKey(e){const{r:c,s:f,recovery:d}=this,b=N(g("msgHash",e));if(null==d||![0,1,2,3].includes(d))throw new Error("recovery id invalid");const o=2===d||3===d?c+a.n:c;if(o>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const s=1&d?"03":"02",l=i.fromHex(s+w(o)),u=n(o),h=r(-b*u),p=r(f*u),m=i.BASE.multiplyAndAddUnsafe(l,h,p);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return I(this.s)}normalizeS(){return this.hasHighS()?new M(this.r,r(-this.s),this.recovery):this}toDERRawBytes(){return s(this.toDERHex())}toDERHex(){return z.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return s(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}const B={isValidPrivateKey(e){try{return o(e),!0}catch(e){return!1}},normPrivateKeyToScalar:o,randomPrivateKey:()=>{const e=F(a.n);return function(e,a,t=!1){const c=e.length,f=T(a),d=F(a);if(c<16||c1024)throw new Error(`expected ${d}-1024 bytes of input, got ${c}`);const r=k(t?l(e):u(e),a-E)+E;return t?p(r,f):h(r,f)}(a.randomBytes(e),a.n)},precompute:(e=8,a=i.BASE)=>(a._setWindowSize(e),a.multiply(BigInt(3)),a)};function L(e){const a=e instanceof Uint8Array,t="string"==typeof e,c=(a||t)&&e.length;return a?c===f||c===d:t?c===2*f||c===2*d:e instanceof i}const S=a.bits2int||function(e){const t=l(e),c=8*e.length-a.nBitLength;return c>0?t>>BigInt(c):t},N=a.bits2int_modN||function(e){return r(S(e))},P=x(a.nBitLength);function O(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(K<=e&&ee in f)))throw new Error("sign() legacy options not supported");const{hash:d,randomBytes:b}=a;let{lowS:s,prehash:l,extraEntropy:u}=f;null==s&&(s=!0),e=g("msgHash",e),l&&(e=g("prehashed msgHash",d(e)));const h=N(e),p=o(c),x=[O(p),O(h)];if(null!=u){const e=!0===u?b(t.BYTES):u;x.push(g("extraEntropy",e))}const y=m(...x),v=h;return{seed:y,k2sig:function(e){const a=S(e);if(!A(a))return;const t=n(a),c=i.BASE.multiply(a).toAffine(),f=r(c.x);if(f===K)return;const d=r(t*r(v+f*p));if(d===K)return;let b=(c.x===f?0:2)|Number(c.y&V),o=d;return s&&I(d)&&(o=function(e){return I(e)?r(-e):e}(d),b^=1),new M(f,o,b)}}}(e,c,f),s=a;return v(s.hash.outputLen,s.nByteLength,s.hmac)(d,b)},verify:function(e,t,c,f=Q){const d=e;if(t=g("msgHash",t),c=g("publicKey",c),"strict"in f)throw new Error("options.strict was renamed to lowS");const{lowS:b,prehash:o}=f;let s,l;try{if("string"==typeof d||d instanceof Uint8Array)try{s=M.fromDER(d)}catch(e){if(!(e instanceof z.Err))throw e;s=M.fromCompact(d)}else{if("object"!=typeof d||"bigint"!=typeof d.r||"bigint"!=typeof d.s)throw new Error("PARSE");{const{r:e,s:a}=d;s=new M(e,a)}}l=i.fromHex(c)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(b&&s.hasHighS())return!1;o&&(t=a.hash(t));const{r:u,s:h}=s,p=N(t),m=n(h),x=r(p*m),y=r(u*m),A=i.BASE.multiplyAndAddUnsafe(l,x,y)?.toAffine();return!!A&&r(A.x)===u},ProjectivePoint:i,Signature:M,utils:B}}function W(e){return{hash:e,hmac:(a,...t)=>(0,Q.w)(e,a,(0,U.Id)(...t)),randomBytes:U.po}}BigInt(4);const Y=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),X=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ee=BigInt(1),ae=BigInt(2),te=(e,a)=>(e+a/ae)/a;const ce=function(e,a,t=!1,c={}){if(e<=I)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:f,nByteLength:d}=D(e,a);if(d>2048)throw new Error("Field lengths over 2048 bytes are not supported");const r=function(e){if(e%B===M){const a=(e+E)/B;return function(e,t){const c=e.pow(t,a);if(!e.eql(e.sqr(c),t))throw new Error("Cannot find square root");return c}}if(e%S===L){const a=(e-L)/S;return function(e,t){const c=e.mul(t,C),f=e.pow(c,a),d=e.mul(t,f),r=e.mul(e.mul(d,C),f),n=e.mul(d,e.sub(r,e.ONE));if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}}return function(e){const a=(e-E)/C;let t,c,f;for(t=e-E,c=0;t%C===I;t/=C,c++);for(f=C;fk(a,e),isValid:a=>{if("bigint"!=typeof a)throw new Error("Invalid field element: expected bigint, got "+typeof a);return I<=a&&ae===I,isOdd:e=>(e&E)===E,neg:a=>k(-a,e),eql:(e,a)=>e===a,sqr:a=>k(a*a,e),add:(a,t)=>k(a+t,e),sub:(a,t)=>k(a-t,e),mul:(a,t)=>k(a*t,e),pow:(e,a)=>function(e,a,t){if(t 0");if(t===I)return e.ONE;if(t===E)return a;let c=e.ONE,f=a;for(;t>I;)t&E&&(c=e.mul(c,f)),f=e.sqr(f),t>>=E;return c}(n,e,a),div:(a,t)=>k(a*R(t,e),e),sqrN:e=>e*e,addN:(e,a)=>e+a,subN:(e,a)=>e-a,mulN:(e,a)=>e*a,inv:a=>R(a,e),sqrt:c.sqrt||(e=>r(n,e)),invertBatch:e=>function(e,a){const t=new Array(a.length),c=a.reduce(((a,c,f)=>e.is0(c)?a:(t[f]=a,e.mul(a,c))),e.ONE),f=e.inv(c);return a.reduceRight(((a,c,f)=>e.is0(c)?a:(t[f]=e.mul(a,t[f]),e.mul(a,c))),f),t}(n,e),cmov:(e,a,t)=>t?a:e,toBytes:e=>t?p(e,d):h(e,d),fromBytes:e=>{if(e.length!==d)throw new Error(`Fp.fromBytes: expected ${d}, got ${e.length}`);return t?u(e):l(e)}});return Object.freeze(n)}(Y,void 0,void 0,{sqrt:function(e){const a=Y,t=BigInt(3),c=BigInt(6),f=BigInt(11),d=BigInt(22),r=BigInt(23),n=BigInt(44),i=BigInt(88),b=e*e*e%a,o=b*b*e%a,s=P(o,t,a)*o%a,l=P(s,t,a)*o%a,u=P(l,ae,a)*b%a,h=P(u,f,a)*u%a,p=P(h,d,a)*h%a,g=P(p,n,a)*p%a,m=P(g,i,a)*g%a,x=P(m,n,a)*p%a,y=P(x,t,a)*o%a,A=P(y,r,a)*h%a,v=P(A,c,a)*b%a,w=P(v,ae,a);if(!ce.eql(ce.sqr(w),e))throw new Error("Cannot find square root");return w}}),fe=function(e,a){const t=a=>J({...e,...W(a)});return Object.freeze({...t(a),create:t})}({a:BigInt(0),b:BigInt(7),Fp:ce,n:X,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const a=X,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),c=-ee*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),f=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),d=t,r=BigInt("0x100000000000000000000000000000000"),n=te(d*e,a),i=te(-c*e,a);let b=k(e-n*t-i*f,a),o=k(-n*c-i*d,a);const s=b>r,l=o>r;if(s&&(b=a-b),l&&(o=a-o),b>r||o>r)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:s,k1:b,k2neg:l,k2:o}}}},f.s);BigInt(0),fe.ProjectivePoint;var de=t(57339),re=t(36212),ne=t(27033),ie=t(20260);class be{#ea;constructor(e){(0,de.MR)(32===(0,re.pO)(e),"invalid private key","privateKey","[REDACTED]"),this.#ea=(0,re.c$)(e)}get privateKey(){return this.#ea}get publicKey(){return be.computePublicKey(this.#ea)}get compressedPublicKey(){return be.computePublicKey(this.#ea,!0)}sign(e){(0,de.MR)(32===(0,re.pO)(e),"invalid digest length","digest",e);const a=fe.sign((0,re.Lm)(e),(0,re.Lm)(this.#ea),{lowS:!0});return ie.t.from({r:(0,ne.up)(a.r,32),s:(0,ne.up)(a.s,32),v:a.recovery?28:27})}computeSharedSecret(e){const a=be.computePublicKey(e);return(0,re.c$)(fe.getSharedSecret((0,re.Lm)(this.#ea),(0,re.q5)(a),!1))}static computePublicKey(e,a){let t=(0,re.q5)(e,"key");if(32===t.length){const e=fe.getPublicKey(t,!!a);return(0,re.c$)(e)}if(64===t.length){const e=new Uint8Array(65);e[0]=4,e.set(t,1),t=e}const c=fe.ProjectivePoint.fromHex(t);return(0,re.c$)(c.toRawBytes(a))}static recoverPublicKey(e,a){(0,de.MR)(32===(0,re.pO)(e),"invalid digest length","digest",e);const t=ie.t.from(a);let c=fe.Signature.fromCompact((0,re.Lm)((0,re.xW)([t.r,t.s])));c=c.addRecoveryBit(t.yParity);const f=c.recoverPublicKey((0,re.Lm)(e));return(0,de.MR)(null!=f,"invalid signautre for digest","signature",a),"0x"+f.toHex(!1)}static addPoints(e,a,t){const c=fe.ProjectivePoint.fromHex(be.computePublicKey(e).substring(2)),f=fe.ProjectivePoint.fromHex(be.computePublicKey(a).substring(2));return"0x"+c.add(f).toHex(!!t)}}},38264:(e,a,t)=>{"use strict";t.d(a,{id:()=>d});var c=t(15539),f=t(87303);function d(e){return(0,c.S)((0,f.YW)(e))}},64563:(e,a,t)=>{"use strict";t.d(a,{Wh:()=>Ee,kM:()=>Ie});var c=t(15539),f=t(57339),d=t(87303),r=t(36212),n="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 i=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),b=4;function o(e){return function(e){let a=0;return()=>e[a++]}(function(e){let a=0;function t(){return e[a++]<<8|e[a++]}let c=t(),f=1,d=[0,1];for(let e=1;e>--i&1}const s=2**31,l=s>>>1,u=l>>1,h=s-1;let p=0;for(let e=0;e<31;e++)p=p<<1|o();let g=[],m=0,x=s;for(;;){let e=Math.floor(((p-m+1)*f-1)/x),a=0,t=c;for(;t-a>1;){let c=a+t>>>1;e>>1|o(),r=r<<1^l,n=(n^l)<<1|l|1;m=r,x=1+n-r}let y=c-4;return g.map((a=>{switch(a-y){case 3:return y+65792+(e[n++]<<16|e[n++]<<8|e[n++]);case 2:return y+256+(e[n++]<<8|e[n++]);case 1:return y+e[n++];default:return a-1}}))}(function(e){let a=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((e,t)=>a[e.charCodeAt(0)]=t));let t=e.length,c=new Uint8Array(6*t>>3);for(let f=0,d=0,r=0,n=0;f=8&&(c[d++]=n>>(r-=8));return c}(e)))}function s(e){return 1&e?~e>>1:e>>1}function l(e,a){let t=Array(e);for(let c=0,f=0;c{let a=u(e);if(a.length)return a}))}function p(e){let a=[];for(;;){let t=e();if(0==t)break;a.push(x(t,e))}for(;;){let t=e()-1;if(t<0)break;a.push(y(t,e))}return a.flat()}function g(e){let a=[];for(;;){let t=e(a.length);if(!t)break;a.push(t)}return a}function m(e,a,t){let c=Array(e).fill().map((()=>[]));for(let f=0;fc[a].push(e)));return c}function x(e,a){let t=1+a(),c=a(),f=g(a);return m(f.length,1+e,a).flatMap(((e,a)=>{let[d,...r]=e;return Array(f[a]).fill().map(((e,a)=>{let f=a*c;return[d+a*t,r.map((e=>e+f))]}))}))}function y(e,a){return m(1+a(),1+e,a).map((e=>[e[0],e.slice(1)]))}function A(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function v(e){let a=e.length;if(a<4096)return String.fromCodePoint(...e);let t=[];for(let c=0;c>24&255}function O(e){return 16777215&e}let D,T,F,Q;function U(e){return e>=I&&e=E&&e=C&&aM&&ae.map((e=>[e,a+1<<24]))))),T=new Set(u(e)),F=new Map,Q=new Map;for(let[a,t]of p(e)){if(!T.has(a)&&2==t.length){let[e,c]=t,f=Q.get(e);f||(f=new Map,Q.set(e,f)),f.set(c,a)}F.set(a,t.reverse())}}();let a=[],t=[],c=!1;function f(e){let t=D.get(e);t&&(c=!0,e|=t),a.push(e)}for(let c of e)for(;;){if(c<128)a.push(c);else if(U(c)){let e=c-I,a=e%L/B|0,t=e%B;f(E+(e/L|0)),f(C+a),t>0&&f(M+t)}else{let e=F.get(c);e?t.push(...e):f(c)}if(!t.length)break;c=t.pop()}if(c&&a.length>1){let e=R(a[0]);for(let t=1;t0&&f>=e)0==e?(a.push(c,...t),t.length=0,c=r):t.push(r),f=e;else{let d=j(c,r);d>=0?c=d:0==f&&0==e?(a.push(c),c=r):(t.push(r),f=e)}}return c>=0&&a.push(c,...t),a}(H(e))}const G=45,z=".",K=65039,V=1,Z=e=>Array.from(e);function J(e,a){return e.P.has(a)||e.Q.has(a)}class W extends Array{get is_emoji(){return!0}}let Y,X,ee,ae,te,ce,fe,de,re,ne,ie,be;function oe(){if(Y)return;let e=o(n);const a=()=>u(e),t=()=>new Set(a()),c=(e,a)=>a.forEach((a=>e.add(a)));Y=new Map(p(e)),X=t(),ee=a(),ae=new Set(a().map((e=>ee[e]))),ee=new Set(ee),te=t(),ce=t();let f=h(e),d=e();const r=()=>{let e=new Set;return a().forEach((a=>c(e,f[a]))),c(e,a()),e};fe=g((a=>{let t=g(e).map((e=>e+96));if(t.length){let c=a>=d;return t[0]-=32,t=v(t),c&&(t=`Restricted[${t}]`),{N:t,P:r(),Q:r(),M:!e(),R:c}}})),de=t(),re=new Map;let i=a().concat(Z(de)).sort(((e,a)=>e-a));i.forEach(((a,t)=>{let c=e(),f=i[t]=c?i[t-c]:{V:[],M:new Map};f.V.push(a),de.has(a)||re.set(a,f)}));for(let{V:e,M:a}of new Set(re.values())){let t=[];for(let a of e){let e=fe.filter((e=>J(e,a))),f=t.find((({G:a})=>e.some((e=>a.has(e)))));f||(f={G:new Set,V:[]},t.push(f)),f.V.push(a),c(f.G,e)}let f=t.flatMap((e=>Z(e.G)));for(let{G:e,V:c}of t){let t=new Set(f.filter((a=>!e.has(a))));for(let e of c)a.set(e,t)}}ne=new Set;let b=new Set;const s=e=>ne.has(e)?b.add(e):ne.add(e);for(let e of fe){for(let a of e.P)s(a);for(let a of e.Q)s(a)}for(let e of ne)re.has(e)||b.has(e)||re.set(e,V);c(ne,$(ne)),ie=function(e){let a=[],t=u(e);return function e({S:t,B:c},f,d){if(!(4&t&&d===f[f.length-1])){2&t&&(d=f[f.length-1]),1&t&&a.push(f);for(let a of c)for(let t of a.Q)e(a,[...f,t],d)}}(function a(c){return{S:e(),B:g((()=>{let c=u(e).map((e=>t[e]));if(c.length)return a(c)})),Q:c}}([]),[]),a}(e).map((e=>W.from(e))).sort(w),be=new Map;for(let e of ie){let a=[be];for(let t of e){let e=a.map((e=>{let a=e.get(t);return a||(a=new Map,e.set(t,a)),a}));t===K?a.push(...e):a=e}for(let t of a)t.V=e}}function se(e){return(he(e)?"":`${le(ue([e]))} `)+A(e)}function le(e){return`"${e}"‎`}function ue(e,a=1/0,t=A){let c=[];var f;f=e[0],oe(),ee.has(f)&&c.push("◌"),e.length>a&&(a>>=1,e=[...e.slice(0,a),8230,...e.slice(-a)]);let d=0,r=e.length;for(let a=0;a{let f=function(e){let a=[];for(let t=0,c=e.length;t0;)if(95!==e[--a])throw new Error("underscore allowed only at start")}(n),!(d.emoji=r>1||c[0].is_emoji)&&n.every((e=>e<128)))!function(e){if(e.length>=4&&e[2]==G&&e[3]==G)throw new Error(`invalid label extension: "${v(e.slice(0,4))}"`)}(n),e="ASCII";else{let a=c.flatMap((e=>e.is_emoji?[]:e));if(a.length){if(ee.has(n[0]))throw xe("leading combining mark");for(let e=1;eJ(e,t)));if(!e.length)throw fe.some((e=>J(e,t)))?me(a[0],t):ge(t);if(a=e,1==e.length)break}return a}(t);!function(e,a){for(let t of a)if(!J(e,t))throw me(e,t);if(e.M){let e=$(a);for(let a=1,t=e.length;ab)throw new Error(`excessive non-spacing marks: ${le(ue(e.slice(a-1,c)))} (${c-a}/${b})`);a=c}}}(f,a),function(e,a){let t,c=[];for(let e of a){let a=re.get(e);if(a===V)return;if(a){let c=a.M.get(e);if(t=t?t.filter((e=>c.has(e))):Z(c),!t.length)return}else c.push(e)}if(t)for(let a of t)if(c.every((e=>J(a,e))))throw new Error(`whole-script confusable: ${e.N}/${a.N}`)}(f,t),e=f.N}else e="Emoji"}d.type=e}catch(e){d.error=e}return d}))}function ge(e){return new Error(`disallowed character: ${se(e)}`)}function me(e,a){let t=se(a),c=fe.find((e=>e.P.has(a)));return c&&(t=`${c.N} ${t}`),new Error(`illegal mixture: ${e.N} + ${t}`)}function xe(e){return new Error(`illegal placement: ${e}`)}function ye(e){return e.filter((e=>e!=K))}function Ae(e,a){let t,c=be,f=e.length;for(;f&&(c=c.get(e[--f]),c);){let{V:d}=c;d&&(t=d,a&&a.push(...e.slice(f).reverse()),e.length=f)}return t}const ve=new Uint8Array(32);function we(e){return(0,f.MR)(0!==e.length,"invalid ENS name; empty component","comp",e),e}function _e(e){const a=(0,d.YW)(function(e){try{if(0===e.length)throw new Error("empty label");return function(e){return function(e){return e.map((({input:a,error:t,output:c})=>{if(t){let c=t.message;throw new Error(1==e.length?c:`Invalid label ${le(ue(a,63))}: ${c}`)}return v(c)})).join(z)}(pe(e,q,ye))}(e)}catch(a){(0,f.MR)(!1,`invalid ENS name (${a.message})`,"name",e)}}(e)),t=[];if(0===e.length)return t;let c=0;for(let e=0;e{(0,f.MR)(a.length<=t,`label ${JSON.stringify(e)} exceeds ${t} bytes`,"name",e);const c=new Uint8Array(a.length+1);return c.set(a,1),c[0]=c.length-1,c}))))+"00"}ve.fill(0)},43948:(e,a,t)=>{"use strict";t.d(a,{J9:()=>s,VS:()=>l,eB:()=>u,tG:()=>h,uI:()=>g,z5:()=>p});var c=t(88081),f=t(36212),d=t(27033),r=t(57339),n=t(8177);const i=BigInt(0);function b(e){return null==e?null:e}function o(e){return null==e?null:e.toString()}class s{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,a,t){(0,c.n)(this,{gasPrice:b(e),maxFeePerGas:b(a),maxPriorityFeePerGas:b(t)})}toJSON(){const{gasPrice:e,maxFeePerGas:a,maxPriorityFeePerGas:t}=this;return{_type:"FeeData",gasPrice:o(e),maxFeePerGas:o(a),maxPriorityFeePerGas:o(t)}}}function l(e){const a={};e.to&&(a.to=e.to),e.from&&(a.from=e.from),e.data&&(a.data=(0,f.c$)(e.data));const t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const c of t)c in e&&null!=e[c]&&(a[c]=(0,d.Ab)(e[c],`request.${c}`));const c="type,nonce".split(/,/);for(const t of c)t in e&&null!=e[t]&&(a[t]=(0,d.WZ)(e[t],`request.${t}`));return e.accessList&&(a.accessList=(0,n.$)(e.accessList)),"blockTag"in e&&(a.blockTag=e.blockTag),"enableCcipRead"in e&&(a.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(a.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(a.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(a.kzg=e.kzg),"blobs"in e&&e.blobs&&(a.blobs=e.blobs.map((e=>(0,f.f)(e)?(0,f.c$)(e):Object.assign({},e)))),a}class u{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#aa;constructor(e,a){this.#aa=e.transactions.map((e=>"string"!=typeof e?new g(e,a):e)),(0,c.n)(this,{provider:a,hash:b(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:b(e.prevRandao),extraData:e.extraData,baseFeePerGas:b(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#aa.map((e=>"string"==typeof e?e:e.hash))}get prefetchedTransactions(){const e=this.#aa.slice();return 0===e.length?[]:((0,r.vA)("object"==typeof e[0],"transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:a,extraData:t,gasLimit:c,gasUsed:f,hash:d,miner:r,prevRandao:n,nonce:i,number:b,parentHash:s,parentBeaconBlockRoot:l,stateRoot:u,receiptsRoot:h,timestamp:p,transactions:g}=this;return{_type:"Block",baseFeePerGas:o(e),difficulty:o(a),extraData:t,gasLimit:o(c),gasUsed:o(f),blobGasUsed:o(this.blobGasUsed),excessBlobGas:o(this.excessBlobGas),hash:d,miner:r,prevRandao:n,nonce:i,number:b,parentHash:s,timestamp:p,parentBeaconBlockRoot:l,stateRoot:u,receiptsRoot:h,transactions:g}}[Symbol.iterator](){let e=0;const a=this.transactions;return{next:()=>enew h(e,a))));let t=i;null!=e.effectiveGasPrice?t=e.effectiveGasPrice:null!=e.gasPrice&&(t=e.gasPrice),(0,c.n)(this,{provider:a,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:t,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#ta}toJSON(){const{to:e,from:a,contractAddress:t,hash:c,index:f,blockHash:d,blockNumber:r,logsBloom:n,logs:i,status:b,root:s}=this;return{_type:"TransactionReceipt",blockHash:d,blockNumber:r,contractAddress:t,cumulativeGasUsed:o(this.cumulativeGasUsed),from:a,gasPrice:o(this.gasPrice),blobGasUsed:o(this.blobGasUsed),blobGasPrice:o(this.blobGasPrice),gasUsed:o(this.gasUsed),hash:c,index:f,logs:i,logsBloom:n,root:s,status:b,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(b)return null;const{blockNumber:e,nonce:a}=await(0,c.k)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(a{if(null==e||0!==e.status)return e;(0,r.vA)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:e.to,from:e.from,data:""},receipt:e})},l=await this.provider.getTransactionReceipt(this.hash);if(0===t)return s(l);if(l){if(await l.confirmations()>=t)return s(l)}else if(await o(),0===t)return null;const u=new Promise(((e,a)=>{const c=[],n=()=>{c.forEach((e=>e()))};if(c.push((()=>{b=!0})),f>0){const e=setTimeout((()=>{n(),a((0,r.xz)("wait for transaction timeout","TIMEOUT"))}),f);c.push((()=>{clearTimeout(e)}))}const i=async c=>{if(await c.confirmations()>=t){n();try{e(s(c))}catch(e){a(e)}}};if(c.push((()=>{this.provider.off(this.hash,i)})),this.provider.on(this.hash,i),d>=0){const e=async()=>{try{await o()}catch(e){if((0,r.bJ)(e,"TRANSACTION_REPLACED"))return n(),void a(e)}b||this.provider.once("block",e)};c.push((()=>{this.provider.off("block",e)})),this.provider.once("block",e)}}));return await u}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}removedEvent(){return(0,r.vA)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),x(this)}reorderedEvent(e){return(0,r.vA)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,r.vA)(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),m(this,e)}replaceableTransaction(e){(0,r.MR)(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const a=new g(this,this.provider);return a.#ca=e,a}}function m(e,a){return{orphan:"reorder-transaction",tx:e,other:a}}function x(e){return{orphan:"drop-transaction",tx:e}}},8177:(e,a,t)=>{"use strict";t.d(a,{$:()=>n});var c=t(30031),f=t(57339),d=t(36212);function r(e,a){return{address:(0,c.b)(e),storageKeys:a.map(((e,a)=>((0,f.MR)((0,d.Lo)(e,32),"invalid slot",`storageKeys[${a}]`,e),e.toLowerCase())))}}function n(e){if(Array.isArray(e))return e.map(((a,t)=>Array.isArray(a)?((0,f.MR)(2===a.length,"invalid slot set",`value[${t}]`,a),r(a[0],a[1])):((0,f.MR)(null!=a&&"object"==typeof a,"invalid address-slot set","value",e),r(a.address,a.storageKeys))));(0,f.MR)(null!=e&&"object"==typeof e,"invalid access list","value",e);const a=Object.keys(e).map((a=>{const t=e[a].reduce(((e,a)=>(e[a]=!0,e)),{});return r(a,Object.keys(t).sort())}));return a.sort(((e,a)=>e.address.localeCompare(a.address))),a}},20415:(e,a,t)=>{"use strict";t.d(a,{K:()=>r,x:()=>n});var c=t(30031),f=t(15496),d=t(15539);function r(e){let a;return a="string"==typeof e?f.h.computePublicKey(e,!1):e.publicKey,(0,c.b)((0,d.S)("0x"+a.substring(4)).substring(26))}function n(e,a){return r(f.h.recoverPublicKey(e,a))}},79453:(e,a,t)=>{"use strict";t.d(a,{Z:()=>D});var c=t(30031),f=t(98982),d=t(68650),r=t(20260),n=t(15539),i=t(15496),b=t(57339),o=t(27033),s=t(36212);function l(e){let a=e.toString(16);for(;a.length<2;)a="0"+a;return"0x"+a}function u(e,a,t){let c=0;for(let f=0;f{(0,b.vA)(a<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:a})};if(e[a]>=248){const c=e[a]-247;t(a+1+c);const f=u(e,a+1,c);return t(a+1+c+f),h(e,a,a+1+c,c+f)}if(e[a]>=192){const c=e[a]-192;return t(a+1+c),h(e,a,a+1,c)}if(e[a]>=184){const c=e[a]-183;t(a+1+c);const f=u(e,a+1,c);return t(a+1+c+f),{consumed:1+c+f,result:(0,s.c$)(e.slice(a+1+c,a+1+c+f))}}if(e[a]>=128){const c=e[a]-128;return t(a+1+c),{consumed:1+c,result:(0,s.c$)(e.slice(a+1,a+1+c))}}return{consumed:1,result:l(e[a])}}function g(e){const a=(0,s.q5)(e,"data"),t=p(a,0);return(0,b.MR)(t.consumed===a.length,"unexpected junk after rlp payload","data",e),t.result}var m=t(65735),x=t(8177),y=t(20415);const A=BigInt(0),v=BigInt(2),w=BigInt(27),_=BigInt(28),I=BigInt(35),E=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),C=131072;function M(e,a){let t=e.toString(16);for(;t.length<2;)t="0"+t;return t+=(0,d.s)(a).substring(4),"0x"+t}function B(e){return"0x"===e?null:(0,c.b)(e)}function L(e,a){try{return(0,x.$)(e)}catch(t){(0,b.MR)(!1,t.message,a,e)}}function S(e,a){return"0x"===e?0:(0,o.WZ)(e,a)}function k(e,a){if("0x"===e)return A;const t=(0,o.Ab)(e,a);return(0,b.MR)(t<=E,"value exceeds uint size",a,t),t}function N(e,a){const t=(0,o.Ab)(e,"value"),c=(0,o.c4)(t);return(0,b.MR)(c.length<=32,"value too large",`tx.${a}`,t),c}function P(e){return(0,x.$)(e).map((e=>[e.address,e.storageKeys]))}function R(e,a){(0,b.MR)(Array.isArray(e),`invalid ${a}`,"value",e);for(let a=0;aObject.assign({},e)))}set blobs(e){if(null==e)return void(this.#ma=null);const a=[],t=[];for(let c=0;ce.data)),t.map((e=>e.commitment)),t.map((e=>e.proof))])]):(0,s.xW)(["0x03",(0,m.R)(c)])}(this,t,a?this.blobs:null)}(0,b.vA)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#xa(!0,!0)}get unsignedSerialized(){return this.#xa(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=null!=this.gasPrice,a=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,t=null!=this.accessList,c=null!=this.#ha||this.#pa;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&(0,b.vA)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,b.vA)(!a||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,b.vA)(0!==this.type||!t,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const f=[];return null!=this.type?f.push(this.type):a?f.push(2):e?(f.push(1),t||f.push(0)):t?(f.push(1),f.push(2)):(c&&this.to||(f.push(0),f.push(1),f.push(2)),f.push(3)),f.sort(),f}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return D.from(this)}toJSON(){const e=e=>null==e?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(null==e)return new D;if("string"==typeof e){const a=(0,s.q5)(e);if(a[0]>=127)return D.from(function(e){const a=g(e);(0,b.MR)(Array.isArray(a)&&(9===a.length||6===a.length),"invalid field count for legacy transaction","data",e);const t={type:0,nonce:S(a[0],"nonce"),gasPrice:k(a[1],"gasPrice"),gasLimit:k(a[2],"gasLimit"),to:B(a[3]),value:k(a[4],"value"),data:(0,s.c$)(a[5]),chainId:A};if(6===a.length)return t;const c=k(a[6],"v"),f=k(a[7],"r"),d=k(a[8],"s");if(f===A&&d===A)t.chainId=c;else{let e=(c-I)/v;e{"use strict";t.d(a,{Lm:()=>r,Lo:()=>n,X_:()=>g,ZG:()=>u,c$:()=>o,f:()=>i,nx:()=>p,pO:()=>l,q5:()=>d,xW:()=>s});var c=t(57339);function f(e,a,t){if(e instanceof Uint8Array)return t?new Uint8Array(e):e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const a=new Uint8Array((e.length-2)/2);let t=2;for(let c=0;c>4]+b[15&c]}return t}function s(e){return"0x"+e.map((e=>o(e).substring(2))).join("")}function l(e){return n(e,!0)?(e.length-2)/2:d(e).length}function u(e,a,t){const f=d(e);return null!=t&&t>f.length&&(0,c.vA)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:f,length:f.length,offset:t}),o(f.slice(null==a?0:a,null==t?f.length:t))}function h(e,a,t){const f=d(e);(0,c.vA)(a>=f.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(f),length:a,offset:a+1});const r=new Uint8Array(a);return r.fill(0),t?r.set(f,a-f.length):r.set(f,0),o(r)}function p(e,a){return h(e,a,!0)}function g(e,a){return h(e,a,!1)}},57339:(e,a,t)=>{"use strict";t.d(a,{E:()=>n,MR:()=>o,SP:()=>u,bJ:()=>r,dd:()=>s,gk:()=>h,vA:()=>b,xz:()=>i});var c=t(99529),f=t(88081);function d(e){if(null==e)return"null";if(Array.isArray(e))return"[ "+e.map(d).join(", ")+" ]";if(e instanceof Uint8Array){const a="0123456789abcdef";let t="0x";for(let c=0;c>4],t+=a[15&e[c]];return t}if("object"==typeof e&&"function"==typeof e.toJSON)return d(e.toJSON());switch(typeof e){case"boolean":case"symbol":case"number":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const a=Object.keys(e);return a.sort(),"{ "+a.map((a=>`${d(a)}: ${d(e[a])}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function r(e,a){return e&&e.code===a}function n(e){return r(e,"CALL_EXCEPTION")}function i(e,a,t){let r,n=e;{const f=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${d(t)}`);for(const e in t){if("shortMessage"===e)continue;const a=t[e];f.push(e+"="+d(a))}}f.push(`code=${a}`),f.push(`version=${c.r}`),f.length&&(e+=" ("+f.join(", ")+")")}switch(a){case"INVALID_ARGUMENT":r=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(e);break;default:r=new Error(e)}return(0,f.n)(r,{code:a}),t&&Object.assign(r,t),null==r.shortMessage&&(0,f.n)(r,{shortMessage:n}),r}function b(e,a,t,c){if(!e)throw i(a,t,c)}function o(e,a,t,c){b(e,a,"INVALID_ARGUMENT",{argument:t,value:c})}function s(e,a,t){null==t&&(t=""),t&&(t=": "+t),b(e>=a,"missing arguemnt"+t,"MISSING_ARGUMENT",{count:e,expectedCount:a}),b(e<=a,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:a})}const l=["NFD","NFC","NFKD","NFKC"].reduce(((e,a)=>{try{if("test"!=="test".normalize(a))throw new Error("bad");if("NFD"===a){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}e.push(a)}catch(e){}return e}),[]);function u(e){b(l.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}function h(e,a,t){if(null==t&&(t=""),e!==a){let e=t,a="new";t&&(e+=".",a+=" "+t),b(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:a})}}},99381:(e,a,t)=>{"use strict";t.d(a,{z:()=>f});var c=t(88081);class f{filter;emitter;#ya;constructor(e,a,t){this.#ya=a,(0,c.n)(this,{emitter:e,filter:t})}async removeListener(){null!=this.#ya&&await this.emitter.off(this.filter,this.#ya)}}},27033:(e,a,t)=>{"use strict";t.d(a,{Ab:()=>s,Dg:()=>h,JJ:()=>b,Ro:()=>g,ST:()=>i,WZ:()=>p,c4:()=>x,dK:()=>o,nD:()=>y,up:()=>m});var c=t(36212),f=t(57339);const d=BigInt(0),r=BigInt(1),n=9007199254740991;function i(e,a){const t=l(e,"value"),c=BigInt(p(a,"width"));return(0,f.vA)(t>>c===d,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),t>>c-r?-((~t&(r<=-n&&e<=n,"overflow",a||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(t){(0,f.MR)(!1,`invalid BigNumberish string: ${t.message}`,a||"value",e)}}(0,f.MR)(!1,"invalid BigNumberish value",a||"value",e)}function l(e,a){const t=s(e,a);return(0,f.vA)(t>=d,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),t}const u="0123456789abcdef";function h(e){if(e instanceof Uint8Array){let a="0x0";for(const t of e)a+=u[t>>4],a+=u[15&t];return BigInt(a)}return s(e)}function p(e,a){switch(typeof e){case"bigint":return(0,f.MR)(e>=-n&&e<=n,"overflow",a||"value",e),Number(e);case"number":return(0,f.MR)(Number.isInteger(e),"underflow",a||"value",e),(0,f.MR)(e>=-n&&e<=n,"overflow",a||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return p(BigInt(e),a)}catch(t){(0,f.MR)(!1,`invalid numeric string: ${t.message}`,a||"value",e)}}(0,f.MR)(!1,"invalid numeric value",a||"value",e)}function g(e){return p(h(e))}function m(e,a){let t=l(e,"value").toString(16);if(null==a)t.length%2&&(t="0"+t);else{const c=p(a,"width");for((0,f.vA)(2*c>=t.length,`value exceeds width (${c} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});t.length<2*c;)t="0"+t}return"0x"+t}function x(e){const a=l(e,"value");if(a===d)return new Uint8Array([]);let t=a.toString(16);t.length%2&&(t="0"+t);const c=new Uint8Array(t.length/2);for(let e=0;e{"use strict";function c(e,a,t){const c=a.split("|").map((e=>e.trim()));for(let t=0;tPromise.resolve(e[a]))))).reduce(((e,t,c)=>(e[a[c]]=t,e)),{})}function d(e,a,t){for(let f in a){let d=a[f];const r=t?t[f]:null;r&&c(d,r,f),Object.defineProperty(e,f,{enumerable:!0,value:d,writable:!1})}}t.d(a,{k:()=>f,n:()=>d})},65735:(e,a,t)=>{"use strict";t.d(a,{R:()=>n});var c=t(36212);function f(e){const a=[];for(;e;)a.unshift(255&e),e>>=8;return a}function d(e){if(Array.isArray(e)){let a=[];if(e.forEach((function(e){a=a.concat(d(e))})),a.length<=55)return a.unshift(192+a.length),a;const t=f(a.length);return t.unshift(247+t.length),t.concat(a)}const a=Array.prototype.slice.call((0,c.q5)(e,"object"));if(1===a.length&&a[0]<=127)return a;if(a.length<=55)return a.unshift(128+a.length),a;const t=f(a.length);return t.unshift(183+t.length),t.concat(a)}const r="0123456789abcdef";function n(e){let a="0x";for(const t of d(e))a+=r[t>>4],a+=r[15&t];return a}},99770:(e,a,t)=>{"use strict";t.d(a,{ck:()=>y,g5:()=>A,XS:()=>x});var c=t(57339),f=t(36212),d=t(27033),r=t(88081);const n=BigInt(-1),i=BigInt(0),b=BigInt(1),o=BigInt(5),s={};let l="0000";for(;l.length<80;)l+=l;function u(e){let a=l;for(;a.length=-a&&ei?(0,d.ST)((0,d.dK)(e,f),f):-(0,d.ST)((0,d.dK)(-e,f),f)}else{const a=b<=0&&enull==d[e]?t:((0,c.MR)(typeof d[e]===a,"invalid fixed format ("+e+" not "+a+")","format."+e,d[e]),d[e]);a=r("signed","boolean",a),t=r("width","number",t),f=r("decimals","number",f)}return(0,c.MR)(t%8==0,"invalid FixedNumber width (not byte aligned)","format.width",t),(0,c.MR)(f<=80,"invalid FixedNumber decimals (too large)","format.decimals",f),{signed:a,width:t,decimals:f,name:(a?"":"u")+"fixed"+String(t)+"x"+String(f)}}class g{format;#Aa;#va;#wa;_value;constructor(e,a,t){(0,c.gk)(e,s,"FixedNumber"),this.#va=a,this.#Aa=t;const f=function(e,a){let t="";e0?t*=u(c):c<0&&(a*=u(-c)),at?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#va;return this.#vai&&(e+=this.#wa-b),e=this.#va/this.#wa*this.#wa,this.#Ia(e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const a=this.decimals-e,t=o*u(a-1);let c=this.value+t;const f=u(a);return c=c/f*f,h(c,this.#Aa,"round"),new g(s,c,this.#Aa)}isZero(){return this.#va===i}isNegative(){return this.#va0){const a=u(b);(0,c.vA)(n%a===i,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),n/=a}else b<0&&(n*=u(-b));return h(n,r,"fromValue"),new g(s,n,r)}static fromString(e,a){const t=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,c.MR)(t&&t[2].length+t[3].length>0,"invalid FixedNumber string value","value",e);const f=p(a);let d=t[2]||"0",r=t[3]||"";for(;r.length=0,"invalid unit","unit",a),t=3*e}else null!=a&&(t=(0,d.WZ)(a,"unit"));return g.fromString(e,{decimals:t,width:512}).value}function y(e){return function(e){let a=18;return a=(0,d.WZ)(18,"unit"),g.fromValue(e,a,{decimals:a,width:512}).toString()}(e)}function A(e){return x(e,18)}},87303:(e,a,t)=>{"use strict";t.d(a,{YW:()=>n,_v:()=>i});var c=t(36212),f=t(57339);function d(e,a,t,c,f){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let c=a+1;c>6==2;c++)e++;return e}return"OVERRUN"===e?t.length-a-1:0}const r=Object.freeze({error:function(e,a,t,c,d){(0,f.MR)(!1,`invalid codepoint at offset ${a}; ${e}`,"bytes",t)},ignore:d,replace:function(e,a,t,c,r){return"OVERLONG"===e?((0,f.MR)("number"==typeof r,"invalid bad code point for replacement","badCodepoint",r),c.push(r),0):(c.push(65533),d(e,a,t))}});function n(e,a){(0,f.MR)("string"==typeof e,"invalid string value","str",e),null!=a&&((0,f.SP)(a),e=e.normalize(a));let t=[];for(let a=0;a>6|192),t.push(63&c|128);else if(55296==(64512&c)){a++;const d=e.charCodeAt(a);(0,f.MR)(a>18|240),t.push(r>>12&63|128),t.push(r>>6&63|128),t.push(63&r|128)}else t.push(c>>12|224),t.push(c>>6&63|128),t.push(63&c|128)}return new Uint8Array(t)}function i(e,a){return function(e,a){null==a&&(a=r.error);const t=(0,c.q5)(e,"bytes"),f=[];let d=0;for(;d>7)){f.push(e);continue}let c=null,r=null;if(192==(224&e))c=1,r=127;else if(224==(240&e))c=2,r=2047;else{if(240!=(248&e)){d+=a(128==(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",d-1,t,f);continue}c=3,r=65535}if(d-1+c>=t.length){d+=a("OVERRUN",d-1,t,f);continue}let n=e&(1<<8-c-1)-1;for(let e=0;e1114111?d+=a("OUT_OF_RANGE",d-1-c,t,f,n):n>=55296&&n<=57343?d+=a("UTF16_SURROGATE",d-1-c,t,f,n):n<=r?d+=a("OVERLONG",d-1-c,t,f,n):f.push(n))}return f}(e,a).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}},27125:(e,a,t)=>{"use strict";function c(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function f(e,...a){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(a.length>0&&!a.includes(e.length))throw new Error(`Expected Uint8Array of length ${a}, not of length=${e.length}`)}function d(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");c(e.outputLen),c(e.blockLen)}function r(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function n(e,a){f(e);const t=a.outputLen;if(e.lengthn,ai:()=>c,ee:()=>f,t2:()=>r,tW:()=>d})},37171:(e,a,t)=>{"use strict";t.d(a,{D:()=>d});var c=t(27125),f=t(10750);class d extends f.Vw{constructor(e,a,t,c){super(),this.blockLen=e,this.outputLen=a,this.padOffset=t,this.isLE=c,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,f.O8)(this.buffer)}update(e){(0,c.t2)(this);const{view:a,buffer:t,blockLen:d}=this,r=(e=(0,f.ZJ)(e)).length;for(let c=0;cd-n&&(this.process(t,0),n=0);for(let e=n;e>f&d),n=Number(t&d),i=c?4:0,b=c?0:4;e.setUint32(a+i,r,c),e.setUint32(a+b,n,c)}(t,d-8,BigInt(8*this.length),r),this.process(t,0);const i=(0,f.O8)(e),b=this.outputLen;if(b%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const o=b/4,s=this.get();if(o>s.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e{"use strict";t.d(a,{Ay:()=>s,B4:()=>i,P5:()=>n,WM:()=>b,im:()=>o,lD:()=>r});const c=BigInt(2**32-1),f=BigInt(32);function d(e,a=!1){return a?{h:Number(e&c),l:Number(e>>f&c)}:{h:0|Number(e>>f&c),l:0|Number(e&c)}}function r(e,a=!1){let t=new Uint32Array(e.length),c=new Uint32Array(e.length);for(let f=0;fe<>>32-t,i=(e,a,t)=>a<>>32-t,b=(e,a,t)=>a<>>64-t,o=(e,a,t)=>e<>>64-t,s={fromBig:d,split:r,toBig:(e,a)=>BigInt(e>>>0)<>>0),shrSH:(e,a,t)=>e>>>t,shrSL:(e,a,t)=>e<<32-t|a>>>t,rotrSH:(e,a,t)=>e>>>t|a<<32-t,rotrSL:(e,a,t)=>e<<32-t|a>>>t,rotrBH:(e,a,t)=>e<<64-t|a>>>t-32,rotrBL:(e,a,t)=>e>>>t-32|a<<64-t,rotr32H:(e,a)=>a,rotr32L:(e,a)=>e,rotlSH:n,rotlSL:i,rotlBH:b,rotlBL:o,add:function(e,a,t,c){const f=(a>>>0)+(c>>>0);return{h:e+t+(f/2**32|0)|0,l:0|f}},add3L:(e,a,t)=>(e>>>0)+(a>>>0)+(t>>>0),add3H:(e,a,t,c)=>a+t+c+(e/2**32|0)|0,add4L:(e,a,t,c)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0),add4H:(e,a,t,c,f)=>a+t+c+f+(e/2**32|0)|0,add5H:(e,a,t,c,f,d)=>a+t+c+f+d+(e/2**32|0)|0,add5L:(e,a,t,c,f)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0)+(f>>>0)}},4655:(e,a,t)=>{"use strict";t.d(a,{w:()=>r});var c=t(27125),f=t(10750);class d extends f.Vw{constructor(e,a){super(),this.finished=!1,this.destroyed=!1,(0,c.tW)(e);const t=(0,f.ZJ)(a);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,r=new Uint8Array(d);r.set(t.length>d?e.create().update(t).digest():t);for(let e=0;enew d(e,a).update(t).digest();r.create=(e,a)=>new d(e,a)},84877:(e,a,t)=>{"use strict";t.d(a,{A:()=>r});var c=t(27125),f=t(4655),d=t(10750);function r(e,a,t,r){const{c:n,dkLen:i,DK:b,PRF:o,PRFSalt:s}=function(e,a,t,r){(0,c.tW)(e);const n=(0,d.tY)({dkLen:32,asyncTick:10},r),{c:i,dkLen:b,asyncTick:o}=n;if((0,c.ai)(i),(0,c.ai)(b),(0,c.ai)(o),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const s=(0,d.ZJ)(a),l=(0,d.ZJ)(t),u=new Uint8Array(b),h=f.w.create(e,s),p=h._cloneInto().update(l);return{c:i,dkLen:b,asyncTick:o,DK:u,PRF:h,PRFSalt:p}}(e,a,t,r);let l;const u=new Uint8Array(4),h=(0,d.O8)(u),p=new Uint8Array(o.outputLen);for(let e=1,a=0;a{"use strict";t.d(a,{s:()=>o});var c=t(37171),f=t(10750);const d=(e,a,t)=>e&a^e&t^a&t,r=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]),n=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);class b extends c.D{constructor(){super(64,32,8,!1),this.A=0|n[0],this.B=0|n[1],this.C=0|n[2],this.D=0|n[3],this.E=0|n[4],this.F=0|n[5],this.G=0|n[6],this.H=0|n[7]}get(){const{A:e,B:a,C:t,D:c,E:f,F:d,G:r,H:n}=this;return[e,a,t,c,f,d,r,n]}set(e,a,t,c,f,d,r,n){this.A=0|e,this.B=0|a,this.C=0|t,this.D=0|c,this.E=0|f,this.F=0|d,this.G=0|r,this.H=0|n}process(e,a){for(let t=0;t<16;t++,a+=4)i[t]=e.getUint32(a,!1);for(let e=16;e<64;e++){const a=i[e-15],t=i[e-2],c=(0,f.Ow)(a,7)^(0,f.Ow)(a,18)^a>>>3,d=(0,f.Ow)(t,17)^(0,f.Ow)(t,19)^t>>>10;i[e]=d+i[e-7]+c+i[e-16]|0}let{A:t,B:c,C:n,D:b,E:o,F:s,G:l,H:u}=this;for(let e=0;e<64;e++){const a=u+((0,f.Ow)(o,6)^(0,f.Ow)(o,11)^(0,f.Ow)(o,25))+((h=o)&s^~h&l)+r[e]+i[e]|0,p=((0,f.Ow)(t,2)^(0,f.Ow)(t,13)^(0,f.Ow)(t,22))+d(t,c,n)|0;u=l,l=s,s=o,o=b+a|0,b=n,n=c,c=t,t=a+p|0}var h;t=t+this.A|0,c=c+this.B|0,n=n+this.C|0,b=b+this.D|0,o=o+this.E|0,s=s+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(t,c,n,b,o,s,l,u)}roundClean(){i.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const o=(0,f.ld)((()=>new b))},10750:(e,a,t)=>{"use strict";t.d(a,{Vw:()=>l,$h:()=>b,tY:()=>h,Id:()=>s,O8:()=>r,po:()=>g,Ow:()=>n,ZJ:()=>o,DH:()=>d,ld:()=>p});const c="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,f=e=>e instanceof Uint8Array,d=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),r=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),n=(e,a)=>e<<32-a|e>>>a;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");const i=async()=>{};async function b(e,a,t){let c=Date.now();for(let f=0;f=0&&ee+a.length),0));let t=0;return e.forEach((e=>{if(!f(e))throw new Error("Uint8Array expected");a.set(e,t),t+=e.length})),a}class l{clone(){return this._cloneInto()}}const u={}.toString;function h(e,a){if(void 0!==a&&"[object Object]"!==u.call(a))throw new Error("Options should be object or undefined");return Object.assign(e,a)}function p(e){const a=a=>e().update(o(a)).digest(),t=e();return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=()=>e(),a}function g(e=32){if(c&&"function"==typeof c.getRandomValues)return c.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},63837:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},72079:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},3219:e=>{"use strict";e.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"}}')},62951:e=>{"use strict";e.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"}}')},64589:e=>{"use strict";e.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"}')},23241:e=>{"use strict";e.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"}}')},1636:e=>{"use strict";e.exports={rE:"6.5.7"}},15579:e=>{"use strict";e.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"}')}},__webpack_module_cache__={};function __webpack_require__(e){var a=__webpack_module_cache__[e];if(void 0!==a)return a.exports;var t=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(t.exports,t,t.exports,__webpack_require__),t.loaded=!0,t.exports}__webpack_require__.amdO={},__webpack_require__.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(a,{a}),a},__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{BatchBlockService:()=>d.B3,BatchEventsService:()=>d.JY,BatchTransactionService:()=>d.AF,Deposit:()=>r.dA,ENS__factory:()=>f.p2,ERC20__factory:()=>f.Xc,GET_DEPOSITS:()=>t.GET_DEPOSITS,GET_ECHO_EVENTS:()=>t.GET_ECHO_EVENTS,GET_ENCRYPTED_NOTES:()=>t.GET_ENCRYPTED_NOTES,GET_GOVERNANCE_APY:()=>t.GET_GOVERNANCE_APY,GET_GOVERNANCE_EVENTS:()=>t.GET_GOVERNANCE_EVENTS,GET_NOTE_ACCOUNTS:()=>t.GET_NOTE_ACCOUNTS,GET_REGISTERED:()=>t.GET_REGISTERED,GET_STATISTIC:()=>t.GET_STATISTIC,GET_WITHDRAWALS:()=>t.GET_WITHDRAWALS,Invoice:()=>r.qO,MAX_FEE:()=>g.KN,MAX_TOVARISH_EVENTS:()=>x.o,MIN_FEE:()=>g.Ss,MIN_STAKE_BALANCE:()=>g.pO,MerkleTreeService:()=>b.s,Mimc:()=>o.p,Multicall__factory:()=>f.Q2,NetId:()=>l.zr,NoteAccount:()=>n.Ad,OffchainOracle__factory:()=>f.Hk,OvmGasPriceOracle__factory:()=>f.Ld,Pedersen:()=>u.Hr,RelayerClient:()=>g.OR,ReverseRecords__factory:()=>f.Rp,TokenPriceOracle:()=>h.T,TornadoBrowserProvider:()=>p.D2,TornadoFeeOracle:()=>i.o,TornadoRpcSigner:()=>p.Vr,TornadoVoidSigner:()=>p.Gd,TornadoWallet:()=>p.nA,TovarishClient:()=>x.E,_META:()=>t._META,addNetwork:()=>l.AE,ajv:()=>c.SS,base64ToBytes:()=>y.Kp,bigIntReplacer:()=>y.gn,bnToBytes:()=>y.jm,buffPedersenHash:()=>u.UB,bufferToBytes:()=>y.lY,bytesToBN:()=>y.Ju,bytesToBase64:()=>y.if,bytesToHex:()=>y.My,calculateScore:()=>g.zy,calculateSnarkProof:()=>A.i,chunk:()=>y.iv,concatBytes:()=>y.Id,convertETHToTokenAmount:()=>i.N,createDeposit:()=>r.Hr,crypto:()=>y.Et,customConfig:()=>l.cX,defaultConfig:()=>l.sb,defaultUserAgent:()=>p.mJ,digest:()=>y.br,enabledChains:()=>l.Af,factories:()=>f.XB,fetch:()=>p.hd,fetchData:()=>p.Fd,fetchGetUrlFunc:()=>p.uY,getActiveTokenInstances:()=>l.oY,getActiveTokens:()=>l.h9,getAllDeposits:()=>t.getAllDeposits,getAllEncryptedNotes:()=>t.getAllEncryptedNotes,getAllGovernanceEvents:()=>t.getAllGovernanceEvents,getAllGraphEchoEvents:()=>t.getAllGraphEchoEvents,getAllRegisters:()=>t.getAllRegisters,getAllWithdrawals:()=>t.getAllWithdrawals,getConfig:()=>l.zj,getDeposits:()=>t.getDeposits,getEncryptedNotes:()=>t.getEncryptedNotes,getGovernanceEvents:()=>t.getGovernanceEvents,getGraphEchoEvents:()=>t.getGraphEchoEvents,getHttpAgent:()=>p.WU,getInstanceByAddress:()=>l.Zh,getMeta:()=>t.getMeta,getNetworkConfig:()=>l.RY,getNoteAccounts:()=>t.getNoteAccounts,getProvider:()=>p.sO,getProviderWithNetId:()=>p.MF,getRegisters:()=>t.getRegisters,getRelayerEnsSubdomains:()=>l.o2,getStatistic:()=>t.getStatistic,getStatusSchema:()=>c.c_,getSupportedInstances:()=>g.XF,getTokenBalances:()=>m.H,getWeightRandom:()=>g.c$,getWithdrawals:()=>t.getWithdrawals,hexToBytes:()=>y.aT,initGroth16:()=>A.O,isNode:()=>y.Ll,jobsSchema:()=>c.Us,leBuff2Int:()=>y.ae,leInt2Buff:()=>y.EI,mimc:()=>o.f,multicall:()=>s.C,packEncryptedMessage:()=>n.Fr,pedersen:()=>u.NO,pickWeightedRandomRelayer:()=>g.sN,populateTransaction:()=>p.zr,queryGraph:()=>t.queryGraph,rBigInt:()=>y.ib,sleep:()=>y.yy,substring:()=>y.uU,toFixedHex:()=>y.$W,toFixedLength:()=>y.sY,unpackEncryptedMessage:()=>n.ol,validateUrl:()=>y.wv});var e=__webpack_require__(94513),a={};for(const t in e)"default"!==t&&(a[t]=()=>e[t]);__webpack_require__.d(__webpack_exports__,a);var t=__webpack_require__(52049),c=__webpack_require__(7613),f=__webpack_require__(21278),d=__webpack_require__(9723),r=__webpack_require__(7240),n=__webpack_require__(33298),i=__webpack_require__(37182),b=__webpack_require__(5217),o=__webpack_require__(22901),s=__webpack_require__(48486),l=__webpack_require__(59499),u=__webpack_require__(85111),h=__webpack_require__(34525),p=__webpack_require__(68434),g=__webpack_require__(57194),m=__webpack_require__(7393),x=__webpack_require__(96838),y=__webpack_require__(67418),A=__webpack_require__(26746)})(),__webpack_exports__})())); \ No newline at end of file + deps: ${t}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:a.error,code(e){const[a,t]=function({schema:e}){const a={},t={};for(const c in e)"__proto__"!==c&&((Array.isArray(e[c])?a:t)[c]=e[c]);return[a,t]}(e);n(e,a),i(e,t)}};function n(e,a=e.schema){const{gen:t,data:f,it:r}=e;if(0===Object.keys(a).length)return;const n=t.let("missing");for(const i in a){const b=a[i];if(0===b.length)continue;const o=(0,d.propertyInData)(t,f,i,r.opts.ownProperties);e.setParams({property:i,depsCount:b.length,deps:b.join(", ")}),r.allErrors?t.if(o,(()=>{for(const a of b)(0,d.checkReportMissingProp)(e,a)})):(t.if(c._`${o} && (${(0,d.checkMissingProp)(e,b,n)})`),(0,d.reportMissingProp)(e,n),t.else())}}function i(e,a=e.schema){const{gen:t,data:c,keyword:r,it:n}=e,i=t.name("valid");for(const b in a)(0,f.alwaysValidSchema)(n,a[b])||(t.if((0,d.propertyInData)(t,c,b,n.opts.ownProperties),(()=>{const a=e.subschema({keyword:r,schemaProp:b},i);e.mergeValidEvaluated(a,i)}),(()=>t.var(i,!0))),e.ok(i))}a.validatePropertyDeps=n,a.validateSchemaDeps=i,a.default=r},1239:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>c.str`must match "${e.ifClause}" schema`,params:({params:e})=>c._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:a,parentSchema:t,it:d}=e;void 0===t.then&&void 0===t.else&&(0,f.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const n=r(d,"then"),i=r(d,"else");if(!n&&!i)return;const b=a.let("valid",!0),o=a.name("_valid");if(function(){const a=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},o);e.mergeEvaluated(a)}(),e.reset(),n&&i){const t=a.let("ifClause");e.setParams({ifClause:t}),a.if(o,s("then",t),s("else",t))}else n?a.if(o,s("then")):a.if((0,c.not)(o),s("else"));function s(t,f){return()=>{const d=e.subschema({keyword:t},o);a.assign(b,o),e.mergeValidEvaluated(d,b),f?a.assign(f,c._`${t}`):e.setParams({ifClause:t})}}e.pass(b,(()=>e.error(!0)))}};function r(e,a){const t=e.schema[a];return void 0!==t&&!(0,f.alwaysValidSchema)(e,t)}a.default=d},56378:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15457),f=t(65354),d=t(20494),r=t(93966),n=t(12661),i=t(83025),b=t(19713),o=t(38660),s=t(40117),l=t(45333),u=t(57923),h=t(16505),p=t(96163),g=t(15844),m=t(1239),x=t(14426);a.default=function(e=!1){const a=[u.default,h.default,p.default,g.default,m.default,x.default,b.default,o.default,i.default,s.default,l.default];return e?a.push(f.default,r.default):a.push(c.default,d.default),a.push(n.default),a}},20494:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateTuple=void 0;const c=t(99029),f=t(94227),d=t(15765),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:a,it:t}=e;if(Array.isArray(a))return n(e,"additionalItems",a);t.items=!0,(0,f.alwaysValidSchema)(t,a)||e.ok((0,d.validateArray)(e))}};function n(e,a,t=e.schema){const{gen:d,parentSchema:r,data:n,keyword:i,it:b}=e;!function(e){const{opts:c,errSchemaPath:d}=b,r=t.length,n=r===e.minItems&&(r===e.maxItems||!1===e[a]);if(c.strictTuples&&!n){const e=`"${i}" is ${r}-tuple, but minItems or maxItems/${a} are not specified or different at path "${d}"`;(0,f.checkStrictMode)(b,e,c.strictTuples)}}(r),b.opts.unevaluated&&t.length&&!0!==b.items&&(b.items=f.mergeEvaluated.items(d,t.length,b.items));const o=d.name("valid"),s=d.const("len",c._`${n}.length`);t.forEach(((a,t)=>{(0,f.alwaysValidSchema)(b,a)||(d.if(c._`${s} > ${t}`,(()=>e.subschema({keyword:i,schemaProp:t,dataProp:t},o))),e.ok(o))}))}a.validateTuple=n,a.default=r},93966:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(15765),r=t(15457),n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>c.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>c._`{limit: ${e}}`},code(e){const{schema:a,parentSchema:t,it:c}=e,{prefixItems:n}=t;c.items=!0,(0,f.alwaysValidSchema)(c,a)||(n?(0,r.validateAdditionalItems)(e,n):e.ok((0,d.validateArray)(e)))}};a.default=n},57923:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(94227),f={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:a,schema:t,it:f}=e;if((0,c.alwaysValidSchema)(f,t))return void e.fail();const d=a.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},d),e.failResult(d,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};a.default=f},96163:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>c._`{passingSchemas: ${e.passing}}`},code(e){const{gen:a,schema:t,parentSchema:d,it:r}=e;if(!Array.isArray(t))throw new Error("ajv implementation error");if(r.opts.discriminator&&d.discriminator)return;const n=t,i=a.let("valid",!1),b=a.let("passing",null),o=a.name("_valid");e.setParams({passing:b}),a.block((function(){n.forEach(((t,d)=>{let n;(0,f.alwaysValidSchema)(r,t)?a.var(o,!0):n=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},o),d>0&&a.if(c._`${o} && ${i}`).assign(i,!1).assign(b,c._`[${b}, ${d}]`).else(),a.if(o,(()=>{a.assign(i,!0),a.assign(b,d),n&&e.mergeEvaluated(n,c.Name)}))}))})),e.result(i,(()=>e.reset()),(()=>e.error(!0)))}};a.default=d},45333:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d=t(94227),r=t(94227),n={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:a,schema:t,data:n,parentSchema:i,it:b}=e,{opts:o}=b,s=(0,c.allSchemaProperties)(t),l=s.filter((e=>(0,d.alwaysValidSchema)(b,t[e])));if(0===s.length||l.length===s.length&&(!b.opts.unevaluated||!0===b.props))return;const u=o.strictSchema&&!o.allowMatchingProperties&&i.properties,h=a.name("valid");!0===b.props||b.props instanceof f.Name||(b.props=(0,r.evaluatedPropsToName)(a,b.props));const{props:p}=b;function g(e){for(const a in u)new RegExp(e).test(a)&&(0,d.checkStrictMode)(b,`property ${a} matches pattern ${e} (use allowMatchingProperties)`)}function m(t){a.forIn("key",n,(d=>{a.if(f._`${(0,c.usePattern)(e,t)}.test(${d})`,(()=>{const c=l.includes(t);c||e.subschema({keyword:"patternProperties",schemaProp:t,dataProp:d,dataPropType:r.Type.Str},h),b.opts.unevaluated&&!0!==p?a.assign(f._`${p}[${d}]`,!0):c||b.allErrors||a.if((0,f.not)(h),(()=>a.break()))}))}))}!function(){for(const e of s)u&&g(e),b.allErrors?m(e):(a.var(h,!0),m(e),a.if(h))}()}};a.default=n},65354:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(20494),f={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,c.validateTuple)(e,"items")};a.default=f},40117:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(62586),f=t(15765),d=t(94227),r=t(38660),n={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:a,schema:t,parentSchema:n,data:i,it:b}=e;"all"===b.opts.removeAdditional&&void 0===n.additionalProperties&&r.default.code(new c.KeywordCxt(b,r.default,"additionalProperties"));const o=(0,f.allSchemaProperties)(t);for(const e of o)b.definedProperties.add(e);b.opts.unevaluated&&o.length&&!0!==b.props&&(b.props=d.mergeEvaluated.props(a,(0,d.toHash)(o),b.props));const s=o.filter((e=>!(0,d.alwaysValidSchema)(b,t[e])));if(0===s.length)return;const l=a.name("valid");for(const t of s)u(t)?h(t):(a.if((0,f.propertyInData)(a,i,t,b.opts.ownProperties)),h(t),b.allErrors||a.else().var(l,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(l);function u(e){return b.opts.useDefaults&&!b.compositeRule&&void 0!==t[e].default}function h(a){e.subschema({keyword:"properties",schemaProp:a,dataProp:a},l)}}};a.default=n},19713:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>c._`{propertyName: ${e.propertyName}}`},code(e){const{gen:a,schema:t,data:d,it:r}=e;if((0,f.alwaysValidSchema)(r,t))return;const n=a.name("valid");a.forIn("key",d,(t=>{e.setParams({propertyName:t}),e.subschema({keyword:"propertyNames",data:t,dataTypes:["string"],propertyName:t,compositeRule:!0},n),a.if((0,c.not)(n),(()=>{e.error(!0),r.allErrors||a.break()}))})),e.ok(n)}};a.default=d},14426:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(94227),f={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:a,it:t}){void 0===a.if&&(0,c.checkStrictMode)(t,`"${e}" without "if" is ignored`)}};a.default=f},15765:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validateUnion=a.validateArray=a.usePattern=a.callValidateCode=a.schemaProperties=a.allSchemaProperties=a.noPropertyInData=a.propertyInData=a.isOwnProperty=a.hasPropFunc=a.reportMissingProp=a.checkMissingProp=a.checkReportMissingProp=void 0;const c=t(99029),f=t(94227),d=t(42023),r=t(94227);function n(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:c._`Object.prototype.hasOwnProperty`})}function i(e,a,t){return c._`${n(e)}.call(${a}, ${t})`}function b(e,a,t,f){const d=c._`${a}${(0,c.getProperty)(t)} === undefined`;return f?(0,c.or)(d,(0,c.not)(i(e,a,t))):d}function o(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}a.checkReportMissingProp=function(e,a){const{gen:t,data:f,it:d}=e;t.if(b(t,f,a,d.opts.ownProperties),(()=>{e.setParams({missingProperty:c._`${a}`},!0),e.error()}))},a.checkMissingProp=function({gen:e,data:a,it:{opts:t}},f,d){return(0,c.or)(...f.map((f=>(0,c.and)(b(e,a,f,t.ownProperties),c._`${d} = ${f}`))))},a.reportMissingProp=function(e,a){e.setParams({missingProperty:a},!0),e.error()},a.hasPropFunc=n,a.isOwnProperty=i,a.propertyInData=function(e,a,t,f){const d=c._`${a}${(0,c.getProperty)(t)} !== undefined`;return f?c._`${d} && ${i(e,a,t)}`:d},a.noPropertyInData=b,a.allSchemaProperties=o,a.schemaProperties=function(e,a){return o(a).filter((t=>!(0,f.alwaysValidSchema)(e,a[t])))},a.callValidateCode=function({schemaCode:e,data:a,it:{gen:t,topSchemaRef:f,schemaPath:r,errorPath:n},it:i},b,o,s){const l=s?c._`${e}, ${a}, ${f}${r}`:a,u=[[d.default.instancePath,(0,c.strConcat)(d.default.instancePath,n)],[d.default.parentData,i.parentData],[d.default.parentDataProperty,i.parentDataProperty],[d.default.rootData,d.default.rootData]];i.opts.dynamicRef&&u.push([d.default.dynamicAnchors,d.default.dynamicAnchors]);const h=c._`${l}, ${t.object(...u)}`;return o!==c.nil?c._`${b}.call(${o}, ${h})`:c._`${b}(${h})`};const s=c._`new RegExp`;a.usePattern=function({gen:e,it:{opts:a}},t){const f=a.unicodeRegExp?"u":"",{regExp:d}=a.code,n=d(t,f);return e.scopeValue("pattern",{key:n.toString(),ref:n,code:c._`${"new RegExp"===d.code?s:(0,r.useFunc)(e,d)}(${t}, ${f})`})},a.validateArray=function(e){const{gen:a,data:t,keyword:d,it:r}=e,n=a.name("valid");if(r.allErrors){const e=a.let("valid",!0);return i((()=>a.assign(e,!1))),e}return a.var(n,!0),i((()=>a.break())),n;function i(r){const i=a.const("len",c._`${t}.length`);a.forRange("i",0,i,(t=>{e.subschema({keyword:d,dataProp:t,dataPropType:f.Type.Num},n),a.if((0,c.not)(n),r)}))}},a.validateUnion=function(e){const{gen:a,schema:t,keyword:d,it:r}=e;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some((e=>(0,f.alwaysValidSchema)(r,e)))&&!r.opts.unevaluated)return;const n=a.let("valid",!1),i=a.name("_valid");a.block((()=>t.forEach(((t,f)=>{const r=e.subschema({keyword:d,schemaProp:f,compositeRule:!0},i);a.assign(n,c._`${n} || ${i}`),e.mergeValidEvaluated(r,i)||a.if((0,c.not)(n))})))),e.result(n,(()=>e.reset()),(()=>e.error(!0)))}},83463:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};a.default=t},72128:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(83463),f=t(13693),d=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",c.default,f.default];a.default=d},13693:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.callRef=a.getValidate=void 0;const c=t(34551),f=t(15765),d=t(99029),r=t(42023),n=t(73835),i=t(94227),b={keyword:"$ref",schemaType:"string",code(e){const{gen:a,schema:t,it:f}=e,{baseId:r,schemaEnv:i,validateName:b,opts:l,self:u}=f,{root:h}=i;if(("#"===t||"#/"===t)&&r===h.baseId)return function(){if(i===h)return s(e,b,i,i.$async);const t=a.scopeValue("root",{ref:h});return s(e,d._`${t}.validate`,h,h.$async)}();const p=n.resolveRef.call(u,h,r,t);if(void 0===p)throw new c.default(f.opts.uriResolver,r,t);return p instanceof n.SchemaEnv?function(a){const t=o(e,a);s(e,t,a,a.$async)}(p):function(c){const f=a.scopeValue("schema",!0===l.code.source?{ref:c,code:(0,d.stringify)(c)}:{ref:c}),r=a.name("valid"),n=e.subschema({schema:c,dataTypes:[],schemaPath:d.nil,topSchemaRef:f,errSchemaPath:t},r);e.mergeEvaluated(n),e.ok(r)}(p)}};function o(e,a){const{gen:t}=e;return a.validate?t.scopeValue("validate",{ref:a.validate}):d._`${t.scopeValue("wrapper",{ref:a})}.validate`}function s(e,a,t,c){const{gen:n,it:b}=e,{allErrors:o,schemaEnv:s,opts:l}=b,u=l.passContext?r.default.this:d.nil;function h(e){const a=d._`${e}.errors`;n.assign(r.default.vErrors,d._`${r.default.vErrors} === null ? ${a} : ${r.default.vErrors}.concat(${a})`),n.assign(r.default.errors,d._`${r.default.vErrors}.length`)}function p(e){var a;if(!b.opts.unevaluated)return;const c=null===(a=null==t?void 0:t.validate)||void 0===a?void 0:a.evaluated;if(!0!==b.props)if(c&&!c.dynamicProps)void 0!==c.props&&(b.props=i.mergeEvaluated.props(n,c.props,b.props));else{const a=n.var("props",d._`${e}.evaluated.props`);b.props=i.mergeEvaluated.props(n,a,b.props,d.Name)}if(!0!==b.items)if(c&&!c.dynamicItems)void 0!==c.items&&(b.items=i.mergeEvaluated.items(n,c.items,b.items));else{const a=n.var("items",d._`${e}.evaluated.items`);b.items=i.mergeEvaluated.items(n,a,b.items,d.Name)}}c?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const t=n.let("valid");n.try((()=>{n.code(d._`await ${(0,f.callValidateCode)(e,a,u)}`),p(a),o||n.assign(t,!0)}),(e=>{n.if(d._`!(${e} instanceof ${b.ValidationError})`,(()=>n.throw(e))),h(e),o||n.assign(t,!1)})),e.ok(t)}():e.result((0,f.callValidateCode)(e,a,u),(()=>p(a)),(()=>h(a)))}a.getValidate=o,a.callRef=s,a.default=b},36653:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(97652),d=t(73835),r=t(34551),n=t(94227),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:a}})=>e===f.DiscrError.Tag?`tag "${a}" must be string`:`value of tag "${a}" must be in oneOf`,params:({params:{discrError:e,tag:a,tagName:t}})=>c._`{error: ${e}, tag: ${t}, tagValue: ${a}}`},code(e){const{gen:a,data:t,schema:i,parentSchema:b,it:o}=e,{oneOf:s}=b;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=i.propertyName;if("string"!=typeof l)throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const u=a.let("valid",!1),h=a.const("tag",c._`${t}${(0,c.getProperty)(l)}`);function p(t){const f=a.name("valid"),d=e.subschema({keyword:"oneOf",schemaProp:t},f);return e.mergeEvaluated(d,c.Name),f}a.if(c._`typeof ${h} == "string"`,(()=>function(){const t=function(){var e;const a={},t=f(b);let c=!0;for(let a=0;ae.error(!1,{discrError:f.DiscrError.Tag,tag:h,tagName:l}))),e.ok(u)}};a.default=i},97652:(e,a)=>{"use strict";var t;Object.defineProperty(a,"__esModule",{value:!0}),a.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t||(a.DiscrError=t={}))},86144:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(72128),f=t(67060),d=t(56378),r=t(97532),n=t(69857),i=[c.default,f.default,(0,d.default)(),r.default,n.metadataVocabulary,n.contentVocabulary];a.default=i},94737:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>c.str`must match format "${e}"`,params:({schemaCode:e})=>c._`{format: ${e}}`},code(e,a){const{gen:t,data:f,$data:d,schema:r,schemaCode:n,it:i}=e,{opts:b,errSchemaPath:o,schemaEnv:s,self:l}=i;b.validateFormats&&(d?function(){const d=t.scopeValue("formats",{ref:l.formats,code:b.code.formats}),r=t.const("fDef",c._`${d}[${n}]`),i=t.let("fType"),o=t.let("format");t.if(c._`typeof ${r} == "object" && !(${r} instanceof RegExp)`,(()=>t.assign(i,c._`${r}.type || "string"`).assign(o,c._`${r}.validate`)),(()=>t.assign(i,c._`"string"`).assign(o,r))),e.fail$data((0,c.or)(!1===b.strictSchema?c.nil:c._`${n} && !${o}`,function(){const e=s.$async?c._`(${r}.async ? await ${o}(${f}) : ${o}(${f}))`:c._`${o}(${f})`,t=c._`(typeof ${o} == "function" ? ${e} : ${o}.test(${f}))`;return c._`${o} && ${o} !== true && ${i} === ${a} && !${t}`}()))}():function(){const d=l.formats[r];if(!d)return void function(){if(!1!==b.strictSchema)throw new Error(e());function e(){return`unknown format "${r}" ignored in schema at path "${o}"`}l.logger.warn(e())}();if(!0===d)return;const[n,i,u]=function(e){const a=e instanceof RegExp?(0,c.regexpCode)(e):b.code.formats?c._`${b.code.formats}${(0,c.getProperty)(r)}`:void 0,f=t.scopeValue("formats",{key:r,ref:e,code:a});return"object"!=typeof e||e instanceof RegExp?["string",e,f]:[e.type||"string",e.validate,c._`${f}.validate`]}(d);n===a&&e.pass(function(){if("object"==typeof d&&!(d instanceof RegExp)&&d.async){if(!s.$async)throw new Error("async format in sync schema");return c._`await ${u}(${f})`}return"function"==typeof i?c._`${u}(${f})`:c._`${u}.test(${f})`}())}())}};a.default=f},97532:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=[t(94737).default];a.default=c},69857:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.contentVocabulary=a.metadataVocabulary=void 0,a.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],a.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},27935:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(76250),r={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>c._`{allowedValue: ${e}}`},code(e){const{gen:a,data:t,$data:r,schemaCode:n,schema:i}=e;r||i&&"object"==typeof i?e.fail$data(c._`!${(0,f.useFunc)(a,d.default)}(${t}, ${n})`):e.fail(c._`${i} !== ${t}`)}};a.default=r},28643:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(76250),r={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>c._`{allowedValues: ${e}}`},code(e){const{gen:a,data:t,$data:r,schema:n,schemaCode:i,it:b}=e;if(!r&&0===n.length)throw new Error("enum must have non-empty array");const o=n.length>=b.opts.loopEnum;let s;const l=()=>null!=s?s:s=(0,f.useFunc)(a,d.default);let u;if(o||r)u=a.let("valid"),e.block$data(u,(function(){a.assign(u,!1),a.forOf("v",i,(e=>a.if(c._`${l()}(${t}, ${e})`,(()=>a.assign(u,!0).break()))))}));else{if(!Array.isArray(n))throw new Error("ajv implementation error");const e=a.const("vSchema",i);u=(0,c.or)(...n.map(((a,f)=>function(e,a){const f=n[a];return"object"==typeof f&&null!==f?c._`${l()}(${t}, ${e}[${a}])`:c._`${t} === ${f}`}(e,f))))}e.pass(u)}};a.default=r},67060:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(75882),f=t(63439),d=t(77307),r=t(90422),n=t(34486),i=t(34003),b=t(61163),o=t(60617),s=t(27935),l=t(28643),u=[c.default,f.default,d.default,r.default,n.default,i.default,b.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},s.default,l.default];a.default=u},61163:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:a}){const t="maxItems"===e?"more":"fewer";return c.str`must NOT have ${t} than ${a} items`},params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:a,data:t,schemaCode:f}=e,d="maxItems"===a?c.operators.GT:c.operators.LT;e.fail$data(c._`${t}.length ${d} ${f}`)}};a.default=f},77307:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=t(94227),d=t(53853),r={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:a}){const t="maxLength"===e?"more":"fewer";return c.str`must NOT have ${t} than ${a} characters`},params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:a,data:t,schemaCode:r,it:n}=e,i="maxLength"===a?c.operators.GT:c.operators.LT,b=!1===n.opts.unicode?c._`${t}.length`:c._`${(0,f.useFunc)(e.gen,d.default)}(${t})`;e.fail$data(c._`${b} ${i} ${r}`)}};a.default=r},75882:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f=c.operators,d={maximum:{okStr:"<=",ok:f.LTE,fail:f.GT},minimum:{okStr:">=",ok:f.GTE,fail:f.LT},exclusiveMaximum:{okStr:"<",ok:f.LT,fail:f.GTE},exclusiveMinimum:{okStr:">",ok:f.GT,fail:f.LTE}},r={message:({keyword:e,schemaCode:a})=>c.str`must be ${d[e].okStr} ${a}`,params:({keyword:e,schemaCode:a})=>c._`{comparison: ${d[e].okStr}, limit: ${a}}`},n={keyword:Object.keys(d),type:"number",schemaType:"number",$data:!0,error:r,code(e){const{keyword:a,data:t,schemaCode:f}=e;e.fail$data(c._`${t} ${d[a].fail} ${f} || isNaN(${t})`)}};a.default=n},34486:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:a}){const t="maxProperties"===e?"more":"fewer";return c.str`must NOT have ${t} than ${a} properties`},params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:a,data:t,schemaCode:f}=e,d="maxProperties"===a?c.operators.GT:c.operators.LT;e.fail$data(c._`Object.keys(${t}).length ${d} ${f}`)}};a.default=f},63439:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(99029),f={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>c.str`must be multiple of ${e}`,params:({schemaCode:e})=>c._`{multipleOf: ${e}}`},code(e){const{gen:a,data:t,schemaCode:f,it:d}=e,r=d.opts.multipleOfPrecision,n=a.let("res"),i=r?c._`Math.abs(Math.round(${n}) - ${n}) > 1e-${r}`:c._`${n} !== parseInt(${n})`;e.fail$data(c._`(${f} === 0 || (${n} = ${t}/${f}, ${i}))`)}};a.default=f},90422:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>f.str`must match pattern "${e}"`,params:({schemaCode:e})=>f._`{pattern: ${e}}`},code(e){const{data:a,$data:t,schema:d,schemaCode:r,it:n}=e,i=n.opts.unicodeRegExp?"u":"",b=t?f._`(new RegExp(${r}, ${i}))`:(0,c.usePattern)(e,d);e.fail$data(f._`!${b}.test(${a})`)}};a.default=d},34003:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(15765),f=t(99029),d=t(94227),r={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>f.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>f._`{missingProperty: ${e}}`},code(e){const{gen:a,schema:t,schemaCode:r,data:n,$data:i,it:b}=e,{opts:o}=b;if(!i&&0===t.length)return;const s=t.length>=o.loopRequired;if(b.allErrors?function(){if(s||i)e.block$data(f.nil,l);else for(const a of t)(0,c.checkReportMissingProp)(e,a)}():function(){const d=a.let("missing");if(s||i){const t=a.let("valid",!0);e.block$data(t,(()=>function(t,d){e.setParams({missingProperty:t}),a.forOf(t,r,(()=>{a.assign(d,(0,c.propertyInData)(a,n,t,o.ownProperties)),a.if((0,f.not)(d),(()=>{e.error(),a.break()}))}),f.nil)}(d,t))),e.ok(t)}else a.if((0,c.checkMissingProp)(e,t,d)),(0,c.reportMissingProp)(e,d),a.else()}(),o.strictRequired){const a=e.parentSchema.properties,{definedProperties:c}=e.it;for(const e of t)if(void 0===(null==a?void 0:a[e])&&!c.has(e)){const a=`required property "${e}" is not defined at "${b.schemaEnv.baseId+b.errSchemaPath}" (strictRequired)`;(0,d.checkStrictMode)(b,a,b.opts.strictRequired)}}function l(){a.forOf("prop",r,(t=>{e.setParams({missingProperty:t}),a.if((0,c.noPropertyInData)(a,n,t,o.ownProperties),(()=>e.error()))}))}}};a.default=r},60617:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});const c=t(10208),f=t(99029),d=t(94227),r=t(76250),n={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:a}})=>f.str`must NOT have duplicate items (items ## ${a} and ${e} are identical)`,params:({params:{i:e,j:a}})=>f._`{i: ${e}, j: ${a}}`},code(e){const{gen:a,data:t,$data:n,schema:i,parentSchema:b,schemaCode:o,it:s}=e;if(!n&&!i)return;const l=a.let("valid"),u=b.items?(0,c.getSchemaTypes)(b.items):[];function h(d,r){const n=a.name("item"),i=(0,c.checkDataTypes)(u,n,s.opts.strictNumbers,c.DataType.Wrong),b=a.const("indices",f._`{}`);a.for(f._`;${d}--;`,(()=>{a.let(n,f._`${t}[${d}]`),a.if(i,f._`continue`),u.length>1&&a.if(f._`typeof ${n} == "string"`,f._`${n} += "_"`),a.if(f._`typeof ${b}[${n}] == "number"`,(()=>{a.assign(r,f._`${b}[${n}]`),e.error(),a.assign(l,!1).break()})).code(f._`${b}[${n}] = ${d}`)}))}function p(c,n){const i=(0,d.useFunc)(a,r.default),b=a.name("outer");a.label(b).for(f._`;${c}--;`,(()=>a.for(f._`${n} = ${c}; ${n}--;`,(()=>a.if(f._`${i}(${t}[${c}], ${t}[${n}])`,(()=>{e.error(),a.assign(l,!1).break(b)}))))))}e.block$data(l,(function(){const c=a.let("i",f._`${t}.length`),d=a.let("j");e.setParams({i:c,j:d}),a.assign(l,!0),a.if(f._`${c} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?h:p)(c,d)))}),f._`${o} === false`),e.ok(l)}};a.default=n},87568:(e,a,t)=>{var c=a;c.bignum=t(72344),c.define=t(47363).define,c.base=t(9673),c.constants=t(22153),c.decoders=t(22853),c.encoders=t(24669)},47363:(e,a,t)=>{var c=t(87568),f=t(56698);function d(e,a){this.name=e,this.body=a,this.decoders={},this.encoders={}}a.define=function(e,a){return new d(e,a)},d.prototype._createNamed=function(e){var a;try{a=t(68961).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){a=function(e){this._initNamed(e)}}return f(a,e),a.prototype._initNamed=function(a){e.call(this,a)},new a(this)},d.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(c.decoders[e])),this.decoders[e]},d.prototype.decode=function(e,a,t){return this._getDecoder(a).decode(e,t)},d.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(c.encoders[e])),this.encoders[e]},d.prototype.encode=function(e,a,t){return this._getEncoder(a).encode(e,t)}},47227:(e,a,t)=>{var c=t(56698),f=t(9673).Reporter,d=t(48287).Buffer;function r(e,a){f.call(this,a),d.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function n(e,a){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return e instanceof n||(e=new n(e,a)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return a.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=d.byteLength(e);else{if(!d.isBuffer(e))return a.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}c(r,f),a.t=r,r.prototype.save=function(){return{offset:this.offset,reporter:f.prototype.save.call(this)}},r.prototype.restore=function(e){var a=new r(this.base);return a.offset=e.offset,a.length=this.offset,this.offset=e.offset,f.prototype.restore.call(this,e.reporter),a},r.prototype.isEmpty=function(){return this.offset===this.length},r.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},r.prototype.skip=function(e,a){if(!(this.offset+e<=this.length))return this.error(a||"DecoderBuffer overrun");var t=new r(this.base);return t._reporterState=this._reporterState,t.offset=this.offset,t.length=this.offset+e,this.offset+=e,t},r.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},a.d=n,n.prototype.join=function(e,a){return e||(e=new d(this.length)),a||(a=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(t){t.join(e,a),a+=t.length})):("number"==typeof this.value?e[a]=this.value:"string"==typeof this.value?e.write(this.value,a):d.isBuffer(this.value)&&this.value.copy(e,a),a+=this.length)),e}},9673:(e,a,t)=>{var c=a;c.Reporter=t(89220).a,c.DecoderBuffer=t(47227).t,c.EncoderBuffer=t(47227).d,c.Node=t(90993)},90993:(e,a,t)=>{var c=t(9673).Reporter,f=t(9673).EncoderBuffer,d=t(9673).DecoderBuffer,r=t(43349),n=["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"],i=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(n);function b(e,a){var t={};this._baseState=t,t.enc=e,t.parent=a||null,t.children=null,t.tag=null,t.args=null,t.reverseArgs=null,t.choice=null,t.optional=!1,t.any=!1,t.obj=!1,t.use=null,t.useDecoder=null,t.key=null,t.default=null,t.explicit=null,t.implicit=null,t.contains=null,t.parent||(t.children=[],this._wrap())}e.exports=b;var o=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];b.prototype.clone=function(){var e=this._baseState,a={};o.forEach((function(t){a[t]=e[t]}));var t=new this.constructor(a.parent);return t._baseState=a,t},b.prototype._wrap=function(){var e=this._baseState;i.forEach((function(a){this[a]=function(){var t=new this.constructor(this);return e.children.push(t),t[a].apply(t,arguments)}}),this)},b.prototype._init=function(e){var a=this._baseState;r(null===a.parent),e.call(this),a.children=a.children.filter((function(e){return e._baseState.parent===this}),this),r.equal(a.children.length,1,"Root node can have only one child")},b.prototype._useArgs=function(e){var a=this._baseState,t=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==t.length&&(r(null===a.children),a.children=t,t.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(r(null===a.args),a.args=e,a.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;var a={};return Object.keys(e).forEach((function(t){t==(0|t)&&(t|=0);var c=e[t];a[c]=t})),a})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){b.prototype[e]=function(){var a=this._baseState;throw new Error(e+" not implemented for encoding: "+a.enc)}})),n.forEach((function(e){b.prototype[e]=function(){var a=this._baseState,t=Array.prototype.slice.call(arguments);return r(null===a.tag),a.tag=e,this._useArgs(t),this}})),b.prototype.use=function(e){r(e);var a=this._baseState;return r(null===a.use),a.use=e,this},b.prototype.optional=function(){return this._baseState.optional=!0,this},b.prototype.def=function(e){var a=this._baseState;return r(null===a.default),a.default=e,a.optional=!0,this},b.prototype.explicit=function(e){var a=this._baseState;return r(null===a.explicit&&null===a.implicit),a.explicit=e,this},b.prototype.implicit=function(e){var a=this._baseState;return r(null===a.explicit&&null===a.implicit),a.implicit=e,this},b.prototype.obj=function(){var e=this._baseState,a=Array.prototype.slice.call(arguments);return e.obj=!0,0!==a.length&&this._useArgs(a),this},b.prototype.key=function(e){var a=this._baseState;return r(null===a.key),a.key=e,this},b.prototype.any=function(){return this._baseState.any=!0,this},b.prototype.choice=function(e){var a=this._baseState;return r(null===a.choice),a.choice=e,this._useArgs(Object.keys(e).map((function(a){return e[a]}))),this},b.prototype.contains=function(e){var a=this._baseState;return r(null===a.use),a.contains=e,this},b.prototype._decode=function(e,a){var t=this._baseState;if(null===t.parent)return e.wrapResult(t.children[0]._decode(e,a));var c,f=t.default,r=!0,n=null;if(null!==t.key&&(n=e.enterKey(t.key)),t.optional){var i=null;if(null!==t.explicit?i=t.explicit:null!==t.implicit?i=t.implicit:null!==t.tag&&(i=t.tag),null!==i||t.any){if(r=this._peekTag(e,i,t.any),e.isError(r))return r}else{var b=e.save();try{null===t.choice?this._decodeGeneric(t.tag,e,a):this._decodeChoice(e,a),r=!0}catch(e){r=!1}e.restore(b)}}if(t.obj&&r&&(c=e.enterObject()),r){if(null!==t.explicit){var o=this._decodeTag(e,t.explicit);if(e.isError(o))return o;e=o}var s=e.offset;if(null===t.use&&null===t.choice){t.any&&(b=e.save());var l=this._decodeTag(e,null!==t.implicit?t.implicit:t.tag,t.any);if(e.isError(l))return l;t.any?f=e.raw(b):e=l}if(a&&a.track&&null!==t.tag&&a.track(e.path(),s,e.length,"tagged"),a&&a.track&&null!==t.tag&&a.track(e.path(),e.offset,e.length,"content"),t.any||(f=null===t.choice?this._decodeGeneric(t.tag,e,a):this._decodeChoice(e,a)),e.isError(f))return f;if(t.any||null!==t.choice||null===t.children||t.children.forEach((function(t){t._decode(e,a)})),t.contains&&("octstr"===t.tag||"bitstr"===t.tag)){var u=new d(f);f=this._getUse(t.contains,e._reporterState.obj)._decode(u,a)}}return t.obj&&r&&(f=e.leaveObject(c)),null===t.key||null===f&&!0!==r?null!==n&&e.exitKey(n):e.leaveKey(n,t.key,f),f},b.prototype._decodeGeneric=function(e,a,t){var c=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(a,e,c.args[0],t):/str$/.test(e)?this._decodeStr(a,e,t):"objid"===e&&c.args?this._decodeObjid(a,c.args[0],c.args[1],t):"objid"===e?this._decodeObjid(a,null,null,t):"gentime"===e||"utctime"===e?this._decodeTime(a,e,t):"null_"===e?this._decodeNull(a,t):"bool"===e?this._decodeBool(a,t):"objDesc"===e?this._decodeStr(a,e,t):"int"===e||"enum"===e?this._decodeInt(a,c.args&&c.args[0],t):null!==c.use?this._getUse(c.use,a._reporterState.obj)._decode(a,t):a.error("unknown tag: "+e)},b.prototype._getUse=function(e,a){var t=this._baseState;return t.useDecoder=this._use(e,a),r(null===t.useDecoder._baseState.parent),t.useDecoder=t.useDecoder._baseState.children[0],t.implicit!==t.useDecoder._baseState.implicit&&(t.useDecoder=t.useDecoder.clone(),t.useDecoder._baseState.implicit=t.implicit),t.useDecoder},b.prototype._decodeChoice=function(e,a){var t=this._baseState,c=null,f=!1;return Object.keys(t.choice).some((function(d){var r=e.save(),n=t.choice[d];try{var i=n._decode(e,a);if(e.isError(i))return!1;c={type:d,value:i},f=!0}catch(a){return e.restore(r),!1}return!0}),this),f?c:e.error("Choice not matched")},b.prototype._createEncoderBuffer=function(e){return new f(e,this.reporter)},b.prototype._encode=function(e,a,t){var c=this._baseState;if(null===c.default||c.default!==e){var f=this._encodeValue(e,a,t);if(void 0!==f&&!this._skipDefault(f,a,t))return f}},b.prototype._encodeValue=function(e,a,t){var f=this._baseState;if(null===f.parent)return f.children[0]._encode(e,a||new c);var d=null;if(this.reporter=a,f.optional&&void 0===e){if(null===f.default)return;e=f.default}var r=null,n=!1;if(f.any)d=this._createEncoderBuffer(e);else if(f.choice)d=this._encodeChoice(e,a);else if(f.contains)r=this._getUse(f.contains,t)._encode(e,a),n=!0;else if(f.children)r=f.children.map((function(t){if("null_"===t._baseState.tag)return t._encode(null,a,e);if(null===t._baseState.key)return a.error("Child should have a key");var c=a.enterKey(t._baseState.key);if("object"!=typeof e)return a.error("Child expected, but input is not object");var f=t._encode(e[t._baseState.key],a,e);return a.leaveKey(c),f}),this).filter((function(e){return e})),r=this._createEncoderBuffer(r);else if("seqof"===f.tag||"setof"===f.tag){if(!f.args||1!==f.args.length)return a.error("Too many args for : "+f.tag);if(!Array.isArray(e))return a.error("seqof/setof, but data is not Array");var i=this.clone();i._baseState.implicit=null,r=this._createEncoderBuffer(e.map((function(t){var c=this._baseState;return this._getUse(c.args[0],e)._encode(t,a)}),i))}else null!==f.use?d=this._getUse(f.use,t)._encode(e,a):(r=this._encodePrimitive(f.tag,e),n=!0);if(!f.any&&null===f.choice){var b=null!==f.implicit?f.implicit:f.tag,o=null===f.implicit?"universal":"context";null===b?null===f.use&&a.error("Tag could be omitted only for .use()"):null===f.use&&(d=this._encodeComposite(b,n,o,r))}return null!==f.explicit&&(d=this._encodeComposite(f.explicit,!1,"context",d)),d},b.prototype._encodeChoice=function(e,a){var t=this._baseState,c=t.choice[e.type];return c||r(!1,e.type+" not found in "+JSON.stringify(Object.keys(t.choice))),c._encode(e.value,a)},b.prototype._encodePrimitive=function(e,a){var t=this._baseState;if(/str$/.test(e))return this._encodeStr(a,e);if("objid"===e&&t.args)return this._encodeObjid(a,t.reverseArgs[0],t.args[1]);if("objid"===e)return this._encodeObjid(a,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(a,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(a,t.args&&t.reverseArgs[0]);if("bool"===e)return this._encodeBool(a);if("objDesc"===e)return this._encodeStr(a,e);throw new Error("Unsupported tag: "+e)},b.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},b.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},89220:(e,a,t)=>{var c=t(56698);function f(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function d(e,a){this.path=e,this.rethrow(a)}a.a=f,f.prototype.isError=function(e){return e instanceof d},f.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},f.prototype.restore=function(e){var a=this._reporterState;a.obj=e.obj,a.path=a.path.slice(0,e.pathLen)},f.prototype.enterKey=function(e){return this._reporterState.path.push(e)},f.prototype.exitKey=function(e){var a=this._reporterState;a.path=a.path.slice(0,e-1)},f.prototype.leaveKey=function(e,a,t){var c=this._reporterState;this.exitKey(e),null!==c.obj&&(c.obj[a]=t)},f.prototype.path=function(){return this._reporterState.path.join("/")},f.prototype.enterObject=function(){var e=this._reporterState,a=e.obj;return e.obj={},a},f.prototype.leaveObject=function(e){var a=this._reporterState,t=a.obj;return a.obj=e,t},f.prototype.error=function(e){var a,t=this._reporterState,c=e instanceof d;if(a=c?e:new d(t.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!t.options.partial)throw a;return c||t.errors.push(a),a},f.prototype.wrapResult=function(e){var a=this._reporterState;return a.options.partial?{result:this.isError(e)?null:e,errors:a.errors}:e},c(d,Error),d.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,d),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},74598:(e,a,t)=>{var c=t(22153);a.tagClass={0:"universal",1:"application",2:"context",3:"private"},a.tagClassByName=c._reverse(a.tagClass),a.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"},a.tagByName=c._reverse(a.tag)},22153:(e,a,t)=>{var c=a;c._reverse=function(e){var a={};return Object.keys(e).forEach((function(t){(0|t)==t&&(t|=0);var c=e[t];a[c]=t})),a},c.der=t(74598)},62010:(e,a,t)=>{var c=t(56698),f=t(87568),d=f.base,r=f.bignum,n=f.constants.der;function i(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new b,this.tree._init(e.body)}function b(e){d.Node.call(this,"der",e)}function o(e,a){var t=e.readUInt8(a);if(e.isError(t))return t;var c=n.tagClass[t>>6],f=!(32&t);if(31&~t)t&=31;else{var d=t;for(t=0;!(128&~d);){if(d=e.readUInt8(a),e.isError(d))return d;t<<=7,t|=127&d}}return{cls:c,primitive:f,tag:t,tagStr:n.tag[t]}}function s(e,a,t){var c=e.readUInt8(t);if(e.isError(c))return c;if(!a&&128===c)return null;if(!(128&c))return c;var f=127&c;if(f>4)return e.error("length octect is too long");c=0;for(var d=0;d{var c=a;c.der=t(62010),c.pem=t(58903)},58903:(e,a,t)=>{var c=t(56698),f=t(48287).Buffer,d=t(62010);function r(e){d.call(this,e),this.enc="pem"}c(r,d),e.exports=r,r.prototype.decode=function(e,a){for(var t=e.toString().split(/[\r\n]+/g),c=a.label.toUpperCase(),r=/^-----(BEGIN|END) ([^-]+)-----$/,n=-1,i=-1,b=0;b{var c=t(56698),f=t(48287).Buffer,d=t(87568),r=d.base,n=d.constants.der;function i(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new b,this.tree._init(e.body)}function b(e){r.Node.call(this,"der",e)}function o(e){return e<10?"0"+e:e}e.exports=i,i.prototype.encode=function(e,a){return this.tree._encode(e,a).join()},c(b,r.Node),b.prototype._encodeComposite=function(e,a,t,c){var d,r=function(e,a,t,c){var f;if("seqof"===e?e="seq":"setof"===e&&(e="set"),n.tagByName.hasOwnProperty(e))f=n.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return c.error("Unknown tag: "+e);f=e}return f>=31?c.error("Multi-octet tag encoding unsupported"):(a||(f|=32),f|=n.tagClassByName[t||"universal"]<<6)}(e,a,t,this.reporter);if(c.length<128)return(d=new f(2))[0]=r,d[1]=c.length,this._createEncoderBuffer([d,c]);for(var i=1,b=c.length;b>=256;b>>=8)i++;(d=new f(2+i))[0]=r,d[1]=128|i,b=1+i;for(var o=c.length;o>0;b--,o>>=8)d[b]=255&o;return this._createEncoderBuffer([d,c])},b.prototype._encodeStr=function(e,a){if("bitstr"===a)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===a){for(var t=new f(2*e.length),c=0;c=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var d=0;for(c=0;c=128;r>>=7)d++}var n=new f(d),i=n.length-1;for(c=e.length-1;c>=0;c--)for(r=e[c],n[i--]=127&r;(r>>=7)>0;)n[i--]=128|127&r;return this._createEncoderBuffer(n)},b.prototype._encodeTime=function(e,a){var t,c=new Date(e);return"gentime"===a?t=[o(c.getFullYear()),o(c.getUTCMonth()+1),o(c.getUTCDate()),o(c.getUTCHours()),o(c.getUTCMinutes()),o(c.getUTCSeconds()),"Z"].join(""):"utctime"===a?t=[o(c.getFullYear()%100),o(c.getUTCMonth()+1),o(c.getUTCDate()),o(c.getUTCHours()),o(c.getUTCMinutes()),o(c.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+a+" time is not supported yet"),this._encodeStr(t,"octstr")},b.prototype._encodeNull=function(){return this._createEncoderBuffer("")},b.prototype._encodeInt=function(e,a){if("string"==typeof e){if(!a)return this.reporter.error("String int or enum given, but no values map");if(!a.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=a[e]}if("number"!=typeof e&&!f.isBuffer(e)){var t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=new f(t)}if(f.isBuffer(e)){var c=e.length;0===e.length&&c++;var d=new f(c);return e.copy(d),0===e.length&&(d[0]=0),this._createEncoderBuffer(d)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);c=1;for(var r=e;r>=256;r>>=8)c++;for(r=(d=new Array(c)).length-1;r>=0;r--)d[r]=255&e,e>>=8;return 128&d[0]&&d.unshift(0),this._createEncoderBuffer(new f(d))},b.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},b.prototype._use=function(e,a){return"function"==typeof e&&(e=e(a)),e._getEncoder("der").tree},b.prototype._skipDefault=function(e,a,t){var c,f=this._baseState;if(null===f.default)return!1;var d=e.join();if(void 0===f.defaultBuffer&&(f.defaultBuffer=this._encodeValue(f.default,a,t).join()),d.length!==f.defaultBuffer.length)return!1;for(c=0;c{var c=a;c.der=t(70082),c.pem=t(90735)},90735:(e,a,t)=>{var c=t(56698),f=t(70082);function d(e){f.call(this,e),this.enc="pem"}c(d,f),e.exports=d,d.prototype.encode=function(e,a){for(var t=f.prototype.encode.call(this,e).toString("base64"),c=["-----BEGIN "+a.label+"-----"],d=0;d=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,T=R>>>13,D=0|r[9],F=8191&D,Q=D>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(T,j)|0,d=Math.imul(T,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(T,q)|0,d=d+Math.imul(T,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(T,K)|0,d=d+Math.imul(T,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(T,J)|0,d=d+Math.imul(T,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(T,X)|0,d=d+Math.imul(T,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(T,te)|0,d=d+Math.imul(T,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(T,de)|0,d=d+Math.imul(T,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(T,ie)|0,d=d+Math.imul(T,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(T,se)|0,d=d+Math.imul(T,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(T,he)|0))<<13)|0;b=((d=d+Math.imul(T,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},94148:(e,a,t)=>{"use strict";function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function f(e,a){for(var t=0;t1?t-1:0),f=1;f1?t-1:0),f=1;f1?t-1:0),f=1;f1?t-1:0),f=1;f{"use strict";function c(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);a&&(c=c.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,c)}return t}function f(e){for(var a=1;ae.length)&&(t=e.length),e.substring(t-a.length,t)===a}var x="",y="",A="",v="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var a=Object.keys(e),t=Object.create(Object.getPrototypeOf(e));return a.forEach((function(a){t[a]=e[a]})),Object.defineProperty(t,"message",{value:e.message}),t}function I(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var E=function(e,a){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&l(e,a)}(E,e);var t,c,r,b,o=(t=E,c=s(),function(){var e,a=u(t);if(c){var f=u(this).constructor;e=Reflect.construct(a,arguments,f)}else e=a.apply(this,arguments);return n(this,e)});function E(e){var a;if(function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,E),"object"!==h(e)||null===e)throw new g("options","Object",e);var t=e.message,c=e.operator,f=e.stackStartFn,d=e.actual,r=e.expected,b=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=t)a=o.call(this,String(t));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&1!==process.stderr.getColorDepth()?(x="",y="",v="",A=""):(x="",y="",v="",A="")),"object"===h(d)&&null!==d&&"object"===h(r)&&null!==r&&"stack"in d&&d instanceof Error&&"stack"in r&&r instanceof Error&&(d=_(d),r=_(r)),"deepStrictEqual"===c||"strictEqual"===c)a=o.call(this,function(e,a,t){var c="",f="",d=0,r="",n=!1,i=I(e),b=i.split("\n"),o=I(a).split("\n"),s=0,l="";if("strictEqual"===t&&"object"===h(e)&&"object"===h(a)&&null!==e&&null!==a&&(t="strictEqualObject"),1===b.length&&1===o.length&&b[0]!==o[0]){var u=b[0].length+o[0].length;if(u<=10){if(!("object"===h(e)&&null!==e||"object"===h(a)&&null!==a||0===e&&0===a))return"".concat(w[t],"\n\n")+"".concat(b[0]," !== ").concat(o[0],"\n")}else if("strictEqualObject"!==t&&u<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;b[0][s]===o[0][s];)s++;s>2&&(l="\n ".concat(function(e,a){if(a=Math.floor(a),0==e.length||0==a)return"";var t=e.length*a;for(a=Math.floor(Math.log(a)/Math.log(2));a;)e+=e,a--;return e+e.substring(0,t-e.length)}(" ",s),"^"),s=0)}}for(var p=b[b.length-1],g=o[o.length-1];p===g&&(s++<2?r="\n ".concat(p).concat(r):c=p,b.pop(),o.pop(),0!==b.length&&0!==o.length);)p=b[b.length-1],g=o[o.length-1];var _=Math.max(b.length,o.length);if(0===_){var E=i.split("\n");if(E.length>30)for(E[26]="".concat(x,"...").concat(v);E.length>27;)E.pop();return"".concat(w.notIdentical,"\n\n").concat(E.join("\n"),"\n")}s>3&&(r="\n".concat(x,"...").concat(v).concat(r),n=!0),""!==c&&(r="\n ".concat(c).concat(r),c="");var C=0,M=w[t]+"\n".concat(y,"+ actual").concat(v," ").concat(A,"- expected").concat(v),B=" ".concat(x,"...").concat(v," Lines skipped");for(s=0;s<_;s++){var L=s-d;if(b.length1&&s>2&&(L>4?(f+="\n".concat(x,"...").concat(v),n=!0):L>3&&(f+="\n ".concat(o[s-2]),C++),f+="\n ".concat(o[s-1]),C++),d=s,c+="\n".concat(A,"-").concat(v," ").concat(o[s]),C++;else if(o.length1&&s>2&&(L>4?(f+="\n".concat(x,"...").concat(v),n=!0):L>3&&(f+="\n ".concat(b[s-2]),C++),f+="\n ".concat(b[s-1]),C++),d=s,f+="\n".concat(y,"+").concat(v," ").concat(b[s]),C++;else{var S=o[s],k=b[s],N=k!==S&&(!m(k,",")||k.slice(0,-1)!==S);N&&m(S,",")&&S.slice(0,-1)===k&&(N=!1,k+=","),N?(L>1&&s>2&&(L>4?(f+="\n".concat(x,"...").concat(v),n=!0):L>3&&(f+="\n ".concat(b[s-2]),C++),f+="\n ".concat(b[s-1]),C++),d=s,f+="\n".concat(y,"+").concat(v," ").concat(k),c+="\n".concat(A,"-").concat(v," ").concat(S),C+=2):(f+=c,c="",1!==L&&0!==s||(f+="\n ".concat(k),C++))}if(C>20&&s<_-2)return"".concat(M).concat(B,"\n").concat(f,"\n").concat(x,"...").concat(v).concat(c,"\n")+"".concat(x,"...").concat(v)}return"".concat(M).concat(n?B:"","\n").concat(f).concat(c).concat(r).concat(l)}(d,r,c));else if("notDeepStrictEqual"===c||"notStrictEqual"===c){var s=w[c],l=I(d).split("\n");if("notStrictEqual"===c&&"object"===h(d)&&null!==d&&(s=w.notStrictEqualObject),l.length>30)for(l[26]="".concat(x,"...").concat(v);l.length>27;)l.pop();a=1===l.length?o.call(this,"".concat(s," ").concat(l[0])):o.call(this,"".concat(s,"\n\n").concat(l.join("\n"),"\n"))}else{var u=I(d),p="",C=w[c];"notDeepEqual"===c||"notEqual"===c?(u="".concat(w[c],"\n\n").concat(u)).length>1024&&(u="".concat(u.slice(0,1021),"...")):(p="".concat(I(r)),u.length>512&&(u="".concat(u.slice(0,509),"...")),p.length>512&&(p="".concat(p.slice(0,509),"...")),"deepEqual"===c||"equal"===c?u="".concat(C,"\n\n").concat(u,"\n\nshould equal\n\n"):p=" ".concat(c," ").concat(p)),a=o.call(this,"".concat(u).concat(p))}return Error.stackTraceLimit=b,a.generatedMessage=!t,Object.defineProperty(i(a),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),a.code="ERR_ASSERTION",a.actual=d,a.expected=r,a.operator=c,Error.captureStackTrace&&Error.captureStackTrace(i(a),f),a.stack,a.name="AssertionError",n(a)}return r=E,(b=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:a,value:function(e,a){return p(this,f(f({},a),{},{customInspect:!1,depth:0}))}}])&&d(r.prototype,b),Object.defineProperty(r,"prototype",{writable:!1}),E}(b(Error),p.custom);e.exports=E},69597:(e,a,t)=>{"use strict";function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function f(e,a){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,a){return e.__proto__=a,e},f(e,a)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}var r,n,i={};function b(e,a,t){t||(t=Error);var r=function(t){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&f(e,a)}(o,t);var r,n,i,b=(n=o,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=d(n);if(i){var t=d(this).constructor;e=Reflect.construct(a,arguments,t)}else e=a.apply(this,arguments);return function(e,a){if(a&&("object"===c(a)||"function"==typeof a))return a;if(void 0!==a)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function o(t,c,f){var d;return function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,o),d=b.call(this,function(e,t,c){return"string"==typeof a?a:a(e,t,c)}(t,c,f)),d.code=e,d}return r=o,Object.defineProperty(r,"prototype",{writable:!1}),r}(t);i[e]=r}function o(e,a){if(Array.isArray(e)){var t=e.length;return e=e.map((function(e){return String(e)})),t>2?"one of ".concat(a," ").concat(e.slice(0,t-1).join(", "),", or ")+e[t-1]:2===t?"one of ".concat(a," ").concat(e[0]," or ").concat(e[1]):"of ".concat(a," ").concat(e[0])}return"of ".concat(a," ").concat(String(e))}b("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),b("ERR_INVALID_ARG_TYPE",(function(e,a,f){var d,n,i,b,s;if(void 0===r&&(r=t(94148)),r("string"==typeof e,"'name' must be a string"),"string"==typeof a&&(n="not ",a.substr(0,4)===n)?(d="must not be",a=a.replace(/^not /,"")):d="must be",function(e,a,t){return(void 0===t||t>e.length)&&(t=e.length),e.substring(t-9,t)===a}(e," argument"))i="The ".concat(e," ").concat(d," ").concat(o(a,"type"));else{var l=("number"!=typeof s&&(s=0),s+1>(b=e).length||-1===b.indexOf(".",s)?"argument":"property");i='The "'.concat(e,'" ').concat(l," ").concat(d," ").concat(o(a,"type"))}return i+". Received type ".concat(c(f))}),TypeError),b("ERR_INVALID_ARG_VALUE",(function(e,a){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===n&&(n=t(40537));var f=n.inspect(a);return f.length>128&&(f="".concat(f.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(c,". Received ").concat(f)}),TypeError,RangeError),b("ERR_INVALID_RETURN_VALUE",(function(e,a,t){var f;return f=t&&t.constructor&&t.constructor.name?"instance of ".concat(t.constructor.name):"type ".concat(c(t)),"Expected ".concat(e,' to be returned from the "').concat(a,'"')+" function but got ".concat(f,".")}),TypeError),b("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,a=new Array(e),c=0;c0,"At least one arg needs to be specified");var f="The ",d=a.length;switch(a=a.map((function(e){return'"'.concat(e,'"')})),d){case 1:f+="".concat(a[0]," argument");break;case 2:f+="".concat(a[0]," and ").concat(a[1]," arguments");break;default:f+=a.slice(0,d-1).join(", "),f+=", and ".concat(a[d-1]," arguments")}return"".concat(f," must be specified")}),TypeError),e.exports.codes=i},82299:(e,a,t)=>{"use strict";function c(e,a){return function(e){if(Array.isArray(e))return e}(e)||function(e,a){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var c,f,d,r,n=[],i=!0,b=!1;try{if(d=(t=t.call(e)).next,0===a){if(Object(t)!==t)return;i=!1}else for(;!(i=(c=d.call(t)).done)&&(n.push(c.value),n.length!==a);i=!0);}catch(e){b=!0,f=e}finally{try{if(!i&&null!=t.return&&(r=t.return(),Object(r)!==r))return}finally{if(b)throw f}}return n}}(e,a)||function(e,a){if(e){if("string"==typeof e)return f(e,a);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?f(e,a):void 0}}(e,a)||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.")}()}function f(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,c=new Array(a);t10)return!0;for(var a=0;a57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function P(e){return Object.keys(e).filter(N).concat(o(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function R(e,a){if(e===a)return 0;for(var t=e.length,c=a.length,f=0,d=Math.min(t,c);f{const c=t(36209),f=t(10943),d=t(51847),r=t(86679),n=t(65435),i=255===new Uint8Array(Uint16Array.of(255).buffer)[0];function b(e){switch(e){case"ascii":return c;case"base64":return f;case"hex":return d;case"utf8":case"utf-8":case void 0:return r;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n;default:throw new Error(`Unknown encoding: ${e}`)}}function o(e){return e instanceof Uint8Array}function s(e,a,t){return"string"==typeof e?function(e,a){const t=b(a),c=new Uint8Array(t.byteLength(e));return t.write(c,e,0,c.byteLength),c}(e,a):Array.isArray(e)?function(e){const a=new Uint8Array(e.length);return a.set(e),a}(e):ArrayBuffer.isView(e)?function(e){const a=new Uint8Array(e.byteLength);return a.set(e),a}(e):function(e,a,t){return new Uint8Array(e,a,t)}(e,a,t)}function l(e,a,t,c,f){if(0===e.byteLength)return-1;if("string"==typeof t?(c=t,t=0):void 0===t?t=f?0:e.length-1:t<0&&(t+=e.byteLength),t>=e.byteLength){if(f)return-1;t=e.byteLength-1}else if(t<0){if(!f)return-1;t=0}if("string"==typeof a)a=s(a,c);else if("number"==typeof a)return a&=255,f?e.indexOf(a,t):e.lastIndexOf(a,t);if(0===a.byteLength)return-1;if(f){let c=-1;for(let f=t;fe.byteLength&&(t=e.byteLength-a.byteLength);for(let c=t;c>=0;c--){let t=!0;for(let f=0;ff)return 1}return e.byteLength>a.byteLength?1:e.byteLengthe+a.byteLength),0));const t=new Uint8Array(a);let c=0;for(const a of e){if(c+a.byteLength>t.byteLength){const e=a.subarray(0,t.byteLength-c);return t.set(e,c),t}t.set(a,c),c+=a.byteLength}return t},copy:function(e,a,t=0,c=0,f=e.byteLength){if(f>0&&f=e.byteLength)throw new RangeError("sourceStart is out of range");if(f<0)throw new RangeError("sourceEnd is out of range");t>=a.byteLength&&(t=a.byteLength),f>e.byteLength&&(f=e.byteLength),a.byteLength-t=f||c<=t?"":(t<0&&(t=0),c>f&&(c=f),(0!==t||c{function a(e){return e.length}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;let t="";for(let c=0;c{const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256);for(let e=0;e<64;e++)t[a.charCodeAt(e)]=e;function c(e){let a=e.length;return 61===e.charCodeAt(a-1)&&a--,a>1&&61===e.charCodeAt(a-1)&&a--,3*a>>>2}t[45]=62,t[95]=63,e.exports={byteLength:c,toString:function(e){const t=e.byteLength;let c="";for(let f=0;f>2]+a[(3&e[f])<<4|e[f+1]>>4]+a[(15&e[f+1])<<2|e[f+2]>>6]+a[63&e[f+2]];return t%3==2?c=c.substring(0,c.length-1)+"=":t%3==1&&(c=c.substring(0,c.length-2)+"=="),c},write:function(e,a,f=0,d=c(a)){const r=Math.min(d,e.byteLength-f);for(let c=0,f=0;f>4,e[f++]=(15&r)<<4|n>>2,e[f++]=(3&n)<<6|63&i}return r}}},51847:e=>{function a(e){return e.length>>>1}function t(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:void 0}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;e=new DataView(e.buffer,e.byteOffset,a);let t="",c=0;for(let f=a-a%4;c{function a(e){return 2*e.length}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;let t="";for(let c=0;c>8,r=f%256;e[c+2*a]=r,e[c+2*a+1]=d}return d}}},86679:e=>{function a(e){let a=0;for(let t=0,c=e.length;t=55296&&f<=56319&&t+1=56320&&c<=57343){a+=4,t++;continue}}a+=f<=127?1:f<=2047?2:3}return a}let t,c;if("undefined"!=typeof TextDecoder){const e=new TextDecoder;t=function(a){return e.decode(a)}}else t=function(e){const a=e.byteLength;let t="",c=0;for(;c0){let a=0;for(;a>c,c-=6;c>=0;)e[n++]=128|a>>c&63,c-=6;r+=a>=65536?2:1}return d};e.exports={byteLength:a,toString:t,write:c}},67526:(e,a)=>{"use strict";a.byteLength=function(e){var a=n(e),t=a[0],c=a[1];return 3*(t+c)/4-c},a.toByteArray=function(e){var a,t,d=n(e),r=d[0],i=d[1],b=new f(function(e,a,t){return 3*(a+t)/4-t}(0,r,i)),o=0,s=i>0?r-4:r;for(t=0;t>16&255,b[o++]=a>>8&255,b[o++]=255&a;return 2===i&&(a=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,b[o++]=255&a),1===i&&(a=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,b[o++]=a>>8&255,b[o++]=255&a),b},a.fromByteArray=function(e){for(var a,c=e.length,f=c%3,d=[],r=16383,n=0,b=c-f;nb?b:n+r));return 1===f?(a=e[c-1],d.push(t[a>>2]+t[a<<4&63]+"==")):2===f&&(a=(e[c-2]<<8)+e[c-1],d.push(t[a>>10]+t[a>>4&63]+t[a<<2&63]+"=")),d.join("")};for(var t=[],c=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)t[r]=d[r],c[d.charCodeAt(r)]=r;function n(e){var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");return-1===t&&(t=a),[t,t===a?0:4-t%4]}function i(e,a,c){for(var f,d,r=[],n=a;n>18&63]+t[d>>12&63]+t[d>>6&63]+t[63&d]);return r.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},92096:(e,a,t)=>{var c;e=t.nmd(e);var f=function(e){"use strict";var a=1e7,t=9007199254740992,c=l(t),d="0123456789abcdefghijklmnopqrstuvwxyz",r="function"==typeof BigInt;function n(e,a,t,c){return void 0===e?n[0]:void 0===a||10==+a&&!t?Z(e):q(e,a,t,c)}function i(e,a){this.value=e,this.sign=a,this.isSmall=!1}function b(e){this.value=e,this.sign=e<0,this.isSmall=!0}function o(e){this.value=e}function s(e){return-t0?Math.floor(e):Math.ceil(e)}function m(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(f=0;f=b?1:0,n[f]=c-i*b;for(;f0&&n.push(i),n}function x(e,a){return e.length>=a.length?m(e,a):m(a,e)}function y(e,t){var c,f,d=e.length,r=new Array(d),n=a;for(f=0;f0;)r[f++]=t%n,t=Math.floor(t/n);return r}function A(e,t){var c,f,d=e.length,r=t.length,n=new Array(d),i=0,b=a;for(c=0;c0;)r[f++]=i%n,i=Math.floor(i/n);return r}function I(e,a){for(var t=[];a-- >0;)t.push(0);return t.concat(e)}function E(e,a){var t=Math.max(e.length,a.length);if(t<=30)return w(e,a);t=Math.ceil(t/2);var c=e.slice(t),f=e.slice(0,t),d=a.slice(t),r=a.slice(0,t),n=E(f,r),i=E(c,d),b=E(x(f,c),x(r,d)),o=x(x(n,I(A(A(b,n),i),t)),I(i,2*t));return h(o),o}function C(e,t,c){return new i(e=0;--c)d=(r=d*b+e[c])-(f=g(r/t))*t,i[c]=0|f;return[i,0|d]}function L(e,t){var c,f=Z(t);if(r)return[new o(e.value/f.value),new o(e.value%f.value)];var d,s=e.value,m=f.value;if(0===m)throw new Error("Cannot divide by zero");if(e.isSmall)return f.isSmall?[new b(g(s/m)),new b(s%m)]:[n[0],e];if(f.isSmall){if(1===m)return[e,n[0]];if(-1==m)return[e.negate(),n[0]];var x=Math.abs(m);if(x=0;f--){for(c=l-1,x[f+s]!==g&&(c=Math.floor((x[f+s]*l+x[f+s-1])/g)),d=0,r=0,i=y.length,n=0;nb&&(d=(d+1)*l),c=Math.ceil(d/r);do{if(S(n=_(t,c),s)<=0)break;c--}while(c);o.push(c),s=A(s,n)}return o.reverse(),[u(o),u(s)]}(s,m),d=c[0];var w=e.sign!==f.sign,I=c[1],E=e.sign;return"number"==typeof d?(w&&(d=-d),d=new b(d)):d=new i(d,w),"number"==typeof I?(E&&(I=-I),I=new b(I)):I=new i(I,E),[d,I]}function S(e,a){if(e.length!==a.length)return e.length>a.length?1:-1;for(var t=e.length-1;t>=0;t--)if(e[t]!==a[t])return e[t]>a[t]?1:-1;return 0}function k(e){var a=e.abs();return!a.isUnit()&&(!!(a.equals(2)||a.equals(3)||a.equals(5))||!(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))&&(!!a.lesser(49)||void 0))}function N(e,a){for(var t,c,d,r=e.prev(),n=r,i=0;n.isEven();)n=n.divide(2),i++;e:for(c=0;c=0?c=A(e,a):(c=A(a,e),t=!t),"number"==typeof(c=u(c))?(t&&(c=-c),new b(c)):new i(c,t)}(t,c,this.sign)},i.prototype.minus=i.prototype.subtract,b.prototype.subtract=function(e){var a=Z(e),t=this.value;if(t<0!==a.sign)return this.add(a.negate());var c=a.value;return a.isSmall?new b(t-c):v(c,Math.abs(t),t>=0)},b.prototype.minus=b.prototype.subtract,o.prototype.subtract=function(e){return new o(this.value-Z(e).value)},o.prototype.minus=o.prototype.subtract,i.prototype.negate=function(){return new i(this.value,!this.sign)},b.prototype.negate=function(){var e=this.sign,a=new b(-this.value);return a.sign=!e,a},o.prototype.negate=function(){return new o(-this.value)},i.prototype.abs=function(){return new i(this.value,!1)},b.prototype.abs=function(){return new b(Math.abs(this.value))},o.prototype.abs=function(){return new o(this.value>=0?this.value:-this.value)},i.prototype.multiply=function(e){var t,c,f,d=Z(e),r=this.value,b=d.value,o=this.sign!==d.sign;if(d.isSmall){if(0===b)return n[0];if(1===b)return this;if(-1===b)return this.negate();if((t=Math.abs(b))0?E(r,b):w(r,b),o)},i.prototype.times=i.prototype.multiply,b.prototype._multiplyBySmall=function(e){return s(e.value*this.value)?new b(e.value*this.value):C(Math.abs(e.value),l(Math.abs(this.value)),this.sign!==e.sign)},i.prototype._multiplyBySmall=function(e){return 0===e.value?n[0]:1===e.value?this:-1===e.value?this.negate():C(Math.abs(e.value),this.value,this.sign!==e.sign)},b.prototype.multiply=function(e){return Z(e)._multiplyBySmall(this)},b.prototype.times=b.prototype.multiply,o.prototype.multiply=function(e){return new o(this.value*Z(e).value)},o.prototype.times=o.prototype.multiply,i.prototype.square=function(){return new i(M(this.value),!1)},b.prototype.square=function(){var e=this.value*this.value;return s(e)?new b(e):new i(M(l(Math.abs(this.value))),!1)},o.prototype.square=function(e){return new o(this.value*this.value)},i.prototype.divmod=function(e){var a=L(this,e);return{quotient:a[0],remainder:a[1]}},o.prototype.divmod=b.prototype.divmod=i.prototype.divmod,i.prototype.divide=function(e){return L(this,e)[0]},o.prototype.over=o.prototype.divide=function(e){return new o(this.value/Z(e).value)},b.prototype.over=b.prototype.divide=i.prototype.over=i.prototype.divide,i.prototype.mod=function(e){return L(this,e)[1]},o.prototype.mod=o.prototype.remainder=function(e){return new o(this.value%Z(e).value)},b.prototype.remainder=b.prototype.mod=i.prototype.remainder=i.prototype.mod,i.prototype.pow=function(e){var a,t,c,f=Z(e),d=this.value,r=f.value;if(0===r)return n[1];if(0===d)return n[0];if(1===d)return n[1];if(-1===d)return f.isEven()?n[1]:n[-1];if(f.sign)return n[0];if(!f.isSmall)throw new Error("The exponent "+f.toString()+" is too large.");if(this.isSmall&&s(a=Math.pow(d,r)))return new b(g(a));for(t=this,c=n[1];!0&r&&(c=c.times(t),--r),0!==r;)r/=2,t=t.square();return c},b.prototype.pow=i.prototype.pow,o.prototype.pow=function(e){var a=Z(e),t=this.value,c=a.value,f=BigInt(0),d=BigInt(1),r=BigInt(2);if(c===f)return n[1];if(t===f)return n[0];if(t===d)return n[1];if(t===BigInt(-1))return a.isEven()?n[1]:n[-1];if(a.isNegative())return new o(f);for(var i=this,b=n[1];(c&d)===d&&(b=b.times(i),--c),c!==f;)c/=r,i=i.square();return b},i.prototype.modPow=function(e,a){if(e=Z(e),(a=Z(a)).isZero())throw new Error("Cannot take modPow with modulus 0");var t=n[1],c=this.mod(a);for(e.isNegative()&&(e=e.multiply(n[-1]),c=c.modInv(a));e.isPositive();){if(c.isZero())return n[0];e.isOdd()&&(t=t.multiply(c).mod(a)),e=e.divide(2),c=c.square().mod(a)}return t},o.prototype.modPow=b.prototype.modPow=i.prototype.modPow,i.prototype.compareAbs=function(e){var a=Z(e),t=this.value,c=a.value;return a.isSmall?1:S(t,c)},b.prototype.compareAbs=function(e){var a=Z(e),t=Math.abs(this.value),c=a.value;return a.isSmall?t===(c=Math.abs(c))?0:t>c?1:-1:-1},o.prototype.compareAbs=function(e){var a=this.value,t=Z(e).value;return(a=a>=0?a:-a)===(t=t>=0?t:-t)?0:a>t?1:-1},i.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return this.sign!==a.sign?a.sign?1:-1:a.isSmall?this.sign?-1:1:S(t,c)*(this.sign?-1:1)},i.prototype.compareTo=i.prototype.compare,b.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=Z(e),t=this.value,c=a.value;return a.isSmall?t==c?0:t>c?1:-1:t<0!==a.sign?t<0?-1:1:t<0?1:-1},b.prototype.compareTo=b.prototype.compare,o.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var a=this.value,t=Z(e).value;return a===t?0:a>t?1:-1},o.prototype.compareTo=o.prototype.compare,i.prototype.equals=function(e){return 0===this.compare(e)},o.prototype.eq=o.prototype.equals=b.prototype.eq=b.prototype.equals=i.prototype.eq=i.prototype.equals,i.prototype.notEquals=function(e){return 0!==this.compare(e)},o.prototype.neq=o.prototype.notEquals=b.prototype.neq=b.prototype.notEquals=i.prototype.neq=i.prototype.notEquals,i.prototype.greater=function(e){return this.compare(e)>0},o.prototype.gt=o.prototype.greater=b.prototype.gt=b.prototype.greater=i.prototype.gt=i.prototype.greater,i.prototype.lesser=function(e){return this.compare(e)<0},o.prototype.lt=o.prototype.lesser=b.prototype.lt=b.prototype.lesser=i.prototype.lt=i.prototype.lesser,i.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},o.prototype.geq=o.prototype.greaterOrEquals=b.prototype.geq=b.prototype.greaterOrEquals=i.prototype.geq=i.prototype.greaterOrEquals,i.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},o.prototype.leq=o.prototype.lesserOrEquals=b.prototype.leq=b.prototype.lesserOrEquals=i.prototype.leq=i.prototype.lesserOrEquals,i.prototype.isEven=function(){return!(1&this.value[0])},b.prototype.isEven=function(){return!(1&this.value)},o.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},i.prototype.isOdd=function(){return!(1&~this.value[0])},b.prototype.isOdd=function(){return!(1&~this.value)},o.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},i.prototype.isPositive=function(){return!this.sign},b.prototype.isPositive=function(){return this.value>0},o.prototype.isPositive=b.prototype.isPositive,i.prototype.isNegative=function(){return this.sign},b.prototype.isNegative=function(){return this.value<0},o.prototype.isNegative=b.prototype.isNegative,i.prototype.isUnit=function(){return!1},b.prototype.isUnit=function(){return 1===Math.abs(this.value)},o.prototype.isUnit=function(){return this.abs().value===BigInt(1)},i.prototype.isZero=function(){return!1},b.prototype.isZero=function(){return 0===this.value},o.prototype.isZero=function(){return this.value===BigInt(0)},i.prototype.isDivisibleBy=function(e){var a=Z(e);return!a.isZero()&&(!!a.isUnit()||(0===a.compareAbs(2)?this.isEven():this.mod(a).isZero()))},o.prototype.isDivisibleBy=b.prototype.isDivisibleBy=i.prototype.isDivisibleBy,i.prototype.isPrime=function(a){var t=k(this);if(t!==e)return t;var c=this.abs(),d=c.bitLength();if(d<=64)return N(c,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var r=Math.log(2)*d.toJSNumber(),n=Math.ceil(!0===a?2*Math.pow(r,2):r),i=[],b=0;b-t?new b(e-1):new i(c,!0)},o.prototype.prev=function(){return new o(this.value-BigInt(1))};for(var P=[1];2*P[P.length-1]<=a;)P.push(2*P[P.length-1]);var R=P.length,O=P[R-1];function T(e){return Math.abs(e)<=a}function D(e,a,t){a=Z(a);for(var c=e.isNegative(),d=a.isNegative(),r=c?e.not():e,n=d?a.not():a,i=0,b=0,o=null,s=null,l=[];!r.isZero()||!n.isZero();)i=(o=L(r,O))[1].toJSNumber(),c&&(i=O-1-i),b=(s=L(n,O))[1].toJSNumber(),d&&(b=O-1-b),r=o[0],n=s[0],l.push(t(i,b));for(var u=0!==t(c?1:0,d?1:0)?f(-1):f(0),h=l.length-1;h>=0;h-=1)u=u.multiply(O).add(f(l[h]));return u}i.prototype.shiftLeft=function(e){var a=Z(e).toJSNumber();if(!T(a))throw new Error(String(a)+" is too large for shifting.");if(a<0)return this.shiftRight(-a);var t=this;if(t.isZero())return t;for(;a>=R;)t=t.multiply(O),a-=R-1;return t.multiply(P[a])},o.prototype.shiftLeft=b.prototype.shiftLeft=i.prototype.shiftLeft,i.prototype.shiftRight=function(e){var a,t=Z(e).toJSNumber();if(!T(t))throw new Error(String(t)+" is too large for shifting.");if(t<0)return this.shiftLeft(-t);for(var c=this;t>=R;){if(c.isZero()||c.isNegative()&&c.isUnit())return c;c=(a=L(c,O))[1].isNegative()?a[0].prev():a[0],t-=R-1}return(a=L(c,P[t]))[1].isNegative()?a[0].prev():a[0]},o.prototype.shiftRight=b.prototype.shiftRight=i.prototype.shiftRight,i.prototype.not=function(){return this.negate().prev()},o.prototype.not=b.prototype.not=i.prototype.not,i.prototype.and=function(e){return D(this,e,(function(e,a){return e&a}))},o.prototype.and=b.prototype.and=i.prototype.and,i.prototype.or=function(e){return D(this,e,(function(e,a){return e|a}))},o.prototype.or=b.prototype.or=i.prototype.or,i.prototype.xor=function(e){return D(this,e,(function(e,a){return e^a}))},o.prototype.xor=b.prototype.xor=i.prototype.xor;var F=1<<30;function Q(e){var t=e.value,c="number"==typeof t?t|F:"bigint"==typeof t?t|BigInt(F):t[0]+t[1]*a|1073758208;return c&-c}function U(e,a){if(a.compareTo(e)<=0){var t=U(e,a.square(a)),c=t.p,d=t.e,r=c.multiply(a);return r.compareTo(e)<=0?{p:r,e:2*d+1}:{p:c,e:2*d}}return{p:f(1),e:0}}function j(e,a){return e=Z(e),a=Z(a),e.greater(a)?e:a}function H(e,a){return e=Z(e),a=Z(a),e.lesser(a)?e:a}function $(e,a){if(e=Z(e).abs(),a=Z(a).abs(),e.equals(a))return e;if(e.isZero())return a;if(a.isZero())return e;for(var t,c,f=n[1];e.isEven()&&a.isEven();)t=H(Q(e),Q(a)),e=e.divide(t),a=a.divide(t),f=f.multiply(t);for(;e.isEven();)e=e.divide(Q(e));do{for(;a.isEven();)a=a.divide(Q(a));e.greater(a)&&(c=a,a=e,e=c),a=a.subtract(e)}while(!a.isZero());return f.isUnit()?e:e.multiply(f)}i.prototype.bitLength=function(){var e=this;return e.compareTo(f(0))<0&&(e=e.negate().subtract(f(1))),0===e.compareTo(f(0))?f(0):f(U(e,f(2)).e).add(f(1))},o.prototype.bitLength=b.prototype.bitLength=i.prototype.bitLength;var q=function(e,a,t,c){t=t||d,e=String(e),c||(e=e.toLowerCase(),t=t.toLowerCase());var f,r=e.length,n=Math.abs(a),i={};for(f=0;f=n){if("1"===s&&1===n)continue;throw new Error(s+" is not a valid digit in base "+a+".")}a=Z(a);var b=[],o="-"===e[0];for(f=o?1:0;f"!==e[f]&&f=0;c--)f=f.add(e[c].times(d)),d=d.times(a);return t?f.negate():f}function z(e,a){if((a=f(a)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(a.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var t=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return t.unshift([1]),{value:[].concat.apply([],t),isNegative:!1}}var c=!1;if(e.isNegative()&&a.isPositive()&&(c=!0,e=e.abs()),a.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:c};for(var d,r=[],n=e;n.isNegative()||n.compareAbs(a)>=0;){d=n.divmod(a),n=d.quotient;var i=d.remainder;i.isNegative()&&(i=a.minus(i).abs(),n=n.next()),r.push(i.toJSNumber())}return r.push(n.toJSNumber()),{value:r.reverse(),isNegative:c}}function K(e,a,t){var c=z(e,a);return(c.isNegative?"-":"")+c.value.map((function(e){return function(e,a){return e<(a=a||d).length?a[e]:"<"+e+">"}(e,t)})).join("")}function V(e){if(s(+e)){var a=+e;if(a===g(a))return r?new o(BigInt(a)):new b(a);throw new Error("Invalid integer: "+e)}var t="-"===e[0];t&&(e=e.slice(1));var c=e.split(/e/i);if(c.length>2)throw new Error("Invalid integer: "+c.join("e"));if(2===c.length){var f=c[1];if("+"===f[0]&&(f=f.slice(1)),(f=+f)!==g(f)||!s(f))throw new Error("Invalid integer: "+f+" is not a valid exponent.");var d=c[0],n=d.indexOf(".");if(n>=0&&(f-=d.length-n-1,d=d.slice(0,n)+d.slice(n+1)),f<0)throw new Error("Cannot include negative exponent part for integers");e=d+=new Array(f+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);if(r)return new o(BigInt(t?"-"+e:e));for(var l=[],u=e.length,p=u-7;u>0;)l.push(+e.slice(p,u)),(p-=7)<0&&(p=0),u-=7;return h(l),new i(l,t)}function Z(e){return"number"==typeof e?function(e){if(r)return new o(BigInt(e));if(s(e)){if(e!==g(e))throw new Error(e+" is not an integer.");return new b(e)}return V(e.toString())}(e):"string"==typeof e?V(e):"bigint"==typeof e?new o(e):e}i.prototype.toArray=function(e){return z(this,e)},b.prototype.toArray=function(e){return z(this,e)},o.prototype.toArray=function(e){return z(this,e)},i.prototype.toString=function(a,t){if(a===e&&(a=10),10!==a||t)return K(this,a,t);for(var c,f=this.value,d=f.length,r=String(f[--d]);--d>=0;)c=String(f[d]),r+="0000000".slice(c.length)+c;return(this.sign?"-":"")+r},b.prototype.toString=function(a,t){return a===e&&(a=10),10!=a||t?K(this,a,t):String(this.value)},o.prototype.toString=b.prototype.toString,o.prototype.toJSON=i.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()},i.prototype.valueOf=function(){return parseInt(this.toString(),10)},i.prototype.toJSNumber=i.prototype.valueOf,b.prototype.valueOf=function(){return this.value},b.prototype.toJSNumber=b.prototype.valueOf,o.prototype.valueOf=o.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var J=0;J<1e3;J++)n[J]=Z(J),J>0&&(n[-J]=Z(-J));return n.one=n[1],n.zero=n[0],n.minusOne=n[-1],n.max=j,n.min=H,n.gcd=$,n.lcm=function(e,a){return e=Z(e).abs(),a=Z(a).abs(),e.divide($(e,a)).multiply(a)},n.isInstance=function(e){return e instanceof i||e instanceof b||e instanceof o},n.randBetween=function(e,t,c){e=Z(e),t=Z(t);var f=c||Math.random,d=H(e,t),r=j(e,t).subtract(d).add(1);if(r.isSmall)return d.add(Math.floor(f()*r));for(var i=z(r,a).value,b=[],o=!0,s=0;s{e.exports=t(85702)(t(86989))},4315:(e,a,t)=>{var c=t(48287).Buffer;const f=t(28399).Transform;e.exports=class extends f{constructor(e,a){super(a),this._engine=e,this._finalized=!1}_transform(e,a,t){let c=null;try{this.update(e,a)}catch(e){c=e}t(c)}_flush(e){let a=null;try{this.push(this.digest())}catch(e){a=e}e(a)}update(e,a){if(!c.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return c.isBuffer(e)||(e=c.from(e,a)),this._engine.update(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;let a=this._engine.digest();return void 0!==e&&(a=a.toString(e)),a}}},85702:(e,a,t)=>{const c=t(4315);e.exports=e=>(a,t)=>{const f=(a=>{switch("string"==typeof a?a.toLowerCase():a){case"blake224":return e.Blake224;case"blake256":return e.Blake256;case"blake384":return e.Blake384;case"blake512":return e.Blake512;default:throw new Error("Invald algorithm: "+a)}})(a);return new c(new f,t)}},34588:(e,a,t)=>{var c=t(48287).Buffer;class f{_lengthCarry(e){for(let a=0;a=a.length;){for(let c=this._blockOffset;c{var c=t(48287).Buffer;const f=t(23287),d=c.from([0]),r=c.from([128]);e.exports=class extends f{constructor(){super(),this._h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],this._zo=d,this._oo=r}digest(){this._padding();const e=c.alloc(28);for(let a=0;a<7;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},23287:(e,a,t)=>{var c=t(48287).Buffer;const f=t(34588),d=c.from([1]),r=c.from([129]),n=(e,a)=>(e<<32-a|e>>>a)>>>0;function i(e,a,t,c,d,r,i,b){const o=f.sigma,s=f.u256;e[c]=e[c]+((a[o[t][b]]^s[o[t][b+1]])>>>0)+e[d]>>>0,e[i]=n(e[i]^e[c],16),e[r]=e[r]+e[i]>>>0,e[d]=n(e[d]^e[r],12),e[c]=e[c]+((a[o[t][b+1]]^s[o[t][b]])>>>0)+e[d]>>>0,e[i]=n(e[i]^e[c],8),e[r]=e[r]+e[i]>>>0,e[d]=n(e[d]^e[r],7)}e.exports=class extends f{constructor(){super(),this._h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this._s=[0,0,0,0],this._block=c.alloc(64),this._blockOffset=0,this._length=[0,0],this._nullt=!1,this._zo=d,this._oo=r}_compress(){const e=f.u256,a=new Array(16),t=new Array(16);let c;for(c=0;c<16;++c)t[c]=this._block.readUInt32BE(4*c);for(c=0;c<8;++c)a[c]=this._h[c]>>>0;for(c=8;c<12;++c)a[c]=(this._s[c-8]^e[c-8])>>>0;for(c=12;c<16;++c)a[c]=e[c-8];for(this._nullt||(a[12]=(a[12]^this._length[0])>>>0,a[13]=(a[13]^this._length[0])>>>0,a[14]=(a[14]^this._length[1])>>>0,a[15]=(a[15]^this._length[1])>>>0),c=0;c<14;++c)i(a,t,c,0,4,8,12,0),i(a,t,c,1,5,9,13,2),i(a,t,c,2,6,10,14,4),i(a,t,c,3,7,11,15,6),i(a,t,c,0,5,10,15,8),i(a,t,c,1,6,11,12,10),i(a,t,c,2,7,8,13,12),i(a,t,c,3,4,9,14,14);for(c=0;c<16;++c)this._h[c%8]=(this._h[c%8]^a[c])>>>0;for(c=0;c<8;++c)this._h[c]=(this._h[c]^this._s[c%4])>>>0}_padding(){let e=this._length[0]+8*this._blockOffset,a=this._length[1];e>=4294967296&&(e-=4294967296,a+=1);const t=c.alloc(8);t.writeUInt32BE(a,0),t.writeUInt32BE(e,4),55===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<55?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(55-this._blockOffset),this.update(f.padding.slice(0,55-this._blockOffset))):(this._length[0]-=8*(64-this._blockOffset),this.update(f.padding.slice(0,64-this._blockOffset)),this._length[0]-=440,this.update(f.padding.slice(1,56)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=64,this.update(t)}digest(){this._padding();const e=c.alloc(32);for(let a=0;a<8;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},399:(e,a,t)=>{var c=t(48287).Buffer;const f=t(61070),d=c.from([0]),r=c.from([128]);e.exports=class extends f{constructor(){super(),this._h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428],this._zo=d,this._oo=r}digest(){this._padding();const e=c.alloc(48);for(let a=0;a<12;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},61070:(e,a,t)=>{var c=t(48287).Buffer;const f=t(34588),d=c.from([1]),r=c.from([129]);function n(e,a,t,c){let f=e[2*a]^e[2*t],d=e[2*a+1]^e[2*t+1];c>=32&&(d^=f,f^=d,d^=f,c-=32),0===c?(e[2*a]=f>>>0,e[2*a+1]=d>>>0):(e[2*a]=(f>>>c|d<<32-c)>>>0,e[2*a+1]=(d>>>c|f<<32-c)>>>0)}function i(e,a,t,c,d,r,i,b){const o=f.sigma,s=f.u512;let l;l=e[2*c+1]+((a[2*o[t][b]+1]^s[2*o[t][b+1]+1])>>>0)+e[2*d+1],e[2*c]=e[2*c]+((a[2*o[t][b]]^s[2*o[t][b+1]])>>>0)+e[2*d]+~~(l/4294967296)>>>0,e[2*c+1]=l>>>0,n(e,i,c,32),l=e[2*r+1]+e[2*i+1],e[2*r]=e[2*r]+e[2*i]+~~(l/4294967296)>>>0,e[2*r+1]=l>>>0,n(e,d,r,25),l=e[2*c+1]+((a[2*o[t][b+1]+1]^s[2*o[t][b]+1])>>>0)+e[2*d+1],e[2*c]=e[2*c]+((a[2*o[t][b+1]]^s[2*o[t][b]])>>>0)+e[2*d]+~~(l/4294967296)>>>0,e[2*c+1]=l>>>0,n(e,i,c,16),l=e[2*r+1]+e[2*i+1],e[2*r]=e[2*r]+e[2*i]+~~(l/4294967296)>>>0,e[2*r+1]=l>>>0,n(e,d,r,11)}e.exports=class extends f{constructor(){super(),this._h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this._s=[0,0,0,0,0,0,0,0],this._block=c.alloc(128),this._blockOffset=0,this._length=[0,0,0,0],this._nullt=!1,this._zo=d,this._oo=r}_compress(){const e=f.u512,a=new Array(32),t=new Array(32);let c;for(c=0;c<32;++c)t[c]=this._block.readUInt32BE(4*c);for(c=0;c<16;++c)a[c]=this._h[c]>>>0;for(c=16;c<24;++c)a[c]=(this._s[c-16]^e[c-16])>>>0;for(c=24;c<32;++c)a[c]=e[c-16];for(this._nullt||(a[24]=(a[24]^this._length[1])>>>0,a[25]=(a[25]^this._length[0])>>>0,a[26]=(a[26]^this._length[1])>>>0,a[27]=(a[27]^this._length[0])>>>0,a[28]=(a[28]^this._length[3])>>>0,a[29]=(a[29]^this._length[2])>>>0,a[30]=(a[30]^this._length[3])>>>0,a[31]=(a[31]^this._length[2])>>>0),c=0;c<16;++c)i(a,t,c,0,4,8,12,0),i(a,t,c,1,5,9,13,2),i(a,t,c,2,6,10,14,4),i(a,t,c,3,7,11,15,6),i(a,t,c,0,5,10,15,8),i(a,t,c,1,6,11,12,10),i(a,t,c,2,7,8,13,12),i(a,t,c,3,4,9,14,14);for(c=0;c<16;++c)this._h[c%8*2]=(this._h[c%8*2]^a[2*c])>>>0,this._h[c%8*2+1]=(this._h[c%8*2+1]^a[2*c+1])>>>0;for(c=0;c<8;++c)this._h[2*c]=(this._h[2*c]^this._s[c%4*2])>>>0,this._h[2*c+1]=(this._h[2*c+1]^this._s[c%4*2+1])>>>0}_padding(){const e=this._length.slice();e[0]+=8*this._blockOffset,this._lengthCarry(e);const a=c.alloc(16);for(let t=0;t<4;++t)a.writeUInt32BE(e[3-t],4*t);111===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<111?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(111-this._blockOffset),this.update(f.padding.slice(0,111-this._blockOffset))):(this._length[0]-=8*(128-this._blockOffset),this.update(f.padding.slice(0,128-this._blockOffset)),this._length[0]-=888,this.update(f.padding.slice(1,112)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=128,this.update(a)}digest(){this._padding();const e=c.alloc(64);for(let a=0;a<16;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},86989:(e,a,t)=>{e.exports={Blake224:t(48746),Blake256:t(23287),Blake384:t(399),Blake512:t(61070)}},91892:e=>{var a,t,c=(()=>{for(var e=new Uint8Array(128),a=0;a<64;a++)e[a<26?a+65:a<52?a+71:a<62?a-4:4*a-205]=a;return a=>{for(var t=a.length,c=new Uint8Array(3*(t-("="==a[t-1])-("="==a[t-2]))/4|0),f=0,d=0;f>4,c[d++]=n<<4|i>>2,c[d++]=i<<6|b}return c}})(),f=(a={"wasm-binary:./blake2b.wat"(e,a){a.exports=c("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMKvz8EwAIAIABCADcDACAAQgA3AwggAEIANwMQIABCADcDGCAAQgA3AyAgAEIANwMoIABCADcDMCAAQgA3AzggAEIANwNAIABCADcDSCAAQgA3A1AgAEIANwNYIABCADcDYCAAQgA3A2ggAEIANwNwIABCADcDeCAAQoiS853/zPmE6gBBACkDAIU3A4ABIABCu86qptjQ67O7f0EIKQMAhTcDiAEgAEKr8NP0r+68tzxBECkDAIU3A5ABIABC8e30+KWn/aelf0EYKQMAhTcDmAEgAELRhZrv+s+Uh9EAQSApAwCFNwOgASAAQp/Y+dnCkdqCm39BKCkDAIU3A6gBIABC6/qG2r+19sEfQTApAwCFNwOwASAAQvnC+JuRo7Pw2wBBOCkDAIU3A7gBIABCADcDwAEgAEIANwPIASAAQgA3A9ABC20BA38gAEHAAWohAyAAQcgBaiEEIAQpAwCnIQUCQANAIAEgAkYNASAFQYABRgRAIAMgAykDACAFrXw3AwBBACEFIAAQAwsgACAFaiABLQAAOgAAIAVBAWohBSABQQFqIQEMAAsLIAQgBa03AwALYQEDfyAAQcABaiEBIABByAFqIQIgASABKQMAIAIpAwB8NwMAIABCfzcD0AEgAikDAKchAwJAA0AgA0GAAUYNASAAIANqQQA6AAAgA0EBaiEDDAALCyACIAOtNwMAIAAQAwuqOwIgfgl/IABBgAFqISEgAEGIAWohIiAAQZABaiEjIABBmAFqISQgAEGgAWohJSAAQagBaiEmIABBsAFqIScgAEG4AWohKCAhKQMAIQEgIikDACECICMpAwAhAyAkKQMAIQQgJSkDACEFICYpAwAhBiAnKQMAIQcgKCkDACEIQoiS853/zPmE6gAhCUK7zqqm2NDrs7t/IQpCq/DT9K/uvLc8IQtC8e30+KWn/aelfyEMQtGFmu/6z5SH0QAhDUKf2PnZwpHagpt/IQ5C6/qG2r+19sEfIQ9C+cL4m5Gjs/DbACEQIAApAwAhESAAKQMIIRIgACkDECETIAApAxghFCAAKQMgIRUgACkDKCEWIAApAzAhFyAAKQM4IRggACkDQCEZIAApA0ghGiAAKQNQIRsgACkDWCEcIAApA2AhHSAAKQNoIR4gACkDcCEfIAApA3ghICANIAApA8ABhSENIA8gACkD0AGFIQ8gASAFIBF8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSASfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgE3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBR8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAVfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBd8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAYfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgGXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBp8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAbfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgHHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIB18fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAefHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgH3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFICB8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAffHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgG3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBV8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAZfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHICB8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAefHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggF3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBJ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAdfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgEXx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBN8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAcfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGHx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBZ8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAUfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHHx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBl8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAdfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgEXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBZ8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByATfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggIHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIB58fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAbfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgH3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBR8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAXfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBJ8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAafHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFXx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBh8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAafHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFHx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBJ8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAefHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHXx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBx8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAffHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgE3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBd8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAWfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgG3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBV8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCARfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgIHx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBl8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAafHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEXx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBZ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAYfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgE3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBV8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAbfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggIHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIB98fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiASfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgHHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB18fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAXfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBR8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAefHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgE3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIB18fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAXfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgG3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBF8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAcfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggGXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBR8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAVfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBh8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAWfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggIHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB98fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSASfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgGnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB18fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAWfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgEnx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGICB8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAffHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBV8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAbfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBh8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAXfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBp8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCATfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGXx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBx8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAefHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgHHx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBh8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAffHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBJ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAUfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBZ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiARfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgIHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBV8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAZfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggF3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBN8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAbfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgF3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFICB8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAffHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGnx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBx8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAUfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggEXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBl8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAdfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgE3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIB58fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAYfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggEnx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBV8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAbfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBt8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSATfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgGXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBV8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAYfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgF3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBJ8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAWfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgIHx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBx8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAafHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgH3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBR8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAdfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgHnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBF8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgISAhKQMAIAEgCYWFNwMAICIgIikDACACIAqFhTcDACAjICMpAwAgAyALhYU3AwAgJCAkKQMAIAQgDIWFNwMAICUgJSkDACAFIA2FhTcDACAmICYpAwAgBiAOhYU3AwAgJyAnKQMAIAcgD4WFNwMAICggKCkDACAIIBCFhTcDAAs=")}},function(){return t||(0,a[Object.keys(a)[0]])((t={exports:{}}).exports,t),t.exports})(),d=WebAssembly.compile(f);e.exports=async e=>(await WebAssembly.instantiate(await d,e)).exports},51685:(e,a,t)=>{var c=t(86889),f=t(35682),d=null,r="undefined"!=typeof WebAssembly&&t(91892)().then((e=>{d=e})),n=64,i=[];e.exports=p;var b=e.exports.BYTES_MIN=16,o=e.exports.BYTES_MAX=64,s=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),l=e.exports.KEYBYTES_MAX=64,u=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),h=e.exports.PERSONALBYTES=16;function p(e,a,t,f,r){if(!(this instanceof p))return new p(e,a,t,f,r);if(!d)throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");e||(e=32),!0!==r&&(c(e>=b,"digestLength must be at least "+b+", was given "+e),c(e<=o,"digestLength must be at most "+o+", was given "+e),null!=a&&(c(a instanceof Uint8Array,"key must be Uint8Array or Buffer"),c(a.length>=s,"key must be at least "+s+", was given "+a.length),c(a.length<=l,"key must be at least "+l+", was given "+a.length)),null!=t&&(c(t instanceof Uint8Array,"salt must be Uint8Array or Buffer"),c(t.length===u,"salt must be exactly "+u+", was given "+t.length)),null!=f&&(c(f instanceof Uint8Array,"personal must be Uint8Array or Buffer"),c(f.length===h,"personal must be exactly "+h+", was given "+f.length))),i.length||(i.push(n),n+=216),this.digestLength=e,this.finalized=!1,this.pointer=i.pop(),this._memory=new Uint8Array(d.memory.buffer),this._memory.fill(0,0,64),this._memory[0]=this.digestLength,this._memory[1]=a?a.length:0,this._memory[2]=1,this._memory[3]=1,t&&this._memory.set(t,32),f&&this._memory.set(f,48),this.pointer+216>this._memory.length&&this._realloc(this.pointer+216),d.blake2b_init(this.pointer,this.digestLength),a&&(this.update(a),this._memory.fill(0,n,n+a.length),this._memory[this.pointer+200]=128)}function g(){}p.prototype._realloc=function(e){d.memory.grow(Math.max(0,Math.ceil(Math.abs(e-this._memory.length)/65536))),this._memory=new Uint8Array(d.memory.buffer)},p.prototype.update=function(e){return c(!1===this.finalized,"Hash instance finalized"),c(e instanceof Uint8Array,"input must be Uint8Array or Buffer"),n+e.length>this._memory.length&&this._realloc(n+e.length),this._memory.set(e,n),d.blake2b_update(this.pointer,n,n+e.length),this},p.prototype.digest=function(e){if(c(!1===this.finalized,"Hash instance finalized"),this.finalized=!0,i.push(this.pointer),d.blake2b_final(this.pointer),!e||"binary"===e)return this._memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if("string"==typeof e)return f.toString(this._memory,e,this.pointer+128,this.pointer+128+this.digestLength);c(e instanceof Uint8Array&&e.length>=this.digestLength,"input must be Uint8Array or Buffer");for(var a=0;ae()),e):e(new Error("WebAssembly not supported"))},p.prototype.ready=p.ready,p.prototype.getPartialHash=function(){return this._memory.slice(this.pointer,this.pointer+216)},p.prototype.setPartialHash=function(e){this._memory.set(e,this.pointer)}},72206:(e,a,t)=>{var c=t(86889),f=t(51685);function d(e,a,t){var c=e[a]+e[t],f=e[a+1]+e[t+1];c>=4294967296&&f++,e[a]=c,e[a+1]=f}function r(e,a,t,c){var f=e[a]+t;t<0&&(f+=4294967296);var d=e[a+1]+c;f>=4294967296&&d++,e[a]=f,e[a+1]=d}function n(e,a){return e[a]^e[a+1]<<8^e[a+2]<<16^e[a+3]<<24}function i(e,a,t,c,f,n){var i=l[f],b=l[f+1],o=l[n],u=l[n+1];d(s,e,a),r(s,e,i,b);var h=s[c]^s[e],p=s[c+1]^s[e+1];s[c]=p,s[c+1]=h,d(s,t,c),h=s[a]^s[t],p=s[a+1]^s[t+1],s[a]=h>>>24^p<<8,s[a+1]=p>>>24^h<<8,d(s,e,a),r(s,e,o,u),h=s[c]^s[e],p=s[c+1]^s[e+1],s[c]=h>>>16^p<<16,s[c+1]=p>>>16^h<<16,d(s,t,c),h=s[a]^s[t],p=s[a+1]^s[t+1],s[a]=p>>>31^h<<1,s[a+1]=h>>>31^p<<1}var b=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),o=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),s=new Uint32Array(32),l=new Uint32Array(32);function u(e,a){var t=0;for(t=0;t<16;t++)s[t]=e.h[t],s[t+16]=b[t];for(s[24]=s[24]^e.t,s[25]=s[25]^e.t/4294967296,a&&(s[28]=~s[28],s[29]=~s[29]),t=0;t<32;t++)l[t]=n(e.b,4*t);for(t=0;t<12;t++)i(0,8,16,24,o[16*t+0],o[16*t+1]),i(2,10,18,26,o[16*t+2],o[16*t+3]),i(4,12,20,28,o[16*t+4],o[16*t+5]),i(6,14,22,30,o[16*t+6],o[16*t+7]),i(0,10,20,30,o[16*t+8],o[16*t+9]),i(2,12,22,24,o[16*t+10],o[16*t+11]),i(4,14,16,26,o[16*t+12],o[16*t+13]),i(6,8,18,28,o[16*t+14],o[16*t+15]);for(t=0;t<16;t++)e.h[t]=e.h[t]^s[t]^s[t+16]}var h=new Uint8Array([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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,a,t,c){h.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=e,h[0]=e,a&&(h[1]=a.length),h[2]=1,h[3]=1,t&&h.set(t,32),c&&h.set(c,48);for(var f=0;f<16;f++)this.h[f]=b[f]^n(h,4*f);a&&(g(this,a),this.c=128)}function g(e,a){for(var t=0;t=this.outlen,"out must have at least outlen bytes of space"),function(e,a){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;u(e,!0);for(var t=0;t>2]>>8*(3&t)}(this,a),"hex"===e?function(e){for(var a="",t=0;t=x,"outlen must be at least "+x+", was given "+e),c(e<=y,"outlen must be at most "+y+", was given "+e),null!=a&&(c(a instanceof Uint8Array,"key must be Uint8Array or Buffer"),c(a.length>=A,"key must be at least "+A+", was given "+a.length),c(a.length<=v,"key must be at most "+v+", was given "+a.length)),null!=t&&(c(t instanceof Uint8Array,"salt must be Uint8Array or Buffer"),c(t.length===w,"salt must be exactly "+w+", was given "+t.length)),null!=f&&(c(f instanceof Uint8Array,"personal must be Uint8Array or Buffer"),c(f.length===_,"personal must be exactly "+_+", was given "+f.length))),new m(e,a,t,f)},e.exports.ready=function(e){f.ready((function(){e()}))},e.exports.WASM_SUPPORTED=f.SUPPORTED,e.exports.WASM_LOADED=!1;var x=e.exports.BYTES_MIN=16,y=e.exports.BYTES_MAX=64,A=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),v=e.exports.KEYBYTES_MAX=64,w=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),_=e.exports.PERSONALBYTES=16;f.ready((function(a){a||(e.exports.WASM_LOADED=!0,e.exports=f)}))},39404:function(e,a,t){!function(e,a){"use strict";function c(e,a){if(!e)throw new Error(a||"Assertion failed")}function f(e,a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}function d(e,a,t){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(t=a,a=10),this._init(e||0,a||10,t||"be"))}var r;"object"==typeof e?e.exports=d:a.BN=d,d.BN=d,d.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(47790).Buffer}catch(e){}function n(e,a){var t=e.charCodeAt(a);return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void c(!1,"Invalid character in "+e)}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,f){for(var d=0,r=0,n=Math.min(e.length,t),i=a;i=49?b-49+10:b>=17?b-17+10:b,c(b>=0&&r0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this._strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this._strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{d.prototype[Symbol.for("nodejs.util.inspect.custom")]=s}catch(e){d.prototype.inspect=s}else d.prototype.inspect=s;function s(){return(this.red?""}var l=["","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"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t._strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215,(f+=2)>=26&&(f-=26,r--),t=0!==d||r!==this.length-1?l[6-i.length]+i+t:i+t}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=u[e],o=h[e];t="";var s=this.clone();for(s.negative=0;!s.isZero();){var p=s.modrn(o).toString(e);t=(s=s.idivn(o)).isZero()?p+t:l[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16,2)},r&&(d.prototype.toBuffer=function(e,a){return this.toArrayLike(r,e,a)}),d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){this._strip();var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0");var r=function(e,a){return e.allocUnsafe?e.allocUnsafe(a):new e(a)}(e,d);return this["_toArrayLike"+("le"===a?"LE":"BE")](r,f),r},d.prototype._toArrayLikeLE=function(e,a){for(var t=0,c=0,f=0,d=0;f>8&255),t>16&255),6===d?(t>24&255),c=0,d=0):(c=r>>>24,d+=2)}if(t=0&&(e[t--]=r>>8&255),t>=0&&(e[t--]=r>>16&255),6===d?(t>=0&&(e[t--]=r>>24&255),c=0,d=0):(c=r>>>24,d+=2)}if(t>=0)for(e[t--]=c;t>=0;)e[t--]=0},Math.clz32?d.prototype._countBits=function(e){return 32-Math.clz32(e)}:d.prototype._countBits=function(e){var a=e,t=0;return a>=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this._strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,T=R>>>13,D=0|r[9],F=8191&D,Q=D>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(T,j)|0,d=Math.imul(T,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(T,q)|0,d=d+Math.imul(T,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(T,K)|0,d=d+Math.imul(T,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(T,J)|0,d=d+Math.imul(T,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(T,X)|0,d=d+Math.imul(T,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(T,te)|0,d=d+Math.imul(T,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(T,de)|0,d=d+Math.imul(T,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(T,ie)|0,d=d+Math.imul(T,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(T,se)|0,d=d+Math.imul(T,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(T,he)|0))<<13)|0;b=((d=d+Math.imul(T,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function m(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t._strip()}function x(e,a,t){return m(e,a,t)}function y(e,a){this.x=e,this.y=a}Math.imul||(g=p),d.prototype.mulTo=function(e,a){var t=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,a):t<63?p(this,e,a):t<1024?m(this,e,a):x(this,e,a)},y.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},y.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,t+=d/67108864|0,t+=r>>>26,this.words[f]=67108863&r}return 0!==t&&(this.words[f]=t,this.length++),a?this.ineg():this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f&1}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this._strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this._strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n._strip(),c._strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modrn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modrn=function(e){var a=e<0;a&&(e=-e),c(e<=67108863);for(var t=(1<<26)%e,f=0,d=this.length-1;d>=0;d--)f=(t*f+(0|this.words[d]))%e;return a?-f:f},d.prototype.modn=function(e){return this.modrn(e)},d.prototype.idivn=function(e){var a=e<0;a&&(e=-e),c(e<=67108863);for(var t=0,f=this.length-1;f>=0;f--){var d=(0|this.words[f])+67108864*t;this.words[f]=d/e|0,t=d%e}return this._strip(),a?this.ineg():this},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this._strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new C(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var A={k256:null,p224:null,p192:null,p25519:null};function v(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function I(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}v.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},v.prototype.split=function(e,a){e.iushrn(this.n,0,a)},v.prototype.imulK=function(e){return e.imul(this.k)},f(w,v),w.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(A[e])return A[e];var a;if("k256"===e)a=new w;else if("p224"===e)a=new _;else if("p192"===e)a=new I;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new E}return A[e]=a,a},C.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(o(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},C.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},C.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},C.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},C.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},C.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},C.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},C.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},C.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new M(e)},f(M,C),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},M.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},M.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},15037:(e,a,t)=>{var c;function f(e){this.rand=e}if(e.exports=function(e){return c||(c=new f(null)),c.generate(e)},e.exports.Rand=f,f.prototype.generate=function(e){return this._rand(e)},f.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var a=new Uint8Array(e),t=0;t{var c=t(92861).Buffer;function f(e){c.isBuffer(e)||(e=c.from(e));for(var a=e.length/4|0,t=new Array(a),f=0;f>>24]^o[h>>>16&255]^s[p>>>8&255]^l[255&g]^a[m++],r=b[h>>>24]^o[p>>>16&255]^s[g>>>8&255]^l[255&u]^a[m++],n=b[p>>>24]^o[g>>>16&255]^s[u>>>8&255]^l[255&h]^a[m++],i=b[g>>>24]^o[u>>>16&255]^s[h>>>8&255]^l[255&p]^a[m++],u=d,h=r,p=n,g=i;return d=(c[u>>>24]<<24|c[h>>>16&255]<<16|c[p>>>8&255]<<8|c[255&g])^a[m++],r=(c[h>>>24]<<24|c[p>>>16&255]<<16|c[g>>>8&255]<<8|c[255&u])^a[m++],n=(c[p>>>24]<<24|c[g>>>16&255]<<16|c[u>>>8&255]<<8|c[255&h])^a[m++],i=(c[g>>>24]<<24|c[u>>>16&255]<<16|c[h>>>8&255]<<8|c[255&p])^a[m++],[d>>>=0,r>>>=0,n>>>=0,i>>>=0]}var n=[0,1,2,4,8,16,32,64,128,27,54],i=function(){for(var e=new Array(256),a=0;a<256;a++)e[a]=a<128?a<<1:a<<1^283;for(var t=[],c=[],f=[[],[],[],[]],d=[[],[],[],[]],r=0,n=0,i=0;i<256;++i){var b=n^n<<1^n<<2^n<<3^n<<4;b=b>>>8^255&b^99,t[r]=b,c[b]=r;var o=e[r],s=e[o],l=e[s],u=257*e[b]^16843008*b;f[0][r]=u<<24|u>>>8,f[1][r]=u<<16|u>>>16,f[2][r]=u<<8|u>>>24,f[3][r]=u,u=16843009*l^65537*s^257*o^16843008*r,d[0][b]=u<<24|u>>>8,d[1][b]=u<<16|u>>>16,d[2][b]=u<<8|u>>>24,d[3][b]=u,0===r?r=n=1:(r=o^e[e[e[l^o]]],n^=e[e[n]])}return{SBOX:t,INV_SBOX:c,SUB_MIX:f,INV_SUB_MIX:d}}();function b(e){this._key=f(e),this._reset()}b.blockSize=16,b.keySize=32,b.prototype.blockSize=b.blockSize,b.prototype.keySize=b.keySize,b.prototype._reset=function(){for(var e=this._key,a=e.length,t=a+6,c=4*(t+1),f=[],d=0;d>>24,r=i.SBOX[r>>>24]<<24|i.SBOX[r>>>16&255]<<16|i.SBOX[r>>>8&255]<<8|i.SBOX[255&r],r^=n[d/a|0]<<24):a>6&&d%a==4&&(r=i.SBOX[r>>>24]<<24|i.SBOX[r>>>16&255]<<16|i.SBOX[r>>>8&255]<<8|i.SBOX[255&r]),f[d]=f[d-a]^r}for(var b=[],o=0;o>>24]]^i.INV_SUB_MIX[1][i.SBOX[l>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[l>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[255&l]]}this._nRounds=t,this._keySchedule=f,this._invKeySchedule=b},b.prototype.encryptBlockRaw=function(e){return r(e=f(e),this._keySchedule,i.SUB_MIX,i.SBOX,this._nRounds)},b.prototype.encryptBlock=function(e){var a=this.encryptBlockRaw(e),t=c.allocUnsafe(16);return t.writeUInt32BE(a[0],0),t.writeUInt32BE(a[1],4),t.writeUInt32BE(a[2],8),t.writeUInt32BE(a[3],12),t},b.prototype.decryptBlock=function(e){var a=(e=f(e))[1];e[1]=e[3],e[3]=a;var t=r(e,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX,this._nRounds),d=c.allocUnsafe(16);return d.writeUInt32BE(t[0],0),d.writeUInt32BE(t[3],4),d.writeUInt32BE(t[2],8),d.writeUInt32BE(t[1],12),d},b.prototype.scrub=function(){d(this._keySchedule),d(this._invKeySchedule),d(this._key)},e.exports.AES=b},92356:(e,a,t)=>{var c=t(50462),f=t(92861).Buffer,d=t(56168),r=t(56698),n=t(25892),i=t(30295),b=t(45122);function o(e,a,t,r){d.call(this);var i=f.alloc(4,0);this._cipher=new c.AES(a);var o=this._cipher.encryptBlock(i);this._ghash=new n(o),t=function(e,a,t){if(12===a.length)return e._finID=f.concat([a,f.from([0,0,0,1])]),f.concat([a,f.from([0,0,0,2])]);var c=new n(t),d=a.length,r=d%16;c.update(a),r&&(r=16-r,c.update(f.alloc(r,0))),c.update(f.alloc(8,0));var i=8*d,o=f.alloc(8);o.writeUIntBE(i,0,8),c.update(o),e._finID=c.state;var s=f.from(e._finID);return b(s),s}(this,t,o),this._prev=f.from(t),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=r,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}r(o,d),o.prototype._update=function(e){if(!this._called&&this._alen){var a=16-this._alen%16;a<16&&(a=f.alloc(a,0),this._ghash.update(a))}this._called=!0;var t=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(t),this._len+=e.length,t},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=i(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,a){var t=0;e.length!==a.length&&t++;for(var c=Math.min(e.length,a.length),f=0;f{var c=t(25799),f=t(36171),d=t(3219);a.createCipher=a.Cipher=c.createCipher,a.createCipheriv=a.Cipheriv=c.createCipheriv,a.createDecipher=a.Decipher=f.createDecipher,a.createDecipheriv=a.Decipheriv=f.createDecipheriv,a.listCiphers=a.getCiphers=function(){return Object.keys(d)}},36171:(e,a,t)=>{var c=t(92356),f=t(92861).Buffer,d=t(530),r=t(50650),n=t(56168),i=t(50462),b=t(68078);function o(e,a,t){n.call(this),this._cache=new s,this._last=void 0,this._cipher=new i.AES(a),this._prev=f.from(t),this._mode=e,this._autopadding=!0}function s(){this.cache=f.allocUnsafe(0)}function l(e,a,t){var n=d[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=f.from(t)),"GCM"!==n.mode&&t.length!==n.iv)throw new TypeError("invalid iv length "+t.length);if("string"==typeof a&&(a=f.from(a)),a.length!==n.key/8)throw new TypeError("invalid key length "+a.length);return"stream"===n.type?new r(n.module,a,t,!0):"auth"===n.type?new c(n.module,a,t,!0):new o(n.module,a,t)}t(56698)(o,n),o.prototype._update=function(e){var a,t;this._cache.add(e);for(var c=[];a=this._cache.get(this._autopadding);)t=this._mode.decrypt(this,a),c.push(t);return f.concat(c)},o.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var a=e[15];if(a<1||a>16)throw new Error("unable to decrypt data");for(var t=-1;++t16)return a=this.cache.slice(0,16),this.cache=this.cache.slice(16),a}else if(this.cache.length>=16)return a=this.cache.slice(0,16),this.cache=this.cache.slice(16),a;return null},s.prototype.flush=function(){if(this.cache.length)return this.cache},a.createDecipher=function(e,a){var t=d[e.toLowerCase()];if(!t)throw new TypeError("invalid suite type");var c=b(a,!1,t.key,t.iv);return l(e,c.key,c.iv)},a.createDecipheriv=l},25799:(e,a,t)=>{var c=t(530),f=t(92356),d=t(92861).Buffer,r=t(50650),n=t(56168),i=t(50462),b=t(68078);function o(e,a,t){n.call(this),this._cache=new l,this._cipher=new i.AES(a),this._prev=d.from(t),this._mode=e,this._autopadding=!0}t(56698)(o,n),o.prototype._update=function(e){var a,t;this._cache.add(e);for(var c=[];a=this._cache.get();)t=this._mode.encrypt(this,a),c.push(t);return d.concat(c)};var s=d.alloc(16,16);function l(){this.cache=d.allocUnsafe(0)}function u(e,a,t){var n=c[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");if("string"==typeof a&&(a=d.from(a)),a.length!==n.key/8)throw new TypeError("invalid key length "+a.length);if("string"==typeof t&&(t=d.from(t)),"GCM"!==n.mode&&t.length!==n.iv)throw new TypeError("invalid iv length "+t.length);return"stream"===n.type?new r(n.module,a,t):"auth"===n.type?new f(n.module,a,t):new o(n.module,a,t)}o.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(s))throw this._cipher.scrub(),new Error("data not multiple of block length")},o.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},l.prototype.add=function(e){this.cache=d.concat([this.cache,e])},l.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},l.prototype.flush=function(){for(var e=16-this.cache.length,a=d.allocUnsafe(e),t=-1;++t{var c=t(92861).Buffer,f=c.alloc(16,0);function d(e){var a=c.allocUnsafe(16);return a.writeUInt32BE(e[0]>>>0,0),a.writeUInt32BE(e[1]>>>0,4),a.writeUInt32BE(e[2]>>>0,8),a.writeUInt32BE(e[3]>>>0,12),a}function r(e){this.h=e,this.state=c.alloc(16,0),this.cache=c.allocUnsafe(0)}r.prototype.ghash=function(e){for(var a=-1;++a0;a--)c[a]=c[a]>>>1|(1&c[a-1])<<31;c[0]=c[0]>>>1,t&&(c[0]=c[0]^225<<24)}this.state=d(f)},r.prototype.update=function(e){var a;for(this.cache=c.concat([this.cache,e]);this.cache.length>=16;)a=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(a)},r.prototype.final=function(e,a){return this.cache.length&&this.ghash(c.concat([this.cache,f],16)),this.ghash(d([0,e,0,a])),this.state},e.exports=r},45122:e=>{e.exports=function(e){for(var a,t=e.length;t--;){if(255!==(a=e.readUInt8(t))){a++,e.writeUInt8(a,t);break}e.writeUInt8(0,t)}}},92884:(e,a,t)=>{var c=t(30295);a.encrypt=function(e,a){var t=c(a,e._prev);return e._prev=e._cipher.encryptBlock(t),e._prev},a.decrypt=function(e,a){var t=e._prev;e._prev=a;var f=e._cipher.decryptBlock(a);return c(f,t)}},46383:(e,a,t)=>{var c=t(92861).Buffer,f=t(30295);function d(e,a,t){var d=a.length,r=f(a,e._cache);return e._cache=e._cache.slice(d),e._prev=c.concat([e._prev,t?a:r]),r}a.encrypt=function(e,a,t){for(var f,r=c.allocUnsafe(0);a.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=c.allocUnsafe(0)),!(e._cache.length<=a.length)){r=c.concat([r,d(e,a,t)]);break}f=e._cache.length,r=c.concat([r,d(e,a.slice(0,f),t)]),a=a.slice(f)}return r}},55264:(e,a,t)=>{var c=t(92861).Buffer;function f(e,a,t){for(var c,f,r=-1,n=0;++r<8;)c=a&1<<7-r?128:0,n+=(128&(f=e._cipher.encryptBlock(e._prev)[0]^c))>>r%8,e._prev=d(e._prev,t?c:f);return n}function d(e,a){var t=e.length,f=-1,d=c.allocUnsafe(e.length);for(e=c.concat([e,c.from([a])]);++f>7;return d}a.encrypt=function(e,a,t){for(var d=a.length,r=c.allocUnsafe(d),n=-1;++n{var c=t(92861).Buffer;function f(e,a,t){var f=e._cipher.encryptBlock(e._prev)[0]^a;return e._prev=c.concat([e._prev.slice(1),c.from([t?a:f])]),f}a.encrypt=function(e,a,t){for(var d=a.length,r=c.allocUnsafe(d),n=-1;++n{var c=t(30295),f=t(92861).Buffer,d=t(45122);function r(e){var a=e._cipher.encryptBlockRaw(e._prev);return d(e._prev),a}a.encrypt=function(e,a){var t=Math.ceil(a.length/16),d=e._cache.length;e._cache=f.concat([e._cache,f.allocUnsafe(16*t)]);for(var n=0;n{a.encrypt=function(e,a){return e._cipher.encryptBlock(a)},a.decrypt=function(e,a){return e._cipher.decryptBlock(a)}},530:(e,a,t)=>{var c={ECB:t(52632),CBC:t(92884),CFB:t(46383),CFB8:t(86975),CFB1:t(55264),OFB:t(46843),CTR:t(63053),GCM:t(63053)},f=t(3219);for(var d in f)f[d].module=c[f[d].mode];e.exports=f},46843:(e,a,t)=>{var c=t(48287).Buffer,f=t(30295);function d(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}a.encrypt=function(e,a){for(;e._cache.length{var c=t(50462),f=t(92861).Buffer,d=t(56168);function r(e,a,t,r){d.call(this),this._cipher=new c.AES(a),this._prev=f.from(t),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=r,this._mode=e}t(56698)(r,d),r.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},r.prototype._final=function(){this._cipher.scrub()},e.exports=r},30125:(e,a,t)=>{var c=t(84050),f=t(1241),d=t(530),r=t(32438),n=t(68078);function i(e,a,t){if(e=e.toLowerCase(),d[e])return f.createCipheriv(e,a,t);if(r[e])return new c({key:a,iv:t,mode:e});throw new TypeError("invalid suite type")}function b(e,a,t){if(e=e.toLowerCase(),d[e])return f.createDecipheriv(e,a,t);if(r[e])return new c({key:a,iv:t,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}a.createCipher=a.Cipher=function(e,a){var t,c;if(e=e.toLowerCase(),d[e])t=d[e].key,c=d[e].iv;else{if(!r[e])throw new TypeError("invalid suite type");t=8*r[e].key,c=r[e].iv}var f=n(a,!1,t,c);return i(e,f.key,f.iv)},a.createCipheriv=a.Cipheriv=i,a.createDecipher=a.Decipher=function(e,a){var t,c;if(e=e.toLowerCase(),d[e])t=d[e].key,c=d[e].iv;else{if(!r[e])throw new TypeError("invalid suite type");t=8*r[e].key,c=r[e].iv}var f=n(a,!1,t,c);return b(e,f.key,f.iv)},a.createDecipheriv=a.Decipheriv=b,a.listCiphers=a.getCiphers=function(){return Object.keys(r).concat(f.getCiphers())}},84050:(e,a,t)=>{var c=t(56168),f=t(29560),d=t(56698),r=t(92861).Buffer,n={"des-ede3-cbc":f.CBC.instantiate(f.EDE),"des-ede3":f.EDE,"des-ede-cbc":f.CBC.instantiate(f.EDE),"des-ede":f.EDE,"des-cbc":f.CBC.instantiate(f.DES),"des-ecb":f.DES};function i(e){c.call(this);var a,t=e.mode.toLowerCase(),f=n[t];a=e.decrypt?"decrypt":"encrypt";var d=e.key;r.isBuffer(d)||(d=r.from(d)),"des-ede"!==t&&"des-ede-cbc"!==t||(d=r.concat([d,d.slice(0,8)]));var i=e.iv;r.isBuffer(i)||(i=r.from(i)),this._des=f.create({key:d,iv:i,type:a})}n.des=n["des-cbc"],n.des3=n["des-ede3-cbc"],e.exports=i,d(i,c),i.prototype._update=function(e){return r.from(this._des.update(e))},i.prototype._final=function(){return r.from(this._des.final())}},32438:(e,a)=>{a["des-ecb"]={key:8,iv:0},a["des-cbc"]=a.des={key:8,iv:8},a["des-ede3-cbc"]=a.des3={key:24,iv:8},a["des-ede3"]={key:24,iv:0},a["des-ede-cbc"]={key:16,iv:8},a["des-ede"]={key:16,iv:0}},67332:(e,a,t)=>{var c=t(48287).Buffer,f=t(39404),d=t(53209);function r(e){var a,t=e.modulus.byteLength();do{a=new f(d(t))}while(a.cmp(e.modulus)>=0||!a.umod(e.prime1)||!a.umod(e.prime2));return a}function n(e,a){var t=function(e){var a=r(e);return{blinder:a.toRed(f.mont(e.modulus)).redPow(new f(e.publicExponent)).fromRed(),unblinder:a.invm(e.modulus)}}(a),d=a.modulus.byteLength(),n=new f(e).mul(t.blinder).umod(a.modulus),i=n.toRed(f.mont(a.prime1)),b=n.toRed(f.mont(a.prime2)),o=a.coefficient,s=a.prime1,l=a.prime2,u=i.redPow(a.exponent1).fromRed(),h=b.redPow(a.exponent2).fromRed(),p=u.isub(h).imul(o).umod(s).imul(l);return h.iadd(p).imul(t.unblinder).umod(a.modulus).toArrayLike(c,"be",d)}n.getr=r,e.exports=n},55715:(e,a,t)=>{"use strict";e.exports=t(62951)},20:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(47108),d=t(46737),r=t(56698),n=t(35359),i=t(74847),b=t(62951);function o(e){d.Writable.call(this);var a=b[e];if(!a)throw new Error("Unknown message digest");this._hashType=a.hash,this._hash=f(a.hash),this._tag=a.id,this._signType=a.sign}function s(e){d.Writable.call(this);var a=b[e];if(!a)throw new Error("Unknown message digest");this._hash=f(a.hash),this._tag=a.id,this._signType=a.sign}function l(e){return new o(e)}function u(e){return new s(e)}Object.keys(b).forEach((function(e){b[e].id=c.from(b[e].id,"hex"),b[e.toLowerCase()]=b[e]})),r(o,d.Writable),o.prototype._write=function(e,a,t){this._hash.update(e),t()},o.prototype.update=function(e,a){return this._hash.update("string"==typeof e?c.from(e,a):e),this},o.prototype.sign=function(e,a){this.end();var t=this._hash.digest(),c=n(t,e,this._hashType,this._signType,this._tag);return a?c.toString(a):c},r(s,d.Writable),s.prototype._write=function(e,a,t){this._hash.update(e),t()},s.prototype.update=function(e,a){return this._hash.update("string"==typeof e?c.from(e,a):e),this},s.prototype.verify=function(e,a,t){var f="string"==typeof a?c.from(a,t):a;this.end();var d=this._hash.digest();return i(f,d,e,this._signType,this._tag)},e.exports={Sign:l,Verify:u,createSign:l,createVerify:u}},35359:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(83507),d=t(67332),r=t(86729).ec,n=t(39404),i=t(78170),b=t(64589);function o(e,a,t,d){if((e=c.from(e.toArray())).length0&&t.ishrn(c),t}function l(e,a,t){var d,r;do{for(d=c.alloc(0);8*d.length{"use strict";var c=t(92861).Buffer,f=t(39404),d=t(86729).ec,r=t(78170),n=t(64589);function i(e,a){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(a)>=0)throw new Error("invalid sig")}e.exports=function(e,a,t,b,o){var s=r(t);if("ec"===s.type){if("ecdsa"!==b&&"ecdsa/rsa"!==b)throw new Error("wrong public key type");return function(e,a,t){var c=n[t.data.algorithm.curve.join(".")];if(!c)throw new Error("unknown curve "+t.data.algorithm.curve.join("."));var f=new d(c),r=t.data.subjectPrivateKey.data;return f.verify(a,e,r)}(e,a,s)}if("dsa"===s.type){if("dsa"!==b)throw new Error("wrong public key type");return function(e,a,t){var c=t.data.p,d=t.data.q,n=t.data.g,b=t.data.pub_key,o=r.signature.decode(e,"der"),s=o.s,l=o.r;i(s,d),i(l,d);var u=f.mont(c),h=s.invm(d);return 0===n.toRed(u).redPow(new f(a).mul(h).mod(d)).fromRed().mul(b.toRed(u).redPow(l.mul(h).mod(d)).fromRed()).mod(c).mod(d).cmp(l)}(e,a,s)}if("rsa"!==b&&"ecdsa/rsa"!==b)throw new Error("wrong public key type");a=c.concat([o,a]);for(var l=s.modulus.byteLength(),u=[1],h=0;a.length+u.length+2{var a={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==a.call(e)}},26248:(e,a,t)=>{"use strict";var c=t(33225),f=Object.keys||function(e){var a=[];for(var t in e)a.push(t);return a};e.exports=s;var d=Object.create(t(15622));d.inherits=t(56698);var r=t(30206),n=t(7314);d.inherits(s,r);for(var i=f(n.prototype),b=0;b{"use strict";e.exports=d;var c=t(81816),f=Object.create(t(15622));function d(e){if(!(this instanceof d))return new d(e);c.call(this,e)}f.inherits=t(56698),f.inherits(d,c),d.prototype._transform=function(e,a,t){t(null,e)}},30206:(e,a,t)=>{"use strict";var c=t(33225);e.exports=x;var f,d=t(32240);x.ReadableState=m,t(37007).EventEmitter;var r=function(e,a){return e.listeners(a).length},n=t(5567),i=t(24116).Buffer,b=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},o=Object.create(t(15622));o.inherits=t(56698);var s=t(92668),l=void 0;l=s&&s.debuglog?s.debuglog("stream"):function(){};var u,h=t(20672),p=t(36278);o.inherits(x,n);var g=["error","close","destroy","pause","resume"];function m(e,a){e=e||{};var c=a instanceof(f=f||t(26248));this.objectMode=!!e.objectMode,c&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var d=e.highWaterMark,r=e.readableHighWaterMark,n=this.objectMode?16:16384;this.highWaterMark=d||0===d?d:c&&(r||0===r)?r:n,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=t(6427).I),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function x(e){if(f=f||t(26248),!(this instanceof x))return new x(e);this._readableState=new m(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),n.call(this)}function y(e,a,t,c,f){var d,r=e._readableState;return null===a?(r.reading=!1,function(e,a){if(!a.ended){if(a.decoder){var t=a.decoder.end();t&&t.length&&(a.buffer.push(t),a.length+=a.objectMode?1:t.length)}a.ended=!0,_(e)}}(e,r)):(f||(d=function(e,a){var t,c;return c=a,i.isBuffer(c)||c instanceof b||"string"==typeof a||void 0===a||e.objectMode||(t=new TypeError("Invalid non-string/buffer chunk")),t}(r,a)),d?e.emit("error",d):r.objectMode||a&&a.length>0?("string"==typeof a||r.objectMode||Object.getPrototypeOf(a)===i.prototype||(a=function(e){return i.from(e)}(a)),c?r.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):A(e,r,a,!0):r.ended?e.emit("error",new Error("stream.push() after EOF")):(r.reading=!1,r.decoder&&!t?(a=r.decoder.write(a),r.objectMode||0!==a.length?A(e,r,a,!1):E(e,r)):A(e,r,a,!1))):c||(r.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtha.highWaterMark&&(a.highWaterMark=function(e){return e>=v?e=v:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0))}function _(e){var a=e._readableState;a.needReadable=!1,a.emittedReadable||(l("emitReadable",a.flowing),a.emittedReadable=!0,a.sync?c.nextTick(I,e):I(e))}function I(e){l("emit readable"),e.emit("readable"),L(e)}function E(e,a){a.readingMore||(a.readingMore=!0,c.nextTick(C,e,a))}function C(e,a){for(var t=a.length;!a.reading&&!a.flowing&&!a.ended&&a.length=a.length?(t=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.head.data:a.buffer.concat(a.length),a.buffer.clear()):t=function(e,a,t){var c;return ed.length?d.length:e;if(r===d.length?f+=d:f+=d.slice(0,e),0==(e-=r)){r===d.length?(++c,t.next?a.head=t.next:a.head=a.tail=null):(a.head=t,t.data=d.slice(r));break}++c}return a.length-=c,f}(e,a):function(e,a){var t=i.allocUnsafe(e),c=a.head,f=1;for(c.data.copy(t),e-=c.data.length;c=c.next;){var d=c.data,r=e>d.length?d.length:e;if(d.copy(t,t.length-e,0,r),0==(e-=r)){r===d.length?(++f,c.next?a.head=c.next:a.head=a.tail=null):(a.head=c,c.data=d.slice(r));break}++f}return a.length-=f,t}(e,a),c}(e,a.buffer,a.decoder),t);var t}function k(e){var a=e._readableState;if(a.length>0)throw new Error('"endReadable()" called on non-empty stream');a.endEmitted||(a.ended=!0,c.nextTick(N,a,e))}function N(e,a){e.endEmitted||0!==e.length||(e.endEmitted=!0,a.readable=!1,a.emit("end"))}function P(e,a){for(var t=0,c=e.length;t=a.highWaterMark||a.ended))return l("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?k(this):_(this),null;if(0===(e=w(e,a))&&a.ended)return 0===a.length&&k(this),null;var c,f=a.needReadable;return l("need readable",f),(0===a.length||a.length-e0?S(e,a):null)?(a.needReadable=!0,e=0):a.length-=e,0===a.length&&(a.ended||(a.needReadable=!0),t!==e&&a.ended&&k(this)),null!==c&&this.emit("data",c),c},x.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},x.prototype.pipe=function(e,a){var t=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1,l("pipe count=%d opts=%j",f.pipesCount,a);var n=a&&!1===a.end||e===process.stdout||e===process.stderr?m:i;function i(){l("onend"),e.end()}f.endEmitted?c.nextTick(n):t.once("end",n),e.on("unpipe",(function a(c,d){l("onunpipe"),c===t&&d&&!1===d.hasUnpiped&&(d.hasUnpiped=!0,l("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",b),e.removeListener("error",h),e.removeListener("unpipe",a),t.removeListener("end",i),t.removeListener("end",m),t.removeListener("data",u),o=!0,!f.awaitDrain||e._writableState&&!e._writableState.needDrain||b())}));var b=function(e){return function(){var a=e._readableState;l("pipeOnDrain",a.awaitDrain),a.awaitDrain&&a.awaitDrain--,0===a.awaitDrain&&r(e,"data")&&(a.flowing=!0,L(e))}}(t);e.on("drain",b);var o=!1,s=!1;function u(a){l("ondata"),s=!1,!1!==e.write(a)||s||((1===f.pipesCount&&f.pipes===e||f.pipesCount>1&&-1!==P(f.pipes,e))&&!o&&(l("false write response, pause",f.awaitDrain),f.awaitDrain++,s=!0),t.pause())}function h(a){l("onerror",a),m(),e.removeListener("error",h),0===r(e,"error")&&e.emit("error",a)}function p(){e.removeListener("finish",g),m()}function g(){l("onfinish"),e.removeListener("close",p),m()}function m(){l("unpipe"),t.unpipe(e)}return t.on("data",u),function(e,a,t){if("function"==typeof e.prependListener)return e.prependListener(a,t);e._events&&e._events[a]?d(e._events[a])?e._events[a].unshift(t):e._events[a]=[t,e._events[a]]:e.on(a,t)}(e,"error",h),e.once("close",p),e.once("finish",g),e.emit("pipe",t),f.flowing||(l("pipe resume"),t.resume()),e},x.prototype.unpipe=function(e){var a=this._readableState,t={hasUnpiped:!1};if(0===a.pipesCount)return this;if(1===a.pipesCount)return e&&e!==a.pipes||(e||(e=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,e&&e.emit("unpipe",this,t)),this;if(!e){var c=a.pipes,f=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var d=0;d{"use strict";e.exports=r;var c=t(26248),f=Object.create(t(15622));function d(e,a){var t=this._transformState;t.transforming=!1;var c=t.writecb;if(!c)return this.emit("error",new Error("write callback called multiple times"));t.writechunk=null,t.writecb=null,null!=a&&this.push(a),c(e);var f=this._readableState;f.reading=!1,(f.needReadable||f.length{"use strict";var c=t(33225);function f(e){var a=this;this.next=null,this.entry=null,this.finish=function(){!function(e,a){var t=e.entry;for(e.entry=null;t;){var c=t.callback;a.pendingcb--,c(undefined),t=t.next}a.corkedRequestsFree.next=e}(a,e)}}e.exports=g;var d,r=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:c.nextTick;g.WritableState=p;var n=Object.create(t(15622));n.inherits=t(56698);var i,b={deprecate:t(94643)},o=t(5567),s=t(24116).Buffer,l=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=t(36278);function h(){}function p(e,a){d=d||t(26248),e=e||{};var n=a instanceof d;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,b=e.writableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(b||0===b)?b:o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,a){var t=e._writableState,f=t.sync,d=t.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(t),a)!function(e,a,t,f,d){--a.pendingcb,t?(c.nextTick(d,f),c.nextTick(w,e,a),e._writableState.errorEmitted=!0,e.emit("error",f)):(d(f),e._writableState.errorEmitted=!0,e.emit("error",f),w(e,a))}(e,t,f,a,d);else{var n=A(t);n||t.corked||t.bufferProcessing||!t.bufferedRequest||y(e,t),f?r(x,e,t,n,d):x(e,t,n,d)}}(a,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}function g(e){if(d=d||t(26248),!(i.call(g,this)||this instanceof d))return new g(e);this._writableState=new p(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function m(e,a,t,c,f,d,r){a.writelen=c,a.writecb=r,a.writing=!0,a.sync=!0,t?e._writev(f,a.onwrite):e._write(f,d,a.onwrite),a.sync=!1}function x(e,a,t,c){t||function(e,a){0===a.length&&a.needDrain&&(a.needDrain=!1,e.emit("drain"))}(e,a),a.pendingcb--,c(),w(e,a)}function y(e,a){a.bufferProcessing=!0;var t=a.bufferedRequest;if(e._writev&&t&&t.next){var c=a.bufferedRequestCount,d=new Array(c),r=a.corkedRequestsFree;r.entry=t;for(var n=0,i=!0;t;)d[n]=t,t.isBuf||(i=!1),t=t.next,n+=1;d.allBuffers=i,m(e,a,!0,a.length,d,"",r.finish),a.pendingcb++,a.lastBufferedRequest=null,r.next?(a.corkedRequestsFree=r.next,r.next=null):a.corkedRequestsFree=new f(a),a.bufferedRequestCount=0}else{for(;t;){var b=t.chunk,o=t.encoding,s=t.callback;if(m(e,a,!1,a.objectMode?1:b.length,b,o,s),t=t.next,a.bufferedRequestCount--,a.writing)break}null===t&&(a.lastBufferedRequest=null)}a.bufferedRequest=t,a.bufferProcessing=!1}function A(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function v(e,a){e._final((function(t){a.pendingcb--,t&&e.emit("error",t),a.prefinished=!0,e.emit("prefinish"),w(e,a)}))}function w(e,a){var t=A(a);return t&&(function(e,a){a.prefinished||a.finalCalled||("function"==typeof e._final?(a.pendingcb++,a.finalCalled=!0,c.nextTick(v,e,a)):(a.prefinished=!0,e.emit("prefinish")))}(e,a),0===a.pendingcb&&(a.finished=!0,e.emit("finish"))),t}n.inherits(g,o),p.prototype.getBuffer=function(){for(var e=this.bufferedRequest,a=[];e;)a.push(e),e=e.next;return a},function(){try{Object.defineProperty(p.prototype,"buffer",{get:b.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===g&&e&&e._writableState instanceof p}})):i=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,a,t){var f,d=this._writableState,r=!1,n=!d.objectMode&&(f=e,s.isBuffer(f)||f instanceof l);return n&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"==typeof a&&(t=a,a=null),n?a="buffer":a||(a=d.defaultEncoding),"function"!=typeof t&&(t=h),d.ended?function(e,a){var t=new Error("write after end");e.emit("error",t),c.nextTick(a,t)}(this,t):(n||function(e,a,t,f){var d=!0,r=!1;return null===t?r=new TypeError("May not write null values to stream"):"string"==typeof t||void 0===t||a.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r&&(e.emit("error",r),c.nextTick(f,r),d=!1),d}(this,d,e,t))&&(d.pendingcb++,r=function(e,a,t,c,f,d){if(!t){var r=function(e,a,t){return e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=s.from(a,t)),a}(a,c,f);c!==r&&(t=!0,f="buffer",c=r)}var n=a.objectMode?1:c.length;a.length+=n;var i=a.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,a,t){t(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,a,t){var f=this._writableState;"function"==typeof e?(t=e,e=null,a=null):"function"==typeof a&&(t=a,a=null),null!=e&&this.write(e,a),f.corked&&(f.corked=1,this.uncork()),f.ending||function(e,a,t){a.ending=!0,w(e,a),t&&(a.finished?c.nextTick(t):e.once("finish",t)),a.ended=!0,e.writable=!1}(this,f,t)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=u.destroy,g.prototype._undestroy=u.undestroy,g.prototype._destroy=function(e,a){this.end(),a(e)}},20672:(e,a,t)=>{"use strict";var c=t(24116).Buffer,f=t(21638);e.exports=function(){function e(){!function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var a={data:e,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length},e.prototype.unshift=function(e){var a={data:e,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var a=this.head,t=""+a.data;a=a.next;)t+=e+a.data;return t},e.prototype.concat=function(e){if(0===this.length)return c.alloc(0);for(var a,t,f=c.allocUnsafe(e>>>0),d=this.head,r=0;d;)a=f,t=r,d.data.copy(a,t),r+=d.data.length,d=d.next;return f},e}(),f&&f.inspect&&f.inspect.custom&&(e.exports.prototype[f.inspect.custom]=function(){var e=f.inspect({length:this.length});return this.constructor.name+" "+e})},36278:(e,a,t)=>{"use strict";var c=t(33225);function f(e,a){e.emit("error",a)}e.exports={destroy:function(e,a){var t=this,d=this._readableState&&this._readableState.destroyed,r=this._writableState&&this._writableState.destroyed;return d||r?(a?a(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,c.nextTick(f,this,e)):c.nextTick(f,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!a&&e?t._writableState?t._writableState.errorEmitted||(t._writableState.errorEmitted=!0,c.nextTick(f,t,e)):c.nextTick(f,t,e):a&&a(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},5567:(e,a,t)=>{e.exports=t(37007).EventEmitter},24116:(e,a,t)=>{var c=t(48287),f=c.Buffer;function d(e,a){for(var t in e)a[t]=e[t]}function r(e,a,t){return f(e,a,t)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=c:(d(c,a),a.Buffer=r),d(f,r),r.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return f(e,a,t)},r.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var c=f(e);return void 0!==a?"string"==typeof t?c.fill(a,t):c.fill(a):c.fill(0),c},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return c.SlowBuffer(e)}},46737:(e,a,t)=>{(a=e.exports=t(30206)).Stream=a,a.Readable=a,a.Writable=t(7314),a.Duplex=t(26248),a.Transform=t(81816),a.PassThrough=t(75242)},6427:(e,a,t)=>{"use strict";var c=t(88393).Buffer,f=c.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function d(e){var a;switch(this.encoding=function(e){var a=function(e){if(!e)return"utf8";for(var a;;)switch(e){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 e;default:if(a)return;e=(""+e).toLowerCase(),a=!0}}(e);if("string"!=typeof a&&(c.isEncoding===f||!f(e)))throw new Error("Unknown encoding: "+e);return a||e}(e),this.encoding){case"utf16le":this.text=i,this.end=b,a=4;break;case"utf8":this.fillLast=n,a=4;break;case"base64":this.text=o,this.end=s,a=3;break;default:return this.write=l,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(a)}function r(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function n(e){var a=this.lastTotal-this.lastNeed,t=function(e,a){if(128!=(192&a[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&a.length>1){if(128!=(192&a[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&a.length>2&&128!=(192&a[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==t?t:this.lastNeed<=e.length?(e.copy(this.lastChar,a,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,a,0,e.length),void(this.lastNeed-=e.length))}function i(e,a){if((e.length-a)%2==0){var t=e.toString("utf16le",a);if(t){var c=t.charCodeAt(t.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",a,e.length-1)}function b(e){var a=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return a+this.lastChar.toString("utf16le",0,t)}return a}function o(e,a){var t=(e.length-a)%3;return 0===t?e.toString("base64",a):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",a,e.length-t))}function s(e){var a=e&&e.length?this.write(e):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function l(e){return e.toString(this.encoding)}function u(e){return e&&e.length?this.write(e):""}a.I=d,d.prototype.write=function(e){if(0===e.length)return"";var a,t;if(this.lastNeed){if(void 0===(a=this.fillLast(e)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t=0?(f>0&&(e.lastNeed=f-1),f):--c=0?(f>0&&(e.lastNeed=f-2),f):--c=0?(f>0&&(2===f?f=0:e.lastNeed=f-3),f):0}(this,e,a);if(!this.lastNeed)return e.toString("utf8",a);this.lastTotal=t;var c=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,c),e.toString("utf8",a,c)},d.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},88393:(e,a,t)=>{var c=t(48287),f=c.Buffer;function d(e,a){for(var t in e)a[t]=e[t]}function r(e,a,t){return f(e,a,t)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=c:(d(c,a),a.Buffer=r),d(f,r),r.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return f(e,a,t)},r.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var c=f(e);return void 0!==a?"string"==typeof t?c.fill(a,t):c.fill(a):c.fill(0),c},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return c.SlowBuffer(e)}},5974:(e,a,t)=>{"use strict";var c=t(48287).Buffer,f=t(94148),d=t(44442),r=t(58411),n=t(71447),i=t(19681);for(var b in i)a[b]=i[b];function o(e){if("number"!=typeof e||ea.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}a.NONE=0,a.DEFLATE=1,a.INFLATE=2,a.GZIP=3,a.GUNZIP=4,a.DEFLATERAW=5,a.INFLATERAW=6,a.UNZIP=7,o.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,f(this.init_done,"close before init"),f(this.mode<=a.UNZIP),this.mode===a.DEFLATE||this.mode===a.GZIP||this.mode===a.DEFLATERAW?r.deflateEnd(this.strm):this.mode!==a.INFLATE&&this.mode!==a.GUNZIP&&this.mode!==a.INFLATERAW&&this.mode!==a.UNZIP||n.inflateEnd(this.strm),this.mode=a.NONE,this.dictionary=null)},o.prototype.write=function(e,a,t,c,f,d,r){return this._write(!0,e,a,t,c,f,d,r)},o.prototype.writeSync=function(e,a,t,c,f,d,r){return this._write(!1,e,a,t,c,f,d,r)},o.prototype._write=function(e,t,d,r,n,i,b,o){if(f.equal(arguments.length,8),f(this.init_done,"write before init"),f(this.mode!==a.NONE,"already finalized"),f.equal(!1,this.write_in_progress,"write already in progress"),f.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,f.equal(!1,void 0===t,"must provide flush value"),this.write_in_progress=!0,t!==a.Z_NO_FLUSH&&t!==a.Z_PARTIAL_FLUSH&&t!==a.Z_SYNC_FLUSH&&t!==a.Z_FULL_FLUSH&&t!==a.Z_FINISH&&t!==a.Z_BLOCK)throw new Error("Invalid flush value");if(null==d&&(d=c.alloc(0),n=0,r=0),this.strm.avail_in=n,this.strm.input=d,this.strm.next_in=r,this.strm.avail_out=o,this.strm.output=i,this.strm.next_out=b,this.flush=t,!e)return this._process(),this._checkError()?this._afterSync():void 0;var s=this;return process.nextTick((function(){s._process(),s._after()})),this},o.prototype._afterSync=function(){var e=this.strm.avail_out,a=this.strm.avail_in;return this.write_in_progress=!1,[a,e]},o.prototype._process=function(){var e=null;switch(this.mode){case a.DEFLATE:case a.GZIP:case a.DEFLATERAW:this.err=r.deflate(this.strm,this.flush);break;case a.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=a.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=a.GUNZIP):this.mode=a.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case a.INFLATE:case a.GUNZIP:case a.INFLATERAW:for(this.err=n.inflate(this.strm,this.flush),this.err===a.Z_NEED_DICT&&this.dictionary&&(this.err=n.inflateSetDictionary(this.strm,this.dictionary),this.err===a.Z_OK?this.err=n.inflate(this.strm,this.flush):this.err===a.Z_DATA_ERROR&&(this.err=a.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===a.GUNZIP&&this.err===a.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=n.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},o.prototype._checkError=function(){switch(this.err){case a.Z_OK:case a.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===a.Z_FINISH)return this._error("unexpected end of file"),!1;break;case a.Z_STREAM_END:break;case a.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},o.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,a=this.strm.avail_in;this.write_in_progress=!1,this.callback(a,e),this.pending_close&&this.close()}},o.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},o.prototype.init=function(e,t,c,d,r){f(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),f(e>=8&&e<=15,"invalid windowBits"),f(t>=-1&&t<=9,"invalid compression level"),f(c>=1&&c<=9,"invalid memlevel"),f(d===a.Z_FILTERED||d===a.Z_HUFFMAN_ONLY||d===a.Z_RLE||d===a.Z_FIXED||d===a.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,c,d,r),this._setDictionary()},o.prototype.params=function(){throw new Error("deflateParams Not supported")},o.prototype.reset=function(){this._reset(),this._setDictionary()},o.prototype._init=function(e,t,c,f,i){switch(this.level=e,this.windowBits=t,this.memLevel=c,this.strategy=f,this.flush=a.Z_NO_FLUSH,this.err=a.Z_OK,this.mode!==a.GZIP&&this.mode!==a.GUNZIP||(this.windowBits+=16),this.mode===a.UNZIP&&(this.windowBits+=32),this.mode!==a.DEFLATERAW&&this.mode!==a.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new d,this.mode){case a.DEFLATE:case a.GZIP:case a.DEFLATERAW:this.err=r.deflateInit2(this.strm,this.level,a.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case a.INFLATE:case a.GUNZIP:case a.INFLATERAW:case a.UNZIP:this.err=n.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==a.Z_OK&&this._error("Init error"),this.dictionary=i,this.write_in_progress=!1,this.init_done=!0},o.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=a.Z_OK,this.mode){case a.DEFLATE:case a.DEFLATERAW:this.err=r.deflateSetDictionary(this.strm,this.dictionary)}this.err!==a.Z_OK&&this._error("Failed to set dictionary")}},o.prototype._reset=function(){switch(this.err=a.Z_OK,this.mode){case a.DEFLATE:case a.DEFLATERAW:case a.GZIP:this.err=r.deflateReset(this.strm);break;case a.INFLATE:case a.INFLATERAW:case a.GUNZIP:this.err=n.inflateReset(this.strm)}this.err!==a.Z_OK&&this._error("Failed to reset stream")},a.Zlib=o},78559:(e,a,t)=>{"use strict";var c=t(48287).Buffer,f=t(88310).Transform,d=t(5974),r=t(40537),n=t(94148).ok,i=t(48287).kMaxLength,b="Cannot create final Buffer. It would be larger than 0x"+i.toString(16)+" bytes";d.Z_MIN_WINDOWBITS=8,d.Z_MAX_WINDOWBITS=15,d.Z_DEFAULT_WINDOWBITS=15,d.Z_MIN_CHUNK=64,d.Z_MAX_CHUNK=1/0,d.Z_DEFAULT_CHUNK=16384,d.Z_MIN_MEMLEVEL=1,d.Z_MAX_MEMLEVEL=9,d.Z_DEFAULT_MEMLEVEL=8,d.Z_MIN_LEVEL=-1,d.Z_MAX_LEVEL=9,d.Z_DEFAULT_LEVEL=d.Z_DEFAULT_COMPRESSION;for(var o=Object.keys(d),s=0;s=i?r=new RangeError(b):a=c.concat(f,d),f=[],e.close(),t(r,a)}e.on("error",(function(a){e.removeListener("end",n),e.removeListener("readable",r),t(a)})),e.on("end",n),e.end(a),r()}function x(e,a){if("string"==typeof a&&(a=c.from(a)),!c.isBuffer(a))throw new TypeError("Not a string or buffer");var t=e._finishFlushFlag;return e._processChunk(a,t)}function y(e){if(!(this instanceof y))return new y(e);M.call(this,e,d.DEFLATE)}function A(e){if(!(this instanceof A))return new A(e);M.call(this,e,d.INFLATE)}function v(e){if(!(this instanceof v))return new v(e);M.call(this,e,d.GZIP)}function w(e){if(!(this instanceof w))return new w(e);M.call(this,e,d.GUNZIP)}function _(e){if(!(this instanceof _))return new _(e);M.call(this,e,d.DEFLATERAW)}function I(e){if(!(this instanceof I))return new I(e);M.call(this,e,d.INFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);M.call(this,e,d.UNZIP)}function C(e){return e===d.Z_NO_FLUSH||e===d.Z_PARTIAL_FLUSH||e===d.Z_SYNC_FLUSH||e===d.Z_FULL_FLUSH||e===d.Z_FINISH||e===d.Z_BLOCK}function M(e,t){var r=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||a.Z_DEFAULT_CHUNK,f.call(this,e),e.flush&&!C(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!C(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||d.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:d.Z_FINISH,e.chunkSize&&(e.chunkSizea.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsa.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levela.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevela.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=a.Z_FILTERED&&e.strategy!=a.Z_HUFFMAN_ONLY&&e.strategy!=a.Z_RLE&&e.strategy!=a.Z_FIXED&&e.strategy!=a.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!c.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new d.Zlib(t);var n=this;this._hadError=!1,this._handle.onerror=function(e,t){B(n),n._hadError=!0;var c=new Error(e);c.errno=t,c.code=a.codes[t],n.emit("error",c)};var i=a.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(i=e.level);var b=a.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(b=e.strategy),this._handle.init(e.windowBits||a.Z_DEFAULT_WINDOWBITS,i,e.memLevel||a.Z_DEFAULT_MEMLEVEL,b,e.dictionary),this._buffer=c.allocUnsafe(this._chunkSize),this._offset=0,this._level=i,this._strategy=b,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:!0,enumerable:!0})}function B(e,a){a&&process.nextTick(a),e._handle&&(e._handle.close(),e._handle=null)}function L(e){e.emit("close")}Object.defineProperty(a,"codes",{enumerable:!0,value:Object.freeze(u),writable:!1}),a.Deflate=y,a.Inflate=A,a.Gzip=v,a.Gunzip=w,a.DeflateRaw=_,a.InflateRaw=I,a.Unzip=E,a.createDeflate=function(e){return new y(e)},a.createInflate=function(e){return new A(e)},a.createDeflateRaw=function(e){return new _(e)},a.createInflateRaw=function(e){return new I(e)},a.createGzip=function(e){return new v(e)},a.createGunzip=function(e){return new w(e)},a.createUnzip=function(e){return new E(e)},a.deflate=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new y(a),e,t)},a.deflateSync=function(e,a){return x(new y(a),e)},a.gzip=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new v(a),e,t)},a.gzipSync=function(e,a){return x(new v(a),e)},a.deflateRaw=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new _(a),e,t)},a.deflateRawSync=function(e,a){return x(new _(a),e)},a.unzip=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new E(a),e,t)},a.unzipSync=function(e,a){return x(new E(a),e)},a.inflate=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new A(a),e,t)},a.inflateSync=function(e,a){return x(new A(a),e)},a.gunzip=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new w(a),e,t)},a.gunzipSync=function(e,a){return x(new w(a),e)},a.inflateRaw=function(e,a,t){return"function"==typeof a&&(t=a,a={}),m(new I(a),e,t)},a.inflateRawSync=function(e,a){return x(new I(a),e)},r.inherits(M,f),M.prototype.params=function(e,t,c){if(ea.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=a.Z_FILTERED&&t!=a.Z_HUFFMAN_ONLY&&t!=a.Z_RLE&&t!=a.Z_FIXED&&t!=a.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var f=this;this.flush(d.Z_SYNC_FLUSH,(function(){n(f._handle,"zlib binding closed"),f._handle.params(e,t),f._hadError||(f._level=e,f._strategy=t,c&&c())}))}else process.nextTick(c)},M.prototype.reset=function(){return n(this._handle,"zlib binding closed"),this._handle.reset()},M.prototype._flush=function(e){this._transform(c.alloc(0),"",e)},M.prototype.flush=function(e,a){var t=this,f=this._writableState;("function"==typeof e||void 0===e&&!a)&&(a=e,e=d.Z_FULL_FLUSH),f.ended?a&&process.nextTick(a):f.ending?a&&this.once("end",a):f.needDrain?a&&this.once("drain",(function(){return t.flush(e,a)})):(this._flushFlag=e,this.write(c.alloc(0),"",a))},M.prototype.close=function(e){B(this,e),process.nextTick(L,this)},M.prototype._transform=function(e,a,t){var f,r=this._writableState,n=(r.ending||r.ended)&&(!e||r.length===e.length);return null===e||c.isBuffer(e)?this._handle?(n?f=this._finishFlushFlag:(f=this._flushFlag,e.length>=r.length&&(this._flushFlag=this._opts.flush||d.Z_NO_FLUSH)),void this._processChunk(e,f,t)):t(new Error("zlib binding closed")):t(new Error("invalid input"))},M.prototype._processChunk=function(e,a,t){var f=e&&e.length,d=this._chunkSize-this._offset,r=0,o=this,s="function"==typeof t;if(!s){var l,u=[],h=0;this.on("error",(function(e){l=e})),n(this._handle,"zlib binding closed");do{var p=this._handle.writeSync(a,e,r,f,this._buffer,this._offset,d)}while(!this._hadError&&x(p[0],p[1]));if(this._hadError)throw l;if(h>=i)throw B(this),new RangeError(b);var g=c.concat(u,h);return B(this),g}n(this._handle,"zlib binding closed");var m=this._handle.write(a,e,r,f,this._buffer,this._offset,d);function x(i,b){if(this&&(this.buffer=null,this.callback=null),!o._hadError){var l=d-b;if(n(l>=0,"have should not go down"),l>0){var p=o._buffer.slice(o._offset,o._offset+l);o._offset+=l,s?o.push(p):(u.push(p),h+=p.length)}if((0===b||o._offset>=o._chunkSize)&&(d=o._chunkSize,o._offset=0,o._buffer=c.allocUnsafe(o._chunkSize)),0===b){if(r+=f-i,f=i,!s)return!0;var g=o._handle.write(a,e,r,f,o._buffer,o._offset,o._chunkSize);return g.callback=x,void(g.buffer=e)}if(!s)return!1;t()}}m.buffer=e,m.callback=x},r.inherits(y,M),r.inherits(A,M),r.inherits(v,M),r.inherits(w,M),r.inherits(_,M),r.inherits(I,M),r.inherits(E,M)},30295:(e,a,t)=>{var c=t(48287).Buffer;e.exports=function(e,a){for(var t=Math.min(e.length,a.length),f=new c(t),d=0;d{"use strict";const c=t(67526),f=t(251),d="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=i,a.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},a.INSPECT_MAX_BYTES=50;const r=2147483647;function n(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');const a=new Uint8Array(e);return Object.setPrototypeOf(a,i.prototype),a}function i(e,a,t){if("number"==typeof e){if("string"==typeof a)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}return b(e,a,t)}function b(e,a,t){if("string"==typeof e)return function(e,a){if("string"==typeof a&&""!==a||(a="utf8"),!i.isEncoding(a))throw new TypeError("Unknown encoding: "+a);const t=0|p(e,a);let c=n(t);const f=c.write(e,a);return f!==t&&(c=c.slice(0,f)),c}(e,a);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const a=new Uint8Array(e);return u(a.buffer,a.byteOffset,a.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return u(e,a,t);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return u(e,a,t);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return i.from(c,a,t);const f=function(e){if(i.isBuffer(e)){const a=0|h(e.length),t=n(a);return 0===t.length||e.copy(t,0,0,a),t}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?n(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),a,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e){return o(e),n(e<0?0:0|h(e))}function l(e){const a=e.length<0?0:0|h(e.length),t=n(a);for(let c=0;c=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function p(e,a){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const t=e.length,c=arguments.length>2&&!0===arguments[2];if(!c&&0===t)return 0;let f=!1;for(;;)switch(a){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return K(e).length;default:if(f)return c?-1:z(e).length;a=(""+a).toLowerCase(),f=!0}}function g(e,a,t){let c=!1;if((void 0===a||a<0)&&(a=0),a>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(a>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,a,t);case"utf8":case"utf-8":return C(this,a,t);case"ascii":return B(this,a,t);case"latin1":case"binary":return L(this,a,t);case"base64":return E(this,a,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,a,t);default:if(c)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),c=!0}}function m(e,a,t){const c=e[a];e[a]=e[t],e[t]=c}function x(e,a,t,c,f){if(0===e.length)return-1;if("string"==typeof t?(c=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),J(t=+t)&&(t=f?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(f)return-1;t=e.length-1}else if(t<0){if(!f)return-1;t=0}if("string"==typeof a&&(a=i.from(a,c)),i.isBuffer(a))return 0===a.length?-1:y(e,a,t,c,f);if("number"==typeof a)return a&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,a,t):Uint8Array.prototype.lastIndexOf.call(e,a,t):y(e,[a],t,c,f);throw new TypeError("val must be string, number or Buffer")}function y(e,a,t,c,f){let d,r=1,n=e.length,i=a.length;if(void 0!==c&&("ucs2"===(c=String(c).toLowerCase())||"ucs-2"===c||"utf16le"===c||"utf-16le"===c)){if(e.length<2||a.length<2)return-1;r=2,n/=2,i/=2,t/=2}function b(e,a){return 1===r?e[a]:e.readUInt16BE(a*r)}if(f){let c=-1;for(d=t;dn&&(t=n-i),d=t;d>=0;d--){let t=!0;for(let c=0;cf&&(c=f):c=f;const d=a.length;let r;for(c>d/2&&(c=d/2),r=0;r>8,f=t%256,d.push(f),d.push(c);return d}(a,e.length-t),e,t,c)}function E(e,a,t){return 0===a&&t===e.length?c.fromByteArray(e):c.fromByteArray(e.slice(a,t))}function C(e,a,t){t=Math.min(e.length,t);const c=[];let f=a;for(;f239?4:a>223?3:a>191?2:1;if(f+r<=t){let t,c,n,i;switch(r){case 1:a<128&&(d=a);break;case 2:t=e[f+1],128==(192&t)&&(i=(31&a)<<6|63&t,i>127&&(d=i));break;case 3:t=e[f+1],c=e[f+2],128==(192&t)&&128==(192&c)&&(i=(15&a)<<12|(63&t)<<6|63&c,i>2047&&(i<55296||i>57343)&&(d=i));break;case 4:t=e[f+1],c=e[f+2],n=e[f+3],128==(192&t)&&128==(192&c)&&128==(192&n)&&(i=(15&a)<<18|(63&t)<<12|(63&c)<<6|63&n,i>65535&&i<1114112&&(d=i))}}null===d?(d=65533,r=1):d>65535&&(d-=65536,c.push(d>>>10&1023|55296),d=56320|1023&d),c.push(d),f+=r}return function(e){const a=e.length;if(a<=M)return String.fromCharCode.apply(String,e);let t="",c=0;for(;cc.length?(i.isBuffer(a)||(a=i.from(a)),a.copy(c,f)):Uint8Array.prototype.set.call(c,a,f);else{if(!i.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(c,f)}f+=a.length}return c},i.byteLength=p,i.prototype._isBuffer=!0,i.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let a=0;at&&(e+=" ... "),""},d&&(i.prototype[d]=i.prototype.inspect),i.prototype.compare=function(e,a,t,c,f){if(Z(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===a&&(a=0),void 0===t&&(t=e?e.length:0),void 0===c&&(c=0),void 0===f&&(f=this.length),a<0||t>e.length||c<0||f>this.length)throw new RangeError("out of range index");if(c>=f&&a>=t)return 0;if(c>=f)return-1;if(a>=t)return 1;if(this===e)return 0;let d=(f>>>=0)-(c>>>=0),r=(t>>>=0)-(a>>>=0);const n=Math.min(d,r),b=this.slice(c,f),o=e.slice(a,t);for(let e=0;e>>=0,isFinite(t)?(t>>>=0,void 0===c&&(c="utf8")):(c=t,t=void 0)}const f=this.length-a;if((void 0===t||t>f)&&(t=f),e.length>0&&(t<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");let d=!1;for(;;)switch(c){case"hex":return A(this,e,a,t);case"utf8":case"utf-8":return v(this,e,a,t);case"ascii":case"latin1":case"binary":return w(this,e,a,t);case"base64":return _(this,e,a,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,a,t);default:if(d)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),d=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const M=4096;function B(e,a,t){let c="";t=Math.min(e.length,t);for(let f=a;fc)&&(t=c);let f="";for(let c=a;ct)throw new RangeError("Trying to access beyond buffer length")}function P(e,a,t,c,f,d){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>f||ae.length)throw new RangeError("Index out of range")}function R(e,a,t,c,f){H(a,c,f,e,t,7);let d=Number(a&BigInt(4294967295));e[t++]=d,d>>=8,e[t++]=d,d>>=8,e[t++]=d,d>>=8,e[t++]=d;let r=Number(a>>BigInt(32)&BigInt(4294967295));return e[t++]=r,r>>=8,e[t++]=r,r>>=8,e[t++]=r,r>>=8,e[t++]=r,t}function O(e,a,t,c,f){H(a,c,f,e,t,7);let d=Number(a&BigInt(4294967295));e[t+7]=d,d>>=8,e[t+6]=d,d>>=8,e[t+5]=d,d>>=8,e[t+4]=d;let r=Number(a>>BigInt(32)&BigInt(4294967295));return e[t+3]=r,r>>=8,e[t+2]=r,r>>=8,e[t+1]=r,r>>=8,e[t]=r,t+8}function T(e,a,t,c,f,d){if(t+c>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function D(e,a,t,c,d){return a=+a,t>>>=0,d||T(e,0,t,4),f.write(e,a,t,c,23,4),t+4}function F(e,a,t,c,d){return a=+a,t>>>=0,d||T(e,0,t,8),f.write(e,a,t,c,52,8),t+8}i.prototype.slice=function(e,a){const t=this.length;(e=~~e)<0?(e+=t)<0&&(e=0):e>t&&(e=t),(a=void 0===a?t:~~a)<0?(a+=t)<0&&(a=0):a>t&&(a=t),a>>=0,a>>>=0,t||N(e,a,this.length);let c=this[e],f=1,d=0;for(;++d>>=0,a>>>=0,t||N(e,a,this.length);let c=this[e+--a],f=1;for(;a>0&&(f*=256);)c+=this[e+--a]*f;return c},i.prototype.readUint8=i.prototype.readUInt8=function(e,a){return e>>>=0,a||N(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,a){return e>>>=0,a||N(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,a){return e>>>=0,a||N(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,a){return e>>>=0,a||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,a){return e>>>=0,a||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readBigUInt64LE=Y((function(e){$(e>>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||q(e,this.length-8);const c=a+256*this[++e]+65536*this[++e]+this[++e]*2**24,f=this[++e]+256*this[++e]+65536*this[++e]+t*2**24;return BigInt(c)+(BigInt(f)<>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||q(e,this.length-8);const c=a*2**24+65536*this[++e]+256*this[++e]+this[++e],f=this[++e]*2**24+65536*this[++e]+256*this[++e]+t;return(BigInt(c)<>>=0,a>>>=0,t||N(e,a,this.length);let c=this[e],f=1,d=0;for(;++d=f&&(c-=Math.pow(2,8*a)),c},i.prototype.readIntBE=function(e,a,t){e>>>=0,a>>>=0,t||N(e,a,this.length);let c=a,f=1,d=this[e+--c];for(;c>0&&(f*=256);)d+=this[e+--c]*f;return f*=128,d>=f&&(d-=Math.pow(2,8*a)),d},i.prototype.readInt8=function(e,a){return e>>>=0,a||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,a){e>>>=0,a||N(e,2,this.length);const t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt16BE=function(e,a){e>>>=0,a||N(e,2,this.length);const t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},i.prototype.readInt32LE=function(e,a){return e>>>=0,a||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,a){return e>>>=0,a||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readBigInt64LE=Y((function(e){$(e>>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||q(e,this.length-8);const c=this[e+4]+256*this[e+5]+65536*this[e+6]+(t<<24);return(BigInt(c)<>>=0,"offset");const a=this[e],t=this[e+7];void 0!==a&&void 0!==t||q(e,this.length-8);const c=(a<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(c)<>>=0,a||N(e,4,this.length),f.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,a){return e>>>=0,a||N(e,4,this.length),f.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,a){return e>>>=0,a||N(e,8,this.length),f.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,a){return e>>>=0,a||N(e,8,this.length),f.read(this,e,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,a,t,c){e=+e,a>>>=0,t>>>=0,c||P(this,e,a,t,Math.pow(2,8*t)-1,0);let f=1,d=0;for(this[a]=255&e;++d>>=0,t>>>=0,c||P(this,e,a,t,Math.pow(2,8*t)-1,0);let f=t-1,d=1;for(this[a+f]=255&e;--f>=0&&(d*=256);)this[a+f]=e/d&255;return a+t},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,1,255,0),this[a]=255&e,a+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,2,65535,0),this[a]=255&e,this[a+1]=e>>>8,a+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,2,65535,0),this[a]=e>>>8,this[a+1]=255&e,a+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,4,4294967295,0),this[a+3]=e>>>24,this[a+2]=e>>>16,this[a+1]=e>>>8,this[a]=255&e,a+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,4,4294967295,0),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},i.prototype.writeBigUInt64LE=Y((function(e,a=0){return R(this,e,a,BigInt(0),BigInt("0xffffffffffffffff"))})),i.prototype.writeBigUInt64BE=Y((function(e,a=0){return O(this,e,a,BigInt(0),BigInt("0xffffffffffffffff"))})),i.prototype.writeIntLE=function(e,a,t,c){if(e=+e,a>>>=0,!c){const c=Math.pow(2,8*t-1);P(this,e,a,t,c-1,-c)}let f=0,d=1,r=0;for(this[a]=255&e;++f>>=0,!c){const c=Math.pow(2,8*t-1);P(this,e,a,t,c-1,-c)}let f=t-1,d=1,r=0;for(this[a+f]=255&e;--f>=0&&(d*=256);)e<0&&0===r&&0!==this[a+f+1]&&(r=1),this[a+f]=(e/d|0)-r&255;return a+t},i.prototype.writeInt8=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,1,127,-128),e<0&&(e=255+e+1),this[a]=255&e,a+1},i.prototype.writeInt16LE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,2,32767,-32768),this[a]=255&e,this[a+1]=e>>>8,a+2},i.prototype.writeInt16BE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,2,32767,-32768),this[a]=e>>>8,this[a+1]=255&e,a+2},i.prototype.writeInt32LE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,4,2147483647,-2147483648),this[a]=255&e,this[a+1]=e>>>8,this[a+2]=e>>>16,this[a+3]=e>>>24,a+4},i.prototype.writeInt32BE=function(e,a,t){return e=+e,a>>>=0,t||P(this,e,a,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},i.prototype.writeBigInt64LE=Y((function(e,a=0){return R(this,e,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),i.prototype.writeBigInt64BE=Y((function(e,a=0){return O(this,e,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),i.prototype.writeFloatLE=function(e,a,t){return D(this,e,a,!0,t)},i.prototype.writeFloatBE=function(e,a,t){return D(this,e,a,!1,t)},i.prototype.writeDoubleLE=function(e,a,t){return F(this,e,a,!0,t)},i.prototype.writeDoubleBE=function(e,a,t){return F(this,e,a,!1,t)},i.prototype.copy=function(e,a,t,c){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(t||(t=0),c||0===c||(c=this.length),a>=e.length&&(a=e.length),a||(a=0),c>0&&c=this.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),e.length-a>>=0,t=void 0===t?this.length:t>>>0,e||(e=0),"number"==typeof e)for(f=a;f=c+4;t-=3)a=`_${e.slice(t-3,t)}${a}`;return`${e.slice(0,t)}${a}`}function H(e,a,t,c,f,d){if(e>t||e3?0===a||a===BigInt(0)?`>= 0${c} and < 2${c} ** ${8*(d+1)}${c}`:`>= -(2${c} ** ${8*(d+1)-1}${c}) and < 2 ** ${8*(d+1)-1}${c}`:`>= ${a}${c} and <= ${t}${c}`,new Q.ERR_OUT_OF_RANGE("value",f,e)}!function(e,a,t){$(a,"offset"),void 0!==e[a]&&void 0!==e[a+t]||q(a,e.length-(t+1))}(c,f,d)}function $(e,a){if("number"!=typeof e)throw new Q.ERR_INVALID_ARG_TYPE(a,"number",e)}function q(e,a,t){if(Math.floor(e)!==e)throw $(e,t),new Q.ERR_OUT_OF_RANGE(t||"offset","an integer",e);if(a<0)throw new Q.ERR_BUFFER_OUT_OF_BOUNDS;throw new Q.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${a}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,a){return`The "${e}" argument must be of type number. Received type ${typeof a}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(e,a,t){let c=`The value of "${e}" is out of range.`,f=t;return Number.isInteger(t)&&Math.abs(t)>2**32?f=j(String(t)):"bigint"==typeof t&&(f=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(f=j(f)),f+="n"),c+=` It must be ${a}. Received ${f}`,c}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function z(e,a){let t;a=a||1/0;const c=e.length;let f=null;const d=[];for(let r=0;r55295&&t<57344){if(!f){if(t>56319){(a-=3)>-1&&d.push(239,191,189);continue}if(r+1===c){(a-=3)>-1&&d.push(239,191,189);continue}f=t;continue}if(t<56320){(a-=3)>-1&&d.push(239,191,189),f=t;continue}t=65536+(f-55296<<10|t-56320)}else f&&(a-=3)>-1&&d.push(239,191,189);if(f=null,t<128){if((a-=1)<0)break;d.push(t)}else if(t<2048){if((a-=2)<0)break;d.push(t>>6|192,63&t|128)}else if(t<65536){if((a-=3)<0)break;d.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((a-=4)<0)break;d.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return d}function K(e){return c.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,a,t,c){let f;for(f=0;f=a.length||f>=e.length);++f)a[f+t]=e[f];return f}function Z(e,a){return e instanceof a||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===a.name}function J(e){return e!=e}const W=function(){const e="0123456789abcdef",a=new Array(256);for(let t=0;t<16;++t){const c=16*t;for(let f=0;f<16;++f)a[c+f]=e[t]+e[f]}return a}();function Y(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},86866:e=>{e.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"}},38075:(e,a,t)=>{"use strict";var c=t(70453),f=t(10487),d=f(c("String.prototype.indexOf"));e.exports=function(e,a){var t=c(e,!!a);return"function"==typeof t&&d(e,".prototype.")>-1?f(t):t}},10487:(e,a,t)=>{"use strict";var c=t(66743),f=t(70453),d=t(96897),r=t(69675),n=f("%Function.prototype.apply%"),i=f("%Function.prototype.call%"),b=f("%Reflect.apply%",!0)||c.call(i,n),o=t(30655),s=f("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new r("a function is required");var a=b(c,i,arguments);return d(a,1+s(0,e.length-(arguments.length-1)),!0)};var l=function(){return b(c,n,arguments)};o?o(e.exports,"apply",{value:l}):e.exports.apply=l},56168:(e,a,t)=>{var c=t(92861).Buffer,f=t(88310).Transform,d=t(83141).I;function r(e){f.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t(56698)(r,f),r.prototype.update=function(e,a,t){"string"==typeof e&&(e=c.from(e,a));var f=this._update(e);return this.hashMode?this:(t&&(f=this._toString(f,t)),f)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(e,a,t){var c;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){c=e}finally{t(c)}},r.prototype._flush=function(e){var a;try{this.push(this.__final())}catch(e){a=e}e(a)},r.prototype._finalOrDigest=function(e){var a=this.__final()||c.alloc(0);return e&&(a=this._toString(a,e,!0)),a},r.prototype._toString=function(e,a,t){if(this._decoder||(this._decoder=new d(a),this._encoding=a),this._encoding!==a)throw new Error("can't switch encodings");var c=this._decoder.write(e);return t&&(c+=this._decoder.end()),c},e.exports=r},15622:(e,a,t)=>{function c(e){return Object.prototype.toString.call(e)}a.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===c(e)},a.isBoolean=function(e){return"boolean"==typeof e},a.isNull=function(e){return null===e},a.isNullOrUndefined=function(e){return null==e},a.isNumber=function(e){return"number"==typeof e},a.isString=function(e){return"string"==typeof e},a.isSymbol=function(e){return"symbol"==typeof e},a.isUndefined=function(e){return void 0===e},a.isRegExp=function(e){return"[object RegExp]"===c(e)},a.isObject=function(e){return"object"==typeof e&&null!==e},a.isDate=function(e){return"[object Date]"===c(e)},a.isError=function(e){return"[object Error]"===c(e)||e instanceof Error},a.isFunction=function(e){return"function"==typeof e},a.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},a.isBuffer=t(48287).Buffer.isBuffer},61324:(e,a,t)=>{var c=t(48287).Buffer,f=t(86729),d=t(92801);e.exports=function(e){return new n(e)};var r={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 n(e){this.curveType=r[e],this.curveType||(this.curveType={name:e}),this.curve=new f.ec(this.curveType.name),this.keys=void 0}function i(e,a,t){Array.isArray(e)||(e=e.toArray());var f=new c(e);if(t&&f.length=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,T=R>>>13,D=0|r[9],F=8191&D,Q=D>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(T,j)|0,d=Math.imul(T,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(T,q)|0,d=d+Math.imul(T,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(T,K)|0,d=d+Math.imul(T,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(T,J)|0,d=d+Math.imul(T,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(T,X)|0,d=d+Math.imul(T,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(T,te)|0,d=d+Math.imul(T,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(T,de)|0,d=d+Math.imul(T,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(T,ie)|0,d=d+Math.imul(T,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(T,se)|0,d=d+Math.imul(T,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(T,he)|0))<<13)|0;b=((d=d+Math.imul(T,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},47108:(e,a,t)=>{"use strict";var c=t(56698),f=t(88276),d=t(66011),r=t(62802),n=t(56168);function i(e){n.call(this,"digest"),this._hash=e}c(i,n),i.prototype._update=function(e){this._hash.update(e)},i.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new f:"rmd160"===e||"ripemd160"===e?new d:new i(r(e))}},20320:(e,a,t)=>{var c=t(88276);e.exports=function(e){return(new c).update(e).digest()}},83507:(e,a,t)=>{"use strict";var c=t(56698),f=t(41800),d=t(56168),r=t(92861).Buffer,n=t(20320),i=t(66011),b=t(62802),o=r.alloc(128);function s(e,a){d.call(this,"digest"),"string"==typeof a&&(a=r.from(a));var t="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=a,a.length>t?a=("rmd160"===e?new i:b(e)).update(a).digest():a.length{"use strict";var c=t(56698),f=t(92861).Buffer,d=t(56168),r=f.alloc(128),n=64;function i(e,a){d.call(this,"digest"),"string"==typeof a&&(a=f.from(a)),this._alg=e,this._key=a,a.length>n?a=e(a):a.length{var c="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==t.g&&t.g,f=function(){function e(){this.fetch=!1,this.DOMException=c.DOMException}return e.prototype=c,new e}();!function(e){!function(a){var t=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==t&&t,c="URLSearchParams"in t,f="Symbol"in t&&"iterator"in Symbol,d="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),r="FormData"in t,n="ArrayBuffer"in t;if(n)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],b=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function s(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var a={next:function(){var a=e.shift();return{done:void 0===a,value:a}}};return f&&(a[Symbol.iterator]=function(){return a}),a}function u(e){this.map={},e instanceof u?e.forEach((function(e,a){this.append(a,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(a){this.append(a,e[a])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(a,t){e.onload=function(){a(e.result)},e.onerror=function(){t(e.error)}}))}function g(e){var a=new FileReader,t=p(a);return a.readAsArrayBuffer(e),t}function m(e){if(e.slice)return e.slice(0);var a=new Uint8Array(e.byteLength);return a.set(new Uint8Array(e)),a.buffer}function x(){return this.bodyUsed=!1,this._initBody=function(e){var a;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:d&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:c&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():n&&d&&(a=e)&&DataView.prototype.isPrototypeOf(a)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n&&(ArrayBuffer.prototype.isPrototypeOf(e)||b(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},d&&(this.blob=function(){var e=h(this);if(e)return e;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?h(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(g)}),this.text=function(){var e,a,t,c=h(this);if(c)return c;if(this._bodyBlob)return e=this._bodyBlob,t=p(a=new FileReader),a.readAsText(e),t;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var a=new Uint8Array(e),t=new Array(a.length),c=0;c-1?c:t),this.mode=a.mode||this.mode||null,this.signal=a.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&f)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(f),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==a.cache&&"no-cache"!==a.cache)){var d=/([?&])_=[^&]*/;d.test(this.url)?this.url=this.url.replace(d,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function v(e){var a=new FormData;return e.trim().split("&").forEach((function(e){if(e){var t=e.split("="),c=t.shift().replace(/\+/g," "),f=t.join("=").replace(/\+/g," ");a.append(decodeURIComponent(c),decodeURIComponent(f))}})),a}function w(e,a){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');a||(a={}),this.type="default",this.status=void 0===a.status?200:a.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===a.statusText?"":""+a.statusText,this.headers=new u(a.headers),this.url=a.url||"",this._initBody(e)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},x.call(A.prototype),x.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];w.redirect=function(e,a){if(-1===_.indexOf(a))throw new RangeError("Invalid status code");return new w(null,{status:a,headers:{location:e}})},a.DOMException=t.DOMException;try{new a.DOMException}catch(e){a.DOMException=function(e,a){this.message=e,this.name=a;var t=Error(e);this.stack=t.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function I(e,c){return new Promise((function(f,r){var i=new A(e,c);if(i.signal&&i.signal.aborted)return r(new a.DOMException("Aborted","AbortError"));var b=new XMLHttpRequest;function o(){b.abort()}b.onload=function(){var e,a,t={status:b.status,statusText:b.statusText,headers:(e=b.getAllResponseHeaders()||"",a=new u,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var t=e.split(":"),c=t.shift().trim();if(c){var f=t.join(":").trim();a.append(c,f)}})),a)};t.url="responseURL"in b?b.responseURL:t.headers.get("X-Request-URL");var c="response"in b?b.response:b.responseText;setTimeout((function(){f(new w(c,t))}),0)},b.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},b.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},b.onabort=function(){setTimeout((function(){r(new a.DOMException("Aborted","AbortError"))}),0)},b.open(i.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(a){return e}}(i.url),!0),"include"===i.credentials?b.withCredentials=!0:"omit"===i.credentials&&(b.withCredentials=!1),"responseType"in b&&(d?b.responseType="blob":n&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(b.responseType="arraybuffer")),!c||"object"!=typeof c.headers||c.headers instanceof u?i.headers.forEach((function(e,a){b.setRequestHeader(a,e)})):Object.getOwnPropertyNames(c.headers).forEach((function(e){b.setRequestHeader(e,s(c.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",o),b.onreadystatechange=function(){4===b.readyState&&i.signal.removeEventListener("abort",o)}),b.send(void 0===i._bodyInit?null:i._bodyInit)}))}I.polyfill=!0,t.fetch||(t.fetch=I,t.Headers=u,t.Request=A,t.Response=w),a.Headers=u,a.Request=A,a.Response=w,a.fetch=I}({})}(f),f.fetch.ponyfill=!0,delete f.fetch.polyfill;var d=c.fetch?c:f;(a=d.fetch).default=d.fetch,a.fetch=d.fetch,a.Headers=d.Headers,a.Request=d.Request,a.Response=d.Response,e.exports=a},91565:(e,a,t)=>{"use strict";a.randomBytes=a.rng=a.pseudoRandomBytes=a.prng=t(53209),a.createHash=a.Hash=t(47108),a.createHmac=a.Hmac=t(83507);var c=t(55715),f=Object.keys(c),d=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(f);a.getHashes=function(){return d};var r=t(78396);a.pbkdf2=r.pbkdf2,a.pbkdf2Sync=r.pbkdf2Sync;var n=t(30125);a.Cipher=n.Cipher,a.createCipher=n.createCipher,a.Cipheriv=n.Cipheriv,a.createCipheriv=n.createCipheriv,a.Decipher=n.Decipher,a.createDecipher=n.createDecipher,a.Decipheriv=n.Decipheriv,a.createDecipheriv=n.createDecipheriv,a.getCiphers=n.getCiphers,a.listCiphers=n.listCiphers;var i=t(15380);a.DiffieHellmanGroup=i.DiffieHellmanGroup,a.createDiffieHellmanGroup=i.createDiffieHellmanGroup,a.getDiffieHellman=i.getDiffieHellman,a.createDiffieHellman=i.createDiffieHellman,a.DiffieHellman=i.DiffieHellman;var b=t(20);a.createSign=b.createSign,a.Sign=b.Sign,a.createVerify=b.createVerify,a.Verify=b.Verify,a.createECDH=t(61324);var o=t(97168);a.publicEncrypt=o.publicEncrypt,a.privateEncrypt=o.privateEncrypt,a.publicDecrypt=o.publicDecrypt,a.privateDecrypt=o.privateDecrypt;var s=t(76983);a.randomFill=s.randomFill,a.randomFillSync=s.randomFillSync,a.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},a.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}},17833:(e,a,t)=>{a.formatArgs=function(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;a.splice(1,0,t,"color: inherit");let c=0,f=0;a[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(c++,"%c"===e&&(f=c))})),a.splice(f,0,t)},a.save=function(e){try{e?a.storage.setItem("debug",e):a.storage.removeItem("debug")}catch(e){}},a.load=function(){let e;try{e=a.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},a.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},a.storage=function(){try{return localStorage}catch(e){}}(),a.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),a.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"],a.log=console.debug||console.log||(()=>{}),e.exports=t(40736)(a);const{formatters:c}=e.exports;c.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},40736:(e,a,t)=>{e.exports=function(e){function a(e){let t,f,d,r=null;function n(...e){if(!n.enabled)return;const c=n,f=Number(new Date),d=f-(t||f);c.diff=d,c.prev=t,c.curr=f,t=f,e[0]=a.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,f)=>{if("%%"===t)return"%";r++;const d=a.formatters[f];if("function"==typeof d){const a=e[r];t=d.call(c,a),e.splice(r,1),r--}return t})),a.formatArgs.call(c,e),(c.log||a.log).apply(c,e)}return n.namespace=e,n.useColors=a.useColors(),n.color=a.selectColor(e),n.extend=c,n.destroy=a.destroy,Object.defineProperty(n,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(f!==a.namespaces&&(f=a.namespaces,d=a.enabled(e)),d),set:e=>{r=e}}),"function"==typeof a.init&&a.init(n),n}function c(e,t){const c=a(this.namespace+(void 0===t?":":t)+e);return c.log=this.log,c}function f(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return a.debug=a,a.default=a,a.coerce=function(e){return e instanceof Error?e.stack||e.message:e},a.disable=function(){const e=[...a.names.map(f),...a.skips.map(f).map((e=>"-"+e))].join(",");return a.enable(""),e},a.enable=function(e){let t;a.save(e),a.namespaces=e,a.names=[],a.skips=[];const c=("string"==typeof e?e:"").split(/[\s,]+/),f=c.length;for(t=0;t{a[t]=e[t]})),a.names=[],a.skips=[],a.formatters={},a.selectColor=function(e){let t=0;for(let a=0;a{"use strict";var c=t(30655),f=t(58068),d=t(69675),r=t(75795);e.exports=function(e,a,t){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new d("`obj` must be an object or a function`");if("string"!=typeof a&&"symbol"!=typeof a)throw new d("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new d("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new d("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new d("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new d("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,b=arguments.length>5?arguments[5]:null,o=arguments.length>6&&arguments[6],s=!!r&&r(e,a);if(c)c(e,a,{configurable:null===b&&s?s.configurable:!b,enumerable:null===n&&s?s.enumerable:!n,value:t,writable:null===i&&s?s.writable:!i});else{if(!o&&(n||i||b))throw new f("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[a]=t}}},38452:(e,a,t)=>{"use strict";var c=t(1189),f="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),d=Object.prototype.toString,r=Array.prototype.concat,n=t(30041),i=t(30592)(),b=function(e,a,t,c){if(a in e)if(!0===c){if(e[a]===t)return}else if("function"!=typeof(f=c)||"[object Function]"!==d.call(f)||!c())return;var f;i?n(e,a,t,!0):n(e,a,t)},o=function(e,a){var t=arguments.length>2?arguments[2]:{},d=c(a);f&&(d=r.call(d,Object.getOwnPropertySymbols(a)));for(var n=0;n{"use strict";a.utils=t(87626),a.Cipher=t(82808),a.DES=t(82211),a.CBC=t(3389),a.EDE=t(65279)},3389:(e,a,t)=>{"use strict";var c=t(43349),f=t(56698),d={};function r(e){c.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var a=0;a{"use strict";var c=t(43349);function f(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}e.exports=f,f.prototype._init=function(){},f.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},f.prototype._buffer=function(e,a){for(var t=Math.min(this.buffer.length-this.bufferOff,e.length-a),c=0;c0;c--)a+=this._buffer(e,a),t+=this._flushBuffer(f,t);return a+=this._buffer(e,a),f},f.prototype.final=function(e){var a,t;return e&&(a=this.update(e)),t="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),a?a.concat(t):t},f.prototype._pad=function(e,a){if(0===a)return!1;for(;a{"use strict";var c=t(43349),f=t(56698),d=t(87626),r=t(82808);function n(){this.tmp=new Array(2),this.keys=null}function i(e){r.call(this,e);var a=new n;this._desState=a,this.deriveKeys(a,e.key)}f(i,r),e.exports=i,i.create=function(e){return new i(e)};var b=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];i.prototype.deriveKeys=function(e,a){e.keys=new Array(32),c.equal(a.length,this.blockSize,"Invalid key length");var t=d.readUInt32BE(a,0),f=d.readUInt32BE(a,4);d.pc1(t,f,e.tmp,0),t=e.tmp[0],f=e.tmp[1];for(var r=0;r>>1];t=d.r28shl(t,n),f=d.r28shl(f,n),d.pc2(t,f,e.keys,r)}},i.prototype._update=function(e,a,t,c){var f=this._desState,r=d.readUInt32BE(e,a),n=d.readUInt32BE(e,a+4);d.ip(r,n,f.tmp,0),r=f.tmp[0],n=f.tmp[1],"encrypt"===this.type?this._encrypt(f,r,n,f.tmp,0):this._decrypt(f,r,n,f.tmp,0),r=f.tmp[0],n=f.tmp[1],d.writeUInt32BE(t,r,c),d.writeUInt32BE(t,n,c+4)},i.prototype._pad=function(e,a){if(!1===this.padding)return!1;for(var t=e.length-a,c=a;c>>0,r=l}d.rip(n,r,c,f)},i.prototype._decrypt=function(e,a,t,c,f){for(var r=t,n=a,i=e.keys.length-2;i>=0;i-=2){var b=e.keys[i],o=e.keys[i+1];d.expand(r,e.tmp,0),b^=e.tmp[0],o^=e.tmp[1];var s=d.substitute(b,o),l=r;r=(n^d.permute(s))>>>0,n=l}d.rip(r,n,c,f)}},65279:(e,a,t)=>{"use strict";var c=t(43349),f=t(56698),d=t(82808),r=t(82211);function n(e,a){c.equal(a.length,24,"Invalid key length");var t=a.slice(0,8),f=a.slice(8,16),d=a.slice(16,24);this.ciphers="encrypt"===e?[r.create({type:"encrypt",key:t}),r.create({type:"decrypt",key:f}),r.create({type:"encrypt",key:d})]:[r.create({type:"decrypt",key:d}),r.create({type:"encrypt",key:f}),r.create({type:"decrypt",key:t})]}function i(e){d.call(this,e);var a=new n(this.type,this.options.key);this._edeState=a}f(i,d),e.exports=i,i.create=function(e){return new i(e)},i.prototype._update=function(e,a,t,c){var f=this._edeState;f.ciphers[0]._update(e,a,t,c),f.ciphers[1]._update(t,c,t,c),f.ciphers[2]._update(t,c,t,c)},i.prototype._pad=r.prototype._pad,i.prototype._unpad=r.prototype._unpad},87626:(e,a)=>{"use strict";a.readUInt32BE=function(e,a){return(e[0+a]<<24|e[1+a]<<16|e[2+a]<<8|e[3+a])>>>0},a.writeUInt32BE=function(e,a,t){e[0+t]=a>>>24,e[1+t]=a>>>16&255,e[2+t]=a>>>8&255,e[3+t]=255&a},a.ip=function(e,a,t,c){for(var f=0,d=0,r=6;r>=0;r-=2){for(var n=0;n<=24;n+=8)f<<=1,f|=a>>>n+r&1;for(n=0;n<=24;n+=8)f<<=1,f|=e>>>n+r&1}for(r=6;r>=0;r-=2){for(n=1;n<=25;n+=8)d<<=1,d|=a>>>n+r&1;for(n=1;n<=25;n+=8)d<<=1,d|=e>>>n+r&1}t[c+0]=f>>>0,t[c+1]=d>>>0},a.rip=function(e,a,t,c){for(var f=0,d=0,r=0;r<4;r++)for(var n=24;n>=0;n-=8)f<<=1,f|=a>>>n+r&1,f<<=1,f|=e>>>n+r&1;for(r=4;r<8;r++)for(n=24;n>=0;n-=8)d<<=1,d|=a>>>n+r&1,d<<=1,d|=e>>>n+r&1;t[c+0]=f>>>0,t[c+1]=d>>>0},a.pc1=function(e,a,t,c){for(var f=0,d=0,r=7;r>=5;r--){for(var n=0;n<=24;n+=8)f<<=1,f|=a>>n+r&1;for(n=0;n<=24;n+=8)f<<=1,f|=e>>n+r&1}for(n=0;n<=24;n+=8)f<<=1,f|=a>>n+r&1;for(r=1;r<=3;r++){for(n=0;n<=24;n+=8)d<<=1,d|=a>>n+r&1;for(n=0;n<=24;n+=8)d<<=1,d|=e>>n+r&1}for(n=0;n<=24;n+=8)d<<=1,d|=e>>n+r&1;t[c+0]=f>>>0,t[c+1]=d>>>0},a.r28shl=function(e,a){return e<>>28-a};var t=[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];a.pc2=function(e,a,c,f){for(var d=0,r=0,n=t.length>>>1,i=0;i>>t[i]&1;for(i=n;i>>t[i]&1;c[f+0]=d>>>0,c[f+1]=r>>>0},a.expand=function(e,a,t){var c=0,f=0;c=(1&e)<<5|e>>>27;for(var d=23;d>=15;d-=4)c<<=6,c|=e>>>d&63;for(d=11;d>=3;d-=4)f|=e>>>d&63,f<<=6;f|=(31&e)<<1|e>>>31,a[t+0]=c>>>0,a[t+1]=f>>>0};var c=[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];a.substitute=function(e,a){for(var t=0,f=0;f<4;f++)t<<=4,t|=c[64*f+(e>>>18-6*f&63)];for(f=0;f<4;f++)t<<=4,t|=c[256+64*f+(a>>>18-6*f&63)];return t>>>0};var f=[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];a.permute=function(e){for(var a=0,t=0;t>>f[t]&1;return a>>>0},a.padSplit=function(e,a,t){for(var c=e.toString(2);c.length{var c=t(48287).Buffer,f=t(4934),d=t(23241),r=t(14910),n={binary:!0,hex:!0,base64:!0};a.DiffieHellmanGroup=a.createDiffieHellmanGroup=a.getDiffieHellman=function(e){var a=new c(d[e].prime,"hex"),t=new c(d[e].gen,"hex");return new r(a,t)},a.createDiffieHellman=a.DiffieHellman=function e(a,t,d,i){return c.isBuffer(t)||void 0===n[t]?e(a,"binary",t,d):(t=t||"binary",i=i||"binary",d=d||new c([2]),c.isBuffer(d)||(d=new c(d,i)),"number"==typeof a?new r(f(a,d),d,!0):(c.isBuffer(a)||(a=new c(a,t)),new r(a,d,!0)))}},14910:(e,a,t)=>{var c=t(48287).Buffer,f=t(66473),d=new(t(52244)),r=new f(24),n=new f(11),i=new f(10),b=new f(3),o=new f(7),s=t(4934),l=t(53209);function u(e,a){return a=a||"utf8",c.isBuffer(e)||(e=new c(e,a)),this._pub=new f(e),this}function h(e,a){return a=a||"utf8",c.isBuffer(e)||(e=new c(e,a)),this._priv=new f(e),this}e.exports=g;var p={};function g(e,a,t){this.setGenerator(a),this.__prime=new f(e),this._prime=f.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,t?(this.setPublicKey=u,this.setPrivateKey=h):this._primeCode=8}function m(e,a){var t=new c(e.toArray());return a?t.toString(a):t}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,a){var t=a.toString("hex"),c=[t,e.toString(16)].join("_");if(c in p)return p[c];var f,l=0;if(e.isEven()||!s.simpleSieve||!s.fermatTest(e)||!d.test(e))return l+=1,l+="02"===t||"05"===t?8:4,p[c]=l,l;switch(d.test(e.shrn(1))||(l+=2),t){case"02":e.mod(r).cmp(n)&&(l+=8);break;case"05":(f=e.mod(i)).cmp(b)&&f.cmp(o)&&(l+=8);break;default:l+=4}return p[c]=l,l}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new f(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(e){var a=(e=(e=new f(e)).toRed(this._prime)).redPow(this._priv).fromRed(),t=new c(a.toArray()),d=this.getPrime();if(t.length{var c=t(53209);e.exports=x,x.simpleSieve=g,x.fermatTest=m;var f=t(66473),d=new f(24),r=new(t(52244)),n=new f(1),i=new f(2),b=new f(5),o=(new f(16),new f(8),new f(10)),s=new f(3),l=(new f(7),new f(11)),u=new f(4),h=(new f(12),null);function p(){if(null!==h)return h;var e=[];e[0]=2;for(var a=1,t=3;t<1048576;t+=2){for(var c=Math.ceil(Math.sqrt(t)),f=0;fe;)t.ishrn(1);if(t.isEven()&&t.iadd(n),t.testn(1)||t.iadd(i),a.cmp(i)){if(!a.cmp(b))for(;t.mod(o).cmp(s);)t.iadd(u)}else for(;t.mod(d).cmp(l);)t.iadd(u);if(g(h=t.shrn(1))&&g(t)&&m(h)&&m(t)&&r.test(h)&&r.test(t))return t}}},66473:function(e,a,t){!function(e,a){"use strict";function c(e,a){if(!e)throw new Error(a||"Assertion failed")}function f(e,a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}function d(e,a,t){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(t=a,a=10),this._init(e||0,a||10,t||"be"))}var r;"object"==typeof e?e.exports=d:a.BN=d,d.BN=d,d.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(66089).Buffer}catch(e){}function n(e,a){var t=e.charCodeAt(a);return t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,T=R>>>13,D=0|r[9],F=8191&D,Q=D>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(T,j)|0,d=Math.imul(T,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(T,q)|0,d=d+Math.imul(T,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(T,K)|0,d=d+Math.imul(T,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(T,J)|0,d=d+Math.imul(T,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(T,X)|0,d=d+Math.imul(T,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(T,te)|0,d=d+Math.imul(T,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(T,de)|0,d=d+Math.imul(T,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(T,ie)|0,d=d+Math.imul(T,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(T,se)|0,d=d+Math.imul(T,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(T,he)|0))<<13)|0;b=((d=d+Math.imul(T,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},86729:(e,a,t)=>{"use strict";var c=a;c.version=t(1636).rE,c.utils=t(47011),c.rand=t(15037),c.curve=t(894),c.curves=t(60480),c.ec=t(57447),c.eddsa=t(8650)},36677:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011),d=f.getNAF,r=f.getJSF,n=f.assert;function i(e,a){this.type=e,this.p=new c(a.p,16),this.red=a.prime?c.red(a.prime):c.mont(this.p),this.zero=new c(0).toRed(this.red),this.one=new c(1).toRed(this.red),this.two=new c(2).toRed(this.red),this.n=a.n&&new c(a.n,16),this.g=a.g&&this.pointFromJSON(a.g,a.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 t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function b(e,a){this.curve=e,this.type=a,this.precomputed=null}e.exports=i,i.prototype.point=function(){throw new Error("Not implemented")},i.prototype.validate=function(){throw new Error("Not implemented")},i.prototype._fixedNafMul=function(e,a){n(e.precomputed);var t=e._getDoubles(),c=d(a,1,this._bitLength),f=(1<=r;o--)i=(i<<1)+c[o];b.push(i)}for(var s=this.jpoint(null,null,null),l=this.jpoint(null,null,null),u=f;u>0;u--){for(r=0;r=0;b--){for(var o=0;b>=0&&0===r[b];b--)o++;if(b>=0&&o++,i=i.dblp(o),b<0)break;var s=r[b];n(0!==s),i="affine"===e.type?s>0?i.mixedAdd(f[s-1>>1]):i.mixedAdd(f[-s-1>>1].neg()):s>0?i.add(f[s-1>>1]):i.add(f[-s-1>>1].neg())}return"affine"===e.type?i.toP():i},i.prototype._wnafMulAdd=function(e,a,t,c,f){var n,i,b,o=this._wnafT1,s=this._wnafT2,l=this._wnafT3,u=0;for(n=0;n=1;n-=2){var p=n-1,g=n;if(1===o[p]&&1===o[g]){var m=[a[p],null,null,a[g]];0===a[p].y.cmp(a[g].y)?(m[1]=a[p].add(a[g]),m[2]=a[p].toJ().mixedAdd(a[g].neg())):0===a[p].y.cmp(a[g].y.redNeg())?(m[1]=a[p].toJ().mixedAdd(a[g]),m[2]=a[p].add(a[g].neg())):(m[1]=a[p].toJ().mixedAdd(a[g]),m[2]=a[p].toJ().mixedAdd(a[g].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],y=r(t[p],t[g]);for(u=Math.max(y[0].length,u),l[p]=new Array(u),l[g]=new Array(u),i=0;i=0;n--){for(var I=0;n>=0;){var E=!0;for(i=0;i=0&&I++,w=w.dblp(I),n<0)break;for(i=0;i0?b=s[i][C-1>>1]:C<0&&(b=s[i][-C-1>>1].neg()),w="affine"===b.type?w.mixedAdd(b):w.add(b))}}for(n=0;n=Math.ceil((e.bitLength()+1)/a.step)},b.prototype._getDoubles=function(e,a){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var t=[this],c=this,f=0;f{"use strict";var c=t(47011),f=t(28490),d=t(56698),r=t(36677),n=c.assert;function i(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,r.call(this,"edwards",e),this.a=new f(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new f(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new f(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),n(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function b(e,a,t,c,d){r.BasePoint.call(this,e,"projective"),null===a&&null===t&&null===c?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new f(a,16),this.y=new f(t,16),this.z=c?new f(c,16):this.curve.one,this.t=d&&new f(d,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()))))}d(i,r),e.exports=i,i.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},i.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},i.prototype.jpoint=function(e,a,t,c){return this.point(e,a,t,c)},i.prototype.pointFromX=function(e,a){(e=new f(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr(),c=this.c2.redSub(this.a.redMul(t)),d=this.one.redSub(this.c2.redMul(this.d).redMul(t)),r=c.redMul(d.redInvm()),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(a&&!i||!a&&i)&&(n=n.redNeg()),this.point(e,n)},i.prototype.pointFromY=function(e,a){(e=new f(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr(),c=t.redSub(this.c2),d=t.redMul(this.d).redMul(this.c2).redSub(this.a),r=c.redMul(d.redInvm());if(0===r.cmp(this.zero)){if(a)throw new Error("invalid point");return this.point(this.zero,e)}var n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");return n.fromRed().isOdd()!==a&&(n=n.redNeg()),this.point(n,e)},i.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var a=e.x.redSqr(),t=e.y.redSqr(),c=a.redMul(this.a).redAdd(t),f=this.c2.redMul(this.one.redAdd(this.d.redMul(a).redMul(t)));return 0===c.cmp(f)},d(b,r.BasePoint),i.prototype.pointFromJSON=function(e){return b.fromJSON(this,e)},i.prototype.point=function(e,a,t,c){return new b(this,e,a,t,c)},b.fromJSON=function(e,a){return new b(e,a[0],a[1],a[2])},b.prototype.inspect=function(){return this.isInfinity()?"":""},b.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},b.prototype._extDbl=function(){var e=this.x.redSqr(),a=this.y.redSqr(),t=this.z.redSqr();t=t.redIAdd(t);var c=this.curve._mulA(e),f=this.x.redAdd(this.y).redSqr().redISub(e).redISub(a),d=c.redAdd(a),r=d.redSub(t),n=c.redSub(a),i=f.redMul(r),b=d.redMul(n),o=f.redMul(n),s=r.redMul(d);return this.curve.point(i,b,s,o)},b.prototype._projDbl=function(){var e,a,t,c,f,d,r=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),i=this.y.redSqr();if(this.curve.twisted){var b=(c=this.curve._mulA(n)).redAdd(i);this.zOne?(e=r.redSub(n).redSub(i).redMul(b.redSub(this.curve.two)),a=b.redMul(c.redSub(i)),t=b.redSqr().redSub(b).redSub(b)):(f=this.z.redSqr(),d=b.redSub(f).redISub(f),e=r.redSub(n).redISub(i).redMul(d),a=b.redMul(c.redSub(i)),t=b.redMul(d))}else c=n.redAdd(i),f=this.curve._mulC(this.z).redSqr(),d=c.redSub(f).redSub(f),e=this.curve._mulC(r.redISub(c)).redMul(d),a=this.curve._mulC(c).redMul(n.redISub(i)),t=c.redMul(d);return this.curve.point(e,a,t)},b.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},b.prototype._extAdd=function(e){var a=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),t=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),c=this.t.redMul(this.curve.dd).redMul(e.t),f=this.z.redMul(e.z.redAdd(e.z)),d=t.redSub(a),r=f.redSub(c),n=f.redAdd(c),i=t.redAdd(a),b=d.redMul(r),o=n.redMul(i),s=d.redMul(i),l=r.redMul(n);return this.curve.point(b,o,l,s)},b.prototype._projAdd=function(e){var a,t,c=this.z.redMul(e.z),f=c.redSqr(),d=this.x.redMul(e.x),r=this.y.redMul(e.y),n=this.curve.d.redMul(d).redMul(r),i=f.redSub(n),b=f.redAdd(n),o=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(d).redISub(r),s=c.redMul(i).redMul(o);return this.curve.twisted?(a=c.redMul(b).redMul(r.redSub(this.curve._mulA(d))),t=i.redMul(b)):(a=c.redMul(b).redMul(r.redSub(d)),t=this.curve._mulC(i).redMul(b)),this.curve.point(s,a,t)},b.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},b.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},b.prototype.mulAdd=function(e,a,t){return this.curve._wnafMulAdd(1,[this,a],[e,t],2,!1)},b.prototype.jmulAdd=function(e,a,t){return this.curve._wnafMulAdd(1,[this,a],[e,t],2,!0)},b.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},b.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},b.prototype.getX=function(){return this.normalize(),this.x.fromRed()},b.prototype.getY=function(){return this.normalize(),this.y.fromRed()},b.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},b.prototype.eqXToP=function(e){var a=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(a))return!0;for(var t=e.clone(),c=this.curve.redN.redMul(this.z);;){if(t.iadd(this.curve.n),t.cmp(this.curve.p)>=0)return!1;if(a.redIAdd(c),0===this.x.cmp(a))return!0}},b.prototype.toP=b.prototype.normalize,b.prototype.mixedAdd=b.prototype.add},894:(e,a,t)=>{"use strict";var c=a;c.base=t(36677),c.short=t(39188),c.mont=t(30370),c.edwards=t(31298)},30370:(e,a,t)=>{"use strict";var c=t(28490),f=t(56698),d=t(36677),r=t(47011);function n(e){d.call(this,"mont",e),this.a=new c(e.a,16).toRed(this.red),this.b=new c(e.b,16).toRed(this.red),this.i4=new c(4).toRed(this.red).redInvm(),this.two=new c(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(e,a,t){d.BasePoint.call(this,e,"projective"),null===a&&null===t?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new c(a,16),this.z=new c(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}f(n,d),e.exports=n,n.prototype.validate=function(e){var a=e.normalize().x,t=a.redSqr(),c=t.redMul(a).redAdd(t.redMul(this.a)).redAdd(a);return 0===c.redSqrt().redSqr().cmp(c)},f(i,d.BasePoint),n.prototype.decodePoint=function(e,a){return this.point(r.toArray(e,a),1)},n.prototype.point=function(e,a){return new i(this,e,a)},n.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(e,a){return new i(e,a[0],a[1]||e.one)},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),a=this.x.redSub(this.z).redSqr(),t=e.redSub(a),c=e.redMul(a),f=t.redMul(a.redAdd(this.curve.a24.redMul(t)));return this.curve.point(c,f)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(e,a){var t=this.x.redAdd(this.z),c=this.x.redSub(this.z),f=e.x.redAdd(e.z),d=e.x.redSub(e.z).redMul(t),r=f.redMul(c),n=a.z.redMul(d.redAdd(r).redSqr()),i=a.x.redMul(d.redISub(r).redSqr());return this.curve.point(n,i)},i.prototype.mul=function(e){for(var a=e.clone(),t=this,c=this.curve.point(null,null),f=[];0!==a.cmpn(0);a.iushrn(1))f.push(a.andln(1));for(var d=f.length-1;d>=0;d--)0===f[d]?(t=t.diffAdd(c,this),c=c.dbl()):(c=t.diffAdd(c,this),t=t.dbl());return c},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},39188:(e,a,t)=>{"use strict";var c=t(47011),f=t(28490),d=t(56698),r=t(36677),n=c.assert;function i(e){r.call(this,"short",e),this.a=new f(e.a,16).toRed(this.red),this.b=new f(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function b(e,a,t,c){r.BasePoint.call(this,e,"affine"),null===a&&null===t?(this.x=null,this.y=null,this.inf=!0):(this.x=new f(a,16),this.y=new f(t,16),c&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function o(e,a,t,c){r.BasePoint.call(this,e,"jacobian"),null===a&&null===t&&null===c?(this.x=this.curve.one,this.y=this.curve.one,this.z=new f(0)):(this.x=new f(a,16),this.y=new f(t,16),this.z=new f(c,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}d(i,r),e.exports=i,i.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var a,t;if(e.beta)a=new f(e.beta,16).toRed(this.red);else{var c=this._getEndoRoots(this.p);a=(a=c[0].cmp(c[1])<0?c[0]:c[1]).toRed(this.red)}if(e.lambda)t=new f(e.lambda,16);else{var d=this._getEndoRoots(this.n);0===this.g.mul(d[0]).x.cmp(this.g.x.redMul(a))?t=d[0]:(t=d[1],n(0===this.g.mul(t).x.cmp(this.g.x.redMul(a))))}return{beta:a,lambda:t,basis:e.basis?e.basis.map((function(e){return{a:new f(e.a,16),b:new f(e.b,16)}})):this._getEndoBasis(t)}}},i.prototype._getEndoRoots=function(e){var a=e===this.p?this.red:f.mont(e),t=new f(2).toRed(a).redInvm(),c=t.redNeg(),d=new f(3).toRed(a).redNeg().redSqrt().redMul(t);return[c.redAdd(d).fromRed(),c.redSub(d).fromRed()]},i.prototype._getEndoBasis=function(e){for(var a,t,c,d,r,n,i,b,o,s=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,u=this.n.clone(),h=new f(1),p=new f(0),g=new f(0),m=new f(1),x=0;0!==l.cmpn(0);){var y=u.div(l);b=u.sub(y.mul(l)),o=g.sub(y.mul(h));var A=m.sub(y.mul(p));if(!c&&b.cmp(s)<0)a=i.neg(),t=h,c=b.neg(),d=o;else if(c&&2==++x)break;i=b,u=l,l=b,g=h,h=o,m=p,p=A}r=b.neg(),n=o;var v=c.sqr().add(d.sqr());return r.sqr().add(n.sqr()).cmp(v)>=0&&(r=a,n=t),c.negative&&(c=c.neg(),d=d.neg()),r.negative&&(r=r.neg(),n=n.neg()),[{a:c,b:d},{a:r,b:n}]},i.prototype._endoSplit=function(e){var a=this.endo.basis,t=a[0],c=a[1],f=c.b.mul(e).divRound(this.n),d=t.b.neg().mul(e).divRound(this.n),r=f.mul(t.a),n=d.mul(c.a),i=f.mul(t.b),b=d.mul(c.b);return{k1:e.sub(r).sub(n),k2:i.add(b).neg()}},i.prototype.pointFromX=function(e,a){(e=new f(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),c=t.redSqrt();if(0!==c.redSqr().redSub(t).cmp(this.zero))throw new Error("invalid point");var d=c.fromRed().isOdd();return(a&&!d||!a&&d)&&(c=c.redNeg()),this.point(e,c)},i.prototype.validate=function(e){if(e.inf)return!0;var a=e.x,t=e.y,c=this.a.redMul(a),f=a.redSqr().redMul(a).redIAdd(c).redIAdd(this.b);return 0===t.redSqr().redISub(f).cmpn(0)},i.prototype._endoWnafMulAdd=function(e,a,t){for(var c=this._endoWnafT1,f=this._endoWnafT2,d=0;d":""},b.prototype.isInfinity=function(){return this.inf},b.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var a=this.y.redSub(e.y);0!==a.cmpn(0)&&(a=a.redMul(this.x.redSub(e.x).redInvm()));var t=a.redSqr().redISub(this.x).redISub(e.x),c=a.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,c)},b.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var a=this.curve.a,t=this.x.redSqr(),c=e.redInvm(),f=t.redAdd(t).redIAdd(t).redIAdd(a).redMul(c),d=f.redSqr().redISub(this.x.redAdd(this.x)),r=f.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,r)},b.prototype.getX=function(){return this.x.fromRed()},b.prototype.getY=function(){return this.y.fromRed()},b.prototype.mul=function(e){return e=new f(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},b.prototype.mulAdd=function(e,a,t){var c=[this,a],f=[e,t];return this.curve.endo?this.curve._endoWnafMulAdd(c,f):this.curve._wnafMulAdd(1,c,f,2)},b.prototype.jmulAdd=function(e,a,t){var c=[this,a],f=[e,t];return this.curve.endo?this.curve._endoWnafMulAdd(c,f,!0):this.curve._wnafMulAdd(1,c,f,2,!0)},b.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},b.prototype.neg=function(e){if(this.inf)return this;var a=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var t=this.precomputed,c=function(e){return e.neg()};a.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(c)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(c)}}}return a},b.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},d(o,r.BasePoint),i.prototype.jpoint=function(e,a,t){return new o(this,e,a,t)},o.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),a=e.redSqr(),t=this.x.redMul(a),c=this.y.redMul(a).redMul(e);return this.curve.point(t,c)},o.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},o.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var a=e.z.redSqr(),t=this.z.redSqr(),c=this.x.redMul(a),f=e.x.redMul(t),d=this.y.redMul(a.redMul(e.z)),r=e.y.redMul(t.redMul(this.z)),n=c.redSub(f),i=d.redSub(r);if(0===n.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var b=n.redSqr(),o=b.redMul(n),s=c.redMul(b),l=i.redSqr().redIAdd(o).redISub(s).redISub(s),u=i.redMul(s.redISub(l)).redISub(d.redMul(o)),h=this.z.redMul(e.z).redMul(n);return this.curve.jpoint(l,u,h)},o.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var a=this.z.redSqr(),t=this.x,c=e.x.redMul(a),f=this.y,d=e.y.redMul(a).redMul(this.z),r=t.redSub(c),n=f.redSub(d);if(0===r.cmpn(0))return 0!==n.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=r.redSqr(),b=i.redMul(r),o=t.redMul(i),s=n.redSqr().redIAdd(b).redISub(o).redISub(o),l=n.redMul(o.redISub(s)).redISub(f.redMul(b)),u=this.z.redMul(r);return this.curve.jpoint(s,l,u)},o.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var a;if(this.curve.zeroA||this.curve.threeA){var t=this;for(a=0;a=0)return!1;if(t.redIAdd(f),0===this.x.cmp(t))return!0}},o.prototype.inspect=function(){return this.isInfinity()?"":""},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},60480:(e,a,t)=>{"use strict";var c,f=a,d=t(77952),r=t(894),n=t(47011).assert;function i(e){"short"===e.type?this.curve=new r.short(e):"edwards"===e.type?this.curve=new r.edwards(e):this.curve=new r.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function b(e,a){Object.defineProperty(f,e,{configurable:!0,enumerable:!0,get:function(){var t=new i(a);return Object.defineProperty(f,e,{configurable:!0,enumerable:!0,value:t}),t}})}f.PresetCurve=i,b("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:d.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),b("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:d.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),b("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:d.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),b("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:d.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),b("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:d.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),b("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:d.sha256,gRed:!1,g:["9"]}),b("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:d.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{c=t(74011)}catch(e){c=void 0}b("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:d.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})},57447:(e,a,t)=>{"use strict";var c=t(28490),f=t(32723),d=t(47011),r=t(60480),n=t(15037),i=d.assert,b=t(61200),o=t(28545);function s(e){if(!(this instanceof s))return new s(e);"string"==typeof e&&(i(Object.prototype.hasOwnProperty.call(r,e),"Unknown curve "+e),e=r[e]),e instanceof r.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=s,s.prototype.keyPair=function(e){return new b(this,e)},s.prototype.keyFromPrivate=function(e,a){return b.fromPrivate(this,e,a)},s.prototype.keyFromPublic=function(e,a){return b.fromPublic(this,e,a)},s.prototype.genKeyPair=function(e){e||(e={});for(var a=new f({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||n(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),d=this.n.sub(new c(2));;){var r=new c(a.generate(t));if(!(r.cmp(d)>0))return r.iaddn(1),this.keyFromPrivate(r)}},s.prototype._truncateToN=function(e,a){var t=8*e.byteLength()-this.n.bitLength();return t>0&&(e=e.ushrn(t)),!a&&e.cmp(this.n)>=0?e.sub(this.n):e},s.prototype.sign=function(e,a,t,d){"object"==typeof t&&(d=t,t=null),d||(d={}),a=this.keyFromPrivate(a,t),e=this._truncateToN(new c(e,16));for(var r=this.n.byteLength(),n=a.getPrivate().toArray("be",r),i=e.toArray("be",r),b=new f({hash:this.hash,entropy:n,nonce:i,pers:d.pers,persEnc:d.persEnc||"utf8"}),s=this.n.sub(new c(1)),l=0;;l++){var u=d.k?d.k(l):new c(b.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(s)>=0)){var h=this.g.mul(u);if(!h.isInfinity()){var p=h.getX(),g=p.umod(this.n);if(0!==g.cmpn(0)){var m=u.invm(this.n).mul(g.mul(a.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var x=(h.getY().isOdd()?1:0)|(0!==p.cmp(g)?2:0);return d.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),x^=1),new o({r:g,s:m,recoveryParam:x})}}}}}},s.prototype.verify=function(e,a,t,f){e=this._truncateToN(new c(e,16)),t=this.keyFromPublic(t,f);var d=(a=new o(a,"hex")).r,r=a.s;if(d.cmpn(1)<0||d.cmp(this.n)>=0)return!1;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;var n,i=r.invm(this.n),b=i.mul(e).umod(this.n),s=i.mul(d).umod(this.n);return this.curve._maxwellTrick?!(n=this.g.jmulAdd(b,t.getPublic(),s)).isInfinity()&&n.eqXToP(d):!(n=this.g.mulAdd(b,t.getPublic(),s)).isInfinity()&&0===n.getX().umod(this.n).cmp(d)},s.prototype.recoverPubKey=function(e,a,t,f){i((3&t)===t,"The recovery param is more than two bits"),a=new o(a,f);var d=this.n,r=new c(e),n=a.r,b=a.s,s=1&t,l=t>>1;if(n.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");n=l?this.curve.pointFromX(n.add(this.curve.n),s):this.curve.pointFromX(n,s);var u=a.r.invm(d),h=d.sub(r).mul(u).umod(d),p=b.mul(u).umod(d);return this.g.mulAdd(h,n,p)},s.prototype.getKeyRecoveryParam=function(e,a,t,c){if(null!==(a=new o(a,c)).recoveryParam)return a.recoveryParam;for(var f=0;f<4;f++){var d;try{d=this.recoverPubKey(e,a,f)}catch(e){continue}if(d.eq(t))return f}throw new Error("Unable to find valid recovery factor")}},61200:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011).assert;function d(e,a){this.ec=e,this.priv=null,this.pub=null,a.priv&&this._importPrivate(a.priv,a.privEnc),a.pub&&this._importPublic(a.pub,a.pubEnc)}e.exports=d,d.fromPublic=function(e,a,t){return a instanceof d?a:new d(e,{pub:a,pubEnc:t})},d.fromPrivate=function(e,a,t){return a instanceof d?a:new d(e,{priv:a,privEnc:t})},d.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},d.prototype.getPublic=function(e,a){return"string"==typeof e&&(a=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),a?this.pub.encode(a,e):this.pub},d.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},d.prototype._importPrivate=function(e,a){this.priv=new c(e,a||16),this.priv=this.priv.umod(this.ec.curve.n)},d.prototype._importPublic=function(e,a){if(e.x||e.y)return"mont"===this.ec.curve.type?f(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||f(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,a)},d.prototype.derive=function(e){return e.validate()||f(e.validate(),"public point not validated"),e.mul(this.priv).getX()},d.prototype.sign=function(e,a,t){return this.ec.sign(e,this,a,t)},d.prototype.verify=function(e,a){return this.ec.verify(e,a,this)},d.prototype.inspect=function(){return""}},28545:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011),d=f.assert;function r(e,a){if(e instanceof r)return e;this._importDER(e,a)||(d(e.r&&e.s,"Signature without r or s"),this.r=new c(e.r,16),this.s=new c(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function n(){this.place=0}function i(e,a){var t=e[a.place++];if(!(128&t))return t;var c=15&t;if(0===c||c>4)return!1;if(0===e[a.place])return!1;for(var f=0,d=0,r=a.place;d>>=0;return!(f<=127)&&(a.place=r,f)}function b(e){for(var a=0,t=e.length-1;!e[a]&&!(128&e[a+1])&&a>>3);for(e.push(128|t);--t;)e.push(a>>>(t<<3)&255);e.push(a)}}e.exports=r,r.prototype._importDER=function(e,a){e=f.toArray(e,a);var t=new n;if(48!==e[t.place++])return!1;var d=i(e,t);if(!1===d)return!1;if(d+t.place!==e.length)return!1;if(2!==e[t.place++])return!1;var r=i(e,t);if(!1===r)return!1;if(128&e[t.place])return!1;var b=e.slice(t.place,r+t.place);if(t.place+=r,2!==e[t.place++])return!1;var o=i(e,t);if(!1===o)return!1;if(e.length!==o+t.place)return!1;if(128&e[t.place])return!1;var s=e.slice(t.place,o+t.place);if(0===b[0]){if(!(128&b[1]))return!1;b=b.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new c(b),this.s=new c(s),this.recoveryParam=null,!0},r.prototype.toDER=function(e){var a=this.r.toArray(),t=this.s.toArray();for(128&a[0]&&(a=[0].concat(a)),128&t[0]&&(t=[0].concat(t)),a=b(a),t=b(t);!(t[0]||128&t[1]);)t=t.slice(1);var c=[2];o(c,a.length),(c=c.concat(a)).push(2),o(c,t.length);var d=c.concat(t),r=[48];return o(r,d.length),r=r.concat(d),f.encode(r,e)}},8650:(e,a,t)=>{"use strict";var c=t(77952),f=t(60480),d=t(47011),r=d.assert,n=d.parseBytes,i=t(46661),b=t(90220);function o(e){if(r("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof o))return new o(e);e=f[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=c.sha512}e.exports=o,o.prototype.sign=function(e,a){e=n(e);var t=this.keyFromSecret(a),c=this.hashInt(t.messagePrefix(),e),f=this.g.mul(c),d=this.encodePoint(f),r=this.hashInt(d,t.pubBytes(),e).mul(t.priv()),i=c.add(r).umod(this.curve.n);return this.makeSignature({R:f,S:i,Rencoded:d})},o.prototype.verify=function(e,a,t){if(e=n(e),(a=this.makeSignature(a)).S().gte(a.eddsa.curve.n)||a.S().isNeg())return!1;var c=this.keyFromPublic(t),f=this.hashInt(a.Rencoded(),c.pubBytes(),e),d=this.g.mul(a.S());return a.R().add(c.pub().mul(f)).eq(d)},o.prototype.hashInt=function(){for(var e=this.hash(),a=0;a{"use strict";var c=t(47011),f=c.assert,d=c.parseBytes,r=c.cachedProperty;function n(e,a){this.eddsa=e,this._secret=d(a.secret),e.isPoint(a.pub)?this._pub=a.pub:this._pubBytes=d(a.pub)}n.fromPublic=function(e,a){return a instanceof n?a:new n(e,{pub:a})},n.fromSecret=function(e,a){return a instanceof n?a:new n(e,{secret:a})},n.prototype.secret=function(){return this._secret},r(n,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),r(n,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),r(n,"privBytes",(function(){var e=this.eddsa,a=this.hash(),t=e.encodingLength-1,c=a.slice(0,e.encodingLength);return c[0]&=248,c[t]&=127,c[t]|=64,c})),r(n,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),r(n,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),r(n,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),n.prototype.sign=function(e){return f(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},n.prototype.verify=function(e,a){return this.eddsa.verify(e,a,this)},n.prototype.getSecret=function(e){return f(this._secret,"KeyPair is public only"),c.encode(this.secret(),e)},n.prototype.getPublic=function(e){return c.encode(this.pubBytes(),e)},e.exports=n},90220:(e,a,t)=>{"use strict";var c=t(28490),f=t(47011),d=f.assert,r=f.cachedProperty,n=f.parseBytes;function i(e,a){this.eddsa=e,"object"!=typeof a&&(a=n(a)),Array.isArray(a)&&(d(a.length===2*e.encodingLength,"Signature has invalid size"),a={R:a.slice(0,e.encodingLength),S:a.slice(e.encodingLength)}),d(a.R&&a.S,"Signature without R or S"),e.isPoint(a.R)&&(this._R=a.R),a.S instanceof c&&(this._S=a.S),this._Rencoded=Array.isArray(a.R)?a.R:a.Rencoded,this._Sencoded=Array.isArray(a.S)?a.S:a.Sencoded}r(i,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),r(i,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),r(i,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),r(i,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),i.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},i.prototype.toHex=function(){return f.encode(this.toBytes(),"hex").toUpperCase()},e.exports=i},74011:e=>{e.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"]]}}},47011:(e,a,t)=>{"use strict";var c=a,f=t(28490),d=t(43349),r=t(64367);c.assert=d,c.toArray=r.toArray,c.zero2=r.zero2,c.toHex=r.toHex,c.encode=r.encode,c.getNAF=function(e,a,t){var c,f=new Array(Math.max(e.bitLength(),t)+1);for(c=0;c(d>>1)-1?(d>>1)-i:i,r.isubn(n)):n=0,f[c]=n,r.iushrn(1)}return f},c.getJSF=function(e,a){var t=[[],[]];e=e.clone(),a=a.clone();for(var c,f=0,d=0;e.cmpn(-f)>0||a.cmpn(-d)>0;){var r,n,i=e.andln(3)+f&3,b=a.andln(3)+d&3;3===i&&(i=-1),3===b&&(b=-1),r=1&i?3!=(c=e.andln(7)+f&7)&&5!==c||2!==b?i:-i:0,t[0].push(r),n=1&b?3!=(c=a.andln(7)+d&7)&&5!==c||2!==i?b:-b:0,t[1].push(n),2*f===r+1&&(f=1-f),2*d===n+1&&(d=1-d),e.iushrn(1),a.iushrn(1)}return t},c.cachedProperty=function(e,a,t){var c="_"+a;e.prototype[a]=function(){return void 0!==this[c]?this[c]:this[c]=t.call(this)}},c.parseBytes=function(e){return"string"==typeof e?c.toArray(e,"hex"):e},c.intFromLE=function(e){return new f(e,"hex","le")}},28490:function(e,a,t){!function(e,a){"use strict";function c(e,a){if(!e)throw new Error(a||"Assertion failed")}function f(e,a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}function d(e,a,t){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(t=a,a=10),this._init(e||0,a||10,t||"be"))}var r;"object"==typeof e?e.exports=d:a.BN=d,d.BN=d,d.wordSize=26;try{r="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(79368).Buffer}catch(e){}function n(e,a){var t=e.charCodeAt(a);return t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,T=R>>>13,D=0|r[9],F=8191&D,Q=D>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(T,j)|0,d=Math.imul(T,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(T,q)|0,d=d+Math.imul(T,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(T,K)|0,d=d+Math.imul(T,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(T,J)|0,d=d+Math.imul(T,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(T,X)|0,d=d+Math.imul(T,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(T,te)|0,d=d+Math.imul(T,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(T,de)|0,d=d+Math.imul(T,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(T,ie)|0,d=d+Math.imul(T,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(T,se)|0,d=d+Math.imul(T,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(T,he)|0))<<13)|0;b=((d=d+Math.imul(T,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},30655:(e,a,t)=>{"use strict";var c=t(70453)("%Object.defineProperty%",!0)||!1;if(c)try{c({},"a",{value:1})}catch(e){c=!1}e.exports=c},41237:e=>{"use strict";e.exports=EvalError},69383:e=>{"use strict";e.exports=Error},79290:e=>{"use strict";e.exports=RangeError},79538:e=>{"use strict";e.exports=ReferenceError},58068:e=>{"use strict";e.exports=SyntaxError},69675:e=>{"use strict";e.exports=TypeError},35345:e=>{"use strict";e.exports=URIError},9723:(e,a,t)=>{"use strict";t.d(a,{AF:()=>r,B3:()=>d,JY:()=>n});var c=t(67418),f=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));class d{constructor({provider:e,onProgress:a,concurrencySize:t=10,batchSize:c=10,shouldRetry:f=!0,retryMax:d=5,retryOn:r=500}){this.provider=e,this.onProgress=a,this.concurrencySize=t,this.batchSize=c,this.shouldRetry=f,this.retryMax=d,this.retryOn=r}getBlock(e){return f(this,null,(function*(){const a=yield this.provider.getBlock(e);if(!a)throw new Error(`No block for ${e}`);return a}))}createBatchRequest(e){return e.map(((e,a)=>f(this,null,(function*(){return yield(0,c.yy)(20*a),(()=>f(this,null,(function*(){let a,t=0;for(;!this.shouldRetry&&0===t||this.shouldRetry&&tthis.getBlock(e))))}catch(e){t++,a=e,yield(0,c.yy)(this.retryOn)}throw a})))()}))))}getBatchBlocks(e){return f(this,null,(function*(){let a=0;const t=[];for(const f of(0,c.iv)(e,this.concurrencySize*this.batchSize)){const d=(yield Promise.all(this.createBatchRequest((0,c.iv)(f,this.batchSize)))).flat();t.push(...d),a+=f.length,"function"==typeof this.onProgress&&this.onProgress({percentage:a/e.length,currentIndex:a,totalIndex:e.length})}return t}))}}class r{constructor({provider:e,onProgress:a,concurrencySize:t=10,batchSize:c=10,shouldRetry:f=!0,retryMax:d=5,retryOn:r=500}){this.provider=e,this.onProgress=a,this.concurrencySize=t,this.batchSize=c,this.shouldRetry=f,this.retryMax=d,this.retryOn=r}getTransaction(e){return f(this,null,(function*(){const a=yield this.provider.getTransaction(e);if(!a)throw new Error(`No transaction for ${e}`);return a}))}createBatchRequest(e){return e.map(((e,a)=>f(this,null,(function*(){return yield(0,c.yy)(20*a),(()=>f(this,null,(function*(){let a,t=0;for(;!this.shouldRetry&&0===t||this.shouldRetry&&tthis.getTransaction(e))))}catch(e){t++,a=e,yield(0,c.yy)(this.retryOn)}throw a})))()}))))}getBatchTransactions(e){return f(this,null,(function*(){let a=0;const t=[];for(const f of(0,c.iv)(e,this.concurrencySize*this.batchSize)){const d=(yield Promise.all(this.createBatchRequest((0,c.iv)(f,this.batchSize)))).flat();t.push(...d),a+=f.length,"function"==typeof this.onProgress&&this.onProgress({percentage:a/e.length,currentIndex:a,totalIndex:e.length})}return t}))}}class n{constructor({provider:e,contract:a,onProgress:t,concurrencySize:c=10,blocksPerRequest:f=2e3,shouldRetry:d=!0,retryMax:r=5,retryOn:n=500}){this.provider=e,this.contract=a,this.onProgress=t,this.concurrencySize=c,this.blocksPerRequest=f,this.shouldRetry=d,this.retryMax=r,this.retryOn=n}getPastEvents(e){return f(this,arguments,(function*({fromBlock:e,toBlock:a,type:t}){let f,d=0;for(;!this.shouldRetry&&0===d||this.shouldRetry&&df(this,null,(function*(){return yield(0,c.yy)(20*a),this.getPastEvents(e)}))))}getBatchEvents(e){return f(this,arguments,(function*({fromBlock:e,toBlock:a,type:t="*"}){a||(a=yield this.provider.getBlockNumber());const f=[];for(let c=e;ca?a:c+this.blocksPerRequest-1;f.push({fromBlock:c,toBlock:e,type:t})}const d=[],r=(0,c.iv)(f,this.concurrencySize);let n=0;for(const e of r){n++;const a=(yield Promise.all(this.createBatchRequest(e))).flat();d.push(...a),"function"==typeof this.onProgress&&this.onProgress({percentage:n/r.length,type:t,fromBlock:e[0].fromBlock,toBlock:e[e.length-1].toBlock,count:a.length})}return d}))}}},7240:(e,a,t)=>{"use strict";t.d(a,{Hr:()=>r,dA:()=>n,qO:()=>i});var c=t(67418),f=t(85111),d=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));function r(e){return d(this,arguments,(function*({nullifier:e,secret:a}){const t=new Uint8Array([...(0,c.EI)(e),...(0,c.EI)(a)]),d=(0,c.$W)((0,c.Ju)(t),62),r=BigInt(yield(0,f.UB)(t)),n=(0,c.$W)(r),i=BigInt(yield(0,f.UB)((0,c.EI)(e)));return{preimage:t,noteHex:d,commitment:r,commitmentHex:n,nullifierHash:i,nullifierHex:(0,c.$W)(i)}}))}class n{constructor({currency:e,amount:a,netId:t,nullifier:c,secret:f,note:d,noteHex:r,invoice:n,commitmentHex:i,nullifierHex:b}){this.currency=e,this.amount=a,this.netId=t,this.nullifier=c,this.secret=f,this.note=d,this.noteHex=r,this.invoice=n,this.commitmentHex=i,this.nullifierHex=b}toString(){return JSON.stringify({currency:this.currency,amount:this.amount,netId:this.netId,nullifier:this.nullifier,secret:this.secret,note:this.note,noteHex:this.noteHex,invoice:this.invoice,commitmentHex:this.commitmentHex,nullifierHex:this.nullifierHex},null,2)}static createNote(e){return d(this,arguments,(function*({currency:e,amount:a,netId:t,nullifier:f,secret:d}){f||(f=(0,c.ib)(31)),d||(d=(0,c.ib)(31));const i=yield r({nullifier:f,secret:d});return new n({currency:e.toLowerCase(),amount:a,netId:t,note:`tornado-${e.toLowerCase()}-${a}-${t}-${i.noteHex}`,noteHex:i.noteHex,invoice:`tornadoInvoice-${e.toLowerCase()}-${a}-${t}-${i.commitmentHex}`,nullifier:f,secret:d,commitmentHex:i.commitmentHex,nullifierHex:i.nullifierHex})}))}static parseNote(e){return d(this,null,(function*(){const a=new RegExp("tornado-(?\\w+)-(?[\\d.]+)-(?\\d+)-0x(?[0-9a-fA-F]{124})","g").exec(e);if(!a)throw new Error("The note has invalid format");const t=null==a?void 0:a.groups,f=t.currency.toLowerCase(),d=t.amount,i=Number(t.netId),b=(0,c.jm)("0x"+t.note),o=BigInt((0,c.ae)(b.slice(0,31)).toString()),s=BigInt((0,c.ae)(b.slice(31,62)).toString()),l=yield r({nullifier:o,secret:s}),u=`tornadoInvoice-${f}-${d}-${i}-${l.commitmentHex}`;return new n({currency:f,amount:d,netId:i,note:e,noteHex:l.noteHex,invoice:u,nullifier:o,secret:s,commitmentHex:l.commitmentHex,nullifierHex:l.nullifierHex})}))}}class i{constructor(e){const a=new RegExp("tornadoInvoice-(?\\w+)-(?[\\d.]+)-(?\\d+)-0x(?[0-9a-fA-F]{64})","g").exec(e);if(!a)throw new Error("The note has invalid format");const t=null==a?void 0:a.groups,c=t.currency.toLowerCase(),f=t.amount,d=Number(t.netId);this.currency=c,this.amount=f,this.netId=d,this.commitment="0x"+t.commitment,this.invoice=e}toString(){return JSON.stringify({currency:this.currency,amount:this.amount,netId:this.netId,commitment:this.commitment,invoice:this.invoice},null,2)}}},33298:(e,a,t)=>{"use strict";t.d(a,{Ad:()=>b,Fr:()=>n,ol:()=>i});var c=t(51594),f=t(20415),d=t(30031),r=t(67418);function n({nonce:e,ephemPublicKey:a,ciphertext:t}){const c=(0,r.$W)((0,r.My)((0,r.Kp)(e)),24),f=(0,r.$W)((0,r.My)((0,r.Kp)(a)),32),d=(0,r.My)((0,r.Kp)(t)),n=(0,r.Id)((0,r.aT)(c),(0,r.aT)(f),(0,r.aT)(d));return(0,r.My)(n)}function i(e){const a=(0,r.aT)(e),t=(0,r.if)(a.slice(0,24)),c=(0,r.if)(a.slice(24,56)),f=(0,r.if)(a.slice(56));return{messageBuff:(0,r.My)(a),version:"x25519-xsalsa20-poly1305",nonce:t,ephemPublicKey:c,ciphertext:f}}class b{constructor({netId:e,blockNumber:a,recoveryKey:t,Echoer:d}){t||(t=(0,r.My)(r.Et.getRandomValues(new Uint8Array(32))).slice(2)),this.netId=Math.floor(Number(e)),this.blockNumber=a,this.recoveryKey=t,this.recoveryAddress=(0,f.K)("0x"+t),this.recoveryPublicKey=(0,c.getEncryptionPublicKey)(t),this.Echoer=d}static getWalletPublicKey(e){let{privateKey:a}=e;return a.startsWith("0x")&&(a=a.replace("0x","")),(0,c.getEncryptionPublicKey)(a)}getEncryptedAccount(e){const a=(0,c.encrypt)({publicKey:e,data:this.recoveryKey,version:"x25519-xsalsa20-poly1305"});return{encryptedData:a,data:n(a)}}decryptAccountsWithWallet(e,a){let{privateKey:t}=e;t.startsWith("0x")&&(t=t.replace("0x",""));const f=[];for(const e of a)try{const a=i(e.encryptedAccount),d=(0,c.decrypt)({encryptedData:a,privateKey:t});f.push(new b({netId:this.netId,blockNumber:e.blockNumber,recoveryKey:d,Echoer:this.Echoer}))}catch(e){continue}return f}decryptNotes(e){const a=[];for(const t of e)try{const e=i(t.encryptedNote),[f,r]=(0,c.decrypt)({encryptedData:e,privateKey:this.recoveryKey}).split("-");a.push({blockNumber:t.blockNumber,address:(0,d.b)(f),noteHex:r})}catch(e){continue}return a}encryptNote({address:e,noteHex:a}){return n((0,c.encrypt)({publicKey:this.recoveryPublicKey,data:`${e}-${a}`,version:"x25519-xsalsa20-poly1305"}))}}},71304:(e,a,t)=>{"use strict";t.d(a,{EU:()=>S,GS:()=>M,JJ:()=>L,Lx:()=>_,O_:()=>B,cE:()=>k,e0:()=>C,oW:()=>I,uw:()=>E});var c=t(30031),f=t(64563),d=t(99770),r=t(52049),n=t(9723),i=t(68434),b=t(57194),o=Object.defineProperty,s=Object.defineProperties,l=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,h=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,m=Reflect.get,x=(e,a,t)=>a in e?o(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,y=(e,a)=>{for(var t in a||(a={}))p.call(a,t)&&x(e,t,a[t]);if(u)for(var t of u(a))g.call(a,t)&&x(e,t,a[t]);return e},A=(e,a)=>s(e,l(a)),v=(e,a,t)=>m(h(e),t,a),w=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));const _="deposit",I="withdrawal";class E{constructor({netId:e,provider:a,graphApi:t,subgraphName:c,contract:f,type:d="",deployedBlock:r=0,fetchDataOptions:i,tovarishClient:b}){this.netId=e,this.provider=a,this.graphApi=t,this.subgraphName=c,this.fetchDataOptions=i,this.contract=f,this.type=d,this.deployedBlock=r,this.batchEventsService=new n.JY({provider:a,contract:f,onProgress:this.updateEventProgress}),this.tovarishClient=b}getInstanceName(){return""}getType(){return this.type||""}getTovarishType(){return String(this.getType()||"").toLowerCase()}getGraphMethod(){return""}getGraphParams(){return{graphApi:this.graphApi||"",subgraphName:this.subgraphName||"",fetchDataOptions:this.fetchDataOptions,onProgress:this.updateGraphProgress}}updateEventProgress({percentage:e,type:a,fromBlock:t,toBlock:c,count:f}){}updateBlockProgress({percentage:e,currentIndex:a,totalIndex:t}){}updateTransactionProgress({percentage:e,currentIndex:a,totalIndex:t}){}updateGraphProgress({type:e,fromBlock:a,toBlock:t,count:c}){}formatEvents(e){return w(this,null,(function*(){return yield new Promise((a=>a(e)))}))}getEventsFromDB(){return w(this,null,(function*(){return{events:[],lastBlock:null}}))}getEventsFromCache(){return w(this,null,(function*(){return{events:[],lastBlock:null,fromCache:!0}}))}getSavedEvents(){return w(this,null,(function*(){let e=yield this.getEventsFromDB();return e&&e.events.length||(e=yield this.getEventsFromCache()),e}))}getEventsFromGraph(e){return w(this,arguments,(function*({fromBlock:e,methodName:a=""}){if(!this.graphApi||!this.subgraphName)return{events:[],lastBlock:e};const{events:t,lastSyncBlock:c}=yield r[a||this.getGraphMethod()](y({fromBlock:e},this.getGraphParams()));return{events:t,lastBlock:c}}))}getEventsFromRpc(e){return w(this,arguments,(function*({fromBlock:e,toBlock:a}){try{return a||(a=yield this.provider.getBlockNumber()),e>=a?{events:[],lastBlock:a}:(this.updateEventProgress({percentage:0,type:this.getType()}),{events:yield this.formatEvents(yield this.batchEventsService.getBatchEvents({fromBlock:e,toBlock:a,type:this.getType()})),lastBlock:a})}catch(a){return console.log(a),{events:[],lastBlock:e}}}))}getLatestEvents(e){return w(this,arguments,(function*({fromBlock:e}){var a;if((null==(a=this.tovarishClient)?void 0:a.selectedRelayer)&&![_,I].includes(this.type.toLowerCase())){const{events:a,lastSyncBlock:t}=yield this.tovarishClient.getEvents({type:this.getTovarishType(),fromBlock:e});return{events:a,lastBlock:t}}const t=yield this.getEventsFromGraph({fromBlock:e}),c=t.lastBlock&&t.lastBlock>=e?t.lastBlock:e,f=yield this.getEventsFromRpc({fromBlock:c});return{events:[...t.events,...f.events],lastBlock:f.lastBlock}}))}validateEvents({events:e,lastBlock:a}){}saveEvents(e){return w(this,arguments,(function*({events:e,lastBlock:a}){}))}updateEvents(){return w(this,null,(function*(){var e;const a=yield this.getSavedEvents();let t=this.deployedBlock;a&&a.lastBlock&&(t=a.lastBlock+1);const c=yield this.getLatestEvents({fromBlock:t}),f=new Set,d=[...a.events,...c.events].sort(((e,a)=>e.blockNumber===a.blockNumber?e.logIndex-a.logIndex:e.blockNumber-a.blockNumber)).filter((({transactionHash:e,logIndex:a})=>{const t=`${e}_${a}`,c=f.has(t);return f.add(t),!c})),r=c.lastBlock||(null==(e=d[d.length-1])?void 0:e.blockNumber);return this.validateEvents({events:d,lastBlock:r}),(a.fromCache||c.events.length)&&(yield this.saveEvents({events:d,lastBlock:r})),{events:d,lastBlock:r}}))}}class C extends E{constructor({netId:e,provider:a,graphApi:t,subgraphName:c,Tornado:f,type:d,amount:r,currency:i,deployedBlock:b,fetchDataOptions:o,tovarishClient:s}){super({netId:e,provider:a,graphApi:t,subgraphName:c,contract:f,type:d,deployedBlock:b,fetchDataOptions:o,tovarishClient:s}),this.amount=r,this.currency=i,this.batchTransactionService=new n.AF({provider:a,onProgress:this.updateTransactionProgress}),this.batchBlockService=new n.B3({provider:a,onProgress:this.updateBlockProgress})}getInstanceName(){return`${this.getType().toLowerCase()}s_${this.netId}_${this.currency}_${this.amount}`}getGraphMethod(){return`getAll${this.getType()}s`}getGraphParams(){return{graphApi:this.graphApi||"",subgraphName:this.subgraphName||"",amount:this.amount,currency:this.currency,fetchDataOptions:this.fetchDataOptions,onProgress:this.updateGraphProgress}}formatEvents(e){return w(this,null,(function*(){if(this.getType().toLowerCase()===_){const a=e.map((({blockNumber:e,index:a,transactionHash:t,args:c})=>{const{commitment:f,leafIndex:d,timestamp:r}=c;return{blockNumber:e,logIndex:a,transactionHash:t,commitment:f,leafIndex:Number(d),timestamp:Number(r)}})),t=yield this.batchTransactionService.getBatchTransactions([...new Set(a.map((({transactionHash:e})=>e)))]);return a.map((e=>{const{from:a}=t.find((({hash:a})=>a===e.transactionHash));return A(y({},e),{from:a})}))}{const a=e.map((({blockNumber:e,index:a,transactionHash:t,args:f})=>{const{nullifierHash:d,to:r,fee:n}=f;return{blockNumber:e,logIndex:a,transactionHash:t,nullifierHash:String(d),to:(0,c.b)(r),fee:String(n)}})),t=yield this.batchBlockService.getBatchBlocks([...new Set(a.map((({blockNumber:e})=>e)))]);return a.map((e=>{const{timestamp:a}=t.find((({number:a})=>a===e.blockNumber));return A(y({},e),{timestamp:a})}))}}))}validateEvents({events:e}){if(e.length&&this.getType().toLowerCase()===_){const a=e[e.length-1];if(a.leafIndex!==e.length-1){const t=`Deposit events invalid wants ${e.length-1} leafIndex have ${a.leafIndex}`;throw new Error(t)}}}getLatestEvents(e){return w(this,arguments,(function*({fromBlock:e}){var a;if(null==(a=this.tovarishClient)?void 0:a.selectedRelayer){const{events:a,lastSyncBlock:t}=yield this.tovarishClient.getEvents({type:this.getTovarishType(),currency:this.currency,amount:this.amount,fromBlock:e});return{events:a,lastBlock:t}}return v(C.prototype,this,"getLatestEvents").call(this,{fromBlock:e})}))}}class M extends E{constructor({netId:e,provider:a,graphApi:t,subgraphName:c,Echoer:f,deployedBlock:d,fetchDataOptions:r,tovarishClient:n}){super({netId:e,provider:a,graphApi:t,subgraphName:c,contract:f,deployedBlock:d,fetchDataOptions:r,tovarishClient:n})}getInstanceName(){return`echo_${this.netId}`}getType(){return"Echo"}getGraphMethod(){return"getAllGraphEchoEvents"}formatEvents(e){return w(this,null,(function*(){return e.map((({blockNumber:e,index:a,transactionHash:t,args:c})=>{const{who:f,data:d}=c;if(f&&d)return A(y({},{blockNumber:e,logIndex:a,transactionHash:t}),{address:f,encryptedAccount:d})})).filter((e=>e))}))}getEventsFromGraph(e){return w(this,arguments,(function*({fromBlock:e}){return!this.graphApi||this.graphApi.includes("api.thegraph.com")?{events:[],lastBlock:e}:v(M.prototype,this,"getEventsFromGraph").call(this,{fromBlock:e})}))}}class B extends E{constructor({netId:e,provider:a,graphApi:t,subgraphName:c,Router:f,deployedBlock:d,fetchDataOptions:r,tovarishClient:n}){super({netId:e,provider:a,graphApi:t,subgraphName:c,contract:f,deployedBlock:d,fetchDataOptions:r,tovarishClient:n})}getInstanceName(){return`encrypted_notes_${this.netId}`}getType(){return"EncryptedNote"}getTovarishType(){return"encrypted_notes"}getGraphMethod(){return"getAllEncryptedNotes"}formatEvents(e){return w(this,null,(function*(){return e.map((({blockNumber:e,index:a,transactionHash:t,args:c})=>{const{encryptedNote:f}=c;if(f&&"0x"!==f)return A(y({},{blockNumber:e,logIndex:a,transactionHash:t}),{encryptedNote:f})})).filter((e=>e))}))}}class L extends E{constructor({netId:e,provider:a,graphApi:t,subgraphName:c,Governance:f,deployedBlock:d,fetchDataOptions:r,tovarishClient:i}){super({netId:e,provider:a,graphApi:t,subgraphName:c,contract:f,deployedBlock:d,fetchDataOptions:r,tovarishClient:i}),this.batchTransactionService=new n.AF({provider:a,onProgress:this.updateTransactionProgress})}getInstanceName(){return`governance_${this.netId}`}getType(){return"*"}getTovarishType(){return"governance"}getGraphMethod(){return"getAllGovernanceEvents"}formatEvents(e){return w(this,null,(function*(){const a=[],t=[],c=[],f=[];if(e.forEach((({blockNumber:e,index:d,transactionHash:r,args:n,eventName:i})=>{const b={blockNumber:e,logIndex:d,transactionHash:r,event:i};if("ProposalCreated"===i){const{id:e,proposer:t,target:c,startTime:f,endTime:d,description:r}=n;a.push(A(y({},b),{id:Number(e),proposer:t,target:c,startTime:Number(f),endTime:Number(d),description:r}))}if("Voted"===i){const{proposalId:e,voter:a,support:c,votes:f}=n;t.push(A(y({},b),{proposalId:Number(e),voter:a,support:c,votes:f,from:"",input:""}))}if("Delegated"===i){const{account:e,to:a}=n;c.push(A(y({},b),{account:e,delegateTo:a}))}if("Undelegated"===i){const{account:e,from:a}=n;f.push(A(y({},b),{account:e,delegateFrom:a}))}})),t.length){this.updateTransactionProgress({percentage:0});const e=yield this.batchTransactionService.getBatchTransactions([...new Set(t.map((({transactionHash:e})=>e)))]);t.forEach(((a,c)=>{let{data:f,from:d}=e.find((e=>e.hash===a.transactionHash));(!f||f.length>2048)&&(f=""),t[c].from=d,t[c].input=f}))}return[...a,...t,...c,...f]}))}getEventsFromGraph(e){return w(this,arguments,(function*({fromBlock:e}){return this.graphApi&&this.subgraphName&&!this.graphApi.includes("api.thegraph.com")?v(L.prototype,this,"getEventsFromGraph").call(this,{fromBlock:e}):{events:[],lastBlock:e}}))}}function S(e,a){return w(this,null,(function*(){yield Promise.all(a.filter((e=>e.tovarishHost)).map((a=>w(this,null,(function*(){var t,c;try{a.tovarishNetworks=yield(0,i.Fd)(a.tovarishHost,A(y({},e.fetchDataOptions),{headers:{"Content-Type":"application/json"},timeout:(null==(t=e.fetchDataOptions)?void 0:t.torPort)?1e4:3e3,maxRetry:(null==(c=e.fetchDataOptions)?void 0:c.torPort)?2:0}))}catch(e){a.tovarishNetworks=[]}})))))}))}class k extends E{constructor({netId:e,provider:a,graphApi:t,subgraphName:c,RelayerRegistry:f,Aggregator:d,relayerEnsSubdomains:r,deployedBlock:n,fetchDataOptions:i,tovarishClient:b}){super({netId:e,provider:a,graphApi:t,subgraphName:c,contract:f,deployedBlock:n,fetchDataOptions:i,tovarishClient:b}),this.Aggregator=d,this.relayerEnsSubdomains=r,this.updateInterval=86400}getInstanceName(){return`registered_${this.netId}`}getType(){return"RelayerRegistered"}getTovarishType(){return"registered"}getGraphMethod(){return"getAllRegisters"}formatEvents(e){return w(this,null,(function*(){return e.map((({blockNumber:e,index:a,transactionHash:t,args:c})=>A(y({},{blockNumber:e,logIndex:a,transactionHash:t}),{ensName:c.ensName,relayerAddress:c.relayerAddress})))}))}getRelayersFromDB(){return w(this,null,(function*(){return{lastBlock:0,timestamp:0,relayers:[]}}))}getRelayersFromCache(){return w(this,null,(function*(){return{lastBlock:0,timestamp:0,relayers:[],fromCache:!0}}))}getSavedRelayers(){return w(this,null,(function*(){let e=yield this.getRelayersFromDB();return e&&e.relayers.length||(e=yield this.getRelayersFromCache()),e}))}getLatestRelayers(){return w(this,null,(function*(){const{events:e,lastBlock:a}=yield this.updateEvents(),t=Object.values(this.relayerEnsSubdomains),c=new Set,r=e.filter((({ensName:e})=>!c.has(e)&&(c.add(e),!0))),n=r.map((e=>(0,f.kM)(e.ensName))),[i,o]=yield Promise.all([this.Aggregator.relayersData.staticCall(n,t.concat("tovarish-relayer")),this.provider.getBlock(a).then((e=>Number(null==e?void 0:e.timestamp)))]),s=i.map((({owner:e,balance:a,records:t,isRegistered:c},f)=>{const{ensName:n,relayerAddress:i}=r[f];let o;const s=t.reduce(((e,a,c)=>{if(a){if(c===t.length-1)return o=a,e;e[Number(Object.keys(this.relayerEnsSubdomains)[c])]=a}return e}),{}),l=!i||i===e,u=a>=b.pO;if(Object.keys(s).length&&l&&c&&u)return{ensName:n,relayerAddress:i,isRegistered:c,owner:e,stakeBalance:(0,d.ck)(a),hostnames:s,tovarishHost:o}})).filter((e=>e));return yield S(this,s),{lastBlock:a,timestamp:o,relayers:s}}))}saveRelayers(e){return w(this,arguments,(function*({lastBlock:e,timestamp:a,relayers:t}){}))}updateRelayers(){return w(this,null,(function*(){let{lastBlock:e,timestamp:a,relayers:t,fromCache:c}=yield this.getSavedRelayers(),f=null!=c&&c;return(!t.length||a+this.updateInterval{"use strict";t.r(a),t.d(a,{BaseEchoService:()=>d.GS,BaseEncryptedNotesService:()=>d.O_,BaseEventsService:()=>d.uw,BaseGovernanceService:()=>d.JJ,BaseRegistryService:()=>d.cE,BaseTornadoService:()=>d.e0,DEPOSIT:()=>d.Lx,WITHDRAWAL:()=>d.oW,getTovarishNetworks:()=>d.EU});var c=t(61060),f={};for(const e in c)"default"!==e&&(f[e]=()=>c[e]);t.d(a,f);var d=t(71304)},61060:()=>{},37182:(e,a,t)=>{"use strict";t.d(a,{N:()=>d,o:()=>r});var c=t(99770),f=t(79453);function d(e,a,t=18){const c=BigInt(10**Number(t));return BigInt(e)*c/BigInt(a)}class r{constructor(e){e&&(this.ovmGasPriceOracle=e)}fetchL1OptimismFee(e){return this.ovmGasPriceOracle?(e||(e={type:0,gasLimit:1e6,nonce:1024,data:"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",gasPrice:(0,c.XS)("1","gwei"),to:"0x1111111111111111111111111111111111111111"}),this.ovmGasPriceOracle.getL1Fee.staticCall(f.Z.from(e).unsignedSerialized)):new Promise((e=>e(BigInt(0))))}defaultEthRefund(e,a){return(e?BigInt(e):(0,c.XS)("30","gwei"))*BigInt(a||1e6)}calculateTokenAmount(e,a,t){return d(e,a,t)}calculateRelayerFee({gasPrice:e,gasLimit:a=6e5,l1Fee:t=0,denomination:c,ethRefund:f=BigInt(0),tokenPriceInWei:r,tokenDecimals:n=18,relayerFeePercent:i=.33,isEth:b=!0,premiumPercent:o=20}){const s=BigInt(e)*BigInt(a)+BigInt(t),l=BigInt(c)*BigInt(Math.floor(1e4*i))/BigInt(1e6);return b?(s+l)*BigInt(o?100+o:100)/BigInt(100):(d(s+BigInt(f),r,n)+l)*BigInt(o?100+o:100)/BigInt(100)}}},52049:(e,a,t)=>{"use strict";t.r(a),t.d(a,{GET_DEPOSITS:()=>i,GET_ECHO_EVENTS:()=>s,GET_ENCRYPTED_NOTES:()=>l,GET_GOVERNANCE_APY:()=>h,GET_GOVERNANCE_EVENTS:()=>u,GET_NOTE_ACCOUNTS:()=>o,GET_REGISTERED:()=>n,GET_STATISTIC:()=>d,GET_WITHDRAWALS:()=>b,_META:()=>r,getAllDeposits:()=>P,getAllEncryptedNotes:()=>U,getAllGovernanceEvents:()=>H,getAllGraphEchoEvents:()=>F,getAllRegisters:()=>k,getAllWithdrawals:()=>O,getDeposits:()=>N,getEncryptedNotes:()=>Q,getGovernanceEvents:()=>j,getGraphEchoEvents:()=>D,getMeta:()=>L,getNoteAccounts:()=>T,getRegisters:()=>S,getStatistic:()=>B,getWithdrawals:()=>R,queryGraph:()=>M});var c=t(30031),f=t(68434);const d="\n query getStatistic($currency: String!, $amount: String!, $first: Int, $orderBy: BigInt, $orderDirection: String) {\n deposits(first: $first, orderBy: $orderBy, orderDirection: $orderDirection, where: { currency: $currency, amount: $amount }) {\n index\n timestamp\n blockNumber\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",r="\n query getMeta {\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",n="\n query getRegistered($first: Int, $fromBlock: Int) {\n relayers(first: $first, orderBy: blockRegistration, orderDirection: asc, where: {\n blockRegistration_gte: $fromBlock\n }) {\n id\n address\n ensName\n blockRegistration\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",i="\n query getDeposits($currency: String!, $amount: String!, $first: Int, $fromBlock: Int) {\n deposits(first: $first, orderBy: index, orderDirection: asc, where: { \n amount: $amount,\n currency: $currency,\n blockNumber_gte: $fromBlock\n }) {\n id\n blockNumber\n commitment\n index\n timestamp\n from\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",b="\n query getWithdrawals($currency: String!, $amount: String!, $first: Int, $fromBlock: Int!) {\n withdrawals(first: $first, orderBy: blockNumber, orderDirection: asc, where: { \n currency: $currency,\n amount: $amount,\n blockNumber_gte: $fromBlock\n }) {\n id\n blockNumber\n nullifier\n to\n fee\n timestamp\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",o="\n query getNoteAccount($address: String!) {\n noteAccounts(where: { address: $address }) {\n id\n index\n address\n encryptedAccount\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",s="\n query getNoteAccounts($first: Int, $fromBlock: Int) {\n noteAccounts(first: $first, orderBy: blockNumber, orderDirection: asc, where: { blockNumber_gte: $fromBlock }) {\n id\n blockNumber\n address\n encryptedAccount\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",l="\n query getEncryptedNotes($first: Int, $fromBlock: Int) {\n encryptedNotes(first: $first, orderBy: blockNumber, orderDirection: asc, where: { blockNumber_gte: $fromBlock }) {\n blockNumber\n index\n transactionHash\n encryptedNote\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",u="\n query getGovernanceEvents($first: Int, $fromBlock: Int) {\n proposals(first: $first, orderBy: blockNumber, orderDirection: asc, where: { blockNumber_gte: $fromBlock }) {\n blockNumber\n logIndex\n transactionHash\n proposalId\n proposer\n target\n startTime\n endTime\n description\n }\n votes(first: $first, orderBy: blockNumber, orderDirection: asc, where: { blockNumber_gte: $fromBlock }) {\n blockNumber\n logIndex\n transactionHash\n proposalId\n voter\n support\n votes\n from\n input\n }\n delegates(first: $first, orderBy: blockNumber, orderDirection: asc, where: { blockNumber_gte: $fromBlock }) {\n blockNumber\n logIndex\n transactionHash\n account\n delegateTo\n }\n undelegates(first: $first, orderBy: blockNumber, orderDirection: asc, where: { blockNumber_gte: $fromBlock }) {\n blockNumber\n logIndex\n transactionHash\n account\n delegateFrom\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",h="\n stakeDailyBurns(first: 30, orderBy: date, orderDirection: desc) {\n id\n date\n dailyAmountBurned\n }\n";var p=Object.defineProperty,g=Object.defineProperties,m=Object.getOwnPropertyDescriptors,x=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,v=(e,a,t)=>a in e?p(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,w=(e,a)=>{for(var t in a||(a={}))y.call(a,t)&&v(e,t,a[t]);if(x)for(var t of x(a))A.call(a,t)&&v(e,t,a[t]);return e},_=(e,a)=>g(e,m(a)),I=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));const E=e=>!Array.isArray(e)||!e.length,C=1e3;function M(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,query:t,variables:c,fetchDataOptions:d}){var r;const n=`${e}/subgraphs/name/${a}`,{data:i,errors:b}=yield(0,f.Fd)(n,_(w({},d),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:t,variables:c})}));if(b)throw new Error(JSON.stringify(b));if(null==(r=null==i?void 0:i._meta)?void 0:r.hasIndexingErrors)throw new Error("Subgraph has indexing errors");return i}))}function B(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,currency:t,amount:c,fetchDataOptions:f}){try{const{deposits:r,_meta:{block:{number:n}}}=yield M({graphApi:e,subgraphName:a,query:d,variables:{currency:t,first:10,orderBy:"index",orderDirection:"desc",amount:c},fetchDataOptions:f}),i=r.map((e=>({timestamp:Number(e.timestamp),leafIndex:Number(e.index),blockNumber:Number(e.blockNumber)}))).reverse(),[b]=i.slice(-1);return{events:i,lastSyncBlock:b&&b.blockNumber>=n?b.blockNumber+1:n}}catch(e){return console.log("Error from getStatistic query"),console.log(e),{events:[],lastSyncBlock:null}}}))}function L(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,fetchDataOptions:t}){try{const{_meta:{block:{number:c},hasIndexingErrors:f}}=yield M({graphApi:e,subgraphName:a,query:r,fetchDataOptions:t});return{lastSyncBlock:c,hasIndexingErrors:f}}catch(e){return console.log("Error from getMeta query"),console.log(e),{lastSyncBlock:null,hasIndexingErrors:null}}}))}function S({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:c}){return M({graphApi:e,subgraphName:a,query:n,variables:{first:C,fromBlock:t},fetchDataOptions:c})}function k(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:f,onProgress:d}){try{const r=[];let n=t;for(;;){let{relayers:c,_meta:{block:{number:i}}}=yield S({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:f});if(n=i,E(c))break;const[b]=c,[o]=c.slice(-1);if("function"==typeof d&&d({type:"Registers",fromBlock:Number(b.blockRegistration),toBlock:Number(o.blockRegistration),count:c.length}),c.length<900){r.push(...c);break}c=c.filter((({blockRegistration:e})=>e!==o.blockRegistration)),t=Number(o.blockRegistration),r.push(...c)}return r.length?{events:r.map((({id:e,address:a,ensName:t,blockRegistration:f})=>{const[d,r]=e.split("-");return{blockNumber:Number(f),logIndex:Number(r),transactionHash:d,ensName:t,relayerAddress:(0,c.b)(a)}})),lastSyncBlock:n}:{events:[],lastSyncBlock:n}}catch(e){return console.log("Error from getAllRegisters query"),console.log(e),{events:[],lastSyncBlock:t}}}))}function N({graphApi:e,subgraphName:a,currency:t,amount:c,fromBlock:f,fetchDataOptions:d}){return M({graphApi:e,subgraphName:a,query:i,variables:{currency:t,amount:c,first:C,fromBlock:f},fetchDataOptions:d})}function P(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,currency:t,amount:f,fromBlock:d,fetchDataOptions:r,onProgress:n}){try{const i=[];let b=d;for(;;){let{deposits:c,_meta:{block:{number:o}}}=yield N({graphApi:e,subgraphName:a,currency:t,amount:f,fromBlock:d,fetchDataOptions:r});if(b=o,E(c))break;const[s]=c,[l]=c.slice(-1);if("function"==typeof n&&n({type:"Deposits",fromBlock:Number(s.blockNumber),toBlock:Number(l.blockNumber),count:c.length}),c.length<900){i.push(...c);break}c=c.filter((({blockNumber:e})=>e!==l.blockNumber)),d=Number(l.blockNumber),i.push(...c)}if(!i.length)return{events:[],lastSyncBlock:b};const o=i.map((({id:e,blockNumber:a,commitment:t,index:f,timestamp:d,from:r})=>{const[n,i]=e.split("-");return{blockNumber:Number(a),logIndex:Number(i),transactionHash:n,commitment:t,leafIndex:Number(f),timestamp:Number(d),from:(0,c.b)(r)}})),[s]=o.slice(-1);return{events:o,lastSyncBlock:s&&s.blockNumber>=b?s.blockNumber+1:b}}catch(e){return console.log("Error from getAllDeposits query"),console.log(e),{events:[],lastSyncBlock:d}}}))}function R({graphApi:e,subgraphName:a,currency:t,amount:c,fromBlock:f,fetchDataOptions:d}){return M({graphApi:e,subgraphName:a,query:b,variables:{currency:t,amount:c,first:C,fromBlock:f},fetchDataOptions:d})}function O(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,currency:t,amount:f,fromBlock:d,fetchDataOptions:r,onProgress:n}){try{const i=[];let b=d;for(;;){let{withdrawals:c,_meta:{block:{number:o}}}=yield R({graphApi:e,subgraphName:a,currency:t,amount:f,fromBlock:d,fetchDataOptions:r});if(b=o,E(c))break;const[s]=c,[l]=c.slice(-1);if("function"==typeof n&&n({type:"Withdrawals",fromBlock:Number(s.blockNumber),toBlock:Number(l.blockNumber),count:c.length}),c.length<900){i.push(...c);break}c=c.filter((({blockNumber:e})=>e!==l.blockNumber)),d=Number(l.blockNumber),i.push(...c)}if(!i.length)return{events:[],lastSyncBlock:b};const o=i.map((({id:e,blockNumber:a,nullifier:t,to:f,fee:d,timestamp:r})=>{const[n,i]=e.split("-");return{blockNumber:Number(a),logIndex:Number(i),transactionHash:n,nullifierHash:t,to:(0,c.b)(f),fee:d,timestamp:Number(r)}})),[s]=o.slice(-1);return{events:o,lastSyncBlock:s&&s.blockNumber>=b?s.blockNumber+1:b}}catch(e){return console.log("Error from getAllWithdrawals query"),console.log(e),{events:[],lastSyncBlock:d}}}))}function T(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,address:t,fetchDataOptions:c}){try{const{noteAccounts:f,_meta:{block:{number:d}}}=yield M({graphApi:e,subgraphName:a,query:o,variables:{address:t.toLowerCase()},fetchDataOptions:c});return{events:f,lastSyncBlock:d}}catch(e){return console.log("Error from getNoteAccounts query"),console.log(e),{events:[],lastSyncBlock:null}}}))}function D({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:c}){return M({graphApi:e,subgraphName:a,query:s,variables:{first:C,fromBlock:t},fetchDataOptions:c})}function F(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:f,onProgress:d}){try{const r=[];let n=t;for(;;){let{noteAccounts:c,_meta:{block:{number:i}}}=yield D({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:f});if(n=i,E(c))break;const[b]=c,[o]=c.slice(-1);if("function"==typeof d&&d({type:"EchoEvents",fromBlock:Number(b.blockNumber),toBlock:Number(o.blockNumber),count:c.length}),c.length<900){r.push(...c);break}c=c.filter((({blockNumber:e})=>e!==o.blockNumber)),t=Number(o.blockNumber),r.push(...c)}if(!r.length)return{events:[],lastSyncBlock:n};const i=r.map((e=>{const[a,t]=e.id.split("-");return{blockNumber:Number(e.blockNumber),logIndex:Number(t),transactionHash:a,address:(0,c.b)(e.address),encryptedAccount:e.encryptedAccount}})),[b]=i.slice(-1);return{events:i,lastSyncBlock:b&&b.blockNumber>=n?b.blockNumber+1:n}}catch(e){return console.log("Error from getAllGraphEchoEvents query"),console.log(e),{events:[],lastSyncBlock:t}}}))}function Q({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:c}){return M({graphApi:e,subgraphName:a,query:l,variables:{first:C,fromBlock:t},fetchDataOptions:c})}function U(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:c,onProgress:f}){try{const d=[];let r=t;for(;;){let{encryptedNotes:n,_meta:{block:{number:i}}}=yield Q({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:c});if(r=i,E(n))break;const[b]=n,[o]=n.slice(-1);if("function"==typeof f&&f({type:"EncryptedNotes",fromBlock:Number(b.blockNumber),toBlock:Number(o.blockNumber),count:n.length}),n.length<900){d.push(...n);break}n=n.filter((({blockNumber:e})=>e!==o.blockNumber)),t=Number(o.blockNumber),d.push(...n)}if(!d.length)return{events:[],lastSyncBlock:r};const n=d.map((e=>({blockNumber:Number(e.blockNumber),logIndex:Number(e.index),transactionHash:e.transactionHash,encryptedNote:e.encryptedNote}))),[i]=n.slice(-1);return{events:n,lastSyncBlock:i&&i.blockNumber>=r?i.blockNumber+1:r}}catch(e){return console.log("Error from getAllEncryptedNotes query"),console.log(e),{events:[],lastSyncBlock:t}}}))}function j({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:c}){return M({graphApi:e,subgraphName:a,query:u,variables:{first:C,fromBlock:t},fetchDataOptions:c})}function H(e){return I(this,arguments,(function*({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:f,onProgress:d}){try{const r=[];let n=t;for(;;){const{proposals:i,votes:b,delegates:o,undelegates:s,_meta:{block:{number:l}}}=yield j({graphApi:e,subgraphName:a,fromBlock:t,fetchDataOptions:f});n=l;const u=i.length+b.length+o.length+s.length;if(0===u)break;const h=i.map((({blockNumber:e,logIndex:a,transactionHash:t,proposalId:f,proposer:d,target:r,startTime:n,endTime:i,description:b})=>({blockNumber:Number(e),logIndex:Number(a),transactionHash:t,event:"ProposalCreated",id:Number(f),proposer:(0,c.b)(d),target:(0,c.b)(r),startTime:Number(n),endTime:Number(i),description:b}))),p=b.map((({blockNumber:e,logIndex:a,transactionHash:t,proposalId:f,voter:d,support:r,votes:n,from:i,input:b})=>((!b||b.length>2048)&&(b=""),{blockNumber:Number(e),logIndex:Number(a),transactionHash:t,event:"Voted",proposalId:Number(f),voter:(0,c.b)(d),support:r,votes:n,from:(0,c.b)(i),input:b}))),g=o.map((({blockNumber:e,logIndex:a,transactionHash:t,account:f,delegateTo:d})=>({blockNumber:Number(e),logIndex:Number(a),transactionHash:t,event:"Delegated",account:(0,c.b)(f),delegateTo:(0,c.b)(d)}))),m=s.map((({blockNumber:e,logIndex:a,transactionHash:t,account:f,delegateFrom:d})=>({blockNumber:Number(e),logIndex:Number(a),transactionHash:t,event:"Undelegated",account:(0,c.b)(f),delegateFrom:(0,c.b)(d)})));let x=[...h,...p,...g,...m].sort(((e,a)=>e.blockNumber===a.blockNumber?e.logIndex-a.logIndex:e.blockNumber-a.blockNumber));if(u<900){r.push(...x);break}const[y]=x,[A]=x.slice(-1);"function"==typeof d&&d({type:"Governance Events",fromBlock:Number(y.blockNumber),toBlock:Number(A.blockNumber),count:u}),x=x.filter((({blockNumber:e})=>e!==A.blockNumber)),t=Number(A.blockNumber),r.push(...x)}const[i]=r.slice(-1);return{events:r,lastSyncBlock:i&&i.blockNumber>=n?i.blockNumber+1:n}}catch(e){return console.log("Error from getAllGovernance query"),console.log(e),{events:[],lastSyncBlock:t}}}))}},5217:(e,a,t)=>{"use strict";t.d(a,{s:()=>i});var c=t(47882),f=t(41217),d=t(67418),r=t(22901),n=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));class i{constructor({netId:e,amount:a,currency:t,Tornado:c,commitmentHex:f,merkleTreeHeight:d=20,emptyElement:r="21663839004416932945382355908790599225266501822907911457504978515578255421292",merkleWorkerPath:n}){const i=`${e}_${t}_${a}`;this.currency=t,this.amount=a,this.netId=Number(e),this.Tornado=c,this.instanceName=i,this.commitmentHex=f,this.merkleTreeHeight=d,this.emptyElement=r,this.merkleWorkerPath=n}createTree(e){return n(this,null,(function*(){const{hash:a}=yield r.f.getHash();if(this.merkleWorkerPath){console.log("Using merkleWorker\n");try{if(d.Ll){const t=new Promise(((a,t)=>{const f=new c.Worker(this.merkleWorkerPath,{workerData:{merkleTreeHeight:this.merkleTreeHeight,elements:e,zeroElement:this.emptyElement}});f.on("message",a),f.on("error",t),f.on("exit",(e=>{0!==e&&t(new Error(`Worker stopped with exit code ${e}`))}))}));return f.MerkleTree.deserialize(JSON.parse(yield t),a)}{const t=new Promise(((a,t)=>{const c=new Worker(this.merkleWorkerPath);c.onmessage=e=>{a(e.data)},c.onerror=e=>{t(e)},c.postMessage({merkleTreeHeight:this.merkleTreeHeight,elements:e,zeroElement:this.emptyElement})}));return f.MerkleTree.deserialize(JSON.parse(yield t),a)}}catch(e){console.log("merkleWorker failed, falling back to synchronous merkle tree"),console.log(e)}}return new f.MerkleTree(this.merkleTreeHeight,e,{zeroElement:this.emptyElement,hashFunction:a})}))}createPartialTree(e){return n(this,arguments,(function*({edge:e,elements:a}){const{hash:t}=yield r.f.getHash();if(this.merkleWorkerPath){console.log("Using merkleWorker\n");try{if(d.Ll){const d=new Promise(((t,f)=>{const d=new c.Worker(this.merkleWorkerPath,{workerData:{merkleTreeHeight:this.merkleTreeHeight,edge:e,elements:a,zeroElement:this.emptyElement}});d.on("message",t),d.on("error",f),d.on("exit",(e=>{0!==e&&f(new Error(`Worker stopped with exit code ${e}`))}))}));return f.PartialMerkleTree.deserialize(JSON.parse(yield d),t)}{const c=new Promise(((t,c)=>{const f=new Worker(this.merkleWorkerPath);f.onmessage=e=>{t(e.data)},f.onerror=e=>{c(e)},f.postMessage({merkleTreeHeight:this.merkleTreeHeight,edge:e,elements:a,zeroElement:this.emptyElement})}));return f.PartialMerkleTree.deserialize(JSON.parse(yield c),t)}}catch(e){console.log("merkleWorker failed, falling back to synchronous merkle tree"),console.log(e)}}return new f.PartialMerkleTree(this.merkleTreeHeight,e,a,{zeroElement:this.emptyElement,hashFunction:t})}))}verifyTree(e){return n(this,null,(function*(){console.log(`\nCreating deposit tree for ${this.netId} ${this.amount} ${this.currency.toUpperCase()} would take a while\n`),console.time("Created tree in");const a=yield this.createTree(e.map((({commitment:e})=>e)));if(console.timeEnd("Created tree in"),console.log(""),!(yield this.Tornado.isKnownRoot((0,d.$W)(BigInt(a.root))))){const e=`Deposit Event ${this.netId} ${this.amount} ${this.currency} is invalid`;throw new Error(e)}return a}))}}},22901:(e,a,t)=>{"use strict";t.d(a,{f:()=>r,p:()=>d});var c=t(90294),f=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));class d{constructor(){this.mimcPromise=this.initMimc()}initMimc(){return f(this,null,(function*(){this.sponge=yield(0,c.HI)(),this.hash=(e,a)=>{var t,c;return null==(c=this.sponge)?void 0:c.F.toString(null==(t=this.sponge)?void 0:t.multiHash([BigInt(e),BigInt(a)]))}}))}getHash(){return f(this,null,(function*(){return yield this.mimcPromise,{sponge:this.sponge,hash:this.hash}}))}}const r=new d},48486:(e,a,t)=>{"use strict";t.d(a,{C:()=>f});var c=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));function f(e,a){return c(this,null,(function*(){const t=a.map((e=>{var a,t,c;return{target:(null==(a=e.contract)?void 0:a.target)||e.address,callData:((null==(t=e.contract)?void 0:t.interface)||e.interface).encodeFunctionData(e.name,e.params),allowFailure:null!=(c=e.allowFailure)&&c}}));return(yield e.aggregate3.staticCall(t)).map(((e,t)=>{var c;const f=(null==(c=a[t].contract)?void 0:c.interface)||a[t].interface,[d,r]=e,n=d&&r&&"0x"!==r?f.decodeFunctionResult(a[t].name,r):null;return n?1===n.length?n[0]:n:null}))}))}},59499:(e,a,t)=>{"use strict";t.d(a,{AE:()=>u,Af:()=>s,RY:()=>h,Zh:()=>x,cX:()=>l,h9:()=>g,o2:()=>y,oY:()=>m,sb:()=>o,zj:()=>p,zr:()=>b});var c=Object.defineProperty,f=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(e,a,t)=>a in e?c(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,i=(e,a)=>{for(var t in a||(a={}))d.call(a,t)&&n(e,t,a[t]);if(f)for(var t of f(a))r.call(a,t)&&n(e,t,a[t]);return e},b=(e=>(e[e.MAINNET=1]="MAINNET",e[e.BSC=56]="BSC",e[e.POLYGON=137]="POLYGON",e[e.OPTIMISM=10]="OPTIMISM",e[e.ARBITRUM=42161]="ARBITRUM",e[e.GNOSIS=100]="GNOSIS",e[e.AVALANCHE=43114]="AVALANCHE",e[e.SEPOLIA=11155111]="SEPOLIA",e))(b||{});const o={1:{rpcCallRetryAttempt:15,gasPrices:{instant:80,fast:50,standard:25,low:8},nativeCurrency:"eth",currencyName:"ETH",explorerUrl:"https://etherscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Ethereum Mainnet",deployedBlock:9116966,rpcUrls:{mevblockerRPC:{name:"MevblockerRPC",url:"https://rpc.mevblocker.io"},keydonix:{name:"keydonix",url:"https://ethereum.keydonix.com/v1/mainnet"},SecureRpc:{name:"SecureRpc",url:"https://api.securerpc.com/v1"},meowrpc:{name:"Meow RPC",url:"https://eth.meowrpc.com"},stackup:{name:"Stackup RPC",url:"https://public.stackup.sh/api/v1/node/ethereum-mainnet"},oneRPC:{name:"1RPC",url:"https://1rpc.io/eth"}},multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0xd90e2f925DA726b50C4Ed8D0Fb90Ad053324F31b",echoContract:"0x9B27DD5Bb15d42DC224FCD0B7caEbBe16161Df42",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",tornContract:"0x77777FeDdddFfC19Ff86DB637967013e6C6A116C",governanceContract:"0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce",stakingRewardsContract:"0x5B3f656C80E8ddb9ec01Dd9018815576E9238c29",registryContract:"0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2",aggregatorContract:"0xE8F47A78A6D52D317D0D2FFFac56739fE14D1b49",reverseRecordsContract:"0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C",tornadoSubgraph:"tornadocash/mainnet-tornado-subgraph",registrySubgraph:"tornadocash/tornado-relayer-registry",governanceSubgraph:"tornadocash/tornado-governance",subgraphs:{},tokens:{eth:{instanceAddress:{.1:"0x12D66f87A04A9E220743712cE6d9bB1B5616B8Fc",1:"0x47CE0C6eD5B0Ce3d3A51fdb1C52DC66a7c3c2936",10:"0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF",100:"0xA160cdAB225685dA1d56aa342Ad8841c3b53f291"},symbol:"ETH",decimals:18},dai:{instanceAddress:{100:"0xD4B88Df4D29F5CedD6857912842cff3b20C8Cfa3",1e3:"0xFD8610d20aA15b7B2E3Be39B396a1bC3516c7144",1e4:"0x07687e702b410Fa43f4cB4Af7FA097918ffD2730",1e5:"0x23773E65ed146A459791799d01336DB287f25334"},tokenAddress:"0x6B175474E89094C44Da98b954EedeAC495271d0F",tokenGasLimit:7e4,symbol:"DAI",decimals:18,gasLimit:7e5},cdai:{instanceAddress:{5e3:"0x22aaA7720ddd5388A3c0A3333430953C68f1849b",5e4:"0x03893a7c7463AE47D46bc7f091665f1893656003",5e5:"0x2717c5e28cf931547B621a5dddb772Ab6A35B701",5e6:"0xD21be7248e0197Ee08E0c20D4a96DEBdaC3D20Af"},tokenAddress:"0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643",tokenGasLimit:2e5,symbol:"cDAI",decimals:8,gasLimit:7e5},usdc:{instanceAddress:{100:"0xd96f2B1c14Db8458374d9Aca76E26c3D18364307",1e3:"0x4736dCf1b7A3d580672CcE6E7c65cd5cc9cFBa9D"},tokenAddress:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",tokenGasLimit:7e4,symbol:"USDC",decimals:6,gasLimit:7e5},usdt:{instanceAddress:{100:"0x169AD27A470D064DEDE56a2D3ff727986b15D52B",1e3:"0x0836222F2B2B24A3F36f98668Ed8F0B38D1a872f"},tokenAddress:"0xdAC17F958D2ee523a2206206994597C13D831ec7",tokenGasLimit:7e4,symbol:"USDT",decimals:6,gasLimit:7e5},wbtc:{instanceAddress:{.1:"0x178169B423a011fff22B9e3F3abeA13414dDD0F1",1:"0x610B717796ad172B316836AC95a2ffad065CeaB4",10:"0xbB93e510BbCD0B7beb5A853875f9eC60275CF498"},tokenAddress:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",tokenGasLimit:7e4,symbol:"WBTC",decimals:8,gasLimit:7e5}},disabledTokens:["cdai","usdt","usdc"],relayerEnsSubdomain:"mainnet-tornado",pollInterval:15,constants:{GOVERNANCE_BLOCK:11474695,NOTE_ACCOUNT_BLOCK:11842486,ENCRYPTED_NOTES_BLOCK:12143762,REGISTRY_BLOCK:14173129,MINING_BLOCK_TIME:15}},56:{rpcCallRetryAttempt:15,gasPrices:{instant:5,fast:5,standard:5,low:5},nativeCurrency:"bnb",currencyName:"BNB",explorerUrl:"https://bscscan.com",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Binance Smart Chain",deployedBlock:8158799,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",tornadoSubgraph:"tornadocash/bsc-tornado-subgraph",subgraphs:{},rpcUrls:{bnbchain:{name:"BNB Chain",url:"https://bsc-dataseed.bnbchain.org"},ninicoin:{name:"ninicoin",url:"https://bsc-dataseed1.ninicoin.io"},nodereal:{name:"NodeReal",url:"https://binance.nodereal.io"},meowrpc:{name:"Meow RPC",url:"https://bsc.meowrpc.com"},stackup:{name:"Stackup RPC",url:"https://public.stackup.sh/api/v1/node/bsc-mainnet"},oneRPC:{name:"1RPC",url:"https://1rpc.io/bnb"}},tokens:{bnb:{instanceAddress:{.1:"0x84443CFd09A48AF6eF360C6976C5392aC5023a1F",1:"0xd47438C816c9E7f2E2888E060936a499Af9582b3",10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"},symbol:"BNB",decimals:18}},relayerEnsSubdomain:"bsc-tornado",pollInterval:10,constants:{NOTE_ACCOUNT_BLOCK:8159269,ENCRYPTED_NOTES_BLOCK:8159269}},137:{rpcCallRetryAttempt:15,gasPrices:{instant:100,fast:75,standard:50,low:30},nativeCurrency:"matic",currencyName:"MATIC",explorerUrl:"https://polygonscan.com",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Polygon (Matic) Network",deployedBlock:16257962,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",tornadoSubgraph:"tornadocash/matic-tornado-subgraph",subgraphs:{},rpcUrls:{oneRpc:{name:"1RPC",url:"https://1rpc.io/matic"},meowrpc:{name:"Meow RPC",url:"https://polygon.meowrpc.com"},stackup:{name:"Stackup RPC",url:"https://public.stackup.sh/api/v1/node/polygon-mainnet"}},tokens:{matic:{instanceAddress:{100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD",1e3:"0xdf231d99Ff8b6c6CBF4E9B9a945CBAcEF9339178",1e4:"0xaf4c0B70B2Ea9FB7487C7CbB37aDa259579fe040",1e5:"0xa5C2254e4253490C54cef0a4347fddb8f75A4998"},symbol:"MATIC",decimals:18}},relayerEnsSubdomain:"polygon-tornado",pollInterval:10,constants:{NOTE_ACCOUNT_BLOCK:16257996,ENCRYPTED_NOTES_BLOCK:16257996}},10:{rpcCallRetryAttempt:15,gasPrices:{instant:.001,fast:.001,standard:.001,low:.001},nativeCurrency:"eth",currencyName:"ETH",explorerUrl:"https://optimistic.etherscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Optimism",deployedBlock:2243689,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",ovmGasPriceOracleContract:"0x420000000000000000000000000000000000000F",tornadoSubgraph:"tornadocash/optimism-tornado-subgraph",subgraphs:{},rpcUrls:{optimism:{name:"Optimism",url:"https://mainnet.optimism.io"},meowrpc:{name:"Meow RPC",url:"https://optimism.meowrpc.com"},stackup:{name:"Stackup RPC",url:"https://public.stackup.sh/api/v1/node/optimism-mainnet"},oneRpc:{name:"1RPC",url:"https://1rpc.io/op"}},tokens:{eth:{instanceAddress:{.1:"0x84443CFd09A48AF6eF360C6976C5392aC5023a1F",1:"0xd47438C816c9E7f2E2888E060936a499Af9582b3",10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"},symbol:"ETH",decimals:18}},relayerEnsSubdomain:"optimism-tornado",pollInterval:15,constants:{NOTE_ACCOUNT_BLOCK:2243694,ENCRYPTED_NOTES_BLOCK:2243694}},42161:{rpcCallRetryAttempt:15,gasPrices:{instant:4,fast:3,standard:2.52,low:2.29},nativeCurrency:"eth",currencyName:"ETH",explorerUrl:"https://arbiscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Arbitrum One",deployedBlock:3430648,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",tornadoSubgraph:"tornadocash/arbitrum-tornado-subgraph",subgraphs:{},rpcUrls:{Arbitrum:{name:"Arbitrum RPC",url:"https://arb1.arbitrum.io/rpc"},meowrpc:{name:"Meow RPC",url:"https://arbitrum.meowrpc.com"},stackup:{name:"Stackup RPC",url:"https://public.stackup.sh/api/v1/node/arbitrum-one"},oneRpc:{name:"1rpc",url:"https://1rpc.io/arb"}},tokens:{eth:{instanceAddress:{.1:"0x84443CFd09A48AF6eF360C6976C5392aC5023a1F",1:"0xd47438C816c9E7f2E2888E060936a499Af9582b3",10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD"},symbol:"ETH",decimals:18}},relayerEnsSubdomain:"arbitrum-tornado",pollInterval:15,constants:{NOTE_ACCOUNT_BLOCK:3430605,ENCRYPTED_NOTES_BLOCK:3430605}},100:{rpcCallRetryAttempt:15,gasPrices:{instant:6,fast:5,standard:4,low:1},nativeCurrency:"xdai",currencyName:"xDAI",explorerUrl:"https://gnosisscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Gnosis Chain",deployedBlock:17754561,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",tornadoSubgraph:"tornadocash/xdai-tornado-subgraph",subgraphs:{},rpcUrls:{gnosis:{name:"Gnosis",url:"https://rpc.gnosischain.com"},blockPi:{name:"BlockPi",url:"https://gnosis.blockpi.network/v1/rpc/public"},oneRpc:{name:"1rpc",url:"https://1rpc.io/gnosis"}},tokens:{xdai:{instanceAddress:{100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD",1e3:"0xdf231d99Ff8b6c6CBF4E9B9a945CBAcEF9339178",1e4:"0xaf4c0B70B2Ea9FB7487C7CbB37aDa259579fe040",1e5:"0xa5C2254e4253490C54cef0a4347fddb8f75A4998"},symbol:"xDAI",decimals:18}},relayerEnsSubdomain:"gnosis-tornado",pollInterval:15,constants:{NOTE_ACCOUNT_BLOCK:17754564,ENCRYPTED_NOTES_BLOCK:17754564}},43114:{rpcCallRetryAttempt:15,gasPrices:{instant:225,fast:35,standard:25,low:25},nativeCurrency:"avax",currencyName:"AVAX",explorerUrl:"https://snowtrace.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Avalanche Mainnet",deployedBlock:4429818,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x0D5550d52428E7e3175bfc9550207e4ad3859b17",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",offchainOracleContract:"0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8",tornadoSubgraph:"tornadocash/avalanche-tornado-subgraph",subgraphs:{},rpcUrls:{publicRpc:{name:"Avalanche RPC",url:"https://api.avax.network/ext/bc/C/rpc"},meowRPC:{name:"Meow RPC",url:"https://avax.meowrpc.com"},oneRPC:{name:"OneRPC",url:"https://1rpc.io/avax/c"}},tokens:{avax:{instanceAddress:{10:"0x330bdFADE01eE9bF63C209Ee33102DD334618e0a",100:"0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD",500:"0xaf8d1839c3c67cf571aa74B5c12398d4901147B3"},symbol:"AVAX",decimals:18}},relayerEnsSubdomain:"avalanche-tornado",pollInterval:10,constants:{NOTE_ACCOUNT_BLOCK:4429813,ENCRYPTED_NOTES_BLOCK:4429813}},11155111:{rpcCallRetryAttempt:15,gasPrices:{instant:2,fast:2,standard:2,low:2},nativeCurrency:"eth",currencyName:"SepoliaETH",explorerUrl:"https://sepolia.etherscan.io",merkleTreeHeight:20,emptyElement:"21663839004416932945382355908790599225266501822907911457504978515578255421292",networkName:"Ethereum Sepolia",deployedBlock:5594395,multicallContract:"0xcA11bde05977b3631167028862bE2a173976CA11",routerContract:"0x1572AFE6949fdF51Cb3E0856216670ae9Ee160Ee",echoContract:"0xa75BF2815618872f155b7C4B0C81bF990f5245E4",tornContract:"0x3AE6667167C0f44394106E197904519D808323cA",governanceContract:"0xe5324cD7602eeb387418e594B87aCADee08aeCAD",stakingRewardsContract:"0x6d0018890751Efd31feb8166711B16732E2b496b",registryContract:"0x1428e5d2356b13778A13108b10c440C83011dfB8",aggregatorContract:"0x4088712AC9fad39ea133cdb9130E465d235e9642",reverseRecordsContract:"0xEc29700C0283e5Be64AcdFe8077d6cC95dE23C23",tornadoSubgraph:"tornadocash/sepolia-tornado-subgraph",subgraphs:{},rpcUrls:{sepolia:{name:"Sepolia RPC",url:"https://rpc.sepolia.org"},stackup:{name:"Stackup",url:"https://public.stackup.sh/api/v1/node/ethereum-sepolia"},onerpc:{name:"1rpc",url:"https://1rpc.io/sepolia"},ethpandaops:{name:"ethpandaops",url:"https://rpc.sepolia.ethpandaops.io"}},tokens:{eth:{instanceAddress:{.1:"0x8C4A04d872a6C1BE37964A21ba3a138525dFF50b",1:"0x8cc930096B4Df705A007c4A039BDFA1320Ed2508",10:"0x8D10d506D29Fc62ABb8A290B99F66dB27Fc43585",100:"0x44c5C92ed73dB43888210264f0C8b36Fd68D8379"},symbol:"ETH",decimals:18},dai:{instanceAddress:{100:"0x6921fd1a97441dd603a997ED6DDF388658daf754",1e3:"0x50a637770F5d161999420F7d70d888DE47207145",1e4:"0xecD649870407cD43923A816Cc6334a5bdf113621",1e5:"0x73B4BD04bF83206B6e979BE2507098F92EDf4F90"},tokenAddress:"0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357",tokenGasLimit:7e4,symbol:"DAI",decimals:18,gasLimit:7e5}},relayerEnsSubdomain:"sepolia-tornado",pollInterval:15,constants:{GOVERNANCE_BLOCK:5594395,NOTE_ACCOUNT_BLOCK:5594395,ENCRYPTED_NOTES_BLOCK:5594395,MINING_BLOCK_TIME:15}}},s=Object.values(b).filter((e=>"number"==typeof e));let l={};function u(e){s.push(...Object.keys(e).map((e=>Number(e))).filter((e=>!s.includes(e)))),l=i(i({},l),e)}function h(){const e=i(i({},o),l);return s.reduce(((a,t)=>(a[t]=e[t],a)),{})}function p(e){const a=h()[e];if(!a)throw new Error(`No config found for network ${e}!`);return a}function g(e){const{tokens:a,disabledTokens:t}=e;return Object.keys(a).filter((e=>!(null==t?void 0:t.includes(e))))}function m(e){const{tokens:a,disabledTokens:t}=e;return Object.entries(a).reduce(((e,[a,c])=>((null==t?void 0:t.includes(a))||(e[a]=c),e)),{})}function x(e,a){const{tokens:t,disabledTokens:c}=e;for(const[e,{instanceAddress:f}]of Object.entries(t))if(!(null==c?void 0:c.includes(e)))for(const[t,c]of Object.entries(f))if(c===a)return{amount:t,currency:e}}function y(){const e=h();return s.reduce(((a,t)=>(a[t]=e[t].relayerEnsSubdomain,a)),{})}},85111:(e,a,t)=>{"use strict";t.d(a,{Hr:()=>d,NO:()=>r,UB:()=>n});var c=t(90294),f=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));class d{constructor(){this.pedersenPromise=this.initPedersen()}initPedersen(){return f(this,null,(function*(){this.pedersenHash=yield(0,c.vu)(),this.babyJub=this.pedersenHash.babyJub}))}unpackPoint(e){return f(this,null,(function*(){var a,t;return yield this.pedersenPromise,null==(t=this.babyJub)?void 0:t.unpackPoint(null==(a=this.pedersenHash)?void 0:a.hash(e))}))}toStringBuffer(e){var a;return null==(a=this.babyJub)?void 0:a.F.toString(e)}}const r=new d;function n(e){return f(this,null,(function*(){const[a]=yield r.unpackPoint(e);return r.toStringBuffer(a)}))}},34525:(e,a,t)=>{"use strict";t.d(a,{T:()=>d});var c=t(99770),f=t(48486);class d{constructor(e,a,t){this.provider=e,this.multicall=a,this.oracle=t}fetchPrices(e){return a=this,t=function*(){return this.oracle?(yield(0,f.C)(this.multicall,e.map((({tokenAddress:e})=>({contract:this.oracle,name:"getRateToEth",params:[e,!0]}))))).map(((a,t)=>a*BigInt(10**e[t].decimals)/BigInt(10**18))):new Promise((a=>a(e.map((()=>(0,c.g5)("0.0001"))))))},new Promise(((e,c)=>{var f=e=>{try{r(t.next(e))}catch(e){c(e)}},d=e=>{try{r(t.throw(e))}catch(e){c(e)}},r=a=>a.done?e(a.value):Promise.resolve(a.value).then(f,d);r((t=t.apply(a,null)).next())}));var a,t}}},68434:(e,a,t)=>{"use strict";t.d(a,{D2:()=>of,Vr:()=>bf,Gd:()=>nf,nA:()=>rf,mJ:()=>Yc,hd:()=>Xc,Fd:()=>af,uY:()=>tf,WU:()=>ef,sO:()=>cf,MF:()=>ff,zr:()=>df});var c=t(74945),f=t.n(c),d=t(36212),r=t(57339),n=t(88081),i=t(87303);function b(e){return async function(e,a){(0,r.vA)(null==a||!a.cancelled,"request cancelled before sending","CANCELLED");const t=e.url.split(":")[0].toLowerCase();(0,r.vA)("http"===t||"https"===t,`unsupported protocol ${t}`,"UNSUPPORTED_OPERATION",{info:{protocol:t},operation:"request"}),(0,r.vA)("https"===t||!e.credentials||e.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let c=null;const f=new AbortController,d=setTimeout((()=>{c=(0,r.xz)("request timeout","TIMEOUT"),f.abort()}),e.timeout);a&&a.addListener((()=>{c=(0,r.xz)("request cancelled","CANCELLED"),f.abort()}));const n={method:e.method,headers:new Headers(Array.from(e)),body:e.body||void 0,signal:f.signal};let i;try{i=await fetch(e.url,n)}catch(e){if(clearTimeout(d),c)throw c;throw e}clearTimeout(d);const b={};i.headers.forEach(((e,a)=>{b[a.toLowerCase()]=e}));const o=await i.arrayBuffer(),s=null==o?null:new Uint8Array(o);return{statusCode:i.status,statusMessage:i.statusText,headers:b,body:s}}}b();let o=b();const s=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),l=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let u=!1;async function h(e,a){try{const a=e.match(s);if(!a)throw new Error("invalid data");return new v(200,"OK",{"content-type":a[1]||"text/plain"},a[2]?function(e){e=atob(e);const a=new Uint8Array(e.length);for(let t=0;tString.fromCharCode(parseInt(a,16)))))))}catch(a){return new v(599,"BAD REQUEST (invalid data: URI)",{},null,new A(e))}var t}function p(e){return async function(a,t){try{const t=a.match(l);if(!t)throw new Error("invalid link");return new A(`${e}${t[2]}`)}catch(e){return new v(599,"BAD REQUEST (invalid IPFS URI)",{},null,new A(a))}}}const g={data:h,ipfs:p("https://gateway.ipfs.io/ipfs/")},m=new WeakMap;class x{#e;#a;constructor(e){this.#e=[],this.#a=!1,m.set(e,(()=>{if(!this.#a){this.#a=!0;for(const e of this.#e)setTimeout((()=>{e()}),0);this.#e=[]}}))}addListener(e){(0,r.vA)(!this.#a,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#e.push(e)}get cancelled(){return this.#a}checkSignal(){(0,r.vA)(!this.cancelled,"cancelled","CANCELLED",{})}}function y(e){if(null==e)throw new Error("missing signal; should not happen");return e.checkSignal(),e}class A{#t;#c;#f;#d;#r;#n;#i;#b;#o;#s;#l;#u;#h;#p;#g;get url(){return this.#n}set url(e){this.#n=String(e)}get body(){return null==this.#i?null:new Uint8Array(this.#i)}set body(e){if(null==e)this.#i=void 0,this.#b=void 0;else if("string"==typeof e)this.#i=(0,i.YW)(e),this.#b="text/plain";else if(e instanceof Uint8Array)this.#i=e,this.#b="application/octet-stream";else{if("object"!=typeof e)throw new Error("invalid body");this.#i=(0,i.YW)(JSON.stringify(e)),this.#b="application/json"}}hasBody(){return null!=this.#i}get method(){return this.#d?this.#d:this.hasBody()?"POST":"GET"}set method(e){null==e&&(e=""),this.#d=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#f);return this.#o&&(e.authorization=`Basic ${function(e){const a=(0,d.q5)(e);let t="";for(let e=0;e{if(t=0,"timeout must be non-zero","timeout",e),this.#r=e}get preflightFunc(){return this.#s||null}set preflightFunc(e){this.#s=e}get processFunc(){return this.#l||null}set processFunc(e){this.#l=e}get retryFunc(){return this.#u||null}set retryFunc(e){this.#u=e}get getUrlFunc(){return this.#g||o}set getUrlFunc(e){this.#g=e}constructor(e){this.#n=String(e),this.#t=!1,this.#c=!0,this.#f={},this.#d="",this.#r=3e5,this.#p={slotInterval:250,maxAttempts:12},this.#g=null}toString(){return``}setThrottleParams(e){null!=e.slotInterval&&(this.#p.slotInterval=e.slotInterval),null!=e.maxAttempts&&(this.#p.maxAttempts=e.maxAttempts)}async#m(e,a,t,c,f){if(e>=this.#p.maxAttempts)return f.makeServerError("exceeded maximum retry limit");(0,r.vA)(w()<=a,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:c}),t>0&&await function(e){return new Promise((a=>setTimeout(a,e)))}(t);let d=this.clone();const n=(d.url.split(":")[0]||"").toLowerCase();if(n in g){const e=await g[n](d.url,y(c.#h));if(e instanceof v){let a=e;if(this.processFunc){y(c.#h);try{a=await this.processFunc(d,a)}catch(e){null!=e.throttle&&"number"==typeof e.stall||a.makeServerError("error in post-processing function",e).assertOk()}}return a}d=e}this.preflightFunc&&(d=await this.preflightFunc(d));const i=await this.getUrlFunc(d,y(c.#h));let b=new v(i.statusCode,i.statusMessage,i.headers,i.body,c);if(301===b.statusCode||302===b.statusCode){try{const t=b.headers.location||"";return d.redirect(t).#m(e+1,a,0,c,b)}catch(e){}return b}if(429===b.statusCode&&(null==this.retryFunc||await this.retryFunc(d,b,e))){const t=b.headers["retry-after"];let f=this.#p.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return"string"==typeof t&&t.match(/^[1-9][0-9]*$/)&&(f=parseInt(t)),d.clone().#m(e+1,a,f,c,b)}if(this.processFunc){y(c.#h);try{b=await this.processFunc(d,b)}catch(t){null!=t.throttle&&"number"==typeof t.stall||b.makeServerError("error in post-processing function",t).assertOk();let f=this.#p.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return t.stall>=0&&(f=t.stall),d.clone().#m(e+1,a,f,c,b)}}return b}send(){return(0,r.vA)(null==this.#h,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#h=new x(this),this.#m(0,w()+this.timeout,0,this,new v(0,"",{},null,this))}cancel(){(0,r.vA)(null!=this.#h,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=m.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const a=this.url.split(":")[0].toLowerCase(),t=e.split(":")[0].toLowerCase();(0,r.vA)("GET"===this.method&&("https"!==a||"http"!==t)&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const c=new A(e);return c.method="GET",c.allowGzip=this.allowGzip,c.timeout=this.timeout,c.#f=Object.assign({},this.#f),this.#i&&(c.#i=new Uint8Array(this.#i)),c.#b=this.#b,c}clone(){const e=new A(this.url);return e.#d=this.#d,this.#i&&(e.#i=this.#i),e.#b=this.#b,e.#f=Object.assign({},this.#f),e.#o=this.#o,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#s=this.#s,e.#l=this.#l,e.#u=this.#u,e.#p=Object.assign({},this.#p),e.#g=this.#g,e}static lockConfig(){u=!0}static getGateway(e){return g[e.toLowerCase()]||null}static registerGateway(e,a){if("http"===(e=e.toLowerCase())||"https"===e)throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(u)throw new Error("gateways locked");g[e]=a}static registerGetUrl(e){if(u)throw new Error("gateways locked");o=e}static createGetUrlFunc(e){return b()}static createDataGateway(){return h}static createIpfsGatewayFunc(e){return p(e)}}class v{#x;#y;#f;#i;#A;#v;toString(){return``}get statusCode(){return this.#x}get statusMessage(){return this.#y}get headers(){return Object.assign({},this.#f)}get body(){return null==this.#i?null:new Uint8Array(this.#i)}get bodyText(){try{return null==this.#i?"":(0,i._v)(this.#i)}catch(e){(0,r.vA)(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){(0,r.vA)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,a=Object.keys(e);let t=0;return{next:()=>{if(t(e[a.toLowerCase()]=String(t[a]),e)),{}),this.#i=null==c?null:new Uint8Array(c),this.#A=f||null,this.#v={message:""}}makeServerError(e,a){let t;t=e?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:`CLIENT ESCALATED SERVER ERROR (${e=`${this.statusCode} ${this.statusMessage}`})`;const c=new v(599,t,this.headers,this.body,this.#A||void 0);return c.#v={message:e,error:a},c}throwThrottleError(e,a){null==a?a=-1:(0,r.MR)(Number.isInteger(a)&&a>=0,"invalid stall timeout","stall",a);const t=new Error(e||"throttling requests");throw(0,n.n)(t,{stall:a,throttle:!0}),t}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return null!=this.#i}get request(){return this.#A}ok(){return""===this.#v.message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:a}=this.#v;""===e&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let t=null;this.request&&(t=this.request.url);let c=null;try{this.#i&&(c=(0,i._v)(this.#i))}catch(e){}(0,r.vA)(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:a,info:{requestUrl:t,responseBody:c,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function w(){return(new Date).getTime()}var _=t(35273),I=t(30031),E=t(41442),C=t(15539),M=t(27033),B=t(38264);const L=new Uint8Array(32);L.fill(0);const S=BigInt(-1),k=BigInt(0),N=BigInt(1),P=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),R=(0,M.up)(N,32),O=(0,M.up)(k,32),T={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},D=["name","version","chainId","verifyingContract","salt"];function F(e){return function(a){return(0,r.MR)("string"==typeof a,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,a),a}}const Q={name:F("name"),version:F("version"),chainId:function(e){const a=(0,M.Ab)(e,"domain.chainId");return(0,r.MR)(a>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(a)?Number(a):(0,M.nD)(a)},verifyingContract:function(e){try{return(0,I.b)(e).toLowerCase()}catch(e){}(0,r.MR)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const a=(0,d.q5)(e,"domain.salt");return(0,r.MR)(32===a.length,'invalid domain value "salt"',"domain.salt",e),(0,d.c$)(a)}};function U(e){{const a=e.match(/^(u?)int(\d+)$/);if(a){const t=""===a[1],c=parseInt(a[2]);(0,r.MR)(c%8==0&&0!==c&&c<=256&&a[2]===String(c),"invalid numeric width","type",e);const f=(0,M.dK)(P,t?c-1:c),d=t?(f+N)*S:k;return function(a){const c=(0,M.Ab)(a,"value");return(0,r.MR)(c>=d&&c<=f,`value out-of-bounds for ${e}`,"value",c),(0,M.up)(t?(0,M.JJ)(c,256):c,32)}}}{const a=e.match(/^bytes(\d+)$/);if(a){const t=parseInt(a[1]);return(0,r.MR)(0!==t&&t<=32&&a[1]===String(t),"invalid bytes width","type",e),function(a){const c=(0,d.q5)(a);return(0,r.MR)(c.length===t,`invalid length for ${e}`,"value",a),function(e){const a=(0,d.q5)(e),t=a.length%32;return t?(0,d.xW)([a,L.slice(t)]):(0,d.c$)(a)}(a)}}}switch(e){case"address":return function(e){return(0,d.nx)((0,I.b)(e),32)};case"bool":return function(e){return e?R:O};case"bytes":return function(e){return(0,C.S)(e)};case"string":return function(e){return(0,B.id)(e)}}return null}function j(e,a){return`${e}(${a.map((({name:e,type:a})=>a+" "+e)).join(",")})`}function H(e){const a=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return a?{base:a[1],index:a[2]+a[4],array:{base:a[1],prefix:a[1]+a[2],count:a[5]?parseInt(a[5]):-1}}:{base:e}}class ${primaryType;#w;get types(){return JSON.parse(this.#w)}#_;#I;constructor(e){this.#_=new Map,this.#I=new Map;const a=new Map,t=new Map,c=new Map,f={};Object.keys(e).forEach((d=>{f[d]=e[d].map((({name:a,type:t})=>{let{base:c,index:f}=H(t);return"int"!==c||e.int||(c="int256"),"uint"!==c||e.uint||(c="uint256"),{name:a,type:c+(f||"")}})),a.set(d,new Set),t.set(d,[]),c.set(d,new Set)})),this.#w=JSON.stringify(f);for(const c in f){const d=new Set;for(const n of f[c]){(0,r.MR)(!d.has(n.name),`duplicate variable name ${JSON.stringify(n.name)} in ${JSON.stringify(c)}`,"types",e),d.add(n.name);const f=H(n.type).base;(0,r.MR)(f!==c,`circular type reference to ${JSON.stringify(f)}`,"types",e),U(f)||((0,r.MR)(t.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),t.get(f).push(c),a.get(c).add(f))}}const d=Array.from(t.keys()).filter((e=>0===t.get(e).length));(0,r.MR)(0!==d.length,"missing primary type","types",e),(0,r.MR)(1===d.length,`ambiguous primary types or unused types: ${d.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),(0,n.n)(this,{primaryType:d[0]}),function f(d,n){(0,r.MR)(!n.has(d),`circular type reference to ${JSON.stringify(d)}`,"types",e),n.add(d);for(const e of a.get(d))if(t.has(e)){f(e,n);for(const a of n)c.get(a).add(e)}n.delete(d)}(this.primaryType,new Set);for(const[e,a]of c){const t=Array.from(a);t.sort(),this.#_.set(e,j(e,f[e])+t.map((e=>j(e,f[e]))).join(""))}}getEncoder(e){let a=this.#I.get(e);return a||(a=this.#E(e),this.#I.set(e,a)),a}#E(e){{const a=U(e);if(a)return a}const a=H(e).array;if(a){const e=a.prefix,t=this.getEncoder(e);return c=>{(0,r.MR)(-1===a.count||a.count===c.length,`array length mismatch; expected length ${a.count}`,"value",c);let f=c.map(t);return this.#_.has(e)&&(f=f.map(C.S)),(0,C.S)((0,d.xW)(f))}}const t=this.types[e];if(t){const a=(0,B.id)(this.#_.get(e));return e=>{const c=t.map((({name:a,type:t})=>{const c=this.getEncoder(t)(e[a]);return this.#_.has(t)?(0,C.S)(c):c}));return c.unshift(a),(0,d.xW)(c)}}(0,r.MR)(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const a=this.#_.get(e);return(0,r.MR)(a,`unknown type: ${JSON.stringify(e)}`,"name",e),a}encodeData(e,a){return this.getEncoder(e)(a)}hashStruct(e,a){return(0,C.S)(this.encodeData(e,a))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,a,t){if(U(e))return t(e,a);const c=H(e).array;if(c)return(0,r.MR)(-1===c.count||c.count===a.length,`array length mismatch; expected length ${c.count}`,"value",a),a.map((e=>this._visit(c.prefix,e,t)));const f=this.types[e];if(f)return f.reduce(((e,{name:c,type:f})=>(e[c]=this._visit(f,a[c],t),e)),{});(0,r.MR)(!1,`unknown type: ${e}`,"type",e)}visit(e,a){return this._visit(this.primaryType,e,a)}static from(e){return new $(e)}static getPrimaryType(e){return $.from(e).primaryType}static hashStruct(e,a,t){return $.from(a).hashStruct(e,t)}static hashDomain(e){const a=[];for(const t in e){if(null==e[t])continue;const c=T[t];(0,r.MR)(c,`invalid typed-data domain key: ${JSON.stringify(t)}`,"domain",e),a.push({name:t,type:c})}return a.sort(((e,a)=>D.indexOf(e.name)-D.indexOf(a.name))),$.hashStruct("EIP712Domain",{EIP712Domain:a},e)}static encode(e,a,t){return(0,d.xW)(["0x1901",$.hashDomain(e),$.from(a).hash(t)])}static hash(e,a,t){return(0,C.S)($.encode(e,a,t))}static async resolveNames(e,a,t,c){e=Object.assign({},e);for(const a in e)null==e[a]&&delete e[a];const f={};e.verifyingContract&&!(0,d.Lo)(e.verifyingContract,20)&&(f[e.verifyingContract]="0x");const r=$.from(a);r.visit(t,((e,a)=>("address"!==e||(0,d.Lo)(a,20)||(f[a]="0x"),a)));for(const e in f)f[e]=await c(e);return e.verifyingContract&&f[e.verifyingContract]&&(e.verifyingContract=f[e.verifyingContract]),{domain:e,value:t=r.visit(t,((e,a)=>"address"===e&&f[a]?f[a]:a))}}static getPayload(e,a,t){$.hashDomain(e);const c={},f=[];D.forEach((a=>{const t=e[a];null!=t&&(c[a]=Q[a](t),f.push({name:a,type:T[a]}))}));const n=$.from(a);a=n.types;const i=Object.assign({},a);return(0,r.MR)(null==i.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",a),i.EIP712Domain=f,n.encode(t),{types:i,domain:c,primaryType:n.primaryType,message:n.visit(t,((e,a)=>{if(e.match(/^bytes(\d*)/))return(0,d.c$)((0,d.q5)(a));if(e.match(/^u?int/))return(0,M.Ab)(a).toString();switch(e){case"address":return a.toLowerCase();case"bool":return!!a;case"string":return(0,r.MR)("string"==typeof a,"invalid string","value",a),a}(0,r.MR)(!1,"unsupported type","type",e)}))}}}var q=t(8177),G=t(98982),z=t(24391),K=t(64563),V=t(79453),Z=t(99381);const J="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let W=null;function Y(e){if(null==W){W={};for(let e=0;e<58;e++)W[J[e]]=BigInt(e)}const a=W[e];return(0,r.MR)(null!=a,"invalid base58 value","letter",e),a}const X=BigInt(0),ee=BigInt(58);function ae(e){const a=(0,d.q5)(e);let t=(0,M.Dg)(a),c="";for(;t;)c=J[Number(t%ee)]+c,t/=ee;for(let e=0;e{try{return await this.#M.supportsInterface("0x9061b923")}catch(e){if((0,r.bJ)(e,"CALL_EXCEPTION"))return!1;throw this.#C=null,e}})()),await this.#C}async#B(e,a){a=(a||[]).slice();const t=this.#M.interface;a.unshift((0,K.kM)(this.name));let c=null;await this.supportsWildcard()&&(c=t.getFunction(e),(0,r.vA)(c,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),a=[(0,K.Wh)(this.name,255),t.encodeFunctionData(c,a)],e="resolve(bytes,bytes)"),a.push({enableCcipRead:!0});try{const f=await this.#M[e](...a);return c?t.decodeFunctionResult(c,f)[0]:f}catch(e){if(!(0,r.bJ)(e,"CALL_EXCEPTION"))throw e}return null}async getAddress(e){if(null==e&&(e=60),60===e)try{const e=await this.#B("addr(bytes32)");return null==e||e===G.j?null:e}catch(e){if((0,r.bJ)(e,"CALL_EXCEPTION"))return null;throw e}if(e>=0&&e<2147483648){let a=e+2147483648;const t=await this.#B("addr(bytes32,uint)",[a]);if((0,d.Lo)(t,20))return(0,I.b)(t)}let a=null;for(const t of this.provider.plugins)if(t instanceof ce&&t.supportsCoinType(e)){a=t;break}if(null==a)return null;const t=await this.#B("addr(bytes32,uint)",[e]);if(null==t||"0x"===t)return null;const c=await a.decodeAddress(e,t);if(null!=c)return c;(0,r.vA)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:t}})}async getText(e){const a=await this.#B("text(bytes32,string)",[e]);return null==a||"0x"===a?null:a}async getContentHash(){const e=await this.#B("contenthash(bytes32)");if(null==e||"0x"===e)return null;const a=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(a){const e="e3010170"===a[1]?"ipfs":"ipns",t=parseInt(a[4],16);if(a[5].length===2*t)return`${e}://${ae("0x"+a[2])}`}const t=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(t&&64===t[1].length)return`bzz://${t[1]}`;(0,r.vA)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const a=await this.getText("avatar");if(null==a)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:a});for(let t=0;t{if(a&&null==t)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map((a=>e(a)))}}function le(e,a){return t=>{const c={};for(const f in e){let d=f;if(a&&f in a&&!(d in t))for(const e of a[f])if(e in t){d=e;break}try{const a=e[f](t[d]);void 0!==a&&(c[f]=a)}catch(e){const a=e instanceof Error?e.message:"not-an-error";(0,r.vA)(!1,`invalid value for value.${f} (${a})`,"BAD_DATA",{value:t})}}return c}}function ue(e){return(0,r.MR)((0,d.Lo)(e,!0),"invalid data","value",e),e}function he(e){return(0,r.MR)((0,d.Lo)(e,32),"invalid hash","value",e),e}const pe=le({address:I.b,blockHash:he,blockNumber:M.WZ,data:ue,index:M.WZ,removed:oe((function(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}(0,r.MR)(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)}),!1),topics:se(he),transactionHash:he,transactionIndex:M.WZ},{index:["logIndex"]}),ge=le({hash:oe(he),parentHash:he,parentBeaconBlockRoot:oe(he,null),number:M.WZ,timestamp:M.WZ,nonce:oe(ue),difficulty:M.Ab,gasLimit:M.Ab,gasUsed:M.Ab,stateRoot:oe(he,null),receiptsRoot:oe(he,null),blobGasUsed:oe(M.Ab,null),excessBlobGas:oe(M.Ab,null),miner:oe(I.b),prevRandao:oe(he,null),extraData:ue,baseFeePerGas:oe(M.Ab)},{prevRandao:["mixHash"]}),me=le({transactionIndex:M.WZ,blockNumber:M.WZ,transactionHash:he,address:I.b,topics:se(he),data:ue,index:M.WZ,blockHash:he},{index:["logIndex"]}),xe=le({to:oe(I.b,null),from:oe(I.b,null),contractAddress:oe(I.b,null),index:M.WZ,root:oe(d.c$),gasUsed:M.Ab,blobGasUsed:oe(M.Ab,null),logsBloom:oe(ue),blockHash:he,hash:he,logs:se((function(e){return me(e)})),blockNumber:M.WZ,cumulativeGasUsed:M.Ab,effectiveGasPrice:oe(M.Ab),blobGasPrice:oe(M.Ab,null),status:oe(M.WZ),type:oe(M.WZ,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function ye(e){e.to&&(0,M.Ab)(e.to)===be&&(e.to="0x0000000000000000000000000000000000000000");const a=le({hash:he,index:oe(M.WZ,void 0),type:e=>"0x"===e||null==e?0:(0,M.WZ)(e),accessList:oe(q.$,null),blobVersionedHashes:oe(se(he,!0),null),blockHash:oe(he,null),blockNumber:oe(M.WZ,null),transactionIndex:oe(M.WZ,null),from:I.b,gasPrice:oe(M.Ab),maxPriorityFeePerGas:oe(M.Ab),maxFeePerGas:oe(M.Ab),maxFeePerBlobGas:oe(M.Ab,null),gasLimit:M.Ab,to:oe(I.b,null),value:M.Ab,nonce:M.WZ,data:ue,creates:oe(I.b,null),chainId:oe(M.Ab,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(null==a.to&&null==a.creates&&(a.creates=function(e){const a=(0,I.b)(e.from);let t=(0,M.Ab)(e.nonce,"tx.nonce").toString(16);return t="0"===t?"0x":t.length%2?"0x0"+t:"0x"+t,(0,I.b)((0,d.ZG)((0,C.S)((0,ne.R)([a,t])),12))}(a)),1!==e.type&&2!==e.type||null!=e.accessList||(a.accessList=[]),e.signature?a.signature=ie.t.from(e.signature):a.signature=ie.t.from(e),null==a.chainId){const e=a.signature.legacyChainId;null!=e&&(a.chainId=e)}return a.blockHash&&(0,M.Ab)(a.blockHash)===be&&(a.blockHash=null),a}class Ae{name;constructor(e){(0,n.n)(this,{name:e})}clone(){return new Ae(this.name)}}class ve extends Ae{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,a){null==e&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const t={effectiveBlock:e};function c(e,c){let f=(a||{})[e];null==f&&(f=c),(0,r.MR)("number"==typeof f,`invalud value for ${e}`,"costs",a),t[e]=f}c("txBase",21e3),c("txCreate",32e3),c("txDataZero",4),c("txDataNonzero",16),c("txAccessListStorageKey",1900),c("txAccessListAddress",2400),(0,n.n)(this,t)}clone(){return new ve(this.effectiveBlock,this)}}class we extends Ae{address;targetNetwork;constructor(e,a){super("org.ethers.plugins.network.Ens"),(0,n.n)(this,{address:e||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==a?1:a})}clone(){return new we(this.address,this.targetNetwork)}}class _e extends Ae{#n;#S;get url(){return this.#n}get processFunc(){return this.#S}constructor(e,a){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#n=e,this.#S=a}clone(){return this}}const Ie=new Map;class Ee{#k;#N;#P;constructor(e,a){this.#k=e,this.#N=(0,M.Ab)(a),this.#P=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#k}set name(e){this.#k=e}get chainId(){return this.#N}set chainId(e){this.#N=(0,M.Ab)(e,"chainId")}matches(e){if(null==e)return!1;if("string"==typeof e){try{return this.chainId===(0,M.Ab)(e)}catch(e){}return this.name===e}if("number"==typeof e||"bigint"==typeof e){try{return this.chainId===(0,M.Ab)(e)}catch(e){}return!1}if("object"==typeof e){if(null!=e.chainId){try{return this.chainId===(0,M.Ab)(e.chainId)}catch(e){}return!1}return null!=e.name&&this.name===e.name}return!1}get plugins(){return Array.from(this.#P.values())}attachPlugin(e){if(this.#P.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#P.set(e.name,e.clone()),this}getPlugin(e){return this.#P.get(e)||null}getPlugins(e){return this.plugins.filter((a=>a.name.split("#")[0]===e))}clone(){const e=new Ee(this.name,this.chainId);return this.plugins.forEach((a=>{e.attachPlugin(a.clone())})),e}computeIntrinsicGas(e){const a=this.getPlugin("org.ethers.plugins.network.GasCost")||new ve;let t=a.txBase;if(null==e.to&&(t+=a.txCreate),e.data)for(let c=2;c{c.attachPlugin(e)})),c};Ee.register(e,c),Ee.register(a,c),t.altNames&&t.altNames.forEach((e=>{Ee.register(e,c)}))}Be||(Be=!0,e("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),e("ropsten",3,{ensNetwork:3}),e("rinkeby",4,{ensNetwork:4}),e("goerli",5,{ensNetwork:5}),e("kovan",42,{ensNetwork:42}),e("sepolia",11155111,{ensNetwork:11155111}),e("holesky",17e3,{ensNetwork:17e3}),e("classic",61,{}),e("classicKotti",6,{}),e("arbitrum",42161,{ensNetwork:1}),e("arbitrum-goerli",421613,{}),e("arbitrum-sepolia",421614,{}),e("base",8453,{ensNetwork:1}),e("base-goerli",84531,{}),e("base-sepolia",84532,{}),e("bnb",56,{ensNetwork:1}),e("bnbt",97,{}),e("linea",59144,{ensNetwork:1}),e("linea-goerli",59140,{}),e("linea-sepolia",59141,{}),e("matic",137,{ensNetwork:1,plugins:[Me("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Me("https://gasstation-testnet.polygon.technology/v2")]}),e("optimism",10,{ensNetwork:1,plugins:[]}),e("optimism-goerli",420,{}),e("optimism-sepolia",11155420,{}),e("xdai",100,{ensNetwork:1}))}(),null==e)return Ee.from("mainnet");if("number"==typeof e&&(e=BigInt(e)),"string"==typeof e||"bigint"==typeof e){const a=Ie.get(e);if(a)return a();if("bigint"==typeof e)return new Ee("unknown",e);(0,r.MR)(!1,"unknown network","network",e)}if("function"==typeof e.clone)return e.clone();if("object"==typeof e){(0,r.MR)("string"==typeof e.name&&"number"==typeof e.chainId,"invalid network object name or chainId","network",e);const a=new Ee(e.name,e.chainId);return(e.ensAddress||null!=e.ensNetwork)&&a.attachPlugin(new we(e.ensAddress,e.ensNetwork)),a}(0,r.MR)(!1,"invalid network","network",e)}static register(e,a){"number"==typeof e&&(e=BigInt(e));const t=Ie.get(e);t&&(0,r.MR)(!1,`conflicting network for ${JSON.stringify(t.name)}`,"nameOrChainId",e),Ie.set(e,a)}}function Ce(e,a){const t=String(e);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);const c=t.split(".");if(1===c.length&&c.push(""),2!==c.length)throw new Error(`invalid gwei value: ${e}`);for(;c[1].length9){let e=BigInt(c[1].substring(0,9));c[1].substring(9).match(/^0+$/)||e++,c[1]=e.toString()}return BigInt(c[0]+c[1])}function Me(e){return new _e(e,(async(e,a,t)=>{let c;t.setHeader("User-Agent","ethers");try{const[a,f]=await Promise.all([t.send(),e()]);c=a;const d=c.bodyJson.standard;return{gasPrice:f.gasPrice,maxFeePerGas:Ce(d.maxFee,9),maxPriorityFeePerGas:Ce(d.maxPriorityFee,9)}}catch(e){(0,r.vA)(!1,`error encountered with polygon gas station (${JSON.stringify(t.url)})`,"SERVER_ERROR",{request:t,response:c,error:e})}}))}let Be=!1;var Le=t(43948);function Se(e){return JSON.parse(JSON.stringify(e))}class ke{#R;#O;#T;#D;constructor(e){this.#R=e,this.#O=null,this.#T=4e3,this.#D=-2}get pollingInterval(){return this.#T}set pollingInterval(e){this.#T=e}async#F(){try{const e=await this.#R.getBlockNumber();if(-2===this.#D)return void(this.#D=e);if(e!==this.#D){for(let a=this.#D+1;a<=e;a++){if(null==this.#O)return;await this.#R.emit("block",a)}this.#D=e}}catch(e){}null!=this.#O&&(this.#O=this.#R._setTimeout(this.#F.bind(this),this.#T))}start(){this.#O||(this.#O=this.#R._setTimeout(this.#F.bind(this),this.#T),this.#F())}stop(){this.#O&&(this.#R._clearTimeout(this.#O),this.#O=null)}pause(e){this.stop(),e&&(this.#D=-2)}resume(){this.start()}}class Ne{#R;#F;#Q;constructor(e){this.#R=e,this.#Q=!1,this.#F=e=>{this._poll(e,this.#R)}}async _poll(e,a){throw new Error("sub-classes must override this")}start(){this.#Q||(this.#Q=!0,this.#F(-2),this.#R.on("block",this.#F))}stop(){this.#Q&&(this.#Q=!1,this.#R.off("block",this.#F))}pause(e){this.stop()}resume(){this.start()}}class Pe extends Ne{#U;#j;constructor(e,a){super(e),this.#U=a,this.#j=-2}pause(e){e&&(this.#j=-2),super.pause(e)}async _poll(e,a){const t=await a.getBlock(this.#U);null!=t&&(-2===this.#j?this.#j=t.number:t.number>this.#j&&(a.emit(this.#U,t.number),this.#j=t.number))}}class Re extends Ne{#H;constructor(e,a){super(e),this.#H=Se(a)}async _poll(e,a){throw new Error("@TODO")}}class Oe extends Ne{#$;constructor(e,a){super(e),this.#$=a}async _poll(e,a){const t=await a.getTransactionReceipt(this.#$);t&&a.emit(this.#$,t)}}class Te{#R;#H;#O;#Q;#D;constructor(e,a){this.#R=e,this.#H=Se(a),this.#O=this.#F.bind(this),this.#Q=!1,this.#D=-2}async#F(e){if(-2===this.#D)return;const a=Se(this.#H);a.fromBlock=this.#D+1,a.toBlock=e;const t=await this.#R.getLogs(a);if(0!==t.length)for(const e of t)this.#R.emit(this.#H,e),this.#D=e.blockNumber;else this.#D{this.#D=e})),this.#R.on("block",this.#O))}stop(){this.#Q&&(this.#Q=!1,this.#R.off("block",this.#O))}pause(e){this.stop(),e&&(this.#D=-2)}resume(){this.start()}}const De=BigInt(2);function Fe(e){return e&&"function"==typeof e.then}function Qe(e,a){return e+":"+JSON.stringify(a,((e,a)=>{if(null==a)return"null";if("bigint"==typeof a)return`bigint:${a.toString()}`;if("string"==typeof a)return a.toLowerCase();if("object"==typeof a&&!Array.isArray(a)){const e=Object.keys(a);return e.sort(),e.reduce(((e,t)=>(e[t]=a[t],e)),{})}return a}))}class Ue{name;constructor(e){(0,n.n)(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function je(e){return(e=Array.from(new Set(e).values())).sort(),e}async function He(e,a){if(null==e)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),"string"==typeof e)switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if((0,d.Lo)(e,32)){const a=e.toLowerCase();return{type:"transaction",tag:Qe("tx",{hash:a}),hash:a}}if(e.orphan){const a=e;return{type:"orphan",tag:Qe("orphan",a),filter:(t=a,JSON.parse(JSON.stringify(t)))}}var t;if(e.address||e.topics){const t=e,c={topics:(t.topics||[]).map((e=>null==e?null:Array.isArray(e)?je(e.map((e=>e.toLowerCase()))):e.toLowerCase()))};if(t.address){const e=[],f=[],r=t=>{(0,d.Lo)(t)?e.push(t):f.push((async()=>{e.push(await(0,E.tG)(t,a))})())};Array.isArray(t.address)?t.address.forEach(r):r(t.address),f.length&&await Promise.all(f),c.address=je(e.map((e=>e.toLowerCase())))}return{filter:c,tag:Qe("event",c),type:"event"}}(0,r.MR)(!1,"unknown ProviderEvent","event",e)}function $e(){return(new Date).getTime()}const qe={cacheTimeout:250,pollingInterval:4e3};class Ge{#q;#P;#G;#z;#K;#V;#Z;#J;#W;#Y;#X;#ee;constructor(e,a){if(this.#ee=Object.assign({},qe,a||{}),"any"===e)this.#V=!0,this.#K=null;else if(e){const a=Ee.from(e);this.#V=!1,this.#K=Promise.resolve(a),setTimeout((()=>{this.emit("network",a,null)}),0)}else this.#V=!1,this.#K=null;this.#J=-1,this.#Z=new Map,this.#q=new Map,this.#P=new Map,this.#G=null,this.#z=!1,this.#W=1,this.#Y=new Map,this.#X=!1}get pollingInterval(){return this.#ee.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#P.values())}attachPlugin(e){if(this.#P.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#P.set(e.name,e.connect(this)),this}getPlugin(e){return this.#P.get(e)||null}get disableCcipRead(){return this.#X}set disableCcipRead(e){this.#X=!!e}async#ae(e){const a=this.#ee.cacheTimeout;if(a<0)return await this._perform(e);const t=Qe(e.method,e);let c=this.#Z.get(t);return c||(c=this._perform(e),this.#Z.set(t,c),setTimeout((()=>{this.#Z.get(t)===c&&this.#Z.delete(t)}),a)),await c}async ccipReadFetch(e,a,t){if(this.disableCcipRead||0===t.length||null==e.to)return null;const c=e.to.toLowerCase(),f=a.toLowerCase(),d=[];for(let a=0;a=500,`response not found during CCIP fetch: ${o}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:n,errorMessage:o}}),d.push(o)}(0,r.vA)(!1,`error encountered during CCIP fetch: ${d.map((e=>JSON.stringify(e))).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:t,errorMessages:d}})}_wrapBlock(e,a){return new Le.eB(function(e){const a=ge(e);return a.transactions=e.transactions.map((e=>"string"==typeof e?e:ye(e))),a}(e),this)}_wrapLog(e,a){return new Le.tG(function(e){return pe(e)}(e),this)}_wrapTransactionReceipt(e,a){return new Le.z5(function(e){return xe(e)}(e),this)}_wrapTransactionResponse(e,a){return new Le.uI(ye(e),this)}_detectNetwork(){(0,r.vA)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){(0,r.vA)(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=(0,M.WZ)(await this.#ae({method:"getBlockNumber"}),"%response");return this.#J>=0&&(this.#J=e),e}_getAddress(e){return(0,E.tG)(e,this)}_getBlockTag(e){if(null==e)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}return(0,d.Lo)(e)?(0,d.Lo)(e,32)?e:(0,M.nD)(e):("bigint"==typeof e&&(e=(0,M.WZ)(e,"blockTag")),"number"==typeof e?e>=0?(0,M.nD)(e):this.#J>=0?(0,M.nD)(this.#J+e):this.getBlockNumber().then((a=>(0,M.nD)(a+e))):void(0,r.MR)(!1,"invalid blockTag","blockTag",e))}_getFilter(e){const a=(e.topics||[]).map((e=>null==e?null:Array.isArray(e)?je(e.map((e=>e.toLowerCase()))):e.toLowerCase())),t="blockHash"in e?e.blockHash:void 0,c=(e,c,f)=>{let d;switch(e.length){case 0:break;case 1:d=e[0];break;default:e.sort(),d=e}if(t&&(null!=c||null!=f))throw new Error("invalid filter");const r={};return d&&(r.address=d),a.length&&(r.topics=a),c&&(r.fromBlock=c),f&&(r.toBlock=f),t&&(r.blockHash=t),r};let f,d,r=[];if(e.address)if(Array.isArray(e.address))for(const a of e.address)r.push(this._getAddress(a));else r.push(this._getAddress(e.address));return"fromBlock"in e&&(f=this._getBlockTag(e.fromBlock)),"toBlock"in e&&(d=this._getBlockTag(e.toBlock)),r.filter((e=>"string"!=typeof e)).length||null!=f&&"string"!=typeof f||null!=d&&"string"!=typeof d?Promise.all([Promise.all(r),f,d]).then((e=>c(e[0],e[1],e[2]))):c(r,f,d)}_getTransactionRequest(e){const a=(0,Le.VS)(e),t=[];if(["to","from"].forEach((e=>{if(null==a[e])return;const c=(0,E.tG)(a[e],this);Fe(c)?t.push(async function(){a[e]=await c}()):a[e]=c})),null!=a.blockTag){const e=this._getBlockTag(a.blockTag);Fe(e)?t.push(async function(){a.blockTag=await e}()):a.blockTag=e}return t.length?async function(){return await Promise.all(t),a}():a}async getNetwork(){if(null==this.#K){const e=(async()=>{try{const e=await this._detectNetwork();return this.emit("network",e,null),e}catch(a){throw this.#K===e&&(this.#K=null),a}})();return this.#K=e,(await e).clone()}const e=this.#K,[a,t]=await Promise.all([e,this._detectNetwork()]);return a.chainId!==t.chainId&&(this.#V?(this.emit("network",t,a),this.#K===e&&(this.#K=Promise.resolve(t))):(0,r.vA)(!1,`network changed: ${a.chainId} => ${t.chainId} `,"NETWORK_ERROR",{event:"changed"})),a.clone()}async getFeeData(){const e=await this.getNetwork(),a=async()=>{const{_block:a,gasPrice:t,priorityFee:c}=await(0,n.k)({_block:this.#te("latest",!1),gasPrice:(async()=>{try{const e=await this.#ae({method:"getGasPrice"});return(0,M.Ab)(e,"%response")}catch(e){}return null})(),priorityFee:(async()=>{try{const e=await this.#ae({method:"getPriorityFee"});return(0,M.Ab)(e,"%response")}catch(e){}return null})()});let f=null,d=null;const r=this._wrapBlock(a,e);return r&&r.baseFeePerGas&&(d=null!=c?c:BigInt("1000000000"),f=r.baseFeePerGas*De+d),new Le.J9(t,f,d)},t=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(t){const e=new A(t.url),c=await t.processFunc(a,this,e);return new Le.J9(c.gasPrice,c.maxFeePerGas,c.maxPriorityFeePerGas)}return await a()}async estimateGas(e){let a=this._getTransactionRequest(e);return Fe(a)&&(a=await a),(0,M.Ab)(await this.#ae({method:"estimateGas",transaction:a}),"%response")}async#ce(e,a,t){(0,r.vA)(t<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:a,enableCcipRead:!0})});const c=(0,Le.VS)(e);try{return(0,d.c$)(await this._perform({method:"call",transaction:c,blockTag:a}))}catch(e){if(!this.disableCcipRead&&(0,r.E)(e)&&e.data&&t>=0&&"latest"===a&&null!=c.to&&"0x556f1830"===(0,d.ZG)(e.data,0,4)){const f=e.data,n=await(0,E.tG)(c.to,this);let i;try{i=function(e){const a={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,r.vA)((0,d.pO)(e)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const t=(0,d.ZG)(e,0,32);(0,r.vA)((0,d.ZG)(t,0,12)===(0,d.ZG)(Ye,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),a.sender=(0,d.ZG)(t,12);try{const t=[],c=(0,M.WZ)((0,d.ZG)(e,32,64)),f=(0,M.WZ)((0,d.ZG)(e,c,c+32)),r=(0,d.ZG)(e,c+32);for(let e=0;ea[e])),a}((0,d.ZG)(e.data,4))}catch(e){(0,r.vA)(!1,e.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:c,info:{data:f}})}(0,r.vA)(i.sender.toLowerCase()===n.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:f,reason:"OffchainLookup",transaction:c,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:i.errorArgs}});const b=await this.ccipReadFetch(c,i.calldata,i.urls);(0,r.vA)(null!=b,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:c,info:{data:e.data,errorArgs:i.errorArgs}});const o={to:n,data:(0,d.xW)([i.selector,We([b,i.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:o});try{const e=await this.#ce(o,a,t+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},o),result:e}),e}catch(e){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},o),error:e}),e}}throw e}}async#fe(e){const{value:a}=await(0,n.k)({network:this.getNetwork(),value:e});return a}async call(e){const{tx:a,blockTag:t}=await(0,n.k)({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#fe(this.#ce(a,t,e.enableCcipRead?0:-1))}async#de(e,a,t){let c=this._getAddress(a),f=this._getBlockTag(t);return"string"==typeof c&&"string"==typeof f||([c,f]=await Promise.all([c,f])),await this.#fe(this.#ae(Object.assign(e,{address:c,blockTag:f})))}async getBalance(e,a){return(0,M.Ab)(await this.#de({method:"getBalance"},e,a),"%response")}async getTransactionCount(e,a){return(0,M.WZ)(await this.#de({method:"getTransactionCount"},e,a),"%response")}async getCode(e,a){return(0,d.c$)(await this.#de({method:"getCode"},e,a))}async getStorage(e,a,t){const c=(0,M.Ab)(a,"position");return(0,d.c$)(await this.#de({method:"getStorage",position:c},e,t))}async broadcastTransaction(e){const{blockNumber:a,hash:t,network:c}=await(0,n.k)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),f=V.Z.from(e);if(f.hash!==t)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(f,c).replaceableTransaction(a)}async#te(e,a){if((0,d.Lo)(e,32))return await this.#ae({method:"getBlock",blockHash:e,includeTransactions:a});let t=this._getBlockTag(e);return"string"!=typeof t&&(t=await t),await this.#ae({method:"getBlock",blockTag:t,includeTransactions:a})}async getBlock(e,a){const{network:t,params:c}=await(0,n.k)({network:this.getNetwork(),params:this.#te(e,!!a)});return null==c?null:this._wrapBlock(c,t)}async getTransaction(e){const{network:a,params:t}=await(0,n.k)({network:this.getNetwork(),params:this.#ae({method:"getTransaction",hash:e})});return null==t?null:this._wrapTransactionResponse(t,a)}async getTransactionReceipt(e){const{network:a,params:t}=await(0,n.k)({network:this.getNetwork(),params:this.#ae({method:"getTransactionReceipt",hash:e})});if(null==t)return null;if(null==t.gasPrice&&null==t.effectiveGasPrice){const a=await this.#ae({method:"getTransaction",hash:e});if(null==a)throw new Error("report this; could not find tx or effectiveGasPrice");t.effectiveGasPrice=a.gasPrice}return this._wrapTransactionReceipt(t,a)}async getTransactionResult(e){const{result:a}=await(0,n.k)({network:this.getNetwork(),result:this.#ae({method:"getTransactionResult",hash:e})});return null==a?null:(0,d.c$)(a)}async getLogs(e){let a=this._getFilter(e);Fe(a)&&(a=await a);const{network:t,params:c}=await(0,n.k)({network:this.getNetwork(),params:this.#ae({method:"getLogs",filter:a})});return c.map((e=>this._wrapLog(e,t)))}_getProvider(e){(0,r.vA)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await re.fromName(this,e)}async getAvatar(e){const a=await this.getResolver(e);return a?await a.getAvatar():null}async resolveName(e){const a=await this.getResolver(e);return a?await a.getAddress():null}async lookupAddress(e){e=(0,I.b)(e);const a=(0,K.kM)(e.substring(2).toLowerCase()+".addr.reverse");try{const t=await re.getEnsAddress(this),c=new z.NZ(t,["function resolver(bytes32) view returns (address)"],this),f=await c.resolver(a);if(null==f||f===G.j)return null;const d=new z.NZ(f,["function name(bytes32) view returns (string)"],this),r=await d.name(a);return await this.resolveName(r)!==e?null:r}catch(e){if((0,r.bJ)(e,"BAD_DATA")&&"0x"===e.value)return null;if((0,r.bJ)(e,"CALL_EXCEPTION"))return null;throw e}return null}async waitForTransaction(e,a,t){const c=null!=a?a:1;return 0===c?this.getTransactionReceipt(e):new Promise((async(a,f)=>{let d=null;const n=async t=>{try{const f=await this.getTransactionReceipt(e);if(null!=f&&t-f.blockNumber+1>=c)return a(f),void(d&&(clearTimeout(d),d=null))}catch(e){console.log("EEE",e)}this.once("block",n)};null!=t&&(d=setTimeout((()=>{null!=d&&(d=null,this.off("block",n),f((0,r.xz)("timeout","TIMEOUT",{reason:"timeout"})))}),t)),n(await this.getBlockNumber())}))}async waitForBlock(e){(0,r.vA)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const a=this.#Y.get(e);a&&(a.timer&&clearTimeout(a.timer),this.#Y.delete(e))}_setTimeout(e,a){null==a&&(a=0);const t=this.#W++,c=()=>{this.#Y.delete(t),e()};if(this.paused)this.#Y.set(t,{timer:null,func:c,time:a});else{const e=setTimeout(c,a);this.#Y.set(t,{timer:e,func:c,time:$e()})}return t}_forEachSubscriber(e){for(const a of this.#q.values())e(a.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Ue(e.type);case"block":{const e=new ke(this);return e.pollingInterval=this.pollingInterval,e}case"safe":case"finalized":return new Pe(this,e.type);case"event":return new Te(this,e.filter);case"transaction":return new Oe(this,e.hash);case"orphan":return new Re(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,a){for(const t of this.#q.values())if(t.subscriber===e){t.started&&t.subscriber.stop(),t.subscriber=a,t.started&&a.start(),null!=this.#G&&a.pause(this.#G);break}}async#re(e,a){let t=await He(e,this);return"event"===t.type&&a&&a.length>0&&!0===a[0].removed&&(t=await He({orphan:"drop-log",log:a[0]},this)),this.#q.get(t.tag)||null}async#ne(e){const a=await He(e,this),t=a.tag;let c=this.#q.get(t);return c||(c={subscriber:this._getSubscriber(a),tag:t,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#q.set(t,c)),c}async on(e,a){const t=await this.#ne(e);return t.listeners.push({listener:a,once:!1}),t.started||(t.subscriber.start(),t.started=!0,null!=this.#G&&t.subscriber.pause(this.#G)),this}async once(e,a){const t=await this.#ne(e);return t.listeners.push({listener:a,once:!0}),t.started||(t.subscriber.start(),t.started=!0,null!=this.#G&&t.subscriber.pause(this.#G)),this}async emit(e,...a){const t=await this.#re(e,a);if(!t||0===t.listeners.length)return!1;const c=t.listeners.length;return t.listeners=t.listeners.filter((({listener:t,once:c})=>{const f=new Z.z(this,c?null:t,e);try{t.call(this,...a,f)}catch(e){}return!c})),0===t.listeners.length&&(t.started&&t.subscriber.stop(),this.#q.delete(t.tag)),c>0}async listenerCount(e){if(e){const a=await this.#re(e);return a?a.listeners.length:0}let a=0;for(const{listeners:e}of this.#q.values())a+=e.length;return a}async listeners(e){if(e){const a=await this.#re(e);return a?a.listeners.map((({listener:e})=>e)):[]}let a=[];for(const{listeners:e}of this.#q.values())a=a.concat(e.map((({listener:e})=>e)));return a}async off(e,a){const t=await this.#re(e);if(!t)return this;if(a){const e=t.listeners.map((({listener:e})=>e)).indexOf(a);e>=0&&t.listeners.splice(e,1)}return a&&0!==t.listeners.length||(t.started&&t.subscriber.stop(),this.#q.delete(t.tag)),this}async removeAllListeners(e){if(e){const{tag:a,started:t,subscriber:c}=await this.#ne(e);t&&c.stop(),this.#q.delete(a)}else for(const[e,{started:a,subscriber:t}]of this.#q)a&&t.stop(),this.#q.delete(e);return this}async addListener(e,a){return await this.on(e,a)}async removeListener(e,a){return this.off(e,a)}get destroyed(){return this.#z}destroy(){this.removeAllListeners();for(const e of this.#Y.keys())this._clearTimeout(e);this.#z=!0}get paused(){return null!=this.#G}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#J=-1,null!=this.#G){if(this.#G==!!e)return;(0,r.vA)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber((a=>a.pause(e))),this.#G=!!e;for(const e of this.#Y.values())e.timer&&clearTimeout(e.timer),e.time=$e()-e.time}resume(){if(null!=this.#G){this._forEachSubscriber((e=>e.resume())),this.#G=null;for(const e of this.#Y.values()){let a=e.time;a<0&&(a=0),e.time=$e(),setTimeout(e.func,a)}}}}function ze(e,a){try{const t=Ke(e,a);if(t)return(0,i._v)(t)}catch(e){}return null}function Ke(e,a){if("0x"===e)return null;try{const t=(0,M.WZ)((0,d.ZG)(e,a,a+32)),c=(0,M.WZ)((0,d.ZG)(e,t,t+32));return(0,d.ZG)(e,t+32,t+32+c)}catch(e){}return null}function Ve(e){const a=(0,M.c4)(e);if(a.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(a,32-a.length),t}function Ze(e){if(e.length%32==0)return e;const a=new Uint8Array(32*Math.ceil(e.length/32));return a.set(e),a}const Je=new Uint8Array([]);function We(e){const a=[];let t=0;for(let c=0;c((0,r.MR)(e.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),e)))}else t.from=e.getAddress();return await(0,n.k)(t)}class aa{provider;constructor(e){(0,n.n)(this,{provider:e||null})}async getNonce(e){return Xe(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await ea(this,e)}async populateTransaction(e){const a=Xe(this,"populateTransaction"),t=await ea(this,e);null==t.nonce&&(t.nonce=await this.getNonce("pending")),null==t.gasLimit&&(t.gasLimit=await this.estimateGas(t));const c=await this.provider.getNetwork();if(null!=t.chainId){const a=(0,M.Ab)(t.chainId);(0,r.MR)(a===c.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else t.chainId=c.chainId;const f=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!f?0!==t.type&&1!==t.type||!f||(0,r.MR)(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e):(0,r.MR)(!1,"eip-1559 transaction do not support gasPrice","tx",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type){const e=await a.getFeeData();(0,r.vA)(null!=e.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice)}else{const e=await a.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?((0,r.vA)(!f,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):(0,r.vA)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2!==t.type&&3!==t.type||(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return await(0,n.k)(t)}async estimateGas(e){return Xe(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Xe(this,"call").call(await this.populateCall(e))}async resolveName(e){const a=Xe(this,"resolveName");return await a.resolveName(e)}async sendTransaction(e){const a=Xe(this,"sendTransaction"),t=await this.populateTransaction(e);delete t.from;const c=V.Z.from(t);return await a.broadcastTransaction(await this.signTransaction(c))}}class ta extends aa{address;constructor(e,a){super(a),(0,n.n)(this,{address:e})}async getAddress(){return this.address}connect(e){return new ta(this.address,e)}#ie(e,a){(0,r.vA)(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:a})}async signTransaction(e){this.#ie("transactions","signTransaction")}async signMessage(e){this.#ie("messages","signMessage")}async signTypedData(e,a,t){this.#ie("typed-data","signTypedData")}}class ca{#R;#be;#O;#Q;#oe;#se;constructor(e){this.#R=e,this.#be=null,this.#O=this.#F.bind(this),this.#Q=!1,this.#oe=null,this.#se=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,a){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#F(e){try{null==this.#be&&(this.#be=this._subscribe(this.#R));let e=null;try{e=await this.#be}catch(e){if(!(0,r.bJ)(e,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==e.operation)throw e}if(null==e)return this.#be=null,void this.#R._recoverSubscriber(this,this._recover(this.#R));const a=await this.#R.getNetwork();if(this.#oe||(this.#oe=a),this.#oe.chainId!==a.chainId)throw new Error("chaid changed");if(this.#se)return;const t=await this.#R.send("eth_getFilterChanges",[e]);await this._emitResults(this.#R,t)}catch(e){console.log("@TODO",e)}this.#R.once("block",this.#O)}#le(){const e=this.#be;e&&(this.#be=null,e.then((e=>{this.#R.destroyed||this.#R.send("eth_uninstallFilter",[e])})))}start(){this.#Q||(this.#Q=!0,this.#F(-2))}stop(){this.#Q&&(this.#Q=!1,this.#se=!0,this.#le(),this.#R.off("block",this.#O))}pause(e){e&&this.#le(),this.#R.off("block",this.#O)}resume(){this.start()}}class fa extends ca{#ue;constructor(e,a){var t;super(e),this.#ue=(t=a,JSON.parse(JSON.stringify(t)))}_recover(e){return new Te(e,this.#ue)}async _subscribe(e){return await e.send("eth_newFilter",[this.#ue])}async _emitResults(e,a){for(const t of a)e.emit(this.#ue,e._wrapLog(t,e._network))}}class da extends ca{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,a){for(const t of a)e.emit("pending",t)}}const ra="bigint,boolean,function,number,string,symbol".split(/,/g);function na(e){if(null==e||ra.indexOf(typeof e)>=0)return e;if("function"==typeof e.getAddress)return e;if(Array.isArray(e))return e.map(na);if("object"==typeof e)return Object.keys(e).reduce(((a,t)=>(a[t]=e[t],a)),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function ia(e){return new Promise((a=>{setTimeout(a,e)}))}function ba(e){return e?e.toLowerCase():e}function oa(e){return e&&"number"==typeof e.pollingInterval}const sa={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class la extends aa{address;constructor(e,a){super(e),a=(0,I.b)(a),(0,n.n)(this,{address:a})}connect(e){(0,r.vA)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const a=na(e),t=[];if(a.from){const c=a.from;t.push((async()=>{const t=await(0,E.tG)(c,this.provider);(0,r.MR)(null!=t&&t.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),a.from=t})())}else a.from=this.address;if(null==a.gasLimit&&t.push((async()=>{a.gasLimit=await this.provider.estimateGas({...a,from:this.address})})()),null!=a.to){const e=a.to;t.push((async()=>{a.to=await(0,E.tG)(e,this.provider)})())}t.length&&await Promise.all(t);const c=this.provider.getRpcTransaction(a);return this.provider.send("eth_sendTransaction",[c])}async sendTransaction(e){const a=await this.provider.getBlockNumber(),t=await this.sendUncheckedTransaction(e);return await new Promise(((e,c)=>{const f=[1e3,100];let d=0;const n=async()=>{try{const c=await this.provider.getTransaction(t);if(null!=c)return void e(c.replaceableTransaction(a))}catch(e){if((0,r.bJ)(e,"CANCELLED")||(0,r.bJ)(e,"BAD_DATA")||(0,r.bJ)(e,"NETWORK_ERROR"))return null==e.info&&(e.info={}),e.info.sendTransactionHash=t,void c(e);if((0,r.bJ)(e,"INVALID_ARGUMENT")&&(d++,null==e.info&&(e.info={}),e.info.sendTransactionHash=t,d>10))return void c(e);this.provider.emit("error",(0,r.xz)("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:e}))}this.provider._setTimeout((()=>{n()}),f.pop()||4e3)};n()}))}async signTransaction(e){const a=na(e);if(a.from){const t=await(0,E.tG)(a.from,this.provider);(0,r.MR)(null!=t&&t.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),a.from=t}else a.from=this.address;const t=this.provider.getRpcTransaction(a);return await this.provider.send("eth_signTransaction",[t])}async signMessage(e){const a="string"==typeof e?(0,i.YW)(e):e;return await this.provider.send("personal_sign",[(0,d.c$)(a),this.address.toLowerCase()])}async signTypedData(e,a,t){const c=na(t),f=await $.resolveNames(e,a,c,(async e=>{const a=await(0,E.tG)(e);return(0,r.MR)(null!=a,"TypedData does not support null address","value",e),a}));return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify($.getPayload(f.domain,a,f.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const a="string"==typeof e?(0,i.YW)(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,d.c$)(a)])}}class ua extends Ge{#ee;#he;#pe;#ge;#me;#oe;#xe;#ye(){if(this.#ge)return;const e=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");this.#ge=setTimeout((()=>{this.#ge=null;const e=this.#pe;for(this.#pe=[];e.length;){const a=[e.shift()];for(;e.length&&a.length!==this.#ee.batchMaxCount;)if(a.push(e.shift()),JSON.stringify(a.map((e=>e.payload))).length>this.#ee.batchMaxSize){e.unshift(a.pop());break}(async()=>{const e=1===a.length?a[0].payload:a.map((e=>e.payload));this.emit("debug",{action:"sendRpcPayload",payload:e});try{const t=await this._send(e);this.emit("debug",{action:"receiveRpcResult",result:t});for(const{resolve:e,reject:c,payload:f}of a){if(this.destroyed){c((0,r.xz)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:f.method}));continue}const a=t.filter((e=>e.id===f.id))[0];if(null!=a)"error"in a?c(this.getRpcError(f,a)):e(a.result);else{const e=(0,r.xz)("missing response for request","BAD_DATA",{value:t,info:{payload:f}});this.emit("error",e),c(e)}}}catch(e){this.emit("debug",{action:"receiveRpcError",error:e});for(const{reject:t}of a)t(e)}})()}}),e)}constructor(e,a){super(e,a),this.#he=1,this.#ee=Object.assign({},sa,a||{}),this.#pe=[],this.#ge=null,this.#oe=null,this.#xe=null;{let e=null;const a=new Promise((a=>{e=a}));this.#me={promise:a,resolve:e}}const t=this._getOption("staticNetwork");"boolean"==typeof t?((0,r.MR)(!t||"any"!==e,"staticNetwork cannot be used on special network 'any'","options",a),t&&null!=e&&(this.#oe=Ee.from(e))):t&&((0,r.MR)(null==e||t.matches(e),"staticNetwork MUST match network object","options",a),this.#oe=t)}_getOption(e){return this.#ee[e]}get _network(){return(0,r.vA)(this.#oe,"network is not available yet","NETWORK_ERROR"),this.#oe}async _perform(e){if("call"===e.method||"estimateGas"===e.method){let a=e.transaction;if(a&&null!=a.type&&(0,M.Ab)(a.type)&&null==a.maxFeePerGas&&null==a.maxPriorityFeePerGas){const t=await this.getFeeData();null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas&&(e=Object.assign({},e,{transaction:Object.assign({},a,{type:void 0})}))}}const a=this.getRpcRequest(e);return null!=a?await this.send(a.method,a.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e){if(!0!==e)return e;if(this.#oe)return this.#oe}return this.#xe?await this.#xe:this.ready?(this.#xe=(async()=>{try{const e=Ee.from((0,M.Ab)(await this.send("eth_chainId",[])));return this.#xe=null,e}catch(e){throw this.#xe=null,e}})(),await this.#xe):(this.#xe=(async()=>{const e={id:this.#he++,method:"eth_chainId",params:[],jsonrpc:"2.0"};let a;this.emit("debug",{action:"sendRpcPayload",payload:e});try{a=(await this._send(e))[0],this.#xe=null}catch(e){throw this.#xe=null,this.emit("debug",{action:"receiveRpcError",error:e}),e}if(this.emit("debug",{action:"receiveRpcResult",result:a}),"result"in a)return Ee.from((0,M.Ab)(a.result));throw this.getRpcError(e,a)})(),await this.#xe)}_start(){null!=this.#me&&null!=this.#me.resolve&&(this.#me.resolve(),this.#me=null,(async()=>{for(;null==this.#oe&&!this.destroyed;)try{this.#oe=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",(0,r.xz)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await ia(1e3)}this.#ye()})())}async _waitUntilReady(){if(null!=this.#me)return await this.#me.promise}_getSubscriber(e){return"pending"===e.type?new da(this):"event"===e.type?this._getOption("polling")?new Te(this,e.filter):new fa(this,e.filter):"orphan"===e.type&&"drop-log"===e.filter.orphan?new Ue("orphan"):super._getSubscriber(e)}get ready(){return null==this.#me}getRpcTransaction(e){const a={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((t=>{if(null==e[t])return;let c=t;"gasLimit"===t&&(c="gas"),a[c]=(0,M.nD)((0,M.Ab)(e[t],`tx.${t}`))})),["from","to","data"].forEach((t=>{null!=e[t]&&(a[t]=(0,d.c$)(e[t]))})),e.accessList&&(a.accessList=(0,q.$)(e.accessList)),e.blobVersionedHashes&&(a.blobVersionedHashes=e.blobVersionedHashes.map((e=>e.toLowerCase()))),a}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[ba(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[ba(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[ba(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[ba(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&null!=e.filter.address&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(ba):e.filter.address=ba(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,a){const{method:t}=e,{error:c}=a;if("eth_estimateGas"===t&&c.message){const a=c.message;if(!a.match(/revert/i)&&a.match(/insufficient funds/i))return(0,r.xz)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:c}})}if("eth_call"===t||"eth_estimateGas"===t){const a=ga(c),f=_.y.getBuiltinCallException("eth_call"===t?"call":"estimateGas",e.params[0],a?a.data:null);return f.info={error:c,payload:e},f}const f=JSON.stringify(function(e){const a=[];return ma(e,a),a}(c));if("string"==typeof c.message&&c.message.match(/user denied|ethers-user-denied/i)){const a={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,r.xz)("user rejected action","ACTION_REJECTED",{action:a[t]||"unknown",reason:"rejected",info:{payload:e,error:c}})}if("eth_sendRawTransaction"===t||"eth_sendTransaction"===t){const a=e.params[0];if(f.match(/insufficient funds|base fee exceeds gas limit/i))return(0,r.xz)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:a,info:{error:c}});if(f.match(/nonce/i)&&f.match(/too low/i))return(0,r.xz)("nonce has already been used","NONCE_EXPIRED",{transaction:a,info:{error:c}});if(f.match(/replacement transaction/i)&&f.match(/underpriced/i))return(0,r.xz)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:a,info:{error:c}});if(f.match(/only replay-protected/i))return(0,r.xz)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:t,info:{transaction:a,info:{error:c}}})}let d=!!f.match(/the method .* does not exist/i);return d||c&&c.details&&c.details.startsWith("Unauthorized method:")&&(d=!0),d?(0,r.xz)("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:c,payload:e}}):(0,r.xz)("could not coalesce error","UNKNOWN_ERROR",{error:c,payload:e})}send(e,a){if(this.destroyed)return Promise.reject((0,r.xz)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const t=this.#he++,c=new Promise(((c,f)=>{this.#pe.push({resolve:c,reject:f,payload:{method:e,params:a,id:t,jsonrpc:"2.0"}})}));return this.#ye(),c}async getSigner(e){null==e&&(e=0);const a=this.send("eth_accounts",[]);if("number"==typeof e){const t=await a;if(e>=t.length)throw new Error("no such account");return new la(this,t[e])}const{accounts:t}=await(0,n.k)({network:this.getNetwork(),accounts:a});e=(0,I.b)(e);for(const a of t)if((0,I.b)(a)===e)return new la(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map((e=>new la(this,e)))}destroy(){this.#ge&&(clearTimeout(this.#ge),this.#ge=null);for(const{payload:e,reject:a}of this.#pe)a((0,r.xz)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#pe=[],super.destroy()}}class ha extends ua{#Ae;constructor(e,a){super(e,a);let t=this._getOption("pollingInterval");null==t&&(t=sa.pollingInterval),this.#Ae=t}_getSubscriber(e){const a=super._getSubscriber(e);return oa(a)&&(a.pollingInterval=this.#Ae),a}get pollingInterval(){return this.#Ae}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#Ae=e,this._forEachSubscriber((e=>{oa(e)&&(e.pollingInterval=this.#Ae)}))}}class pa extends ha{#ve;constructor(e,a,t){null==e&&(e="http://localhost:8545"),super(a,t),this.#ve="string"==typeof e?new A(e):e.clone()}_getConnection(){return this.#ve.clone()}async send(e,a){return await this._start(),await super.send(e,a)}async _send(e){const a=this._getConnection();a.body=JSON.stringify(e),a.setHeader("content-type","application/json");const t=await a.send();t.assertOk();let c=t.bodyJson;return Array.isArray(c)||(c=[c]),c}}function ga(e){if(null==e)return null;if("string"==typeof e.message&&e.message.match(/revert/i)&&(0,d.Lo)(e.data))return{message:e.message,data:e.data};if("object"==typeof e){for(const a in e){const t=ga(e[a]);if(t)return t}return null}if("string"==typeof e)try{return ga(JSON.parse(e))}catch(e){}return null}function ma(e,a){if(null!=e){if("string"==typeof e.message&&a.push(e.message),"object"==typeof e)for(const t in e)ma(e[t],a);if("string"==typeof e)try{return ma(JSON.parse(e),a)}catch(e){}}}var xa=t(15496);var ya=t(20415);class Aa extends aa{address;#we;constructor(e,a){super(a),(0,r.MR)(e&&"function"==typeof e.sign,"invalid private key","privateKey","[ REDACTED ]"),this.#we=e;const t=(0,ya.K)(this.signingKey.publicKey);(0,n.n)(this,{address:t})}get signingKey(){return this.#we}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new Aa(this.#we,e)}async signTransaction(e){e=(0,Le.VS)(e);const{to:a,from:t}=await(0,n.k)({to:e.to?(0,E.tG)(e.to,this.provider):void 0,from:e.from?(0,E.tG)(e.from,this.provider):void 0});null!=a&&(e.to=a),null!=t&&(e.from=t),null!=e.from&&((0,r.MR)((0,I.b)(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const c=V.Z.from(e);return c.signature=this.signingKey.sign(c.unsignedHash),c.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(function(e){return"string"==typeof e&&(e=(0,i.YW)(e)),(0,C.S)((0,d.xW)([(0,i.YW)("Ethereum Signed Message:\n"),(0,i.YW)(String(e.length)),e]))}(e)).serialized}async signTypedData(e,a,t){const c=await $.resolveNames(e,a,t,(async e=>{(0,r.vA)(null!=this.provider,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:e}});const a=await this.provider.resolveName(e);return(0,r.vA)(null!=a,"unconfigured ENS name","UNCONFIGURED_NAME",{value:e}),a}));return this.signingKey.sign($.hash(c.domain,a,c.value)).serialized}}var va=t(68650),wa=t(8180);let _a=!1;const Ia=function(e,a,t){return(0,wa.Gz)(e,a).update(t).digest()};let Ea=Ia;function Ca(e,a,t){const c=(0,d.q5)(a,"key"),f=(0,d.q5)(t,"data");return(0,d.c$)(Ea(e,c,f))}Ca._=Ia,Ca.lock=function(){_a=!0},Ca.register=function(e){if(_a)throw new Error("computeHmac is locked");Ea=e},Object.freeze(Ca);var Ma=t(37171),Ba=t(10750);const La=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Sa=Uint8Array.from({length:16},((e,a)=>a));let ka=[Sa],Na=[Sa.map((e=>(9*e+5)%16))];for(let e=0;e<4;e++)for(let a of[ka,Na])a.push(a[e].map((e=>La[e])));const Pa=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),Ra=ka.map(((e,a)=>e.map((e=>Pa[a][e])))),Oa=Na.map(((e,a)=>e.map((e=>Pa[a][e])))),Ta=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Da=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Fa=(e,a)=>e<>>32-a;function Qa(e,a,t,c){return 0===e?a^t^c:1===e?a&t|~a&c:2===e?(a|~t)^c:3===e?a&c|t&~c:a^(t|~c)}const Ua=new Uint32Array(16);class ja extends Ma.D{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:a,h2:t,h3:c,h4:f}=this;return[e,a,t,c,f]}set(e,a,t,c,f){this.h0=0|e,this.h1=0|a,this.h2=0|t,this.h3=0|c,this.h4=0|f}process(e,a){for(let t=0;t<16;t++,a+=4)Ua[t]=e.getUint32(a,!0);let t=0|this.h0,c=t,f=0|this.h1,d=f,r=0|this.h2,n=r,i=0|this.h3,b=i,o=0|this.h4,s=o;for(let e=0;e<5;e++){const a=4-e,l=Ta[e],u=Da[e],h=ka[e],p=Na[e],g=Ra[e],m=Oa[e];for(let a=0;a<16;a++){const c=Fa(t+Qa(e,f,r,i)+Ua[h[a]]+l,g[a])+o|0;t=o,o=i,i=0|Fa(r,10),r=f,f=c}for(let e=0;e<16;e++){const t=Fa(c+Qa(a,d,n,b)+Ua[p[e]]+u,m[e])+s|0;c=s,s=b,b=0|Fa(n,10),n=d,d=t}}this.set(this.h1+r+b|0,this.h2+i+s|0,this.h3+o+c|0,this.h4+t+d|0,this.h0+f+n|0)}roundClean(){Ua.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const Ha=(0,Ba.ld)((()=>new ja));let $a=!1;const qa=function(e){return Ha(e)};let Ga=qa;function za(e){const a=(0,d.q5)(e,"data");return(0,d.c$)(Ga(a))}za._=qa,za.lock=function(){$a=!0},za.register=function(e){if($a)throw new TypeError("ripemd160 is locked");Ga=e},Object.freeze(za);let Ka=!1;const Va=function(e){return new Uint8Array((0,wa.po)(e))};let Za=Va;function Ja(e){return Za(e)}Ja._=Va,Ja.lock=function(){Ka=!0},Ja.register=function(e){if(Ka)throw new Error("randomBytes is locked");Za=e},Object.freeze(Ja);const Wa=/^[a-z]*$/i;function Ya(e,a){let t=97;return e.reduce(((e,c)=>(c===a?t++:c.match(Wa)?e.push(String.fromCharCode(t)+c):(t=97,e.push(c)),e)),[])}class Xa{locale;constructor(e){(0,n.n)(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}class et extends Xa{#_e;#Ie;constructor(e,a,t){super(e),this.#_e=a,this.#Ie=t,this.#Ee=null}get _data(){return this.#_e}_decodeWords(){return e=this.#_e,(0,r.MR)("0"===e[0],"unsupported auwl data","data",e),function(e,a){for(let t=28;t>=0;t--)e=e.split(" !#$%&'()*+,-./<=>?@[]^_`{|}~"[t]).join(a.substring(2*t,2*t+2));const t=[],c=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,((e,a,c,f)=>{if(c)for(let e=parseInt(c);e>=0;e--)t.push(";");else t.push(a.toLowerCase());return""}));if(c)throw new Error(`leftovers: ${JSON.stringify(c)}`);return Ya(Ya(t,";"),":")}(e.substring(59),e.substring(1,59));var e}#Ee;#Ce(){if(null==this.#Ee){const e=this._decodeWords();if((0,B.id)(e.join("\n")+"\n")!==this.#Ie)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#Ee=e}return this.#Ee}getWord(e){const a=this.#Ce();return(0,r.MR)(e>=0&&eurAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}static wordlist(){return null==at&&(at=new tt),at}}let ct=!1;const ft=function(e,a,t,c,f){return(0,wa.T_)(e,a,t,c,f)};let dt=ft;function rt(e,a,t,c,f){const r=(0,d.q5)(e,"password"),n=(0,d.q5)(a,"salt");return(0,d.c$)(dt(r,n,t,c,f))}function nt(e){return(1<=12&&t.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const c=new Uint8Array(Math.ceil(11*t.length/8));let f=0;for(let e=0;e=0,`invalid mnemonic word at index ${e}`,"mnemonic","[ REDACTED ]");for(let e=0;e<11;e++)d&1<<10-e&&(c[f>>3]|=1<<7-f%8),f++}const n=32*t.length/3,i=nt(t.length/3),b=(0,d.q5)((0,va.s)(c.slice(0,n/8)))[0]&i;return(0,r.MR)(b===(c[c.length-1]&i),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,d.c$)(c.slice(0,n/8))}function bt(e,a){(0,r.MR)(e.length%4==0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),null==a&&(a=tt.wordlist());const t=[0];let c=11;for(let a=0;a8?(t[t.length-1]<<=8,t[t.length-1]|=e[a],c-=8):(t[t.length-1]<<=c,t[t.length-1]|=e[a]>>8-c,t.push(e[a]&(1<<8-c)-1&255),c+=3);const f=e.length/4,d=parseInt((0,va.s)(e).substring(2,4),16)&nt(f);return t[t.length-1]<<=f,t[t.length-1]|=d>>8-f,a.join(t.map((e=>a.getWord(e))))}rt._=ft,rt.lock=function(){ct=!0},rt.register=function(e){if(ct)throw new Error("pbkdf2 is locked");dt=e},Object.freeze(rt);const ot={};class st{phrase;password;wordlist;entropy;constructor(e,a,t,c,f){null==c&&(c=""),null==f&&(f=tt.wordlist()),(0,r.gk)(e,ot,"Mnemonic"),(0,n.n)(this,{phrase:t,password:c,wordlist:f,entropy:a})}computeSeed(){const e=(0,i.YW)("mnemonic"+this.password,"NFKD");return rt((0,i.YW)(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,a,t){const c=it(e,t);return e=bt((0,d.q5)(c),t),new st(ot,c,e,a,t)}static fromEntropy(e,a,t){const c=(0,d.q5)(e,"entropy"),f=bt(c,t);return new st(ot,(0,d.c$)(c),f,a,t)}static entropyToPhrase(e,a){return bt((0,d.q5)(e,"entropy"),a)}static phraseToEntropy(e,a){return it(e,a)}static isValidMnemonic(e,a){try{return it(e,a),!0}catch(e){}return!1}}var lt,ut,ht,pt=function(e,a,t,c){if("a"===t&&!c)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof a?e!==a||!c:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?c:"a"===t?c.call(e):c?c.value:a.get(e)},gt=function(e,a,t,c,f){if("m"===c)throw new TypeError("Private method is not writable");if("a"===c&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof a?e!==a||!f:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===c?f.call(e,t):f?f.value=t:a.set(e,t),t};const mt={16:10,24:12,32:14},xt=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],yt=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],At=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],vt=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],wt=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],_t=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],It=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Et=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Ct=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Mt=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Bt=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Lt=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],St=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],kt=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Nt=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Pt(e){const a=[];for(let t=0;t>2,pt(this,ht,"f")[d][e%4]=f[e],pt(this,ut,"f")[a-d][e%4]=f[e];let r,n=0,i=c;for(;i>16&255]<<24^yt[r>>8&255]<<16^yt[255&r]<<8^yt[r>>24&255]^xt[n]<<24,n+=1,8!=c)for(let e=1;e>8&255]<<8^yt[r>>16&255]<<16^yt[r>>24&255]<<24;for(let e=c/2+1;e>2,d=i%4,pt(this,ht,"f")[e][d]=f[b],pt(this,ut,"f")[a-e][d]=f[b++],i++}for(let e=1;e>24&255]^St[r>>16&255]^kt[r>>8&255]^Nt[255&r]}encrypt(e){if(16!=e.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const a=pt(this,ht,"f").length-1,t=[0,0,0,0];let c=Pt(e);for(let e=0;e<4;e++)c[e]^=pt(this,ht,"f")[0][e];for(let e=1;e>24&255]^wt[c[(a+1)%4]>>16&255]^_t[c[(a+2)%4]>>8&255]^It[255&c[(a+3)%4]]^pt(this,ht,"f")[e][a];c=t.slice()}const f=new Uint8Array(16);let d=0;for(let e=0;e<4;e++)d=pt(this,ht,"f")[a][e],f[4*e]=255&(yt[c[e]>>24&255]^d>>24),f[4*e+1]=255&(yt[c[(e+1)%4]>>16&255]^d>>16),f[4*e+2]=255&(yt[c[(e+2)%4]>>8&255]^d>>8),f[4*e+3]=255&(yt[255&c[(e+3)%4]]^d);return f}decrypt(e){if(16!=e.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const a=pt(this,ut,"f").length-1,t=[0,0,0,0];let c=Pt(e);for(let e=0;e<4;e++)c[e]^=pt(this,ut,"f")[0][e];for(let e=1;e>24&255]^Ct[c[(a+3)%4]>>16&255]^Mt[c[(a+2)%4]>>8&255]^Bt[255&c[(a+1)%4]]^pt(this,ut,"f")[e][a];c=t.slice()}const f=new Uint8Array(16);let d=0;for(let e=0;e<4;e++)d=pt(this,ut,"f")[a][e],f[4*e]=255&(At[c[e]>>24&255]^d>>24),f[4*e+1]=255&(At[c[(e+3)%4]>>16&255]^d>>16),f[4*e+2]=255&(At[c[(e+2)%4]>>8&255]^d>>8),f[4*e+3]=255&(At[255&c[(e+1)%4]]^d);return f}}lt=new WeakMap,ut=new WeakMap,ht=new WeakMap;class Ot{constructor(e,a,t){if(t&&!(this instanceof t))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new Rt(a)},name:{enumerable:!0,value:e}})}}var Tt,Dt,Ft=function(e,a,t,c,f){if("m"===c)throw new TypeError("Private method is not writable");if("a"===c&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof a?e!==a||!f:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===c?f.call(e,t):f?f.value=t:a.set(e,t),t},Qt=function(e,a,t,c){if("a"===t&&!c)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof a?e!==a||!c:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?c:"a"===t?c.call(e):c?c.value:a.get(e)};class Ut extends Ot{constructor(e,a){if(super("ECC",e,Ut),Tt.set(this,void 0),Dt.set(this,void 0),a){if(a.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Ft(this,Tt,new Uint8Array(a),"f")}else Ft(this,Tt,new Uint8Array(16),"f");Ft(this,Dt,this.iv,"f")}get iv(){return new Uint8Array(Qt(this,Tt,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const a=new Uint8Array(e.length);for(let t=0;tNumber.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let a=15;a>=0;--a)Gt(this,$t,"f")[a]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(16!==e.length)throw new TypeError("invalid counter initial Uint8Array value length");Gt(this,$t,"f").set(e)}increment(){for(let e=15;e>=0;e--){if(255!==Gt(this,$t,"f")[e]){Gt(this,$t,"f")[e]++;break}Gt(this,$t,"f")[e]=0}}encrypt(e){var a,t;const c=new Uint8Array(e);for(let e=0;ee<>>32-a;function Wt(e,a,t,c,f,d){let r=e[a++]^t[c++],n=e[a++]^t[c++],i=e[a++]^t[c++],b=e[a++]^t[c++],o=e[a++]^t[c++],s=e[a++]^t[c++],l=e[a++]^t[c++],u=e[a++]^t[c++],h=e[a++]^t[c++],p=e[a++]^t[c++],g=e[a++]^t[c++],m=e[a++]^t[c++],x=e[a++]^t[c++],y=e[a++]^t[c++],A=e[a++]^t[c++],v=e[a++]^t[c++],w=r,_=n,I=i,E=b,C=o,M=s,B=l,L=u,S=h,k=p,N=g,P=m,R=x,O=y,T=A,D=v;for(let e=0;e<8;e+=2)C^=Jt(w+R|0,7),S^=Jt(C+w|0,9),R^=Jt(S+C|0,13),w^=Jt(R+S|0,18),k^=Jt(M+_|0,7),O^=Jt(k+M|0,9),_^=Jt(O+k|0,13),M^=Jt(_+O|0,18),T^=Jt(N+B|0,7),I^=Jt(T+N|0,9),B^=Jt(I+T|0,13),N^=Jt(B+I|0,18),E^=Jt(D+P|0,7),L^=Jt(E+D|0,9),P^=Jt(L+E|0,13),D^=Jt(P+L|0,18),_^=Jt(w+E|0,7),I^=Jt(_+w|0,9),E^=Jt(I+_|0,13),w^=Jt(E+I|0,18),B^=Jt(M+C|0,7),L^=Jt(B+M|0,9),C^=Jt(L+B|0,13),M^=Jt(C+L|0,18),P^=Jt(N+k|0,7),S^=Jt(P+N|0,9),k^=Jt(S+P|0,13),N^=Jt(k+S|0,18),R^=Jt(D+T|0,7),O^=Jt(R+D|0,9),T^=Jt(O+R|0,13),D^=Jt(T+O|0,18);f[d++]=r+w|0,f[d++]=n+_|0,f[d++]=i+I|0,f[d++]=b+E|0,f[d++]=o+C|0,f[d++]=s+M|0,f[d++]=l+B|0,f[d++]=u+L|0,f[d++]=h+S|0,f[d++]=p+k|0,f[d++]=g+N|0,f[d++]=m+P|0,f[d++]=x+R|0,f[d++]=y+O|0,f[d++]=A+T|0,f[d++]=v+D|0}function Yt(e,a,t,c,f){let d=c+0,r=c+16*f;for(let c=0;c<16;c++)t[r+c]=e[a+16*(2*f-1)+c];for(let c=0;c0&&(r+=16),Wt(t,d,e,a+=16,t,r)}function Xt(e,a,t){const c=(0,Ba.tY)({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:f,r:d,p:r,dkLen:n,asyncTick:i,maxmem:b,onProgress:o}=c;if((0,Kt.ai)(f),(0,Kt.ai)(d),(0,Kt.ai)(r),(0,Kt.ai)(n),(0,Kt.ai)(i),(0,Kt.ai)(b),void 0!==o&&"function"!=typeof o)throw new Error("progressCb should be function");const s=128*d,l=s/4;if(f<=1||f&f-1||f>=2**(s/8)||f>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(r<0||r>137438953440/s)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(n<0||n>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const u=s*(f+r);if(u>b)throw new Error(`Scrypt: parameters too large, ${u} (128 * r * (N + p)) > ${b} (maxmem)`);const h=(0,Zt.A)(Vt.s,e,a,{c:1,dkLen:s*r}),p=(0,Ba.DH)(h),g=(0,Ba.DH)(new Uint8Array(s*f)),m=(0,Ba.DH)(new Uint8Array(s));let x=()=>{};if(o){const e=2*f*r,a=Math.max(Math.floor(e/1e4),1);let t=0;x=()=>{t++,!o||t%a&&t!==e||o(t/e)}}return{N:f,r:d,p:r,dkLen:n,blockSize32:l,V:g,B32:p,B:h,tmp:m,blockMixCb:x,asyncTick:i}}function ec(e,a,t,c,f){const d=(0,Zt.A)(Vt.s,e,t,{c:1,dkLen:a});return t.fill(0),c.fill(0),f.fill(0),d}let ac=!1,tc=!1;const cc=async function(e,a,t,c,f,d,r){return await async function(e,a,t){const{N:c,r:f,p:d,dkLen:r,blockSize32:n,V:i,B32:b,B:o,tmp:s,blockMixCb:l,asyncTick:u}=Xt(e,a,t);for(let e=0;e{Yt(i,t,i,t+=n,f),l()})),Yt(i,(c-1)*n,b,a,f),l(),await(0,Ba.$h)(c,u,(()=>{const e=b[a+n-16]%c;for(let t=0;t0&&!(c&c-1),"invalid kdf.N","kdf.N",c),(0,r.MR)(f>0&&d>0,"invalid kdf","kdf",a);const n=uc(e,"crypto.kdfparams.dklen:int!");return(0,r.MR)(32===n,"invalid kdf.dklen","kdf.dflen",n),{name:"scrypt",salt:t,N:c,r:f,p:d,dkLen:64}}if("pbkdf2"===a.toLowerCase()){const a=uc(e,"crypto.kdfparams.salt:data!"),t=uc(e,"crypto.kdfparams.prf:string!"),c=t.split("-").pop();(0,r.MR)("sha256"===c||"sha512"===c,"invalid kdf.pdf","kdf.pdf",t);const f=uc(e,"crypto.kdfparams.c:int!"),d=uc(e,"crypto.kdfparams.dklen:int!");return(0,r.MR)(32===d,"invalid kdf.dklen","kdf.dklen",d),{name:"pbkdf2",salt:a,count:f,dkLen:d,algorithm:c}}}(0,r.MR)(!1,"unsupported key-derivation function","kdf",a)}function yc(e){return new Promise((a=>{setTimeout((()=>{a()}),e)}))}function Ac(e){const a=null!=e.salt?(0,d.q5)(e.salt,"options.salt"):Ja(32);let t=1<<17,c=8,f=1;return e.scrypt&&(e.scrypt.N&&(t=e.scrypt.N),e.scrypt.r&&(c=e.scrypt.r),e.scrypt.p&&(f=e.scrypt.p)),(0,r.MR)("number"==typeof t&&t>0&&Number.isSafeInteger(t)&&(BigInt(t)&BigInt(t-1))===BigInt(0),"invalid scrypt N parameter","options.N",t),(0,r.MR)("number"==typeof c&&c>0&&Number.isSafeInteger(c),"invalid scrypt r parameter","options.r",c),(0,r.MR)("number"==typeof f&&f>0&&Number.isSafeInteger(f),"invalid scrypt p parameter","options.p",f),{name:"scrypt",dkLen:32,salt:a,N:t,r:c,p:f}}function vc(e,a,t,c){const f=(0,d.q5)(t.privateKey,"privateKey"),n=null!=c.iv?(0,d.q5)(c.iv,"options.iv"):Ja(16);(0,r.MR)(16===n.length,"invalid options.iv length","options.iv",c.iv);const i=null!=c.uuid?(0,d.q5)(c.uuid,"options.uuid"):Ja(16);(0,r.MR)(16===i.length,"invalid options.uuid length","options.uuid",c.iv);const b=e.slice(0,16),o=e.slice(16,32),s=new zt(b,n),l=(0,d.q5)(s.encrypt(f)),u=(0,C.S)((0,d.xW)([o,l])),h={address:t.address.substring(2).toLowerCase(),id:bc(i),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,d.c$)(n).substring(2)},ciphertext:(0,d.c$)(l).substring(2),kdf:"scrypt",kdfparams:{salt:(0,d.c$)(a.salt).substring(2),n:a.N,dklen:32,p:a.p,r:a.r},mac:u.substring(2)}};if(t.mnemonic){const a=null!=c.client?c.client:`ethers/${hc.r}`,f=t.mnemonic.path||pc,r=t.mnemonic.locale||"en",n=e.slice(32,64),i=(0,d.q5)(t.mnemonic.entropy,"account.mnemonic.entropy"),b=Ja(16),o=new zt(n,b),s=(0,d.q5)(o.encrypt(i)),l=new Date,u="UTC--"+l.getUTCFullYear()+"-"+sc(l.getUTCMonth()+1,2)+"-"+sc(l.getUTCDate(),2)+"T"+sc(l.getUTCHours(),2)+"-"+sc(l.getUTCMinutes(),2)+"-"+sc(l.getUTCSeconds(),2)+".0Z--"+h.address;h["x-ethers"]={client:a,gethFilename:u,path:f,locale:r,mnemonicCounter:(0,d.c$)(b).substring(2),mnemonicCiphertext:(0,d.c$)(s).substring(2),version:"0.1"}}return JSON.stringify(h)}function wc(e,a,t){null==t&&(t={});const c=lc(a),f=Ac(t),r=ic(c,f.salt,f.N,f.r,f.p,64);return vc((0,d.q5)(r),f,e,t)}async function _c(e,a,t){null==t&&(t={});const c=lc(a),f=Ac(t),r=await nc(c,f.salt,f.N,f.r,f.p,64,t.progressCallback);return vc((0,d.q5)(r),f,e,t)}const Ic="m/44'/60'/0'/0/0",Ec=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Cc=2147483648,Mc=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function Bc(e,a){let t="";for(;e;)t="0123456789abcdef"[e%16]+t,e=Math.trunc(e/16);for(;t.length<2*a;)t="0"+t;return"0x"+t}function Lc(e){const a=(0,d.q5)(e),t=(0,d.ZG)((0,va.s)((0,va.s)(a)),0,4);return ae((0,d.xW)([a,t]))}const Sc={};function kc(e,a,t,c){const f=new Uint8Array(37);e&Cc?((0,r.vA)(null!=c,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),f.set((0,d.q5)(c),1)):f.set((0,d.q5)(t));for(let a=24;a>=0;a-=8)f[33+(a>>3)]=e>>24-a&255;const n=(0,d.q5)(Ca("sha512",a,f));return{IL:n.slice(0,32),IR:n.slice(32)}}function Nc(e,a){const t=a.split("/");(0,r.MR)(t.length>0,"invalid path","path",a),"m"===t[0]&&((0,r.MR)(0===e.depth,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,"path",a),t.shift());let c=e;for(let e=0;e=16&&t.length<=64,"invalid seed","seed","[REDACTED]");const c=(0,d.q5)(Ca("sha512",Ec,t)),f=new xa.h((0,d.c$)(c.slice(0,32)));return new Pc(Sc,f,"0x00000000",(0,d.c$)(c.slice(32)),"m",0,0,a,null)}static fromExtendedKey(e){const a=(0,M.c4)(function(e){let a=X;for(let t=0;t16)throw new TypeError("PKCS#7 padding byte out of range");const t=e.length-a;for(let c=0;c{setTimeout((()=>{a()}),e)}))}class Fc extends Aa{constructor(e,a){"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),super("string"==typeof e?new xa.h(e):e,a)}connect(e){return new Fc(this.signingKey,e)}async encrypt(e,a){const t={address:this.address,privateKey:this.privateKey};return await _c(t,e,{progressCallback:a})}encryptSync(e){return wc({address:this.address,privateKey:this.privateKey},e)}static#Le(e){if((0,r.MR)(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&"en"===e.mnemonic.locale){const a=st.fromEntropy(e.mnemonic.entropy),t=Pc.fromMnemonic(a,e.mnemonic.path);if(t.address===e.address&&t.privateKey===e.privateKey)return t;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const a=new Fc(e.privateKey);return(0,r.MR)(a.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),a}static async fromEncryptedJson(e,a,t){let c=null;return gc(e)?c=await async function(e,a,t){const c=JSON.parse(e),f=lc(a),d=xc(c);if("pbkdf2"===d.name){t&&(t(0),await yc(0));const{salt:e,count:a,dkLen:r,algorithm:n}=d,i=rt(f,e,a,r,n);return t&&(t(1),await yc(0)),mc(c,i)}(0,r.vA)("scrypt"===d.name,"cannot be reached","UNKNOWN_ERROR",{params:d});const{salt:n,N:i,r:b,p:o,dkLen:s}=d;return mc(c,await nc(f,n,i,b,o,s,t))}(e,a,t):Oc(e)&&(t&&(t(0),await Dc(0)),c=Tc(e,a),t&&(t(1),await Dc(0))),Fc.#Le(c)}static fromEncryptedJsonSync(e,a){let t=null;return gc(e)?t=function(e,a){const t=JSON.parse(e),c=lc(a),f=xc(t);if("pbkdf2"===f.name){const{salt:e,count:a,dkLen:d,algorithm:r}=f;return mc(t,rt(c,e,a,d,r))}(0,r.vA)("scrypt"===f.name,"cannot be reached","UNKNOWN_ERROR",{params:f});const{salt:d,N:n,r:i,p:b,dkLen:o}=f;return mc(t,ic(c,d,n,i,b,o))}(e,a):Oc(e)?t=Tc(e,a):(0,r.MR)(!1,"invalid JSON wallet","json","[ REDACTED ]"),Fc.#Le(t)}static createRandom(e){const a=Pc.createRandom();return e?a.connect(e):a}static fromPhrase(e,a){const t=Pc.fromPhrase(e);return a?t.connect(a):t}}class Qc extends ha{#A;constructor(e,a,t){const c=Object.assign({},null!=t?t:{},{batchMaxCount:1});(0,r.MR)(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(a,c),this.#A=async(a,t)=>{const c={method:a,params:t};this.emit("debug",{action:"sendEip1193Request",payload:c});try{const a=await e.request(c);return this.emit("debug",{action:"receiveEip1193Result",result:a}),a}catch(e){const a=new Error(e.message);throw a.code=e.code,a.data=e.data,a.payload=c,this.emit("debug",{action:"receiveEip1193Error",error:a}),a}}}async send(e,a){return await this._start(),await super.send(e,a)}async _send(e){(0,r.MR)(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const a=await this.#A(e.method,e.params||[]);return[{id:e.id,result:a}]}catch(a){return[{id:e.id,error:{code:a.code,data:a.data,message:a.message}}]}}getRpcError(e,a){switch((a=JSON.parse(JSON.stringify(a))).error.code||-1){case 4001:a.error.message=`ethers-user-denied: ${a.error.message}`;break;case 4200:a.error.message=`ethers-unsupported: ${a.error.message}`}return super.getRpcError(e,a)}async hasSigner(e){null==e&&(e=0);const a=await this.send("eth_accounts",[]);return"number"==typeof e?a.length>e:(e=e.toLowerCase(),0!==a.filter((a=>a.toLowerCase()===e)).length)}async getSigner(e){if(null==e&&(e=0),!await this.hasSigner(e))try{await this.#A("eth_requestAccounts",[])}catch(e){const a=e.payload;throw this.getRpcError(a,{id:a.id,error:e})}return await super.getSigner(e)}}var Uc=t(67418),jc=Object.defineProperty,Hc=Object.defineProperties,$c=Object.getOwnPropertyDescriptors,qc=Object.getOwnPropertySymbols,Gc=Object.getPrototypeOf,zc=Object.prototype.hasOwnProperty,Kc=Object.prototype.propertyIsEnumerable,Vc=Reflect.get,Zc=(e,a,t)=>a in e?jc(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,Jc=(e,a,t)=>Vc(Gc(e),t,a),Wc=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));const Yc="Mozilla/5.0 (Windows NT 10.0; rv:109.0) Gecko/20100101 Firefox/115.0",Xc=f();function ef({fetchUrl:e,proxyUrl:a,torPort:c,retry:f}){const{HttpProxyAgent:d}=t(60513),{HttpsProxyAgent:r}=t(2378),{SocksProxyAgent:n}=t(60290);if(c)return new n(`socks5h://tor${f}@127.0.0.1:${c}`);if(!a)return;const i=e.includes("https://");return a.includes("socks://")||a.includes("socks4://")||a.includes("socks5://")?new n(a):a.includes("http://")||a.includes("https://")?i?new r(a):new d(a):void 0}function af(e){return Wc(this,arguments,(function*(e,a={}){var t,c,f;const d=null!=(t=a.maxRetry)?t:3,r=null!=(c=a.retryOn)?c:500,n=null!=(f=a.userAgent)?f:Yc;let i,b=0;for(a.method||(a.body?a.method="POST":a.method="GET"),a.headers||(a.headers={}),Uc.Ll&&!a.headers["User-Agent"]&&(a.headers["User-Agent"]=n);b{e.abort()}),a.timeout)}!a.agent&&Uc.Ll&&(a.proxy||a.torPort)&&(a.agent=ef({fetchUrl:e,proxyUrl:a.proxy,torPort:a.torPort,retry:b})),a.debug&&"function"==typeof a.debug&&a.debug("request",{url:e,retry:b,errorObject:i,options:a});try{const t=yield Xc(e,{method:a.method,headers:a.headers,body:a.body,redirect:a.redirect,signal:a.signal,agent:a.agent});if(a.debug&&"function"==typeof a.debug&&a.debug("response",t),!t.ok){const a=`Request to ${e} failed with error code ${t.status}:\n`+(yield t.text());throw new Error(a)}if(a.returnResponse)return t;const c=t.headers.get("content-type");return(null==c?void 0:c.includes("application/json"))?yield t.json():(null==c?void 0:c.includes("text"))?yield t.text():t}catch(e){t&&clearTimeout(t),i=e,b++,yield(0,Uc.yy)(r)}finally{t&&clearTimeout(t)}}throw a.debug&&"function"==typeof a.debug&&a.debug("error",i),i}))}const tf=(e={})=>(a,t)=>Wc(void 0,null,(function*(){let c;if(t){const e=new AbortController;c=e.signal,t.addListener((()=>{e.abort()}))}const f=(d=((e,a)=>{for(var t in a||(a={}))zc.call(a,t)&&Zc(e,t,a[t]);if(qc)for(var t of qc(a))Kc.call(a,t)&&Zc(e,t,a[t]);return e})({},e),r={method:a.method||"POST",headers:a.headers,body:a.body||void 0,signal:c,returnResponse:!0},Hc(d,$c(r)));var d,r;const n=yield af(a.url,f),i={};n.headers.forEach(((e,a)=>{i[a.toLowerCase()]=e}));const b=yield n.arrayBuffer(),o=null==b?null:new Uint8Array(b);return{statusCode:n.status,statusMessage:n.statusText,headers:i,body:o}}));function cf(e,a){return Wc(this,null,(function*(){const t=new A(e);t.getUrlFunc=tf(a);const c=yield new pa(t).getNetwork(),f=Number(c.chainId);if((null==a?void 0:a.netId)&&a.netId!==f){const t=`Wrong network for ${e}, wants ${a.netId} got ${f}`;throw new Error(t)}return new pa(t,c,{staticNetwork:c,pollingInterval:(null==a?void 0:a.pollingInterval)||1e3})}))}function ff(e,a,t,c){const{networkName:f,reverseRecordsContract:d,pollInterval:r}=t,n=Boolean(d),i=new A(a);i.getUrlFunc=tf(c);const b=new Ee(f,e);return n&&b.attachPlugin(new we(null,Number(e))),b.attachPlugin(new ve),new pa(i,b,{staticNetwork:b,pollingInterval:(null==c?void 0:c.pollingInterval)||1e3*r})}const df=(e,a)=>Wc(void 0,null,(function*(){const t=e.provider;if(a.from){if(a.from!==e.address){const t=`populateTransaction: signer mismatch for tx, wants ${a.from} have ${e.address}`;throw new Error(t)}}else a.from=e.address;const[c,f]=yield Promise.all([a.maxFeePerGas||a.gasPrice?void 0:t.getFeeData(),a.nonce?void 0:t.getTransactionCount(e.address,"pending")]);if(c&&(c.maxFeePerGas?(a.type||(a.type=2),a.maxFeePerGas=c.maxFeePerGas*(BigInt(1e4)+BigInt(e.gasPriceBump))/BigInt(1e4),a.maxPriorityFeePerGas=c.maxPriorityFeePerGas,delete a.gasPrice):c.gasPrice&&(a.type||(a.type=0),a.gasPrice=c.gasPrice,delete a.maxFeePerGas,delete a.maxPriorityFeePerGas)),f&&(a.nonce=f),!a.gasLimit)try{const c=yield t.estimateGas(a);a.gasLimit=c===BigInt(21e3)?c:c*(BigInt(1e4)+BigInt(e.gasLimitBump))/BigInt(1e4)}catch(t){if(!e.gasFailover)throw t;console.log("populateTransaction: warning gas estimation failed falling back to 3M gas"),a.gasLimit=BigInt("3000000")}return a}));class rf extends Fc{constructor(e,a,{gasPriceBump:t,gasLimitBump:c,gasFailover:f,bumpNonce:d}={}){super(e,a),this.gasPriceBump=null!=t?t:0,this.gasLimitBump=null!=c?c:3e3,this.gasFailover=null!=f&&f,this.bumpNonce=null!=d&&d}static fromMnemonic(e,a,t=0,c){const f=`m/44'/60'/0'/0/${t}`,{privateKey:d}=Pc.fromPhrase(e,void 0,f);return new rf(d,a,c)}populateTransaction(e){return Wc(this,null,(function*(){const a=yield df(this,e);return this.nonce=a.nonce,Jc(rf.prototype,this,"populateTransaction").call(this,a)}))}}class nf extends ta{constructor(e,a,{gasPriceBump:t,gasLimitBump:c,gasFailover:f,bumpNonce:d}={}){super(e,a),this.gasPriceBump=null!=t?t:0,this.gasLimitBump=null!=c?c:3e3,this.gasFailover=null!=f&&f,this.bumpNonce=null!=d&&d}populateTransaction(e){return Wc(this,null,(function*(){const a=yield df(this,e);return this.nonce=a.nonce,Jc(nf.prototype,this,"populateTransaction").call(this,a)}))}}class bf extends la{constructor(e,a,{gasPriceBump:t,gasLimitBump:c,gasFailover:f,bumpNonce:d}={}){super(e,a),this.gasPriceBump=null!=t?t:0,this.gasLimitBump=null!=c?c:3e3,this.gasFailover=null!=f&&f,this.bumpNonce=null!=d&&d}sendUncheckedTransaction(e){return Wc(this,null,(function*(){return Jc(bf.prototype,this,"sendUncheckedTransaction").call(this,yield df(this,e))}))}}class of extends Qc{constructor(e,a,t){super(e,a),this.options=t}getSigner(e){return Wc(this,null,(function*(){var a,t,c,f,d,r,n,i,b;const o=(yield Jc(of.prototype,this,"getSigner").call(this,e)).address;return(null==(a=this.options)?void 0:a.webChainId)&&(null==(t=this.options)?void 0:t.connectWallet)&&Number(yield Jc(of.prototype,this,"send").call(this,"eth_chainId",[]))!==Number(null==(c=this.options)?void 0:c.webChainId)&&(yield this.options.connectWallet()),(null==(f=this.options)?void 0:f.handleNetworkChanges)&&(null==(d=null==window?void 0:window.ethereum)||d.on("chainChanged",this.options.handleNetworkChanges)),(null==(r=this.options)?void 0:r.handleAccountChanges)&&(null==(n=null==window?void 0:window.ethereum)||n.on("accountsChanged",this.options.handleAccountChanges)),(null==(i=this.options)?void 0:i.handleAccountDisconnect)&&(null==(b=null==window?void 0:window.ethereum)||b.on("disconnect",this.options.handleAccountDisconnect)),new bf(this,o,this.options)}))}}},57194:(e,a,t)=>{"use strict";t.d(a,{KN:()=>A,OR:()=>C,Ss:()=>y,XF:()=>I,c$:()=>_,pO:()=>v,sN:()=>E,zy:()=>w});var c=t(99770),f=t(30031),d=t(67418),r=t(59499),n=t(68434),i=t(59511),b=Object.defineProperty,o=Object.defineProperties,s=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,p=(e,a,t)=>a in e?b(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,g=(e,a)=>{for(var t in a||(a={}))u.call(a,t)&&p(e,t,a[t]);if(l)for(var t of l(a))h.call(a,t)&&p(e,t,a[t]);return e},m=(e,a)=>o(e,s(a)),x=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));const y=.1,A=.9,v=(0,c.g5)("500");function w({stakeBalance:e,tornadoServiceFee:a}){if(a=A)return BigInt(0);const t=1-1/(A-y)**2*(a-y)**2;return BigInt(Math.floor(Number(e||"0")*t))}function _(e,a){for(let t=0;tObject.values(e))).flat().map((e=>(0,f.b)(e)))}function E(e){const a=e.map((e=>w(e))),t=a.reduce(((e,a)=>e+a),BigInt("0"));return e[_(a,BigInt(Math.floor(Number(t)*Math.random())))]}class C{constructor({netId:e,config:a,fetchDataOptions:t}){this.netId=e,this.config=a,this.fetchDataOptions=t,this.tovarish=!1}askRelayerStatus(e){return x(this,arguments,(function*({hostname:e,url:a,relayerAddress:t}){var c,f;!a&&e?a=`https://${e.endsWith("/")?e:e+"/"}`:a&&!a.endsWith("/")?a+="/":a="";const d=yield(0,n.Fd)(`${a}status`,m(g({},this.fetchDataOptions),{headers:{"Content-Type":"application/json, application/x-www-form-urlencoded"},timeout:(null==(c=this.fetchDataOptions)?void 0:c.torPort)?1e4:3e3,maxRetry:(null==(f=this.fetchDataOptions)?void 0:f.torPort)?2:0}));if(!i.SS.compile((0,i.c_)(this.netId,this.config,this.tovarish))(d))throw new Error("Invalid status schema");const b=m(g({},d),{url:a});if(b.currentQueue>5)throw new Error("Withdrawal queue is overloaded");if(b.netId!==this.netId)throw new Error("This relayer serves a different network");if(t&&this.netId===r.zr.MAINNET&&b.rewardAccount!==t)throw new Error("The Relayer reward address must match registered address");return b}))}filterRelayer(e){return x(this,null,(function*(){var a;const t=e.hostnames[this.netId],{ensName:c,relayerAddress:d}=e;if(t)try{const r=yield this.askRelayerStatus({hostname:t,relayerAddress:d});return{netId:r.netId,url:r.url,hostname:t,ensName:c,relayerAddress:d,rewardAccount:(0,f.b)(r.rewardAccount),instances:I(r.instances),stakeBalance:e.stakeBalance,gasPrice:null==(a=r.gasPrices)?void 0:a.fast,ethPrices:r.ethPrices,currentQueue:r.currentQueue,tornadoServiceFee:r.tornadoServiceFee}}catch(e){return{hostname:t,relayerAddress:d,errorMessage:e.message,hasError:!0}}}))}getValidRelayers(e){return x(this,null,(function*(){const a=[];return{validRelayers:(yield Promise.all(e.map((e=>this.filterRelayer(e))))).filter((e=>!(!e||e.hasError&&(a.push(e),1)))),invalidRelayers:a}}))}pickWeightedRandomRelayer(e){return E(e)}tornadoWithdraw(e,a){return x(this,arguments,(function*({contract:e,proof:a,args:t},c){const{url:f}=this.selectedRelayer,r=yield(0,n.Fd)(`${f}v1/tornadoWithdraw`,m(g({},this.fetchDataOptions),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contract:e,proof:a,args:t})})),{id:b,error:o}=r;if(o)throw new Error(o);let s;const l=`${f}v1/jobs/${b}`;for(console.log(`Job submitted: ${l}\n`);!s||!["FAILED","CONFIRMED"].includes(s);){const e=yield(0,n.Fd)(l,m(g({},this.fetchDataOptions),{method:"GET",headers:{"Content-Type":"application/json"}}));if(e.error)throw new Error(o);if(!i.SS.compile(i.Us)(e))throw new Error(`${l} has an invalid job response`);const{status:a,txHash:t,confirmations:f,failedReason:r}=e;if(s!==a){if("FAILED"===a)throw new Error(`Job ${a}: ${l} failed reason: ${r}`);"SENT"===a?console.log(`Job ${a}: ${l}, txhash: ${t}\n`):"MINED"===a||"CONFIRMED"===a?console.log(`Job ${a}: ${l}, txhash: ${t}, confirmations: ${f}\n`):console.log(`Job ${a}: ${l}\n`),s=a,"function"==typeof c&&c(e)}yield(0,d.yy)(3e3)}}))}}},59511:(e,a,t)=>{"use strict";t.d(a,{SC:()=>p,SS:()=>r,iL:()=>g,i1:()=>y,yF:()=>x,CI:()=>P,ME:()=>O,XW:()=>T,ZC:()=>D,c_:()=>U,FR:()=>k,Us:()=>j,Y6:()=>m,dX:()=>N,$j:()=>R});var c=t(63282),f=t.n(c),d=t(41442);const r=new(f())({allErrors:!0});r.addKeyword({keyword:"BN",validate:(e,a)=>{try{return BigInt(a),!0}catch(e){return!1}},errors:!0}),r.addKeyword({keyword:"isAddress",validate:(e,a)=>{try{return(0,d.PW)(a)}catch(e){return!1}},errors:!0});var n=t(94513),i=Object.defineProperty,b=Object.defineProperties,o=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,h=(e,a,t)=>a in e?i(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t;const p={type:"string",pattern:"^0x[a-fA-F0-9]{40}$",isAddress:!0},g={type:"string",BN:!0},m={type:"string",pattern:"^0x[a-fA-F0-9]{512}$"},x={type:"string",pattern:"^0x[a-fA-F0-9]{64}$"},y=b(((e,a)=>{for(var t in a||(a={}))l.call(a,t)&&h(e,t,a[t]);if(s)for(var t of s(a))u.call(a,t)&&h(e,t,a[t]);return e})({},x),o({BN:!0}));var A=Object.defineProperty,v=Object.defineProperties,w=Object.getOwnPropertyDescriptors,_=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,C=(e,a,t)=>a in e?A(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,M=(e,a)=>{for(var t in a||(a={}))I.call(a,t)&&C(e,t,a[t]);if(_)for(var t of _(a))E.call(a,t)&&C(e,t,a[t]);return e},B=(e,a)=>v(e,w(a));const L={blockNumber:{type:"number"},logIndex:{type:"number"},transactionHash:x},S=Object.keys(L),k={type:"array",items:{anyOf:[{type:"object",properties:B(M({},L),{event:{type:"string"},id:{type:"number"},proposer:p,target:p,startTime:{type:"number"},endTime:{type:"number"},description:{type:"string"}}),required:[...S,"event","id","proposer","target","startTime","endTime","description"],additionalProperties:!1},{type:"object",properties:B(M({},L),{event:{type:"string"},proposalId:{type:"number"},voter:p,support:{type:"boolean"},votes:{type:"string"},from:p,input:{type:"string"}}),required:[...S,"event","proposalId","voter","support","votes","from","input"],additionalProperties:!1},{type:"object",properties:B(M({},L),{event:{type:"string"},account:p,delegateTo:p}),required:[...S,"account","delegateTo"],additionalProperties:!1},{type:"object",properties:B(M({},L),{event:{type:"string"},account:p,delegateFrom:p}),required:[...S,"account","delegateFrom"],additionalProperties:!1}]}},N={type:"array",items:{type:"object",properties:B(M({},L),{ensName:{type:"string"},relayerAddress:p}),required:[...S,"ensName","relayerAddress"],additionalProperties:!1}},P={type:"array",items:{type:"object",properties:B(M({},L),{commitment:x,leafIndex:{type:"number"},timestamp:{type:"number"},from:p}),required:[...S,"commitment","leafIndex","timestamp","from"],additionalProperties:!1}},R={type:"array",items:{type:"object",properties:B(M({},L),{nullifierHash:x,to:p,fee:g,timestamp:{type:"number"}}),required:[...S,"nullifierHash","to","fee","timestamp"],additionalProperties:!1}},O={type:"array",items:{type:"object",properties:B(M({},L),{address:p,encryptedAccount:{type:"string"}}),required:[...S,"address","encryptedAccount"],additionalProperties:!1}},T={type:"array",items:{type:"object",properties:B(M({},L),{encryptedNote:{type:"string"}}),required:[...S,"encryptedNote"],additionalProperties:!1}};function D(e){if(e===n.DEPOSIT)return r.compile(P);if(e===n.WITHDRAWAL)return r.compile(R);if("governance"===e)return r.compile(k);if("registered"===e)return r.compile(N);if("echo"===e)return r.compile(O);if("encrypted_notes"===e)return r.compile(T);throw new Error("Unsupported event type for schema validation")}var F=t(59499);const Q={type:"object",properties:{rewardAccount:p,gasPrices:{type:"object",properties:{fast:{type:"number"},additionalProperties:{type:"number"}},required:["fast"]},netId:{type:"integer"},tornadoServiceFee:{type:"number",maximum:20,minimum:0},latestBlock:{type:"number"},latestBalance:g,version:{type:"string"},health:{type:"object",properties:{status:{const:"true"},error:{type:"string"}},required:["status"]},syncStatus:{type:"object",properties:{events:{type:"boolean"},tokenPrice:{type:"boolean"},gasPrice:{type:"boolean"}},required:["events","tokenPrice","gasPrice"]},onSyncEvents:{type:"boolean"},currentQueue:{type:"number"}},required:["rewardAccount","instances","netId","tornadoServiceFee","version","health","currentQueue"]};function U(e,a,t){const{tokens:c,optionalTokens:f,disabledTokens:d,nativeCurrency:r}=a,n=JSON.parse(JSON.stringify(Q)),i=Object.keys(c).reduce(((e,a)=>{const{instanceAddress:t,tokenAddress:r,symbol:n,decimals:i,optionalInstances:b=[]}=c[a],o=Object.keys(t),s={type:"object",properties:{instanceAddress:{type:"object",properties:o.reduce(((e,a)=>(e[a]=p,e)),{}),required:o.filter((e=>!b.includes(e)))},decimals:{enum:[i]}},required:["instanceAddress","decimals"].concat(r?["tokenAddress"]:[],n?["symbol"]:[])};return r&&(s.properties.tokenAddress=p),n&&(s.properties.symbol={enum:[n]}),e.properties[a]=s,(null==f?void 0:f.includes(a))||(null==d?void 0:d.includes(a))||e.required.push(a),e}),{type:"object",properties:{},required:[]});n.properties.instances=i;const b=Object.keys(c).filter((e=>{var t,c;return e!==r&&!(null==(t=a.optionalTokens)?void 0:t.includes(e))&&!(null==(c=a.disabledTokens)?void 0:c.includes(e))}));if(e===F.zr.MAINNET&&b.push("torn"),b.length){const e={type:"object",properties:b.reduce(((e,a)=>(e[a]=g,e)),{}),required:b};n.properties.ethPrices=e,n.required.push("ethPrices")}return t&&n.required.push("gasPrices","latestBlock","latestBalance","syncStatus","onSyncEvents"),n}const j={type:"object",properties:{error:{type:"string"},id:{type:"string"},type:{type:"string"},status:{type:"string"},contract:{type:"string"},proof:{type:"string"},args:{type:"array",items:{type:"string"}},txHash:{type:"string"},confirmations:{type:"number"},failedReason:{type:"string"}},required:["id","status"]}},7393:(e,a,t)=>{"use strict";t.d(a,{H:()=>i});var c=t(98982),f=t(21278),d=t(67418),r=t(48486),n=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));function i(e){return n(this,arguments,(function*({provider:e,Multicall:a,currencyName:t,userAddress:n,tokenAddresses:i=[]}){const b=i.map((a=>{const t=f.Xc.connect(a,e);return[{contract:t,name:"balanceOf",params:[n]},{contract:t,name:"name"},{contract:t,name:"symbol"},{contract:t,name:"decimals"}]})).flat(),o=yield(0,r.C)(a,[{contract:a,name:"getEthBalance",params:[n]},...b.length?b:[]]),s=o[0],l=(o.slice(1).length?(0,d.iv)(o.slice(1),b.length/i.length):[]).map(((e,a)=>{const[t,c,f,d]=e;return{address:i[a],name:c,symbol:f,decimals:Number(d),balance:t}}));return[{address:c.j,name:t,symbol:t,decimals:18,balance:s},...l]}))}},96838:(e,a,t)=>{"use strict";t.d(a,{E:()=>y,o:()=>x});var c=t(30031),f=t(57194),d=t(68434),r=t(59511),n=Object.defineProperty,i=Object.defineProperties,b=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,h=Reflect.get,p=(e,a,t)=>a in e?n(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,g=(e,a)=>{for(var t in a||(a={}))l.call(a,t)&&p(e,t,a[t]);if(o)for(var t of o(a))u.call(a,t)&&p(e,t,a[t]);return e},m=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));const x=5e3;class y extends f.OR{constructor({netId:e,config:a,fetchDataOptions:t}){super({netId:e,config:a,fetchDataOptions:t}),this.tovarish=!0}askRelayerStatus(e){return m(this,arguments,(function*({hostname:e,url:a,relayerAddress:t}){const c=yield(f=y.prototype,h(s(f),"askRelayerStatus",this)).call(this,{hostname:e,url:a,relayerAddress:t});var f;if(!c.version.includes("tovarish"))throw new Error("Not a tovarish relayer!");return c}))}filterRelayer(e){return m(this,null,(function*(){var a;const{ensName:t,relayerAddress:d,tovarishHost:r,tovarishNetworks:n}=e;if(r&&(null==n?void 0:n.includes(this.netId)))try{const n=yield this.askRelayerStatus({hostname:r,relayerAddress:d});return{netId:n.netId,url:n.url,hostname:r,ensName:t,relayerAddress:d,rewardAccount:(0,c.b)(n.rewardAccount),instances:(0,f.XF)(n.instances),stakeBalance:e.stakeBalance,gasPrice:null==(a=n.gasPrices)?void 0:a.fast,ethPrices:n.ethPrices,currentQueue:n.currentQueue,tornadoServiceFee:n.tornadoServiceFee,latestBlock:Number(n.latestBlock),latestBalance:n.latestBalance,version:n.version,events:n.events,syncStatus:n.syncStatus}}catch(e){return{hostname:r,relayerAddress:d,errorMessage:e.message,hasError:!0}}}))}getValidRelayers(e){return m(this,null,(function*(){const a=[];return{validRelayers:(yield Promise.all(e.map((e=>this.filterRelayer(e))))).filter((e=>!(!e||e.hasError&&(a.push(e),1)))),invalidRelayers:a}}))}getEvents(e){return m(this,arguments,(function*({type:e,currency:a,amount:t,fromBlock:c,recent:f}){var n;const o=`${null==(n=this.selectedRelayer)?void 0:n.url}events`,s=(0,r.ZC)(e);try{const r=[];let n=c;for(;;){let{events:h,lastSyncBlock:p}=yield(0,d.Fd)(o,(l=g({},this.fetchDataOptions),u={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e,currency:a,amount:t,fromBlock:c,recent:f})},i(l,b(u))));if(!s(h)){const a=`Schema validation failed for ${e} events`;throw new Error(a)}if(n=p,!Array.isArray(h)||!h.length)break;h=h.sort(((e,a)=>e.blockNumber===a.blockNumber?e.logIndex-a.logIndex:e.blockNumber-a.blockNumber));const[m]=h.slice(-1);if(h.lengthe.blockNumber!==m.blockNumber)),c=Number(m.blockNumber),r.push(...h)}return{events:r,lastSyncBlock:n}}catch(e){return console.log("Error from TovarishClient events endpoint"),console.log(e),{events:[],lastSyncBlock:c}}var l,u}))}}},21278:(e,a,t)=>{"use strict";t.d(a,{p2:()=>n,Xc:()=>b,Q2:()=>s,Hk:()=>u,Ld:()=>p,Rp:()=>m,XB:()=>c});var c={};t.r(c),t.d(c,{ENS__factory:()=>n,ERC20__factory:()=>b,Multicall__factory:()=>s,OffchainOracle__factory:()=>u,OvmGasPriceOracle__factory:()=>p,ReverseRecords__factory:()=>m});var f=t(73622),d=t(24391);const r=[{constant:!0,inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"},{internalType:"string",name:"value",type:"string"}],name:"setText",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],name:"setPubkey",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"hash",type:"bytes"}],name:"setContenthash",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"isAuthorised",type:"bool"}],name:"setAuthorisation",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentType",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setABI",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"name",type:"string"}],name:"setName",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"},{internalType:"bytes",name:"a",type:"bytes"}],name:"setAddr",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"},{internalType:"address",name:"implementer",type:"address"}],name:"setInterface",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"authorisations",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"bool",name:"isAuthorised",type:"bool"}],name:"AuthorisationChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"}],name:"TextChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"uint256",name:"contentType",type:"uint256"}],name:"ABIChanged",type:"event"}];class n{static createInterface(){return new f.KA(r)}static connect(e,a){return new d.NZ(e,r,a)}}n.abi=r;const i=[{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"_totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"who",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"}];class b{static createInterface(){return new f.KA(i)}static connect(e,a){return new d.NZ(e,i,a)}}b.abi=i;const o=[{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes[]",name:"returnData",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3[]",name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3Value[]",name:"calls",type:"tuple[]"}],name:"aggregate3Value",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"blockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"getBasefee",outputs:[{internalType:"uint256",name:"basefee",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getBlockNumber",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getChainId",outputs:[{internalType:"uint256",name:"chainid",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockCoinbase",outputs:[{internalType:"address",name:"coinbase",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockDifficulty",outputs:[{internalType:"uint256",name:"difficulty",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockGasLimit",outputs:[{internalType:"uint256",name:"gaslimit",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"getEthBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"tryAggregate",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"tryBlockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"}];class s{static createInterface(){return new f.KA(o)}static connect(e,a){return new d.NZ(e,o,a)}}s.abi=o;const l=[{inputs:[{internalType:"contract MultiWrapper",name:"_multiWrapper",type:"address"},{internalType:"contract IOracle[]",name:"existingOracles",type:"address[]"},{internalType:"enum OffchainOracle.OracleType[]",name:"oracleTypes",type:"uint8[]"},{internalType:"contract IERC20[]",name:"existingConnectors",type:"address[]"},{internalType:"contract IERC20",name:"wBase",type:"address"},{internalType:"address",name:"owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ArraysLengthMismatch",type:"error"},{inputs:[],name:"ConnectorAlreadyAdded",type:"error"},{inputs:[],name:"InvalidOracleTokenKind",type:"error"},{inputs:[],name:"OracleAlreadyAdded",type:"error"},{inputs:[],name:"SameTokens",type:"error"},{inputs:[],name:"TooBigThreshold",type:"error"},{inputs:[],name:"UnknownConnector",type:"error"},{inputs:[],name:"UnknownOracle",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IERC20",name:"connector",type:"address"}],name:"ConnectorAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IERC20",name:"connector",type:"address"}],name:"ConnectorRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract MultiWrapper",name:"multiWrapper",type:"address"}],name:"MultiWrapperUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IOracle",name:"oracle",type:"address"},{indexed:!1,internalType:"enum OffchainOracle.OracleType",name:"oracleType",type:"uint8"}],name:"OracleAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"contract IOracle",name:"oracle",type:"address"},{indexed:!1,internalType:"enum OffchainOracle.OracleType",name:"oracleType",type:"uint8"}],name:"OracleRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[{internalType:"contract IERC20",name:"connector",type:"address"}],name:"addConnector",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IOracle",name:"oracle",type:"address"},{internalType:"enum OffchainOracle.OracleType",name:"oracleKind",type:"uint8"}],name:"addOracle",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"connectors",outputs:[{internalType:"contract IERC20[]",name:"allConnectors",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"contract IERC20",name:"dstToken",type:"address"},{internalType:"bool",name:"useWrappers",type:"bool"}],name:"getRate",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"bool",name:"useSrcWrappers",type:"bool"}],name:"getRateToEth",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"bool",name:"useSrcWrappers",type:"bool"},{internalType:"contract IERC20[]",name:"customConnectors",type:"address[]"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateToEthWithCustomConnectors",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"bool",name:"useSrcWrappers",type:"bool"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateToEthWithThreshold",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"contract IERC20",name:"dstToken",type:"address"},{internalType:"bool",name:"useWrappers",type:"bool"},{internalType:"contract IERC20[]",name:"customConnectors",type:"address[]"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateWithCustomConnectors",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"srcToken",type:"address"},{internalType:"contract IERC20",name:"dstToken",type:"address"},{internalType:"bool",name:"useWrappers",type:"bool"},{internalType:"uint256",name:"thresholdFilter",type:"uint256"}],name:"getRateWithThreshold",outputs:[{internalType:"uint256",name:"weightedRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"multiWrapper",outputs:[{internalType:"contract MultiWrapper",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"oracles",outputs:[{internalType:"contract IOracle[]",name:"allOracles",type:"address[]"},{internalType:"enum OffchainOracle.OracleType[]",name:"oracleTypes",type:"uint8[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20",name:"connector",type:"address"}],name:"removeConnector",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IOracle",name:"oracle",type:"address"},{internalType:"enum OffchainOracle.OracleType",name:"oracleKind",type:"uint8"}],name:"removeOracle",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract MultiWrapper",name:"_multiWrapper",type:"address"}],name:"setMultiWrapper",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];class u{static createInterface(){return new f.KA(l)}static connect(e,a){return new d.NZ(e,l,a)}}u.abi=l;const h=[{inputs:[{internalType:"address",name:"_owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"DecimalsUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"GasPriceUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"L1BaseFeeUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"OverheadUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"",type:"uint256"}],name:"ScalarUpdated",type:"event"},{inputs:[],name:"decimals",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"gasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"getL1Fee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"getL1GasUsed",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"l1BaseFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"overhead",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"scalar",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_decimals",type:"uint256"}],name:"setDecimals",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_gasPrice",type:"uint256"}],name:"setGasPrice",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_baseFee",type:"uint256"}],name:"setL1BaseFee",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_overhead",type:"uint256"}],name:"setOverhead",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_scalar",type:"uint256"}],name:"setScalar",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];class p{static createInterface(){return new f.KA(h)}static connect(e,a){return new d.NZ(e,h,a)}}p.abi=h;const g=[{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address[]",name:"addresses",type:"address[]"}],name:"getNames",outputs:[{internalType:"string[]",name:"r",type:"string[]"}],stateMutability:"view",type:"function"}];class m{static createInterface(){return new f.KA(g)}static connect(e,a){return new d.NZ(e,g,a)}}m.abi=g},67418:(e,a,t)=>{"use strict";t.d(a,{$W:()=>w,EI:()=>v,Et:()=>i,Id:()=>l,Ju:()=>x,Kp:()=>p,Ll:()=>n,My:()=>g,aT:()=>m,ae:()=>A,br:()=>M,gn:()=>E,ib:()=>I,if:()=>h,iv:()=>b,jm:()=>y,lY:()=>u,sY:()=>_,uU:()=>C,wv:()=>s,yy:()=>o});var c=t(91565),f=t(39404),d=t.n(f),r=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));BigInt.prototype.toJSON=function(){return this.toString()};const n=!process.browser&&void 0===globalThis.window,i=n?c.webcrypto:globalThis.crypto,b=(e,a)=>[...Array(Math.ceil(e.length/a))].map(((t,c)=>e.slice(a*c,a+a*c)));function o(e){return new Promise((a=>setTimeout(a,e)))}function s(e,a){try{const t=new URL(e);return!a||!a.length||a.map((e=>e.toLowerCase())).includes(t.protocol)}catch(e){return!1}}function l(...e){const a=e.reduce(((e,a)=>e+a.length),0),t=new Uint8Array(a);return e.forEach(((e,a,c)=>{const f=c.slice(0,a).reduce(((e,a)=>e+a.length),0);t.set(e,f)})),t}function u(e){return new Uint8Array(e.buffer)}function h(e){return btoa(e.reduce(((e,a)=>e+String.fromCharCode(a)),""))}function p(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function g(e){return"0x"+Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("")}function m(e){return"0x"===e.slice(0,2)&&(e=e.replace("0x","")),e.length%2!=0&&(e="0"+e),Uint8Array.from(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))}function x(e){return BigInt(g(e))}function y(e){let a="bigint"==typeof e?e.toString(16):e;return a.startsWith("0x")&&(a=a.replace("0x","")),a.length%2!=0&&(a="0"+a),Uint8Array.from(a.match(/.{1,2}/g).map((e=>parseInt(e,16))))}function A(e){return new(d())(e,16,"le")}function v(e){return Uint8Array.from(new(d())(e).toArray("le",31))}function w(e,a=32){return"0x"+BigInt(e).toString(16).padStart(2*a,"0")}function _(e,a=32){return"0x"+(e=e.replace("0x","")).padStart(2*a,"0")}function I(e=31){return x(i.getRandomValues(new Uint8Array(e)))}function E(e,a){return"bigint"==typeof a?a.toString():a}function C(e,a=10){return e.length<2*a?e:`${e.substring(0,a)}...${e.substring(e.length-a)}`}function M(e,a="SHA-384"){return r(this,null,(function*(){return new Uint8Array(yield i.subtle.digest(a,e))}))}},26746:(e,a,t)=>{"use strict";t.d(a,{O:()=>b,i:()=>o});var c=t(84276),f=t(36336),d=t.n(f),r=t(67418),n=(e,a,t)=>new Promise(((c,f)=>{var d=e=>{try{n(t.next(e))}catch(e){f(e)}},r=e=>{try{n(t.throw(e))}catch(e){f(e)}},n=e=>e.done?c(e.value):Promise.resolve(e.value).then(d,r);n((t=t.apply(e,a)).next())}));let i;function b(){return n(this,null,(function*(){i||(i=yield d()({wasmInitialMemory:2e3}))}))}function o(e,a,t){return n(this,null,(function*(){i||(yield b());const f={root:e.root,nullifierHash:BigInt(e.nullifierHex).toString(),recipient:BigInt(e.recipient),relayer:BigInt(e.relayer),fee:e.fee,refund:e.refund,nullifier:e.nullifier,secret:e.secret,pathElements:e.pathElements,pathIndices:e.pathIndices};console.log("Start generating SNARK proof",f),console.time("SNARK proof time");const d=yield c.genWitnessAndProve(yield i,f,a,t),n=c.toSolidityInput(d).proof;return console.timeEnd("SNARK proof time"),{proof:n,args:[(0,r.$W)(e.root,32),(0,r.$W)(e.nullifierHex,32),e.recipient,e.relayer,(0,r.$W)(e.fee,32),(0,r.$W)(e.refund,32)]}}))}},32019:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.keccak512=a.keccak384=a.keccak256=a.keccak224=void 0;const c=t(32955),f=t(82672);a.keccak224=(0,f.wrapHash)(c.keccak_224),a.keccak256=(()=>{const e=(0,f.wrapHash)(c.keccak_256);return e.create=c.keccak_256.create,e})(),a.keccak384=(0,f.wrapHash)(c.keccak_384),a.keccak512=(0,f.wrapHash)(c.keccak_512)},26513:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.secp256k1=void 0;var c=t(8510);Object.defineProperty(a,"secp256k1",{enumerable:!0,get:function(){return c.secp256k1}})},82672:function(e,a,t){"use strict";e=t.nmd(e);var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.crypto=a.utf8ToBytes=a.createView=a.concatBytes=a.toHex=a.bytesToHex=a.assertBytes=a.assertBool=void 0,a.bytesToUtf8=function(e){if(!(e instanceof Uint8Array))throw new TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)},a.hexToBytes=function(e){const a=e.startsWith("0x")?e.substring(2):e;return(0,d.hexToBytes)(a)},a.equalsBytes=function(e,a){if(e.length!==a.length)return!1;for(let t=0;t(f.default.bytes(a),e(a))};const f=c(t(67557)),d=t(99175),r=f.default.bool;a.assertBool=r;const n=f.default.bytes;a.assertBytes=n;var i=t(99175);Object.defineProperty(a,"bytesToHex",{enumerable:!0,get:function(){return i.bytesToHex}}),Object.defineProperty(a,"toHex",{enumerable:!0,get:function(){return i.bytesToHex}}),Object.defineProperty(a,"concatBytes",{enumerable:!0,get:function(){return i.concatBytes}}),Object.defineProperty(a,"createView",{enumerable:!0,get:function(){return i.createView}}),Object.defineProperty(a,"utf8ToBytes",{enumerable:!0,get:function(){return i.utf8ToBytes}}),a.crypto=(()=>{const a="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,t="function"==typeof e.require&&e.require.bind(e);return{node:t&&!a?t("crypto"):void 0,web:a}})()},37007:e=>{"use strict";var a,t="object"==typeof Reflect?Reflect:null,c=t&&"function"==typeof t.apply?t.apply:function(e,a,t){return Function.prototype.apply.call(e,a,t)};a=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var f=Number.isNaN||function(e){return e!=e};function d(){d.init.call(this)}e.exports=d,e.exports.once=function(e,a){return new Promise((function(t,c){function f(t){e.removeListener(a,d),c(t)}function d(){"function"==typeof e.removeListener&&e.removeListener("error",f),t([].slice.call(arguments))}p(e,a,d,{once:!0}),"error"!==a&&function(e,a){"function"==typeof e.on&&p(e,"error",a,{once:!0})}(e,f)}))},d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var r=10;function n(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function i(e){return void 0===e._maxListeners?d.defaultMaxListeners:e._maxListeners}function b(e,a,t,c){var f,d,r,b;if(n(t),void 0===(d=e._events)?(d=e._events=Object.create(null),e._eventsCount=0):(void 0!==d.newListener&&(e.emit("newListener",a,t.listener?t.listener:t),d=e._events),r=d[a]),void 0===r)r=d[a]=t,++e._eventsCount;else if("function"==typeof r?r=d[a]=c?[t,r]:[r,t]:c?r.unshift(t):r.push(t),(f=i(e))>0&&r.length>f&&!r.warned){r.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=a,o.count=r.length,b=o,console&&console.warn&&console.warn(b)}return e}function o(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(e,a,t){var c={fired:!1,wrapFn:void 0,target:e,type:a,listener:t},f=o.bind(c);return f.listener=t,c.wrapFn=f,f}function l(e,a,t){var c=e._events;if(void 0===c)return[];var f=c[a];return void 0===f?[]:"function"==typeof f?t?[f.listener||f]:[f]:t?function(e){for(var a=new Array(e.length),t=0;t0&&(r=a[0]),r instanceof Error)throw r;var n=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw n.context=r,n}var i=d[e];if(void 0===i)return!1;if("function"==typeof i)c(i,this,a);else{var b=i.length,o=h(i,b);for(t=0;t=0;d--)if(t[d]===a||t[d].listener===a){r=t[d].listener,f=d;break}if(f<0)return this;0===f?t.shift():function(e,a){for(;a+1=0;c--)this.removeListener(e,a[c]);return this},d.prototype.listeners=function(e){return l(this,e,!0)},d.prototype.rawListeners=function(e){return l(this,e,!1)},d.listenerCount=function(e,a){return"function"==typeof e.listenerCount?e.listenerCount(a):u.call(e,a)},d.prototype.listenerCount=u,d.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},68078:(e,a,t)=>{var c=t(92861).Buffer,f=t(88276);e.exports=function(e,a,t,d){if(c.isBuffer(e)||(e=c.from(e,"binary")),a&&(c.isBuffer(a)||(a=c.from(a,"binary")),8!==a.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var r=t/8,n=c.alloc(r),i=c.alloc(d||0),b=c.alloc(0);r>0||d>0;){var o=new f;o.update(b),o.update(e),a&&o.update(a),b=o.digest();var s=0;if(r>0){var l=n.length-r;s=Math.min(r,b.length),b.copy(n,l,0,s),r-=s}if(s0){var u=i.length-d,h=Math.min(d,b.length-s);b.copy(i,u,s,s+h),d-=h}}return b.fill(0),{key:n,iv:i}}},32017:e=>{"use strict";e.exports=function e(a,t){if(a===t)return!0;if(a&&t&&"object"==typeof a&&"object"==typeof t){if(a.constructor!==t.constructor)return!1;var c,f,d;if(Array.isArray(a)){if((c=a.length)!=t.length)return!1;for(f=c;0!=f--;)if(!e(a[f],t[f]))return!1;return!0}if(a.constructor===RegExp)return a.source===t.source&&a.flags===t.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===t.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===t.toString();if((c=(d=Object.keys(a)).length)!==Object.keys(t).length)return!1;for(f=c;0!=f--;)if(!Object.prototype.hasOwnProperty.call(t,d[f]))return!1;for(f=c;0!=f--;){var r=d[f];if(!e(a[r],t[r]))return!1}return!0}return a!=a&&t!=t}},82682:(e,a,t)=>{"use strict";var c=t(69600),f=Object.prototype.toString,d=Object.prototype.hasOwnProperty;e.exports=function(e,a,t){if(!c(a))throw new TypeError("iterator must be a function");var r;arguments.length>=3&&(r=t),"[object Array]"===f.call(e)?function(e,a,t){for(var c=0,f=e.length;c{"use strict";var a=Object.prototype.toString,t=Math.max,c=function(e,a){for(var t=[],c=0;c{"use strict";var c=t(89353);e.exports=Function.prototype.bind||c},70453:(e,a,t)=>{"use strict";var c,f=t(69383),d=t(41237),r=t(79290),n=t(79538),i=t(58068),b=t(69675),o=t(35345),s=Function,l=function(e){try{return s('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var h=function(){throw new b},p=u?function(){try{return h}catch(e){try{return u(arguments,"callee").get}catch(e){return h}}}():h,g=t(64039)(),m=t(80024)(),x=Object.getPrototypeOf||(m?function(e){return e.__proto__}:null),y={},A="undefined"!=typeof Uint8Array&&x?x(Uint8Array):c,v={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?c:ArrayBuffer,"%ArrayIteratorPrototype%":g&&x?x([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?c:Atomics,"%BigInt%":"undefined"==typeof BigInt?c:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?c:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?c:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":f,"%eval%":eval,"%EvalError%":d,"%Float32Array%":"undefined"==typeof Float32Array?c:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?c:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?c:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?c:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?c:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&x?x(x([][Symbol.iterator]())):c,"%JSON%":"object"==typeof JSON?JSON:c,"%Map%":"undefined"==typeof Map?c:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&x?x((new Map)[Symbol.iterator]()):c,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?c:Promise,"%Proxy%":"undefined"==typeof Proxy?c:Proxy,"%RangeError%":r,"%ReferenceError%":n,"%Reflect%":"undefined"==typeof Reflect?c:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?c:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&x?x((new Set)[Symbol.iterator]()):c,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&x?x(""[Symbol.iterator]()):c,"%Symbol%":g?Symbol:c,"%SyntaxError%":i,"%ThrowTypeError%":p,"%TypedArray%":A,"%TypeError%":b,"%Uint8Array%":"undefined"==typeof Uint8Array?c:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?c:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?c:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?c:Uint32Array,"%URIError%":o,"%WeakMap%":"undefined"==typeof WeakMap?c:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?c:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?c:WeakSet};if(x)try{null.error}catch(e){var w=x(x(e));v["%Error.prototype%"]=w}var _=function e(a){var t;if("%AsyncFunction%"===a)t=l("async function () {}");else if("%GeneratorFunction%"===a)t=l("function* () {}");else if("%AsyncGeneratorFunction%"===a)t=l("async function* () {}");else if("%AsyncGenerator%"===a){var c=e("%AsyncGeneratorFunction%");c&&(t=c.prototype)}else if("%AsyncIteratorPrototype%"===a){var f=e("%AsyncGenerator%");f&&x&&(t=x(f.prototype))}return v[a]=t,t},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},E=t(66743),C=t(9957),M=E.call(Function.call,Array.prototype.concat),B=E.call(Function.apply,Array.prototype.splice),L=E.call(Function.call,String.prototype.replace),S=E.call(Function.call,String.prototype.slice),k=E.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,P=/\\(\\)?/g,R=function(e,a){var t,c=e;if(C(I,c)&&(c="%"+(t=I[c])[0]+"%"),C(v,c)){var f=v[c];if(f===y&&(f=_(c)),void 0===f&&!a)throw new b("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:t,name:c,value:f}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,a){if("string"!=typeof e||0===e.length)throw new b("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof a)throw new b('"allowMissing" argument must be a boolean');if(null===k(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=function(e){var a=S(e,0,1),t=S(e,-1);if("%"===a&&"%"!==t)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==a)throw new i("invalid intrinsic syntax, expected opening `%`");var c=[];return L(e,N,(function(e,a,t,f){c[c.length]=t?L(f,P,"$1"):a||e})),c}(e),c=t.length>0?t[0]:"",f=R("%"+c+"%",a),d=f.name,r=f.value,n=!1,o=f.alias;o&&(c=o[0],B(t,M([0,1],o)));for(var s=1,l=!0;s=t.length){var m=u(r,h);r=(l=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:r[h]}else l=C(r,h),r=r[h];l&&!n&&(v[d]=r)}}return r}},75795:(e,a,t)=>{"use strict";var c=t(70453)("%Object.getOwnPropertyDescriptor%",!0);if(c)try{c([],"length")}catch(e){c=null}e.exports=c},30592:(e,a,t)=>{"use strict";var c=t(30655),f=function(){return!!c};f.hasArrayLengthDefineBug=function(){if(!c)return null;try{return 1!==c([],"length",{value:1}).length}catch(e){return!0}},e.exports=f},80024:e=>{"use strict";var a={__proto__:null,foo:{}},t=Object;e.exports=function(){return{__proto__:a}.foo===a.foo&&!(a instanceof t)}},64039:(e,a,t)=>{"use strict";var c="undefined"!=typeof Symbol&&Symbol,f=t(41333);e.exports=function(){return"function"==typeof c&&"function"==typeof Symbol&&"symbol"==typeof c("foo")&&"symbol"==typeof Symbol("bar")&&f()}},41333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},a=Symbol("test"),t=Object(a);if("string"==typeof a)return!1;if("[object Symbol]"!==Object.prototype.toString.call(a))return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;for(a in e[a]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var c=Object.getOwnPropertySymbols(e);if(1!==c.length||c[0]!==a)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,a))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var f=Object.getOwnPropertyDescriptor(e,a);if(42!==f.value||!0!==f.enumerable)return!1}return!0}},49092:(e,a,t)=>{"use strict";var c=t(41333);e.exports=function(){return c()&&!!Symbol.toStringTag}},77952:(e,a,t)=>{var c=a;c.utils=t(67426),c.common=t(66166),c.sha=t(46229),c.ripemd=t(46784),c.hmac=t(28948),c.sha1=c.sha.sha1,c.sha256=c.sha.sha256,c.sha224=c.sha.sha224,c.sha384=c.sha.sha384,c.sha512=c.sha.sha512,c.ripemd160=c.ripemd.ripemd160},66166:(e,a,t)=>{"use strict";var c=t(67426),f=t(43349);function d(){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}a.BlockHash=d,d.prototype.update=function(e,a){if(e=c.toArray(e,a),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var t=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-t,e.length),0===this.pending.length&&(this.pending=null),e=c.join32(e,0,e.length-t,this.endian);for(var f=0;f>>24&255,c[f++]=e>>>16&255,c[f++]=e>>>8&255,c[f++]=255&e}else for(c[f++]=255&e,c[f++]=e>>>8&255,c[f++]=e>>>16&255,c[f++]=e>>>24&255,c[f++]=0,c[f++]=0,c[f++]=0,c[f++]=0,d=8;d{"use strict";var c=t(67426),f=t(43349);function d(e,a,t){if(!(this instanceof d))return new d(e,a,t);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(c.toArray(a,t))}e.exports=d,d.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),f(e.length<=this.blockSize);for(var a=e.length;a{"use strict";var c=t(67426),f=t(66166),d=c.rotl32,r=c.sum32,n=c.sum32_3,i=c.sum32_4,b=f.BlockHash;function o(){if(!(this instanceof o))return new o;b.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function s(e,a,t,c){return e<=15?a^t^c:e<=31?a&t|~a&c:e<=47?(a|~t)^c:e<=63?a&c|t&~c:a^(t|~c)}function l(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function u(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}c.inherits(o,b),a.ripemd160=o,o.blockSize=512,o.outSize=160,o.hmacStrength=192,o.padLength=64,o.prototype._update=function(e,a){for(var t=this.h[0],c=this.h[1],f=this.h[2],b=this.h[3],o=this.h[4],x=t,y=c,A=f,v=b,w=o,_=0;_<80;_++){var I=r(d(i(t,s(_,c,f,b),e[h[_]+a],l(_)),g[_]),o);t=o,o=b,b=d(f,10),f=c,c=I,I=r(d(i(x,s(79-_,y,A,v),e[p[_]+a],u(_)),m[_]),w),x=w,w=v,v=d(A,10),A=y,y=I}I=n(this.h[1],f,v),this.h[1]=n(this.h[2],b,w),this.h[2]=n(this.h[3],o,x),this.h[3]=n(this.h[4],t,y),this.h[4]=n(this.h[0],c,A),this.h[0]=I},o.prototype._digest=function(e){return"hex"===e?c.toHex32(this.h,"little"):c.split32(this.h,"little")};var h=[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],p=[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],g=[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],m=[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]},46229:(e,a,t)=>{"use strict";a.sha1=t(43917),a.sha224=t(47714),a.sha256=t(2287),a.sha384=t(21911),a.sha512=t(57766)},43917:(e,a,t)=>{"use strict";var c=t(67426),f=t(66166),d=t(66225),r=c.rotl32,n=c.sum32,i=c.sum32_5,b=d.ft_1,o=f.BlockHash,s=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}c.inherits(l,o),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,a){for(var t=this.W,c=0;c<16;c++)t[c]=e[a+c];for(;c{"use strict";var c=t(67426),f=t(2287);function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}c.inherits(d,f),e.exports=d,d.blockSize=512,d.outSize=224,d.hmacStrength=192,d.padLength=64,d.prototype._digest=function(e){return"hex"===e?c.toHex32(this.h.slice(0,7),"big"):c.split32(this.h.slice(0,7),"big")}},2287:(e,a,t)=>{"use strict";var c=t(67426),f=t(66166),d=t(66225),r=t(43349),n=c.sum32,i=c.sum32_4,b=c.sum32_5,o=d.ch32,s=d.maj32,l=d.s0_256,u=d.s1_256,h=d.g0_256,p=d.g1_256,g=f.BlockHash,m=[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 x(){if(!(this instanceof x))return new x;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}c.inherits(x,g),e.exports=x,x.blockSize=512,x.outSize=256,x.hmacStrength=192,x.padLength=64,x.prototype._update=function(e,a){for(var t=this.W,c=0;c<16;c++)t[c]=e[a+c];for(;c{"use strict";var c=t(67426),f=t(57766);function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}c.inherits(d,f),e.exports=d,d.blockSize=1024,d.outSize=384,d.hmacStrength=192,d.padLength=128,d.prototype._digest=function(e){return"hex"===e?c.toHex32(this.h.slice(0,12),"big"):c.split32(this.h.slice(0,12),"big")}},57766:(e,a,t)=>{"use strict";var c=t(67426),f=t(66166),d=t(43349),r=c.rotr64_hi,n=c.rotr64_lo,i=c.shr64_hi,b=c.shr64_lo,o=c.sum64,s=c.sum64_hi,l=c.sum64_lo,u=c.sum64_4_hi,h=c.sum64_4_lo,p=c.sum64_5_hi,g=c.sum64_5_lo,m=f.BlockHash,x=[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 y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=x,this.W=new Array(160)}function A(e,a,t,c,f){var d=e&t^~e&f;return d<0&&(d+=4294967296),d}function v(e,a,t,c,f,d){var r=a&c^~a&d;return r<0&&(r+=4294967296),r}function w(e,a,t,c,f){var d=e&t^e&f^t&f;return d<0&&(d+=4294967296),d}function _(e,a,t,c,f,d){var r=a&c^a&d^c&d;return r<0&&(r+=4294967296),r}function I(e,a){var t=r(e,a,28)^r(a,e,2)^r(a,e,7);return t<0&&(t+=4294967296),t}function E(e,a){var t=n(e,a,28)^n(a,e,2)^n(a,e,7);return t<0&&(t+=4294967296),t}function C(e,a){var t=n(e,a,14)^n(e,a,18)^n(a,e,9);return t<0&&(t+=4294967296),t}function M(e,a){var t=r(e,a,1)^r(e,a,8)^i(e,a,7);return t<0&&(t+=4294967296),t}function B(e,a){var t=n(e,a,1)^n(e,a,8)^b(e,a,7);return t<0&&(t+=4294967296),t}function L(e,a){var t=n(e,a,19)^n(a,e,29)^b(e,a,6);return t<0&&(t+=4294967296),t}c.inherits(y,m),e.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(e,a){for(var t=this.W,c=0;c<32;c++)t[c]=e[a+c];for(;c{"use strict";var c=t(67426).rotr32;function f(e,a,t){return e&a^~e&t}function d(e,a,t){return e&a^e&t^a&t}function r(e,a,t){return e^a^t}a.ft_1=function(e,a,t,c){return 0===e?f(a,t,c):1===e||3===e?r(a,t,c):2===e?d(a,t,c):void 0},a.ch32=f,a.maj32=d,a.p32=r,a.s0_256=function(e){return c(e,2)^c(e,13)^c(e,22)},a.s1_256=function(e){return c(e,6)^c(e,11)^c(e,25)},a.g0_256=function(e){return c(e,7)^c(e,18)^e>>>3},a.g1_256=function(e){return c(e,17)^c(e,19)^e>>>10}},67426:(e,a,t)=>{"use strict";var c=t(43349),f=t(56698);function d(e,a){return 55296==(64512&e.charCodeAt(a))&&!(a<0||a+1>=e.length)&&56320==(64512&e.charCodeAt(a+1))}function r(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function i(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}a.inherits=f,a.toArray=function(e,a){if(Array.isArray(e))return e.slice();if(!e)return[];var t=[];if("string"==typeof e)if(a){if("hex"===a)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),f=0;f>6|192,t[c++]=63&r|128):d(e,f)?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++f)),t[c++]=r>>18|240,t[c++]=r>>12&63|128,t[c++]=r>>6&63|128,t[c++]=63&r|128):(t[c++]=r>>12|224,t[c++]=r>>6&63|128,t[c++]=63&r|128)}else for(f=0;f>>0}return r},a.split32=function(e,a){for(var t=new Array(4*e.length),c=0,f=0;c>>24,t[f+1]=d>>>16&255,t[f+2]=d>>>8&255,t[f+3]=255&d):(t[f+3]=d>>>24,t[f+2]=d>>>16&255,t[f+1]=d>>>8&255,t[f]=255&d)}return t},a.rotr32=function(e,a){return e>>>a|e<<32-a},a.rotl32=function(e,a){return e<>>32-a},a.sum32=function(e,a){return e+a>>>0},a.sum32_3=function(e,a,t){return e+a+t>>>0},a.sum32_4=function(e,a,t,c){return e+a+t+c>>>0},a.sum32_5=function(e,a,t,c,f){return e+a+t+c+f>>>0},a.sum64=function(e,a,t,c){var f=e[a],d=c+e[a+1]>>>0,r=(d>>0,e[a+1]=d},a.sum64_hi=function(e,a,t,c){return(a+c>>>0>>0},a.sum64_lo=function(e,a,t,c){return a+c>>>0},a.sum64_4_hi=function(e,a,t,c,f,d,r,n){var i=0,b=a;return i+=(b=b+c>>>0)>>0)>>0)>>0},a.sum64_4_lo=function(e,a,t,c,f,d,r,n){return a+c+d+n>>>0},a.sum64_5_hi=function(e,a,t,c,f,d,r,n,i,b){var o=0,s=a;return o+=(s=s+c>>>0)>>0)>>0)>>0)>>0},a.sum64_5_lo=function(e,a,t,c,f,d,r,n,i,b){return a+c+d+n+b>>>0},a.rotr64_hi=function(e,a,t){return(a<<32-t|e>>>t)>>>0},a.rotr64_lo=function(e,a,t){return(e<<32-t|a>>>t)>>>0},a.shr64_hi=function(e,a,t){return e>>>t},a.shr64_lo=function(e,a,t){return(e<<32-t|a>>>t)>>>0}},9957:(e,a,t)=>{"use strict";var c=Function.prototype.call,f=Object.prototype.hasOwnProperty,d=t(66743);e.exports=d.call(c,f)},32723:(e,a,t)=>{"use strict";var c=t(77952),f=t(64367),d=t(43349);function r(e){if(!(this instanceof r))return new r(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var a=f.toArray(e.entropy,e.entropyEnc||"hex"),t=f.toArray(e.nonce,e.nonceEnc||"hex"),c=f.toArray(e.pers,e.persEnc||"hex");d(a.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(a,t,c)}e.exports=r,r.prototype._init=function(e,a,t){var c=e.concat(a).concat(t);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(t||[])),this._reseed=1},r.prototype.generate=function(e,a,t,c){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof a&&(c=t,t=a,a=null),t&&(t=f.toArray(t,c||"hex"),this._update(t));for(var d=[];d.length{var c=t(11568),f=t(23276),d=e.exports;for(var r in c)c.hasOwnProperty(r)&&(d[r]=c[r]);function n(e){if("string"==typeof e&&(e=f.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}d.request=function(e,a){return e=n(e),c.request.call(this,e,a)},d.get=function(e,a){return e=n(e),c.get.call(this,e,a)}},251:(e,a)=>{a.read=function(e,a,t,c,f){var d,r,n=8*f-c-1,i=(1<>1,o=-7,s=t?f-1:0,l=t?-1:1,u=e[a+s];for(s+=l,d=u&(1<<-o)-1,u>>=-o,o+=n;o>0;d=256*d+e[a+s],s+=l,o-=8);for(r=d&(1<<-o)-1,d>>=-o,o+=c;o>0;r=256*r+e[a+s],s+=l,o-=8);if(0===d)d=1-b;else{if(d===i)return r?NaN:1/0*(u?-1:1);r+=Math.pow(2,c),d-=b}return(u?-1:1)*r*Math.pow(2,d-c)},a.write=function(e,a,t,c,f,d){var r,n,i,b=8*d-f-1,o=(1<>1,l=23===f?Math.pow(2,-24)-Math.pow(2,-77):0,u=c?0:d-1,h=c?1:-1,p=a<0||0===a&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(n=isNaN(a)?1:0,r=o):(r=Math.floor(Math.log(a)/Math.LN2),a*(i=Math.pow(2,-r))<1&&(r--,i*=2),(a+=r+s>=1?l/i:l*Math.pow(2,1-s))*i>=2&&(r++,i/=2),r+s>=o?(n=0,r=o):r+s>=1?(n=(a*i-1)*Math.pow(2,f),r+=s):(n=a*Math.pow(2,s-1)*Math.pow(2,f),r=0));f>=8;e[t+u]=255&n,u+=h,n/=256,f-=8);for(r=r<0;e[t+u]=255&r,u+=h,r/=256,b-=8);e[t+u-h]|=128*p}},56698:e=>{"function"==typeof Object.create?e.exports=function(e,a){a&&(e.super_=a,e.prototype=Object.create(a.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,a){if(a){e.super_=a;var t=function(){};t.prototype=a.prototype,e.prototype=new t,e.prototype.constructor=e}}},47244:(e,a,t)=>{"use strict";var c=t(49092)(),f=t(38075)("Object.prototype.toString"),d=function(e){return!(c&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===f(e)},r=function(e){return!!d(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==f(e)&&"[object Function]"===f(e.callee)},n=function(){return d(arguments)}();d.isLegacyArguments=r,e.exports=n?d:r},69600:e=>{"use strict";var a,t,c=Function.prototype.toString,f="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof f&&"function"==typeof Object.defineProperty)try{a=Object.defineProperty({},"length",{get:function(){throw t}}),t={},f((function(){throw 42}),null,a)}catch(e){e!==t&&(f=null)}else f=null;var d=/^\s*class\b/,r=function(e){try{var a=c.call(e);return d.test(a)}catch(e){return!1}},n=function(e){try{return!r(e)&&(c.call(e),!0)}catch(e){return!1}},i=Object.prototype.toString,b="function"==typeof Symbol&&!!Symbol.toStringTag,o=!(0 in[,]),s=function(){return!1};if("object"==typeof document){var l=document.all;i.call(l)===i.call(document.all)&&(s=function(e){if((o||!e)&&(void 0===e||"object"==typeof e))try{var a=i.call(e);return("[object HTMLAllCollection]"===a||"[object HTML document.all class]"===a||"[object HTMLCollection]"===a||"[object Object]"===a)&&null==e("")}catch(e){}return!1})}e.exports=f?function(e){if(s(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{f(e,null,a)}catch(e){if(e!==t)return!1}return!r(e)&&n(e)}:function(e){if(s(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(b)return n(e);if(r(e))return!1;var a=i.call(e);return!("[object Function]"!==a&&"[object GeneratorFunction]"!==a&&!/^\[object HTML/.test(a))&&n(e)}},48184:(e,a,t)=>{"use strict";var c,f=Object.prototype.toString,d=Function.prototype.toString,r=/^\s*(?:function)?\*/,n=t(49092)(),i=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(r.test(d.call(e)))return!0;if(!n)return"[object GeneratorFunction]"===f.call(e);if(!i)return!1;if(void 0===c){var a=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch(e){}}();c=!!a&&i(a)}return i(e)===c}},13003:e=>{"use strict";e.exports=function(e){return e!=e}},24133:(e,a,t)=>{"use strict";var c=t(10487),f=t(38452),d=t(13003),r=t(76642),n=t(92464),i=c(r(),Number);f(i,{getPolyfill:r,implementation:d,shim:n}),e.exports=i},76642:(e,a,t)=>{"use strict";var c=t(13003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:c}},92464:(e,a,t)=>{"use strict";var c=t(38452),f=t(76642);e.exports=function(){var e=f();return c(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},35680:(e,a,t)=>{"use strict";var c=t(25767);e.exports=function(e){return!!c(e)}},31176:(e,a,t)=>{var c;!function(){"use strict";var f="input is invalid type",d="object"==typeof window,r=d?window:{};r.JS_SHA3_NO_WINDOW&&(d=!1);var n=!d&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=t.g:n&&(r=self);var i=!r.JS_SHA3_NO_COMMON_JS&&e.exports,b=t.amdO,o=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),l=[4,1024,262144,67108864],u=[0,8,16,24],h=[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],p=[224,256,384,512],g=[128,256],m=["hex","buffer","arrayBuffer","array","digest"],x={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!o||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var y=function(e,a,t){return function(c){return new R(e,a,e).update(c)[t]()}},A=function(e,a,t){return function(c,f){return new R(e,a,f).update(c)[t]()}},v=function(e,a,t){return function(a,c,f,d){return C["cshake"+e].update(a,c,f,d)[t]()}},w=function(e,a,t){return function(a,c,f,d){return C["kmac"+e].update(a,c,f,d)[t]()}},_=function(e,a,t,c){for(var f=0;f>5,this.byteCount=this.blockCount<<2,this.outputBlocks=t>>5,this.extraBytes=(31&t)>>3;for(var c=0;c<50;++c)this.s[c]=0}function O(e,a,t){R.call(this,e,a,t)}R.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var a,t=typeof e;if("string"!==t){if("object"!==t)throw new Error(f);if(null===e)throw new Error(f);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||o&&ArrayBuffer.isView(e)))throw new Error(f);a=!0}for(var c,d,r=this.blocks,n=this.byteCount,i=e.length,b=this.blockCount,s=0,l=this.s;s>2]|=e[s]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(r[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=n){for(this.start=c-n,this.block=r[b],c=0;c>=8);t>0;)f.unshift(t),t=255&(e>>=8),++c;return a?f.push(c):f.unshift(c),this.update(f),f.length},R.prototype.encodeString=function(e){var a,t=typeof e;if("string"!==t){if("object"!==t)throw new Error(f);if(null===e)throw new Error(f);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||o&&ArrayBuffer.isView(e)))throw new Error(f);a=!0}var c=0,d=e.length;if(a)c=d;else for(var r=0;r=57344?c+=3:(n=65536+((1023&n)<<10|1023&e.charCodeAt(++r)),c+=4)}return c+=this.encode(8*c),this.update(e),c},R.prototype.bytepad=function(e,a){for(var t=this.encode(a),c=0;c>2]|=this.padding[3&a],this.lastByteIndex===this.byteCount)for(e[0]=e[t],a=1;a>4&15]+s[15&e]+s[e>>12&15]+s[e>>8&15]+s[e>>20&15]+s[e>>16&15]+s[e>>28&15]+s[e>>24&15];r%a==0&&(T(t),d=0)}return f&&(e=t[d],n+=s[e>>4&15]+s[15&e],f>1&&(n+=s[e>>12&15]+s[e>>8&15]),f>2&&(n+=s[e>>20&15]+s[e>>16&15])),n},R.prototype.arrayBuffer=function(){this.finalize();var e,a=this.blockCount,t=this.s,c=this.outputBlocks,f=this.extraBytes,d=0,r=0,n=this.outputBits>>3;e=f?new ArrayBuffer(c+1<<2):new ArrayBuffer(n);for(var i=new Uint32Array(e);r>8&255,i[e+2]=a>>16&255,i[e+3]=a>>24&255;n%t==0&&T(c)}return d&&(e=n<<2,a=c[r],i[e]=255&a,d>1&&(i[e+1]=a>>8&255),d>2&&(i[e+2]=a>>16&255)),i},O.prototype=new R,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var T=function(e){var a,t,c,f,d,r,n,i,b,o,s,l,u,p,g,m,x,y,A,v,w,_,I,E,C,M,B,L,S,k,N,P,R,O,T,D,F,Q,U,j,H,$,q,G,z,K,V,Z,J,W,Y,X,ee,ae,te,ce,fe,de,re,ne,ie,be,oe;for(c=0;c<48;c+=2)f=e[0]^e[10]^e[20]^e[30]^e[40],d=e[1]^e[11]^e[21]^e[31]^e[41],r=e[2]^e[12]^e[22]^e[32]^e[42],n=e[3]^e[13]^e[23]^e[33]^e[43],i=e[4]^e[14]^e[24]^e[34]^e[44],b=e[5]^e[15]^e[25]^e[35]^e[45],o=e[6]^e[16]^e[26]^e[36]^e[46],s=e[7]^e[17]^e[27]^e[37]^e[47],a=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(r<<1|n>>>31),t=(u=e[9]^e[19]^e[29]^e[39]^e[49])^(n<<1|r>>>31),e[0]^=a,e[1]^=t,e[10]^=a,e[11]^=t,e[20]^=a,e[21]^=t,e[30]^=a,e[31]^=t,e[40]^=a,e[41]^=t,a=f^(i<<1|b>>>31),t=d^(b<<1|i>>>31),e[2]^=a,e[3]^=t,e[12]^=a,e[13]^=t,e[22]^=a,e[23]^=t,e[32]^=a,e[33]^=t,e[42]^=a,e[43]^=t,a=r^(o<<1|s>>>31),t=n^(s<<1|o>>>31),e[4]^=a,e[5]^=t,e[14]^=a,e[15]^=t,e[24]^=a,e[25]^=t,e[34]^=a,e[35]^=t,e[44]^=a,e[45]^=t,a=i^(l<<1|u>>>31),t=b^(u<<1|l>>>31),e[6]^=a,e[7]^=t,e[16]^=a,e[17]^=t,e[26]^=a,e[27]^=t,e[36]^=a,e[37]^=t,e[46]^=a,e[47]^=t,a=o^(f<<1|d>>>31),t=s^(d<<1|f>>>31),e[8]^=a,e[9]^=t,e[18]^=a,e[19]^=t,e[28]^=a,e[29]^=t,e[38]^=a,e[39]^=t,e[48]^=a,e[49]^=t,p=e[0],g=e[1],K=e[11]<<4|e[10]>>>28,V=e[10]<<4|e[11]>>>28,L=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,ne=e[31]<<9|e[30]>>>23,ie=e[30]<<9|e[31]>>>23,$=e[40]<<18|e[41]>>>14,q=e[41]<<18|e[40]>>>14,O=e[2]<<1|e[3]>>>31,T=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,x=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,k=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,be=e[42]<<2|e[43]>>>30,oe=e[43]<<2|e[42]>>>30,ae=e[5]<<30|e[4]>>>2,te=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,F=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,W=e[34]<<15|e[35]>>>17,Y=e[35]<<15|e[34]>>>17,P=e[45]<<29|e[44]>>>3,R=e[44]<<29|e[45]>>>3,E=e[6]<<28|e[7]>>>4,C=e[7]<<28|e[6]>>>4,ce=e[17]<<23|e[16]>>>9,fe=e[16]<<23|e[17]>>>9,Q=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,v=e[36]<<21|e[37]>>>11,w=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,G=e[8]<<27|e[9]>>>5,z=e[9]<<27|e[8]>>>5,M=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,de=e[29]<<7|e[28]>>>25,re=e[28]<<7|e[29]>>>25,j=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,I=e[49]<<14|e[48]>>>18,e[0]=p^~m&y,e[1]=g^~x&A,e[10]=E^~M&L,e[11]=C^~B&S,e[20]=O^~D&Q,e[21]=T^~F&U,e[30]=G^~K&Z,e[31]=z^~V&J,e[40]=ae^~ce&de,e[41]=te^~fe&re,e[2]=m^~y&v,e[3]=x^~A&w,e[12]=M^~L&k,e[13]=B^~S&N,e[22]=D^~Q&j,e[23]=F^~U&H,e[32]=K^~Z&W,e[33]=V^~J&Y,e[42]=ce^~de&ne,e[43]=fe^~re&ie,e[4]=y^~v&_,e[5]=A^~w&I,e[14]=L^~k&P,e[15]=S^~N&R,e[24]=Q^~j&$,e[25]=U^~H&q,e[34]=Z^~W&X,e[35]=J^~Y&ee,e[44]=de^~ne&be,e[45]=re^~ie&oe,e[6]=v^~_&p,e[7]=w^~I&g,e[16]=k^~P&E,e[17]=N^~R&C,e[26]=j^~$&O,e[27]=H^~q&T,e[36]=W^~X&G,e[37]=Y^~ee&z,e[46]=ne^~be&ae,e[47]=ie^~oe&te,e[8]=_^~p&m,e[9]=I^~g&x,e[18]=P^~E&M,e[19]=R^~C&B,e[28]=$^~O&D,e[29]=q^~T&F,e[38]=X^~G&K,e[39]=ee^~z&V,e[48]=be^~ae&ce,e[49]=oe^~te&fe,e[0]^=h[c],e[1]^=h[c+1]};if(i)e.exports=C;else{for(B=0;B{"use strict";var a=e.exports=function(e,a,c){"function"==typeof a&&(c=a,a={}),t(a,"function"==typeof(c=a.cb||c)?c:c.pre||function(){},c.post||function(){},e,"",e)};function t(e,c,f,d,r,n,i,b,o,s){if(d&&"object"==typeof d&&!Array.isArray(d)){for(var l in c(d,r,n,i,b,o,s),d){var u=d[l];if(Array.isArray(u)){if(l in a.arrayKeywords)for(var h=0;h{"use strict";var c=t(56698),f=t(73726),d=t(92861).Buffer,r=new Array(16);function n(){f.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function i(e,a){return e<>>32-a}function b(e,a,t,c,f,d,r){return i(e+(a&t|~a&c)+f+d|0,r)+a|0}function o(e,a,t,c,f,d,r){return i(e+(a&c|t&~c)+f+d|0,r)+a|0}function s(e,a,t,c,f,d,r){return i(e+(a^t^c)+f+d|0,r)+a|0}function l(e,a,t,c,f,d,r){return i(e+(t^(a|~c))+f+d|0,r)+a|0}c(n,f),n.prototype._update=function(){for(var e=r,a=0;a<16;++a)e[a]=this._block.readInt32LE(4*a);var t=this._a,c=this._b,f=this._c,d=this._d;t=b(t,c,f,d,e[0],3614090360,7),d=b(d,t,c,f,e[1],3905402710,12),f=b(f,d,t,c,e[2],606105819,17),c=b(c,f,d,t,e[3],3250441966,22),t=b(t,c,f,d,e[4],4118548399,7),d=b(d,t,c,f,e[5],1200080426,12),f=b(f,d,t,c,e[6],2821735955,17),c=b(c,f,d,t,e[7],4249261313,22),t=b(t,c,f,d,e[8],1770035416,7),d=b(d,t,c,f,e[9],2336552879,12),f=b(f,d,t,c,e[10],4294925233,17),c=b(c,f,d,t,e[11],2304563134,22),t=b(t,c,f,d,e[12],1804603682,7),d=b(d,t,c,f,e[13],4254626195,12),f=b(f,d,t,c,e[14],2792965006,17),t=o(t,c=b(c,f,d,t,e[15],1236535329,22),f,d,e[1],4129170786,5),d=o(d,t,c,f,e[6],3225465664,9),f=o(f,d,t,c,e[11],643717713,14),c=o(c,f,d,t,e[0],3921069994,20),t=o(t,c,f,d,e[5],3593408605,5),d=o(d,t,c,f,e[10],38016083,9),f=o(f,d,t,c,e[15],3634488961,14),c=o(c,f,d,t,e[4],3889429448,20),t=o(t,c,f,d,e[9],568446438,5),d=o(d,t,c,f,e[14],3275163606,9),f=o(f,d,t,c,e[3],4107603335,14),c=o(c,f,d,t,e[8],1163531501,20),t=o(t,c,f,d,e[13],2850285829,5),d=o(d,t,c,f,e[2],4243563512,9),f=o(f,d,t,c,e[7],1735328473,14),t=s(t,c=o(c,f,d,t,e[12],2368359562,20),f,d,e[5],4294588738,4),d=s(d,t,c,f,e[8],2272392833,11),f=s(f,d,t,c,e[11],1839030562,16),c=s(c,f,d,t,e[14],4259657740,23),t=s(t,c,f,d,e[1],2763975236,4),d=s(d,t,c,f,e[4],1272893353,11),f=s(f,d,t,c,e[7],4139469664,16),c=s(c,f,d,t,e[10],3200236656,23),t=s(t,c,f,d,e[13],681279174,4),d=s(d,t,c,f,e[0],3936430074,11),f=s(f,d,t,c,e[3],3572445317,16),c=s(c,f,d,t,e[6],76029189,23),t=s(t,c,f,d,e[9],3654602809,4),d=s(d,t,c,f,e[12],3873151461,11),f=s(f,d,t,c,e[15],530742520,16),t=l(t,c=s(c,f,d,t,e[2],3299628645,23),f,d,e[0],4096336452,6),d=l(d,t,c,f,e[7],1126891415,10),f=l(f,d,t,c,e[14],2878612391,15),c=l(c,f,d,t,e[5],4237533241,21),t=l(t,c,f,d,e[12],1700485571,6),d=l(d,t,c,f,e[3],2399980690,10),f=l(f,d,t,c,e[10],4293915773,15),c=l(c,f,d,t,e[1],2240044497,21),t=l(t,c,f,d,e[8],1873313359,6),d=l(d,t,c,f,e[15],4264355552,10),f=l(f,d,t,c,e[6],2734768916,15),c=l(c,f,d,t,e[13],1309151649,21),t=l(t,c,f,d,e[4],4149444226,6),d=l(d,t,c,f,e[11],3174756917,10),f=l(f,d,t,c,e[2],718787259,15),c=l(c,f,d,t,e[9],3951481745,21),this._a=this._a+t|0,this._b=this._b+c|0,this._c=this._c+f|0,this._d=this._d+d|0},n.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 e=d.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=n},73726:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(28399).Transform;function d(e){f.call(this),this._block=c.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(56698)(d,f),d.prototype._transform=function(e,a,t){var c=null;try{this.update(e,a)}catch(e){c=e}t(c)},d.prototype._flush=function(e){var a=null;try{this.push(this.digest())}catch(e){a=e}e(a)},d.prototype.update=function(e,a){if(function(e){if(!c.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");c.isBuffer(e)||(e=c.from(e,a));for(var t=this._block,f=0;this._blockOffset+e.length-f>=this._blockSize;){for(var d=this._blockOffset;d0;++r)this._length[r]+=n,(n=this._length[r]/4294967296|0)>0&&(this._length[r]-=4294967296*n);return this},d.prototype._update=function(){throw new Error("_update is not implemented")},d.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();void 0!==e&&(a=a.toString(e)),this._block.fill(0),this._blockOffset=0;for(var t=0;t<4;++t)this._length[t]=0;return a},d.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=d},6215:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.InvalidStatusCodeError=a.InvalidCertError=void 0;const f=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class d extends Error{constructor(e,a){super(e),this.fingerprint256=a}}a.InvalidCertError=d;class r extends Error{constructor(e){super(`Request Failed. Status Code: ${e}`),this.statusCode=e}}function n(e,a){if(!a||"text"===a||"json"===a)try{let t=new TextDecoder("utf8",{fatal:!0}).decode(e);if("text"===a)return t;try{return JSON.parse(t)}catch(e){if("json"===a)throw e;return t}}catch(e){if("text"===a||"json"===a)throw e}return e}a.InvalidStatusCodeError=r;let i={};function b(e,a){let o={...f,...a};const s=t(11568),l=t(11083),u=t(78559),{promisify:h}=t(40537),{resolve:p}=t(59676),g=!!/^https/.test(e);let m={method:o.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const x=e=>e.replace(/:| /g,"").toLowerCase();if(o.keepAlive){const e={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},a=[g,g&&o.sslPinnedCertificates?.map((e=>x(e))).sort()].join();m.agent=i[a]||(i[a]=new(g?l:s).Agent(e))}return"json"===o.type&&(m.headers["Content-Type"]="application/json"),o.data&&(o.method||(m.method="POST"),m.body="json"===o.type?JSON.stringify(o.data):o.data),m.headers={...m.headers,...o.headers},o.sslAllowSelfSigned&&(m.rejectUnauthorized=!1),new Promise(((a,t)=>{const f=async a=>{if(a&&"DEPTH_ZERO_SELF_SIGNED_CERT"===a.code)try{await b(e,{...o,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(e){e&&e.fingerprint256&&(a=new d(`Self-signed SSL certificate: ${e.fingerprint256}`,e.fingerprint256))}t(a)},i=(g?l:s).request(e,m,(d=>{d.on("error",f),(async()=>{try{a(await(async a=>{const t=a.statusCode;if(o.redirect&&300<=t&&t<400&&a.headers.location){if(10==o._redirectCount)throw new Error("Request failed. Too much redirects.");return o._redirectCount+=1,await b(p(e,a.headers.location),o)}if(o.expectStatusCode&&t!==o.expectStatusCode)throw a.resume(),new r(t);let f=[];for await(const e of a)f.push(e);let d=c.concat(f);const i=a.headers["content-encoding"];"br"===i&&(d=await h(u.brotliDecompress)(d)),"gzip"!==i&&"deflate"!==i||(d=await h(u.unzip)(d));const s=n(d,o.type);return o.full?{headers:a.headers,status:t,body:s}:s})(d))}catch(e){t(e)}})()}));i.on("error",f);const y=o.sslPinnedCertificates?.map((e=>x(e))),A=e=>{const a=x(e.getPeerCertificate()?.fingerprint256||"");if((a||!e.isSessionReused())&&!y.includes(a))return i.emit("error",new d(`Invalid SSL certificate: ${a} Expected: ${y}`,a)),i.abort()};o.sslPinnedCertificates&&i.on("socket",(e=>{e.listeners("secureConnect").map((e=>(e.name||"").replace("bound ",""))).includes("mfetchSecureConnect")||e.on("secureConnect",A.bind(null,e))})),o.keepAlive&&i.setNoDelay(!0),m.body&&i.write(m.body),i.end()}))}const o=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map((e=>e.toLowerCase()))),s=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((e=>e.toLowerCase())));async function l(e,a){let t={...f,...a};const c=new Headers;"json"===t.type&&c.set("Content-Type","application/json");let d=new URL(e);if(d.username){const e=btoa(`${d.username}:${d.password}`);c.set("Authorization",`Basic ${e}`),d.username="",d.password=""}e=""+d;for(let e in t.headers){const a=e.toLowerCase();(o.has(a)||t.cors&&!s.has(a))&&c.set(e,t.headers[e])}let i={headers:c,redirect:t.redirect?"follow":"manual"};t.referrer||(i.referrerPolicy="no-referrer"),t.cors&&(i.mode="cors"),t.data&&(t.method||(i.method="POST"),i.body="json"===t.type?JSON.stringify(t.data):t.data);const b=await fetch(e,i);if(t.expectStatusCode&&b.status!==t.expectStatusCode)throw new r(b.status);const l=n(new Uint8Array(await b.arrayBuffer()),t.type);return t.full?{headers:Object.fromEntries(b.headers.entries()),status:b.status,body:l}:l}const u=!!("object"==typeof process&&process.versions&&process.versions.node&&process.versions.v8);a.default=function(e,a){return(u?b:l)(e,a)}},52244:(e,a,t)=>{var c=t(61158),f=t(15037);function d(e){this.rand=e||new f.Rand}e.exports=d,d.create=function(e){return new d(e)},d.prototype._randbelow=function(e){var a=e.bitLength(),t=Math.ceil(a/8);do{var f=new c(this.rand.generate(t))}while(f.cmp(e)>=0);return f},d.prototype._randrange=function(e,a){var t=a.sub(e);return e.add(this._randbelow(t))},d.prototype.test=function(e,a,t){var f=e.bitLength(),d=c.mont(e),r=new c(1).toRed(d);a||(a=Math.max(1,f/48|0));for(var n=e.subn(1),i=0;!n.testn(i);i++);for(var b=e.shrn(i),o=n.toRed(d);a>0;a--){var s=this._randrange(new c(2),n);t&&t(s);var l=s.toRed(d).redPow(b);if(0!==l.cmp(r)&&0!==l.cmp(o)){for(var u=1;u0;a--){var o=this._randrange(new c(2),r),s=e.gcd(o);if(0!==s.cmpn(1))return s;var l=o.toRed(f).redPow(i);if(0!==l.cmp(d)&&0!==l.cmp(b)){for(var u=1;u=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,T=R>>>13,D=0|r[9],F=8191&D,Q=D>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(T,j)|0,d=Math.imul(T,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(T,q)|0,d=d+Math.imul(T,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(T,K)|0,d=d+Math.imul(T,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(T,J)|0,d=d+Math.imul(T,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(T,X)|0,d=d+Math.imul(T,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(T,te)|0,d=d+Math.imul(T,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(T,de)|0,d=d+Math.imul(T,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(T,ie)|0,d=d+Math.imul(T,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(T,se)|0,d=d+Math.imul(T,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(T,he)|0))<<13)|0;b=((d=d+Math.imul(T,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},43349:e=>{function a(e,a){if(!e)throw new Error(a||"Assertion failed")}e.exports=a,a.equal=function(e,a,t){if(e!=a)throw new Error(t||"Assertion failed: "+e+" != "+a)}},64367:(e,a)=>{"use strict";var t=a;function c(e){return 1===e.length?"0"+e:e}function f(e){for(var a="",t=0;t>8,r=255&f;d?t.push(d,r):t.push(r)}return t},t.zero2=c,t.toHex=f,t.encode=function(e,a){return"hex"===a?f(e):e}},6585:e=>{var a=1e3,t=60*a,c=60*t,f=24*c,d=7*f;function r(e,a,t,c){var f=a>=1.5*t;return Math.round(e/t)+" "+c+(f?"s":"")}e.exports=function(e,n){n=n||{};var i,b,o=typeof e;if("string"===o&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var n=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return n*d;case"days":case"day":case"d":return n*f;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*t;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===o&&isFinite(e))return n.long?(i=e,(b=Math.abs(i))>=f?r(i,b,f,"day"):b>=c?r(i,b,c,"hour"):b>=t?r(i,b,t,"minute"):b>=a?r(i,b,a,"second"):i+" ms"):function(e){var d=Math.abs(e);return d>=f?Math.round(e/f)+"d":d>=c?Math.round(e/c)+"h":d>=t?Math.round(e/t)+"m":d>=a?Math.round(e/a)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},86889:e=>{e.exports=function e(t,c){if(!t){var f=new a(c);throw Error.captureStackTrace&&Error.captureStackTrace(f,e),f}};class a extends Error{}a.prototype.name="AssertionError"},89211:e=>{"use strict";var a=function(e){return e!=e};e.exports=function(e,t){return 0===e&&0===t?1/e==1/t:e===t||!(!a(e)||!a(t))}},37653:(e,a,t)=>{"use strict";var c=t(38452),f=t(10487),d=t(89211),r=t(9394),n=t(36576),i=f(r(),Object);c(i,{getPolyfill:r,implementation:d,shim:n}),e.exports=i},9394:(e,a,t)=>{"use strict";var c=t(89211);e.exports=function(){return"function"==typeof Object.is?Object.is:c}},36576:(e,a,t)=>{"use strict";var c=t(9394),f=t(38452);e.exports=function(){var e=c();return f(Object,{is:e},{is:function(){return Object.is!==e}}),e}},28875:(e,a,t)=>{"use strict";var c;if(!Object.keys){var f=Object.prototype.hasOwnProperty,d=Object.prototype.toString,r=t(1093),n=Object.prototype.propertyIsEnumerable,i=!n.call({toString:null},"toString"),b=n.call((function(){}),"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(e){var a=e.constructor;return a&&a.prototype===e},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},u=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!l["$"+e]&&f.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{s(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();c=function(e){var a=null!==e&&"object"==typeof e,t="[object Function]"===d.call(e),c=r(e),n=a&&"[object String]"===d.call(e),l=[];if(!a&&!t&&!c)throw new TypeError("Object.keys called on a non-object");var h=b&&t;if(n&&e.length>0&&!f.call(e,0))for(var p=0;p0)for(var g=0;g{"use strict";var c=Array.prototype.slice,f=t(1093),d=Object.keys,r=d?function(e){return d(e)}:t(28875),n=Object.keys;r.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return f(e)?n(c.call(e)):n(e)})}else Object.keys=r;return Object.keys||r},e.exports=r},1093:e=>{"use strict";var a=Object.prototype.toString;e.exports=function(e){var t=a.call(e),c="[object Arguments]"===t;return c||(c="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===a.call(e.callee)),c}},38403:(e,a,t)=>{"use strict";var c=t(1189),f=t(41333)(),d=t(38075),r=Object,n=d("Array.prototype.push"),i=d("Object.prototype.propertyIsEnumerable"),b=f?Object.getOwnPropertySymbols:null;e.exports=function(e,a){if(null==e)throw new TypeError("target must be an object");var t=r(e);if(1===arguments.length)return t;for(var d=1;d{"use strict";var c=t(38403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",a=e.split(""),t={},c=0;c{"use strict";var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function c(e,a){return Object.prototype.hasOwnProperty.call(e,a)}a.assign=function(e){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var t=a.shift();if(t){if("object"!=typeof t)throw new TypeError(t+"must be non-object");for(var f in t)c(t,f)&&(e[f]=t[f])}}return e},a.shrinkBuf=function(e,a){return e.length===a?e:e.subarray?e.subarray(0,a):(e.length=a,e)};var f={arraySet:function(e,a,t,c,f){if(a.subarray&&e.subarray)e.set(a.subarray(t,t+c),f);else for(var d=0;d{"use strict";e.exports=function(e,a,t,c){for(var f=65535&e,d=e>>>16&65535,r=0;0!==t;){t-=r=t>2e3?2e3:t;do{d=d+(f=f+a[c++]|0)|0}while(--r);f%=65521,d%=65521}return f|d<<16}},19681:e=>{"use strict";e.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}},14823:e=>{"use strict";var a=function(){for(var e,a=[],t=0;t<256;t++){e=t;for(var c=0;c<8;c++)e=1&e?3988292384^e>>>1:e>>>1;a[t]=e}return a}();e.exports=function(e,t,c,f){var d=a,r=f+c;e^=-1;for(var n=f;n>>8^d[255&(e^t[n])];return~e}},58411:(e,a,t)=>{"use strict";var c,f=t(9805),d=t(23665),r=t(53269),n=t(14823),i=t(54674),b=-2,o=258,s=262,l=103,u=113,h=666;function p(e,a){return e.msg=i[a],a}function g(e){return(e<<1)-(e>4?9:0)}function m(e){for(var a=e.length;--a>=0;)e[a]=0}function x(e){var a=e.state,t=a.pending;t>e.avail_out&&(t=e.avail_out),0!==t&&(f.arraySet(e.output,a.pending_buf,a.pending_out,t,e.next_out),e.next_out+=t,a.pending_out+=t,e.total_out+=t,e.avail_out-=t,a.pending-=t,0===a.pending&&(a.pending_out=0))}function y(e,a){d._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,a),e.block_start=e.strstart,x(e.strm)}function A(e,a){e.pending_buf[e.pending++]=a}function v(e,a){e.pending_buf[e.pending++]=a>>>8&255,e.pending_buf[e.pending++]=255&a}function w(e,a){var t,c,f=e.max_chain_length,d=e.strstart,r=e.prev_length,n=e.nice_match,i=e.strstart>e.w_size-s?e.strstart-(e.w_size-s):0,b=e.window,l=e.w_mask,u=e.prev,h=e.strstart+o,p=b[d+r-1],g=b[d+r];e.prev_length>=e.good_match&&(f>>=2),n>e.lookahead&&(n=e.lookahead);do{if(b[(t=a)+r]===g&&b[t+r-1]===p&&b[t]===b[d]&&b[++t]===b[d+1]){d+=2,t++;do{}while(b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&b[++d]===b[++t]&&dr){if(e.match_start=a,r=c,c>=n)break;p=b[d+r-1],g=b[d+r]}}}while((a=u[a&l])>i&&0!=--f);return r<=e.lookahead?r:e.lookahead}function _(e){var a,t,c,d,i,b,o,l,u,h,p=e.w_size;do{if(d=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-s)){f.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,a=t=e.hash_size;do{c=e.head[--a],e.head[a]=c>=p?c-p:0}while(--t);a=t=p;do{c=e.prev[--a],e.prev[a]=c>=p?c-p:0}while(--t);d+=p}if(0===e.strm.avail_in)break;if(b=e.strm,o=e.window,l=e.strstart+e.lookahead,u=d,h=void 0,(h=b.avail_in)>u&&(h=u),t=0===h?0:(b.avail_in-=h,f.arraySet(o,b.input,b.next_in,h,l),1===b.state.wrap?b.adler=r(b.adler,o,h,l):2===b.state.wrap&&(b.adler=n(b.adler,o,h,l)),b.next_in+=h,b.total_in+=h,h),e.lookahead+=t,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(c=d._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){f=e.strstart+e.lookahead-3,c=d._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=f&&(e.ins_h=(e.ins_h<15&&(n=2,c-=16),d<1||d>9||8!==t||c<8||c>15||a<0||a>9||r<0||r>4)return p(e,b);8===c&&(c=9);var i=new M;return e.state=i,i.strm=e,i.wrap=n,i.gzhead=null,i.w_bits=c,i.w_size=1<e.pending_buf_size-5&&(t=e.pending_buf_size-5);;){if(e.lookahead<=1){if(_(e),0===e.lookahead&&0===a)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var c=e.block_start+t;if((0===e.strstart||e.strstart>=c)&&(e.lookahead=e.strstart-c,e.strstart=c,y(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-s&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===a?(y(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(y(e,!1),e.strm.avail_out),1)})),new C(4,4,8,4,I),new C(4,5,16,8,I),new C(4,6,32,32,I),new C(4,4,16,16,E),new C(8,16,32,32,E),new C(8,16,128,128,E),new C(8,32,128,256,E),new C(32,128,258,1024,E),new C(32,258,258,4096,E)],a.deflateInit=function(e,a){return S(e,a,8,15,8,0)},a.deflateInit2=S,a.deflateReset=L,a.deflateResetKeep=B,a.deflateSetHeader=function(e,a){return e&&e.state?2!==e.state.wrap?b:(e.state.gzhead=a,0):b},a.deflate=function(e,a){var t,f,r,i;if(!e||!e.state||a>5||a<0)return e?p(e,b):b;if(f=e.state,!e.output||!e.input&&0!==e.avail_in||f.status===h&&4!==a)return p(e,0===e.avail_out?-5:b);if(f.strm=e,t=f.last_flush,f.last_flush=a,42===f.status)if(2===f.wrap)e.adler=0,A(f,31),A(f,139),A(f,8),f.gzhead?(A(f,(f.gzhead.text?1:0)+(f.gzhead.hcrc?2:0)+(f.gzhead.extra?4:0)+(f.gzhead.name?8:0)+(f.gzhead.comment?16:0)),A(f,255&f.gzhead.time),A(f,f.gzhead.time>>8&255),A(f,f.gzhead.time>>16&255),A(f,f.gzhead.time>>24&255),A(f,9===f.level?2:f.strategy>=2||f.level<2?4:0),A(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(A(f,255&f.gzhead.extra.length),A(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(e.adler=n(e.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(A(f,0),A(f,0),A(f,0),A(f,0),A(f,0),A(f,9===f.level?2:f.strategy>=2||f.level<2?4:0),A(f,3),f.status=u);else{var s=8+(f.w_bits-8<<4)<<8;s|=(f.strategy>=2||f.level<2?0:f.level<6?1:6===f.level?2:3)<<6,0!==f.strstart&&(s|=32),s+=31-s%31,f.status=u,v(f,s),0!==f.strstart&&(v(f,e.adler>>>16),v(f,65535&e.adler)),e.adler=1}if(69===f.status)if(f.gzhead.extra){for(r=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),x(e),r=f.pending,f.pending!==f.pending_buf_size));)A(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(73===f.status)if(f.gzhead.name){r=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),x(e),r=f.pending,f.pending===f.pending_buf_size)){i=1;break}i=f.gzindexr&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),0===i&&(f.gzindex=0,f.status=91)}else f.status=91;if(91===f.status)if(f.gzhead.comment){r=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>r&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),x(e),r=f.pending,f.pending===f.pending_buf_size)){i=1;break}i=f.gzindexr&&(e.adler=n(e.adler,f.pending_buf,f.pending-r,r)),0===i&&(f.status=l)}else f.status=l;if(f.status===l&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&x(e),f.pending+2<=f.pending_buf_size&&(A(f,255&e.adler),A(f,e.adler>>8&255),e.adler=0,f.status=u)):f.status=u),0!==f.pending){if(x(e),0===e.avail_out)return f.last_flush=-1,0}else if(0===e.avail_in&&g(a)<=g(t)&&4!==a)return p(e,-5);if(f.status===h&&0!==e.avail_in)return p(e,-5);if(0!==e.avail_in||0!==f.lookahead||0!==a&&f.status!==h){var w=2===f.strategy?function(e,a){for(var t;;){if(0===e.lookahead&&(_(e),0===e.lookahead)){if(0===a)return 1;break}if(e.match_length=0,t=d._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===a?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}(f,a):3===f.strategy?function(e,a){for(var t,c,f,r,n=e.window;;){if(e.lookahead<=o){if(_(e),e.lookahead<=o&&0===a)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(c=n[f=e.strstart-1])===n[++f]&&c===n[++f]&&c===n[++f]){r=e.strstart+o;do{}while(c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&c===n[++f]&&fe.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(t=d._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=d._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===a?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}(f,a):c[f.level].func(f,a);if(3!==w&&4!==w||(f.status=h),1===w||3===w)return 0===e.avail_out&&(f.last_flush=-1),0;if(2===w&&(1===a?d._tr_align(f):5!==a&&(d._tr_stored_block(f,0,0,!1),3===a&&(m(f.head),0===f.lookahead&&(f.strstart=0,f.block_start=0,f.insert=0))),x(e),0===e.avail_out))return f.last_flush=-1,0}return 4!==a?0:f.wrap<=0?1:(2===f.wrap?(A(f,255&e.adler),A(f,e.adler>>8&255),A(f,e.adler>>16&255),A(f,e.adler>>24&255),A(f,255&e.total_in),A(f,e.total_in>>8&255),A(f,e.total_in>>16&255),A(f,e.total_in>>24&255)):(v(f,e.adler>>>16),v(f,65535&e.adler)),x(e),f.wrap>0&&(f.wrap=-f.wrap),0!==f.pending?0:1)},a.deflateEnd=function(e){var a;return e&&e.state?42!==(a=e.state.status)&&69!==a&&73!==a&&91!==a&&a!==l&&a!==u&&a!==h?p(e,b):(e.state=null,a===u?p(e,-3):0):b},a.deflateSetDictionary=function(e,a){var t,c,d,n,i,o,s,l,u=a.length;if(!e||!e.state)return b;if(2===(n=(t=e.state).wrap)||1===n&&42!==t.status||t.lookahead)return b;for(1===n&&(e.adler=r(e.adler,a,u,0)),t.wrap=0,u>=t.w_size&&(0===n&&(m(t.head),t.strstart=0,t.block_start=0,t.insert=0),l=new f.Buf8(t.w_size),f.arraySet(l,a,u-t.w_size,t.w_size,0),a=l,u=t.w_size),i=e.avail_in,o=e.next_in,s=e.input,e.avail_in=u,e.next_in=0,e.input=a,_(t);t.lookahead>=3;){c=t.strstart,d=t.lookahead-2;do{t.ins_h=(t.ins_h<{"use strict";e.exports=function(e,a){var t,c,f,d,r,n,i,b,o,s,l,u,h,p,g,m,x,y,A,v,w,_,I,E,C;t=e.state,c=e.next_in,E=e.input,f=c+(e.avail_in-5),d=e.next_out,C=e.output,r=d-(a-e.avail_out),n=d+(e.avail_out-257),i=t.dmax,b=t.wsize,o=t.whave,s=t.wnext,l=t.window,u=t.hold,h=t.bits,p=t.lencode,g=t.distcode,m=(1<>>=A=y>>>24,h-=A,0==(A=y>>>16&255))C[d++]=65535&y;else{if(!(16&A)){if(64&A){if(32&A){t.mode=12;break e}e.msg="invalid literal/length code",t.mode=30;break e}y=p[(65535&y)+(u&(1<>>=A,h-=A),h<15&&(u+=E[c++]<>>=A=y>>>24,h-=A,16&(A=y>>>16&255)){if(w=65535&y,h<(A&=15)&&(u+=E[c++]<i){e.msg="invalid distance too far back",t.mode=30;break e}if(u>>>=A,h-=A,w>(A=d-r)){if((A=w-A)>o&&t.sane){e.msg="invalid distance too far back",t.mode=30;break e}if(_=0,I=l,0===s){if(_+=b-A,A2;)C[d++]=I[_++],C[d++]=I[_++],C[d++]=I[_++],v-=3;v&&(C[d++]=I[_++],v>1&&(C[d++]=I[_++]))}else{_=d-w;do{C[d++]=C[_++],C[d++]=C[_++],C[d++]=C[_++],v-=3}while(v>2);v&&(C[d++]=C[_++],v>1&&(C[d++]=C[_++]))}break}if(64&A){e.msg="invalid distance code",t.mode=30;break e}y=g[(65535&y)+(u&(1<>3,u&=(1<<(h-=v<<3))-1,e.next_in=c,e.next_out=d,e.avail_in=c{"use strict";var c=t(9805),f=t(53269),d=t(14823),r=t(47293),n=t(21998),i=-2,b=12,o=30;function s(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function l(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,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 c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(e){var a;return e&&e.state?(a=e.state,e.total_in=e.total_out=a.total=0,e.msg="",a.wrap&&(e.adler=1&a.wrap),a.mode=1,a.last=0,a.havedict=0,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=a.lendyn=new c.Buf32(852),a.distcode=a.distdyn=new c.Buf32(592),a.sane=1,a.back=-1,0):i}function h(e){var a;return e&&e.state?((a=e.state).wsize=0,a.whave=0,a.wnext=0,u(e)):i}function p(e,a){var t,c;return e&&e.state?(c=e.state,a<0?(t=0,a=-a):(t=1+(a>>4),a<48&&(a&=15)),a&&(a<8||a>15)?i:(null!==c.window&&c.wbits!==a&&(c.window=null),c.wrap=t,c.wbits=a,h(e))):i}function g(e,a){var t,c;return e?(c=new l,e.state=c,c.window=null,0!==(t=p(e,a))&&(e.state=null),t):i}var m,x,y=!0;function A(e){if(y){var a;for(m=new c.Buf32(512),x=new c.Buf32(32),a=0;a<144;)e.lens[a++]=8;for(;a<256;)e.lens[a++]=9;for(;a<280;)e.lens[a++]=7;for(;a<288;)e.lens[a++]=8;for(n(1,e.lens,0,288,m,0,e.work,{bits:9}),a=0;a<32;)e.lens[a++]=5;n(2,e.lens,0,32,x,0,e.work,{bits:5}),y=!1}e.lencode=m,e.lenbits=9,e.distcode=x,e.distbits=5}function v(e,a,t,f){var d,r=e.state;return null===r.window&&(r.wsize=1<=r.wsize?(c.arraySet(r.window,a,t-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((d=r.wsize-r.wnext)>f&&(d=f),c.arraySet(r.window,a,t-f,d,r.wnext),(f-=d)?(c.arraySet(r.window,a,t-f,f,0),r.wnext=f,r.whave=r.wsize):(r.wnext+=d,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,t.check=d(t.check,F,2,0),x=0,y=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&x)<<8)+(x>>8))%31){e.msg="incorrect header check",t.mode=o;break}if(8!=(15&x)){e.msg="unknown compression method",t.mode=o;break}if(y-=4,P=8+(15&(x>>>=4)),0===t.wbits)t.wbits=P;else if(P>t.wbits){e.msg="invalid window size",t.mode=o;break}t.dmax=1<>8&1),512&t.flags&&(F[0]=255&x,F[1]=x>>>8&255,t.check=d(t.check,F,2,0)),x=0,y=0,t.mode=3;case 3:for(;y<32;){if(0===g)break e;g--,x+=l[h++]<>>8&255,F[2]=x>>>16&255,F[3]=x>>>24&255,t.check=d(t.check,F,4,0)),x=0,y=0,t.mode=4;case 4:for(;y<16;){if(0===g)break e;g--,x+=l[h++]<>8),512&t.flags&&(F[0]=255&x,F[1]=x>>>8&255,t.check=d(t.check,F,2,0)),x=0,y=0,t.mode=5;case 5:if(1024&t.flags){for(;y<16;){if(0===g)break e;g--,x+=l[h++]<>>8&255,t.check=d(t.check,F,2,0)),x=0,y=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&((I=t.length)>g&&(I=g),I&&(t.head&&(P=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),c.arraySet(t.head.extra,l,h,I,P)),512&t.flags&&(t.check=d(t.check,l,I,h)),g-=I,h+=I,t.length-=I),t.length))break e;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(0===g)break e;I=0;do{P=l[h+I++],t.head&&P&&t.length<65536&&(t.head.name+=String.fromCharCode(P))}while(P&&I>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=b;break;case 10:for(;y<32;){if(0===g)break e;g--,x+=l[h++]<>>=7&y,y-=7&y,t.mode=27;break}for(;y<3;){if(0===g)break e;g--,x+=l[h++]<>>=1)){case 0:t.mode=14;break;case 1:if(A(t),t.mode=20,6===a){x>>>=2,y-=2;break e}break;case 2:t.mode=17;break;case 3:e.msg="invalid block type",t.mode=o}x>>>=2,y-=2;break;case 14:for(x>>>=7&y,y-=7&y;y<32;){if(0===g)break e;g--,x+=l[h++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=o;break}if(t.length=65535&x,x=0,y=0,t.mode=15,6===a)break e;case 15:t.mode=16;case 16:if(I=t.length){if(I>g&&(I=g),I>m&&(I=m),0===I)break e;c.arraySet(u,l,h,I,p),g-=I,h+=I,m-=I,p+=I,t.length-=I;break}t.mode=b;break;case 17:for(;y<14;){if(0===g)break e;g--,x+=l[h++]<>>=5,y-=5,t.ndist=1+(31&x),x>>>=5,y-=5,t.ncode=4+(15&x),x>>>=4,y-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=o;break}t.have=0,t.mode=18;case 18:for(;t.have>>=3,y-=3}for(;t.have<19;)t.lens[Q[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,O={bits:t.lenbits},R=n(0,t.lens,0,19,t.lencode,0,t.work,O),t.lenbits=O.bits,R){e.msg="invalid code lengths set",t.mode=o;break}t.have=0,t.mode=19;case 19:for(;t.have>>16&255,L=65535&D,!((M=D>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>>=M,y-=M,t.lens[t.have++]=L;else{if(16===L){for(T=M+2;y>>=M,y-=M,0===t.have){e.msg="invalid bit length repeat",t.mode=o;break}P=t.lens[t.have-1],I=3+(3&x),x>>>=2,y-=2}else if(17===L){for(T=M+3;y>>=M)),x>>>=3,y-=3}else{for(T=M+7;y>>=M)),x>>>=7,y-=7}if(t.have+I>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=o;break}for(;I--;)t.lens[t.have++]=P}}if(t.mode===o)break;if(0===t.lens[256]){e.msg="invalid code -- missing end-of-block",t.mode=o;break}if(t.lenbits=9,O={bits:t.lenbits},R=n(1,t.lens,0,t.nlen,t.lencode,0,t.work,O),t.lenbits=O.bits,R){e.msg="invalid literal/lengths set",t.mode=o;break}if(t.distbits=6,t.distcode=t.distdyn,O={bits:t.distbits},R=n(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,O),t.distbits=O.bits,R){e.msg="invalid distances set",t.mode=o;break}if(t.mode=20,6===a)break e;case 20:t.mode=21;case 21:if(g>=6&&m>=258){e.next_out=p,e.avail_out=m,e.next_in=h,e.avail_in=g,t.hold=x,t.bits=y,r(e,_),p=e.next_out,u=e.output,m=e.avail_out,h=e.next_in,l=e.input,g=e.avail_in,x=t.hold,y=t.bits,t.mode===b&&(t.back=-1);break}for(t.back=0;B=(D=t.lencode[x&(1<>>16&255,L=65535&D,!((M=D>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>S)])>>>16&255,L=65535&D,!(S+(M=D>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>>=S,y-=S,t.back+=S}if(x>>>=M,y-=M,t.back+=M,t.length=L,0===B){t.mode=26;break}if(32&B){t.back=-1,t.mode=b;break}if(64&B){e.msg="invalid literal/length code",t.mode=o;break}t.extra=15&B,t.mode=22;case 22:if(t.extra){for(T=t.extra;y>>=t.extra,y-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;B=(D=t.distcode[x&(1<>>16&255,L=65535&D,!((M=D>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>S)])>>>16&255,L=65535&D,!(S+(M=D>>>24)<=y);){if(0===g)break e;g--,x+=l[h++]<>>=S,y-=S,t.back+=S}if(x>>>=M,y-=M,t.back+=M,64&B){e.msg="invalid distance code",t.mode=o;break}t.offset=L,t.extra=15&B,t.mode=24;case 24:if(t.extra){for(T=t.extra;y>>=t.extra,y-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=o;break}t.mode=25;case 25:if(0===m)break e;if(I=_-m,t.offset>I){if((I=t.offset-I)>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=o;break}I>t.wnext?(I-=t.wnext,E=t.wsize-I):E=t.wnext-I,I>t.length&&(I=t.length),C=t.window}else C=u,E=p-t.offset,I=t.length;I>m&&(I=m),m-=I,t.length-=I;do{u[p++]=C[E++]}while(--I);0===t.length&&(t.mode=21);break;case 26:if(0===m)break e;u[p++]=t.length,m--,t.mode=21;break;case 27:if(t.wrap){for(;y<32;){if(0===g)break e;g--,x|=l[h++]<{"use strict";var c=t(9805),f=[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],d=[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],r=[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],n=[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];e.exports=function(e,a,t,i,b,o,s,l){var u,h,p,g,m,x,y,A,v,w=l.bits,_=0,I=0,E=0,C=0,M=0,B=0,L=0,S=0,k=0,N=0,P=null,R=0,O=new c.Buf16(16),T=new c.Buf16(16),D=null,F=0;for(_=0;_<=15;_++)O[_]=0;for(I=0;I=1&&0===O[C];C--);if(M>C&&(M=C),0===C)return b[o++]=20971520,b[o++]=20971520,l.bits=1,0;for(E=1;E0&&(0===e||1!==C))return-1;for(T[1]=0,_=1;_<15;_++)T[_+1]=T[_]+O[_];for(I=0;I852||2===e&&k>592)return 1;for(;;){y=_-L,s[I]x?(A=D[F+s[I]],v=P[R+s[I]]):(A=96,v=0),u=1<<_-L,E=h=1<>L)+(h-=u)]=y<<24|A<<16|v}while(0!==h);for(u=1<<_-1;N&u;)u>>=1;if(0!==u?(N&=u-1,N+=u):N=0,I++,0==--O[_]){if(_===C)break;_=a[t+s[I]]}if(_>M&&(N&g)!==p){for(0===L&&(L=M),m+=E,S=1<<(B=_-L);B+L852||2===e&&k>592)return 1;b[p=N&g]=M<<24|B<<16|m-o}}return 0!==N&&(b[m+N]=_-L<<24|64<<16),l.bits=M,0}},54674:e=>{"use strict";e.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"}},23665:(e,a,t)=>{"use strict";var c=t(9805);function f(e){for(var a=e.length;--a>=0;)e[a]=0}var d=[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],r=[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],n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],i=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],b=new Array(576);f(b);var o=new Array(60);f(o);var s=new Array(512);f(s);var l=new Array(256);f(l);var u=new Array(29);f(u);var h,p,g,m=new Array(30);function x(e,a,t,c,f){this.static_tree=e,this.extra_bits=a,this.extra_base=t,this.elems=c,this.max_length=f,this.has_stree=e&&e.length}function y(e,a){this.dyn_tree=e,this.max_code=0,this.stat_desc=a}function A(e){return e<256?s[e]:s[256+(e>>>7)]}function v(e,a){e.pending_buf[e.pending++]=255&a,e.pending_buf[e.pending++]=a>>>8&255}function w(e,a,t){e.bi_valid>16-t?(e.bi_buf|=a<>16-e.bi_valid,e.bi_valid+=t-16):(e.bi_buf|=a<>>=1,t<<=1}while(--a>0);return t>>>1}function E(e,a,t){var c,f,d=new Array(16),r=0;for(c=1;c<=15;c++)d[c]=r=r+t[c-1]<<1;for(f=0;f<=a;f++){var n=e[2*f+1];0!==n&&(e[2*f]=I(d[n]++,n))}}function C(e){var a;for(a=0;a<286;a++)e.dyn_ltree[2*a]=0;for(a=0;a<30;a++)e.dyn_dtree[2*a]=0;for(a=0;a<19;a++)e.bl_tree[2*a]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function M(e){e.bi_valid>8?v(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function B(e,a,t,c){var f=2*a,d=2*t;return e[f]>1;t>=1;t--)L(e,d,t);f=i;do{t=e.heap[1],e.heap[1]=e.heap[e.heap_len--],L(e,d,1),c=e.heap[1],e.heap[--e.heap_max]=t,e.heap[--e.heap_max]=c,d[2*f]=d[2*t]+d[2*c],e.depth[f]=(e.depth[t]>=e.depth[c]?e.depth[t]:e.depth[c])+1,d[2*t+1]=d[2*c+1]=f,e.heap[1]=f++,L(e,d,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,a){var t,c,f,d,r,n,i=a.dyn_tree,b=a.max_code,o=a.stat_desc.static_tree,s=a.stat_desc.has_stree,l=a.stat_desc.extra_bits,u=a.stat_desc.extra_base,h=a.stat_desc.max_length,p=0;for(d=0;d<=15;d++)e.bl_count[d]=0;for(i[2*e.heap[e.heap_max]+1]=0,t=e.heap_max+1;t<573;t++)(d=i[2*i[2*(c=e.heap[t])+1]+1]+1)>h&&(d=h,p++),i[2*c+1]=d,c>b||(e.bl_count[d]++,r=0,c>=u&&(r=l[c-u]),n=i[2*c],e.opt_len+=n*(d+r),s&&(e.static_len+=n*(o[2*c+1]+r)));if(0!==p){do{for(d=h-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[h]--,p-=2}while(p>0);for(d=h;0!==d;d--)for(c=e.bl_count[d];0!==c;)(f=e.heap[--t])>b||(i[2*f+1]!==d&&(e.opt_len+=(d-i[2*f+1])*i[2*f],i[2*f+1]=d),c--)}}(e,a),E(d,b,e.bl_count)}function N(e,a,t){var c,f,d=-1,r=a[1],n=0,i=7,b=4;for(0===r&&(i=138,b=3),a[2*(t+1)+1]=65535,c=0;c<=t;c++)f=r,r=a[2*(c+1)+1],++n>=7;c<30;c++)for(m[c]=f<<7,e=0;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var a,t=4093624447;for(a=0;a<=31;a++,t>>>=1)if(1&t&&0!==e.dyn_ltree[2*a])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(a=32;a<256;a++)if(0!==e.dyn_ltree[2*a])return 1;return 0}(e)),k(e,e.l_desc),k(e,e.d_desc),r=function(e){var a;for(N(e,e.dyn_ltree,e.l_desc.max_code),N(e,e.dyn_dtree,e.d_desc.max_code),k(e,e.bl_desc),a=18;a>=3&&0===e.bl_tree[2*i[a]+1];a--);return e.opt_len+=3*(a+1)+5+5+4,a}(e),f=e.opt_len+3+7>>>3,(d=e.static_len+3+7>>>3)<=f&&(f=d)):f=d=t+5,t+4<=f&&-1!==a?O(e,a,t,c):4===e.strategy||d===f?(w(e,2+(c?1:0),3),S(e,b,o)):(w(e,4+(c?1:0),3),function(e,a,t,c){var f;for(w(e,a-257,5),w(e,t-1,5),w(e,c-4,4),f=0;f>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&a,e.pending_buf[e.l_buf+e.last_lit]=255&t,e.last_lit++,0===a?e.dyn_ltree[2*t]++:(e.matches++,a--,e.dyn_ltree[2*(l[t]+256+1)]++,e.dyn_dtree[2*A(a)]++),e.last_lit===e.lit_bufsize-1},a._tr_align=function(e){w(e,2,3),_(e,256,b),function(e){16===e.bi_valid?(v(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},44442:e=>{"use strict";e.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}},21137:(e,a,t)=>{"use strict";var c=t(87568);a.certificate=t(36413);var f=c.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())}));a.RSAPrivateKey=f;var d=c.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));a.RSAPublicKey=d;var r=c.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())})),n=c.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(r),this.key("subjectPublicKey").bitstr())}));a.PublicKey=n;var i=c.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(r),this.key("subjectPrivateKey").octstr())}));a.PrivateKey=i;var b=c.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())}));a.EncryptedPrivateKey=b;var o=c.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())}));a.DSAPrivateKey=o,a.DSAparam=c.define("DSAparam",(function(){this.int()}));var s=c.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})})),l=c.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(s),this.key("publicKey").optional().explicit(1).bitstr())}));a.ECPrivateKey=l,a.signature=c.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},36413:(e,a,t)=>{"use strict";var c=t(87568),f=c.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),d=c.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),r=c.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),n=c.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(r),this.key("subjectPublicKey").bitstr())})),i=c.define("RelativeDistinguishedName",(function(){this.setof(d)})),b=c.define("RDNSequence",(function(){this.seqof(i)})),o=c.define("Name",(function(){this.choice({rdnSequence:this.use(b)})})),s=c.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(f),this.key("notAfter").use(f))})),l=c.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),u=c.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(r),this.key("issuer").use(o),this.key("validity").use(s),this.key("subject").use(o),this.key("subjectPublicKeyInfo").use(n),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())})),h=c.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(u),this.key("signatureAlgorithm").use(r),this.key("signatureValue").bitstr())}));e.exports=h},24101:(e,a,t)=>{"use strict";var c=/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,f=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,d=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,r=t(68078),n=t(1241),i=t(92861).Buffer;e.exports=function(e,a){var t,b=e.toString(),o=b.match(c);if(o){var s="aes"+o[1],l=i.from(o[2],"hex"),u=i.from(o[3].replace(/[\r\n]/g,""),"base64"),h=r(a,l.slice(0,8),parseInt(o[1],10)).key,p=[],g=n.createDecipheriv(s,h,l);p.push(g.update(u)),p.push(g.final()),t=i.concat(p)}else{var m=b.match(d);t=i.from(m[2].replace(/[\r\n]/g,""),"base64")}return{tag:b.match(f)[1],data:t}}},78170:(e,a,t)=>{"use strict";var c=t(21137),f=t(15579),d=t(24101),r=t(1241),n=t(78396),i=t(92861).Buffer;function b(e){var a;"object"!=typeof e||i.isBuffer(e)||(a=e.passphrase,e=e.key),"string"==typeof e&&(e=i.from(e));var t,b,o=d(e,a),s=o.tag,l=o.data;switch(s){case"CERTIFICATE":b=c.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(b||(b=c.PublicKey.decode(l,"der")),t=b.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return c.RSAPublicKey.decode(b.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return b.subjectPrivateKey=b.subjectPublicKey,{type:"ec",data:b};case"1.2.840.10040.4.1":return b.algorithm.params.pub_key=c.DSAparam.decode(b.subjectPublicKey.data,"der"),{type:"dsa",data:b.algorithm.params};default:throw new Error("unknown key id "+t)}case"ENCRYPTED PRIVATE KEY":l=function(e,a){var t=e.algorithm.decrypt.kde.kdeparams.salt,c=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),d=f[e.algorithm.decrypt.cipher.algo.join(".")],b=e.algorithm.decrypt.cipher.iv,o=e.subjectPrivateKey,s=parseInt(d.split("-")[1],10)/8,l=n.pbkdf2Sync(a,t,c,s,"sha1"),u=r.createDecipheriv(d,l,b),h=[];return h.push(u.update(o)),h.push(u.final()),i.concat(h)}(l=c.EncryptedPrivateKey.decode(l,"der"),a);case"PRIVATE KEY":switch(t=(b=c.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return c.RSAPrivateKey.decode(b.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:b.algorithm.curve,privateKey:c.ECPrivateKey.decode(b.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return b.algorithm.params.priv_key=c.DSAparam.decode(b.subjectPrivateKey,"der"),{type:"dsa",params:b.algorithm.params};default:throw new Error("unknown key id "+t)}case"RSA PUBLIC KEY":return c.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return c.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:c.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=c.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+s)}}b.signature=c.signature,e.exports=b},78396:(e,a,t)=>{a.pbkdf2=t(43832),a.pbkdf2Sync=t(21352)},43832:(e,a,t)=>{var c,f,d=t(92861).Buffer,r=t(64196),n=t(2455),i=t(21352),b=t(93382),o=t.g.crypto&&t.g.crypto.subtle,s={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"},l=[];function u(){return f||(f=t.g.process&&t.g.process.nextTick?t.g.process.nextTick:t.g.queueMicrotask?t.g.queueMicrotask:t.g.setImmediate?t.g.setImmediate:t.g.setTimeout)}function h(e,a,t,c,f){return o.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return o.deriveBits({name:"PBKDF2",salt:a,iterations:t,hash:{name:f}},e,c<<3)})).then((function(e){return d.from(e)}))}e.exports=function(e,a,f,p,g,m){"function"==typeof g&&(m=g,g=void 0);var x=s[(g=g||"sha1").toLowerCase()];if(x&&"function"==typeof t.g.Promise){if(r(f,p),e=b(e,n,"Password"),a=b(a,n,"Salt"),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");!function(e,a){e.then((function(e){u()((function(){a(null,e)}))}),(function(e){u()((function(){a(e)}))}))}(function(e){if(t.g.process&&!t.g.process.browser)return Promise.resolve(!1);if(!o||!o.importKey||!o.deriveBits)return Promise.resolve(!1);if(void 0!==l[e])return l[e];var a=h(c=c||d.alloc(8),c,10,128,e).then((function(){return!0})).catch((function(){return!1}));return l[e]=a,a}(x).then((function(t){return t?h(e,a,f,p,x):i(e,a,f,p,g)})),m)}else u()((function(){var t;try{t=i(e,a,f,p,g)}catch(e){return m(e)}m(null,t)}))}},2455:(e,a,t)=>{var c;c=t.g.process&&t.g.process.browser?"utf-8":t.g.process&&t.g.process.version?parseInt(process.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",e.exports=c},64196:e=>{var a=Math.pow(2,30)-1;e.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>a||t!=t)throw new TypeError("Bad key length")}},21352:(e,a,t)=>{var c=t(20320),f=t(66011),d=t(62802),r=t(92861).Buffer,n=t(64196),i=t(2455),b=t(93382),o=r.alloc(128),s={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(e,a,t){var n=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new f).update(e).digest()}:"md5"===e?c:function(a){return d(e).update(a).digest()}}(e),i="sha512"===e||"sha384"===e?128:64;a.length>i?a=n(a):a.length{var c=t(92861).Buffer;e.exports=function(e,a,t){if(c.isBuffer(e))return e;if("string"==typeof e)return c.from(e,a);if(ArrayBuffer.isView(e))return c.from(e.buffer);throw new TypeError(t+" must be a string, a Buffer, a typed array or a DataView")}},71843:(e,a,t)=>{"use strict";const{ErrorWithCause:c}=t(75832),{findCauseByReference:f,getErrorCause:d,messageWithCauses:r,stackWithCauses:n}=t(94306);e.exports={ErrorWithCause:c,findCauseByReference:f,getErrorCause:d,stackWithCauses:n,messageWithCauses:r}},75832:e=>{"use strict";class a extends Error{constructor(e,{cause:t}={}){super(e),this.name=a.name,t&&(this.cause=t),this.message=e}}e.exports={ErrorWithCause:a}},94306:e=>{"use strict";const a=e=>{if(e&&"object"==typeof e&&"cause"in e){if("function"==typeof e.cause){const a=e.cause();return a instanceof Error?a:void 0}return e.cause instanceof Error?e.cause:void 0}},t=(e,c)=>{if(!(e instanceof Error))return"";const f=e.stack||"";if(c.has(e))return f+"\ncauses have become circular...";const d=a(e);return d?(c.add(e),f+"\ncaused by: "+t(d,c)):f},c=(e,t,f)=>{if(!(e instanceof Error))return"";const d=f?"":e.message||"";if(t.has(e))return d+": ...";const r=a(e);if(r){t.add(e);const a="cause"in e&&"function"==typeof e.cause;return d+(a?"":": ")+c(r,t,a)}return d};e.exports={findCauseByReference:(e,t)=>{if(!e||!t)return;if(!(e instanceof Error))return;if(!(t.prototype instanceof Error)&&t!==Error)return;const c=new Set;let f=e;for(;f&&!c.has(f);){if(c.add(f),f instanceof t)return f;f=a(f)}},getErrorCause:a,stackWithCauses:e=>t(e,new Set),messageWithCauses:e=>c(e,new Set)}},76578:e=>{"use strict";e.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},33225:e=>{"use strict";"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?e.exports={nextTick:function(e,a,t,c){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var f,d,r=arguments.length;switch(r){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,a)}));case 3:return process.nextTick((function(){e.call(null,a,t)}));case 4:return process.nextTick((function(){e.call(null,a,t,c)}));default:for(f=new Array(r-1),d=0;d{a.publicEncrypt=t(28902),a.privateDecrypt=t(77362),a.privateEncrypt=function(e,t){return a.publicEncrypt(e,t,!0)},a.publicDecrypt=function(e,t){return a.privateDecrypt(e,t,!0)}},48206:(e,a,t)=>{var c=t(47108),f=t(92861).Buffer;function d(e){var a=f.allocUnsafe(4);return a.writeUInt32BE(e,0),a}e.exports=function(e,a){for(var t,r=f.alloc(0),n=0;r.length=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function i(e,a,t){var c=n(e,t);return t-1>=a&&(c|=n(e,t-1)<<4),c}function b(e,a,t,c){for(var f=0,d=Math.min(e.length,t),r=a;r=49?n-49+10:n>=17?n-17+10:n}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,a){return e.cmp(a)>0?e:a},d.min=function(e,a){return e.cmp(a)<0?e:a},d.prototype._init=function(e,a,t){if("number"==typeof e)return this._initNumber(e,a,t);if("object"==typeof e)return this._initArray(e,a,t);"hex"===a&&(a=16),c(a===(0|a)&&a>=2&&a<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f=0;f-=3)r=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=r<>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);else if("le"===t)for(f=0,d=0;f>>26-n&67108863,(n+=24)>=26&&(n-=26,d++);return this.strip()},d.prototype._parseHex=function(e,a,t){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var c=0;c=a;c-=2)f=i(e,a,c)<=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;else for(c=(e.length-a)%2==0?a+1:a;c=18?(d-=18,r+=1,this.words[r]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,a,t){this.words=[0],this.length=1;for(var c=0,f=1;f<=67108863;f*=a)c++;c--,f=f/a|0;for(var d=e.length-t,r=d%c,n=Math.min(d,d-r)+t,i=0,o=t;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],l=[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 u(e,a,t){t.negative=a.negative^e.negative;var c=e.length+a.length|0;t.length=c,c=c-1|0;var f=0|e.words[0],d=0|a.words[0],r=f*d,n=67108863&r,i=r/67108864|0;t.words[0]=n;for(var b=1;b>>26,s=67108863&i,l=Math.min(b,a.length-1),u=Math.max(0,b-e.length+1);u<=l;u++){var h=b-u|0;o+=(r=(f=0|e.words[h])*(d=0|a.words[u])+s)/67108864|0,s=67108863&r}t.words[b]=0|s,i=0|o}return 0!==i?t.words[b]=0|i:t.length--,t.strip()}d.prototype.toString=function(e,a){var t;if(a=0|a||1,16===(e=e||10)||"hex"===e){t="";for(var f=0,d=0,r=0;r>>24-f&16777215)||r!==this.length-1?o[6-i.length]+i+t:i+t,(f+=2)>=26&&(f-=26,r--)}for(0!==d&&(t=d.toString(16)+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],u=l[e];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var p=h.modn(u).toString(e);t=(h=h.idivn(u)).isZero()?p+t:o[b-p.length]+p+t}for(this.isZero()&&(t="0"+t);t.length%a!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}c(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(e,a){return c(void 0!==r),this.toArrayLike(r,e,a)},d.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},d.prototype.toArrayLike=function(e,a,t){var f=this.byteLength(),d=t||Math.max(1,f);c(f<=d,"byte array longer than desired length"),c(d>0,"Requested array length <= 0"),this.strip();var r,n,i="le"===a,b=new e(d),o=this.clone();if(i){for(n=0;!o.isZero();n++)r=o.andln(255),o.iushrn(8),b[n]=r;for(;n=4096&&(t+=13,a>>>=13),a>=64&&(t+=7,a>>>=7),a>=8&&(t+=4,a>>>=4),a>=2&&(t+=2,a>>>=2),t+a},d.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,t=0;return 8191&a||(t+=13,a>>>=13),127&a||(t+=7,a>>>=7),15&a||(t+=4,a>>>=4),3&a||(t+=2,a>>>=2),1&a||t++,t},d.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},d.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},d.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},d.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},d.prototype.iuxor=function(e){var a,t;this.length>e.length?(a=this,t=e):(a=e,t=this);for(var c=0;ce.length?this.clone().ixor(e):e.clone().ixor(this)},d.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},d.prototype.inotn=function(e){c("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),t=e%26;this._expand(a),t>0&&a--;for(var f=0;f0&&(this.words[f]=~this.words[f]&67108863>>26-t),this.strip()},d.prototype.notn=function(e){return this.clone().inotn(e)},d.prototype.setn=function(e,a){c("number"==typeof e&&e>=0);var t=e/26|0,f=e%26;return this._expand(t+1),this.words[t]=a?this.words[t]|1<e.length?(t=this,c=e):(t=e,c=this);for(var f=0,d=0;d>>26;for(;0!==f&&d>>26;if(this.length=t.length,0!==f)this.words[this.length]=f,this.length++;else if(t!==this)for(;de.length?this.clone().iadd(e):e.clone().iadd(this)},d.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,c,f=this.cmp(e);if(0===f)return this.negative=0,this.length=1,this.words[0]=0,this;f>0?(t=this,c=e):(t=e,c=this);for(var d=0,r=0;r>26,this.words[r]=67108863&a;for(;0!==d&&r>26,this.words[r]=67108863&a;if(0===d&&r>>13,u=0|r[1],h=8191&u,p=u>>>13,g=0|r[2],m=8191&g,x=g>>>13,y=0|r[3],A=8191&y,v=y>>>13,w=0|r[4],_=8191&w,I=w>>>13,E=0|r[5],C=8191&E,M=E>>>13,B=0|r[6],L=8191&B,S=B>>>13,k=0|r[7],N=8191&k,P=k>>>13,R=0|r[8],O=8191&R,T=R>>>13,D=0|r[9],F=8191&D,Q=D>>>13,U=0|n[0],j=8191&U,H=U>>>13,$=0|n[1],q=8191&$,G=$>>>13,z=0|n[2],K=8191&z,V=z>>>13,Z=0|n[3],J=8191&Z,W=Z>>>13,Y=0|n[4],X=8191&Y,ee=Y>>>13,ae=0|n[5],te=8191&ae,ce=ae>>>13,fe=0|n[6],de=8191&fe,re=fe>>>13,ne=0|n[7],ie=8191&ne,be=ne>>>13,oe=0|n[8],se=8191&oe,le=oe>>>13,ue=0|n[9],he=8191&ue,pe=ue>>>13;t.negative=e.negative^a.negative,t.length=19;var ge=(b+(c=Math.imul(s,j))|0)+((8191&(f=(f=Math.imul(s,H))+Math.imul(l,j)|0))<<13)|0;b=((d=Math.imul(l,H))+(f>>>13)|0)+(ge>>>26)|0,ge&=67108863,c=Math.imul(h,j),f=(f=Math.imul(h,H))+Math.imul(p,j)|0,d=Math.imul(p,H);var me=(b+(c=c+Math.imul(s,q)|0)|0)+((8191&(f=(f=f+Math.imul(s,G)|0)+Math.imul(l,q)|0))<<13)|0;b=((d=d+Math.imul(l,G)|0)+(f>>>13)|0)+(me>>>26)|0,me&=67108863,c=Math.imul(m,j),f=(f=Math.imul(m,H))+Math.imul(x,j)|0,d=Math.imul(x,H),c=c+Math.imul(h,q)|0,f=(f=f+Math.imul(h,G)|0)+Math.imul(p,q)|0,d=d+Math.imul(p,G)|0;var xe=(b+(c=c+Math.imul(s,K)|0)|0)+((8191&(f=(f=f+Math.imul(s,V)|0)+Math.imul(l,K)|0))<<13)|0;b=((d=d+Math.imul(l,V)|0)+(f>>>13)|0)+(xe>>>26)|0,xe&=67108863,c=Math.imul(A,j),f=(f=Math.imul(A,H))+Math.imul(v,j)|0,d=Math.imul(v,H),c=c+Math.imul(m,q)|0,f=(f=f+Math.imul(m,G)|0)+Math.imul(x,q)|0,d=d+Math.imul(x,G)|0,c=c+Math.imul(h,K)|0,f=(f=f+Math.imul(h,V)|0)+Math.imul(p,K)|0,d=d+Math.imul(p,V)|0;var ye=(b+(c=c+Math.imul(s,J)|0)|0)+((8191&(f=(f=f+Math.imul(s,W)|0)+Math.imul(l,J)|0))<<13)|0;b=((d=d+Math.imul(l,W)|0)+(f>>>13)|0)+(ye>>>26)|0,ye&=67108863,c=Math.imul(_,j),f=(f=Math.imul(_,H))+Math.imul(I,j)|0,d=Math.imul(I,H),c=c+Math.imul(A,q)|0,f=(f=f+Math.imul(A,G)|0)+Math.imul(v,q)|0,d=d+Math.imul(v,G)|0,c=c+Math.imul(m,K)|0,f=(f=f+Math.imul(m,V)|0)+Math.imul(x,K)|0,d=d+Math.imul(x,V)|0,c=c+Math.imul(h,J)|0,f=(f=f+Math.imul(h,W)|0)+Math.imul(p,J)|0,d=d+Math.imul(p,W)|0;var Ae=(b+(c=c+Math.imul(s,X)|0)|0)+((8191&(f=(f=f+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;b=((d=d+Math.imul(l,ee)|0)+(f>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,c=Math.imul(C,j),f=(f=Math.imul(C,H))+Math.imul(M,j)|0,d=Math.imul(M,H),c=c+Math.imul(_,q)|0,f=(f=f+Math.imul(_,G)|0)+Math.imul(I,q)|0,d=d+Math.imul(I,G)|0,c=c+Math.imul(A,K)|0,f=(f=f+Math.imul(A,V)|0)+Math.imul(v,K)|0,d=d+Math.imul(v,V)|0,c=c+Math.imul(m,J)|0,f=(f=f+Math.imul(m,W)|0)+Math.imul(x,J)|0,d=d+Math.imul(x,W)|0,c=c+Math.imul(h,X)|0,f=(f=f+Math.imul(h,ee)|0)+Math.imul(p,X)|0,d=d+Math.imul(p,ee)|0;var ve=(b+(c=c+Math.imul(s,te)|0)|0)+((8191&(f=(f=f+Math.imul(s,ce)|0)+Math.imul(l,te)|0))<<13)|0;b=((d=d+Math.imul(l,ce)|0)+(f>>>13)|0)+(ve>>>26)|0,ve&=67108863,c=Math.imul(L,j),f=(f=Math.imul(L,H))+Math.imul(S,j)|0,d=Math.imul(S,H),c=c+Math.imul(C,q)|0,f=(f=f+Math.imul(C,G)|0)+Math.imul(M,q)|0,d=d+Math.imul(M,G)|0,c=c+Math.imul(_,K)|0,f=(f=f+Math.imul(_,V)|0)+Math.imul(I,K)|0,d=d+Math.imul(I,V)|0,c=c+Math.imul(A,J)|0,f=(f=f+Math.imul(A,W)|0)+Math.imul(v,J)|0,d=d+Math.imul(v,W)|0,c=c+Math.imul(m,X)|0,f=(f=f+Math.imul(m,ee)|0)+Math.imul(x,X)|0,d=d+Math.imul(x,ee)|0,c=c+Math.imul(h,te)|0,f=(f=f+Math.imul(h,ce)|0)+Math.imul(p,te)|0,d=d+Math.imul(p,ce)|0;var we=(b+(c=c+Math.imul(s,de)|0)|0)+((8191&(f=(f=f+Math.imul(s,re)|0)+Math.imul(l,de)|0))<<13)|0;b=((d=d+Math.imul(l,re)|0)+(f>>>13)|0)+(we>>>26)|0,we&=67108863,c=Math.imul(N,j),f=(f=Math.imul(N,H))+Math.imul(P,j)|0,d=Math.imul(P,H),c=c+Math.imul(L,q)|0,f=(f=f+Math.imul(L,G)|0)+Math.imul(S,q)|0,d=d+Math.imul(S,G)|0,c=c+Math.imul(C,K)|0,f=(f=f+Math.imul(C,V)|0)+Math.imul(M,K)|0,d=d+Math.imul(M,V)|0,c=c+Math.imul(_,J)|0,f=(f=f+Math.imul(_,W)|0)+Math.imul(I,J)|0,d=d+Math.imul(I,W)|0,c=c+Math.imul(A,X)|0,f=(f=f+Math.imul(A,ee)|0)+Math.imul(v,X)|0,d=d+Math.imul(v,ee)|0,c=c+Math.imul(m,te)|0,f=(f=f+Math.imul(m,ce)|0)+Math.imul(x,te)|0,d=d+Math.imul(x,ce)|0,c=c+Math.imul(h,de)|0,f=(f=f+Math.imul(h,re)|0)+Math.imul(p,de)|0,d=d+Math.imul(p,re)|0;var _e=(b+(c=c+Math.imul(s,ie)|0)|0)+((8191&(f=(f=f+Math.imul(s,be)|0)+Math.imul(l,ie)|0))<<13)|0;b=((d=d+Math.imul(l,be)|0)+(f>>>13)|0)+(_e>>>26)|0,_e&=67108863,c=Math.imul(O,j),f=(f=Math.imul(O,H))+Math.imul(T,j)|0,d=Math.imul(T,H),c=c+Math.imul(N,q)|0,f=(f=f+Math.imul(N,G)|0)+Math.imul(P,q)|0,d=d+Math.imul(P,G)|0,c=c+Math.imul(L,K)|0,f=(f=f+Math.imul(L,V)|0)+Math.imul(S,K)|0,d=d+Math.imul(S,V)|0,c=c+Math.imul(C,J)|0,f=(f=f+Math.imul(C,W)|0)+Math.imul(M,J)|0,d=d+Math.imul(M,W)|0,c=c+Math.imul(_,X)|0,f=(f=f+Math.imul(_,ee)|0)+Math.imul(I,X)|0,d=d+Math.imul(I,ee)|0,c=c+Math.imul(A,te)|0,f=(f=f+Math.imul(A,ce)|0)+Math.imul(v,te)|0,d=d+Math.imul(v,ce)|0,c=c+Math.imul(m,de)|0,f=(f=f+Math.imul(m,re)|0)+Math.imul(x,de)|0,d=d+Math.imul(x,re)|0,c=c+Math.imul(h,ie)|0,f=(f=f+Math.imul(h,be)|0)+Math.imul(p,ie)|0,d=d+Math.imul(p,be)|0;var Ie=(b+(c=c+Math.imul(s,se)|0)|0)+((8191&(f=(f=f+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;b=((d=d+Math.imul(l,le)|0)+(f>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,c=Math.imul(F,j),f=(f=Math.imul(F,H))+Math.imul(Q,j)|0,d=Math.imul(Q,H),c=c+Math.imul(O,q)|0,f=(f=f+Math.imul(O,G)|0)+Math.imul(T,q)|0,d=d+Math.imul(T,G)|0,c=c+Math.imul(N,K)|0,f=(f=f+Math.imul(N,V)|0)+Math.imul(P,K)|0,d=d+Math.imul(P,V)|0,c=c+Math.imul(L,J)|0,f=(f=f+Math.imul(L,W)|0)+Math.imul(S,J)|0,d=d+Math.imul(S,W)|0,c=c+Math.imul(C,X)|0,f=(f=f+Math.imul(C,ee)|0)+Math.imul(M,X)|0,d=d+Math.imul(M,ee)|0,c=c+Math.imul(_,te)|0,f=(f=f+Math.imul(_,ce)|0)+Math.imul(I,te)|0,d=d+Math.imul(I,ce)|0,c=c+Math.imul(A,de)|0,f=(f=f+Math.imul(A,re)|0)+Math.imul(v,de)|0,d=d+Math.imul(v,re)|0,c=c+Math.imul(m,ie)|0,f=(f=f+Math.imul(m,be)|0)+Math.imul(x,ie)|0,d=d+Math.imul(x,be)|0,c=c+Math.imul(h,se)|0,f=(f=f+Math.imul(h,le)|0)+Math.imul(p,se)|0,d=d+Math.imul(p,le)|0;var Ee=(b+(c=c+Math.imul(s,he)|0)|0)+((8191&(f=(f=f+Math.imul(s,pe)|0)+Math.imul(l,he)|0))<<13)|0;b=((d=d+Math.imul(l,pe)|0)+(f>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,c=Math.imul(F,q),f=(f=Math.imul(F,G))+Math.imul(Q,q)|0,d=Math.imul(Q,G),c=c+Math.imul(O,K)|0,f=(f=f+Math.imul(O,V)|0)+Math.imul(T,K)|0,d=d+Math.imul(T,V)|0,c=c+Math.imul(N,J)|0,f=(f=f+Math.imul(N,W)|0)+Math.imul(P,J)|0,d=d+Math.imul(P,W)|0,c=c+Math.imul(L,X)|0,f=(f=f+Math.imul(L,ee)|0)+Math.imul(S,X)|0,d=d+Math.imul(S,ee)|0,c=c+Math.imul(C,te)|0,f=(f=f+Math.imul(C,ce)|0)+Math.imul(M,te)|0,d=d+Math.imul(M,ce)|0,c=c+Math.imul(_,de)|0,f=(f=f+Math.imul(_,re)|0)+Math.imul(I,de)|0,d=d+Math.imul(I,re)|0,c=c+Math.imul(A,ie)|0,f=(f=f+Math.imul(A,be)|0)+Math.imul(v,ie)|0,d=d+Math.imul(v,be)|0,c=c+Math.imul(m,se)|0,f=(f=f+Math.imul(m,le)|0)+Math.imul(x,se)|0,d=d+Math.imul(x,le)|0;var Ce=(b+(c=c+Math.imul(h,he)|0)|0)+((8191&(f=(f=f+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;b=((d=d+Math.imul(p,pe)|0)+(f>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c=Math.imul(F,K),f=(f=Math.imul(F,V))+Math.imul(Q,K)|0,d=Math.imul(Q,V),c=c+Math.imul(O,J)|0,f=(f=f+Math.imul(O,W)|0)+Math.imul(T,J)|0,d=d+Math.imul(T,W)|0,c=c+Math.imul(N,X)|0,f=(f=f+Math.imul(N,ee)|0)+Math.imul(P,X)|0,d=d+Math.imul(P,ee)|0,c=c+Math.imul(L,te)|0,f=(f=f+Math.imul(L,ce)|0)+Math.imul(S,te)|0,d=d+Math.imul(S,ce)|0,c=c+Math.imul(C,de)|0,f=(f=f+Math.imul(C,re)|0)+Math.imul(M,de)|0,d=d+Math.imul(M,re)|0,c=c+Math.imul(_,ie)|0,f=(f=f+Math.imul(_,be)|0)+Math.imul(I,ie)|0,d=d+Math.imul(I,be)|0,c=c+Math.imul(A,se)|0,f=(f=f+Math.imul(A,le)|0)+Math.imul(v,se)|0,d=d+Math.imul(v,le)|0;var Me=(b+(c=c+Math.imul(m,he)|0)|0)+((8191&(f=(f=f+Math.imul(m,pe)|0)+Math.imul(x,he)|0))<<13)|0;b=((d=d+Math.imul(x,pe)|0)+(f>>>13)|0)+(Me>>>26)|0,Me&=67108863,c=Math.imul(F,J),f=(f=Math.imul(F,W))+Math.imul(Q,J)|0,d=Math.imul(Q,W),c=c+Math.imul(O,X)|0,f=(f=f+Math.imul(O,ee)|0)+Math.imul(T,X)|0,d=d+Math.imul(T,ee)|0,c=c+Math.imul(N,te)|0,f=(f=f+Math.imul(N,ce)|0)+Math.imul(P,te)|0,d=d+Math.imul(P,ce)|0,c=c+Math.imul(L,de)|0,f=(f=f+Math.imul(L,re)|0)+Math.imul(S,de)|0,d=d+Math.imul(S,re)|0,c=c+Math.imul(C,ie)|0,f=(f=f+Math.imul(C,be)|0)+Math.imul(M,ie)|0,d=d+Math.imul(M,be)|0,c=c+Math.imul(_,se)|0,f=(f=f+Math.imul(_,le)|0)+Math.imul(I,se)|0,d=d+Math.imul(I,le)|0;var Be=(b+(c=c+Math.imul(A,he)|0)|0)+((8191&(f=(f=f+Math.imul(A,pe)|0)+Math.imul(v,he)|0))<<13)|0;b=((d=d+Math.imul(v,pe)|0)+(f>>>13)|0)+(Be>>>26)|0,Be&=67108863,c=Math.imul(F,X),f=(f=Math.imul(F,ee))+Math.imul(Q,X)|0,d=Math.imul(Q,ee),c=c+Math.imul(O,te)|0,f=(f=f+Math.imul(O,ce)|0)+Math.imul(T,te)|0,d=d+Math.imul(T,ce)|0,c=c+Math.imul(N,de)|0,f=(f=f+Math.imul(N,re)|0)+Math.imul(P,de)|0,d=d+Math.imul(P,re)|0,c=c+Math.imul(L,ie)|0,f=(f=f+Math.imul(L,be)|0)+Math.imul(S,ie)|0,d=d+Math.imul(S,be)|0,c=c+Math.imul(C,se)|0,f=(f=f+Math.imul(C,le)|0)+Math.imul(M,se)|0,d=d+Math.imul(M,le)|0;var Le=(b+(c=c+Math.imul(_,he)|0)|0)+((8191&(f=(f=f+Math.imul(_,pe)|0)+Math.imul(I,he)|0))<<13)|0;b=((d=d+Math.imul(I,pe)|0)+(f>>>13)|0)+(Le>>>26)|0,Le&=67108863,c=Math.imul(F,te),f=(f=Math.imul(F,ce))+Math.imul(Q,te)|0,d=Math.imul(Q,ce),c=c+Math.imul(O,de)|0,f=(f=f+Math.imul(O,re)|0)+Math.imul(T,de)|0,d=d+Math.imul(T,re)|0,c=c+Math.imul(N,ie)|0,f=(f=f+Math.imul(N,be)|0)+Math.imul(P,ie)|0,d=d+Math.imul(P,be)|0,c=c+Math.imul(L,se)|0,f=(f=f+Math.imul(L,le)|0)+Math.imul(S,se)|0,d=d+Math.imul(S,le)|0;var Se=(b+(c=c+Math.imul(C,he)|0)|0)+((8191&(f=(f=f+Math.imul(C,pe)|0)+Math.imul(M,he)|0))<<13)|0;b=((d=d+Math.imul(M,pe)|0)+(f>>>13)|0)+(Se>>>26)|0,Se&=67108863,c=Math.imul(F,de),f=(f=Math.imul(F,re))+Math.imul(Q,de)|0,d=Math.imul(Q,re),c=c+Math.imul(O,ie)|0,f=(f=f+Math.imul(O,be)|0)+Math.imul(T,ie)|0,d=d+Math.imul(T,be)|0,c=c+Math.imul(N,se)|0,f=(f=f+Math.imul(N,le)|0)+Math.imul(P,se)|0,d=d+Math.imul(P,le)|0;var ke=(b+(c=c+Math.imul(L,he)|0)|0)+((8191&(f=(f=f+Math.imul(L,pe)|0)+Math.imul(S,he)|0))<<13)|0;b=((d=d+Math.imul(S,pe)|0)+(f>>>13)|0)+(ke>>>26)|0,ke&=67108863,c=Math.imul(F,ie),f=(f=Math.imul(F,be))+Math.imul(Q,ie)|0,d=Math.imul(Q,be),c=c+Math.imul(O,se)|0,f=(f=f+Math.imul(O,le)|0)+Math.imul(T,se)|0,d=d+Math.imul(T,le)|0;var Ne=(b+(c=c+Math.imul(N,he)|0)|0)+((8191&(f=(f=f+Math.imul(N,pe)|0)+Math.imul(P,he)|0))<<13)|0;b=((d=d+Math.imul(P,pe)|0)+(f>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c=Math.imul(F,se),f=(f=Math.imul(F,le))+Math.imul(Q,se)|0,d=Math.imul(Q,le);var Pe=(b+(c=c+Math.imul(O,he)|0)|0)+((8191&(f=(f=f+Math.imul(O,pe)|0)+Math.imul(T,he)|0))<<13)|0;b=((d=d+Math.imul(T,pe)|0)+(f>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Re=(b+(c=Math.imul(F,he))|0)+((8191&(f=(f=Math.imul(F,pe))+Math.imul(Q,he)|0))<<13)|0;return b=((d=Math.imul(Q,pe))+(f>>>13)|0)+(Re>>>26)|0,Re&=67108863,i[0]=ge,i[1]=me,i[2]=xe,i[3]=ye,i[4]=Ae,i[5]=ve,i[6]=we,i[7]=_e,i[8]=Ie,i[9]=Ee,i[10]=Ce,i[11]=Me,i[12]=Be,i[13]=Le,i[14]=Se,i[15]=ke,i[16]=Ne,i[17]=Pe,i[18]=Re,0!==b&&(i[19]=b,t.length++),t};function p(e,a,t){return(new g).mulp(e,a,t)}function g(e,a){this.x=e,this.y=a}Math.imul||(h=u),d.prototype.mulTo=function(e,a){var t,c=this.length+e.length;return t=10===this.length&&10===e.length?h(this,e,a):c<63?u(this,e,a):c<1024?function(e,a,t){t.negative=a.negative^e.negative,t.length=e.length+a.length;for(var c=0,f=0,d=0;d>>26)|0)>>>26,r&=67108863}t.words[d]=n,c=r,r=f}return 0!==c?t.words[d]=c:t.length--,t.strip()}(this,e,a):p(this,e,a),t},g.prototype.makeRBT=function(e){for(var a=new Array(e),t=d.prototype._countBits(e)-1,c=0;c>=1;return c},g.prototype.permute=function(e,a,t,c,f,d){for(var r=0;r>>=1)f++;return 1<>>=13,t[2*r+1]=8191&d,d>>>=13;for(r=2*a;r>=26,a+=f/67108864|0,a+=d>>>26,this.words[t]=67108863&d}return 0!==a&&(this.words[t]=a,this.length++),this},d.prototype.muln=function(e){return this.clone().imuln(e)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),t=0;t>>f}return a}(e);if(0===a.length)return new d(1);for(var t=this,c=0;c=0);var a,t=e%26,f=(e-t)/26,d=67108863>>>26-t<<26-t;if(0!==t){var r=0;for(a=0;a>>26-t}r&&(this.words[a]=r,this.length++)}if(0!==f){for(a=this.length-1;a>=0;a--)this.words[a+f]=this.words[a];for(a=0;a=0),f=a?(a-a%26)/26:0;var d=e%26,r=Math.min((e-d)/26,this.length),n=67108863^67108863>>>d<r)for(this.length-=r,b=0;b=0&&(0!==o||b>=f);b--){var s=0|this.words[b];this.words[b]=o<<26-d|s>>>d,o=s&n}return i&&0!==o&&(i.words[i.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(e,a,t){return c(0===this.negative),this.iushrn(e,a,t)},d.prototype.shln=function(e){return this.clone().ishln(e)},d.prototype.ushln=function(e){return this.clone().iushln(e)},d.prototype.shrn=function(e){return this.clone().ishrn(e)},d.prototype.ushrn=function(e){return this.clone().iushrn(e)},d.prototype.testn=function(e){c("number"==typeof e&&e>=0);var a=e%26,t=(e-a)/26,f=1<=0);var a=e%26,t=(e-a)/26;if(c(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==a&&t++,this.length=Math.min(t,this.length),0!==a){var f=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},d.prototype.isubn=function(e){if(c("number"==typeof e),c(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(i/67108864|0),this.words[f+t]=67108863&d}for(;f>26,this.words[f+t]=67108863&d;if(0===n)return this.strip();for(c(-1===n),n=0,f=0;f>26,this.words[f]=67108863&d;return this.negative=1,this.strip()},d.prototype._wordDiv=function(e,a){var t=(this.length,e.length),c=this.clone(),f=e,r=0|f.words[f.length-1];0!=(t=26-this._countBits(r))&&(f=f.ushln(t),c.iushln(t),r=0|f.words[f.length-1]);var n,i=c.length-f.length;if("mod"!==a){(n=new d(null)).length=i+1,n.words=new Array(n.length);for(var b=0;b=0;s--){var l=67108864*(0|c.words[f.length+s])+(0|c.words[f.length+s-1]);for(l=Math.min(l/r|0,67108863),c._ishlnsubmul(f,l,s);0!==c.negative;)l--,c.negative=0,c._ishlnsubmul(f,1,s),c.isZero()||(c.negative^=1);n&&(n.words[s]=l)}return n&&n.strip(),c.strip(),"div"!==a&&0!==t&&c.iushrn(t),{div:n||null,mod:c}},d.prototype.divmod=function(e,a,t){return c(!e.isZero()),this.isZero()?{div:new d(0),mod:new d(0)}:0!==this.negative&&0===e.negative?(n=this.neg().divmod(e,a),"mod"!==a&&(f=n.div.neg()),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.iadd(e)),{div:f,mod:r}):0===this.negative&&0!==e.negative?(n=this.divmod(e.neg(),a),"mod"!==a&&(f=n.div.neg()),{div:f,mod:n.mod}):this.negative&e.negative?(n=this.neg().divmod(e.neg(),a),"div"!==a&&(r=n.mod.neg(),t&&0!==r.negative&&r.isub(e)),{div:n.div,mod:r}):e.length>this.length||this.cmp(e)<0?{div:new d(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new d(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new d(this.modn(e.words[0]))}:this._wordDiv(e,a);var f,r,n},d.prototype.div=function(e){return this.divmod(e,"div",!1).div},d.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},d.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},d.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var t=0!==a.div.negative?a.mod.isub(e):a.mod,c=e.ushrn(1),f=e.andln(1),d=t.cmp(c);return d<0||1===f&&0===d?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},d.prototype.modn=function(e){c(e<=67108863);for(var a=(1<<26)%e,t=0,f=this.length-1;f>=0;f--)t=(a*t+(0|this.words[f]))%e;return t},d.prototype.idivn=function(e){c(e<=67108863);for(var a=0,t=this.length-1;t>=0;t--){var f=(0|this.words[t])+67108864*a;this.words[t]=f/e|0,a=f%e}return this.strip()},d.prototype.divn=function(e){return this.clone().idivn(e)},d.prototype.egcd=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f=new d(1),r=new d(0),n=new d(0),i=new d(1),b=0;a.isEven()&&t.isEven();)a.iushrn(1),t.iushrn(1),++b;for(var o=t.clone(),s=a.clone();!a.isZero();){for(var l=0,u=1;!(a.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(f.isOdd()||r.isOdd())&&(f.iadd(o),r.isub(s)),f.iushrn(1),r.iushrn(1);for(var h=0,p=1;!(t.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(o),i.isub(s)),n.iushrn(1),i.iushrn(1);a.cmp(t)>=0?(a.isub(t),f.isub(n),r.isub(i)):(t.isub(a),n.isub(f),i.isub(r))}return{a:n,b:i,gcd:t.iushln(b)}},d.prototype._invmp=function(e){c(0===e.negative),c(!e.isZero());var a=this,t=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var f,r=new d(1),n=new d(0),i=t.clone();a.cmpn(1)>0&&t.cmpn(1)>0;){for(var b=0,o=1;!(a.words[0]&o)&&b<26;++b,o<<=1);if(b>0)for(a.iushrn(b);b-- >0;)r.isOdd()&&r.iadd(i),r.iushrn(1);for(var s=0,l=1;!(t.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(t.iushrn(s);s-- >0;)n.isOdd()&&n.iadd(i),n.iushrn(1);a.cmp(t)>=0?(a.isub(t),r.isub(n)):(t.isub(a),n.isub(r))}return(f=0===a.cmpn(1)?r:n).cmpn(0)<0&&f.iadd(e),f},d.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),t=e.clone();a.negative=0,t.negative=0;for(var c=0;a.isEven()&&t.isEven();c++)a.iushrn(1),t.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;t.isEven();)t.iushrn(1);var f=a.cmp(t);if(f<0){var d=a;a=t,t=d}else if(0===f||0===t.cmpn(1))break;a.isub(t)}return t.iushln(c)},d.prototype.invm=function(e){return this.egcd(e).a.umod(e)},d.prototype.isEven=function(){return!(1&this.words[0])},d.prototype.isOdd=function(){return!(1&~this.words[0])},d.prototype.andln=function(e){return this.words[0]&e},d.prototype.bincn=function(e){c("number"==typeof e);var a=e%26,t=(e-a)/26,f=1<>>26,n&=67108863,this.words[r]=n}return 0!==d&&(this.words[r]=d,this.length++),this},d.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},d.prototype.cmpn=function(e){var a,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)a=1;else{t&&(e=-e),c(e<=67108863,"Number is too big");var f=0|this.words[0];a=f===e?0:fe.length)return 1;if(this.length=0;t--){var c=0|this.words[t],f=0|e.words[t];if(c!==f){cf&&(a=1);break}}return a},d.prototype.gtn=function(e){return 1===this.cmpn(e)},d.prototype.gt=function(e){return 1===this.cmp(e)},d.prototype.gten=function(e){return this.cmpn(e)>=0},d.prototype.gte=function(e){return this.cmp(e)>=0},d.prototype.ltn=function(e){return-1===this.cmpn(e)},d.prototype.lt=function(e){return-1===this.cmp(e)},d.prototype.lten=function(e){return this.cmpn(e)<=0},d.prototype.lte=function(e){return this.cmp(e)<=0},d.prototype.eqn=function(e){return 0===this.cmpn(e)},d.prototype.eq=function(e){return 0===this.cmp(e)},d.red=function(e){return new _(e)},d.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},d.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(e){return this.red=e,this},d.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},d.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},d.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},d.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},d.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},d.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},d.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},d.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},d.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function x(e,a){this.name=e,this.p=new d(a,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var a=d._prime(e);this.m=a.p,this.prime=a}else c(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new d(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)}x.prototype._tmp=function(){var e=new d(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var a,t=e;do{this.split(t,this.tmp),a=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(a>this.n);var c=a0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},x.prototype.split=function(e,a){e.iushrn(this.n,0,a)},x.prototype.imulK=function(e){return e.imul(this.k)},f(y,x),y.prototype.split=function(e,a){for(var t=4194303,c=Math.min(e.length,9),f=0;f>>22,d=r}d>>>=22,e.words[f-10]=d,0===d&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,t=0;t>>=26,e.words[t]=f,a=c}return 0!==a&&(e.words[e.length++]=a),e},d._prime=function(e){if(m[e])return m[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new A;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return m[e]=a,a},_.prototype._verify1=function(e){c(0===e.negative,"red works only with positives"),c(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,a){c(!(e.negative|a.negative),"red works only with positives"),c(e.red&&e.red===a.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,a){this._verify2(e,a);var t=e.add(a);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},_.prototype.iadd=function(e,a){this._verify2(e,a);var t=e.iadd(a);return t.cmp(this.m)>=0&&t.isub(this.m),t},_.prototype.sub=function(e,a){this._verify2(e,a);var t=e.sub(a);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},_.prototype.isub=function(e,a){this._verify2(e,a);var t=e.isub(a);return t.cmpn(0)<0&&t.iadd(this.m),t},_.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},_.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},_.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(c(a%2==1),3===a){var t=this.m.add(new d(1)).iushrn(2);return this.pow(e,t)}for(var f=this.m.subn(1),r=0;!f.isZero()&&0===f.andln(1);)r++,f.iushrn(1);c(!f.isZero());var n=new d(1).toRed(this),i=n.redNeg(),b=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new d(2*o*o).toRed(this);0!==this.pow(o,b).cmp(i);)o.redIAdd(i);for(var s=this.pow(o,f),l=this.pow(e,f.addn(1).iushrn(1)),u=this.pow(e,f),h=r;0!==u.cmp(n);){for(var p=u,g=0;0!==p.cmp(n);g++)p=p.redSqr();c(g=0;c--){for(var b=a.words[c],o=i-1;o>=0;o--){var s=b>>o&1;f!==t[0]&&(f=this.sqr(f)),0!==s||0!==r?(r<<=1,r|=s,(4==++n||0===c&&0===o)&&(f=this.mul(f,t[r]),n=0,r=0)):n=0}i=26}return f},_.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},_.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},d.mont=function(e){return new I(e)},f(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},I.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),d=f;return f.cmp(this.m)>=0?d=f.isub(this.m):f.cmpn(0)<0&&(d=f.iadd(this.m)),d._forceRed(this)},I.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new d(0)._forceRed(this);var t=e.mul(a),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=t.isub(c).iushrn(this.shift),r=f;return f.cmp(this.m)>=0?r=f.isub(this.m):f.cmpn(0)<0&&(r=f.iadd(this.m)),r._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=t.nmd(e),this)},77362:(e,a,t)=>{var c=t(78170),f=t(48206),d=t(52061),r=t(82509),n=t(67332),i=t(47108),b=t(99247),o=t(92861).Buffer;e.exports=function(e,a,t){var s;s=e.padding?e.padding:t?1:4;var l,u=c(e),h=u.modulus.byteLength();if(a.length>h||new r(a).cmp(u.modulus)>=0)throw new Error("decryption error");l=t?b(new r(a),u):n(a,u);var p=o.alloc(h-l.length);if(l=o.concat([p,l],h),4===s)return function(e,a){var t=e.modulus.byteLength(),c=i("sha1").update(o.alloc(0)).digest(),r=c.length;if(0!==a[0])throw new Error("decryption error");var n=a.slice(1,r+1),b=a.slice(r+1),s=d(n,f(b,r)),l=d(b,f(s,t-r-1));if(function(e,a){e=o.from(e),a=o.from(a);var t=0,c=e.length;e.length!==a.length&&(t++,c=Math.min(e.length,a.length));for(var f=-1;++f=a.length){d++;break}var r=a.slice(2,f-1);if(("0002"!==c.toString("hex")&&!t||"0001"!==c.toString("hex")&&t)&&d++,r.length<8&&d++,d)throw new Error("decryption error");return a.slice(f)}(0,l,t);if(3===s)return l;throw new Error("unknown padding")}},28902:(e,a,t)=>{var c=t(78170),f=t(53209),d=t(47108),r=t(48206),n=t(52061),i=t(82509),b=t(99247),o=t(67332),s=t(92861).Buffer;e.exports=function(e,a,t){var l;l=e.padding?e.padding:t?1:4;var u,h=c(e);if(4===l)u=function(e,a){var t=e.modulus.byteLength(),c=a.length,b=d("sha1").update(s.alloc(0)).digest(),o=b.length,l=2*o;if(c>t-l-2)throw new Error("message too long");var u=s.alloc(t-c-l-2),h=t-o-1,p=f(o),g=n(s.concat([b,u,s.alloc(1,1),a],h),r(p,h)),m=n(p,r(g,o));return new i(s.concat([s.alloc(1),m,g],t))}(h,a);else if(1===l)u=function(e,a,t){var c,d=a.length,r=e.modulus.byteLength();if(d>r-11)throw new Error("message too long");return c=t?s.alloc(r-d-3,255):function(e){for(var a,t=s.allocUnsafe(e),c=0,d=f(2*e),r=0;c=0)throw new Error("data too long for modulus")}return t?o(u,h):b(u,h)}},99247:(e,a,t)=>{var c=t(82509),f=t(92861).Buffer;e.exports=function(e,a){return f.from(e.toRed(c.mont(a.modulus)).redPow(new c(a.publicExponent)).fromRed().toArray())}},52061:e=>{e.exports=function(e,a){for(var t=e.length,c=-1;++c{"use strict";var c=65536,f=t(92861).Buffer,d=t.g.crypto||t.g.msCrypto;d&&d.getRandomValues?e.exports=function(e,a){if(e>4294967295)throw new RangeError("requested too many random bytes");var t=f.allocUnsafe(e);if(e>0)if(e>c)for(var r=0;r{"use strict";function c(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var f=t(92861),d=t(53209),r=f.Buffer,n=f.kMaxLength,i=t.g.crypto||t.g.msCrypto,b=Math.pow(2,32)-1;function o(e,a){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>b||e<0)throw new TypeError("offset must be a uint32");if(e>n||e>a)throw new RangeError("offset out of range")}function s(e,a,t){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>b||e<0)throw new TypeError("size must be a uint32");if(e+a>t||e>n)throw new RangeError("buffer too small")}function l(e,a,t,c){if(process.browser){var f=e.buffer,r=new Uint8Array(f,a,t);return i.getRandomValues(r),c?void process.nextTick((function(){c(null,e)})):e}if(!c)return d(t).copy(e,a),e;d(t,(function(t,f){if(t)return c(t);f.copy(e,a),c(null,e)}))}i&&i.getRandomValues||!process.browser?(a.randomFill=function(e,a,c,f){if(!(r.isBuffer(e)||e instanceof t.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof a)f=a,a=0,c=e.length;else if("function"==typeof c)f=c,c=e.length-a;else if("function"!=typeof f)throw new TypeError('"cb" argument must be a function');return o(a,e.length),s(c,a,e.length),l(e,a,c,f)},a.randomFillSync=function(e,a,c){if(void 0===a&&(a=0),!(r.isBuffer(e)||e instanceof t.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return o(a,e.length),void 0===c&&(c=e.length-a),s(c,a,e.length),l(e,a,c)}):(a.randomFill=c,a.randomFillSync=c)},86048:e=>{"use strict";var a={};function t(e,t,c){c||(c=Error);var f=function(e){var a,c;function f(a,c,f){return e.call(this,function(e,a,c){return"string"==typeof t?t:t(e,a,c)}(a,c,f))||this}return c=e,(a=f).prototype=Object.create(c.prototype),a.prototype.constructor=a,a.__proto__=c,f}(c);f.prototype.name=c.name,f.prototype.code=e,a[e]=f}function c(e,a){if(Array.isArray(e)){var t=e.length;return e=e.map((function(e){return String(e)})),t>2?"one of ".concat(a," ").concat(e.slice(0,t-1).join(", "),", or ")+e[t-1]:2===t?"one of ".concat(a," ").concat(e[0]," or ").concat(e[1]):"of ".concat(a," ").concat(e[0])}return"of ".concat(a," ").concat(String(e))}t("ERR_INVALID_OPT_VALUE",(function(e,a){return'The value "'+a+'" is invalid for option "'+e+'"'}),TypeError),t("ERR_INVALID_ARG_TYPE",(function(e,a,t){var f,d,r,n,i;if("string"==typeof a&&(d="not ",a.substr(0,4)===d)?(f="must not be",a=a.replace(/^not /,"")):f="must be",function(e,a,t){return(void 0===t||t>e.length)&&(t=e.length),e.substring(t-9,t)===a}(e," argument"))r="The ".concat(e," ").concat(f," ").concat(c(a,"type"));else{var b=("number"!=typeof i&&(i=0),i+1>(n=e).length||-1===n.indexOf(".",i)?"argument":"property");r='The "'.concat(e,'" ').concat(b," ").concat(f," ").concat(c(a,"type"))}return r+". Received type ".concat(typeof t)}),TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=a},25382:(e,a,t)=>{"use strict";var c=Object.keys||function(e){var a=[];for(var t in e)a.push(t);return a};e.exports=b;var f=t(45412),d=t(16708);t(56698)(b,f);for(var r=c(d.prototype),n=0;n{"use strict";e.exports=f;var c=t(74610);function f(e){if(!(this instanceof f))return new f(e);c.call(this,e)}t(56698)(f,c),f.prototype._transform=function(e,a,t){t(null,e)}},45412:(e,a,t)=>{"use strict";var c;e.exports=I,I.ReadableState=_,t(37007).EventEmitter;var f,d=function(e,a){return e.listeners(a).length},r=t(40345),n=t(48287).Buffer,i=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},b=t(79838);f=b&&b.debuglog?b.debuglog("stream"):function(){};var o,s,l,u=t(80345),h=t(75896),p=t(65291).getHighWaterMark,g=t(86048).F,m=g.ERR_INVALID_ARG_TYPE,x=g.ERR_STREAM_PUSH_AFTER_EOF,y=g.ERR_METHOD_NOT_IMPLEMENTED,A=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;t(56698)(I,r);var v=h.errorOrDestroy,w=["error","close","destroy","pause","resume"];function _(e,a,f){c=c||t(25382),e=e||{},"boolean"!=typeof f&&(f=a instanceof c),this.objectMode=!!e.objectMode,f&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=p(this,e,"readableHighWaterMark",f),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=t(83141).I),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function I(e){if(c=c||t(25382),!(this instanceof I))return new I(e);var a=this instanceof c;this._readableState=new _(e,this,a),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),r.call(this)}function E(e,a,t,c,d){f("readableAddChunk",a);var r,b=e._readableState;if(null===a)b.reading=!1,function(e,a){if(f("onEofChunk"),!a.ended){if(a.decoder){var t=a.decoder.end();t&&t.length&&(a.buffer.push(t),a.length+=a.objectMode?1:t.length)}a.ended=!0,a.sync?L(e):(a.needReadable=!1,a.emittedReadable||(a.emittedReadable=!0,S(e)))}}(e,b);else if(d||(r=function(e,a){var t,c;return c=a,n.isBuffer(c)||c instanceof i||"string"==typeof a||void 0===a||e.objectMode||(t=new m("chunk",["string","Buffer","Uint8Array"],a)),t}(b,a)),r)v(e,r);else if(b.objectMode||a&&a.length>0)if("string"==typeof a||b.objectMode||Object.getPrototypeOf(a)===n.prototype||(a=function(e){return n.from(e)}(a)),c)b.endEmitted?v(e,new A):C(e,b,a,!0);else if(b.ended)v(e,new x);else{if(b.destroyed)return!1;b.reading=!1,b.decoder&&!t?(a=b.decoder.write(a),b.objectMode||0!==a.length?C(e,b,a,!1):k(e,b)):C(e,b,a,!1)}else c||(b.reading=!1,k(e,b));return!b.ended&&(b.lengtha.highWaterMark&&(a.highWaterMark=function(e){return e>=M?e=M:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0))}function L(e){var a=e._readableState;f("emitReadable",a.needReadable,a.emittedReadable),a.needReadable=!1,a.emittedReadable||(f("emitReadable",a.flowing),a.emittedReadable=!0,process.nextTick(S,e))}function S(e){var a=e._readableState;f("emitReadable_",a.destroyed,a.length,a.ended),a.destroyed||!a.length&&!a.ended||(e.emit("readable"),a.emittedReadable=!1),a.needReadable=!a.flowing&&!a.ended&&a.length<=a.highWaterMark,T(e)}function k(e,a){a.readingMore||(a.readingMore=!0,process.nextTick(N,e,a))}function N(e,a){for(;!a.reading&&!a.ended&&(a.length0,a.resumeScheduled&&!a.paused?a.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){f("readable nexttick read 0"),e.read(0)}function O(e,a){f("resume",a.reading),a.reading||e.read(0),a.resumeScheduled=!1,e.emit("resume"),T(e),a.flowing&&!a.reading&&e.read(0)}function T(e){var a=e._readableState;for(f("flow",a.flowing);a.flowing&&null!==e.read(););}function D(e,a){return 0===a.length?null:(a.objectMode?t=a.buffer.shift():!e||e>=a.length?(t=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.first():a.buffer.concat(a.length),a.buffer.clear()):t=a.buffer.consume(e,a.decoder),t);var t}function F(e){var a=e._readableState;f("endReadable",a.endEmitted),a.endEmitted||(a.ended=!0,process.nextTick(Q,a,e))}function Q(e,a){if(f("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,a.readable=!1,a.emit("end"),e.autoDestroy)){var t=a._writableState;(!t||t.autoDestroy&&t.finished)&&a.destroy()}}function U(e,a){for(var t=0,c=e.length;t=a.highWaterMark:a.length>0)||a.ended))return f("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?F(this):L(this),null;if(0===(e=B(e,a))&&a.ended)return 0===a.length&&F(this),null;var c,d=a.needReadable;return f("need readable",d),(0===a.length||a.length-e0?D(e,a):null)?(a.needReadable=a.length<=a.highWaterMark,e=0):(a.length-=e,a.awaitDrain=0),0===a.length&&(a.ended||(a.needReadable=!0),t!==e&&a.ended&&F(this)),null!==c&&this.emit("data",c),c},I.prototype._read=function(e){v(this,new y("_read()"))},I.prototype.pipe=function(e,a){var t=this,c=this._readableState;switch(c.pipesCount){case 0:c.pipes=e;break;case 1:c.pipes=[c.pipes,e];break;default:c.pipes.push(e)}c.pipesCount+=1,f("pipe count=%d opts=%j",c.pipesCount,a);var r=a&&!1===a.end||e===process.stdout||e===process.stderr?h:n;function n(){f("onend"),e.end()}c.endEmitted?process.nextTick(r):t.once("end",r),e.on("unpipe",(function a(d,r){f("onunpipe"),d===t&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,f("cleanup"),e.removeListener("close",l),e.removeListener("finish",u),e.removeListener("drain",i),e.removeListener("error",s),e.removeListener("unpipe",a),t.removeListener("end",n),t.removeListener("end",h),t.removeListener("data",o),b=!0,!c.awaitDrain||e._writableState&&!e._writableState.needDrain||i())}));var i=function(e){return function(){var a=e._readableState;f("pipeOnDrain",a.awaitDrain),a.awaitDrain&&a.awaitDrain--,0===a.awaitDrain&&d(e,"data")&&(a.flowing=!0,T(e))}}(t);e.on("drain",i);var b=!1;function o(a){f("ondata");var d=e.write(a);f("dest.write",d),!1===d&&((1===c.pipesCount&&c.pipes===e||c.pipesCount>1&&-1!==U(c.pipes,e))&&!b&&(f("false write response, pause",c.awaitDrain),c.awaitDrain++),t.pause())}function s(a){f("onerror",a),h(),e.removeListener("error",s),0===d(e,"error")&&v(e,a)}function l(){e.removeListener("finish",u),h()}function u(){f("onfinish"),e.removeListener("close",l),h()}function h(){f("unpipe"),t.unpipe(e)}return t.on("data",o),function(e,a,t){if("function"==typeof e.prependListener)return e.prependListener(a,t);e._events&&e._events[a]?Array.isArray(e._events[a])?e._events[a].unshift(t):e._events[a]=[t,e._events[a]]:e.on(a,t)}(e,"error",s),e.once("close",l),e.once("finish",u),e.emit("pipe",t),c.flowing||(f("pipe resume"),t.resume()),e},I.prototype.unpipe=function(e){var a=this._readableState,t={hasUnpiped:!1};if(0===a.pipesCount)return this;if(1===a.pipesCount)return e&&e!==a.pipes||(e||(e=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,e&&e.emit("unpipe",this,t)),this;if(!e){var c=a.pipes,f=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var d=0;d0,!1!==c.flowing&&this.resume()):"readable"===e&&(c.endEmitted||c.readableListening||(c.readableListening=c.needReadable=!0,c.flowing=!1,c.emittedReadable=!1,f("on readable",c.length,c.reading),c.length?L(this):c.reading||process.nextTick(R,this))),t},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(e,a){var t=r.prototype.removeListener.call(this,e,a);return"readable"===e&&process.nextTick(P,this),t},I.prototype.removeAllListeners=function(e){var a=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(P,this),a},I.prototype.resume=function(){var e=this._readableState;return e.flowing||(f("resume"),e.flowing=!e.readableListening,function(e,a){a.resumeScheduled||(a.resumeScheduled=!0,process.nextTick(O,e,a))}(this,e)),e.paused=!1,this},I.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},I.prototype.wrap=function(e){var a=this,t=this._readableState,c=!1;for(var d in e.on("end",(function(){if(f("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&a.push(e)}a.push(null)})),e.on("data",(function(d){f("wrapped data"),t.decoder&&(d=t.decoder.write(d)),t.objectMode&&null==d||(t.objectMode||d&&d.length)&&(a.push(d)||(c=!0,e.pause()))})),e)void 0===this[d]&&"function"==typeof e[d]&&(this[d]=function(a){return function(){return e[a].apply(e,arguments)}}(d));for(var r=0;r{"use strict";e.exports=o;var c=t(86048).F,f=c.ERR_METHOD_NOT_IMPLEMENTED,d=c.ERR_MULTIPLE_CALLBACK,r=c.ERR_TRANSFORM_ALREADY_TRANSFORMING,n=c.ERR_TRANSFORM_WITH_LENGTH_0,i=t(25382);function b(e,a){var t=this._transformState;t.transforming=!1;var c=t.writecb;if(null===c)return this.emit("error",new d);t.writechunk=null,t.writecb=null,null!=a&&this.push(a),c(e);var f=this._readableState;f.reading=!1,(f.needReadable||f.length{"use strict";function c(e){var a=this;this.next=null,this.entry=null,this.finish=function(){!function(e,a){var t=e.entry;for(e.entry=null;t;){var c=t.callback;a.pendingcb--,c(undefined),t=t.next}a.corkedRequestsFree.next=e}(a,e)}}var f;e.exports=I,I.WritableState=_;var d,r={deprecate:t(94643)},n=t(40345),i=t(48287).Buffer,b=(void 0!==t.g?t.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},o=t(75896),s=t(65291).getHighWaterMark,l=t(86048).F,u=l.ERR_INVALID_ARG_TYPE,h=l.ERR_METHOD_NOT_IMPLEMENTED,p=l.ERR_MULTIPLE_CALLBACK,g=l.ERR_STREAM_CANNOT_PIPE,m=l.ERR_STREAM_DESTROYED,x=l.ERR_STREAM_NULL_VALUES,y=l.ERR_STREAM_WRITE_AFTER_END,A=l.ERR_UNKNOWN_ENCODING,v=o.errorOrDestroy;function w(){}function _(e,a,d){f=f||t(25382),e=e||{},"boolean"!=typeof d&&(d=a instanceof f),this.objectMode=!!e.objectMode,d&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=s(this,e,"writableHighWaterMark",d),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var r=!1===e.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,a){var t=e._writableState,c=t.sync,f=t.writecb;if("function"!=typeof f)throw new p;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(t),a)!function(e,a,t,c,f){--a.pendingcb,t?(process.nextTick(f,c),process.nextTick(S,e,a),e._writableState.errorEmitted=!0,v(e,c)):(f(c),e._writableState.errorEmitted=!0,v(e,c),S(e,a))}(e,t,c,a,f);else{var d=B(t)||e.destroyed;d||t.corked||t.bufferProcessing||!t.bufferedRequest||M(e,t),c?process.nextTick(C,e,t,d,f):C(e,t,d,f)}}(a,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}function I(e){var a=this instanceof(f=f||t(25382));if(!a&&!d.call(I,this))return new I(e);this._writableState=new _(e,this,a),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),n.call(this)}function E(e,a,t,c,f,d,r){a.writelen=c,a.writecb=r,a.writing=!0,a.sync=!0,a.destroyed?a.onwrite(new m("write")):t?e._writev(f,a.onwrite):e._write(f,d,a.onwrite),a.sync=!1}function C(e,a,t,c){t||function(e,a){0===a.length&&a.needDrain&&(a.needDrain=!1,e.emit("drain"))}(e,a),a.pendingcb--,c(),S(e,a)}function M(e,a){a.bufferProcessing=!0;var t=a.bufferedRequest;if(e._writev&&t&&t.next){var f=a.bufferedRequestCount,d=new Array(f),r=a.corkedRequestsFree;r.entry=t;for(var n=0,i=!0;t;)d[n]=t,t.isBuf||(i=!1),t=t.next,n+=1;d.allBuffers=i,E(e,a,!0,a.length,d,"",r.finish),a.pendingcb++,a.lastBufferedRequest=null,r.next?(a.corkedRequestsFree=r.next,r.next=null):a.corkedRequestsFree=new c(a),a.bufferedRequestCount=0}else{for(;t;){var b=t.chunk,o=t.encoding,s=t.callback;if(E(e,a,!1,a.objectMode?1:b.length,b,o,s),t=t.next,a.bufferedRequestCount--,a.writing)break}null===t&&(a.lastBufferedRequest=null)}a.bufferedRequest=t,a.bufferProcessing=!1}function B(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function L(e,a){e._final((function(t){a.pendingcb--,t&&v(e,t),a.prefinished=!0,e.emit("prefinish"),S(e,a)}))}function S(e,a){var t=B(a);if(t&&(function(e,a){a.prefinished||a.finalCalled||("function"!=typeof e._final||a.destroyed?(a.prefinished=!0,e.emit("prefinish")):(a.pendingcb++,a.finalCalled=!0,process.nextTick(L,e,a)))}(e,a),0===a.pendingcb&&(a.finished=!0,e.emit("finish"),a.autoDestroy))){var c=e._readableState;(!c||c.autoDestroy&&c.endEmitted)&&e.destroy()}return t}t(56698)(I,n),_.prototype.getBuffer=function(){for(var e=this.bufferedRequest,a=[];e;)a.push(e),e=e.next;return a},function(){try{Object.defineProperty(_.prototype,"buffer",{get:r.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===I&&e&&e._writableState instanceof _}})):d=function(e){return e instanceof this},I.prototype.pipe=function(){v(this,new g)},I.prototype.write=function(e,a,t){var c,f=this._writableState,d=!1,r=!f.objectMode&&(c=e,i.isBuffer(c)||c instanceof b);return r&&!i.isBuffer(e)&&(e=function(e){return i.from(e)}(e)),"function"==typeof a&&(t=a,a=null),r?a="buffer":a||(a=f.defaultEncoding),"function"!=typeof t&&(t=w),f.ending?function(e,a){var t=new y;v(e,t),process.nextTick(a,t)}(this,t):(r||function(e,a,t,c){var f;return null===t?f=new x:"string"==typeof t||a.objectMode||(f=new u("chunk",["string","Buffer"],t)),!f||(v(e,f),process.nextTick(c,f),!1)}(this,f,e,t))&&(f.pendingcb++,d=function(e,a,t,c,f,d){if(!t){var r=function(e,a,t){return e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=i.from(a,t)),a}(a,c,f);c!==r&&(t=!0,f="buffer",c=r)}var n=a.objectMode?1:c.length;a.length+=n;var b=a.length-1))throw new A(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),I.prototype._write=function(e,a,t){t(new h("_write()"))},I.prototype._writev=null,I.prototype.end=function(e,a,t){var c=this._writableState;return"function"==typeof e?(t=e,e=null,a=null):"function"==typeof a&&(t=a,a=null),null!=e&&this.write(e,a),c.corked&&(c.corked=1,this.uncork()),c.ending||function(e,a,t){a.ending=!0,S(e,a),t&&(a.finished?process.nextTick(t):e.once("finish",t)),a.ended=!0,e.writable=!1}(this,c,t),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),I.prototype.destroy=o.destroy,I.prototype._undestroy=o.undestroy,I.prototype._destroy=function(e,a){a(e)}},2955:(e,a,t)=>{"use strict";var c;function f(e,a,t){return(a=function(e){var a=function(e){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var t=a.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof a?a:String(a)}(a))in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}var d=t(86238),r=Symbol("lastResolve"),n=Symbol("lastReject"),i=Symbol("error"),b=Symbol("ended"),o=Symbol("lastPromise"),s=Symbol("handlePromise"),l=Symbol("stream");function u(e,a){return{value:e,done:a}}function h(e){var a=e[r];if(null!==a){var t=e[l].read();null!==t&&(e[o]=null,e[r]=null,e[n]=null,a(u(t,!1)))}}function p(e){process.nextTick(h,e)}var g=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((f(c={get stream(){return this[l]},next:function(){var e=this,a=this[i];if(null!==a)return Promise.reject(a);if(this[b])return Promise.resolve(u(void 0,!0));if(this[l].destroyed)return new Promise((function(a,t){process.nextTick((function(){e[i]?t(e[i]):a(u(void 0,!0))}))}));var t,c=this[o];if(c)t=new Promise(function(e,a){return function(t,c){e.then((function(){a[b]?t(u(void 0,!0)):a[s](t,c)}),c)}}(c,this));else{var f=this[l].read();if(null!==f)return Promise.resolve(u(f,!1));t=new Promise(this[s])}return this[o]=t,t}},Symbol.asyncIterator,(function(){return this})),f(c,"return",(function(){var e=this;return new Promise((function(a,t){e[l].destroy(null,(function(e){e?t(e):a(u(void 0,!0))}))}))})),c),g);e.exports=function(e){var a,t=Object.create(m,(f(a={},l,{value:e,writable:!0}),f(a,r,{value:null,writable:!0}),f(a,n,{value:null,writable:!0}),f(a,i,{value:null,writable:!0}),f(a,b,{value:e._readableState.endEmitted,writable:!0}),f(a,s,{value:function(e,a){var c=t[l].read();c?(t[o]=null,t[r]=null,t[n]=null,e(u(c,!1))):(t[r]=e,t[n]=a)},writable:!0}),a));return t[o]=null,d(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var a=t[n];return null!==a&&(t[o]=null,t[r]=null,t[n]=null,a(e)),void(t[i]=e)}var c=t[r];null!==c&&(t[o]=null,t[r]=null,t[n]=null,c(u(void 0,!0))),t[b]=!0})),e.on("readable",p.bind(null,t)),t}},80345:(e,a,t)=>{"use strict";function c(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);a&&(c=c.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,c)}return t}function f(e){for(var a=1;a0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(e){var a={data:e,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var a=this.head,t=""+a.data;a=a.next;)t+=e+a.data;return t}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var a,t,c,f=i.allocUnsafe(e>>>0),d=this.head,r=0;d;)a=d.data,t=f,c=r,i.prototype.copy.call(a,t,c),r+=d.data.length,d=d.next;return f}},{key:"consume",value:function(e,a){var t;return ef.length?f.length:e;if(d===f.length?c+=f:c+=f.slice(0,e),0==(e-=d)){d===f.length?(++t,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=f.slice(d));break}++t}return this.length-=t,c}},{key:"_getBuffer",value:function(e){var a=i.allocUnsafe(e),t=this.head,c=1;for(t.data.copy(a),e-=t.data.length;t=t.next;){var f=t.data,d=e>f.length?f.length:e;if(f.copy(a,a.length-e,0,d),0==(e-=d)){d===f.length?(++c,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=f.slice(d));break}++c}return this.length-=c,a}},{key:o,value:function(e,a){return b(this,f(f({},a),{},{depth:0,customInspect:!1}))}}])&&r(a.prototype,t),Object.defineProperty(a,"prototype",{writable:!1}),e}()},75896:e=>{"use strict";function a(e,a){c(e,a),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function c(e,a){e.emit("error",a)}e.exports={destroy:function(e,f){var d=this,r=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return r||n?(f?f(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(c,this,e)):process.nextTick(c,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!f&&e?d._writableState?d._writableState.errorEmitted?process.nextTick(t,d):(d._writableState.errorEmitted=!0,process.nextTick(a,d,e)):process.nextTick(a,d,e):f?(process.nextTick(t,d),f(e)):process.nextTick(t,d)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,a){var t=e._readableState,c=e._writableState;t&&t.autoDestroy||c&&c.autoDestroy?e.destroy(a):e.emit("error",a)}}},86238:(e,a,t)=>{"use strict";var c=t(86048).F.ERR_STREAM_PREMATURE_CLOSE;function f(){}e.exports=function e(a,t,d){if("function"==typeof t)return e(a,null,t);t||(t={}),d=function(e){var a=!1;return function(){if(!a){a=!0;for(var t=arguments.length,c=new Array(t),f=0;f{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},57758:(e,a,t)=>{"use strict";var c,f=t(86048).F,d=f.ERR_MISSING_ARGS,r=f.ERR_STREAM_DESTROYED;function n(e){if(e)throw e}function i(e){e()}function b(e,a){return e.pipe(a)}e.exports=function(){for(var e=arguments.length,a=new Array(e),f=0;f0,(function(e){o||(o=e),e&&l.forEach(i),d||(l.forEach(i),s(o))}))}));return a.reduce(b)}},65291:(e,a,t)=>{"use strict";var c=t(86048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,a,t,f){var d=function(e,a,t){return null!=e.highWaterMark?e.highWaterMark:a?e[t]:null}(a,f,t);if(null!=d){if(!isFinite(d)||Math.floor(d)!==d||d<0)throw new c(f?t:"highWaterMark",d);return Math.floor(d)}return e.objectMode?16:16384}}},40345:(e,a,t)=>{e.exports=t(37007).EventEmitter},28399:(e,a,t)=>{(a=e.exports=t(45412)).Stream=a,a.Readable=a,a.Writable=t(16708),a.Duplex=t(25382),a.Transform=t(74610),a.PassThrough=t(63600),a.finished=t(86238),a.pipeline=t(57758)},66011:(e,a,t)=>{"use strict";var c=t(48287).Buffer,f=t(56698),d=t(51147),r=new Array(16),n=[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],i=[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],b=[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],o=[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],s=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function u(){d.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function h(e,a){return e<>>32-a}function p(e,a,t,c,f,d,r,n){return h(e+(a^t^c)+d+r|0,n)+f|0}function g(e,a,t,c,f,d,r,n){return h(e+(a&t|~a&c)+d+r|0,n)+f|0}function m(e,a,t,c,f,d,r,n){return h(e+((a|~t)^c)+d+r|0,n)+f|0}function x(e,a,t,c,f,d,r,n){return h(e+(a&c|t&~c)+d+r|0,n)+f|0}function y(e,a,t,c,f,d,r,n){return h(e+(a^(t|~c))+d+r|0,n)+f|0}f(u,d),u.prototype._update=function(){for(var e=r,a=0;a<16;++a)e[a]=this._block.readInt32LE(4*a);for(var t=0|this._a,c=0|this._b,f=0|this._c,d=0|this._d,u=0|this._e,A=0|this._a,v=0|this._b,w=0|this._c,_=0|this._d,I=0|this._e,E=0;E<80;E+=1){var C,M;E<16?(C=p(t,c,f,d,u,e[n[E]],s[0],b[E]),M=y(A,v,w,_,I,e[i[E]],l[0],o[E])):E<32?(C=g(t,c,f,d,u,e[n[E]],s[1],b[E]),M=x(A,v,w,_,I,e[i[E]],l[1],o[E])):E<48?(C=m(t,c,f,d,u,e[n[E]],s[2],b[E]),M=m(A,v,w,_,I,e[i[E]],l[2],o[E])):E<64?(C=x(t,c,f,d,u,e[n[E]],s[3],b[E]),M=g(A,v,w,_,I,e[i[E]],l[3],o[E])):(C=y(t,c,f,d,u,e[n[E]],s[4],b[E]),M=p(A,v,w,_,I,e[i[E]],l[4],o[E])),t=u,u=d,d=h(f,10),f=c,c=C,A=I,I=_,_=h(w,10),w=v,v=M}var B=this._b+f+_|0;this._b=this._c+d+I|0,this._c=this._d+u+A|0,this._d=this._e+t+v|0,this._e=this._a+c+w|0,this._a=B},u.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 e=c.alloc?c.alloc(20):new c(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=u},51147:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=t(28399).Transform;function d(e){f.call(this),this._block=c.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(56698)(d,f),d.prototype._transform=function(e,a,t){var c=null;try{this.update(e,a)}catch(e){c=e}t(c)},d.prototype._flush=function(e){var a=null;try{this.push(this.digest())}catch(e){a=e}e(a)},d.prototype.update=function(e,a){if(function(e){if(!c.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");c.isBuffer(e)||(e=c.from(e,a));for(var t=this._block,f=0;this._blockOffset+e.length-f>=this._blockSize;){for(var d=this._blockOffset;d0;++r)this._length[r]+=n,(n=this._length[r]/4294967296|0)>0&&(this._length[r]-=4294967296*n);return this},d.prototype._update=function(){throw new Error("_update is not implemented")},d.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();void 0!==e&&(a=a.toString(e)),this._block.fill(0),this._blockOffset=0;for(var t=0;t<4;++t)this._length[t]=0;return a},d.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=d},92861:(e,a,t)=>{var c=t(48287),f=c.Buffer;function d(e,a){for(var t in e)a[t]=e[t]}function r(e,a,t){return f(e,a,t)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?e.exports=c:(d(c,a),a.Buffer=r),r.prototype=Object.create(f.prototype),d(f,r),r.from=function(e,a,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return f(e,a,t)},r.alloc=function(e,a,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var c=f(e);return void 0!==a?"string"==typeof t?c.fill(a,t):c.fill(a):c.fill(0),c},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return c.SlowBuffer(e)}},93904:(e,a,t)=>{const c=Symbol("SemVer ANY");class f{static get ANY(){return c}constructor(e,a){if(a=d(a),e instanceof f){if(e.loose===!!a.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),b("comparator",e,a),this.options=a,this.loose=!!a.loose,this.parse(e),this.semver===c?this.value="":this.value=this.operator+this.semver.version,b("comp",this)}parse(e){const a=this.options.loose?r[n.COMPARATORLOOSE]:r[n.COMPARATOR],t=e.match(a);if(!t)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),t[2]?this.semver=new o(t[2],this.options.loose):this.semver=c}toString(){return this.value}test(e){if(b("Comparator.test",e,this.options.loose),this.semver===c||e===c)return!0;if("string"==typeof e)try{e=new o(e,this.options)}catch(e){return!1}return i(e,this.operator,this.semver,this.options)}intersects(e,a){if(!(e instanceof f))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new s(e.value,a).test(this.value):""===e.operator?""===e.value||new s(this.value,a).test(e.semver):!((a=d(a)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!a.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(i(this.semver,"<",e.semver,a)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(i(this.semver,">",e.semver,a)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=f;const d=t(98587),{safeRe:r,t:n}=t(99718),i=t(72111),b=t(57272),o=t(53908),s=t(78311)},78311:(e,a,t)=>{const c=/\s+/g;class f{constructor(e,a){if(a=r(a),e instanceof f)return e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease?e:new f(e.raw,a);if(e instanceof n)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=e.trim().replace(c," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!m(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&x(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const a=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=a[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const a=((this.options.includePrerelease&&p)|(this.options.loose&&g))+":"+e,t=d.get(a);if(t)return t;const c=this.options.loose,f=c?o[s.HYPHENRANGELOOSE]:o[s.HYPHENRANGE];e=e.replace(f,S(this.options.includePrerelease)),i("hyphen replace",e),e=e.replace(o[s.COMPARATORTRIM],l),i("comparator trim",e),e=e.replace(o[s.TILDETRIM],u),i("tilde trim",e),e=e.replace(o[s.CARETTRIM],h),i("caret trim",e);let r=e.split(" ").map((e=>A(e,this.options))).join(" ").split(/\s+/).map((e=>L(e,this.options)));c&&(r=r.filter((e=>(i("loose invalid filter",e,this.options),!!e.match(o[s.COMPARATORLOOSE]))))),i("range list",r);const b=new Map,x=r.map((e=>new n(e,this.options)));for(const e of x){if(m(e))return[e];b.set(e.value,e)}b.size>1&&b.has("")&&b.delete("");const y=[...b.values()];return d.set(a,y),y}intersects(e,a){if(!(e instanceof f))throw new TypeError("a Range is required");return this.set.some((t=>y(t,a)&&e.set.some((e=>y(e,a)&&t.every((t=>e.every((e=>t.intersects(e,a)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new b(e,this.options)}catch(e){return!1}for(let a=0;a"<0.0.0-0"===e.value,x=e=>""===e.value,y=(e,a)=>{let t=!0;const c=e.slice();let f=c.pop();for(;t&&c.length;)t=c.every((e=>f.intersects(e,a))),f=c.pop();return t},A=(e,a)=>(i("comp",e,a),e=I(e,a),i("caret",e),e=w(e,a),i("tildes",e),e=C(e,a),i("xrange",e),e=B(e,a),i("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,a)=>e.trim().split(/\s+/).map((e=>_(e,a))).join(" "),_=(e,a)=>{const t=a.loose?o[s.TILDELOOSE]:o[s.TILDE];return e.replace(t,((a,t,c,f,d)=>{let r;return i("tilde",e,a,t,c,f,d),v(t)?r="":v(c)?r=`>=${t}.0.0 <${+t+1}.0.0-0`:v(f)?r=`>=${t}.${c}.0 <${t}.${+c+1}.0-0`:d?(i("replaceTilde pr",d),r=`>=${t}.${c}.${f}-${d} <${t}.${+c+1}.0-0`):r=`>=${t}.${c}.${f} <${t}.${+c+1}.0-0`,i("tilde return",r),r}))},I=(e,a)=>e.trim().split(/\s+/).map((e=>E(e,a))).join(" "),E=(e,a)=>{i("caret",e,a);const t=a.loose?o[s.CARETLOOSE]:o[s.CARET],c=a.includePrerelease?"-0":"";return e.replace(t,((a,t,f,d,r)=>{let n;return i("caret",e,a,t,f,d,r),v(t)?n="":v(f)?n=`>=${t}.0.0${c} <${+t+1}.0.0-0`:v(d)?n="0"===t?`>=${t}.${f}.0${c} <${t}.${+f+1}.0-0`:`>=${t}.${f}.0${c} <${+t+1}.0.0-0`:r?(i("replaceCaret pr",r),n="0"===t?"0"===f?`>=${t}.${f}.${d}-${r} <${t}.${f}.${+d+1}-0`:`>=${t}.${f}.${d}-${r} <${t}.${+f+1}.0-0`:`>=${t}.${f}.${d}-${r} <${+t+1}.0.0-0`):(i("no pr"),n="0"===t?"0"===f?`>=${t}.${f}.${d}${c} <${t}.${f}.${+d+1}-0`:`>=${t}.${f}.${d}${c} <${t}.${+f+1}.0-0`:`>=${t}.${f}.${d} <${+t+1}.0.0-0`),i("caret return",n),n}))},C=(e,a)=>(i("replaceXRanges",e,a),e.split(/\s+/).map((e=>M(e,a))).join(" ")),M=(e,a)=>{e=e.trim();const t=a.loose?o[s.XRANGELOOSE]:o[s.XRANGE];return e.replace(t,((t,c,f,d,r,n)=>{i("xRange",e,t,c,f,d,r,n);const b=v(f),o=b||v(d),s=o||v(r),l=s;return"="===c&&l&&(c=""),n=a.includePrerelease?"-0":"",b?t=">"===c||"<"===c?"<0.0.0-0":"*":c&&l?(o&&(d=0),r=0,">"===c?(c=">=",o?(f=+f+1,d=0,r=0):(d=+d+1,r=0)):"<="===c&&(c="<",o?f=+f+1:d=+d+1),"<"===c&&(n="-0"),t=`${c+f}.${d}.${r}${n}`):o?t=`>=${f}.0.0${n} <${+f+1}.0.0-0`:s&&(t=`>=${f}.${d}.0${n} <${f}.${+d+1}.0-0`),i("xRange return",t),t}))},B=(e,a)=>(i("replaceStars",e,a),e.trim().replace(o[s.STAR],"")),L=(e,a)=>(i("replaceGTE0",e,a),e.trim().replace(o[a.includePrerelease?s.GTE0PRE:s.GTE0],"")),S=e=>(a,t,c,f,d,r,n,i,b,o,s,l)=>`${t=v(c)?"":v(f)?`>=${c}.0.0${e?"-0":""}`:v(d)?`>=${c}.${f}.0${e?"-0":""}`:r?`>=${t}`:`>=${t}${e?"-0":""}`} ${i=v(b)?"":v(o)?`<${+b+1}.0.0-0`:v(s)?`<${b}.${+o+1}.0-0`:l?`<=${b}.${o}.${s}-${l}`:e?`<${b}.${o}.${+s+1}-0`:`<=${i}`}`.trim(),k=(e,a,t)=>{for(let t=0;t0){const c=e[t].semver;if(c.major===a.major&&c.minor===a.minor&&c.patch===a.patch)return!0}return!1}return!0}},53908:(e,a,t)=>{const c=t(57272),{MAX_LENGTH:f,MAX_SAFE_INTEGER:d}=t(16874),{safeRe:r,t:n}=t(99718),i=t(98587),{compareIdentifiers:b}=t(61123);class o{constructor(e,a){if(a=i(a),e instanceof o){if(e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>f)throw new TypeError(`version is longer than ${f} characters`);c("SemVer",e,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;const t=e.trim().match(a.loose?r[n.LOOSE]:r[n.FULL]);if(!t)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>d||this.major<0)throw new TypeError("Invalid major version");if(this.minor>d||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>d||this.patch<0)throw new TypeError("Invalid patch version");t[4]?this.prerelease=t[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const a=+e;if(a>=0&&a=0;)"number"==typeof this.prerelease[c]&&(this.prerelease[c]++,c=-2);if(-1===c){if(a===this.prerelease.join(".")&&!1===t)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(a){let c=[a,e];!1===t&&(c=[a]),0===b(this.prerelease[0],a)?isNaN(this.prerelease[1])&&(this.prerelease=c):this.prerelease=c}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=o},57414:(e,a,t)=>{const c=t(30144);e.exports=(e,a)=>{const t=c(e.trim().replace(/^[=v]+/,""),a);return t?t.version:null}},72111:(e,a,t)=>{const c=t(94641),f=t(13999),d=t(35580),r=t(54089),n=t(7059),i=t(25200);e.exports=(e,a,t,b)=>{switch(a){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e===t;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e!==t;case"":case"=":case"==":return c(e,t,b);case"!=":return f(e,t,b);case">":return d(e,t,b);case">=":return r(e,t,b);case"<":return n(e,t,b);case"<=":return i(e,t,b);default:throw new TypeError(`Invalid operator: ${a}`)}}},46170:(e,a,t)=>{const c=t(53908),f=t(30144),{safeRe:d,t:r}=t(99718);e.exports=(e,a)=>{if(e instanceof c)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let t=null;if((a=a||{}).rtl){const c=a.includePrerelease?d[r.COERCERTLFULL]:d[r.COERCERTL];let f;for(;(f=c.exec(e))&&(!t||t.index+t[0].length!==e.length);)t&&f.index+f[0].length===t.index+t[0].length||(t=f),c.lastIndex=f.index+f[1].length+f[2].length;c.lastIndex=-1}else t=e.match(a.includePrerelease?d[r.COERCEFULL]:d[r.COERCE]);if(null===t)return null;const n=t[2],i=t[3]||"0",b=t[4]||"0",o=a.includePrerelease&&t[5]?`-${t[5]}`:"",s=a.includePrerelease&&t[6]?`+${t[6]}`:"";return f(`${n}.${i}.${b}${o}${s}`,a)}},40909:(e,a,t)=>{const c=t(53908);e.exports=(e,a,t)=>{const f=new c(e,t),d=new c(a,t);return f.compare(d)||f.compareBuild(d)}},11763:(e,a,t)=>{const c=t(50560);e.exports=(e,a)=>c(e,a,!0)},50560:(e,a,t)=>{const c=t(53908);e.exports=(e,a,t)=>new c(e,t).compare(new c(a,t))},51832:(e,a,t)=>{const c=t(30144);e.exports=(e,a)=>{const t=c(e,null,!0),f=c(a,null,!0),d=t.compare(f);if(0===d)return null;const r=d>0,n=r?t:f,i=r?f:t,b=!!n.prerelease.length;if(i.prerelease.length&&!b)return i.patch||i.minor?n.patch?"patch":n.minor?"minor":"major":"major";const o=b?"pre":"";return t.major!==f.major?o+"major":t.minor!==f.minor?o+"minor":t.patch!==f.patch?o+"patch":"prerelease"}},94641:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>0===c(e,a,t)},35580:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>c(e,a,t)>0},54089:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>c(e,a,t)>=0},93007:(e,a,t)=>{const c=t(53908);e.exports=(e,a,t,f,d)=>{"string"==typeof t&&(d=f,f=t,t=void 0);try{return new c(e instanceof c?e.version:e,t).inc(a,f,d).version}catch(e){return null}}},7059:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>c(e,a,t)<0},25200:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>c(e,a,t)<=0},32938:(e,a,t)=>{const c=t(53908);e.exports=(e,a)=>new c(e,a).major},46254:(e,a,t)=>{const c=t(53908);e.exports=(e,a)=>new c(e,a).minor},13999:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>0!==c(e,a,t)},30144:(e,a,t)=>{const c=t(53908);e.exports=(e,a,t=!1)=>{if(e instanceof c)return e;try{return new c(e,a)}catch(e){if(!t)return null;throw e}}},24493:(e,a,t)=>{const c=t(53908);e.exports=(e,a)=>new c(e,a).patch},31729:(e,a,t)=>{const c=t(30144);e.exports=(e,a)=>{const t=c(e,a);return t&&t.prerelease.length?t.prerelease:null}},9970:(e,a,t)=>{const c=t(50560);e.exports=(e,a,t)=>c(a,e,t)},74277:(e,a,t)=>{const c=t(40909);e.exports=(e,a)=>e.sort(((e,t)=>c(t,e,a)))},97638:(e,a,t)=>{const c=t(78311);e.exports=(e,a,t)=>{try{a=new c(a,t)}catch(e){return!1}return a.test(e)}},43927:(e,a,t)=>{const c=t(40909);e.exports=(e,a)=>e.sort(((e,t)=>c(e,t,a)))},56953:(e,a,t)=>{const c=t(30144);e.exports=(e,a)=>{const t=c(e,a);return t?t.version:null}},99589:(e,a,t)=>{const c=t(99718),f=t(16874),d=t(53908),r=t(61123),n=t(30144),i=t(56953),b=t(57414),o=t(93007),s=t(51832),l=t(32938),u=t(46254),h=t(24493),p=t(31729),g=t(50560),m=t(9970),x=t(11763),y=t(40909),A=t(43927),v=t(74277),w=t(35580),_=t(7059),I=t(94641),E=t(13999),C=t(54089),M=t(25200),B=t(72111),L=t(46170),S=t(93904),k=t(78311),N=t(97638),P=t(77631),R=t(19628),O=t(270),T=t(41261),D=t(13874),F=t(97075),Q=t(75571),U=t(5342),j=t(76780),H=t(72525),$=t(75032);e.exports={parse:n,valid:i,clean:b,inc:o,diff:s,major:l,minor:u,patch:h,prerelease:p,compare:g,rcompare:m,compareLoose:x,compareBuild:y,sort:A,rsort:v,gt:w,lt:_,eq:I,neq:E,gte:C,lte:M,cmp:B,coerce:L,Comparator:S,Range:k,satisfies:N,toComparators:P,maxSatisfying:R,minSatisfying:O,minVersion:T,validRange:D,outside:F,gtr:Q,ltr:U,intersects:j,simplifyRange:H,subset:$,SemVer:d,re:c.re,src:c.src,tokens:c.t,SEMVER_SPEC_VERSION:f.SEMVER_SPEC_VERSION,RELEASE_TYPES:f.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers}},16874:e=>{const a=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:a,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},57272:e=>{const a="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=a},61123:e=>{const a=/^[0-9]+$/,t=(e,t)=>{const c=a.test(e),f=a.test(t);return c&&f&&(e=+e,t=+t),e===t?0:c&&!f?-1:f&&!c?1:et(a,e)}},68794:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const a=this.map.get(e);return void 0===a?void 0:(this.map.delete(e),this.map.set(e,a),a)}delete(e){return this.map.delete(e)}set(e,a){if(!this.delete(e)&&void 0!==a){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,a)}return this}}},98587:e=>{const a=Object.freeze({loose:!0}),t=Object.freeze({});e.exports=e=>e?"object"!=typeof e?a:e:t},99718:(e,a,t)=>{const{MAX_SAFE_COMPONENT_LENGTH:c,MAX_SAFE_BUILD_LENGTH:f,MAX_LENGTH:d}=t(16874),r=t(57272),n=(a=e.exports={}).re=[],i=a.safeRe=[],b=a.src=[],o=a.t={};let s=0;const l="[a-zA-Z0-9-]",u=[["\\s",1],["\\d",d],[l,f]],h=(e,a,t)=>{const c=(e=>{for(const[a,t]of u)e=e.split(`${a}*`).join(`${a}{0,${t}}`).split(`${a}+`).join(`${a}{1,${t}}`);return e})(a),f=s++;r(e,f,a),o[e]=f,b[f]=a,n[f]=new RegExp(a,t?"g":void 0),i[f]=new RegExp(c,t?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${l}*`),h("MAINVERSION",`(${b[o.NUMERICIDENTIFIER]})\\.(${b[o.NUMERICIDENTIFIER]})\\.(${b[o.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${b[o.NUMERICIDENTIFIERLOOSE]})\\.(${b[o.NUMERICIDENTIFIERLOOSE]})\\.(${b[o.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${b[o.NUMERICIDENTIFIER]}|${b[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${b[o.NUMERICIDENTIFIERLOOSE]}|${b[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${b[o.PRERELEASEIDENTIFIER]}(?:\\.${b[o.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${b[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${b[o.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${l}+`),h("BUILD",`(?:\\+(${b[o.BUILDIDENTIFIER]}(?:\\.${b[o.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${b[o.MAINVERSION]}${b[o.PRERELEASE]}?${b[o.BUILD]}?`),h("FULL",`^${b[o.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${b[o.MAINVERSIONLOOSE]}${b[o.PRERELEASELOOSE]}?${b[o.BUILD]}?`),h("LOOSE",`^${b[o.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${b[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${b[o.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${b[o.XRANGEIDENTIFIER]})(?:\\.(${b[o.XRANGEIDENTIFIER]})(?:\\.(${b[o.XRANGEIDENTIFIER]})(?:${b[o.PRERELEASE]})?${b[o.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${b[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[o.XRANGEIDENTIFIERLOOSE]})(?:${b[o.PRERELEASELOOSE]})?${b[o.BUILD]}?)?)?`),h("XRANGE",`^${b[o.GTLT]}\\s*${b[o.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${b[o.GTLT]}\\s*${b[o.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${c}})(?:\\.(\\d{1,${c}}))?(?:\\.(\\d{1,${c}}))?`),h("COERCE",`${b[o.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",b[o.COERCEPLAIN]+`(?:${b[o.PRERELEASE]})?`+`(?:${b[o.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",b[o.COERCE],!0),h("COERCERTLFULL",b[o.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${b[o.LONETILDE]}\\s+`,!0),a.tildeTrimReplace="$1~",h("TILDE",`^${b[o.LONETILDE]}${b[o.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${b[o.LONETILDE]}${b[o.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${b[o.LONECARET]}\\s+`,!0),a.caretTrimReplace="$1^",h("CARET",`^${b[o.LONECARET]}${b[o.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${b[o.LONECARET]}${b[o.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${b[o.GTLT]}\\s*(${b[o.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${b[o.GTLT]}\\s*(${b[o.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${b[o.GTLT]}\\s*(${b[o.LOOSEPLAIN]}|${b[o.XRANGEPLAIN]})`,!0),a.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${b[o.XRANGEPLAIN]})\\s+-\\s+(${b[o.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${b[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${b[o.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},75571:(e,a,t)=>{const c=t(97075);e.exports=(e,a,t)=>c(e,a,">",t)},76780:(e,a,t)=>{const c=t(78311);e.exports=(e,a,t)=>(e=new c(e,t),a=new c(a,t),e.intersects(a,t))},5342:(e,a,t)=>{const c=t(97075);e.exports=(e,a,t)=>c(e,a,"<",t)},19628:(e,a,t)=>{const c=t(53908),f=t(78311);e.exports=(e,a,t)=>{let d=null,r=null,n=null;try{n=new f(a,t)}catch(e){return null}return e.forEach((e=>{n.test(e)&&(d&&-1!==r.compare(e)||(d=e,r=new c(d,t)))})),d}},270:(e,a,t)=>{const c=t(53908),f=t(78311);e.exports=(e,a,t)=>{let d=null,r=null,n=null;try{n=new f(a,t)}catch(e){return null}return e.forEach((e=>{n.test(e)&&(d&&1!==r.compare(e)||(d=e,r=new c(d,t)))})),d}},41261:(e,a,t)=>{const c=t(53908),f=t(78311),d=t(35580);e.exports=(e,a)=>{e=new f(e,a);let t=new c("0.0.0");if(e.test(t))return t;if(t=new c("0.0.0-0"),e.test(t))return t;t=null;for(let a=0;a{const a=new c(e.semver.version);switch(e.operator){case">":0===a.prerelease.length?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":r&&!d(a,r)||(r=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!r||t&&!d(t,r)||(t=r)}return t&&e.test(t)?t:null}},97075:(e,a,t)=>{const c=t(53908),f=t(93904),{ANY:d}=f,r=t(78311),n=t(97638),i=t(35580),b=t(7059),o=t(25200),s=t(54089);e.exports=(e,a,t,l)=>{let u,h,p,g,m;switch(e=new c(e,l),a=new r(a,l),t){case">":u=i,h=o,p=b,g=">",m=">=";break;case"<":u=b,h=s,p=i,g="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(n(e,a,l))return!1;for(let t=0;t{e.semver===d&&(e=new f(">=0.0.0")),r=r||e,n=n||e,u(e.semver,r.semver,l)?r=e:p(e.semver,n.semver,l)&&(n=e)})),r.operator===g||r.operator===m)return!1;if((!n.operator||n.operator===g)&&h(e,n.semver))return!1;if(n.operator===m&&p(e,n.semver))return!1}return!0}},72525:(e,a,t)=>{const c=t(97638),f=t(50560);e.exports=(e,a,t)=>{const d=[];let r=null,n=null;const i=e.sort(((e,a)=>f(e,a,t)));for(const e of i)c(e,a,t)?(n=e,r||(r=e)):(n&&d.push([r,n]),n=null,r=null);r&&d.push([r,null]);const b=[];for(const[e,a]of d)e===a?b.push(e):a||e!==i[0]?a?e===i[0]?b.push(`<=${a}`):b.push(`${e} - ${a}`):b.push(`>=${e}`):b.push("*");const o=b.join(" || "),s="string"==typeof a.raw?a.raw:String(a);return o.length{const c=t(78311),f=t(93904),{ANY:d}=f,r=t(97638),n=t(50560),i=[new f(">=0.0.0-0")],b=[new f(">=0.0.0")],o=(e,a,t)=>{if(e===a)return!0;if(1===e.length&&e[0].semver===d){if(1===a.length&&a[0].semver===d)return!0;e=t.includePrerelease?i:b}if(1===a.length&&a[0].semver===d){if(t.includePrerelease)return!0;a=b}const c=new Set;let f,o,u,h,p,g,m;for(const a of e)">"===a.operator||">="===a.operator?f=s(f,a,t):"<"===a.operator||"<="===a.operator?o=l(o,a,t):c.add(a.semver);if(c.size>1)return null;if(f&&o){if(u=n(f.semver,o.semver,t),u>0)return null;if(0===u&&(">="!==f.operator||"<="!==o.operator))return null}for(const e of c){if(f&&!r(e,String(f),t))return null;if(o&&!r(e,String(o),t))return null;for(const c of a)if(!r(e,String(c),t))return!1;return!0}let x=!(!o||t.includePrerelease||!o.semver.prerelease.length)&&o.semver,y=!(!f||t.includePrerelease||!f.semver.prerelease.length)&&f.semver;x&&1===x.prerelease.length&&"<"===o.operator&&0===x.prerelease[0]&&(x=!1);for(const e of a){if(m=m||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,f)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(h=s(f,e,t),h===e&&h!==f)return!1}else if(">="===f.operator&&!r(f.semver,String(e),t))return!1;if(o)if(x&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===x.major&&e.semver.minor===x.minor&&e.semver.patch===x.patch&&(x=!1),"<"===e.operator||"<="===e.operator){if(p=l(o,e,t),p===e&&p!==o)return!1}else if("<="===o.operator&&!r(o.semver,String(e),t))return!1;if(!e.operator&&(o||f)&&0!==u)return!1}return!(f&&g&&!o&&0!==u||o&&m&&!f&&0!==u||y||x)},s=(e,a,t)=>{if(!e)return a;const c=n(e.semver,a.semver,t);return c>0?e:c<0||">"===a.operator&&">="===e.operator?a:e},l=(e,a,t)=>{if(!e)return a;const c=n(e.semver,a.semver,t);return c<0?e:c>0||"<"===a.operator&&"<="===e.operator?a:e};e.exports=(e,a,t={})=>{if(e===a)return!0;e=new c(e,t),a=new c(a,t);let f=!1;e:for(const c of e.set){for(const e of a.set){const a=o(c,e,t);if(f=f||null!==a,a)continue e}if(f)return!1}return!0}},77631:(e,a,t)=>{const c=t(78311);e.exports=(e,a)=>new c(e,a).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},13874:(e,a,t)=>{const c=t(78311);e.exports=(e,a)=>{try{return new c(e,a).range||"*"}catch(e){return null}}},96897:(e,a,t)=>{"use strict";var c=t(70453),f=t(30041),d=t(30592)(),r=t(75795),n=t(69675),i=c("%Math.floor%");e.exports=function(e,a){if("function"!=typeof e)throw new n("`fn` is not a function");if("number"!=typeof a||a<0||a>4294967295||i(a)!==a)throw new n("`length` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],c=!0,b=!0;if("length"in e&&r){var o=r(e,"length");o&&!o.configurable&&(c=!1),o&&!o.writable&&(b=!1)}return(c||b||!t)&&(d?f(e,"length",a,!0,!0):f(e,"length",a)),e}},90392:(e,a,t)=>{var c=t(92861).Buffer;function f(e,a){this._block=c.alloc(e),this._finalSize=a,this._blockSize=e,this._len=0}f.prototype.update=function(e,a){"string"==typeof e&&(a=a||"utf8",e=c.from(e,a));for(var t=this._block,f=this._blockSize,d=e.length,r=this._len,n=0;n=this._finalSize&&(this._update(this._block),this._block.fill(0));var t=8*this._len;if(t<=4294967295)this._block.writeUInt32BE(t,this._blockSize-4);else{var c=(4294967295&t)>>>0,f=(t-c)/4294967296;this._block.writeUInt32BE(f,this._blockSize-8),this._block.writeUInt32BE(c,this._blockSize-4)}this._update(this._block);var d=this._hash();return e?d.toString(e):d},f.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=f},62802:(e,a,t)=>{var c=e.exports=function(e){e=e.toLowerCase();var a=c[e];if(!a)throw new Error(e+" is not supported (we accept pull requests)");return new a};c.sha=t(27816),c.sha1=t(63737),c.sha224=t(26710),c.sha256=t(24107),c.sha384=t(32827),c.sha512=t(82890)},27816:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function i(){this.init(),this._w=n,f.call(this,64,56)}function b(e){return e<<30|e>>>2}function o(e,a,t,c){return 0===e?a&t|~a&c:2===e?a&t|a&c|t&c:a^t^c}c(i,f),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(e){for(var a,t=this._w,c=0|this._a,f=0|this._b,d=0|this._c,n=0|this._d,i=0|this._e,s=0;s<16;++s)t[s]=e.readInt32BE(4*s);for(;s<80;++s)t[s]=t[s-3]^t[s-8]^t[s-14]^t[s-16];for(var l=0;l<80;++l){var u=~~(l/20),h=0|((a=c)<<5|a>>>27)+o(u,f,d,n)+i+t[l]+r[u];i=n,n=d,d=b(f),f=c,c=h}this._a=c+this._a|0,this._b=f+this._b|0,this._c=d+this._c|0,this._d=n+this._d|0,this._e=i+this._e|0},i.prototype._hash=function(){var e=d.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=i},63737:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function i(){this.init(),this._w=n,f.call(this,64,56)}function b(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function s(e,a,t,c){return 0===e?a&t|~a&c:2===e?a&t|a&c|t&c:a^t^c}c(i,f),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(e){for(var a,t=this._w,c=0|this._a,f=0|this._b,d=0|this._c,n=0|this._d,i=0|this._e,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<80;++l)t[l]=(a=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|a>>>31;for(var u=0;u<80;++u){var h=~~(u/20),p=b(c)+s(h,f,d,n)+i+t[u]+r[h]|0;i=n,n=d,d=o(f),f=c,c=p}this._a=c+this._a|0,this._b=f+this._b|0,this._c=d+this._c|0,this._d=n+this._d|0,this._e=i+this._e|0},i.prototype._hash=function(){var e=d.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=i},26710:(e,a,t)=>{var c=t(56698),f=t(24107),d=t(90392),r=t(92861).Buffer,n=new Array(64);function i(){this.init(),this._w=n,d.call(this,64,56)}c(i,f),i.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},i.prototype._hash=function(){var e=r.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=i},24107:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[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],n=new Array(64);function i(){this.init(),this._w=n,f.call(this,64,56)}function b(e,a,t){return t^e&(a^t)}function o(e,a,t){return e&a|t&(e|a)}function s(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function l(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function u(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}c(i,f),i.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},i.prototype._update=function(e){for(var a,t=this._w,c=0|this._a,f=0|this._b,d=0|this._c,n=0|this._d,i=0|this._e,h=0|this._f,p=0|this._g,g=0|this._h,m=0;m<16;++m)t[m]=e.readInt32BE(4*m);for(;m<64;++m)t[m]=0|(((a=t[m-2])>>>17|a<<15)^(a>>>19|a<<13)^a>>>10)+t[m-7]+u(t[m-15])+t[m-16];for(var x=0;x<64;++x){var y=g+l(i)+b(i,h,p)+r[x]+t[x]|0,A=s(c)+o(c,f,d)|0;g=p,p=h,h=i,i=n+y|0,n=d,d=f,f=c,c=y+A|0}this._a=c+this._a|0,this._b=f+this._b|0,this._c=d+this._c|0,this._d=n+this._d|0,this._e=i+this._e|0,this._f=h+this._f|0,this._g=p+this._g|0,this._h=g+this._h|0},i.prototype._hash=function(){var e=d.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=i},32827:(e,a,t)=>{var c=t(56698),f=t(82890),d=t(90392),r=t(92861).Buffer,n=new Array(160);function i(){this.init(),this._w=n,d.call(this,128,112)}c(i,f),i.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},i.prototype._hash=function(){var e=r.allocUnsafe(48);function a(a,t,c){e.writeInt32BE(a,c),e.writeInt32BE(t,c+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),e},e.exports=i},82890:(e,a,t)=>{var c=t(56698),f=t(90392),d=t(92861).Buffer,r=[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],n=new Array(160);function i(){this.init(),this._w=n,f.call(this,128,112)}function b(e,a,t){return t^e&(a^t)}function o(e,a,t){return e&a|t&(e|a)}function s(e,a){return(e>>>28|a<<4)^(a>>>2|e<<30)^(a>>>7|e<<25)}function l(e,a){return(e>>>14|a<<18)^(e>>>18|a<<14)^(a>>>9|e<<23)}function u(e,a){return(e>>>1|a<<31)^(e>>>8|a<<24)^e>>>7}function h(e,a){return(e>>>1|a<<31)^(e>>>8|a<<24)^(e>>>7|a<<25)}function p(e,a){return(e>>>19|a<<13)^(a>>>29|e<<3)^e>>>6}function g(e,a){return(e>>>19|a<<13)^(a>>>29|e<<3)^(e>>>6|a<<26)}function m(e,a){return e>>>0>>0?1:0}c(i,f),i.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},i.prototype._update=function(e){for(var a=this._w,t=0|this._ah,c=0|this._bh,f=0|this._ch,d=0|this._dh,n=0|this._eh,i=0|this._fh,x=0|this._gh,y=0|this._hh,A=0|this._al,v=0|this._bl,w=0|this._cl,_=0|this._dl,I=0|this._el,E=0|this._fl,C=0|this._gl,M=0|this._hl,B=0;B<32;B+=2)a[B]=e.readInt32BE(4*B),a[B+1]=e.readInt32BE(4*B+4);for(;B<160;B+=2){var L=a[B-30],S=a[B-30+1],k=u(L,S),N=h(S,L),P=p(L=a[B-4],S=a[B-4+1]),R=g(S,L),O=a[B-14],T=a[B-14+1],D=a[B-32],F=a[B-32+1],Q=N+T|0,U=k+O+m(Q,N)|0;U=(U=U+P+m(Q=Q+R|0,R)|0)+D+m(Q=Q+F|0,F)|0,a[B]=U,a[B+1]=Q}for(var j=0;j<160;j+=2){U=a[j],Q=a[j+1];var H=o(t,c,f),$=o(A,v,w),q=s(t,A),G=s(A,t),z=l(n,I),K=l(I,n),V=r[j],Z=r[j+1],J=b(n,i,x),W=b(I,E,C),Y=M+K|0,X=y+z+m(Y,M)|0;X=(X=(X=X+J+m(Y=Y+W|0,W)|0)+V+m(Y=Y+Z|0,Z)|0)+U+m(Y=Y+Q|0,Q)|0;var ee=G+$|0,ae=q+H+m(ee,G)|0;y=x,M=C,x=i,C=E,i=n,E=I,n=d+X+m(I=_+Y|0,_)|0,d=f,_=w,f=c,w=v,c=t,v=A,t=X+ae+m(A=Y+ee|0,Y)|0}this._al=this._al+A|0,this._bl=this._bl+v|0,this._cl=this._cl+w|0,this._dl=this._dl+_|0,this._el=this._el+I|0,this._fl=this._fl+E|0,this._gl=this._gl+C|0,this._hl=this._hl+M|0,this._ah=this._ah+t+m(this._al,A)|0,this._bh=this._bh+c+m(this._bl,v)|0,this._ch=this._ch+f+m(this._cl,w)|0,this._dh=this._dh+d+m(this._dl,_)|0,this._eh=this._eh+n+m(this._el,I)|0,this._fh=this._fh+i+m(this._fl,E)|0,this._gh=this._gh+x+m(this._gl,C)|0,this._hh=this._hh+y+m(this._hl,M)|0},i.prototype._hash=function(){var e=d.allocUnsafe(64);function a(a,t,c){e.writeInt32BE(a,c),e.writeInt32BE(t,c+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),a(this._gh,this._gl,48),a(this._hh,this._hl,56),e},e.exports=i},88310:(e,a,t)=>{e.exports=f;var c=t(37007).EventEmitter;function f(){c.call(this)}t(56698)(f,c),f.Readable=t(45412),f.Writable=t(16708),f.Duplex=t(25382),f.Transform=t(74610),f.PassThrough=t(63600),f.finished=t(86238),f.pipeline=t(57758),f.Stream=f,f.prototype.pipe=function(e,a){var t=this;function f(a){e.writable&&!1===e.write(a)&&t.pause&&t.pause()}function d(){t.readable&&t.resume&&t.resume()}t.on("data",f),e.on("drain",d),e._isStdio||a&&!1===a.end||(t.on("end",n),t.on("close",i));var r=!1;function n(){r||(r=!0,e.end())}function i(){r||(r=!0,"function"==typeof e.destroy&&e.destroy())}function b(e){if(o(),0===c.listenerCount(this,"error"))throw e}function o(){t.removeListener("data",f),e.removeListener("drain",d),t.removeListener("end",n),t.removeListener("close",i),t.removeListener("error",b),e.removeListener("error",b),t.removeListener("end",o),t.removeListener("close",o),e.removeListener("close",o)}return t.on("error",b),e.on("error",b),t.on("end",o),t.on("close",o),e.on("close",o),e.emit("pipe",t),e}},11568:(e,a,t)=>{var c=t(55537),f=t(6917),d=t(57510),r=t(86866),n=t(59817),i=a;i.request=function(e,a){e="string"==typeof e?n.parse(e):d(e);var f=-1===t.g.location.protocol.search(/^https?:$/)?"http:":"",r=e.protocol||f,i=e.hostname||e.host,b=e.port,o=e.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),e.url=(i?r+"//"+i:"")+(b?":"+b:"")+o,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var s=new c(e);return a&&s.on("response",a),s},i.get=function(e,a){var t=i.request(e,a);return t.end(),t},i.ClientRequest=c,i.IncomingMessage=f.IncomingMessage,i.Agent=function(){},i.Agent.defaultMaxSockets=4,i.globalAgent=new i.Agent,i.STATUS_CODES=r,i.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"]},6688:(e,a,t)=>{var c;function f(){if(void 0!==c)return c;if(t.g.XMLHttpRequest){c=new t.g.XMLHttpRequest;try{c.open("GET",t.g.XDomainRequest?"/":"https://example.com")}catch(e){c=null}}else c=null;return c}function d(e){var a=f();if(!a)return!1;try{return a.responseType=e,a.responseType===e}catch(e){}return!1}function r(e){return"function"==typeof e}a.fetch=r(t.g.fetch)&&r(t.g.ReadableStream),a.writableStream=r(t.g.WritableStream),a.abortController=r(t.g.AbortController),a.arraybuffer=a.fetch||d("arraybuffer"),a.msstream=!a.fetch&&d("ms-stream"),a.mozchunkedarraybuffer=!a.fetch&&d("moz-chunked-arraybuffer"),a.overrideMimeType=a.fetch||!!f()&&r(f().overrideMimeType),c=null},55537:(e,a,t)=>{var c=t(48287).Buffer,f=t(6688),d=t(56698),r=t(6917),n=t(28399),i=r.IncomingMessage,b=r.readyStates,o=e.exports=function(e){var a,t=this;n.Writable.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+c.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(a){t.setHeader(a,e.headers[a])}));var d=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!f.abortController)d=!1,a=!0;else if("prefer-streaming"===e.mode)a=!1;else if("allow-wrong-content-type"===e.mode)a=!f.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");a=!0}t._mode=function(e,a){return f.fetch&&a?"fetch":f.mozchunkedarraybuffer?"moz-chunked-arraybuffer":f.msstream?"ms-stream":f.arraybuffer&&e?"arraybuffer":"text"}(a,d),t._fetchTimer=null,t._socketTimeout=null,t._socketTimer=null,t.on("finish",(function(){t._onFinish()}))};d(o,n.Writable),o.prototype.setHeader=function(e,a){var t=e.toLowerCase();-1===s.indexOf(t)&&(this._headers[t]={name:e,value:a})},o.prototype.getHeader=function(e){var a=this._headers[e.toLowerCase()];return a?a.value:null},o.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},o.prototype._onFinish=function(){var e=this;if(!e._destroyed){var a=e._opts;"timeout"in a&&0!==a.timeout&&e.setTimeout(a.timeout);var c=e._headers,d=null;"GET"!==a.method&&"HEAD"!==a.method&&(d=new Blob(e._body,{type:(c["content-type"]||{}).value||""}));var r=[];if(Object.keys(c).forEach((function(e){var a=c[e].name,t=c[e].value;Array.isArray(t)?t.forEach((function(e){r.push([a,e])})):r.push([a,t])})),"fetch"===e._mode){var n=null;if(f.abortController){var i=new AbortController;n=i.signal,e._fetchAbortController=i,"requestTimeout"in a&&0!==a.requestTimeout&&(e._fetchTimer=t.g.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),a.requestTimeout))}t.g.fetch(e._opts.url,{method:e._opts.method,headers:r,body:d||void 0,mode:"cors",credentials:a.withCredentials?"include":"same-origin",signal:n}).then((function(a){e._fetchResponse=a,e._resetTimers(!1),e._connect()}),(function(a){e._resetTimers(!0),e._destroyed||e.emit("error",a)}))}else{var o=e._xhr=new t.g.XMLHttpRequest;try{o.open(e._opts.method,e._opts.url,!0)}catch(a){return void process.nextTick((function(){e.emit("error",a)}))}"responseType"in o&&(o.responseType=e._mode),"withCredentials"in o&&(o.withCredentials=!!a.withCredentials),"text"===e._mode&&"overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in a&&(o.timeout=a.requestTimeout,o.ontimeout=function(){e.emit("requestTimeout")}),r.forEach((function(e){o.setRequestHeader(e[0],e[1])})),e._response=null,o.onreadystatechange=function(){switch(o.readyState){case b.LOADING:case b.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(o.onprogress=function(){e._onXHRProgress()}),o.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{o.send(d)}catch(a){return void process.nextTick((function(){e.emit("error",a)}))}}}},o.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var a=e.status;return null!==a&&0!==a}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},o.prototype._connect=function(){var e=this;e._destroyed||(e._response=new i(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(a){e.emit("error",a)})),e.emit("response",e._response))},o.prototype._write=function(e,a,t){this._body.push(e),t()},o.prototype._resetTimers=function(e){var a=this;t.g.clearTimeout(a._socketTimer),a._socketTimer=null,e?(t.g.clearTimeout(a._fetchTimer),a._fetchTimer=null):a._socketTimeout&&(a._socketTimer=t.g.setTimeout((function(){a.emit("timeout")}),a._socketTimeout))},o.prototype.abort=o.prototype.destroy=function(e){var a=this;a._destroyed=!0,a._resetTimers(!0),a._response&&(a._response._destroyed=!0),a._xhr?a._xhr.abort():a._fetchAbortController&&a._fetchAbortController.abort(),e&&a.emit("error",e)},o.prototype.end=function(e,a,t){"function"==typeof e&&(t=e,e=void 0),n.Writable.prototype.end.call(this,e,a,t)},o.prototype.setTimeout=function(e,a){var t=this;a&&t.once("timeout",a),t._socketTimeout=e,t._resetTimers(!1)},o.prototype.flushHeaders=function(){},o.prototype.setNoDelay=function(){},o.prototype.setSocketKeepAlive=function(){};var s=["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"]},6917:(e,a,t)=>{var c=t(48287).Buffer,f=t(6688),d=t(56698),r=t(28399),n=a.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i=a.IncomingMessage=function(e,a,t,d){var n=this;if(r.Readable.call(n),n._mode=t,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",(function(){process.nextTick((function(){n.emit("close")}))})),"fetch"===t){if(n._fetchResponse=a,n.url=a.url,n.statusCode=a.status,n.statusMessage=a.statusText,a.headers.forEach((function(e,a){n.headers[a.toLowerCase()]=e,n.rawHeaders.push(a,e)})),f.writableStream){var i=new WritableStream({write:function(e){return d(!1),new Promise((function(a,t){n._destroyed?t():n.push(c.from(e))?a():n._resumeFetch=a}))},close:function(){d(!0),n._destroyed||n.push(null)},abort:function(e){d(!0),n._destroyed||n.emit("error",e)}});try{return void a.body.pipeTo(i).catch((function(e){d(!0),n._destroyed||n.emit("error",e)}))}catch(e){}}var b=a.body.getReader();!function e(){b.read().then((function(a){n._destroyed||(d(a.done),a.done?n.push(null):(n.push(c.from(a.value)),e()))})).catch((function(e){d(!0),n._destroyed||n.emit("error",e)}))}()}else if(n._xhr=e,n._pos=0,n.url=e.responseURL,n.statusCode=e.status,n.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var a=e.match(/^([^:]+):\s*(.*)/);if(a){var t=a[1].toLowerCase();"set-cookie"===t?(void 0===n.headers[t]&&(n.headers[t]=[]),n.headers[t].push(a[2])):void 0!==n.headers[t]?n.headers[t]+=", "+a[2]:n.headers[t]=a[2],n.rawHeaders.push(a[1],a[2])}})),n._charset="x-user-defined",!f.overrideMimeType){var o=n.rawHeaders["mime-type"];if(o){var s=o.match(/;\s*charset=([^;])(;|$)/);s&&(n._charset=s[1].toLowerCase())}n._charset||(n._charset="utf-8")}};d(i,r.Readable),i.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},i.prototype._onXHRProgress=function(e){var a=this,f=a._xhr,d=null;switch(a._mode){case"text":if((d=f.responseText).length>a._pos){var r=d.substr(a._pos);if("x-user-defined"===a._charset){for(var i=c.alloc(r.length),b=0;ba._pos&&(a.push(c.from(new Uint8Array(o.result.slice(a._pos)))),a._pos=o.result.byteLength)},o.onload=function(){e(!0),a.push(null)},o.readAsArrayBuffer(d)}a._xhr.readyState===n.DONE&&"ms-stream"!==a._mode&&(e(!0),a.push(null))}},83141:(e,a,t)=>{"use strict";var c=t(92861).Buffer,f=c.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function d(e){var a;switch(this.encoding=function(e){var a=function(e){if(!e)return"utf8";for(var a;;)switch(e){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 e;default:if(a)return;e=(""+e).toLowerCase(),a=!0}}(e);if("string"!=typeof a&&(c.isEncoding===f||!f(e)))throw new Error("Unknown encoding: "+e);return a||e}(e),this.encoding){case"utf16le":this.text=i,this.end=b,a=4;break;case"utf8":this.fillLast=n,a=4;break;case"base64":this.text=o,this.end=s,a=3;break;default:return this.write=l,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(a)}function r(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function n(e){var a=this.lastTotal-this.lastNeed,t=function(e,a){if(128!=(192&a[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&a.length>1){if(128!=(192&a[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&a.length>2&&128!=(192&a[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==t?t:this.lastNeed<=e.length?(e.copy(this.lastChar,a,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,a,0,e.length),void(this.lastNeed-=e.length))}function i(e,a){if((e.length-a)%2==0){var t=e.toString("utf16le",a);if(t){var c=t.charCodeAt(t.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",a,e.length-1)}function b(e){var a=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return a+this.lastChar.toString("utf16le",0,t)}return a}function o(e,a){var t=(e.length-a)%3;return 0===t?e.toString("base64",a):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",a,e.length-t))}function s(e){var a=e&&e.length?this.write(e):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function l(e){return e.toString(this.encoding)}function u(e){return e&&e.length?this.write(e):""}a.I=d,d.prototype.write=function(e){if(0===e.length)return"";var a,t;if(this.lastNeed){if(void 0===(a=this.fillLast(e)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t=0?(f>0&&(e.lastNeed=f-1),f):--c=0?(f>0&&(e.lastNeed=f-2),f):--c=0?(f>0&&(2===f?f=0:e.lastNeed=f-3),f):0}(this,e,a);if(!this.lastNeed)return e.toString("utf8",a);this.lastTotal=t;var c=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,c),e.toString("utf8",a,c)},d.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},88947:(e,a,t)=>{!function(e){"use strict";var a=function(e){var a,t=new Float64Array(16);if(e)for(a=0;a>24&255,e[a+1]=t>>16&255,e[a+2]=t>>8&255,e[a+3]=255&t,e[a+4]=c>>24&255,e[a+5]=c>>16&255,e[a+6]=c>>8&255,e[a+7]=255&c}function p(e,a,t,c,f){var d,r=0;for(d=0;d>>8)-1}function g(e,a,t,c){return p(e,a,t,c,16)}function m(e,a,t,c){return p(e,a,t,c,32)}function x(e,a,t,c){!function(e,a,t,c){for(var f,d=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,r=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,n=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,i=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,b=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,o=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,s=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,l=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,h=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,p=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,g=255&t[16]|(255&t[17])<<8|(255&t[18])<<16|(255&t[19])<<24,m=255&t[20]|(255&t[21])<<8|(255&t[22])<<16|(255&t[23])<<24,x=255&t[24]|(255&t[25])<<8|(255&t[26])<<16|(255&t[27])<<24,y=255&t[28]|(255&t[29])<<8|(255&t[30])<<16|(255&t[31])<<24,A=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,v=d,w=r,_=n,I=i,E=b,C=o,M=s,B=l,L=u,S=h,k=p,N=g,P=m,R=x,O=y,T=A,D=0;D<20;D+=2)v^=(f=(P^=(f=(L^=(f=(E^=(f=v+P|0)<<7|f>>>25)+v|0)<<9|f>>>23)+E|0)<<13|f>>>19)+L|0)<<18|f>>>14,C^=(f=(w^=(f=(R^=(f=(S^=(f=C+w|0)<<7|f>>>25)+C|0)<<9|f>>>23)+S|0)<<13|f>>>19)+R|0)<<18|f>>>14,k^=(f=(M^=(f=(_^=(f=(O^=(f=k+M|0)<<7|f>>>25)+k|0)<<9|f>>>23)+O|0)<<13|f>>>19)+_|0)<<18|f>>>14,T^=(f=(N^=(f=(B^=(f=(I^=(f=T+N|0)<<7|f>>>25)+T|0)<<9|f>>>23)+I|0)<<13|f>>>19)+B|0)<<18|f>>>14,v^=(f=(I^=(f=(_^=(f=(w^=(f=v+I|0)<<7|f>>>25)+v|0)<<9|f>>>23)+w|0)<<13|f>>>19)+_|0)<<18|f>>>14,C^=(f=(E^=(f=(B^=(f=(M^=(f=C+E|0)<<7|f>>>25)+C|0)<<9|f>>>23)+M|0)<<13|f>>>19)+B|0)<<18|f>>>14,k^=(f=(S^=(f=(L^=(f=(N^=(f=k+S|0)<<7|f>>>25)+k|0)<<9|f>>>23)+N|0)<<13|f>>>19)+L|0)<<18|f>>>14,T^=(f=(O^=(f=(R^=(f=(P^=(f=T+O|0)<<7|f>>>25)+T|0)<<9|f>>>23)+P|0)<<13|f>>>19)+R|0)<<18|f>>>14;v=v+d|0,w=w+r|0,_=_+n|0,I=I+i|0,E=E+b|0,C=C+o|0,M=M+s|0,B=B+l|0,L=L+u|0,S=S+h|0,k=k+p|0,N=N+g|0,P=P+m|0,R=R+x|0,O=O+y|0,T=T+A|0,e[0]=v>>>0&255,e[1]=v>>>8&255,e[2]=v>>>16&255,e[3]=v>>>24&255,e[4]=w>>>0&255,e[5]=w>>>8&255,e[6]=w>>>16&255,e[7]=w>>>24&255,e[8]=_>>>0&255,e[9]=_>>>8&255,e[10]=_>>>16&255,e[11]=_>>>24&255,e[12]=I>>>0&255,e[13]=I>>>8&255,e[14]=I>>>16&255,e[15]=I>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=C>>>0&255,e[21]=C>>>8&255,e[22]=C>>>16&255,e[23]=C>>>24&255,e[24]=M>>>0&255,e[25]=M>>>8&255,e[26]=M>>>16&255,e[27]=M>>>24&255,e[28]=B>>>0&255,e[29]=B>>>8&255,e[30]=B>>>16&255,e[31]=B>>>24&255,e[32]=L>>>0&255,e[33]=L>>>8&255,e[34]=L>>>16&255,e[35]=L>>>24&255,e[36]=S>>>0&255,e[37]=S>>>8&255,e[38]=S>>>16&255,e[39]=S>>>24&255,e[40]=k>>>0&255,e[41]=k>>>8&255,e[42]=k>>>16&255,e[43]=k>>>24&255,e[44]=N>>>0&255,e[45]=N>>>8&255,e[46]=N>>>16&255,e[47]=N>>>24&255,e[48]=P>>>0&255,e[49]=P>>>8&255,e[50]=P>>>16&255,e[51]=P>>>24&255,e[52]=R>>>0&255,e[53]=R>>>8&255,e[54]=R>>>16&255,e[55]=R>>>24&255,e[56]=O>>>0&255,e[57]=O>>>8&255,e[58]=O>>>16&255,e[59]=O>>>24&255,e[60]=T>>>0&255,e[61]=T>>>8&255,e[62]=T>>>16&255,e[63]=T>>>24&255}(e,a,t,c)}function y(e,a,t,c){!function(e,a,t,c){for(var f,d=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,r=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,n=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,i=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,b=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,o=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,s=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,l=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,h=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,p=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,g=255&t[16]|(255&t[17])<<8|(255&t[18])<<16|(255&t[19])<<24,m=255&t[20]|(255&t[21])<<8|(255&t[22])<<16|(255&t[23])<<24,x=255&t[24]|(255&t[25])<<8|(255&t[26])<<16|(255&t[27])<<24,y=255&t[28]|(255&t[29])<<8|(255&t[30])<<16|(255&t[31])<<24,A=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,v=0;v<20;v+=2)d^=(f=(m^=(f=(u^=(f=(b^=(f=d+m|0)<<7|f>>>25)+d|0)<<9|f>>>23)+b|0)<<13|f>>>19)+u|0)<<18|f>>>14,o^=(f=(r^=(f=(x^=(f=(h^=(f=o+r|0)<<7|f>>>25)+o|0)<<9|f>>>23)+h|0)<<13|f>>>19)+x|0)<<18|f>>>14,p^=(f=(s^=(f=(n^=(f=(y^=(f=p+s|0)<<7|f>>>25)+p|0)<<9|f>>>23)+y|0)<<13|f>>>19)+n|0)<<18|f>>>14,A^=(f=(g^=(f=(l^=(f=(i^=(f=A+g|0)<<7|f>>>25)+A|0)<<9|f>>>23)+i|0)<<13|f>>>19)+l|0)<<18|f>>>14,d^=(f=(i^=(f=(n^=(f=(r^=(f=d+i|0)<<7|f>>>25)+d|0)<<9|f>>>23)+r|0)<<13|f>>>19)+n|0)<<18|f>>>14,o^=(f=(b^=(f=(l^=(f=(s^=(f=o+b|0)<<7|f>>>25)+o|0)<<9|f>>>23)+s|0)<<13|f>>>19)+l|0)<<18|f>>>14,p^=(f=(h^=(f=(u^=(f=(g^=(f=p+h|0)<<7|f>>>25)+p|0)<<9|f>>>23)+g|0)<<13|f>>>19)+u|0)<<18|f>>>14,A^=(f=(y^=(f=(x^=(f=(m^=(f=A+y|0)<<7|f>>>25)+A|0)<<9|f>>>23)+m|0)<<13|f>>>19)+x|0)<<18|f>>>14;e[0]=d>>>0&255,e[1]=d>>>8&255,e[2]=d>>>16&255,e[3]=d>>>24&255,e[4]=o>>>0&255,e[5]=o>>>8&255,e[6]=o>>>16&255,e[7]=o>>>24&255,e[8]=p>>>0&255,e[9]=p>>>8&255,e[10]=p>>>16&255,e[11]=p>>>24&255,e[12]=A>>>0&255,e[13]=A>>>8&255,e[14]=A>>>16&255,e[15]=A>>>24&255,e[16]=s>>>0&255,e[17]=s>>>8&255,e[18]=s>>>16&255,e[19]=s>>>24&255,e[20]=l>>>0&255,e[21]=l>>>8&255,e[22]=l>>>16&255,e[23]=l>>>24&255,e[24]=u>>>0&255,e[25]=u>>>8&255,e[26]=u>>>16&255,e[27]=u>>>24&255,e[28]=h>>>0&255,e[29]=h>>>8&255,e[30]=h>>>16&255,e[31]=h>>>24&255}(e,a,t,c)}var A=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function v(e,a,t,c,f,d,r){var n,i,b=new Uint8Array(16),o=new Uint8Array(64);for(i=0;i<16;i++)b[i]=0;for(i=0;i<8;i++)b[i]=d[i];for(;f>=64;){for(x(o,b,r,A),i=0;i<64;i++)e[a+i]=t[c+i]^o[i];for(n=1,i=8;i<16;i++)n=n+(255&b[i])|0,b[i]=255&n,n>>>=8;f-=64,a+=64,c+=64}if(f>0)for(x(o,b,r,A),i=0;i=64;){for(x(i,n,f,A),r=0;r<64;r++)e[a+r]=i[r];for(d=1,r=8;r<16;r++)d=d+(255&n[r])|0,n[r]=255&d,d>>>=8;t-=64,a+=64}if(t>0)for(x(i,n,f,A),r=0;r>>13|t<<3),c=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(t>>>10|c<<6),f=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(c>>>7|f<<9),d=255&e[8]|(255&e[9])<<8,this.r[4]=255&(f>>>4|d<<12),this.r[5]=d>>>1&8190,r=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(d>>>14|r<<2),n=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(r>>>11|n<<5),i=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(n>>>8|i<<8),this.r[9]=i>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function C(e,a,t,c,f,d){var r=new E(d);return r.update(t,c,f),r.finish(e,a),0}function M(e,a,t,c,f,d){var r=new Uint8Array(16);return C(r,0,t,c,f,d),g(e,a,r,0)}function B(e,a,t,c,f){var d;if(t<32)return-1;for(I(e,0,a,0,t,c,f),C(e,16,e,32,t-32,e),d=0;d<16;d++)e[d]=0;return 0}function L(e,a,t,c,f){var d,r=new Uint8Array(32);if(t<32)return-1;if(_(r,0,32,c,f),0!==M(a,16,a,32,t-32,r))return-1;for(I(e,0,a,0,t,c,f),d=0;d<32;d++)e[d]=0;return 0}function S(e,a){var t;for(t=0;t<16;t++)e[t]=0|a[t]}function k(e){var a,t,c=1;for(a=0;a<16;a++)t=e[a]+c+65535,c=Math.floor(t/65536),e[a]=t-65536*c;e[0]+=c-1+37*(c-1)}function N(e,a,t){for(var c,f=~(t-1),d=0;d<16;d++)c=f&(e[d]^a[d]),e[d]^=c,a[d]^=c}function P(e,t){var c,f,d,r=a(),n=a();for(c=0;c<16;c++)n[c]=t[c];for(k(n),k(n),k(n),f=0;f<2;f++){for(r[0]=n[0]-65517,c=1;c<15;c++)r[c]=n[c]-65535-(r[c-1]>>16&1),r[c-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1),d=r[15]>>16&1,r[14]&=65535,N(n,r,1-d)}for(c=0;c<16;c++)e[2*c]=255&n[c],e[2*c+1]=n[c]>>8}function R(e,a){var t=new Uint8Array(32),c=new Uint8Array(32);return P(t,e),P(c,a),m(t,0,c,0)}function O(e){var a=new Uint8Array(32);return P(a,e),1&a[0]}function T(e,a){var t;for(t=0;t<16;t++)e[t]=a[2*t]+(a[2*t+1]<<8);e[15]&=32767}function D(e,a,t){for(var c=0;c<16;c++)e[c]=a[c]+t[c]}function F(e,a,t){for(var c=0;c<16;c++)e[c]=a[c]-t[c]}function Q(e,a,t){var c,f,d=0,r=0,n=0,i=0,b=0,o=0,s=0,l=0,u=0,h=0,p=0,g=0,m=0,x=0,y=0,A=0,v=0,w=0,_=0,I=0,E=0,C=0,M=0,B=0,L=0,S=0,k=0,N=0,P=0,R=0,O=0,T=t[0],D=t[1],F=t[2],Q=t[3],U=t[4],j=t[5],H=t[6],$=t[7],q=t[8],G=t[9],z=t[10],K=t[11],V=t[12],Z=t[13],J=t[14],W=t[15];d+=(c=a[0])*T,r+=c*D,n+=c*F,i+=c*Q,b+=c*U,o+=c*j,s+=c*H,l+=c*$,u+=c*q,h+=c*G,p+=c*z,g+=c*K,m+=c*V,x+=c*Z,y+=c*J,A+=c*W,r+=(c=a[1])*T,n+=c*D,i+=c*F,b+=c*Q,o+=c*U,s+=c*j,l+=c*H,u+=c*$,h+=c*q,p+=c*G,g+=c*z,m+=c*K,x+=c*V,y+=c*Z,A+=c*J,v+=c*W,n+=(c=a[2])*T,i+=c*D,b+=c*F,o+=c*Q,s+=c*U,l+=c*j,u+=c*H,h+=c*$,p+=c*q,g+=c*G,m+=c*z,x+=c*K,y+=c*V,A+=c*Z,v+=c*J,w+=c*W,i+=(c=a[3])*T,b+=c*D,o+=c*F,s+=c*Q,l+=c*U,u+=c*j,h+=c*H,p+=c*$,g+=c*q,m+=c*G,x+=c*z,y+=c*K,A+=c*V,v+=c*Z,w+=c*J,_+=c*W,b+=(c=a[4])*T,o+=c*D,s+=c*F,l+=c*Q,u+=c*U,h+=c*j,p+=c*H,g+=c*$,m+=c*q,x+=c*G,y+=c*z,A+=c*K,v+=c*V,w+=c*Z,_+=c*J,I+=c*W,o+=(c=a[5])*T,s+=c*D,l+=c*F,u+=c*Q,h+=c*U,p+=c*j,g+=c*H,m+=c*$,x+=c*q,y+=c*G,A+=c*z,v+=c*K,w+=c*V,_+=c*Z,I+=c*J,E+=c*W,s+=(c=a[6])*T,l+=c*D,u+=c*F,h+=c*Q,p+=c*U,g+=c*j,m+=c*H,x+=c*$,y+=c*q,A+=c*G,v+=c*z,w+=c*K,_+=c*V,I+=c*Z,E+=c*J,C+=c*W,l+=(c=a[7])*T,u+=c*D,h+=c*F,p+=c*Q,g+=c*U,m+=c*j,x+=c*H,y+=c*$,A+=c*q,v+=c*G,w+=c*z,_+=c*K,I+=c*V,E+=c*Z,C+=c*J,M+=c*W,u+=(c=a[8])*T,h+=c*D,p+=c*F,g+=c*Q,m+=c*U,x+=c*j,y+=c*H,A+=c*$,v+=c*q,w+=c*G,_+=c*z,I+=c*K,E+=c*V,C+=c*Z,M+=c*J,B+=c*W,h+=(c=a[9])*T,p+=c*D,g+=c*F,m+=c*Q,x+=c*U,y+=c*j,A+=c*H,v+=c*$,w+=c*q,_+=c*G,I+=c*z,E+=c*K,C+=c*V,M+=c*Z,B+=c*J,L+=c*W,p+=(c=a[10])*T,g+=c*D,m+=c*F,x+=c*Q,y+=c*U,A+=c*j,v+=c*H,w+=c*$,_+=c*q,I+=c*G,E+=c*z,C+=c*K,M+=c*V,B+=c*Z,L+=c*J,S+=c*W,g+=(c=a[11])*T,m+=c*D,x+=c*F,y+=c*Q,A+=c*U,v+=c*j,w+=c*H,_+=c*$,I+=c*q,E+=c*G,C+=c*z,M+=c*K,B+=c*V,L+=c*Z,S+=c*J,k+=c*W,m+=(c=a[12])*T,x+=c*D,y+=c*F,A+=c*Q,v+=c*U,w+=c*j,_+=c*H,I+=c*$,E+=c*q,C+=c*G,M+=c*z,B+=c*K,L+=c*V,S+=c*Z,k+=c*J,N+=c*W,x+=(c=a[13])*T,y+=c*D,A+=c*F,v+=c*Q,w+=c*U,_+=c*j,I+=c*H,E+=c*$,C+=c*q,M+=c*G,B+=c*z,L+=c*K,S+=c*V,k+=c*Z,N+=c*J,P+=c*W,y+=(c=a[14])*T,A+=c*D,v+=c*F,w+=c*Q,_+=c*U,I+=c*j,E+=c*H,C+=c*$,M+=c*q,B+=c*G,L+=c*z,S+=c*K,k+=c*V,N+=c*Z,P+=c*J,R+=c*W,A+=(c=a[15])*T,r+=38*(w+=c*F),n+=38*(_+=c*Q),i+=38*(I+=c*U),b+=38*(E+=c*j),o+=38*(C+=c*H),s+=38*(M+=c*$),l+=38*(B+=c*q),u+=38*(L+=c*G),h+=38*(S+=c*z),p+=38*(k+=c*K),g+=38*(N+=c*V),m+=38*(P+=c*Z),x+=38*(R+=c*J),y+=38*(O+=c*W),d=(c=(d+=38*(v+=c*D))+(f=1)+65535)-65536*(f=Math.floor(c/65536)),r=(c=r+f+65535)-65536*(f=Math.floor(c/65536)),n=(c=n+f+65535)-65536*(f=Math.floor(c/65536)),i=(c=i+f+65535)-65536*(f=Math.floor(c/65536)),b=(c=b+f+65535)-65536*(f=Math.floor(c/65536)),o=(c=o+f+65535)-65536*(f=Math.floor(c/65536)),s=(c=s+f+65535)-65536*(f=Math.floor(c/65536)),l=(c=l+f+65535)-65536*(f=Math.floor(c/65536)),u=(c=u+f+65535)-65536*(f=Math.floor(c/65536)),h=(c=h+f+65535)-65536*(f=Math.floor(c/65536)),p=(c=p+f+65535)-65536*(f=Math.floor(c/65536)),g=(c=g+f+65535)-65536*(f=Math.floor(c/65536)),m=(c=m+f+65535)-65536*(f=Math.floor(c/65536)),x=(c=x+f+65535)-65536*(f=Math.floor(c/65536)),y=(c=y+f+65535)-65536*(f=Math.floor(c/65536)),A=(c=A+f+65535)-65536*(f=Math.floor(c/65536)),d=(c=(d+=f-1+37*(f-1))+(f=1)+65535)-65536*(f=Math.floor(c/65536)),r=(c=r+f+65535)-65536*(f=Math.floor(c/65536)),n=(c=n+f+65535)-65536*(f=Math.floor(c/65536)),i=(c=i+f+65535)-65536*(f=Math.floor(c/65536)),b=(c=b+f+65535)-65536*(f=Math.floor(c/65536)),o=(c=o+f+65535)-65536*(f=Math.floor(c/65536)),s=(c=s+f+65535)-65536*(f=Math.floor(c/65536)),l=(c=l+f+65535)-65536*(f=Math.floor(c/65536)),u=(c=u+f+65535)-65536*(f=Math.floor(c/65536)),h=(c=h+f+65535)-65536*(f=Math.floor(c/65536)),p=(c=p+f+65535)-65536*(f=Math.floor(c/65536)),g=(c=g+f+65535)-65536*(f=Math.floor(c/65536)),m=(c=m+f+65535)-65536*(f=Math.floor(c/65536)),x=(c=x+f+65535)-65536*(f=Math.floor(c/65536)),y=(c=y+f+65535)-65536*(f=Math.floor(c/65536)),A=(c=A+f+65535)-65536*(f=Math.floor(c/65536)),d+=f-1+37*(f-1),e[0]=d,e[1]=r,e[2]=n,e[3]=i,e[4]=b,e[5]=o,e[6]=s,e[7]=l,e[8]=u,e[9]=h,e[10]=p,e[11]=g,e[12]=m,e[13]=x,e[14]=y,e[15]=A}function U(e,a){Q(e,a,a)}function j(e,t){var c,f=a();for(c=0;c<16;c++)f[c]=t[c];for(c=253;c>=0;c--)U(f,f),2!==c&&4!==c&&Q(f,f,t);for(c=0;c<16;c++)e[c]=f[c]}function H(e,t){var c,f=a();for(c=0;c<16;c++)f[c]=t[c];for(c=250;c>=0;c--)U(f,f),1!==c&&Q(f,f,t);for(c=0;c<16;c++)e[c]=f[c]}function $(e,t,c){var f,d,r=new Uint8Array(32),n=new Float64Array(80),b=a(),o=a(),s=a(),l=a(),u=a(),h=a();for(d=0;d<31;d++)r[d]=t[d];for(r[31]=127&t[31]|64,r[0]&=248,T(n,c),d=0;d<16;d++)o[d]=n[d],l[d]=b[d]=s[d]=0;for(b[0]=l[0]=1,d=254;d>=0;--d)N(b,o,f=r[d>>>3]>>>(7&d)&1),N(s,l,f),D(u,b,s),F(b,b,s),D(s,o,l),F(o,o,l),U(l,u),U(h,b),Q(b,s,b),Q(s,o,u),D(u,b,s),F(b,b,s),U(o,b),F(s,l,h),Q(b,s,i),D(b,b,l),Q(s,s,b),Q(b,l,h),Q(l,o,n),U(o,u),N(b,o,f),N(s,l,f);for(d=0;d<16;d++)n[d+16]=b[d],n[d+32]=s[d],n[d+48]=o[d],n[d+64]=l[d];var p=n.subarray(32),g=n.subarray(16);return j(p,p),Q(g,g,p),P(e,g),0}function q(e,a){return $(e,a,d)}function G(e,a){return c(a,32),q(e,a)}function z(e,a,t){var c=new Uint8Array(32);return $(c,t,a),y(e,f,c,A)}E.prototype.blocks=function(e,a,t){for(var c,f,d,r,n,i,b,o,s,l,u,h,p,g,m,x,y,A,v,w=this.fin?0:2048,_=this.h[0],I=this.h[1],E=this.h[2],C=this.h[3],M=this.h[4],B=this.h[5],L=this.h[6],S=this.h[7],k=this.h[8],N=this.h[9],P=this.r[0],R=this.r[1],O=this.r[2],T=this.r[3],D=this.r[4],F=this.r[5],Q=this.r[6],U=this.r[7],j=this.r[8],H=this.r[9];t>=16;)l=s=0,l+=(_+=8191&(c=255&e[a+0]|(255&e[a+1])<<8))*P,l+=(I+=8191&(c>>>13|(f=255&e[a+2]|(255&e[a+3])<<8)<<3))*(5*H),l+=(E+=8191&(f>>>10|(d=255&e[a+4]|(255&e[a+5])<<8)<<6))*(5*j),l+=(C+=8191&(d>>>7|(r=255&e[a+6]|(255&e[a+7])<<8)<<9))*(5*U),s=(l+=(M+=8191&(r>>>4|(n=255&e[a+8]|(255&e[a+9])<<8)<<12))*(5*Q))>>>13,l&=8191,l+=(B+=n>>>1&8191)*(5*F),l+=(L+=8191&(n>>>14|(i=255&e[a+10]|(255&e[a+11])<<8)<<2))*(5*D),l+=(S+=8191&(i>>>11|(b=255&e[a+12]|(255&e[a+13])<<8)<<5))*(5*T),l+=(k+=8191&(b>>>8|(o=255&e[a+14]|(255&e[a+15])<<8)<<8))*(5*O),u=s+=(l+=(N+=o>>>5|w)*(5*R))>>>13,u+=_*R,u+=I*P,u+=E*(5*H),u+=C*(5*j),s=(u+=M*(5*U))>>>13,u&=8191,u+=B*(5*Q),u+=L*(5*F),u+=S*(5*D),u+=k*(5*T),s+=(u+=N*(5*O))>>>13,u&=8191,h=s,h+=_*O,h+=I*R,h+=E*P,h+=C*(5*H),s=(h+=M*(5*j))>>>13,h&=8191,h+=B*(5*U),h+=L*(5*Q),h+=S*(5*F),h+=k*(5*D),p=s+=(h+=N*(5*T))>>>13,p+=_*T,p+=I*O,p+=E*R,p+=C*P,s=(p+=M*(5*H))>>>13,p&=8191,p+=B*(5*j),p+=L*(5*U),p+=S*(5*Q),p+=k*(5*F),g=s+=(p+=N*(5*D))>>>13,g+=_*D,g+=I*T,g+=E*O,g+=C*R,s=(g+=M*P)>>>13,g&=8191,g+=B*(5*H),g+=L*(5*j),g+=S*(5*U),g+=k*(5*Q),m=s+=(g+=N*(5*F))>>>13,m+=_*F,m+=I*D,m+=E*T,m+=C*O,s=(m+=M*R)>>>13,m&=8191,m+=B*P,m+=L*(5*H),m+=S*(5*j),m+=k*(5*U),x=s+=(m+=N*(5*Q))>>>13,x+=_*Q,x+=I*F,x+=E*D,x+=C*T,s=(x+=M*O)>>>13,x&=8191,x+=B*R,x+=L*P,x+=S*(5*H),x+=k*(5*j),y=s+=(x+=N*(5*U))>>>13,y+=_*U,y+=I*Q,y+=E*F,y+=C*D,s=(y+=M*T)>>>13,y&=8191,y+=B*O,y+=L*R,y+=S*P,y+=k*(5*H),A=s+=(y+=N*(5*j))>>>13,A+=_*j,A+=I*U,A+=E*Q,A+=C*F,s=(A+=M*D)>>>13,A&=8191,A+=B*T,A+=L*O,A+=S*R,A+=k*P,v=s+=(A+=N*(5*H))>>>13,v+=_*H,v+=I*j,v+=E*U,v+=C*Q,s=(v+=M*F)>>>13,v&=8191,v+=B*D,v+=L*T,v+=S*O,v+=k*R,_=l=8191&(s=(s=((s+=(v+=N*P)>>>13)<<2)+s|0)+(l&=8191)|0),I=u+=s>>>=13,E=h&=8191,C=p&=8191,M=g&=8191,B=m&=8191,L=x&=8191,S=y&=8191,k=A&=8191,N=v&=8191,a+=16,t-=16;this.h[0]=_,this.h[1]=I,this.h[2]=E,this.h[3]=C,this.h[4]=M,this.h[5]=B,this.h[6]=L,this.h[7]=S,this.h[8]=k,this.h[9]=N},E.prototype.finish=function(e,a){var t,c,f,d,r=new Uint16Array(10);if(this.leftover){for(d=this.leftover,this.buffer[d++]=1;d<16;d++)this.buffer[d]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(t=this.h[1]>>>13,this.h[1]&=8191,d=2;d<10;d++)this.h[d]+=t,t=this.h[d]>>>13,this.h[d]&=8191;for(this.h[0]+=5*t,t=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=t,t=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=t,r[0]=this.h[0]+5,t=r[0]>>>13,r[0]&=8191,d=1;d<10;d++)r[d]=this.h[d]+t,t=r[d]>>>13,r[d]&=8191;for(r[9]-=8192,c=(1^t)-1,d=0;d<10;d++)r[d]&=c;for(c=~c,d=0;d<10;d++)this.h[d]=this.h[d]&c|r[d];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,d=1;d<8;d++)f=(this.h[d]+this.pad[d]|0)+(f>>>16)|0,this.h[d]=65535&f;e[a+0]=this.h[0]>>>0&255,e[a+1]=this.h[0]>>>8&255,e[a+2]=this.h[1]>>>0&255,e[a+3]=this.h[1]>>>8&255,e[a+4]=this.h[2]>>>0&255,e[a+5]=this.h[2]>>>8&255,e[a+6]=this.h[3]>>>0&255,e[a+7]=this.h[3]>>>8&255,e[a+8]=this.h[4]>>>0&255,e[a+9]=this.h[4]>>>8&255,e[a+10]=this.h[5]>>>0&255,e[a+11]=this.h[5]>>>8&255,e[a+12]=this.h[6]>>>0&255,e[a+13]=this.h[6]>>>8&255,e[a+14]=this.h[7]>>>0&255,e[a+15]=this.h[7]>>>8&255},E.prototype.update=function(e,a,t){var c,f;if(this.leftover){for((f=16-this.leftover)>t&&(f=t),c=0;c=16&&(f=t-t%16,this.blocks(e,a,f),a+=f,t-=f),t){for(c=0;c=128;){for(w=0;w<16;w++)_=8*w+V,S[w]=t[_+0]<<24|t[_+1]<<16|t[_+2]<<8|t[_+3],k[w]=t[_+4]<<24|t[_+5]<<16|t[_+6]<<8|t[_+7];for(w=0;w<80;w++)if(f=N,d=P,r=R,n=O,i=T,b=D,o=F,l=U,u=j,h=H,p=$,g=q,m=G,x=z,C=65535&(E=K),M=E>>>16,B=65535&(I=Q),L=I>>>16,C+=65535&(E=(q>>>14|T<<18)^(q>>>18|T<<14)^(T>>>9|q<<23)),M+=E>>>16,B+=65535&(I=(T>>>14|q<<18)^(T>>>18|q<<14)^(q>>>9|T<<23)),L+=I>>>16,C+=65535&(E=q&G^~q&z),M+=E>>>16,B+=65535&(I=T&D^~T&F),L+=I>>>16,C+=65535&(E=Z[2*w+1]),M+=E>>>16,B+=65535&(I=Z[2*w]),L+=I>>>16,I=S[w%16],M+=(E=k[w%16])>>>16,B+=65535&I,L+=I>>>16,B+=(M+=(C+=65535&E)>>>16)>>>16,C=65535&(E=v=65535&C|M<<16),M=E>>>16,B=65535&(I=A=65535&B|(L+=B>>>16)<<16),L=I>>>16,C+=65535&(E=(U>>>28|N<<4)^(N>>>2|U<<30)^(N>>>7|U<<25)),M+=E>>>16,B+=65535&(I=(N>>>28|U<<4)^(U>>>2|N<<30)^(U>>>7|N<<25)),L+=I>>>16,M+=(E=U&j^U&H^j&H)>>>16,B+=65535&(I=N&P^N&R^P&R),L+=I>>>16,s=65535&(B+=(M+=(C+=65535&E)>>>16)>>>16)|(L+=B>>>16)<<16,y=65535&C|M<<16,C=65535&(E=p),M=E>>>16,B=65535&(I=n),L=I>>>16,M+=(E=v)>>>16,B+=65535&(I=A),L+=I>>>16,P=f,R=d,O=r,T=n=65535&(B+=(M+=(C+=65535&E)>>>16)>>>16)|(L+=B>>>16)<<16,D=i,F=b,Q=o,N=s,j=l,H=u,$=h,q=p=65535&C|M<<16,G=g,z=m,K=x,U=y,w%16==15)for(_=0;_<16;_++)I=S[_],C=65535&(E=k[_]),M=E>>>16,B=65535&I,L=I>>>16,I=S[(_+9)%16],C+=65535&(E=k[(_+9)%16]),M+=E>>>16,B+=65535&I,L+=I>>>16,A=S[(_+1)%16],C+=65535&(E=((v=k[(_+1)%16])>>>1|A<<31)^(v>>>8|A<<24)^(v>>>7|A<<25)),M+=E>>>16,B+=65535&(I=(A>>>1|v<<31)^(A>>>8|v<<24)^A>>>7),L+=I>>>16,A=S[(_+14)%16],M+=(E=((v=k[(_+14)%16])>>>19|A<<13)^(A>>>29|v<<3)^(v>>>6|A<<26))>>>16,B+=65535&(I=(A>>>19|v<<13)^(v>>>29|A<<3)^A>>>6),L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,S[_]=65535&B|L<<16,k[_]=65535&C|M<<16;C=65535&(E=U),M=E>>>16,B=65535&(I=N),L=I>>>16,I=e[0],M+=(E=a[0])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[0]=N=65535&B|L<<16,a[0]=U=65535&C|M<<16,C=65535&(E=j),M=E>>>16,B=65535&(I=P),L=I>>>16,I=e[1],M+=(E=a[1])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[1]=P=65535&B|L<<16,a[1]=j=65535&C|M<<16,C=65535&(E=H),M=E>>>16,B=65535&(I=R),L=I>>>16,I=e[2],M+=(E=a[2])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[2]=R=65535&B|L<<16,a[2]=H=65535&C|M<<16,C=65535&(E=$),M=E>>>16,B=65535&(I=O),L=I>>>16,I=e[3],M+=(E=a[3])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[3]=O=65535&B|L<<16,a[3]=$=65535&C|M<<16,C=65535&(E=q),M=E>>>16,B=65535&(I=T),L=I>>>16,I=e[4],M+=(E=a[4])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[4]=T=65535&B|L<<16,a[4]=q=65535&C|M<<16,C=65535&(E=G),M=E>>>16,B=65535&(I=D),L=I>>>16,I=e[5],M+=(E=a[5])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[5]=D=65535&B|L<<16,a[5]=G=65535&C|M<<16,C=65535&(E=z),M=E>>>16,B=65535&(I=F),L=I>>>16,I=e[6],M+=(E=a[6])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[6]=F=65535&B|L<<16,a[6]=z=65535&C|M<<16,C=65535&(E=K),M=E>>>16,B=65535&(I=Q),L=I>>>16,I=e[7],M+=(E=a[7])>>>16,B+=65535&I,L+=I>>>16,L+=(B+=(M+=(C+=65535&E)>>>16)>>>16)>>>16,e[7]=Q=65535&B|L<<16,a[7]=K=65535&C|M<<16,V+=128,c-=128}return c}function W(e,a,t){var c,f=new Int32Array(8),d=new Int32Array(8),r=new Uint8Array(256),n=t;for(f[0]=1779033703,f[1]=3144134277,f[2]=1013904242,f[3]=2773480762,f[4]=1359893119,f[5]=2600822924,f[6]=528734635,f[7]=1541459225,d[0]=4089235720,d[1]=2227873595,d[2]=4271175723,d[3]=1595750129,d[4]=2917565137,d[5]=725511199,d[6]=4215389547,d[7]=327033209,J(f,d,a,t),t%=128,c=0;c=0;--f)X(e,a,c=t[f/8|0]>>(7&f)&1),Y(a,e),Y(e,e),X(e,a,c)}function te(e,t){var c=[a(),a(),a(),a()];S(c[0],s),S(c[1],l),S(c[2],n),Q(c[3],s,l),ae(e,c,t)}function ce(e,t,f){var d,r=new Uint8Array(64),n=[a(),a(),a(),a()];for(f||c(t,32),W(r,t,32),r[0]&=248,r[31]&=127,r[31]|=64,te(n,r),ee(e,n),d=0;d<32;d++)t[d+32]=e[d];return 0}var fe=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 de(e,a){var t,c,f,d;for(c=63;c>=32;--c){for(t=0,f=c-32,d=c-12;f>4)*fe[f],t=a[f]>>8,a[f]&=255;for(f=0;f<32;f++)a[f]-=t*fe[f];for(c=0;c<32;c++)a[c+1]+=a[c]>>8,e[c]=255&a[c]}function re(e){var a,t=new Float64Array(64);for(a=0;a<64;a++)t[a]=e[a];for(a=0;a<64;a++)e[a]=0;de(e,t)}function ne(e,t,c,f){var d,r,n=new Uint8Array(64),i=new Uint8Array(64),b=new Uint8Array(64),o=new Float64Array(64),s=[a(),a(),a(),a()];W(n,f,32),n[0]&=248,n[31]&=127,n[31]|=64;var l=c+64;for(d=0;d>7&&F(e[0],r,e[0]),Q(e[3],e[0],e[1]),0)}(l,f))return-1;for(d=0;d=0},e.sign.keyPair=function(){var e=new Uint8Array(se),a=new Uint8Array(le);return ce(e,a),{publicKey:e,secretKey:a}},e.sign.keyPair.fromSecretKey=function(e){if(he(e),e.length!==le)throw new Error("bad secret key size");for(var a=new Uint8Array(se),t=0;t{function c(e){try{if(!t.g.localStorage)return!1}catch(e){return!1}var a=t.g.localStorage[e];return null!=a&&"true"===String(a).toLowerCase()}e.exports=function(e,a){if(c("noDeprecation"))return e;var t=!1;return function(){if(!t){if(c("throwDeprecation"))throw new Error(a);c("traceDeprecation")?console.trace(a):console.warn(a),t=!0}return e.apply(this,arguments)}}},81135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},49032:(e,a,t)=>{"use strict";var c=t(47244),f=t(48184),d=t(25767),r=t(35680);function n(e){return e.call.bind(e)}var i="undefined"!=typeof BigInt,b="undefined"!=typeof Symbol,o=n(Object.prototype.toString),s=n(Number.prototype.valueOf),l=n(String.prototype.valueOf),u=n(Boolean.prototype.valueOf);if(i)var h=n(BigInt.prototype.valueOf);if(b)var p=n(Symbol.prototype.valueOf);function g(e,a){if("object"!=typeof e)return!1;try{return a(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===o(e)}function x(e){return"[object Set]"===o(e)}function y(e){return"[object WeakMap]"===o(e)}function A(e){return"[object WeakSet]"===o(e)}function v(e){return"[object ArrayBuffer]"===o(e)}function w(e){return"undefined"!=typeof ArrayBuffer&&(v.working?v(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===o(e)}function I(e){return"undefined"!=typeof DataView&&(_.working?_(e):e instanceof DataView)}a.isArgumentsObject=c,a.isGeneratorFunction=f,a.isTypedArray=r,a.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},a.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):r(e)||I(e)},a.isUint8Array=function(e){return"Uint8Array"===d(e)},a.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===d(e)},a.isUint16Array=function(e){return"Uint16Array"===d(e)},a.isUint32Array=function(e){return"Uint32Array"===d(e)},a.isInt8Array=function(e){return"Int8Array"===d(e)},a.isInt16Array=function(e){return"Int16Array"===d(e)},a.isInt32Array=function(e){return"Int32Array"===d(e)},a.isFloat32Array=function(e){return"Float32Array"===d(e)},a.isFloat64Array=function(e){return"Float64Array"===d(e)},a.isBigInt64Array=function(e){return"BigInt64Array"===d(e)},a.isBigUint64Array=function(e){return"BigUint64Array"===d(e)},m.working="undefined"!=typeof Map&&m(new Map),a.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},x.working="undefined"!=typeof Set&&x(new Set),a.isSet=function(e){return"undefined"!=typeof Set&&(x.working?x(e):e instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),a.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(y.working?y(e):e instanceof WeakMap)},A.working="undefined"!=typeof WeakSet&&A(new WeakSet),a.isWeakSet=function(e){return A(e)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),a.isArrayBuffer=w,_.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),a.isDataView=I;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function C(e){return"[object SharedArrayBuffer]"===o(e)}function M(e){return void 0!==E&&(void 0===C.working&&(C.working=C(new E)),C.working?C(e):e instanceof E)}function B(e){return g(e,s)}function L(e){return g(e,l)}function S(e){return g(e,u)}function k(e){return i&&g(e,h)}function N(e){return b&&g(e,p)}a.isSharedArrayBuffer=M,a.isAsyncFunction=function(e){return"[object AsyncFunction]"===o(e)},a.isMapIterator=function(e){return"[object Map Iterator]"===o(e)},a.isSetIterator=function(e){return"[object Set Iterator]"===o(e)},a.isGeneratorObject=function(e){return"[object Generator]"===o(e)},a.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===o(e)},a.isNumberObject=B,a.isStringObject=L,a.isBooleanObject=S,a.isBigIntObject=k,a.isSymbolObject=N,a.isBoxedPrimitive=function(e){return B(e)||L(e)||S(e)||k(e)||N(e)},a.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(w(e)||M(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(a,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},40537:(e,a,t)=>{var c=Object.getOwnPropertyDescriptors||function(e){for(var a=Object.keys(e),t={},c=0;c=d)return e;switch(e){case"%s":return String(c[t++]);case"%d":return Number(c[t++]);case"%j":try{return JSON.stringify(c[t++])}catch(e){return"[Circular]"}default:return e}})),n=c[t];t=3&&(c.depth=arguments[2]),arguments.length>=4&&(c.colors=arguments[3]),p(t)?c.showHidden=t:t&&a._extend(c,t),y(c.showHidden)&&(c.showHidden=!1),y(c.depth)&&(c.depth=2),y(c.colors)&&(c.colors=!1),y(c.customInspect)&&(c.customInspect=!0),c.colors&&(c.stylize=b),s(c,e,c.depth)}function b(e,a){var t=i.styles[a];return t?"["+i.colors[t][0]+"m"+e+"["+i.colors[t][1]+"m":e}function o(e,a){return e}function s(e,t,c){if(e.customInspect&&t&&I(t.inspect)&&t.inspect!==a.inspect&&(!t.constructor||t.constructor.prototype!==t)){var f=t.inspect(c,e);return x(f)||(f=s(e,f,c)),f}var d=function(e,a){if(y(a))return e.stylize("undefined","undefined");if(x(a)){var t="'"+JSON.stringify(a).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}return m(a)?e.stylize(""+a,"number"):p(a)?e.stylize(""+a,"boolean"):g(a)?e.stylize("null","null"):void 0}(e,t);if(d)return d;var r=Object.keys(t),n=function(e){var a={};return e.forEach((function(e,t){a[e]=!0})),a}(r);if(e.showHidden&&(r=Object.getOwnPropertyNames(t)),_(t)&&(r.indexOf("message")>=0||r.indexOf("description")>=0))return l(t);if(0===r.length){if(I(t)){var i=t.name?": "+t.name:"";return e.stylize("[Function"+i+"]","special")}if(A(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(w(t))return e.stylize(Date.prototype.toString.call(t),"date");if(_(t))return l(t)}var b,o="",v=!1,E=["{","}"];return h(t)&&(v=!0,E=["[","]"]),I(t)&&(o=" [Function"+(t.name?": "+t.name:"")+"]"),A(t)&&(o=" "+RegExp.prototype.toString.call(t)),w(t)&&(o=" "+Date.prototype.toUTCString.call(t)),_(t)&&(o=" "+l(t)),0!==r.length||v&&0!=t.length?c<0?A(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),b=v?function(e,a,t,c,f){for(var d=[],r=0,n=a.length;r60?t[0]+(""===a?"":a+"\n ")+" "+e.join(",\n ")+" "+t[1]:t[0]+a+" "+e.join(", ")+" "+t[1]}(b,o,E)):E[0]+o+E[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function u(e,a,t,c,f,d){var r,n,i;if((i=Object.getOwnPropertyDescriptor(a,f)||{value:a[f]}).get?n=i.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):i.set&&(n=e.stylize("[Setter]","special")),B(c,f)||(r="["+f+"]"),n||(e.seen.indexOf(i.value)<0?(n=g(t)?s(e,i.value,null):s(e,i.value,t-1)).indexOf("\n")>-1&&(n=d?n.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+n.split("\n").map((function(e){return" "+e})).join("\n")):n=e.stylize("[Circular]","special")),y(r)){if(d&&f.match(/^\d+$/))return n;(r=JSON.stringify(""+f)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(r=r.slice(1,-1),r=e.stylize(r,"name")):(r=r.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),r=e.stylize(r,"string"))}return r+": "+n}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function x(e){return"string"==typeof e}function y(e){return void 0===e}function A(e){return v(e)&&"[object RegExp]"===E(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===E(e)}function _(e){return v(e)&&("[object Error]"===E(e)||e instanceof Error)}function I(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function C(e){return e<10?"0"+e.toString(10):e.toString(10)}a.debuglog=function(e){if(e=e.toUpperCase(),!d[e])if(r.test(e)){var t=process.pid;d[e]=function(){var c=a.format.apply(a,arguments);console.error("%s %d: %s",e,t,c)}}else d[e]=function(){};return d[e]},a.inspect=i,i.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]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},a.types=t(49032),a.isArray=h,a.isBoolean=p,a.isNull=g,a.isNullOrUndefined=function(e){return null==e},a.isNumber=m,a.isString=x,a.isSymbol=function(e){return"symbol"==typeof e},a.isUndefined=y,a.isRegExp=A,a.types.isRegExp=A,a.isObject=v,a.isDate=w,a.types.isDate=w,a.isError=_,a.types.isNativeError=_,a.isFunction=I,a.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},a.isBuffer=t(81135);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(e,a){return Object.prototype.hasOwnProperty.call(e,a)}a.log=function(){var e,t;console.log("%s - %s",(t=[C((e=new Date).getHours()),C(e.getMinutes()),C(e.getSeconds())].join(":"),[e.getDate(),M[e.getMonth()],t].join(" ")),a.format.apply(a,arguments))},a.inherits=t(56698),a._extend=function(e,a){if(!a||!v(a))return e;for(var t=Object.keys(a),c=t.length;c--;)e[t[c]]=a[t[c]];return e};var L="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function S(e,a){if(!e){var t=new Error("Promise was rejected with a falsy value");t.reason=e,e=t}return a(e)}a.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(L&&e[L]){var a;if("function"!=typeof(a=e[L]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(a,L,{value:a,enumerable:!1,writable:!1,configurable:!0}),a}function a(){for(var a,t,c=new Promise((function(e,c){a=e,t=c})),f=[],d=0;d{var indexOf=function(e,a){if(e.indexOf)return e.indexOf(a);for(var t=0;t{"use strict";var c=t(82682),f=t(39209),d=t(10487),r=t(38075),n=t(75795),i=r("Object.prototype.toString"),b=t(49092)(),o="undefined"==typeof globalThis?t.g:globalThis,s=f(),l=r("String.prototype.slice"),u=Object.getPrototypeOf,h=r("Array.prototype.indexOf",!0)||function(e,a){for(var t=0;t-1?a:"Object"===a&&function(e){var a=!1;return c(p,(function(t,c){if(!a)try{t(e),a=l(c,1)}catch(e){}})),a}(e)}return n?function(e){var a=!1;return c(p,(function(t,c){if(!a)try{"$"+t(e)===c&&(a=l(c,1))}catch(e){}})),a}(e):null}},57510:e=>{e.exports=function(){for(var e={},t=0;t{},78982:()=>{},47790:()=>{},73776:()=>{},21638:()=>{},92668:()=>{},77965:()=>{},66089:()=>{},79368:()=>{},23276:()=>{},59676:()=>{},64688:()=>{},51069:()=>{},15340:()=>{},79838:()=>{},59817:()=>{},71281:()=>{},60513:()=>{},2378:()=>{},60290:()=>{},47882:()=>{},27754:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.StructError=void 0;class t extends TypeError{constructor(e,a){let t;const{message:c,explanation:f,...d}=e,{path:r}=e,n=0===r.length?c:`At path: ${r.join(".")} -- ${c}`;super(f??n),null!=f&&(this.cause=n),Object.assign(this,d),this.name=this.constructor.name,this.failures=()=>t??(t=[e,...a()])}}a.StructError=t},35620:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(27754),a),f(t(99067),a),f(t(91704),a),f(t(50401),a),f(t(67792),a),f(t(65991),a)},99067:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.validate=a.is=a.mask=a.create=a.assert=a.Struct=void 0;const c=t(27754),f=t(70639);function d(e,a,t){const c=b(e,a,{message:t});if(c[0])throw c[0]}function r(e,a,t){const c=b(e,a,{coerce:!0,message:t});if(c[0])throw c[0];return c[1]}function n(e,a,t){const c=b(e,a,{coerce:!0,mask:!0,message:t});if(c[0])throw c[0];return c[1]}function i(e,a){return!b(e,a)[0]}function b(e,a,t={}){const d=(0,f.run)(e,a,t),r=(0,f.shiftIterator)(d);return r[0]?[new c.StructError(r[0],(function*(){for(const e of d)e[0]&&(yield e[0])})),void 0]:[void 0,r[1]]}a.Struct=class{constructor(e){const{type:a,schema:t,validator:c,refiner:d,coercer:r=e=>e,entries:n=function*(){}}=e;this.type=a,this.schema=t,this.entries=n,this.coercer=r,this.validator=c?(e,a)=>{const t=c(e,a);return(0,f.toFailures)(t,a,this,e)}:()=>[],this.refiner=d?(e,a)=>{const t=d(e,a);return(0,f.toFailures)(t,a,this,e)}:()=>[]}assert(e,a){return d(e,this,a)}create(e,a){return r(e,this,a)}is(e){return i(e,this)}mask(e,a){return n(e,this,a)}validate(e,a={}){return b(e,this,a)}},a.assert=d,a.create=r,a.mask=n,a.is=i,a.validate=b},91704:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.trimmed=a.defaulted=a.coerce=void 0;const c=t(99067),f=t(70639),d=t(67792);function r(e,a,t){return new c.Struct({...e,coercer:(f,d)=>(0,c.is)(f,a)?e.coercer(t(f,d),d):e.coercer(f,d)})}a.coerce=r,a.defaulted=function(e,a,t={}){return r(e,(0,d.unknown)(),(e=>{const c="function"==typeof a?a():a;if(void 0===e)return c;if(!t.strict&&(0,f.isPlainObject)(e)&&(0,f.isPlainObject)(c)){const a={...e};let t=!1;for(const e in c)void 0===a[e]&&(a[e]=c[e],t=!0);if(t)return a}return e}))},a.trimmed=function(e){return r(e,(0,d.string)(),(e=>e.trim()))}},50401:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.refine=a.size=a.pattern=a.nonempty=a.min=a.max=a.empty=void 0;const c=t(99067),f=t(70639);function d(e){return e instanceof Map||e instanceof Set?e.size:e.length}function r(e,a,t){return new c.Struct({...e,*refiner(c,d){yield*e.refiner(c,d);const r=t(c,d),n=(0,f.toFailures)(r,d,e,c);for(const e of n)yield{...e,refinement:a}}})}a.empty=function(e){return r(e,"empty",(a=>{const t=d(a);return 0===t||`Expected an empty ${e.type} but received one with a size of \`${t}\``}))},a.max=function(e,a,t={}){const{exclusive:c}=t;return r(e,"max",(t=>c?tc?t>a:t>=a||`Expected a ${e.type} greater than ${c?"":"or equal to "}${a} but received \`${t}\``))},a.nonempty=function(e){return r(e,"nonempty",(a=>d(a)>0||`Expected a nonempty ${e.type} but received an empty one`))},a.pattern=function(e,a){return r(e,"pattern",(t=>a.test(t)||`Expected a ${e.type} matching \`/${a.source}/\` but received "${t}"`))},a.size=function(e,a,t=a){const c=`Expected a ${e.type}`,f=a===t?`of \`${a}\``:`between \`${a}\` and \`${t}\``;return r(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return a<=e&&e<=t||`${c} ${f} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:d}=e;return a<=d&&d<=t||`${c} with a size ${f} but received one with a size of \`${d}\``}const{length:d}=e;return a<=d&&d<=t||`${c} with a length ${f} but received one with a length of \`${d}\``}))},a.refine=r},67792:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.unknown=a.union=a.type=a.tuple=a.string=a.set=a.regexp=a.record=a.optional=a.object=a.number=a.nullable=a.never=a.map=a.literal=a.intersection=a.integer=a.instance=a.func=a.enums=a.date=a.boolean=a.bigint=a.array=a.any=void 0;const c=t(99067),f=t(70639),d=t(65991);function r(){return(0,d.define)("never",(()=>!1))}a.any=function(){return(0,d.define)("any",(()=>!0))},a.array=function(e){return new c.Struct({type:"array",schema:e,*entries(a){if(e&&Array.isArray(a))for(const[t,c]of a.entries())yield[t,c,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${(0,f.print)(e)}`})},a.bigint=function(){return(0,d.define)("bigint",(e=>"bigint"==typeof e))},a.boolean=function(){return(0,d.define)("boolean",(e=>"boolean"==typeof e))},a.date=function(){return(0,d.define)("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${(0,f.print)(e)}`))},a.enums=function(e){const a={},t=e.map((e=>(0,f.print)(e))).join();for(const t of e)a[t]=t;return new c.Struct({type:"enums",schema:a,validator:a=>e.includes(a)||`Expected one of \`${t}\`, but received: ${(0,f.print)(a)}`})},a.func=function(){return(0,d.define)("func",(e=>"function"==typeof e||`Expected a function, but received: ${(0,f.print)(e)}`))},a.instance=function(e){return(0,d.define)("instance",(a=>a instanceof e||`Expected a \`${e.name}\` instance, but received: ${(0,f.print)(a)}`))},a.integer=function(){return(0,d.define)("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${(0,f.print)(e)}`))},a.intersection=function(e){return new c.Struct({type:"intersection",schema:null,*entries(a,t){for(const{entries:c}of e)yield*c(a,t)},*validator(a,t){for(const{validator:c}of e)yield*c(a,t)},*refiner(a,t){for(const{refiner:c}of e)yield*c(a,t)}})},a.literal=function(e){const a=(0,f.print)(e),t=typeof e;return new c.Struct({type:"literal",schema:"string"===t||"number"===t||"boolean"===t?e:null,validator:t=>t===e||`Expected the literal \`${a}\`, but received: ${(0,f.print)(t)}`})},a.map=function(e,a){return new c.Struct({type:"map",schema:null,*entries(t){if(e&&a&&t instanceof Map)for(const[c,f]of t.entries())yield[c,c,e],yield[c,f,a]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${(0,f.print)(e)}`})},a.never=r,a.nullable=function(e){return new c.Struct({...e,validator:(a,t)=>null===a||e.validator(a,t),refiner:(a,t)=>null===a||e.refiner(a,t)})},a.number=function(){return(0,d.define)("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${(0,f.print)(e)}`))},a.object=function(e){const a=e?Object.keys(e):[],t=r();return new c.Struct({type:"object",schema:e??null,*entries(c){if(e&&(0,f.isObject)(c)){const f=new Set(Object.keys(c));for(const t of a)f.delete(t),yield[t,c[t],e[t]];for(const e of f)yield[e,c[e],t]}},validator:e=>(0,f.isObject)(e)||`Expected an object, but received: ${(0,f.print)(e)}`,coercer:e=>(0,f.isObject)(e)?{...e}:e})},a.optional=function(e){return new c.Struct({...e,validator:(a,t)=>void 0===a||e.validator(a,t),refiner:(a,t)=>void 0===a||e.refiner(a,t)})},a.record=function(e,a){return new c.Struct({type:"record",schema:null,*entries(t){if((0,f.isObject)(t))for(const c in t){const f=t[c];yield[c,c,e],yield[c,f,a]}},validator:e=>(0,f.isObject)(e)||`Expected an object, but received: ${(0,f.print)(e)}`})},a.regexp=function(){return(0,d.define)("regexp",(e=>e instanceof RegExp))},a.set=function(e){return new c.Struct({type:"set",schema:null,*entries(a){if(e&&a instanceof Set)for(const t of a)yield[t,t,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${(0,f.print)(e)}`})},a.string=function(){return(0,d.define)("string",(e=>"string"==typeof e||`Expected a string, but received: ${(0,f.print)(e)}`))},a.tuple=function(e){const a=r();return new c.Struct({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){const c=Math.max(e.length,t.length);for(let f=0;fArray.isArray(e)||`Expected an array, but received: ${(0,f.print)(e)}`})},a.type=function(e){const a=Object.keys(e);return new c.Struct({type:"type",schema:e,*entries(t){if((0,f.isObject)(t))for(const c of a)yield[c,t[c],e[c]]},validator:e=>(0,f.isObject)(e)||`Expected an object, but received: ${(0,f.print)(e)}`,coercer:e=>(0,f.isObject)(e)?{...e}:e})},a.union=function(e){const a=e.map((e=>e.type)).join(" | ");return new c.Struct({type:"union",schema:null,coercer(a){for(const t of e){const[e,c]=t.validate(a,{coerce:!0});if(!e)return c}return a},validator(t,c){const d=[];for(const a of e){const[...e]=(0,f.run)(t,a,c),[r]=e;if(!r?.[0])return[];for(const[a]of e)a&&d.push(a)}return[`Expected the value to satisfy a union of \`${a}\`, but received: ${(0,f.print)(t)}`,...d]}})},a.unknown=function(){return(0,d.define)("unknown",(()=>!0))}},65991:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.pick=a.partial=a.omit=a.lazy=a.dynamic=a.deprecated=a.define=a.assign=void 0;const c=t(99067),f=t(67792);a.assign=function(...e){const a="type"===e[0]?.type,t=e.map((({schema:e})=>e)),c=Object.assign({},...t);return a?(0,f.type)(c):(0,f.object)(c)},a.define=function(e,a){return new c.Struct({type:e,schema:null,validator:a})},a.deprecated=function(e,a){return new c.Struct({...e,refiner:(a,t)=>void 0===a||e.refiner(a,t),validator:(t,c)=>void 0===t||(a(t,c),e.validator(t,c))})},a.dynamic=function(e){return new c.Struct({type:"dynamic",schema:null,*entries(a,t){const c=e(a,t);yield*c.entries(a,t)},validator:(a,t)=>e(a,t).validator(a,t),coercer:(a,t)=>e(a,t).coercer(a,t),refiner:(a,t)=>e(a,t).refiner(a,t)})},a.lazy=function(e){let a;return new c.Struct({type:"lazy",schema:null,*entries(t,c){a??(a=e()),yield*a.entries(t,c)},validator:(t,c)=>(a??(a=e()),a.validator(t,c)),coercer:(t,c)=>(a??(a=e()),a.coercer(t,c)),refiner:(t,c)=>(a??(a=e()),a.refiner(t,c))})},a.omit=function(e,a){const{schema:t}=e,c={...t};for(const e of a)delete c[e];return"type"===e.type?(0,f.type)(c):(0,f.object)(c)},a.partial=function(e){const a=e instanceof c.Struct,t=a?{...e.schema}:{...e};for(const e in t)t[e]=(0,f.optional)(t[e]);return a&&"type"===e.type?(0,f.type)(t):(0,f.object)(t)},a.pick=function(e,a){const{schema:t}=e,c={};for(const e of a)c[e]=t[e];return"type"===e.type?(0,f.type)(c):(0,f.object)(c)}},70639:(e,a)=>{"use strict";function t(e){return"object"==typeof e&&null!==e}function c(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function f(e,a,t,f){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:d,branch:r}=a,{type:n}=t,{refinement:i,message:b=`Expected a value of type \`${n}\`${i?` with refinement \`${i}\``:""}, but received: \`${c(f)}\``}=e;return{value:f,type:n,refinement:i,key:d[d.length-1],path:d,branch:r,...e,message:b}}Object.defineProperty(a,"__esModule",{value:!0}),a.run=a.toFailures=a.toFailure=a.shiftIterator=a.print=a.isPlainObject=a.isObject=void 0,a.isObject=t,a.isPlainObject=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const a=Object.getPrototypeOf(e);return null===a||a===Object.prototype},a.print=c,a.shiftIterator=function(e){const{done:a,value:t}=e.next();return a?void 0:t},a.toFailure=f,a.toFailures=function*(e,a,c,d){(function(e){return t(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const t of e){const e=f(t,a,c,d);e&&(yield e)}},a.run=function*e(a,c,f={}){const{path:d=[],branch:r=[a],coerce:n=!1,mask:i=!1}=f,b={path:d,branch:r};if(n&&(a=c.coercer(a,b),i&&"type"!==c.type&&t(c.schema)&&t(a)&&!Array.isArray(a)))for(const e in a)void 0===c.schema[e]&&delete a[e];let o="valid";for(const e of c.validator(a,b))e.explanation=f.message,o="not_valid",yield[e,void 0];for(let[s,l,u]of c.entries(a,b)){const c=e(l,u,{path:void 0===s?d:[...d,s],branch:void 0===s?r:[...r,l],coerce:n,mask:i,message:f.message});for(const e of c)e[0]?(o=null===e[0].refinement||void 0===e[0].refinement?"not_valid":"not_refined",yield[e[0],void 0]):n&&(l=e[1],void 0===s?a=l:a instanceof Map?a.set(s,l):a instanceof Set?a.add(l):t(a)&&(void 0!==l||s in a)&&(a[s]=l))}if("not_valid"!==o)for(const e of c.refiner(a,b))e.explanation=f.message,o="not_refined",yield[e,void 0];"valid"===o&&(yield[void 0,a])}},22011:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.assertExhaustive=a.assertStruct=a.assert=a.AssertionError=void 0;const c=t(35620),f=t(75940);function d(e,a){return t=e,Boolean("string"==typeof t?.prototype?.constructor?.name)?new e({message:a}):e({message:a});var t}class r extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}a.AssertionError=r,a.assert=function(e,a="Assertion failed.",t=r){if(!e){if(a instanceof Error)throw a;throw d(t,a)}},a.assertStruct=function(e,a,t="Assertion failed",n=r){try{(0,c.assert)(e,a)}catch(e){throw d(n,`${t}: ${function(e){return(0,f.getErrorMessage)(e).replace(/\.$/u,"")}(e)}.`)}},a.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},20472:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.base64=void 0;const c=t(35620),f=t(22011);a.base64=(e,a={})=>{const t=a.paddingRequired??!1,d=a.characterSet??"base64";let r,n;return"base64"===d?r=String.raw`[A-Za-z0-9+\/]`:((0,f.assert)("base64url"===d),r=String.raw`[-_A-Za-z0-9]`),n=t?new RegExp(`^(?:${r}{4})*(?:${r}{3}=|${r}{2}==)?$`,"u"):new RegExp(`^(?:${r}{4})*(?:${r}{2,3}|${r}{3}=|${r}{2}==)?$`,"u"),(0,c.pattern)(e,n)}},77862:(e,a,t)=>{"use strict";var c=t(48287).Buffer;Object.defineProperty(a,"__esModule",{value:!0}),a.createDataView=a.concatBytes=a.valueToBytes=a.base64ToBytes=a.stringToBytes=a.numberToBytes=a.signedBigIntToBytes=a.bigIntToBytes=a.hexToBytes=a.bytesToBase64=a.bytesToString=a.bytesToNumber=a.bytesToSignedBigInt=a.bytesToBigInt=a.bytesToHex=a.assertIsBytes=a.isBytes=void 0;const f=t(63203),d=t(22011),r=t(93976),n=function(){const e=[];return()=>{if(0===e.length)for(let a=0;a<256;a++)e.push(a.toString(16).padStart(2,"0"));return e}}();function i(e){return e instanceof Uint8Array}function b(e){(0,d.assert)(i(e),"Value must be a Uint8Array.")}function o(e){if(b(e),0===e.length)return"0x";const a=n(),t=new Array(e.length);for(let c=0;c=BigInt(0),"Value must be a non-negative bigint."),l(e.toString(16))}function h(e){return(0,d.assert)("number"==typeof e,"Value must be a number."),(0,d.assert)(e>=0,"Value must be a non-negative number."),(0,d.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),l(e.toString(16))}function p(e){return(0,d.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function g(e){if("bigint"==typeof e)return u(e);if("number"==typeof e)return h(e);if("string"==typeof e)return e.startsWith("0x")?l(e):p(e);if(i(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}a.isBytes=i,a.assertIsBytes=b,a.bytesToHex=o,a.bytesToBigInt=s,a.bytesToSignedBigInt=function(e){b(e);let a=BigInt(0);for(const t of e)a=(a<0,"Byte length must be greater than 0."),(0,d.assert)(function(e,a){(0,d.assert)(a>0);const t=e>>BigInt(31);return!((~e&t)+(e&~t)>>BigInt(8*a-1))}(e,a),"Byte length is too small to represent the given value.");let t=e;const c=new Uint8Array(a);for(let e=0;e>=BigInt(8);return c.reverse()},a.numberToBytes=h,a.stringToBytes=p,a.base64ToBytes=function(e){return(0,d.assert)("string"==typeof e,"Value must be a string."),f.base64.decode(e)},a.valueToBytes=g,a.concatBytes=function(e){const a=new Array(e.length);let t=0;for(let c=0;c{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.toCaipChainId=a.parseCaipAccountId=a.parseCaipChainId=a.isCaipAccountAddress=a.isCaipAccountId=a.isCaipReference=a.isCaipNamespace=a.isCaipChainId=a.KnownCaipNamespace=a.CaipAccountAddressStruct=a.CaipAccountIdStruct=a.CaipReferenceStruct=a.CaipNamespaceStruct=a.CaipChainIdStruct=a.CAIP_ACCOUNT_ADDRESS_REGEX=a.CAIP_ACCOUNT_ID_REGEX=a.CAIP_REFERENCE_REGEX=a.CAIP_NAMESPACE_REGEX=a.CAIP_CHAIN_ID_REGEX=void 0;const c=t(35620);function f(e){return(0,c.is)(e,a.CaipNamespaceStruct)}function d(e){return(0,c.is)(e,a.CaipReferenceStruct)}var r;a.CAIP_CHAIN_ID_REGEX=/^(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})$/u,a.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,a.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,a.CAIP_ACCOUNT_ID_REGEX=/^(?(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})):(?[-.%a-zA-Z0-9]{1,128})$/u,a.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,a.CaipChainIdStruct=(0,c.pattern)((0,c.string)(),a.CAIP_CHAIN_ID_REGEX),a.CaipNamespaceStruct=(0,c.pattern)((0,c.string)(),a.CAIP_NAMESPACE_REGEX),a.CaipReferenceStruct=(0,c.pattern)((0,c.string)(),a.CAIP_REFERENCE_REGEX),a.CaipAccountIdStruct=(0,c.pattern)((0,c.string)(),a.CAIP_ACCOUNT_ID_REGEX),a.CaipAccountAddressStruct=(0,c.pattern)((0,c.string)(),a.CAIP_ACCOUNT_ADDRESS_REGEX),(r=a.KnownCaipNamespace||(a.KnownCaipNamespace={})).Eip155="eip155",r.Wallet="wallet",a.isCaipChainId=function(e){return(0,c.is)(e,a.CaipChainIdStruct)},a.isCaipNamespace=f,a.isCaipReference=d,a.isCaipAccountId=function(e){return(0,c.is)(e,a.CaipAccountIdStruct)},a.isCaipAccountAddress=function(e){return(0,c.is)(e,a.CaipAccountAddressStruct)},a.parseCaipChainId=function(e){const t=a.CAIP_CHAIN_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}},a.parseCaipAccountId=function(e){const t=a.CAIP_ACCOUNT_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},a.toCaipChainId=function(e,t){if(!f(e))throw new Error(`Invalid "namespace", must match: ${a.CAIP_NAMESPACE_REGEX.toString()}`);if(!d(t))throw new Error(`Invalid "reference", must match: ${a.CAIP_REFERENCE_REGEX.toString()}`);return`${e}:${t}`}},98860:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ChecksumStruct=void 0;const c=t(35620),f=t(20472);a.ChecksumStruct=(0,c.size)((0,f.base64)((0,c.string)(),{paddingRequired:!0}),44,44)},65211:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.createHex=a.createBytes=a.createBigInt=a.createNumber=void 0;const c=t(35620),f=t(22011),d=t(77862),r=t(93976),n=(0,c.union)([(0,c.number)(),(0,c.bigint)(),(0,c.string)(),r.StrictHexStruct]),i=(0,c.coerce)((0,c.number)(),n,Number),b=(0,c.coerce)((0,c.bigint)(),n,BigInt),o=((0,c.union)([r.StrictHexStruct,(0,c.instance)(Uint8Array)]),(0,c.coerce)((0,c.instance)(Uint8Array),(0,c.union)([r.StrictHexStruct]),d.hexToBytes)),s=(0,c.coerce)(r.StrictHexStruct,(0,c.instance)(Uint8Array),d.bytesToHex);a.createNumber=function(e){try{const a=(0,c.create)(e,i);return(0,f.assert)(Number.isFinite(a),`Expected a number-like value, got "${e}".`),a}catch(a){if(a instanceof c.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw a}},a.createBigInt=function(e){try{return(0,c.create)(e,b)}catch(e){if(e instanceof c.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},a.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,c.create)(e,o)}catch(e){if(e instanceof c.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},a.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,c.create)(e,s)}catch(e){if(e instanceof c.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}},44180:function(e,a){"use strict";var t,c,f=this&&this.__classPrivateFieldGet||function(e,a,t,c){if("a"===t&&!c)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof a?e!==a||!c:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?c:"a"===t?c.call(e):c?c.value:a.get(e)},d=this&&this.__classPrivateFieldSet||function(e,a,t,c,f){if("m"===c)throw new TypeError("Private method is not writable");if("a"===c&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof a?e!==a||!f:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===c?f.call(e,t):f?f.value=t:a.set(e,t),t};Object.defineProperty(a,"__esModule",{value:!0}),a.FrozenSet=a.FrozenMap=void 0;class r{get size(){return f(this,t,"f").size}[(t=new WeakMap,Symbol.iterator)](){return f(this,t,"f")[Symbol.iterator]()}constructor(e){t.set(this,void 0),d(this,t,new Map(e),"f"),Object.freeze(this)}entries(){return f(this,t,"f").entries()}forEach(e,a){return f(this,t,"f").forEach(((t,c,f)=>e.call(a,t,c,this)))}get(e){return f(this,t,"f").get(e)}has(e){return f(this,t,"f").has(e)}keys(){return f(this,t,"f").keys()}values(){return f(this,t,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,a])=>`${String(e)} => ${String(a)}`)).join(", ")} `:""}}`}}a.FrozenMap=r;class n{get size(){return f(this,c,"f").size}[(c=new WeakMap,Symbol.iterator)](){return f(this,c,"f")[Symbol.iterator]()}constructor(e){c.set(this,void 0),d(this,c,new Set(e),"f"),Object.freeze(this)}entries(){return f(this,c,"f").entries()}forEach(e,a){return f(this,c,"f").forEach(((t,c,f)=>e.call(a,t,c,this)))}has(e){return f(this,c,"f").has(e)}keys(){return f(this,c,"f").keys()}values(){return f(this,c,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}a.FrozenSet=n,Object.freeze(r),Object.freeze(r.prototype),Object.freeze(n),Object.freeze(n.prototype)},91630:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},75940:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.wrapError=a.getErrorMessage=a.isErrorWithStack=a.isErrorWithMessage=a.isErrorWithCode=void 0;const c=t(71843),f=t(33745);function d(e){return"object"==typeof e&&null!==e&&"code"in e}function r(e){return"object"==typeof e&&null!==e&&"message"in e}a.isErrorWithCode=d,a.isErrorWithMessage=r,a.isErrorWithStack=function(e){return"object"==typeof e&&null!==e&&"stack"in e},a.getErrorMessage=function(e){return r(e)&&"string"==typeof e.message?e.message:(0,f.isNullOrUndefined)(e)?"":String(e)},a.wrapError=function(e,a){if((t=e)instanceof Error||(0,f.isObject)(t)&&"Error"===t.constructor.name){let t;return t=2===Error.length?new Error(a,{cause:e}):new c.ErrorWithCause(a,{cause:e}),d(e)&&(t.code=e.code),t}var t;return a.length>0?new Error(`${String(e)}: ${a}`):new Error(String(e))}},93976:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.remove0x=a.add0x=a.isValidChecksumAddress=a.getChecksumAddress=a.isValidHexAddress=a.assertIsStrictHexString=a.assertIsHexString=a.isStrictHexString=a.isHexString=a.HexChecksumAddressStruct=a.HexAddressStruct=a.StrictHexStruct=a.HexStruct=void 0;const c=t(35620),f=t(2214),d=t(22011),r=t(77862);function n(e){return(0,c.is)(e,a.HexStruct)}function i(e){return(0,c.is)(e,a.StrictHexStruct)}function b(e){(0,d.assert)((0,c.is)(e,a.HexChecksumAddressStruct),"Invalid hex address.");const t=s(e.toLowerCase()),n=s((0,r.bytesToHex)((0,f.keccak_256)(t)));return`0x${t.split("").map(((e,a)=>{const t=n[a];return(0,d.assert)((0,c.is)(t,(0,c.string)()),"Hash shorter than address."),parseInt(t,16)>7?e.toUpperCase():e})).join("")}`}function o(e){return!!(0,c.is)(e,a.HexChecksumAddressStruct)&&b(e)===e}function s(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}a.HexStruct=(0,c.pattern)((0,c.string)(),/^(?:0x)?[0-9a-f]+$/iu),a.StrictHexStruct=(0,c.pattern)((0,c.string)(),/^0x[0-9a-f]+$/iu),a.HexAddressStruct=(0,c.pattern)((0,c.string)(),/^0x[0-9a-f]{40}$/u),a.HexChecksumAddressStruct=(0,c.pattern)((0,c.string)(),/^0x[0-9a-fA-F]{40}$/u),a.isHexString=n,a.isStrictHexString=i,a.assertIsHexString=function(e){(0,d.assert)(n(e),"Value must be a hexadecimal string.")},a.assertIsStrictHexString=function(e){(0,d.assert)(i(e),'Value must be a hexadecimal string, starting with "0x".')},a.isValidHexAddress=function(e){return(0,c.is)(e,a.HexAddressStruct)||o(e)},a.getChecksumAddress=b,a.isValidChecksumAddress=o,a.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},a.remove0x=s},52367:function(e,a,t){"use strict";var c=this&&this.__createBinding||(Object.create?function(e,a,t,c){void 0===c&&(c=t);var f=Object.getOwnPropertyDescriptor(a,t);f&&!("get"in f?!a.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,c,f)}:function(e,a,t,c){void 0===c&&(c=t),e[c]=a[t]}),f=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||c(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),f(t(22011),a),f(t(20472),a),f(t(77862),a),f(t(87690),a),f(t(98860),a),f(t(65211),a),f(t(44180),a),f(t(91630),a),f(t(75940),a),f(t(93976),a),f(t(60087),a),f(t(24956),a),f(t(98912),a),f(t(33745),a),f(t(5770),a),f(t(3028),a),f(t(2812),a),f(t(32954),a),f(t(16871),a),f(t(49266),a)},60087:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getJsonRpcIdValidator=a.assertIsJsonRpcError=a.isJsonRpcError=a.assertIsJsonRpcFailure=a.isJsonRpcFailure=a.assertIsJsonRpcSuccess=a.isJsonRpcSuccess=a.assertIsJsonRpcResponse=a.isJsonRpcResponse=a.assertIsPendingJsonRpcResponse=a.isPendingJsonRpcResponse=a.JsonRpcResponseStruct=a.JsonRpcFailureStruct=a.JsonRpcSuccessStruct=a.PendingJsonRpcResponseStruct=a.assertIsJsonRpcRequest=a.isJsonRpcRequest=a.assertIsJsonRpcNotification=a.isJsonRpcNotification=a.JsonRpcNotificationStruct=a.JsonRpcRequestStruct=a.JsonRpcParamsStruct=a.JsonRpcErrorStruct=a.JsonRpcIdStruct=a.JsonRpcVersionStruct=a.jsonrpc2=a.getJsonSize=a.getSafeJson=a.isValidJson=a.JsonStruct=a.UnsafeJsonStruct=a.exactOptional=a.object=void 0;const c=t(35620),f=t(22011),d=t(33745);function r({path:e,branch:a}){const t=e[e.length-1];return(0,d.hasProperty)(a[a.length-2],t)}function n(e){return new c.Struct({...e,type:`optional ${e.type}`,validator:(a,t)=>!r(t)||e.validator(a,t),refiner:(a,t)=>!r(t)||e.refiner(a,t)})}function i(e){return(0,c.create)(e,a.JsonStruct)}a.object=e=>(0,c.object)(e),a.exactOptional=n,a.UnsafeJsonStruct=(0,c.union)([(0,c.literal)(null),(0,c.boolean)(),(0,c.define)("finite number",(e=>(0,c.is)(e,(0,c.number)())&&Number.isFinite(e))),(0,c.string)(),(0,c.array)((0,c.lazy)((()=>a.UnsafeJsonStruct))),(0,c.record)((0,c.string)(),(0,c.lazy)((()=>a.UnsafeJsonStruct)))]),a.JsonStruct=(0,c.coerce)(a.UnsafeJsonStruct,(0,c.any)(),(e=>((0,f.assertStruct)(e,a.UnsafeJsonStruct),JSON.parse(JSON.stringify(e,((e,a)=>{if("__proto__"!==e&&"constructor"!==e)return a})))))),a.isValidJson=function(e){try{return i(e),!0}catch{return!1}},a.getSafeJson=i,a.getJsonSize=function(e){(0,f.assertStruct)(e,a.JsonStruct,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},a.jsonrpc2="2.0",a.JsonRpcVersionStruct=(0,c.literal)(a.jsonrpc2),a.JsonRpcIdStruct=(0,c.nullable)((0,c.union)([(0,c.number)(),(0,c.string)()])),a.JsonRpcErrorStruct=(0,a.object)({code:(0,c.integer)(),message:(0,c.string)(),data:n(a.JsonStruct),stack:n((0,c.string)())}),a.JsonRpcParamsStruct=(0,c.union)([(0,c.record)((0,c.string)(),a.JsonStruct),(0,c.array)(a.JsonStruct)]),a.JsonRpcRequestStruct=(0,a.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,method:(0,c.string)(),params:n(a.JsonRpcParamsStruct)}),a.JsonRpcNotificationStruct=(0,a.object)({jsonrpc:a.JsonRpcVersionStruct,method:(0,c.string)(),params:n(a.JsonRpcParamsStruct)}),a.isJsonRpcNotification=function(e){return(0,c.is)(e,a.JsonRpcNotificationStruct)},a.assertIsJsonRpcNotification=function(e,t){(0,f.assertStruct)(e,a.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",t)},a.isJsonRpcRequest=function(e){return(0,c.is)(e,a.JsonRpcRequestStruct)},a.assertIsJsonRpcRequest=function(e,t){(0,f.assertStruct)(e,a.JsonRpcRequestStruct,"Invalid JSON-RPC request",t)},a.PendingJsonRpcResponseStruct=(0,c.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,result:(0,c.optional)((0,c.unknown)()),error:(0,c.optional)(a.JsonRpcErrorStruct)}),a.JsonRpcSuccessStruct=(0,a.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,result:a.JsonStruct}),a.JsonRpcFailureStruct=(0,a.object)({id:a.JsonRpcIdStruct,jsonrpc:a.JsonRpcVersionStruct,error:a.JsonRpcErrorStruct}),a.JsonRpcResponseStruct=(0,c.union)([a.JsonRpcSuccessStruct,a.JsonRpcFailureStruct]),a.isPendingJsonRpcResponse=function(e){return(0,c.is)(e,a.PendingJsonRpcResponseStruct)},a.assertIsPendingJsonRpcResponse=function(e,t){(0,f.assertStruct)(e,a.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",t)},a.isJsonRpcResponse=function(e){return(0,c.is)(e,a.JsonRpcResponseStruct)},a.assertIsJsonRpcResponse=function(e,t){(0,f.assertStruct)(e,a.JsonRpcResponseStruct,"Invalid JSON-RPC response",t)},a.isJsonRpcSuccess=function(e){return(0,c.is)(e,a.JsonRpcSuccessStruct)},a.assertIsJsonRpcSuccess=function(e,t){(0,f.assertStruct)(e,a.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",t)},a.isJsonRpcFailure=function(e){return(0,c.is)(e,a.JsonRpcFailureStruct)},a.assertIsJsonRpcFailure=function(e,t){(0,f.assertStruct)(e,a.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",t)},a.isJsonRpcError=function(e){return(0,c.is)(e,a.JsonRpcErrorStruct)},a.assertIsJsonRpcError=function(e,t){(0,f.assertStruct)(e,a.JsonRpcErrorStruct,"Invalid JSON-RPC error",t)},a.getJsonRpcIdValidator=function(e){const{permitEmptyString:a,permitFractions:t,permitNull:c}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(t||Number.isInteger(e))||"string"==typeof e&&(a||e.length>0)||c&&null===e)}},24956:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},98912:function(e,a,t){"use strict";var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.createModuleLogger=a.createProjectLogger=void 0;const f=(0,c(t(17833)).default)("metamask");a.createProjectLogger=function(e){return f.extend(e)},a.createModuleLogger=function(e,a){return e.extend(a)}},33745:(e,a)=>{"use strict";function t(e){return e.charCodeAt(0)<=127}var c;Object.defineProperty(a,"__esModule",{value:!0}),a.calculateNumberSize=a.calculateStringSize=a.isASCII=a.isPlainObject=a.ESCAPE_CHARACTERS_REGEXP=a.JsonSize=a.getKnownPropertyNames=a.hasProperty=a.isObject=a.isNullOrUndefined=a.isNonEmptyArray=void 0,a.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},a.isNullOrUndefined=function(e){return null==e},a.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)},a.hasProperty=(e,a)=>Object.hasOwnProperty.call(e,a),a.getKnownPropertyNames=function(e){return Object.getOwnPropertyNames(e)},(c=a.JsonSize||(a.JsonSize={}))[c.Null=4]="Null",c[c.Comma=1]="Comma",c[c.Wrapper=1]="Wrapper",c[c.True=4]="True",c[c.False=5]="False",c[c.Quote=1]="Quote",c[c.Colon=1]="Colon",c[c.Date=24]="Date",a.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,a.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let a=e;for(;null!==Object.getPrototypeOf(a);)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(e)===a}catch(e){return!1}},a.isASCII=t,a.calculateStringSize=function(e){return e.split("").reduce(((e,a)=>t(a)?e+1:e+2),0)+(e.match(a.ESCAPE_CHARACTERS_REGEXP)??[]).length},a.calculateNumberSize=function(e){return e.toString().length}},5770:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.hexToBigInt=a.hexToNumber=a.bigIntToHex=a.numberToHex=void 0;const c=t(22011),f=t(93976);a.numberToHex=e=>((0,c.assert)("number"==typeof e,"Value must be a number."),(0,c.assert)(e>=0,"Value must be a non-negative number."),(0,c.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,f.add0x)(e.toString(16))),a.bigIntToHex=e=>((0,c.assert)("bigint"==typeof e,"Value must be a bigint."),(0,c.assert)(e>=0,"Value must be a non-negative bigint."),(0,f.add0x)(e.toString(16))),a.hexToNumber=e=>{(0,f.assertIsHexString)(e);const a=parseInt(e,16);return(0,c.assert)(Number.isSafeInteger(a),"Value is not a safe integer. Use `hexToBigInt` instead."),a},a.hexToBigInt=e=>((0,f.assertIsHexString)(e),BigInt((0,f.add0x)(e)))},3028:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},2812:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.createDeferredPromise=void 0,a.createDeferredPromise=function({suppressUnhandledRejection:e=!1}={}){let a,t;const c=new Promise(((e,c)=>{a=e,t=c}));return e&&c.catch((e=>{})),{promise:c,resolve:a,reject:t}}},32954:(e,a)=>{"use strict";var t;Object.defineProperty(a,"__esModule",{value:!0}),a.timeSince=a.inMilliseconds=a.Duration=void 0,(t=a.Duration||(a.Duration={}))[t.Millisecond=1]="Millisecond",t[t.Second=1e3]="Second",t[t.Minute=6e4]="Minute",t[t.Hour=36e5]="Hour",t[t.Day=864e5]="Day",t[t.Week=6048e5]="Week",t[t.Year=31536e6]="Year";const c=(e,a)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${a}" must be a non-negative integer. Received: "${e}".`)};a.inMilliseconds=function(e,a){return c(e,"count"),e*a},a.timeSince=function(e){return c(e,"timestamp"),Date.now()-e}},16871:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0})},49266:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.satisfiesVersionRange=a.gtRange=a.gtVersion=a.assertIsSemVerRange=a.assertIsSemVerVersion=a.isValidSemVerRange=a.isValidSemVerVersion=a.VersionRangeStruct=a.VersionStruct=void 0;const c=t(35620),f=t(99589),d=t(22011);a.VersionStruct=(0,c.refine)((0,c.string)(),"Version",(e=>null!==(0,f.valid)(e)||`Expected SemVer version, got "${e}"`)),a.VersionRangeStruct=(0,c.refine)((0,c.string)(),"Version range",(e=>null!==(0,f.validRange)(e)||`Expected SemVer range, got "${e}"`)),a.isValidSemVerVersion=function(e){return(0,c.is)(e,a.VersionStruct)},a.isValidSemVerRange=function(e){return(0,c.is)(e,a.VersionRangeStruct)},a.assertIsSemVerVersion=function(e){(0,d.assertStruct)(e,a.VersionStruct)},a.assertIsSemVerRange=function(e){(0,d.assertStruct)(e,a.VersionRangeStruct)},a.gtVersion=function(e,a){return(0,f.gt)(e,a)},a.gtRange=function(e,a){return(0,f.gtr)(e,a)},a.satisfiesVersionRange=function(e,a){return(0,f.satisfies)(e,a,{includePrerelease:!0})}},39209:(e,a,t)=>{"use strict";var c=t(76578),f="undefined"==typeof globalThis?t.g:globalThis;e.exports=function(){for(var e=[],a=0;a{"use strict";const{normalizeIPv6:c,normalizeIPv4:f,removeDotSegments:d,recomposeAuthority:r,normalizeComponentEncoding:n}=t(34834),i=t(343);function b(e,a,t,c){const f={};return c||(e=u(o(e,t),t),a=u(o(a,t),t)),!(t=t||{}).tolerant&&a.scheme?(f.scheme=a.scheme,f.userinfo=a.userinfo,f.host=a.host,f.port=a.port,f.path=d(a.path||""),f.query=a.query):(void 0!==a.userinfo||void 0!==a.host||void 0!==a.port?(f.userinfo=a.userinfo,f.host=a.host,f.port=a.port,f.path=d(a.path||""),f.query=a.query):(a.path?("/"===a.path.charAt(0)?f.path=d(a.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?f.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+a.path:f.path=a.path:f.path="/"+a.path,f.path=d(f.path)),f.query=a.query):(f.path=e.path,void 0!==a.query?f.query=a.query:f.query=e.query),f.userinfo=e.userinfo,f.host=e.host,f.port=e.port),f.scheme=e.scheme),f.fragment=a.fragment,f}function o(e,a){const t={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},c=Object.assign({},a),f=[],n=i[(c.scheme||t.scheme||"").toLowerCase()];n&&n.serialize&&n.serialize(t,c),void 0!==t.path&&(c.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),void 0!==t.scheme&&(t.path=t.path.split("%3A").join(":")))),"suffix"!==c.reference&&t.scheme&&(f.push(t.scheme),f.push(":"));const b=r(t,c);if(void 0!==b&&("suffix"!==c.reference&&f.push("//"),f.push(b),t.path&&"/"!==t.path.charAt(0)&&f.push("/")),void 0!==t.path){let e=t.path;c.absolutePath||n&&n.absolutePath||(e=d(e)),void 0===b&&(e=e.replace(/^\/\//u,"/%2F")),f.push(e)}return void 0!==t.query&&(f.push("?"),f.push(t.query)),void 0!==t.fragment&&(f.push("#"),f.push(t.fragment)),f.join("")}const s=Array.from({length:127},((e,a)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(a)))),l=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function u(e,a){const t=Object.assign({},a),d={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},r=-1!==e.indexOf("%");let n=!1;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);const b=e.match(l);if(b){if(d.scheme=b[1],d.userinfo=b[3],d.host=b[4],d.port=parseInt(b[5],10),d.path=b[6]||"",d.query=b[7],d.fragment=b[8],isNaN(d.port)&&(d.port=b[5]),d.host){const e=f(d.host);if(!1===e.isIPV4){const a=c(e.host,{isIPV4:!1});d.host=a.host.toLowerCase(),n=a.isIPV6}else d.host=e.host,n=!0}void 0!==d.scheme||void 0!==d.userinfo||void 0!==d.host||void 0!==d.port||d.path||void 0!==d.query?void 0===d.scheme?d.reference="relative":void 0===d.fragment?d.reference="absolute":d.reference="uri":d.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==d.reference&&(d.error=d.error||"URI is not a "+t.reference+" reference.");const e=i[(t.scheme||d.scheme||"").toLowerCase()];if(!(t.unicodeSupport||e&&e.unicodeSupport)&&d.host&&(t.domainHost||e&&e.domainHost)&&!1===n&&function(e){let a=0;for(let t=0,c=e.length;t126||s[a])return!0;return!1}(d.host))try{d.host=URL.domainToASCII(d.host.toLowerCase())}catch(e){d.error=d.error||"Host's domain name can not be converted to ASCII: "+e}(!e||e&&!e.skipNormalize)&&(r&&void 0!==d.scheme&&(d.scheme=unescape(d.scheme)),r&&void 0!==d.userinfo&&(d.userinfo=unescape(d.userinfo)),r&&void 0!==d.host&&(d.host=unescape(d.host)),void 0!==d.path&&d.path.length&&(d.path=escape(unescape(d.path))),void 0!==d.fragment&&d.fragment.length&&(d.fragment=encodeURI(decodeURIComponent(d.fragment)))),e&&e.parse&&e.parse(d,t)}else d.error=d.error||"URI can not be parsed.";return d}const h={SCHEMES:i,normalize:function(e,a){return"string"==typeof e?e=o(u(e,a),a):"object"==typeof e&&(e=u(o(e,a),a)),e},resolve:function(e,a,t){const c=Object.assign({scheme:"null"},t);return o(b(u(e,c),u(a,c),c,!0),{...c,skipEscape:!0})},resolveComponents:b,equal:function(e,a,t){return"string"==typeof e?(e=unescape(e),e=o(n(u(e,t),!0),{...t,skipEscape:!0})):"object"==typeof e&&(e=o(n(e,!0),{...t,skipEscape:!0})),"string"==typeof a?(a=unescape(a),a=o(n(u(a,t),!0),{...t,skipEscape:!0})):"object"==typeof a&&(a=o(n(a,!0),{...t,skipEscape:!0})),e.toLowerCase()===a.toLowerCase()},serialize:o,parse:u};e.exports=h,e.exports.default=h,e.exports.fastUri=h},343:e=>{"use strict";const a=/^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu,t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function c(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function f(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function d(e){const a="https"===String(e.scheme).toLowerCase();return e.port!==(a?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const r={scheme:"http",domainHost:!0,parse:f,serialize:d},n={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=c(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(c(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[a,t]=e.resourceName.split("?");e.path=a&&"/"!==a?a:void 0,e.query=t,e.resourceName=void 0}return e.fragment=void 0,e}},i={http:r,https:{scheme:"https",domainHost:r.domainHost,parse:f,serialize:d},ws:n,wss:{scheme:"wss",domainHost:n.domainHost,parse:n.parse,serialize:n.serialize},urn:{scheme:"urn",parse:function(e,a){if(!e.path)return e.error="URN can not be parsed",e;const c=e.path.match(t);if(c){const t=a.scheme||e.scheme||"urn";e.nid=c[1].toLowerCase(),e.nss=c[2];const f=`${t}:${a.nid||e.nid}`,d=i[f];e.path=void 0,d&&(e=d.parse(e,a))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,a){const t=a.scheme||e.scheme||"urn",c=e.nid.toLowerCase(),f=`${t}:${a.nid||c}`,d=i[f];d&&(e=d.serialize(e,a));const r=e,n=e.nss;return r.path=`${c||a.nid}:${n}`,a.skipEscape=!0,r},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){const c=e;return c.uuid=c.nss,c.nss=void 0,t.tolerant||c.uuid&&a.test(c.uuid)||(c.error=c.error||"UUID is not valid."),c},serialize:function(e){const a=e;return a.nss=(e.uuid||"").toLowerCase(),a},skipNormalize:!0}};e.exports=i},64914:e=>{"use strict";e.exports={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}},34834:(e,a,t)=>{"use strict";const{HEX:c}=t(64914);function f(e){if(i(e,".")<3)return{host:e,isIPV4:!1};const a=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[t]=a;return t?{host:n(t,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function d(e,a=!1){let t="",f=!0;for(const a of e){if(void 0===c[a])return;"0"!==a&&!0===f&&(f=!1),f||(t+=a)}return a&&0===t.length&&(t="0"),t}function r(e,a={}){if(i(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let a=0;const t={error:!1,address:"",zone:""},c=[],f=[];let r=!1,n=!1,i=!1;function b(){if(f.length){if(!1===r){const e=d(f);if(void 0===e)return t.error=!0,!1;c.push(e)}f.length=0}return!0}for(let d=0;d7){t.error=!0;break}d-1>=0&&":"===e[d-1]&&(n=!0)}}return f.length&&(r?t.zone=f.join(""):i?c.push(f.join("")):c.push(d(f))),t.address=c.join(""),t}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,a=t.address;return t.zone&&(e+="%"+t.zone,a+="%25"+t.zone),{host:e,escapedHost:a,isIPV6:!0}}}function n(e,a){let t="",c=!0;const f=e.length;for(let d=0;d{"use strict";t.d(a,{HI:()=>Bt,vu:()=>ct});const c=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];function f(e,a){return a&&10!=a?16==a?"0x"==e.slice(0,2)?BigInt(e):BigInt("0x"+e):void 0:BigInt(e)}const d=f;function r(e){const a=e.toString(16);return 4*(a.length-1)+c[parseInt(a[0],16)]}function n(e){return BigInt(e)>BigInt(a)}const o=i,s=b;function l(e){return(BigInt(e)&BigInt(1))==BigInt(1)}function u(e){if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("Number too big");return Number(e)}function h(e,a){return BigInt(e)+BigInt(a)}function p(e,a){return BigInt(e)-BigInt(a)}function g(e){return-BigInt(e)}function m(e,a){return BigInt(e)*BigInt(a)}function x(e,a){return BigInt(e)%BigInt(a)}function y(e,a){return BigInt(e)>BigInt(a)}function A(e,a){return BigInt(e)>=BigInt(a)}function v(e,a){return BigInt(e)&BigInt(a)}function w(e,a,t,c){const f="0000000"+t.toString(16),d=new Uint32Array(e.buffer,e.byteOffset+a,c/4),r=1+(4*(f.length-7)-1>>5);for(let e=0;ed[d.length-a-1]=e.toString(16).padStart(8,"0"))),f(d.join(""),16)}function I(e,a){return e.toString(a)}function E(e){const a=new Uint8Array(Math.floor((r(e)-1)/8)+1);return w(a,0,e,a.byteLength),a}const C=d(0),M=d(1);var B=Object.freeze({__proto__:null,abs:function(e){return BigInt(e)>=0?BigInt(e):-BigInt(e)},add:h,band:v,bitLength:r,bits:function(e){let a=BigInt(e);const t=[];for(;a;)a&BigInt(1)?t.push(1):t.push(0),a>>=BigInt(1);return t},bor:function(e,a){return BigInt(e)|BigInt(a)},bxor:function(e,a){return BigInt(e)^BigInt(a)},div:function(e,a){return BigInt(e)/BigInt(a)},e:d,eq:function(e,a){return BigInt(e)==BigInt(a)},exp:function(e,a){return BigInt(e)**BigInt(a)},fromArray:function(e,a){let t=BigInt(0);a=BigInt(a);for(let c=0;c>=BigInt(1)}return t},neg:g,neq:function(e,a){return BigInt(e)!=BigInt(a)},one:M,pow:function(e,a){return BigInt(e)**BigInt(a)},shiftLeft:i,shiftRight:b,shl:o,shr:s,square:function(e){return BigInt(e)*BigInt(e)},sub:p,toArray:function(e,a){const t=[];let c=BigInt(e);for(a=BigInt(a);c;)t.unshift(Number(c%a)),c/=a;return t},toLEBuff:E,toNumber:u,toRprBE:function(e,a,t,c){const f="0000000"+t.toString(16),d=new DataView(e.buffer,e.byteOffset+a,c),r=1+(4*(f.length-7)-1>>5);for(let e=0;e>=1;return t}function k(e,a,t,c,f){e[a]=e[a]+e[t]>>>0,e[f]=(e[f]^e[a])>>>0,e[f]=(e[f]<<16|e[f]>>>16&65535)>>>0,e[c]=e[c]+e[f]>>>0,e[t]=(e[t]^e[c])>>>0,e[t]=(e[t]<<12|e[t]>>>20&4095)>>>0,e[a]=e[a]+e[t]>>>0,e[f]=(e[f]^e[a])>>>0,e[f]=(e[f]<<8|e[f]>>>24&255)>>>0,e[c]=e[c]+e[f]>>>0,e[t]=(e[t]^e[c])>>>0,e[t]=(e[t]<<7|e[t]>>>25&127)>>>0}class N{constructor(e){e=e||[0,0,0,0,0,0,0,0],this.state=[1634760805,857760878,2036477234,1797285236,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],0,0,0,0],this.idx=16,this.buff=new Array(16)}nextU32(){return 16==this.idx&&this.update(),this.buff[this.idx++]}nextU64(){return h(m(this.nextU32(),4294967296),this.nextU32())}nextBool(){return!(1&~this.nextU32())}update(){for(let e=0;e<16;e++)this.buff[e]=this.state[e];for(let a=0;a<10;a++)k(e=this.buff,0,4,8,12),k(e,1,5,9,13),k(e,2,6,10,14),k(e,3,7,11,15),k(e,0,5,10,15),k(e,1,6,11,12),k(e,2,7,8,13),k(e,3,4,9,14);var e;for(let e=0;e<16;e++)this.buff[e]=this.buff[e]+this.state[e]>>>0;this.idx=0,this.state[12]=this.state[12]+1>>>0,0==this.state[12]&&(this.state[13]=this.state[13]+1>>>0,0==this.state[13]&&(this.state[14]=this.state[14]+1>>>0,0==this.state[14]&&(this.state[15]=this.state[15]+1>>>0)))}}let P=null;function R(){return P||(P=new N(function(){const e=function(e){let a=new Uint8Array(e);if(void 0!==globalThis.crypto)globalThis.crypto.getRandomValues(a);else for(let t=0;t>>0;return a}(32),a=new Uint32Array(e.buffer),t=[];for(let e=0;e<8;e++)t.push(a[e]);return t}()),P)}function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var T={bigInt2BytesLE:function(e,a){const t=Array(a);let c=BigInt(e);for(let e=0;e>=8n;return t},bigInt2U32LE:function(e,a){const t=Array(a);let c=BigInt(e);for(let e=0;e>=32n;return t},isOcamNum:function(e){return!!Array.isArray(e)&&3==e.length&&"number"==typeof e[0]&&"number"==typeof e[1]&&!!Array.isArray(e[2])}},D=function(e,a,t,c,f,d,r){const n=e.addFunction(a);n.addParam("base","i32"),n.addParam("scalar","i32"),n.addParam("scalarLength","i32"),n.addParam("r","i32"),n.addLocal("i","i32"),n.addLocal("b","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(t));n.addCode(i.if(i.i32_eqz(i.getLocal("scalarLength")),[...i.call(r,i.getLocal("r")),...i.ret([])])),n.addCode(i.call(d,i.getLocal("base"),b)),n.addCode(i.call(r,i.getLocal("r"))),n.addCode(i.setLocal("i",i.getLocal("scalarLength"))),n.addCode(i.block(i.loop(i.setLocal("i",i.i32_sub(i.getLocal("i"),i.i32_const(1))),i.setLocal("b",i.i32_load8_u(i.i32_add(i.getLocal("scalar"),i.getLocal("i")))),...function(){const e=[];for(let a=0;a<8;a++)e.push(...i.call(f,i.getLocal("r"),i.getLocal("r")),...i.if(i.i32_ge_u(i.getLocal("b"),i.i32_const(128>>a)),[...i.setLocal("b",i.i32_sub(i.getLocal("b"),i.i32_const(128>>a))),...i.call(c,i.getLocal("r"),b,i.getLocal("r"))]));return e}(),i.br_if(1,i.i32_eqz(i.getLocal("i"))),i.br(0))))},F=function(e,a){const t=8*e.modules[a].n64,c=e.addFunction(a+"_batchInverse");c.addParam("pIn","i32"),c.addParam("inStep","i32"),c.addParam("n","i32"),c.addParam("pOut","i32"),c.addParam("outStep","i32"),c.addLocal("itAux","i32"),c.addLocal("itIn","i32"),c.addLocal("itOut","i32"),c.addLocal("i","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(t));c.addCode(f.setLocal("itAux",f.i32_load(f.i32_const(0))),f.i32_store(f.i32_const(0),f.i32_add(f.getLocal("itAux"),f.i32_mul(f.i32_add(f.getLocal("n"),f.i32_const(1)),f.i32_const(t))))),c.addCode(f.call(a+"_one",f.getLocal("itAux")),f.setLocal("itIn",f.getLocal("pIn")),f.setLocal("itAux",f.i32_add(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("i",f.i32_const(0)),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("i"),f.getLocal("n"))),f.if(f.call(a+"_isZero",f.getLocal("itIn")),f.call(a+"_copy",f.i32_sub(f.getLocal("itAux"),f.i32_const(t)),f.getLocal("itAux")),f.call(a+"_mul",f.getLocal("itIn"),f.i32_sub(f.getLocal("itAux"),f.i32_const(t)),f.getLocal("itAux"))),f.setLocal("itIn",f.i32_add(f.getLocal("itIn"),f.getLocal("inStep"))),f.setLocal("itAux",f.i32_add(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("i",f.i32_add(f.getLocal("i"),f.i32_const(1))),f.br(0))),f.setLocal("itIn",f.i32_sub(f.getLocal("itIn"),f.getLocal("inStep"))),f.setLocal("itAux",f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("itOut",f.i32_add(f.getLocal("pOut"),f.i32_mul(f.i32_sub(f.getLocal("n"),f.i32_const(1)),f.getLocal("outStep")))),f.call(a+"_inverse",f.getLocal("itAux"),f.getLocal("itAux")),f.block(f.loop(f.br_if(1,f.i32_eqz(f.getLocal("i"))),f.if(f.call(a+"_isZero",f.getLocal("itIn")),[...f.call(a+"_copy",f.getLocal("itAux"),f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),...f.call(a+"_zero",f.getLocal("itOut"))],[...f.call(a+"_copy",f.i32_sub(f.getLocal("itAux"),f.i32_const(t)),d),...f.call(a+"_mul",f.getLocal("itAux"),f.getLocal("itIn"),f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),...f.call(a+"_mul",f.getLocal("itAux"),d,f.getLocal("itOut"))]),f.setLocal("itIn",f.i32_sub(f.getLocal("itIn"),f.getLocal("inStep"))),f.setLocal("itOut",f.i32_sub(f.getLocal("itOut"),f.getLocal("outStep"))),f.setLocal("itAux",f.i32_sub(f.getLocal("itAux"),f.i32_const(t))),f.setLocal("i",f.i32_sub(f.getLocal("i"),f.i32_const(1))),f.br(0)))),c.addCode(f.i32_store(f.i32_const(0),f.getLocal("itAux")))},Q=function(e,a,t,c,f,d){void 0===d&&(d=ca?1:-1}function H(e){return e*e}function $(e){return e%2n!==0n}function q(e){return e%2n===0n}function G(e){return e<0n}function z(e){return e>0n}function K(e){return G(e)?e.toString(2).length-1:e.toString(2).length}function V(e){return e<0n?-e:e}function Z(e){return 1n===V(e)}function J(e,a){for(var t,c,f,d=0n,r=1n,n=a,i=V(e);0n!==i;)t=n/i,c=d,f=n,d=r,n=i,r=c-t*r,i=f-t*i;if(!Z(n))throw new Error(e.toString()+" and "+a.toString()+" are not co-prime");return-1===j(d,0n)&&(d+=a),G(e)?-d:d}function W(e,a,t){if(0n===t)throw new Error("Cannot take modPow with modulus 0");var c=1n,f=e%t;for(G(a)&&(a*=-1n,f=J(f,t));z(a);){if(0n===f)return 0n;$(a)&&(c=c*f%t),a/=2n,f=H(f)%t}return c}function Y(e,a){return 0n!==a&&(!!Z(a)||(0===function(e,a){return(e=e>=0n?e:-e)===(a=a>=0n?a:-a)?0:e>a?1:-1}(a,2n)?q(e):e%a===0n))}function X(e,a){for(var t,c,f,d=function(e){return e-1n}(e),r=d,n=0;q(r);)r/=2n,n++;e:for(c=0;c>1&&c>1,e>>1)))),a.addCode(t.setLocal(i,t.i64_add(t.getLocal(i),t.i64_shr_u(t.getLocal(n),t.i64_const(32)))))),e>0&&(a.addCode(t.setLocal(n,t.i64_add(t.i64_and(t.getLocal(n),t.i64_const(4294967295)),t.i64_and(t.getLocal(b),t.i64_const(4294967295))))),a.addCode(t.setLocal(i,t.i64_add(t.i64_add(t.getLocal(i),t.i64_shr_u(t.getLocal(n),t.i64_const(32))),t.getLocal(o))))),a.addCode(t.i64_store32(t.getLocal("r"),4*e,t.getLocal(n))),a.addCode(t.setLocal(b,t.getLocal(i)),t.setLocal(o,t.i64_shr_u(t.getLocal(b),t.i64_const(32))))}a.addCode(t.i64_store32(t.getLocal("r"),4*f*2-4,t.getLocal(b)))}(),function(){const a=e.addFunction(c+"_squareOld");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(c+"_mul",t.getLocal("x"),t.getLocal("x"),t.getLocal("r")))}(),function(){!function(){const a=e.addFunction(c+"__mul1");a.addParam("px","i32"),a.addParam("y","i64"),a.addParam("pr","i32"),a.addLocal("c","i64");const t=a.getCodeBuilder();a.addCode(t.setLocal("c",t.i64_mul(t.i64_load32_u(t.getLocal("px"),0,0),t.getLocal("y")))),a.addCode(t.i64_store32(t.getLocal("pr"),0,0,t.getLocal("c")));for(let e=1;e>1n,g=e.alloc(n,ee.bigInt2BytesLE(p,n)),m=p+1n,x=e.alloc(n,ee.bigInt2BytesLE(m,n));e.modules[i]={pq:o,pR2:s,n64:d,q:f,pOne:l,pZero:u,pePlusOne:x};let y=2n;if(ie(f))for(;ne(y,p,f)!==h;)y+=1n;let A=0,v=h;for(;!be(v)&&0n!==v;)A++,v>>=1n;const w=e.alloc(n,ee.bigInt2BytesLE(v,n)),_=ne(y,v,f),I=e.alloc(ee.bigInt2BytesLE((_<>1n,C=e.alloc(n,ee.bigInt2BytesLE(E,n));return e.exportFunction(b+"_copy",i+"_copy"),e.exportFunction(b+"_zero",i+"_zero"),e.exportFunction(b+"_isZero",i+"_isZero"),e.exportFunction(b+"_eq",i+"_eq"),function(){const a=e.addFunction(i+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder();a.addCode(t.ret(t.call(b+"_eq",t.getLocal("x"),t.i32_const(l))))}(),function(){const a=e.addFunction(i+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.if(t.call(b+"_add",t.getLocal("x"),t.getLocal("y"),t.getLocal("r")),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),t.if(t.call(b+"_gte",t.getLocal("r"),t.i32_const(o)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))))))}(),function(){const a=e.addFunction(i+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.if(t.call(b+"_sub",t.getLocal("x"),t.getLocal("y"),t.getLocal("r")),t.drop(t.call(b+"_add",t.getLocal("r"),t.i32_const(o),t.getLocal("r")))))}(),function(){const a=e.addFunction(i+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_sub",t.i32_const(u),t.getLocal("x"),t.getLocal("r")))}(),function(){const a=e.alloc(r*r*8),t=e.addFunction(i+"_mReduct");t.addParam("t","i32"),t.addParam("r","i32"),t.addLocal("np32","i64"),t.addLocal("c","i64"),t.addLocal("m","i64");const c=t.getCodeBuilder(),d=Number(0x100000000n-re(f,0x100000000n));t.addCode(c.setLocal("np32",c.i64_const(d)));for(let e=0;e=r&&a.addCode(t.i64_store32(t.getLocal("r"),4*(e-r),t.getLocal(h))),[h,p]=[p,h],a.addCode(t.setLocal(p,t.i64_shr_u(t.getLocal(h),t.i64_const(32))))}a.addCode(t.i64_store32(t.getLocal("r"),4*r-4,t.getLocal(h))),a.addCode(t.if(t.i32_wrap_i64(t.getLocal(p)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),t.if(t.call(b+"_gte",t.getLocal("r"),t.i32_const(o)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))))))}(),function(){const a=e.addFunction(i+"_square");a.addParam("x","i32"),a.addParam("r","i32"),a.addLocal("c0","i64"),a.addLocal("c1","i64"),a.addLocal("c0_old","i64"),a.addLocal("c1_old","i64"),a.addLocal("np32","i64");for(let e=0;e>1&&c>1,e>>1)))),a.addCode(t.setLocal(h,t.i64_add(t.getLocal(h),t.i64_shr_u(t.getLocal(u),t.i64_const(32)))))),e>0&&(a.addCode(t.setLocal(u,t.i64_add(t.i64_and(t.getLocal(u),t.i64_const(4294967295)),t.i64_and(t.getLocal(p),t.i64_const(4294967295))))),a.addCode(t.setLocal(h,t.i64_add(t.i64_add(t.getLocal(h),t.i64_shr_u(t.getLocal(u),t.i64_const(32))),t.getLocal(g)))));for(let c=Math.max(1,e-r+1);c<=e&&c=r&&a.addCode(t.i64_store32(t.getLocal("r"),4*(e-r),t.getLocal(u))),a.addCode(t.setLocal(p,t.getLocal(h)),t.setLocal(g,t.i64_shr_u(t.getLocal(p),t.i64_const(32))))}a.addCode(t.i64_store32(t.getLocal("r"),4*r-4,t.getLocal(p))),a.addCode(t.if(t.i32_wrap_i64(t.getLocal(g)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),t.if(t.call(b+"_gte",t.getLocal("r"),t.i32_const(o)),t.drop(t.call(b+"_sub",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))))))}(),function(){const a=e.addFunction(i+"_squareOld");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_mul",t.getLocal("x"),t.getLocal("x"),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_mul",t.getLocal("x"),t.i32_const(s),t.getLocal("r")))}(),function(){const a=e.alloc(2*n),t=e.addFunction(i+"_fromMontgomery");t.addParam("x","i32"),t.addParam("r","i32");const c=t.getCodeBuilder();t.addCode(c.call(b+"_copy",c.getLocal("x"),c.i32_const(a))),t.addCode(c.call(b+"_zero",c.i32_const(a+n))),t.addCode(c.call(i+"_mReduct",c.i32_const(a),c.getLocal("r")))}(),function(){const a=e.addFunction(i+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n));a.addCode(t.call(i+"_fromMontgomery",t.getLocal("x"),c),t.call(b+"_gte",c,t.i32_const(x)))}(),function(){const a=e.addFunction(i+"_sign");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n));a.addCode(t.if(t.call(b+"_isZero",t.getLocal("x")),t.ret(t.i32_const(0))),t.call(i+"_fromMontgomery",t.getLocal("x"),c),t.if(t.call(b+"_gte",c,t.i32_const(x)),t.ret(t.i32_const(-1))),t.ret(t.i32_const(1)))}(),function(){const a=e.addFunction(i+"_inverse");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_fromMontgomery",t.getLocal("x"),t.getLocal("r"))),a.addCode(t.call(b+"_inverseMod",t.getLocal("r"),t.i32_const(o),t.getLocal("r"))),a.addCode(t.call(i+"_toMontgomery",t.getLocal("r"),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_one");a.addParam("pr","i32");const t=a.getCodeBuilder();a.addCode(t.call(b+"_copy",t.i32_const(l),t.getLocal("pr")))}(),function(){const a=e.addFunction(i+"_load");a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32"),a.addLocal("p","i32"),a.addLocal("l","i32"),a.addLocal("i","i32"),a.addLocal("j","i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n)),f=e.alloc(n),d=t.i32_const(f);a.addCode(t.call(b+"_zero",t.getLocal("r")),t.setLocal("i",t.i32_const(n)),t.setLocal("p",t.getLocal("scalar")),t.block(t.loop(t.br_if(1,t.i32_gt_u(t.getLocal("i"),t.getLocal("scalarLen"))),t.if(t.i32_eq(t.getLocal("i"),t.i32_const(n)),t.call(i+"_one",c),t.call(i+"_mul",c,t.i32_const(s),c)),t.call(i+"_mul",t.getLocal("p"),c,d),t.call(i+"_add",t.getLocal("r"),d,t.getLocal("r")),t.setLocal("p",t.i32_add(t.getLocal("p"),t.i32_const(n))),t.setLocal("i",t.i32_add(t.getLocal("i"),t.i32_const(n))),t.br(0))),t.setLocal("l",t.i32_rem_u(t.getLocal("scalarLen"),t.i32_const(n))),t.if(t.i32_eqz(t.getLocal("l")),t.ret([])),t.call(b+"_zero",d),t.setLocal("j",t.i32_const(0)),t.block(t.loop(t.br_if(1,t.i32_eq(t.getLocal("j"),t.getLocal("l"))),t.i32_store8(t.getLocal("j"),f,t.i32_load8_u(t.getLocal("p"))),t.setLocal("p",t.i32_add(t.getLocal("p"),t.i32_const(1))),t.setLocal("j",t.i32_add(t.getLocal("j"),t.i32_const(1))),t.br(0))),t.if(t.i32_eq(t.getLocal("i"),t.i32_const(n)),t.call(i+"_one",c),t.call(i+"_mul",c,t.i32_const(s),c)),t.call(i+"_mul",d,c,d),t.call(i+"_add",t.getLocal("r"),d,t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const t=a.getCodeBuilder(),c=t.i32_const(e.alloc(n));a.addCode(t.call(i+"_load",t.getLocal("scalar"),t.getLocal("scalarLen"),c),t.call(i+"_toMontgomery",c,c),t.call(i+"_mul",t.getLocal("x"),c,t.getLocal("r")))}(),te(e,i),ce(e,i+"_batchToMontgomery",i+"_toMontgomery",n,n),ce(e,i+"_batchFromMontgomery",i+"_fromMontgomery",n,n),ce(e,i+"_batchNeg",i+"_neg",n,n),fe(e,i+"_batchAdd",i+"_add",n,n),fe(e,i+"_batchSub",i+"_sub",n,n),fe(e,i+"_batchMul",i+"_mul",n,n),e.exportFunction(i+"_add"),e.exportFunction(i+"_sub"),e.exportFunction(i+"_neg"),e.exportFunction(i+"_isNegative"),e.exportFunction(i+"_isOne"),e.exportFunction(i+"_sign"),e.exportFunction(i+"_mReduct"),e.exportFunction(i+"_mul"),e.exportFunction(i+"_square"),e.exportFunction(i+"_squareOld"),e.exportFunction(i+"_fromMontgomery"),e.exportFunction(i+"_toMontgomery"),e.exportFunction(i+"_inverse"),e.exportFunction(i+"_one"),e.exportFunction(i+"_load"),e.exportFunction(i+"_timesScalar"),ae(e,i+"_exp",n,i+"_mul",i+"_square",b+"_copy",i+"_one"),e.exportFunction(i+"_exp"),e.exportFunction(i+"_batchInverse"),ie(f)&&(function(){const a=e.addFunction(i+"_sqrt");a.addParam("n","i32"),a.addParam("r","i32"),a.addLocal("m","i32"),a.addLocal("i","i32"),a.addLocal("j","i32");const t=a.getCodeBuilder(),c=t.i32_const(l),f=t.i32_const(e.alloc(n)),d=t.i32_const(e.alloc(n)),r=t.i32_const(e.alloc(n)),b=t.i32_const(e.alloc(n)),o=t.i32_const(e.alloc(n));a.addCode(t.if(t.call(i+"_isZero",t.getLocal("n")),t.ret(t.call(i+"_zero",t.getLocal("r")))),t.setLocal("m",t.i32_const(A)),t.call(i+"_copy",t.i32_const(I),f),t.call(i+"_exp",t.getLocal("n"),t.i32_const(w),t.i32_const(n),d),t.call(i+"_exp",t.getLocal("n"),t.i32_const(C),t.i32_const(n),r),t.block(t.loop(t.br_if(1,t.call(i+"_eq",d,c)),t.call(i+"_square",d,b),t.setLocal("i",t.i32_const(1)),t.block(t.loop(t.br_if(1,t.call(i+"_eq",b,c)),t.call(i+"_square",b,b),t.setLocal("i",t.i32_add(t.getLocal("i"),t.i32_const(1))),t.br(0))),t.call(i+"_copy",f,o),t.setLocal("j",t.i32_sub(t.i32_sub(t.getLocal("m"),t.getLocal("i")),t.i32_const(1))),t.block(t.loop(t.br_if(1,t.i32_eqz(t.getLocal("j"))),t.call(i+"_square",o,o),t.setLocal("j",t.i32_sub(t.getLocal("j"),t.i32_const(1))),t.br(0))),t.setLocal("m",t.getLocal("i")),t.call(i+"_square",o,f),t.call(i+"_mul",d,f,d),t.call(i+"_mul",r,o,r),t.br(0))),t.if(t.call(i+"_isNegative",r),t.call(i+"_neg",r,t.getLocal("r")),t.call(i+"_copy",r,t.getLocal("r"))))}(),function(){const a=e.addFunction(i+"_isSquare");a.addParam("n","i32"),a.setReturnType("i32");const t=a.getCodeBuilder(),c=t.i32_const(l),f=t.i32_const(e.alloc(n));a.addCode(t.if(t.call(i+"_isZero",t.getLocal("n")),t.ret(t.i32_const(1))),t.call(i+"_exp",t.getLocal("n"),t.i32_const(g),t.i32_const(n),f),t.call(i+"_eq",f,c))}(),e.exportFunction(i+"_sqrt"),e.exportFunction(i+"_isSquare")),e.exportFunction(i+"_batchToMontgomery"),e.exportFunction(i+"_batchFromMontgomery"),i};const le=se,{bitLength:ue}=U;var he=function(e,a,t,c,f){const d=BigInt(a),r=Math.floor((ue(d-1n)-1)/64)+1,n=8*r,i=t||"f1";if(e.modules[i])return i;e.modules[i]={n64:r};const b=f||"int",o=le(e,d,c,b),s=e.modules[o].pR2,l=e.modules[o].pq,u=e.modules[o].pePlusOne;return function(){const a=e.alloc(n),t=e.addFunction(i+"_mul");t.addParam("x","i32"),t.addParam("y","i32"),t.addParam("r","i32");const c=t.getCodeBuilder();t.addCode(c.call(o+"_mul",c.getLocal("x"),c.getLocal("y"),c.i32_const(a))),t.addCode(c.call(o+"_mul",c.i32_const(a),c.i32_const(s),c.getLocal("r")))}(),function(){const a=e.addFunction(i+"_square");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(i+"_mul",t.getLocal("x"),t.getLocal("x"),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_inverse");a.addParam("x","i32"),a.addParam("r","i32");const t=a.getCodeBuilder();a.addCode(t.call(b+"_inverseMod",t.getLocal("x"),t.i32_const(l),t.getLocal("r")))}(),function(){const a=e.addFunction(i+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const t=a.getCodeBuilder();a.addCode(t.call(b+"_gte",t.getLocal("x"),t.i32_const(u)))}(),e.exportFunction(o+"_add",i+"_add"),e.exportFunction(o+"_sub",i+"_sub"),e.exportFunction(o+"_neg",i+"_neg"),e.exportFunction(i+"_mul"),e.exportFunction(i+"_square"),e.exportFunction(i+"_inverse"),e.exportFunction(i+"_isNegative"),e.exportFunction(o+"_copy",i+"_copy"),e.exportFunction(o+"_zero",i+"_zero"),e.exportFunction(o+"_one",i+"_one"),e.exportFunction(o+"_isZero",i+"_isZero"),e.exportFunction(o+"_eq",i+"_eq"),i};const pe=D,ge=F,me=T;var xe=function(e,a,t,c){if(e.modules[t])return t;const f=8*e.modules[c].n64,d=e.modules[c].q;return e.modules[t]={n64:2*e.modules[c].n64},function(){const a=e.addFunction(t+"_isZero");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.i32_and(d.call(c+"_isZero",r),d.call(c+"_isZero",n)))}(),function(){const a=e.addFunction(t+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.ret(d.i32_and(d.call(c+"_isOne",r),d.call(c+"_isZero",n))))}(),function(){const a=e.addFunction(t+"_zero");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.call(c+"_zero",r),d.call(c+"_zero",n))}(),function(){const a=e.addFunction(t+"_one");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.call(c+"_one",r),d.call(c+"_zero",n))}(),function(){const a=e.addFunction(t+"_copy");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_copy",r,i),d.call(c+"_copy",n,b))}(),function(){const d=e.addFunction(t+"_mul");d.addParam("x","i32"),d.addParam("y","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.getLocal("y"),o=r.i32_add(r.getLocal("y"),r.i32_const(f)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f)),p=r.i32_const(e.alloc(f)),g=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_mul",n,b,u),r.call(c+"_mul",i,o,h),r.call(c+"_add",n,i,p),r.call(c+"_add",b,o,g),r.call(c+"_mul",p,g,p),r.call(a,h,s),r.call(c+"_add",u,s,s),r.call(c+"_add",u,h,l),r.call(c+"_sub",p,l,l))}(),function(){const a=e.addFunction(t+"_mul1");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_mul",r,i,b),d.call(c+"_mul",n,i,o))}(),function(){const d=e.addFunction(t+"_square");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.getLocal("r"),o=r.i32_add(r.getLocal("r"),r.i32_const(f)),s=r.i32_const(e.alloc(f)),l=r.i32_const(e.alloc(f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_mul",n,i,s),r.call(c+"_add",n,i,l),r.call(a,i,u),r.call(c+"_add",n,u,u),r.call(a,s,h),r.call(c+"_add",h,s,h),r.call(c+"_mul",l,u,b),r.call(c+"_sub",b,h,b),r.call(c+"_add",s,s,o))}(),function(){const a=e.addFunction(t+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.i32_add(d.getLocal("y"),d.i32_const(f)),o=d.getLocal("r"),s=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_add",r,i,o),d.call(c+"_add",n,b,s))}(),function(){const a=e.addFunction(t+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.i32_add(d.getLocal("y"),d.i32_const(f)),o=d.getLocal("r"),s=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_sub",r,i,o),d.call(c+"_sub",n,b,s))}(),function(){const a=e.addFunction(t+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_neg",r,i),d.call(c+"_neg",n,b))}(),function(){const a=e.addFunction(t+"_conjugate");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_copy",r,i),d.call(c+"_neg",n,b))}(),function(){const a=e.addFunction(t+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_toMontgomery",r,i),d.call(c+"_toMontgomery",n,b))}(),function(){const a=e.addFunction(t+"_fromMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_fromMontgomery",r,i),d.call(c+"_fromMontgomery",n,b))}(),function(){const a=e.addFunction(t+"_eq");a.addParam("x","i32"),a.addParam("y","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("y"),b=d.i32_add(d.getLocal("y"),d.i32_const(f));a.addCode(d.i32_and(d.call(c+"_eq",r,i),d.call(c+"_eq",n,b)))}(),function(){const d=e.addFunction(t+"_inverse");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.getLocal("r"),o=r.i32_add(r.getLocal("r"),r.i32_const(f)),s=r.i32_const(e.alloc(f)),l=r.i32_const(e.alloc(f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_square",n,s),r.call(c+"_square",i,l),r.call(a,l,u),r.call(c+"_sub",s,u,u),r.call(c+"_inverse",u,h),r.call(c+"_mul",n,h,b),r.call(c+"_mul",i,h,o),r.call(c+"_neg",o,o))}(),function(){const a=e.addFunction(t+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.getLocal("r"),b=d.i32_add(d.getLocal("r"),d.i32_const(f));a.addCode(d.call(c+"_timesScalar",r,d.getLocal("scalar"),d.getLocal("scalarLen"),i),d.call(c+"_timesScalar",n,d.getLocal("scalar"),d.getLocal("scalarLen"),b))}(),function(){const a=e.addFunction(t+"_sign");a.addParam("x","i32"),a.addLocal("s","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.setLocal("s",d.call(c+"_sign",n)),d.if(d.getLocal("s"),d.ret(d.getLocal("s"))),d.ret(d.call(c+"_sign",r)))}(),function(){const a=e.addFunction(t+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f));a.addCode(d.if(d.call(c+"_isZero",n),d.ret(d.call(c+"_isNegative",r))),d.ret(d.call(c+"_isNegative",n)))}(),e.exportFunction(t+"_isZero"),e.exportFunction(t+"_isOne"),e.exportFunction(t+"_zero"),e.exportFunction(t+"_one"),e.exportFunction(t+"_copy"),e.exportFunction(t+"_mul"),e.exportFunction(t+"_mul1"),e.exportFunction(t+"_square"),e.exportFunction(t+"_add"),e.exportFunction(t+"_sub"),e.exportFunction(t+"_neg"),e.exportFunction(t+"_sign"),e.exportFunction(t+"_conjugate"),e.exportFunction(t+"_fromMontgomery"),e.exportFunction(t+"_toMontgomery"),e.exportFunction(t+"_eq"),e.exportFunction(t+"_inverse"),ge(e,t),pe(e,t+"_exp",2*f,t+"_mul",t+"_square",t+"_copy",t+"_one"),function(){const a=e.addFunction(t+"_sqrt");a.addParam("a","i32"),a.addParam("pr","i32");const r=a.getCodeBuilder(),n=r.i32_const(e.alloc(me.bigInt2BytesLE((BigInt(d||0)-3n)/4n,f))),i=r.i32_const(e.alloc(me.bigInt2BytesLE((BigInt(d||0)-1n)/2n,f))),b=r.getLocal("a"),o=r.i32_const(e.alloc(2*f)),s=r.i32_const(e.alloc(2*f)),l=r.i32_const(e.alloc(2*f)),u=e.alloc(2*f),h=r.i32_const(u),p=r.i32_const(u),g=r.i32_const(u+f),m=r.i32_const(e.alloc(2*f)),x=r.i32_const(e.alloc(2*f));a.addCode(r.call(t+"_one",h),r.call(t+"_neg",h,h),r.call(t+"_exp",b,n,r.i32_const(f),o),r.call(t+"_square",o,s),r.call(t+"_mul",b,s,s),r.call(t+"_conjugate",s,l),r.call(t+"_mul",l,s,l),r.if(r.call(t+"_eq",l,h),r.unreachable()),r.call(t+"_mul",o,b,m),r.if(r.call(t+"_eq",s,h),[...r.call(c+"_zero",p),...r.call(c+"_one",g),...r.call(t+"_mul",h,m,r.getLocal("pr"))],[...r.call(t+"_one",x),...r.call(t+"_add",x,s,x),...r.call(t+"_exp",x,i,r.i32_const(f),x),...r.call(t+"_mul",x,m,r.getLocal("pr"))]))}(),function(){const a=e.addFunction(t+"_isSquare");a.addParam("a","i32"),a.setReturnType("i32");const c=a.getCodeBuilder(),r=c.i32_const(e.alloc(me.bigInt2BytesLE((BigInt(d||0)-3n)/4n,f))),n=c.getLocal("a"),i=c.i32_const(e.alloc(2*f)),b=c.i32_const(e.alloc(2*f)),o=c.i32_const(e.alloc(2*f)),s=e.alloc(2*f),l=c.i32_const(s);a.addCode(c.call(t+"_one",l),c.call(t+"_neg",l,l),c.call(t+"_exp",n,r,c.i32_const(f),i),c.call(t+"_square",i,b),c.call(t+"_mul",n,b,b),c.call(t+"_conjugate",b,o),c.call(t+"_mul",o,b,o),c.if(c.call(t+"_eq",o,l),c.ret(c.i32_const(0))),c.ret(c.i32_const(1)))}(),e.exportFunction(t+"_exp"),e.exportFunction(t+"_timesScalar"),e.exportFunction(t+"_batchInverse"),e.exportFunction(t+"_sqrt"),e.exportFunction(t+"_isSquare"),e.exportFunction(t+"_isNegative"),t};const ye=D,Ae=F;var ve=function(e,a,t,c){if(e.modules[t])return t;const f=8*e.modules[c].n64;return e.modules[t]={n64:3*e.modules[c].n64},function(){const a=e.addFunction(t+"_isZero");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.i32_and(d.i32_and(d.call(c+"_isZero",r),d.call(c+"_isZero",n)),d.call(c+"_isZero",i)))}(),function(){const a=e.addFunction(t+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.ret(d.i32_and(d.i32_and(d.call(c+"_isOne",r),d.call(c+"_isZero",n)),d.call(c+"_isZero",i))))}(),function(){const a=e.addFunction(t+"_zero");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.call(c+"_zero",r),d.call(c+"_zero",n),d.call(c+"_zero",i))}(),function(){const a=e.addFunction(t+"_one");a.addParam("x","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.call(c+"_one",r),d.call(c+"_zero",n),d.call(c+"_zero",i))}(),function(){const a=e.addFunction(t+"_copy");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_copy",r,b),d.call(c+"_copy",n,o),d.call(c+"_copy",i,s))}(),function(){const d=e.addFunction(t+"_mul");d.addParam("x","i32"),d.addParam("y","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.i32_add(r.getLocal("x"),r.i32_const(2*f)),o=r.getLocal("y"),s=r.i32_add(r.getLocal("y"),r.i32_const(f)),l=r.i32_add(r.getLocal("y"),r.i32_const(2*f)),u=r.getLocal("r"),h=r.i32_add(r.getLocal("r"),r.i32_const(f)),p=r.i32_add(r.getLocal("r"),r.i32_const(2*f)),g=r.i32_const(e.alloc(f)),m=r.i32_const(e.alloc(f)),x=r.i32_const(e.alloc(f)),y=r.i32_const(e.alloc(f)),A=r.i32_const(e.alloc(f)),v=r.i32_const(e.alloc(f)),w=r.i32_const(e.alloc(f)),_=r.i32_const(e.alloc(f)),I=r.i32_const(e.alloc(f)),E=r.i32_const(e.alloc(f)),C=r.i32_const(e.alloc(f)),M=r.i32_const(e.alloc(f)),B=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_mul",n,o,g),r.call(c+"_mul",i,s,m),r.call(c+"_mul",b,l,x),r.call(c+"_add",n,i,y),r.call(c+"_add",o,s,A),r.call(c+"_add",n,b,v),r.call(c+"_add",o,l,w),r.call(c+"_add",i,b,_),r.call(c+"_add",s,l,I),r.call(c+"_add",g,m,E),r.call(c+"_add",g,x,C),r.call(c+"_add",m,x,M),r.call(c+"_mul",_,I,u),r.call(c+"_sub",u,M,u),r.call(a,u,u),r.call(c+"_add",g,u,u),r.call(c+"_mul",y,A,h),r.call(c+"_sub",h,E,h),r.call(a,x,B),r.call(c+"_add",h,B,h),r.call(c+"_mul",v,w,p),r.call(c+"_sub",p,C,p),r.call(c+"_add",p,m,p))}(),function(){const d=e.addFunction(t+"_square");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.i32_add(r.getLocal("x"),r.i32_const(2*f)),o=r.getLocal("r"),s=r.i32_add(r.getLocal("r"),r.i32_const(f)),l=r.i32_add(r.getLocal("r"),r.i32_const(2*f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f)),p=r.i32_const(e.alloc(f)),g=r.i32_const(e.alloc(f)),m=r.i32_const(e.alloc(f)),x=r.i32_const(e.alloc(f)),y=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_square",n,u),r.call(c+"_mul",n,i,h),r.call(c+"_add",h,h,p),r.call(c+"_sub",n,i,g),r.call(c+"_add",g,b,g),r.call(c+"_square",g,g),r.call(c+"_mul",i,b,m),r.call(c+"_add",m,m,x),r.call(c+"_square",b,y),r.call(a,x,o),r.call(c+"_add",u,o,o),r.call(a,y,s),r.call(c+"_add",p,s,s),r.call(c+"_add",u,y,l),r.call(c+"_sub",x,l,l),r.call(c+"_add",g,l,l),r.call(c+"_add",p,l,l))}(),function(){const a=e.addFunction(t+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("y"),o=d.i32_add(d.getLocal("y"),d.i32_const(f)),s=d.i32_add(d.getLocal("y"),d.i32_const(2*f)),l=d.getLocal("r"),u=d.i32_add(d.getLocal("r"),d.i32_const(f)),h=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_add",r,b,l),d.call(c+"_add",n,o,u),d.call(c+"_add",i,s,h))}(),function(){const a=e.addFunction(t+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("y"),o=d.i32_add(d.getLocal("y"),d.i32_const(f)),s=d.i32_add(d.getLocal("y"),d.i32_const(2*f)),l=d.getLocal("r"),u=d.i32_add(d.getLocal("r"),d.i32_const(f)),h=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_sub",r,b,l),d.call(c+"_sub",n,o,u),d.call(c+"_sub",i,s,h))}(),function(){const a=e.addFunction(t+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_neg",r,b),d.call(c+"_neg",n,o),d.call(c+"_neg",i,s))}(),function(){const a=e.addFunction(t+"_sign");a.addParam("x","i32"),a.addLocal("s","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.setLocal("s",d.call(c+"_sign",i)),d.if(d.getLocal("s"),d.ret(d.getLocal("s"))),d.setLocal("s",d.call(c+"_sign",n)),d.if(d.getLocal("s"),d.ret(d.getLocal("s"))),d.ret(d.call(c+"_sign",r)))}(),function(){const a=e.addFunction(t+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_toMontgomery",r,b),d.call(c+"_toMontgomery",n,o),d.call(c+"_toMontgomery",i,s))}(),function(){const a=e.addFunction(t+"_fromMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_fromMontgomery",r,b),d.call(c+"_fromMontgomery",n,o),d.call(c+"_fromMontgomery",i,s))}(),function(){const a=e.addFunction(t+"_eq");a.addParam("x","i32"),a.addParam("y","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("y"),o=d.i32_add(d.getLocal("y"),d.i32_const(f)),s=d.i32_add(d.getLocal("y"),d.i32_const(2*f));a.addCode(d.i32_and(d.i32_and(d.call(c+"_eq",r,b),d.call(c+"_eq",n,o)),d.call(c+"_eq",i,s)))}(),function(){const d=e.addFunction(t+"_inverse");d.addParam("x","i32"),d.addParam("r","i32");const r=d.getCodeBuilder(),n=r.getLocal("x"),i=r.i32_add(r.getLocal("x"),r.i32_const(f)),b=r.i32_add(r.getLocal("x"),r.i32_const(2*f)),o=r.getLocal("r"),s=r.i32_add(r.getLocal("r"),r.i32_const(f)),l=r.i32_add(r.getLocal("r"),r.i32_const(2*f)),u=r.i32_const(e.alloc(f)),h=r.i32_const(e.alloc(f)),p=r.i32_const(e.alloc(f)),g=r.i32_const(e.alloc(f)),m=r.i32_const(e.alloc(f)),x=r.i32_const(e.alloc(f)),y=r.i32_const(e.alloc(f)),A=r.i32_const(e.alloc(f)),v=r.i32_const(e.alloc(f)),w=r.i32_const(e.alloc(f)),_=r.i32_const(e.alloc(f));d.addCode(r.call(c+"_square",n,u),r.call(c+"_square",i,h),r.call(c+"_square",b,p),r.call(c+"_mul",n,i,g),r.call(c+"_mul",n,b,m),r.call(c+"_mul",i,b,x),r.call(a,x,y),r.call(c+"_sub",u,y,y),r.call(a,p,A),r.call(c+"_sub",A,g,A),r.call(c+"_sub",h,m,v),r.call(c+"_mul",b,A,w),r.call(c+"_mul",i,v,_),r.call(c+"_add",w,_,w),r.call(a,w,w),r.call(c+"_mul",n,y,_),r.call(c+"_add",_,w,w),r.call(c+"_inverse",w,w),r.call(c+"_mul",w,y,o),r.call(c+"_mul",w,A,s),r.call(c+"_mul",w,v,l))}(),function(){const a=e.addFunction(t+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f)),b=d.getLocal("r"),o=d.i32_add(d.getLocal("r"),d.i32_const(f)),s=d.i32_add(d.getLocal("r"),d.i32_const(2*f));a.addCode(d.call(c+"_timesScalar",r,d.getLocal("scalar"),d.getLocal("scalarLen"),b),d.call(c+"_timesScalar",n,d.getLocal("scalar"),d.getLocal("scalarLen"),o),d.call(c+"_timesScalar",i,d.getLocal("scalar"),d.getLocal("scalarLen"),s))}(),function(){const a=e.addFunction(t+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const d=a.getCodeBuilder(),r=d.getLocal("x"),n=d.i32_add(d.getLocal("x"),d.i32_const(f)),i=d.i32_add(d.getLocal("x"),d.i32_const(2*f));a.addCode(d.if(d.call(c+"_isZero",i),d.if(d.call(c+"_isZero",n),d.ret(d.call(c+"_isNegative",r)),d.ret(d.call(c+"_isNegative",n)))),d.ret(d.call(c+"_isNegative",i)))}(),e.exportFunction(t+"_isZero"),e.exportFunction(t+"_isOne"),e.exportFunction(t+"_zero"),e.exportFunction(t+"_one"),e.exportFunction(t+"_copy"),e.exportFunction(t+"_mul"),e.exportFunction(t+"_square"),e.exportFunction(t+"_add"),e.exportFunction(t+"_sub"),e.exportFunction(t+"_neg"),e.exportFunction(t+"_sign"),e.exportFunction(t+"_fromMontgomery"),e.exportFunction(t+"_toMontgomery"),e.exportFunction(t+"_eq"),e.exportFunction(t+"_inverse"),Ae(e,t),ye(e,t+"_exp",3*f,t+"_mul",t+"_square",t+"_copy",t+"_one"),e.exportFunction(t+"_exp"),e.exportFunction(t+"_timesScalar"),e.exportFunction(t+"_batchInverse"),e.exportFunction(t+"_isNegative"),t};const we=function(e,a,t,c,f,d,r,n){const i=e.addFunction(a);i.addParam("base","i32"),i.addParam("scalar","i32"),i.addParam("scalarLength","i32"),i.addParam("r","i32"),i.addLocal("old0","i32"),i.addLocal("nbits","i32"),i.addLocal("i","i32"),i.addLocal("last","i32"),i.addLocal("cur","i32"),i.addLocal("carry","i32"),i.addLocal("p","i32");const b=i.getCodeBuilder(),o=b.i32_const(e.alloc(t));function s(e){return b.i32_and(b.i32_shr_u(b.i32_load(b.i32_add(b.getLocal("scalar"),b.i32_and(b.i32_shr_u(e,b.i32_const(3)),b.i32_const(4294967292)))),b.i32_and(e,b.i32_const(31))),b.i32_const(1))}function l(e){return[...b.i32_store8(b.getLocal("p"),b.i32_const(e)),...b.setLocal("p",b.i32_add(b.getLocal("p"),b.i32_const(1)))]}i.addCode(b.if(b.i32_eqz(b.getLocal("scalarLength")),[...b.call(n,b.getLocal("r")),...b.ret([])]),b.setLocal("nbits",b.i32_shl(b.getLocal("scalarLength"),b.i32_const(3))),b.setLocal("old0",b.i32_load(b.i32_const(0))),b.setLocal("p",b.getLocal("old0")),b.i32_store(b.i32_const(0),b.i32_and(b.i32_add(b.i32_add(b.getLocal("old0"),b.i32_const(32)),b.getLocal("nbits")),b.i32_const(4294967288))),b.setLocal("i",b.i32_const(1)),b.setLocal("last",s(b.i32_const(0))),b.setLocal("carry",b.i32_const(0)),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("i"),b.getLocal("nbits"))),b.setLocal("cur",s(b.getLocal("i"))),b.if(b.getLocal("last"),b.if(b.getLocal("cur"),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(1)],[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(255)]),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(255)],[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(0)),...l(1)])),b.if(b.getLocal("cur"),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(1)),...l(0)],[...b.setLocal("last",b.i32_const(1)),...b.setLocal("carry",b.i32_const(0)),...l(0)]),b.if(b.getLocal("carry"),[...b.setLocal("last",b.i32_const(1)),...b.setLocal("carry",b.i32_const(0)),...l(0)],[...b.setLocal("last",b.i32_const(0)),...b.setLocal("carry",b.i32_const(0)),...l(0)]))),b.setLocal("i",b.i32_add(b.getLocal("i"),b.i32_const(1))),b.br(0))),b.if(b.getLocal("last"),b.if(b.getLocal("carry"),[...l(255),...l(0),...l(1)],[...l(1)]),b.if(b.getLocal("carry"),[...l(0),...l(1)])),b.setLocal("p",b.i32_sub(b.getLocal("p"),b.i32_const(1))),b.call(r,b.getLocal("base"),o),b.call(n,b.getLocal("r")),b.block(b.loop(b.call(f,b.getLocal("r"),b.getLocal("r")),b.setLocal("cur",b.i32_load8_u(b.getLocal("p"))),b.if(b.getLocal("cur"),b.if(b.i32_eq(b.getLocal("cur"),b.i32_const(1)),b.call(c,b.getLocal("r"),o,b.getLocal("r")),b.call(d,b.getLocal("r"),o,b.getLocal("r")))),b.br_if(1,b.i32_eq(b.getLocal("old0"),b.getLocal("p"))),b.setLocal("p",b.i32_sub(b.getLocal("p"),b.i32_const(1))),b.br(0))),b.i32_store(b.i32_const(0),b.getLocal("old0")))},_e=Q,Ie=function(e,a,t,c,f){const d=8*e.modules[a].n64;!function(){const a=e.addFunction(t+"_getChunk");a.addParam("pScalar","i32"),a.addParam("scalarSize","i32"),a.addParam("startBit","i32"),a.addParam("chunkSize","i32"),a.addLocal("bitsToEnd","i32"),a.addLocal("mask","i32"),a.setReturnType("i32");const c=a.getCodeBuilder();a.addCode(c.setLocal("bitsToEnd",c.i32_sub(c.i32_mul(c.getLocal("scalarSize"),c.i32_const(8)),c.getLocal("startBit"))),c.if(c.i32_gt_s(c.getLocal("chunkSize"),c.getLocal("bitsToEnd")),c.setLocal("mask",c.i32_sub(c.i32_shl(c.i32_const(1),c.getLocal("bitsToEnd")),c.i32_const(1))),c.setLocal("mask",c.i32_sub(c.i32_shl(c.i32_const(1),c.getLocal("chunkSize")),c.i32_const(1)))),c.i32_and(c.i32_shr_u(c.i32_load(c.i32_add(c.getLocal("pScalar"),c.i32_shr_u(c.getLocal("startBit"),c.i32_const(3))),0,0),c.i32_and(c.getLocal("startBit"),c.i32_const(7))),c.getLocal("mask")))}(),function(){const c=e.addFunction(t+"_reduceTable");c.addParam("pTable","i32"),c.addParam("p","i32"),c.addLocal("half","i32"),c.addLocal("it1","i32"),c.addLocal("it2","i32"),c.addLocal("pAcc","i32");const f=c.getCodeBuilder();c.addCode(f.if(f.i32_eq(f.getLocal("p"),f.i32_const(1)),f.ret([])),f.setLocal("half",f.i32_shl(f.i32_const(1),f.i32_sub(f.getLocal("p"),f.i32_const(1)))),f.setLocal("it1",f.getLocal("pTable")),f.setLocal("it2",f.i32_add(f.getLocal("pTable"),f.i32_mul(f.getLocal("half"),f.i32_const(d)))),f.setLocal("pAcc",f.i32_sub(f.getLocal("it2"),f.i32_const(d))),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("it1"),f.getLocal("pAcc"))),f.call(a+"_add",f.getLocal("it1"),f.getLocal("it2"),f.getLocal("it1")),f.call(a+"_add",f.getLocal("pAcc"),f.getLocal("it2"),f.getLocal("pAcc")),f.setLocal("it1",f.i32_add(f.getLocal("it1"),f.i32_const(d))),f.setLocal("it2",f.i32_add(f.getLocal("it2"),f.i32_const(d))),f.br(0))),f.call(t+"_reduceTable",f.getLocal("pTable"),f.i32_sub(f.getLocal("p"),f.i32_const(1))),f.setLocal("p",f.i32_sub(f.getLocal("p"),f.i32_const(1))),f.block(f.loop(f.br_if(1,f.i32_eqz(f.getLocal("p"))),f.call(a+"_double",f.getLocal("pAcc"),f.getLocal("pAcc")),f.setLocal("p",f.i32_sub(f.getLocal("p"),f.i32_const(1))),f.br(0))),f.call(a+"_add",f.getLocal("pTable"),f.getLocal("pAcc"),f.getLocal("pTable")))}(),function(){const r=e.addFunction(t+"_chunk");r.addParam("pBases","i32"),r.addParam("pScalars","i32"),r.addParam("scalarSize","i32"),r.addParam("n","i32"),r.addParam("startBit","i32"),r.addParam("chunkSize","i32"),r.addParam("pr","i32"),r.addLocal("nChunks","i32"),r.addLocal("itScalar","i32"),r.addLocal("endScalar","i32"),r.addLocal("itBase","i32"),r.addLocal("i","i32"),r.addLocal("j","i32"),r.addLocal("nTable","i32"),r.addLocal("pTable","i32"),r.addLocal("idx","i32"),r.addLocal("pIdxTable","i32");const n=r.getCodeBuilder();r.addCode(n.if(n.i32_eqz(n.getLocal("n")),[...n.call(a+"_zero",n.getLocal("pr")),...n.ret([])]),n.setLocal("nTable",n.i32_shl(n.i32_const(1),n.getLocal("chunkSize"))),n.setLocal("pTable",n.i32_load(n.i32_const(0))),n.i32_store(n.i32_const(0),n.i32_add(n.getLocal("pTable"),n.i32_mul(n.getLocal("nTable"),n.i32_const(d)))),n.setLocal("j",n.i32_const(0)),n.block(n.loop(n.br_if(1,n.i32_eq(n.getLocal("j"),n.getLocal("nTable"))),n.call(a+"_zero",n.i32_add(n.getLocal("pTable"),n.i32_mul(n.getLocal("j"),n.i32_const(d)))),n.setLocal("j",n.i32_add(n.getLocal("j"),n.i32_const(1))),n.br(0))),n.setLocal("itBase",n.getLocal("pBases")),n.setLocal("itScalar",n.getLocal("pScalars")),n.setLocal("endScalar",n.i32_add(n.getLocal("pScalars"),n.i32_mul(n.getLocal("n"),n.getLocal("scalarSize")))),n.block(n.loop(n.br_if(1,n.i32_eq(n.getLocal("itScalar"),n.getLocal("endScalar"))),n.setLocal("idx",n.call(t+"_getChunk",n.getLocal("itScalar"),n.getLocal("scalarSize"),n.getLocal("startBit"),n.getLocal("chunkSize"))),n.if(n.getLocal("idx"),[...n.setLocal("pIdxTable",n.i32_add(n.getLocal("pTable"),n.i32_mul(n.i32_sub(n.getLocal("idx"),n.i32_const(1)),n.i32_const(d)))),...n.call(c,n.getLocal("pIdxTable"),n.getLocal("itBase"),n.getLocal("pIdxTable"))]),n.setLocal("itScalar",n.i32_add(n.getLocal("itScalar"),n.getLocal("scalarSize"))),n.setLocal("itBase",n.i32_add(n.getLocal("itBase"),n.i32_const(f))),n.br(0))),n.call(t+"_reduceTable",n.getLocal("pTable"),n.getLocal("chunkSize")),n.call(a+"_copy",n.getLocal("pTable"),n.getLocal("pr")),n.i32_store(n.i32_const(0),n.getLocal("pTable")))}(),function(){const c=e.addFunction(t);c.addParam("pBases","i32"),c.addParam("pScalars","i32"),c.addParam("scalarSize","i32"),c.addParam("n","i32"),c.addParam("pr","i32"),c.addLocal("chunkSize","i32"),c.addLocal("nChunks","i32"),c.addLocal("itScalar","i32"),c.addLocal("endScalar","i32"),c.addLocal("itBase","i32"),c.addLocal("itBit","i32"),c.addLocal("i","i32"),c.addLocal("j","i32"),c.addLocal("nTable","i32"),c.addLocal("pTable","i32"),c.addLocal("idx","i32"),c.addLocal("pIdxTable","i32");const f=c.getCodeBuilder(),r=f.i32_const(e.alloc(d)),n=e.alloc([17,17,17,17,17,17,17,17,17,17,16,16,15,14,13,13,12,11,10,9,8,7,7,6,5,4,3,2,1,1,1,1]);c.addCode(f.call(a+"_zero",f.getLocal("pr")),f.if(f.i32_eqz(f.getLocal("n")),f.ret([])),f.setLocal("chunkSize",f.i32_load8_u(f.i32_clz(f.getLocal("n")),n)),f.setLocal("nChunks",f.i32_add(f.i32_div_u(f.i32_sub(f.i32_shl(f.getLocal("scalarSize"),f.i32_const(3)),f.i32_const(1)),f.getLocal("chunkSize")),f.i32_const(1))),f.setLocal("itBit",f.i32_mul(f.i32_sub(f.getLocal("nChunks"),f.i32_const(1)),f.getLocal("chunkSize"))),f.block(f.loop(f.br_if(1,f.i32_lt_s(f.getLocal("itBit"),f.i32_const(0))),f.if(f.i32_eqz(f.call(a+"_isZero",f.getLocal("pr"))),[...f.setLocal("j",f.i32_const(0)),...f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("j"),f.getLocal("chunkSize"))),f.call(a+"_double",f.getLocal("pr"),f.getLocal("pr")),f.setLocal("j",f.i32_add(f.getLocal("j"),f.i32_const(1))),f.br(0)))]),f.call(t+"_chunk",f.getLocal("pBases"),f.getLocal("pScalars"),f.getLocal("scalarSize"),f.getLocal("n"),f.getLocal("itBit"),f.getLocal("chunkSize"),r),f.call(a+"_add",f.getLocal("pr"),r,f.getLocal("pr")),f.setLocal("itBit",f.i32_sub(f.getLocal("itBit"),f.getLocal("chunkSize"))),f.br(0))))}(),e.exportFunction(t),e.exportFunction(t+"_chunk")};var Ee=function(e,a,t,c){const f=e.modules[t].n64,d=8*f;return e.modules[a]||(e.modules[a]={n64:3*f},function(){const c=e.addFunction(a+"_isZeroAffine");c.addParam("p1","i32"),c.setReturnType("i32");const f=c.getCodeBuilder();c.addCode(f.i32_and(f.call(t+"_isZero",f.getLocal("p1")),f.call(t+"_isZero",f.i32_add(f.getLocal("p1"),f.i32_const(d)))))}(),function(){const c=e.addFunction(a+"_isZero");c.addParam("p1","i32"),c.setReturnType("i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_isZero",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))))}(),function(){const c=e.addFunction(a+"_zeroAffine");c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_zero",f.getLocal("pr"))),c.addCode(f.call(t+"_zero",f.i32_add(f.getLocal("pr"),f.i32_const(d))))}(),function(){const c=e.addFunction(a+"_zero");c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_zero",f.getLocal("pr"))),c.addCode(f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(d)))),c.addCode(f.call(t+"_zero",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))))}(),function(){const t=e.addFunction(a+"_copyAffine");t.addParam("ps","i32"),t.addParam("pd","i32");const c=t.getCodeBuilder();for(let e=0;e<2*f;e++)t.addCode(c.i64_store(c.getLocal("pd"),8*e,c.i64_load(c.getLocal("ps"),8*e)))}(),function(){const t=e.addFunction(a+"_copy");t.addParam("ps","i32"),t.addParam("pd","i32");const c=t.getCodeBuilder();for(let e=0;e<3*f;e++)t.addCode(c.i64_store(c.getLocal("pd"),8*e,c.i64_load(c.getLocal("ps"),8*e)))}(),function(){const c=e.addFunction(a+"_toJacobian");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.getLocal("pr"),b=f.i32_add(f.getLocal("pr"),f.i32_const(d)),o=f.i32_add(f.getLocal("pr"),f.i32_const(2*d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("p1")),f.call(a+"_zero",f.getLocal("pr")),[...f.call(t+"_one",o),...f.call(t+"_copy",n,b),...f.call(t+"_copy",r,i)]))}(),function(){const c=e.addFunction(a+"_eqAffine");c.addParam("p1","i32"),c.addParam("p2","i32"),c.setReturnType("i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder();c.addCode(f.ret(f.i32_and(f.call(t+"_eq",f.getLocal("p1"),f.getLocal("p2")),f.call(t+"_eq",f.i32_add(f.getLocal("p1"),f.i32_const(d)),f.i32_add(f.getLocal("p2"),f.i32_const(d))))))}(),function(){const c=e.addFunction(a+"_eqMixed");c.addParam("p1","i32"),c.addParam("p2","i32"),c.setReturnType("i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d)),s=f.i32_const(e.alloc(d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),f.ret(f.call(a+"_isZeroAffine",f.getLocal("p2")))),f.if(f.call(a+"_isZeroAffine",f.getLocal("p2")),f.ret(f.i32_const(0))),f.if(f.call(t+"_isOne",i),f.ret(f.call(a+"_eqAffine",f.getLocal("p1"),f.getLocal("p2")))),f.call(t+"_square",i,s),f.call(t+"_mul",b,s,l),f.call(t+"_mul",i,s,u),f.call(t+"_mul",o,u,h),f.if(f.call(t+"_eq",r,l),f.if(f.call(t+"_eq",n,h),f.ret(f.i32_const(1)))),f.ret(f.i32_const(0)))}(),function(){const c=e.addFunction(a+"_eq");c.addParam("p1","i32"),c.addParam("p2","i32"),c.setReturnType("i32"),c.addLocal("z1","i32"),c.addLocal("z2","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d));c.addCode(f.setLocal("z2",f.i32_add(f.getLocal("p2"),f.i32_const(2*d))));const s=f.getLocal("z2"),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),f.ret(f.call(a+"_isZero",f.getLocal("p2")))),f.if(f.call(a+"_isZero",f.getLocal("p2")),f.ret(f.i32_const(0))),f.if(f.call(t+"_isOne",i),f.ret(f.call(a+"_eqMixed",f.getLocal("p2"),f.getLocal("p1")))),f.if(f.call(t+"_isOne",s),f.ret(f.call(a+"_eqMixed",f.getLocal("p1"),f.getLocal("p2")))),f.call(t+"_square",i,l),f.call(t+"_square",s,u),f.call(t+"_mul",r,u,h),f.call(t+"_mul",b,l,p),f.call(t+"_mul",i,l,g),f.call(t+"_mul",s,u,m),f.call(t+"_mul",n,m,x),f.call(t+"_mul",o,g,y),f.if(f.call(t+"_eq",h,p),f.if(f.call(t+"_eq",x,y),f.ret(f.i32_const(1)))),f.ret(f.i32_const(0)))}(),function(){const c=e.addFunction(a+"_doubleAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.getLocal("pr"),b=f.i32_add(f.getLocal("pr"),f.i32_const(d)),o=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),s=f.i32_const(e.alloc(d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("p1")),[...f.call(a+"_toJacobian",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.call(t+"_square",r,s),f.call(t+"_square",n,l),f.call(t+"_square",l,u),f.call(t+"_add",r,l,h),f.call(t+"_square",h,h),f.call(t+"_sub",h,s,h),f.call(t+"_sub",h,u,h),f.call(t+"_add",h,h,h),f.call(t+"_add",s,s,p),f.call(t+"_add",p,s,p),f.call(t+"_add",n,n,o),f.call(t+"_square",p,i),f.call(t+"_sub",i,h,i),f.call(t+"_sub",i,h,i),f.call(t+"_add",u,u,g),f.call(t+"_add",g,g,g),f.call(t+"_add",g,g,g),f.call(t+"_sub",h,i,b),f.call(t+"_mul",b,p,b),f.call(t+"_sub",b,g,b))}(),function(){const c=e.addFunction(a+"_double");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(a+"_copy",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(t+"_isOne",i),[...f.ret(f.call(a+"_doubleAffine",f.getLocal("p1"),f.getLocal("pr"))),...f.ret([])]),f.call(t+"_square",r,l),f.call(t+"_square",n,u),f.call(t+"_square",u,h),f.call(t+"_add",r,u,p),f.call(t+"_square",p,p),f.call(t+"_sub",p,l,p),f.call(t+"_sub",p,h,p),f.call(t+"_add",p,p,p),f.call(t+"_add",l,l,g),f.call(t+"_add",g,l,g),f.call(t+"_square",g,m),f.call(t+"_mul",n,i,x),f.call(t+"_add",p,p,b),f.call(t+"_sub",m,b,b),f.call(t+"_add",h,h,y),f.call(t+"_add",y,y,y),f.call(t+"_add",y,y,y),f.call(t+"_sub",p,b,o),f.call(t+"_mul",o,g,o),f.call(t+"_sub",o,y,o),f.call(t+"_add",x,x,s))}(),function(){const c=e.addFunction(a+"_addAffine");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("p2"),b=f.i32_add(f.getLocal("p2"),f.i32_const(d)),o=f.getLocal("pr"),s=f.i32_add(f.getLocal("pr"),f.i32_const(d)),l=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),A=f.i32_const(e.alloc(d)),v=f.i32_const(e.alloc(d)),w=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("p1")),[...f.call(a+"_copyAffine",f.getLocal("p2"),f.getLocal("pr")),...f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))),...f.ret([])]),f.if(f.call(a+"_isZeroAffine",f.getLocal("p2")),[...f.call(a+"_copyAffine",f.getLocal("p1"),f.getLocal("pr")),...f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))),...f.ret([])]),f.if(f.call(t+"_eq",r,i),f.if(f.call(t+"_eq",n,b),[...f.call(a+"_doubleAffine",f.getLocal("p2"),f.getLocal("pr")),...f.ret([])])),f.call(t+"_sub",i,r,u),f.call(t+"_sub",b,n,p),f.call(t+"_square",u,h),f.call(t+"_add",h,h,g),f.call(t+"_add",g,g,g),f.call(t+"_mul",u,g,m),f.call(t+"_add",p,p,x),f.call(t+"_mul",r,g,A),f.call(t+"_square",x,y),f.call(t+"_add",A,A,v),f.call(t+"_sub",y,m,o),f.call(t+"_sub",o,v,o),f.call(t+"_mul",n,m,w),f.call(t+"_add",w,w,w),f.call(t+"_sub",A,o,s),f.call(t+"_mul",s,x,s),f.call(t+"_sub",s,w,s),f.call(t+"_add",u,u,l))}(),function(){const c=e.addFunction(a+"_addMixed");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32"),c.addLocal("z1","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d)),s=f.getLocal("pr"),l=f.i32_add(f.getLocal("pr"),f.i32_const(d)),u=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),h=f.i32_const(e.alloc(d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),A=f.i32_const(e.alloc(d)),v=f.i32_const(e.alloc(d)),w=f.i32_const(e.alloc(d)),_=f.i32_const(e.alloc(d)),I=f.i32_const(e.alloc(d)),E=f.i32_const(e.alloc(d)),C=f.i32_const(e.alloc(d)),M=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(a+"_copyAffine",f.getLocal("p2"),f.getLocal("pr")),...f.call(t+"_one",f.i32_add(f.getLocal("pr"),f.i32_const(2*d))),...f.ret([])]),f.if(f.call(a+"_isZeroAffine",f.getLocal("p2")),[...f.call(a+"_copy",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(t+"_isOne",i),[...f.call(a+"_addAffine",r,b,s),...f.ret([])]),f.call(t+"_square",i,h),f.call(t+"_mul",b,h,p),f.call(t+"_mul",i,h,g),f.call(t+"_mul",o,g,m),f.if(f.call(t+"_eq",r,p),f.if(f.call(t+"_eq",n,m),[...f.call(a+"_doubleAffine",f.getLocal("p2"),f.getLocal("pr")),...f.ret([])])),f.call(t+"_sub",p,r,x),f.call(t+"_sub",m,n,A),f.call(t+"_square",x,y),f.call(t+"_add",y,y,v),f.call(t+"_add",v,v,v),f.call(t+"_mul",x,v,w),f.call(t+"_add",A,A,_),f.call(t+"_mul",r,v,E),f.call(t+"_square",_,I),f.call(t+"_add",E,E,C),f.call(t+"_sub",I,w,s),f.call(t+"_sub",s,C,s),f.call(t+"_mul",n,w,M),f.call(t+"_add",M,M,M),f.call(t+"_sub",E,s,l),f.call(t+"_mul",l,_,l),f.call(t+"_sub",l,M,l),f.call(t+"_add",i,x,u),f.call(t+"_square",u,u),f.call(t+"_sub",u,h,u),f.call(t+"_sub",u,y,u))}(),function(){const c=e.addFunction(a+"_add");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32"),c.addLocal("z1","i32"),c.addLocal("z2","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d));c.addCode(f.setLocal("z1",f.i32_add(f.getLocal("p1"),f.i32_const(2*d))));const i=f.getLocal("z1"),b=f.getLocal("p2"),o=f.i32_add(f.getLocal("p2"),f.i32_const(d));c.addCode(f.setLocal("z2",f.i32_add(f.getLocal("p2"),f.i32_const(2*d))));const s=f.getLocal("z2"),l=f.getLocal("pr"),u=f.i32_add(f.getLocal("pr"),f.i32_const(d)),h=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),p=f.i32_const(e.alloc(d)),g=f.i32_const(e.alloc(d)),m=f.i32_const(e.alloc(d)),x=f.i32_const(e.alloc(d)),y=f.i32_const(e.alloc(d)),A=f.i32_const(e.alloc(d)),v=f.i32_const(e.alloc(d)),w=f.i32_const(e.alloc(d)),_=f.i32_const(e.alloc(d)),I=f.i32_const(e.alloc(d)),E=f.i32_const(e.alloc(d)),C=f.i32_const(e.alloc(d)),M=f.i32_const(e.alloc(d)),B=f.i32_const(e.alloc(d)),L=f.i32_const(e.alloc(d)),S=f.i32_const(e.alloc(d)),k=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(a+"_copy",f.getLocal("p2"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(a+"_isZero",f.getLocal("p2")),[...f.call(a+"_copy",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])]),f.if(f.call(t+"_isOne",i),[...f.call(a+"_addMixed",b,r,l),...f.ret([])]),f.if(f.call(t+"_isOne",s),[...f.call(a+"_addMixed",r,b,l),...f.ret([])]),f.call(t+"_square",i,p),f.call(t+"_square",s,g),f.call(t+"_mul",r,g,m),f.call(t+"_mul",b,p,x),f.call(t+"_mul",i,p,y),f.call(t+"_mul",s,g,A),f.call(t+"_mul",n,A,v),f.call(t+"_mul",o,y,w),f.if(f.call(t+"_eq",m,x),f.if(f.call(t+"_eq",v,w),[...f.call(a+"_double",f.getLocal("p1"),f.getLocal("pr")),...f.ret([])])),f.call(t+"_sub",x,m,_),f.call(t+"_sub",w,v,I),f.call(t+"_add",_,_,E),f.call(t+"_square",E,E),f.call(t+"_mul",_,E,C),f.call(t+"_add",I,I,M),f.call(t+"_mul",m,E,L),f.call(t+"_square",M,B),f.call(t+"_add",L,L,S),f.call(t+"_sub",B,C,l),f.call(t+"_sub",l,S,l),f.call(t+"_mul",v,C,k),f.call(t+"_add",k,k,k),f.call(t+"_sub",L,l,u),f.call(t+"_mul",u,M,u),f.call(t+"_sub",u,k,u),f.call(t+"_add",i,s,h),f.call(t+"_square",h,h),f.call(t+"_sub",h,p,h),f.call(t+"_sub",h,g,h),f.call(t+"_mul",h,_,h))}(),function(){const c=e.addFunction(a+"_negAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.getLocal("pr"),b=f.i32_add(f.getLocal("pr"),f.i32_const(d));c.addCode(f.call(t+"_copy",r,i),f.call(t+"_neg",n,b))}(),function(){const c=e.addFunction(a+"_neg");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_add(f.getLocal("pr"),f.i32_const(2*d));c.addCode(f.call(t+"_copy",r,b),f.call(t+"_neg",n,o),f.call(t+"_copy",i,s))}(),function(){const t=e.addFunction(a+"_subAffine");t.addParam("p1","i32"),t.addParam("p2","i32"),t.addParam("pr","i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(3*d));t.addCode(c.call(a+"_negAffine",c.getLocal("p2"),f),c.call(a+"_addAffine",c.getLocal("p1"),f,c.getLocal("pr")))}(),function(){const t=e.addFunction(a+"_subMixed");t.addParam("p1","i32"),t.addParam("p2","i32"),t.addParam("pr","i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(3*d));t.addCode(c.call(a+"_negAffine",c.getLocal("p2"),f),c.call(a+"_addMixed",c.getLocal("p1"),f,c.getLocal("pr")))}(),function(){const t=e.addFunction(a+"_sub");t.addParam("p1","i32"),t.addParam("p2","i32"),t.addParam("pr","i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(3*d));t.addCode(c.call(a+"_neg",c.getLocal("p2"),f),c.call(a+"_add",c.getLocal("p1"),f,c.getLocal("pr")))}(),function(){const c=e.addFunction(a+"_fromMontgomeryAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_fromMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<2;e++)c.addCode(f.call(t+"_fromMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_fromMontgomery");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_fromMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<3;e++)c.addCode(f.call(t+"_fromMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_toMontgomeryAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_toMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<2;e++)c.addCode(f.call(t+"_toMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_toMontgomery");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder();c.addCode(f.call(t+"_toMontgomery",f.getLocal("p1"),f.getLocal("pr")));for(let e=1;e<3;e++)c.addCode(f.call(t+"_toMontgomery",f.i32_add(f.getLocal("p1"),f.i32_const(e*d)),f.i32_add(f.getLocal("pr"),f.i32_const(e*d))))}(),function(){const c=e.addFunction(a+"_toAffine");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_const(e.alloc(d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),[...f.call(t+"_zero",b),...f.call(t+"_zero",o)],[...f.call(t+"_inverse",i,s),...f.call(t+"_square",s,l),...f.call(t+"_mul",s,l,u),...f.call(t+"_mul",r,l,b),...f.call(t+"_mul",n,u,o)]))}(),function(){const f=e.addFunction(a+"_inCurveAffine");f.addParam("pIn","i32"),f.setReturnType("i32");const r=f.getCodeBuilder(),n=r.getLocal("pIn"),i=r.i32_add(r.getLocal("pIn"),r.i32_const(d)),b=r.i32_const(e.alloc(d)),o=r.i32_const(e.alloc(d));f.addCode(r.call(t+"_square",i,b),r.call(t+"_square",n,o),r.call(t+"_mul",n,o,o),r.call(t+"_add",o,r.i32_const(c),o),r.ret(r.call(t+"_eq",b,o)))}(),function(){const t=e.addFunction(a+"_inCurve");t.addParam("pIn","i32"),t.setReturnType("i32");const c=t.getCodeBuilder(),f=c.i32_const(e.alloc(2*d));t.addCode(c.call(a+"_toAffine",c.getLocal("pIn"),f),c.ret(c.call(a+"_inCurveAffine",f)))}(),function(){const c=e.addFunction(a+"_batchToAffine");c.addParam("pIn","i32"),c.addParam("n","i32"),c.addParam("pOut","i32"),c.addLocal("pAux","i32"),c.addLocal("itIn","i32"),c.addLocal("itAux","i32"),c.addLocal("itOut","i32"),c.addLocal("i","i32");const f=c.getCodeBuilder(),r=f.i32_const(e.alloc(d));c.addCode(f.setLocal("pAux",f.i32_load(f.i32_const(0))),f.i32_store(f.i32_const(0),f.i32_add(f.getLocal("pAux"),f.i32_mul(f.getLocal("n"),f.i32_const(d)))),f.call(t+"_batchInverse",f.i32_add(f.getLocal("pIn"),f.i32_const(2*d)),f.i32_const(3*d),f.getLocal("n"),f.getLocal("pAux"),f.i32_const(d)),f.setLocal("itIn",f.getLocal("pIn")),f.setLocal("itAux",f.getLocal("pAux")),f.setLocal("itOut",f.getLocal("pOut")),f.setLocal("i",f.i32_const(0)),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("i"),f.getLocal("n"))),f.if(f.call(t+"_isZero",f.getLocal("itAux")),[...f.call(t+"_zero",f.getLocal("itOut")),...f.call(t+"_zero",f.i32_add(f.getLocal("itOut"),f.i32_const(d)))],[...f.call(t+"_mul",f.getLocal("itAux"),f.i32_add(f.getLocal("itIn"),f.i32_const(d)),r),...f.call(t+"_square",f.getLocal("itAux"),f.getLocal("itAux")),...f.call(t+"_mul",f.getLocal("itAux"),f.getLocal("itIn"),f.getLocal("itOut")),...f.call(t+"_mul",f.getLocal("itAux"),r,f.i32_add(f.getLocal("itOut"),f.i32_const(d)))]),f.setLocal("itIn",f.i32_add(f.getLocal("itIn"),f.i32_const(3*d))),f.setLocal("itOut",f.i32_add(f.getLocal("itOut"),f.i32_const(2*d))),f.setLocal("itAux",f.i32_add(f.getLocal("itAux"),f.i32_const(d))),f.setLocal("i",f.i32_add(f.getLocal("i"),f.i32_const(1))),f.br(0))),f.i32_store(f.i32_const(0),f.getLocal("pAux")))}(),function(){const c=e.addFunction(a+"_normalize");c.addParam("p1","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),r=f.getLocal("p1"),n=f.i32_add(f.getLocal("p1"),f.i32_const(d)),i=f.i32_add(f.getLocal("p1"),f.i32_const(2*d)),b=f.getLocal("pr"),o=f.i32_add(f.getLocal("pr"),f.i32_const(d)),s=f.i32_add(f.getLocal("pr"),f.i32_const(2*d)),l=f.i32_const(e.alloc(d)),u=f.i32_const(e.alloc(d)),h=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZero",f.getLocal("p1")),f.call(a+"_zero",f.getLocal("pr")),[...f.call(t+"_inverse",i,l),...f.call(t+"_square",l,u),...f.call(t+"_mul",l,u,h),...f.call(t+"_mul",r,u,b),...f.call(t+"_mul",n,h,o),...f.call(t+"_one",s)]))}(),function(){const t=e.addFunction(a+"__reverseBytes");t.addParam("pIn","i32"),t.addParam("n","i32"),t.addParam("pOut","i32"),t.addLocal("itOut","i32"),t.addLocal("itIn","i32");const c=t.getCodeBuilder();t.addCode(c.setLocal("itOut",c.i32_sub(c.i32_add(c.getLocal("pOut"),c.getLocal("n")),c.i32_const(1))),c.setLocal("itIn",c.getLocal("pIn")),c.block(c.loop(c.br_if(1,c.i32_lt_s(c.getLocal("itOut"),c.getLocal("pOut"))),c.i32_store8(c.getLocal("itOut"),c.i32_load8_u(c.getLocal("itIn"))),c.setLocal("itOut",c.i32_sub(c.getLocal("itOut"),c.i32_const(1))),c.setLocal("itIn",c.i32_add(c.getLocal("itIn"),c.i32_const(1))),c.br(0))))}(),function(){const t=e.addFunction(a+"_LEMtoU");t.addParam("pIn","i32"),t.addParam("pOut","i32");const c=t.getCodeBuilder(),f=e.alloc(2*d),r=c.i32_const(f),n=c.i32_const(f),i=c.i32_const(f+d);t.addCode(c.if(c.call(a+"_isZeroAffine",c.getLocal("pIn")),[...c.call(a+"_zeroAffine",c.getLocal("pOut")),...c.ret([])]),c.call(a+"_fromMontgomeryAffine",c.getLocal("pIn"),r),c.call(a+"__reverseBytes",n,c.i32_const(d),c.getLocal("pOut")),c.call(a+"__reverseBytes",i,c.i32_const(d),c.i32_add(c.getLocal("pOut"),c.i32_const(d))))}(),function(){const c=e.addFunction(a+"_LEMtoC");c.addParam("pIn","i32"),c.addParam("pOut","i32");const f=c.getCodeBuilder(),r=f.i32_const(e.alloc(d));c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("pIn")),[...f.call(t+"_zero",f.getLocal("pOut")),...f.i32_store8(f.getLocal("pOut"),f.i32_const(64)),...f.ret([])]),f.call(t+"_fromMontgomery",f.getLocal("pIn"),r),f.call(a+"__reverseBytes",r,f.i32_const(d),f.getLocal("pOut")),f.if(f.i32_eq(f.call(t+"_sign",f.i32_add(f.getLocal("pIn"),f.i32_const(d))),f.i32_const(-1)),f.i32_store8(f.getLocal("pOut"),f.i32_or(f.i32_load8_u(f.getLocal("pOut")),f.i32_const(128)))))}(),function(){const t=e.addFunction(a+"_UtoLEM");t.addParam("pIn","i32"),t.addParam("pOut","i32");const c=t.getCodeBuilder(),f=e.alloc(2*d),r=c.i32_const(f),n=c.i32_const(f),i=c.i32_const(f+d);t.addCode(c.if(c.i32_and(c.i32_load8_u(c.getLocal("pIn")),c.i32_const(64)),[...c.call(a+"_zeroAffine",c.getLocal("pOut")),...c.ret([])]),c.call(a+"__reverseBytes",c.getLocal("pIn"),c.i32_const(d),n),c.call(a+"__reverseBytes",c.i32_add(c.getLocal("pIn"),c.i32_const(d)),c.i32_const(d),i),c.call(a+"_toMontgomeryAffine",r,c.getLocal("pOut")))}(),function(){const f=e.addFunction(a+"_CtoLEM");f.addParam("pIn","i32"),f.addParam("pOut","i32"),f.addLocal("firstByte","i32"),f.addLocal("greatest","i32");const r=f.getCodeBuilder(),n=e.alloc(2*d),i=r.i32_const(n),b=r.i32_const(n+d);f.addCode(r.setLocal("firstByte",r.i32_load8_u(r.getLocal("pIn"))),r.if(r.i32_and(r.getLocal("firstByte"),r.i32_const(64)),[...r.call(a+"_zeroAffine",r.getLocal("pOut")),...r.ret([])]),r.setLocal("greatest",r.i32_and(r.getLocal("firstByte"),r.i32_const(128))),r.call(t+"_copy",r.getLocal("pIn"),b),r.i32_store8(b,r.i32_and(r.getLocal("firstByte"),r.i32_const(63))),r.call(a+"__reverseBytes",b,r.i32_const(d),i),r.call(t+"_toMontgomery",i,r.getLocal("pOut")),r.call(t+"_square",r.getLocal("pOut"),b),r.call(t+"_mul",r.getLocal("pOut"),b,b),r.call(t+"_add",b,r.i32_const(c),b),r.call(t+"_sqrt",b,b),r.call(t+"_neg",b,i),r.if(r.i32_eq(r.call(t+"_sign",b),r.i32_const(-1)),r.if(r.getLocal("greatest"),r.call(t+"_copy",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d))),r.call(t+"_neg",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d)))),r.if(r.getLocal("greatest"),r.call(t+"_neg",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d))),r.call(t+"_copy",b,r.i32_add(r.getLocal("pOut"),r.i32_const(d))))))}(),_e(e,a+"_batchLEMtoU",a+"_LEMtoU",2*d,2*d),_e(e,a+"_batchLEMtoC",a+"_LEMtoC",2*d,d),_e(e,a+"_batchUtoLEM",a+"_UtoLEM",2*d,2*d),_e(e,a+"_batchCtoLEM",a+"_CtoLEM",d,2*d,!0),_e(e,a+"_batchToJacobian",a+"_toJacobian",2*d,3*d,!0),Ie(e,a,a+"_multiexp",a+"_add",3*d),Ie(e,a,a+"_multiexpAffine",a+"_addMixed",2*d),we(e,a+"_timesScalar",3*d,a+"_add",a+"_double",a+"_sub",a+"_copy",a+"_zero"),we(e,a+"_timesScalarAffine",2*d,a+"_addMixed",a+"_double",a+"_subMixed",a+"_copyAffine",a+"_zero"),e.exportFunction(a+"_isZero"),e.exportFunction(a+"_isZeroAffine"),e.exportFunction(a+"_eq"),e.exportFunction(a+"_eqMixed"),e.exportFunction(a+"_eqAffine"),e.exportFunction(a+"_copy"),e.exportFunction(a+"_copyAffine"),e.exportFunction(a+"_zero"),e.exportFunction(a+"_zeroAffine"),e.exportFunction(a+"_double"),e.exportFunction(a+"_doubleAffine"),e.exportFunction(a+"_add"),e.exportFunction(a+"_addMixed"),e.exportFunction(a+"_addAffine"),e.exportFunction(a+"_neg"),e.exportFunction(a+"_negAffine"),e.exportFunction(a+"_sub"),e.exportFunction(a+"_subMixed"),e.exportFunction(a+"_subAffine"),e.exportFunction(a+"_fromMontgomery"),e.exportFunction(a+"_fromMontgomeryAffine"),e.exportFunction(a+"_toMontgomery"),e.exportFunction(a+"_toMontgomeryAffine"),e.exportFunction(a+"_timesScalar"),e.exportFunction(a+"_timesScalarAffine"),e.exportFunction(a+"_normalize"),e.exportFunction(a+"_LEMtoU"),e.exportFunction(a+"_LEMtoC"),e.exportFunction(a+"_UtoLEM"),e.exportFunction(a+"_CtoLEM"),e.exportFunction(a+"_batchLEMtoU"),e.exportFunction(a+"_batchLEMtoC"),e.exportFunction(a+"_batchUtoLEM"),e.exportFunction(a+"_batchCtoLEM"),e.exportFunction(a+"_toAffine"),e.exportFunction(a+"_toJacobian"),e.exportFunction(a+"_batchToAffine"),e.exportFunction(a+"_batchToJacobian"),e.exportFunction(a+"_inCurve"),e.exportFunction(a+"_inCurveAffine")),a};const{isOdd:Ce,modInv:Me,modPow:Be}=U,Le=T;var Se=function(e,a,t,c,f){const d=8*e.modules[c].n64,r=8*e.modules[t].n64,n=e.modules[c].q;let i=n-1n,b=0;for(;!Ce(i);)b++,i>>=1n;let o=2n;for(;1n===Be(o,n>>1n,n);)o+=1n;const s=new Array(b+1);s[b]=Be(o,i,n);let l=b-1;for(;l>=0;)s[l]=Be(s[l+1],2n,n),l--;const u=[],h=(1n<>t);return a}const E=Array(256);for(let e=0;e<256;e++)E[e]=I(e);const C=e.alloc(E);!function(){const t=e.addFunction(a+"__rev");t.addParam("x","i32"),t.addParam("bits","i32"),t.setReturnType("i32");const c=t.getCodeBuilder();t.addCode(c.i32_rotl(c.i32_add(c.i32_add(c.i32_shl(c.i32_load8_u(c.i32_and(c.getLocal("x"),c.i32_const(255)),C,0),c.i32_const(24)),c.i32_shl(c.i32_load8_u(c.i32_and(c.i32_shr_u(c.getLocal("x"),c.i32_const(8)),c.i32_const(255)),C,0),c.i32_const(16))),c.i32_add(c.i32_shl(c.i32_load8_u(c.i32_and(c.i32_shr_u(c.getLocal("x"),c.i32_const(16)),c.i32_const(255)),C,0),c.i32_const(8)),c.i32_load8_u(c.i32_and(c.i32_shr_u(c.getLocal("x"),c.i32_const(24)),c.i32_const(255)),C,0))),c.getLocal("bits")))}(),function(){const c=e.addFunction(a+"__reversePermutation");c.addParam("px","i32"),c.addParam("bits","i32"),c.addLocal("n","i32"),c.addLocal("i","i32"),c.addLocal("ri","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(r));c.addCode(f.setLocal("n",f.i32_shl(f.i32_const(1),f.getLocal("bits"))),f.setLocal("i",f.i32_const(0)),f.block(f.loop(f.br_if(1,f.i32_eq(f.getLocal("i"),f.getLocal("n"))),f.setLocal("idx1",f.i32_add(f.getLocal("px"),f.i32_mul(f.getLocal("i"),f.i32_const(r)))),f.setLocal("ri",f.call(a+"__rev",f.getLocal("i"),f.getLocal("bits"))),f.setLocal("idx2",f.i32_add(f.getLocal("px"),f.i32_mul(f.getLocal("ri"),f.i32_const(r)))),f.if(f.i32_lt_u(f.getLocal("i"),f.getLocal("ri")),[...f.call(t+"_copy",f.getLocal("idx1"),d),...f.call(t+"_copy",f.getLocal("idx2"),f.getLocal("idx1")),...f.call(t+"_copy",d,f.getLocal("idx2"))]),f.setLocal("i",f.i32_add(f.getLocal("i"),f.i32_const(1))),f.br(0))))}(),function(){const d=e.addFunction(a+"__fftFinal");d.addParam("px","i32"),d.addParam("bits","i32"),d.addParam("reverse","i32"),d.addParam("mulFactor","i32"),d.addLocal("n","i32"),d.addLocal("ndiv2","i32"),d.addLocal("pInv2","i32"),d.addLocal("i","i32"),d.addLocal("mask","i32"),d.addLocal("idx1","i32"),d.addLocal("idx2","i32");const n=d.getCodeBuilder(),i=n.i32_const(e.alloc(r));d.addCode(n.if(n.i32_and(n.i32_eqz(n.getLocal("reverse")),n.call(c+"_isOne",n.getLocal("mulFactor"))),n.ret([])),n.setLocal("n",n.i32_shl(n.i32_const(1),n.getLocal("bits"))),n.setLocal("mask",n.i32_sub(n.getLocal("n"),n.i32_const(1))),n.setLocal("i",n.i32_const(1)),n.setLocal("ndiv2",n.i32_shr_u(n.getLocal("n"),n.i32_const(1))),n.block(n.loop(n.br_if(1,n.i32_ge_u(n.getLocal("i"),n.getLocal("ndiv2"))),n.setLocal("idx1",n.i32_add(n.getLocal("px"),n.i32_mul(n.getLocal("i"),n.i32_const(r)))),n.setLocal("idx2",n.i32_add(n.getLocal("px"),n.i32_mul(n.i32_sub(n.getLocal("n"),n.getLocal("i")),n.i32_const(r)))),n.if(n.getLocal("reverse"),n.if(n.call(c+"_isOne",n.getLocal("mulFactor")),[...n.call(t+"_copy",n.getLocal("idx1"),i),...n.call(t+"_copy",n.getLocal("idx2"),n.getLocal("idx1")),...n.call(t+"_copy",i,n.getLocal("idx2"))],[...n.call(t+"_copy",n.getLocal("idx1"),i),...n.call(f,n.getLocal("idx2"),n.getLocal("mulFactor"),n.getLocal("idx1")),...n.call(f,i,n.getLocal("mulFactor"),n.getLocal("idx2"))]),n.if(n.call(c+"_isOne",n.getLocal("mulFactor")),[],[...n.call(f,n.getLocal("idx1"),n.getLocal("mulFactor"),n.getLocal("idx1")),...n.call(f,n.getLocal("idx2"),n.getLocal("mulFactor"),n.getLocal("idx2"))])),n.setLocal("i",n.i32_add(n.getLocal("i"),n.i32_const(1))),n.br(0))),n.if(n.call(c+"_isOne",n.getLocal("mulFactor")),[],[...n.call(f,n.getLocal("px"),n.getLocal("mulFactor"),n.getLocal("px")),...n.setLocal("idx2",n.i32_add(n.getLocal("px"),n.i32_mul(n.getLocal("ndiv2"),n.i32_const(r)))),...n.call(f,n.getLocal("idx2"),n.getLocal("mulFactor"),n.getLocal("idx2"))]))}(),function(){const n=e.addFunction(a+"_rawfft");n.addParam("px","i32"),n.addParam("bits","i32"),n.addParam("reverse","i32"),n.addParam("mulFactor","i32"),n.addLocal("s","i32"),n.addLocal("k","i32"),n.addLocal("j","i32"),n.addLocal("m","i32"),n.addLocal("mdiv2","i32"),n.addLocal("n","i32"),n.addLocal("pwm","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r)),s=i.i32_const(e.alloc(r));n.addCode(i.call(a+"__reversePermutation",i.getLocal("px"),i.getLocal("bits")),i.setLocal("n",i.i32_shl(i.i32_const(1),i.getLocal("bits"))),i.setLocal("s",i.i32_const(1)),i.block(i.loop(i.br_if(1,i.i32_gt_u(i.getLocal("s"),i.getLocal("bits"))),i.setLocal("m",i.i32_shl(i.i32_const(1),i.getLocal("s"))),i.setLocal("pwm",i.i32_add(i.i32_const(p),i.i32_mul(i.getLocal("s"),i.i32_const(d)))),i.setLocal("k",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_ge_u(i.getLocal("k"),i.getLocal("n"))),i.call(c+"_one",b),i.setLocal("mdiv2",i.i32_shr_u(i.getLocal("m"),i.i32_const(1))),i.setLocal("j",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_ge_u(i.getLocal("j"),i.getLocal("mdiv2"))),i.setLocal("idx1",i.i32_add(i.getLocal("px"),i.i32_mul(i.i32_add(i.getLocal("k"),i.getLocal("j")),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("idx1"),i.i32_mul(i.getLocal("mdiv2"),i.i32_const(r)))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_copy",i.getLocal("idx1"),s),i.call(t+"_add",s,o,i.getLocal("idx1")),i.call(t+"_sub",s,o,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("pwm"),b),i.setLocal("j",i.i32_add(i.getLocal("j"),i.i32_const(1))),i.br(0))),i.setLocal("k",i.i32_add(i.getLocal("k"),i.getLocal("m"))),i.br(0))),i.setLocal("s",i.i32_add(i.getLocal("s"),i.i32_const(1))),i.br(0))),i.call(a+"__fftFinal",i.getLocal("px"),i.getLocal("bits"),i.getLocal("reverse"),i.getLocal("mulFactor")))}(),function(){const t=e.addFunction(a+"__log2");t.addParam("n","i32"),t.setReturnType("i32"),t.addLocal("bits","i32"),t.addLocal("aux","i32");const c=t.getCodeBuilder();t.addCode(c.setLocal("aux",c.i32_shr_u(c.getLocal("n"),c.i32_const(1)))),t.addCode(c.setLocal("bits",c.i32_const(0))),t.addCode(c.block(c.loop(c.br_if(1,c.i32_eqz(c.getLocal("aux"))),c.setLocal("aux",c.i32_shr_u(c.getLocal("aux"),c.i32_const(1))),c.setLocal("bits",c.i32_add(c.getLocal("bits"),c.i32_const(1))),c.br(0)))),t.addCode(c.if(c.i32_ne(c.getLocal("n"),c.i32_shl(c.i32_const(1),c.getLocal("bits"))),c.unreachable())),t.addCode(c.if(c.i32_gt_u(c.getLocal("bits"),c.i32_const(b)),c.unreachable())),t.addCode(c.getLocal("bits"))}(),function(){const t=e.addFunction(a+"_fft");t.addParam("px","i32"),t.addParam("n","i32"),t.addLocal("bits","i32");const f=t.getCodeBuilder(),r=f.i32_const(e.alloc(d));t.addCode(f.setLocal("bits",f.call(a+"__log2",f.getLocal("n"))),f.call(c+"_one",r),f.call(a+"_rawfft",f.getLocal("px"),f.getLocal("bits"),f.i32_const(0),r))}(),function(){const t=e.addFunction(a+"_ifft");t.addParam("px","i32"),t.addParam("n","i32"),t.addLocal("bits","i32"),t.addLocal("pInv2","i32");const c=t.getCodeBuilder();t.addCode(c.setLocal("bits",c.call(a+"__log2",c.getLocal("n"))),c.setLocal("pInv2",c.i32_add(c.i32_const(x),c.i32_mul(c.getLocal("bits"),c.i32_const(d)))),c.call(a+"_rawfft",c.getLocal("px"),c.getLocal("bits"),c.i32_const(1),c.getLocal("pInv2")))}(),function(){const n=e.addFunction(a+"_fftJoin");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r)),s=i.i32_const(e.alloc(r));n.addCode(i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_copy",i.getLocal("idx1"),s),i.call(t+"_add",s,o,i.getLocal("idx1")),i.call(t+"_sub",s,o,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const n=e.addFunction(a+"_fftJoinExt");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addParam("totalBits","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("pShiftToM","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r));n.addCode(i.setLocal("pShiftToM",i.i32_add(i.i32_const(w),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(t+"_add",i.getLocal("idx1"),i.getLocal("idx2"),o),i.call(f,i.getLocal("idx2"),i.getLocal("pShiftToM"),i.getLocal("idx2")),i.call(t+"_add",i.getLocal("idx1"),i.getLocal("idx2"),i.getLocal("idx2")),i.call(f,i.getLocal("idx2"),b,i.getLocal("idx2")),i.call(t+"_copy",o,i.getLocal("idx1")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const n=e.addFunction(a+"_fftJoinExtInv");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addParam("totalBits","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("pShiftToM","i32"),n.addLocal("pSConst","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r));n.addCode(i.setLocal("pShiftToM",i.i32_add(i.i32_const(w),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.setLocal("pSConst",i.i32_add(i.i32_const(_),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_sub",i.getLocal("idx1"),o,i.getLocal("idx2")),i.call(f,i.getLocal("idx2"),i.getLocal("pSConst"),i.getLocal("idx2")),i.call(f,i.getLocal("idx1"),i.getLocal("pShiftToM"),i.getLocal("idx1")),i.call(t+"_sub",o,i.getLocal("idx1"),i.getLocal("idx1")),i.call(f,i.getLocal("idx1"),i.getLocal("pSConst"),i.getLocal("idx1")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const n=e.addFunction(a+"_fftMix");n.addParam("pBuff","i32"),n.addParam("n","i32"),n.addParam("exp","i32"),n.addLocal("nGroups","i32"),n.addLocal("nPerGroup","i32"),n.addLocal("nPerGroupDiv2","i32"),n.addLocal("pairOffset","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("j","i32"),n.addLocal("pwm","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r)),s=i.i32_const(e.alloc(r));n.addCode(i.setLocal("nPerGroup",i.i32_shl(i.i32_const(1),i.getLocal("exp"))),i.setLocal("nPerGroupDiv2",i.i32_shr_u(i.getLocal("nPerGroup"),i.i32_const(1))),i.setLocal("nGroups",i.i32_shr_u(i.getLocal("n"),i.getLocal("exp"))),i.setLocal("pairOffset",i.i32_mul(i.getLocal("nPerGroupDiv2"),i.i32_const(r))),i.setLocal("pwm",i.i32_add(i.i32_const(p),i.i32_mul(i.getLocal("exp"),i.i32_const(d)))),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("nGroups"))),i.call(c+"_one",b),i.setLocal("j",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("j"),i.getLocal("nPerGroupDiv2"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff"),i.i32_mul(i.i32_add(i.i32_mul(i.getLocal("i"),i.getLocal("nPerGroup")),i.getLocal("j")),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("idx1"),i.getLocal("pairOffset"))),i.call(f,i.getLocal("idx2"),b,o),i.call(t+"_copy",i.getLocal("idx1"),s),i.call(t+"_add",s,o,i.getLocal("idx1")),i.call(t+"_sub",s,o,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("pwm"),b),i.setLocal("j",i.i32_add(i.getLocal("j"),i.i32_const(1))),i.br(0))),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const c=e.addFunction(a+"_fftFinal");c.addParam("pBuff","i32"),c.addParam("n","i32"),c.addParam("factor","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32"),c.addLocal("ndiv2","i32");const d=c.getCodeBuilder(),n=d.i32_const(e.alloc(r));c.addCode(d.setLocal("ndiv2",d.i32_shr_u(d.getLocal("n"),d.i32_const(1))),d.if(d.i32_and(d.getLocal("n"),d.i32_const(1)),d.call(f,d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.getLocal("ndiv2"),d.i32_const(r))),d.getLocal("factor"),d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.getLocal("ndiv2"),d.i32_const(r))))),d.setLocal("i",d.i32_const(0)),d.block(d.loop(d.br_if(1,d.i32_ge_u(d.getLocal("i"),d.getLocal("ndiv2"))),d.setLocal("idx1",d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.getLocal("i"),d.i32_const(r)))),d.setLocal("idx2",d.i32_add(d.getLocal("pBuff"),d.i32_mul(d.i32_sub(d.i32_sub(d.getLocal("n"),d.i32_const(1)),d.getLocal("i")),d.i32_const(r)))),d.call(f,d.getLocal("idx2"),d.getLocal("factor"),n),d.call(f,d.getLocal("idx1"),d.getLocal("factor"),d.getLocal("idx2")),d.call(t+"_copy",n,d.getLocal("idx1")),d.setLocal("i",d.i32_add(d.getLocal("i"),d.i32_const(1))),d.br(0))))}(),function(){const n=e.addFunction(a+"_prepareLagrangeEvaluation");n.addParam("pBuff1","i32"),n.addParam("pBuff2","i32"),n.addParam("n","i32"),n.addParam("first","i32"),n.addParam("inc","i32"),n.addParam("totalBits","i32"),n.addLocal("idx1","i32"),n.addLocal("idx2","i32"),n.addLocal("i","i32"),n.addLocal("pShiftToM","i32"),n.addLocal("pSConst","i32");const i=n.getCodeBuilder(),b=i.i32_const(e.alloc(d)),o=i.i32_const(e.alloc(r));n.addCode(i.setLocal("pShiftToM",i.i32_add(i.i32_const(w),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.setLocal("pSConst",i.i32_add(i.i32_const(_),i.i32_mul(i.getLocal("totalBits"),i.i32_const(d)))),i.call(c+"_copy",i.getLocal("first"),b),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("pBuff1"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.setLocal("idx2",i.i32_add(i.getLocal("pBuff2"),i.i32_mul(i.getLocal("i"),i.i32_const(r)))),i.call(f,i.getLocal("idx1"),i.getLocal("pShiftToM"),o),i.call(t+"_sub",i.getLocal("idx2"),o,o),i.call(t+"_sub",i.getLocal("idx1"),i.getLocal("idx2"),i.getLocal("idx2")),i.call(f,o,i.getLocal("pSConst"),i.getLocal("idx1")),i.call(f,i.getLocal("idx2"),b,i.getLocal("idx2")),i.call(c+"_mul",b,i.getLocal("inc"),b),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),e.exportFunction(a+"_fft"),e.exportFunction(a+"_ifft"),e.exportFunction(a+"_rawfft"),e.exportFunction(a+"_fftJoin"),e.exportFunction(a+"_fftJoinExt"),e.exportFunction(a+"_fftJoinExtInv"),e.exportFunction(a+"_fftMix"),e.exportFunction(a+"_fftFinal"),e.exportFunction(a+"_prepareLagrangeEvaluation")},ke=function(e,a,t){const c=8*e.modules[t].n64;return function(){const f=e.addFunction(a+"_zero");f.addParam("px","i32"),f.addParam("n","i32"),f.addLocal("lastp","i32"),f.addLocal("p","i32");const d=f.getCodeBuilder();f.addCode(d.setLocal("p",d.getLocal("px")),d.setLocal("lastp",d.i32_add(d.getLocal("px"),d.i32_mul(d.getLocal("n"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("p"),d.getLocal("lastp"))),d.call(t+"_zero",d.getLocal("p")),d.setLocal("p",d.i32_add(d.getLocal("p"),d.i32_const(c))),d.br(0))))}(),function(){const f=e.addFunction(a+"_constructLC");f.addParam("ppolynomials","i32"),f.addParam("psignals","i32"),f.addParam("nSignals","i32"),f.addParam("pres","i32"),f.addLocal("i","i32"),f.addLocal("j","i32"),f.addLocal("pp","i32"),f.addLocal("ps","i32"),f.addLocal("pd","i32"),f.addLocal("ncoefs","i32");const d=f.getCodeBuilder(),r=d.i32_const(e.alloc(c));f.addCode(d.setLocal("i",d.i32_const(0)),d.setLocal("pp",d.getLocal("ppolynomials")),d.setLocal("ps",d.getLocal("psignals")),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("i"),d.getLocal("nSignals"))),d.setLocal("ncoefs",d.i32_load(d.getLocal("pp"))),d.setLocal("pp",d.i32_add(d.getLocal("pp"),d.i32_const(4))),d.setLocal("j",d.i32_const(0)),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("j"),d.getLocal("ncoefs"))),d.setLocal("pd",d.i32_add(d.getLocal("pres"),d.i32_mul(d.i32_load(d.getLocal("pp")),d.i32_const(c)))),d.setLocal("pp",d.i32_add(d.getLocal("pp"),d.i32_const(4))),d.call(t+"_mul",d.getLocal("ps"),d.getLocal("pp"),r),d.call(t+"_add",r,d.getLocal("pd"),d.getLocal("pd")),d.setLocal("pp",d.i32_add(d.getLocal("pp"),d.i32_const(c))),d.setLocal("j",d.i32_add(d.getLocal("j"),d.i32_const(1))),d.br(0))),d.setLocal("ps",d.i32_add(d.getLocal("ps"),d.i32_const(c))),d.setLocal("i",d.i32_add(d.getLocal("i"),d.i32_const(1))),d.br(0))))}(),e.exportFunction(a+"_zero"),e.exportFunction(a+"_constructLC"),a},Ne=function(e,a,t){const c=8*e.modules[t].n64;return function(){const f=e.addFunction(a+"_buildABC");f.addParam("pCoefs","i32"),f.addParam("nCoefs","i32"),f.addParam("pWitness","i32"),f.addParam("pA","i32"),f.addParam("pB","i32"),f.addParam("pC","i32"),f.addParam("offsetOut","i32"),f.addParam("nOut","i32"),f.addParam("offsetWitness","i32"),f.addParam("nWitness","i32"),f.addLocal("it","i32"),f.addLocal("ita","i32"),f.addLocal("itb","i32"),f.addLocal("last","i32"),f.addLocal("m","i32"),f.addLocal("c","i32"),f.addLocal("s","i32"),f.addLocal("pOut","i32");const d=f.getCodeBuilder(),r=d.i32_const(e.alloc(c));f.addCode(d.setLocal("ita",d.getLocal("pA")),d.setLocal("itb",d.getLocal("pB")),d.setLocal("last",d.i32_add(d.getLocal("pA"),d.i32_mul(d.getLocal("nOut"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_zero",d.getLocal("ita")),d.call(t+"_zero",d.getLocal("itb")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.br(0))),d.setLocal("it",d.getLocal("pCoefs")),d.setLocal("last",d.i32_add(d.getLocal("pCoefs"),d.i32_mul(d.getLocal("nCoefs"),d.i32_const(c+12)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("it"),d.getLocal("last"))),d.setLocal("s",d.i32_load(d.getLocal("it"),8)),d.if(d.i32_or(d.i32_lt_u(d.getLocal("s"),d.getLocal("offsetWitness")),d.i32_ge_u(d.getLocal("s"),d.i32_add(d.getLocal("offsetWitness"),d.getLocal("nWitness")))),[...d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),...d.br(1)]),d.setLocal("m",d.i32_load(d.getLocal("it"))),d.if(d.i32_eq(d.getLocal("m"),d.i32_const(0)),d.setLocal("pOut",d.getLocal("pA")),d.if(d.i32_eq(d.getLocal("m"),d.i32_const(1)),d.setLocal("pOut",d.getLocal("pB")),[...d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),...d.br(1)])),d.setLocal("c",d.i32_load(d.getLocal("it"),4)),d.if(d.i32_or(d.i32_lt_u(d.getLocal("c"),d.getLocal("offsetOut")),d.i32_ge_u(d.getLocal("c"),d.i32_add(d.getLocal("offsetOut"),d.getLocal("nOut")))),[...d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),...d.br(1)]),d.setLocal("pOut",d.i32_add(d.getLocal("pOut"),d.i32_mul(d.i32_sub(d.getLocal("c"),d.getLocal("offsetOut")),d.i32_const(c)))),d.call(t+"_mul",d.i32_add(d.getLocal("pWitness"),d.i32_mul(d.i32_sub(d.getLocal("s"),d.getLocal("offsetWitness")),d.i32_const(c))),d.i32_add(d.getLocal("it"),d.i32_const(12)),r),d.call(t+"_add",d.getLocal("pOut"),r,d.getLocal("pOut")),d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c+12))),d.br(0))),d.setLocal("ita",d.getLocal("pA")),d.setLocal("itb",d.getLocal("pB")),d.setLocal("it",d.getLocal("pC")),d.setLocal("last",d.i32_add(d.getLocal("pA"),d.i32_mul(d.getLocal("nOut"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_mul",d.getLocal("ita"),d.getLocal("itb"),d.getLocal("it")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.setLocal("it",d.i32_add(d.getLocal("it"),d.i32_const(c))),d.br(0))))}(),function(){const f=e.addFunction(a+"_joinABC");f.addParam("pA","i32"),f.addParam("pB","i32"),f.addParam("pC","i32"),f.addParam("n","i32"),f.addParam("pP","i32"),f.addLocal("ita","i32"),f.addLocal("itb","i32"),f.addLocal("itc","i32"),f.addLocal("itp","i32"),f.addLocal("last","i32");const d=f.getCodeBuilder(),r=d.i32_const(e.alloc(c));f.addCode(d.setLocal("ita",d.getLocal("pA")),d.setLocal("itb",d.getLocal("pB")),d.setLocal("itc",d.getLocal("pC")),d.setLocal("itp",d.getLocal("pP")),d.setLocal("last",d.i32_add(d.getLocal("pA"),d.i32_mul(d.getLocal("n"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_mul",d.getLocal("ita"),d.getLocal("itb"),r),d.call(t+"_sub",r,d.getLocal("itc"),d.getLocal("itp")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.setLocal("itc",d.i32_add(d.getLocal("itc"),d.i32_const(c))),d.setLocal("itp",d.i32_add(d.getLocal("itp"),d.i32_const(c))),d.br(0))))}(),function(){const f=e.addFunction(a+"_batchAdd");f.addParam("pa","i32"),f.addParam("pb","i32"),f.addParam("n","i32"),f.addParam("pr","i32"),f.addLocal("ita","i32"),f.addLocal("itb","i32"),f.addLocal("itr","i32"),f.addLocal("last","i32");const d=f.getCodeBuilder();f.addCode(d.setLocal("ita",d.getLocal("pa")),d.setLocal("itb",d.getLocal("pb")),d.setLocal("itr",d.getLocal("pr")),d.setLocal("last",d.i32_add(d.getLocal("pa"),d.i32_mul(d.getLocal("n"),d.i32_const(c)))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("ita"),d.getLocal("last"))),d.call(t+"_add",d.getLocal("ita"),d.getLocal("itb"),d.getLocal("itr")),d.setLocal("ita",d.i32_add(d.getLocal("ita"),d.i32_const(c))),d.setLocal("itb",d.i32_add(d.getLocal("itb"),d.i32_const(c))),d.setLocal("itr",d.i32_add(d.getLocal("itr"),d.i32_const(c))),d.br(0))))}(),e.exportFunction(a+"_buildABC"),e.exportFunction(a+"_joinABC"),e.exportFunction(a+"_batchAdd"),a},Pe=function(e,a,t,c,f,d,r,n){const i=e.addFunction(a);i.addParam("pIn","i32"),i.addParam("n","i32"),i.addParam("pFirst","i32"),i.addParam("pInc","i32"),i.addParam("pOut","i32"),i.addLocal("pOldFree","i32"),i.addLocal("i","i32"),i.addLocal("pFrom","i32"),i.addLocal("pTo","i32");const b=i.getCodeBuilder(),o=b.i32_const(e.alloc(r));i.addCode(b.setLocal("pFrom",b.getLocal("pIn")),b.setLocal("pTo",b.getLocal("pOut"))),i.addCode(b.call(c+"_copy",b.getLocal("pFirst"),o)),i.addCode(b.setLocal("i",b.i32_const(0)),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("i"),b.getLocal("n"))),b.call(n,b.getLocal("pFrom"),o,b.getLocal("pTo")),b.setLocal("pFrom",b.i32_add(b.getLocal("pFrom"),b.i32_const(f))),b.setLocal("pTo",b.i32_add(b.getLocal("pTo"),b.i32_const(d))),b.call(c+"_mul",o,b.getLocal("pInc"),o),b.setLocal("i",b.i32_add(b.getLocal("i"),b.i32_const(1))),b.br(0)))),e.exportFunction(a)};const Re=T,Oe=se,Te=he,De=xe,Fe=ve,Qe=Ee,Ue=Se,je=ke,He=Ne,$e=Pe,{bitLength:qe,modInv:Ge,isOdd:ze,isNegative:Ke}=U,Ve=T,Ze=se,Je=he,We=xe,Ye=ve,Xe=Ee,ea=Se,aa=ke,ta=Ne,ca=Pe,{bitLength:fa,isOdd:da,isNegative:ra}=U;var na=function(e,a){const t=a||"bn128";if(e.modules[t])return t;const c=21888242871839275222246405745257275088696311157297823662689037894645226208583n,f=21888242871839275222246405745257275088548364400416034343698204186575808495617n,d=Math.floor((qe(c-1n)-1)/64)+1,r=8*d,n=r,i=r,b=2*i,o=12*i,s=e.alloc(Re.bigInt2BytesLE(f,n)),l=Oe(e,c,"f1m");Te(e,f,"fr","frm");const u=e.alloc(Re.bigInt2BytesLE(y(3n),i)),h=Qe(e,"g1m","f1m",u);Ue(e,"frm","frm","frm","frm_mul"),je(e,"pol","frm"),He(e,"qap","frm");const p=De(e,"f1m_neg","f2m","f1m"),g=e.alloc([...Re.bigInt2BytesLE(y(19485874751759354771024239261021720505790618469301721065564631296452457478373n),i),...Re.bigInt2BytesLE(y(266929791119991161246907387137283842545076965332900288569378510910307636690n),i)]),m=Qe(e,"g2m","f2m",g);function x(a,t){const c=e.addFunction(a);c.addParam("pG","i32"),c.addParam("pFr","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(r));c.addCode(f.call("frm_fromMontgomery",f.getLocal("pFr"),d),f.call(t,f.getLocal("pG"),d,f.i32_const(r),f.getLocal("pr"))),e.exportFunction(a)}function y(e){return BigInt(e)*(1n<0n;)ze(e)?a.push(1):a.push(0),e>>=1n;return a}(),T=e.alloc(O),D=3*b,F=O.length-1,Q=O.reduce(((e,a)=>e+(0!=a?1:0)),0),U=6*r,j=3*r*2+(Q+F+1)*D;function H(a){const f=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[8376118865763821496583973867626364092589906065868298776909617916018768340080n,16469823323077808223889137241176536799009286646108169935659301613961712198316n],[21888242871839275220042445260109153167277707414472061641714758635765020556617n,0n],[11697423496358154304825782922584725312912383441159505038794027105778954184319n,303847389135065887422783454877609941456349188919719272345083954437860409601n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3321304630594332808241809054958361220322477375291206261884409189760185844239n,5722266937896532885780051958958348231143373700109372999374820235121374419868n],[21888242871839275222246405745257275088696311157297823662689037894645226208582n,0n],[13512124006075453725662431877630910996106405091429524885779419978626457868503n,5418419548761466998357268504080738289687024511189653727029736280683514010267n],[2203960485148121921418603742825762020974279258880205651966n,0n],[10190819375481120917420622822672549775783927716138318623895010788866272024264n,21584395482704209334823622290379665147239961968378104390343953940207365798982n],[2203960485148121921418603742825762020974279258880205651967n,0n],[18566938241244942414004596690298913868373833782006617400804628704885040364344n,16165975933942742336466353786298926857552937457188450663314217659523851788715n]]],d=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[21575463638280843010398324269430826099269044274347216827212613867836435027261n,10307601595873709700152284273816112264069230130616436755625194854815875713954n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3772000881919853776433695186713858239009073593817195771773381919316419345261n,2236595495967245188281701248203181795121068902605861227855261137820944008926n],[2203960485148121921418603742825762020974279258880205651966n,0n],[18429021223477853657660792034369865839114504446431234726392080002137598044644n,9344045779998320333812420223237981029506012124075525679208581902008406485703n]],[[1n,0n],[2581911344467009335267311115468803099551665605076196740867805258568234346338n,19937756971775647987995932169929341994314640652964949448313374472400716661030n],[2203960485148121921418603742825762020974279258880205651966n,0n],[5324479202449903542726783395506214481928257762400643279780343368557297135718n,16208900380737693084919495127334387981393726419856888799917914180988844123039n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[13981852324922362344252311234282257507216387789820983642040889267519694726527n,7629828391165209371577384193250820201684255241773809077146787135900891633097n]]],r=e.addFunction(t+"__frobeniusMap"+a);r.addParam("x","i32"),r.addParam("r","i32");const n=r.getCodeBuilder();for(let t=0;t<6;t++){const c=0==t?n.getLocal("x"):n.i32_add(n.getLocal("x"),n.i32_const(t*b)),s=c,u=n.i32_add(n.getLocal("x"),n.i32_const(t*b+i)),h=0==t?n.getLocal("r"):n.i32_add(n.getLocal("r"),n.i32_const(t*b)),g=h,m=n.i32_add(n.getLocal("r"),n.i32_const(t*b+i)),x=o(f[Math.floor(t/3)][a%12],d[t%3][a%6]),A=e.alloc([...Re.bigInt2BytesLE(y(x[0]),32),...Re.bigInt2BytesLE(y(x[1]),32)]);a%2==1?r.addCode(n.call(l+"_copy",s,g),n.call(l+"_neg",u,m),n.call(p+"_mul",h,n.i32_const(A),h)):r.addCode(n.call(p+"_mul",c,n.i32_const(A),h))}function o(e,a){const t=BigInt(e[0]),f=BigInt(e[1]),d=BigInt(a[0]),r=BigInt(a[1]),n=[(t*d-f*r)%c,(t*r+f*d)%c];return Ke(n[0])&&(n[0]=n[0]+c),n}}function $(){!function(){const a=e.addFunction(t+"__cyclotomicSquare");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.getLocal("x"),d=c.i32_add(c.getLocal("x"),c.i32_const(b)),r=c.i32_add(c.getLocal("x"),c.i32_const(2*b)),n=c.i32_add(c.getLocal("x"),c.i32_const(3*b)),i=c.i32_add(c.getLocal("x"),c.i32_const(4*b)),o=c.i32_add(c.getLocal("x"),c.i32_const(5*b)),s=c.getLocal("r"),l=c.i32_add(c.getLocal("r"),c.i32_const(b)),u=c.i32_add(c.getLocal("r"),c.i32_const(2*b)),h=c.i32_add(c.getLocal("r"),c.i32_const(3*b)),g=c.i32_add(c.getLocal("r"),c.i32_const(4*b)),m=c.i32_add(c.getLocal("r"),c.i32_const(5*b)),x=c.i32_const(e.alloc(b)),y=c.i32_const(e.alloc(b)),A=c.i32_const(e.alloc(b)),v=c.i32_const(e.alloc(b)),w=c.i32_const(e.alloc(b)),_=c.i32_const(e.alloc(b)),I=c.i32_const(e.alloc(b)),E=c.i32_const(e.alloc(b));a.addCode(c.call(p+"_mul",f,i,I),c.call(p+"_mul",i,c.i32_const(L),x),c.call(p+"_add",f,x,x),c.call(p+"_add",f,i,E),c.call(p+"_mul",E,x,x),c.call(p+"_mul",c.i32_const(L),I,E),c.call(p+"_add",I,E,E),c.call(p+"_sub",x,E,x),c.call(p+"_add",I,I,y),c.call(p+"_mul",n,r,I),c.call(p+"_mul",r,c.i32_const(L),A),c.call(p+"_add",n,A,A),c.call(p+"_add",n,r,E),c.call(p+"_mul",E,A,A),c.call(p+"_mul",c.i32_const(L),I,E),c.call(p+"_add",I,E,E),c.call(p+"_sub",A,E,A),c.call(p+"_add",I,I,v),c.call(p+"_mul",d,o,I),c.call(p+"_mul",o,c.i32_const(L),w),c.call(p+"_add",d,w,w),c.call(p+"_add",d,o,E),c.call(p+"_mul",E,w,w),c.call(p+"_mul",c.i32_const(L),I,E),c.call(p+"_add",I,E,E),c.call(p+"_sub",w,E,w),c.call(p+"_add",I,I,_),c.call(p+"_sub",x,f,s),c.call(p+"_add",s,s,s),c.call(p+"_add",x,s,s),c.call(p+"_add",y,i,g),c.call(p+"_add",g,g,g),c.call(p+"_add",y,g,g),c.call(p+"_mul",_,c.i32_const(k),E),c.call(p+"_add",E,n,h),c.call(p+"_add",h,h,h),c.call(p+"_add",E,h,h),c.call(p+"_sub",w,r,u),c.call(p+"_add",u,u,u),c.call(p+"_add",w,u,u),c.call(p+"_sub",A,d,l),c.call(p+"_add",l,l,l),c.call(p+"_add",A,l,l),c.call(p+"_add",v,o,m),c.call(p+"_add",m,m,m),c.call(p+"_add",v,m,m))}(),function(a,c){const f=function(e){let a=e;const t=[];for(;a>0n;){if(ze(a)){const e=2-Number(a%4n);t.push(e),a-=BigInt(e)}else t.push(0);a>>=1n}return t}(a).map((e=>-1==e?255:e)),d=e.alloc(f),r=e.addFunction(t+"__cyclotomicExp_"+c);r.addParam("x","i32"),r.addParam("r","i32"),r.addLocal("bit","i32"),r.addLocal("i","i32");const n=r.getCodeBuilder(),i=n.getLocal("x"),b=n.getLocal("r"),s=n.i32_const(e.alloc(o));r.addCode(n.call(R+"_conjugate",i,s),n.call(R+"_one",b),n.if(n.teeLocal("bit",n.i32_load8_s(n.i32_const(f.length-1),d)),n.if(n.i32_eq(n.getLocal("bit"),n.i32_const(1)),n.call(R+"_mul",b,i,b),n.call(R+"_mul",b,s,b))),n.setLocal("i",n.i32_const(f.length-2)),n.block(n.loop(n.call(t+"__cyclotomicSquare",b,b),n.if(n.teeLocal("bit",n.i32_load8_s(n.getLocal("i"),d)),n.if(n.i32_eq(n.getLocal("bit"),n.i32_const(1)),n.call(R+"_mul",b,i,b),n.call(R+"_mul",b,s,b))),n.br_if(1,n.i32_eqz(n.getLocal("i"))),n.setLocal("i",n.i32_sub(n.getLocal("i"),n.i32_const(1))),n.br(0))))}(4965661367192848881n,"w0");const a=e.addFunction(t+"__finalExponentiationLastChunk");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.getLocal("x"),d=c.getLocal("r"),r=c.i32_const(e.alloc(o)),n=c.i32_const(e.alloc(o)),i=c.i32_const(e.alloc(o)),s=c.i32_const(e.alloc(o)),l=c.i32_const(e.alloc(o)),u=c.i32_const(e.alloc(o)),h=c.i32_const(e.alloc(o)),g=c.i32_const(e.alloc(o)),m=c.i32_const(e.alloc(o)),x=c.i32_const(e.alloc(o)),y=c.i32_const(e.alloc(o)),A=c.i32_const(e.alloc(o)),v=c.i32_const(e.alloc(o)),w=c.i32_const(e.alloc(o)),_=c.i32_const(e.alloc(o)),I=c.i32_const(e.alloc(o)),E=c.i32_const(e.alloc(o)),C=c.i32_const(e.alloc(o)),M=c.i32_const(e.alloc(o)),B=c.i32_const(e.alloc(o)),S=c.i32_const(e.alloc(o));a.addCode(c.call(t+"__cyclotomicExp_w0",f,r),c.call(R+"_conjugate",r,r),c.call(t+"__cyclotomicSquare",r,n),c.call(t+"__cyclotomicSquare",n,i),c.call(R+"_mul",i,n,s),c.call(t+"__cyclotomicExp_w0",s,l),c.call(R+"_conjugate",l,l),c.call(t+"__cyclotomicSquare",l,u),c.call(t+"__cyclotomicExp_w0",u,h),c.call(R+"_conjugate",h,h),c.call(R+"_conjugate",s,g),c.call(R+"_conjugate",h,m),c.call(R+"_mul",m,l,x),c.call(R+"_mul",x,g,y),c.call(R+"_mul",y,n,A),c.call(R+"_mul",y,l,v),c.call(R+"_mul",v,f,w),c.call(t+"__frobeniusMap1",A,_),c.call(R+"_mul",_,w,I),c.call(t+"__frobeniusMap2",y,E),c.call(R+"_mul",E,I,C),c.call(R+"_conjugate",f,M),c.call(R+"_mul",M,A,B),c.call(t+"__frobeniusMap3",B,S),c.call(R+"_mul",S,C,d))}e.modules[t]={n64:d,pG1gen:v,pG1zero:_,pG1b:u,pG2gen:E,pG2zero:M,pG2b:g,pq:e.modules.f1m.pq,pr:s,pOneT:B,prePSize:U,preQSize:j,r:f.toString(),q:c.toString()};const q=e.alloc(U),G=e.alloc(j);function z(a){const c=e.addFunction(t+"_pairingEq"+a);for(let e=0;e0n;)da(e)?a.push(1):a.push(0),e>>=1n;return a}(),O=e.alloc(R),T=3*i,D=R.length-1,F=R.reduce(((e,a)=>e+(0!=a?1:0)),0),Q=6*r,U=3*r*2+(F+D+1)*T,j=15132376222941642752n;function H(a){const t=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n,151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n],[2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n,1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n,877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n,3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n,2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n,3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n]]],f=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[0n,4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[0n,1n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[0n,793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n]],[[1n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n]]],d=e.addFunction(P+"_frobeniusMap"+a);d.addParam("x","i32"),d.addParam("r","i32");const b=d.getCodeBuilder();for(let c=0;c<6;c++){const s=0==c?b.getLocal("x"):b.i32_add(b.getLocal("x"),b.i32_const(c*i)),l=s,u=b.i32_add(b.getLocal("x"),b.i32_const(c*i+n)),p=0==c?b.getLocal("r"):b.i32_add(b.getLocal("r"),b.i32_const(c*i)),g=p,x=b.i32_add(b.getLocal("r"),b.i32_const(c*i+n)),y=o(t[Math.floor(c/3)][a%12],f[c%3][a%6]),A=e.alloc([...Ve.bigInt2BytesLE(v(y[0]),r),...Ve.bigInt2BytesLE(v(y[1]),r)]);a%2==1?d.addCode(b.call(h+"_copy",l,g),b.call(h+"_neg",u,x),b.call(m+"_mul",p,b.i32_const(A),p)):d.addCode(b.call(m+"_mul",s,b.i32_const(A),p))}function o(e,a){const t=e[0],f=e[1],d=a[0],r=a[1],n=[(t*d-f*r)%c,(t*r+f*d)%c];return ra(n[0])&&(n[0]=n[0]+c),n}}e.modules[t]={n64q:d,n64r:o,n8q:r,n8r:s,pG1gen:_,pG1zero:E,pG1b:p,pG2gen:M,pG2zero:L,pG2b:x,pq:e.modules.f1m.pq,pr:u,pOneT:S,r:f,q:c,prePSize:Q,preQSize:U},function(){const a=e.addFunction(N+"_mul1");a.addParam("pA","i32"),a.addParam("pC1","i32"),a.addParam("pR","i32");const t=a.getCodeBuilder(),c=t.getLocal("pA"),f=t.i32_add(t.getLocal("pA"),t.i32_const(2*n)),d=t.i32_add(t.getLocal("pA"),t.i32_const(4*n)),r=t.getLocal("pC1"),i=t.getLocal("pR"),b=t.i32_add(t.getLocal("pR"),t.i32_const(2*n)),o=t.i32_add(t.getLocal("pR"),t.i32_const(4*n)),s=t.i32_const(e.alloc(2*n)),l=t.i32_const(e.alloc(2*n));a.addCode(t.call(m+"_add",c,f,s),t.call(m+"_add",f,d,l),t.call(m+"_mul",f,r,o),t.call(m+"_mul",l,r,i),t.call(m+"_sub",i,o,i),t.call(m+"_mulNR",i,i),t.call(m+"_mul",s,r,b),t.call(m+"_sub",b,o,b))}(),function(){const a=e.addFunction(N+"_mul01");a.addParam("pA","i32"),a.addParam("pC0","i32"),a.addParam("pC1","i32"),a.addParam("pR","i32");const t=a.getCodeBuilder(),c=t.getLocal("pA"),f=t.i32_add(t.getLocal("pA"),t.i32_const(2*n)),d=t.i32_add(t.getLocal("pA"),t.i32_const(4*n)),r=t.getLocal("pC0"),i=t.getLocal("pC1"),b=t.getLocal("pR"),o=t.i32_add(t.getLocal("pR"),t.i32_const(2*n)),s=t.i32_add(t.getLocal("pR"),t.i32_const(4*n)),l=t.i32_const(e.alloc(2*n)),u=t.i32_const(e.alloc(2*n)),h=t.i32_const(e.alloc(2*n)),p=t.i32_const(e.alloc(2*n));a.addCode(t.call(m+"_mul",c,r,l),t.call(m+"_mul",f,i,u),t.call(m+"_add",c,f,h),t.call(m+"_add",c,d,p),t.call(m+"_add",f,d,b),t.call(m+"_mul",b,i,b),t.call(m+"_sub",b,u,b),t.call(m+"_mulNR",b,b),t.call(m+"_add",b,l,b),t.call(m+"_add",r,i,o),t.call(m+"_mul",o,h,o),t.call(m+"_sub",o,l,o),t.call(m+"_sub",o,u,o),t.call(m+"_mul",p,r,s),t.call(m+"_sub",s,l,s),t.call(m+"_add",s,u,s))}(),function(){const a=e.addFunction(P+"_mul014");a.addParam("pA","i32"),a.addParam("pC0","i32"),a.addParam("pC1","i32"),a.addParam("pC4","i32"),a.addParam("pR","i32");const t=a.getCodeBuilder(),c=t.getLocal("pA"),f=t.i32_add(t.getLocal("pA"),t.i32_const(6*n)),d=t.getLocal("pC0"),r=t.getLocal("pC1"),i=t.getLocal("pC4"),b=t.i32_const(e.alloc(6*n)),o=t.i32_const(e.alloc(6*n)),s=t.i32_const(e.alloc(2*n)),l=t.getLocal("pR"),u=t.i32_add(t.getLocal("pR"),t.i32_const(6*n));a.addCode(t.call(N+"_mul01",c,d,r,b),t.call(N+"_mul1",f,i,o),t.call(m+"_add",r,i,s),t.call(N+"_add",f,c,u),t.call(N+"_mul01",u,d,s,u),t.call(N+"_sub",u,b,u),t.call(N+"_sub",u,o,u),t.call(N+"_copy",o,l),t.call(N+"_mulNR",l,l),t.call(N+"_add",l,b,l))}(),function(){const a=e.addFunction(t+"_ell");a.addParam("pP","i32"),a.addParam("pCoefs","i32"),a.addParam("pF","i32");const c=a.getCodeBuilder(),f=c.getLocal("pP"),d=c.i32_add(c.getLocal("pP"),c.i32_const(r)),i=c.getLocal("pF"),b=c.getLocal("pCoefs"),o=c.i32_add(c.getLocal("pCoefs"),c.i32_const(n)),s=c.i32_add(c.getLocal("pCoefs"),c.i32_const(2*n)),l=c.i32_add(c.getLocal("pCoefs"),c.i32_const(3*n)),u=c.i32_add(c.getLocal("pCoefs"),c.i32_const(4*n)),p=e.alloc(2*n),g=c.i32_const(p),m=c.i32_const(p),x=c.i32_const(p+n),y=e.alloc(2*n),A=c.i32_const(y),v=c.i32_const(y),w=c.i32_const(y+n);a.addCode(c.call(h+"_mul",b,d,m),c.call(h+"_mul",o,d,x),c.call(h+"_mul",s,f,v),c.call(h+"_mul",l,f,w),c.call(P+"_mul014",i,u,A,g,i))}();const $=e.alloc(Q),q=e.alloc(U);function G(a){const c=e.addFunction(t+"_pairingEq"+a);for(let e=0;e0n;){if(da(a)){const e=2-Number(a%4n);t.push(e),a-=BigInt(e)}else t.push(0);a>>=1n}return t}(a).map((e=>-1==e?255:e)),r=e.alloc(d),n=e.addFunction(t+"__cyclotomicExp_"+f);n.addParam("x","i32"),n.addParam("r","i32"),n.addLocal("bit","i32"),n.addLocal("i","i32");const i=n.getCodeBuilder(),o=i.getLocal("x"),s=i.getLocal("r"),l=i.i32_const(e.alloc(b));n.addCode(i.call(P+"_conjugate",o,l),i.call(P+"_one",s),i.if(i.teeLocal("bit",i.i32_load8_s(i.i32_const(d.length-1),r)),i.if(i.i32_eq(i.getLocal("bit"),i.i32_const(1)),i.call(P+"_mul",s,o,s),i.call(P+"_mul",s,l,s))),i.setLocal("i",i.i32_const(d.length-2)),i.block(i.loop(i.call(t+"__cyclotomicSquare",s,s),i.if(i.teeLocal("bit",i.i32_load8_s(i.getLocal("i"),r)),i.if(i.i32_eq(i.getLocal("bit"),i.i32_const(1)),i.call(P+"_mul",s,o,s),i.call(P+"_mul",s,l,s))),i.br_if(1,i.i32_eqz(i.getLocal("i"))),i.setLocal("i",i.i32_sub(i.getLocal("i"),i.i32_const(1))),i.br(0)))),c&&n.addCode(i.call(P+"_conjugate",s,s))}(j,!0,"w0");const a=e.addFunction(t+"_finalExponentiation");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.getLocal("x"),d=c.getLocal("r"),r=c.i32_const(e.alloc(b)),n=c.i32_const(e.alloc(b)),o=c.i32_const(e.alloc(b)),s=c.i32_const(e.alloc(b)),l=c.i32_const(e.alloc(b)),u=c.i32_const(e.alloc(b)),h=c.i32_const(e.alloc(b));a.addCode(c.call(P+"_frobeniusMap6",f,r),c.call(P+"_inverse",f,n),c.call(P+"_mul",r,n,o),c.call(P+"_copy",o,n),c.call(P+"_frobeniusMap2",o,o),c.call(P+"_mul",o,n,o),c.call(t+"__cyclotomicSquare",o,n),c.call(P+"_conjugate",n,n),c.call(t+"__cyclotomicExp_w0",o,s),c.call(t+"__cyclotomicSquare",s,l),c.call(P+"_mul",n,s,u),c.call(t+"__cyclotomicExp_w0",u,n),c.call(t+"__cyclotomicExp_w0",n,r),c.call(t+"__cyclotomicExp_w0",r,h),c.call(P+"_mul",h,l,h),c.call(t+"__cyclotomicExp_w0",h,l),c.call(P+"_conjugate",u,u),c.call(P+"_mul",l,u,l),c.call(P+"_mul",l,o,l),c.call(P+"_conjugate",o,u),c.call(P+"_mul",n,o,n),c.call(P+"_frobeniusMap3",n,n),c.call(P+"_mul",h,u,h),c.call(P+"_frobeniusMap1",h,h),c.call(P+"_mul",s,r,s),c.call(P+"_frobeniusMap2",s,s),c.call(P+"_mul",s,n,s),c.call(P+"_mul",s,h,s),c.call(P+"_mul",s,l,d))}();for(let a=1;a<=5;a++)G(a),e.exportFunction(t+"_pairingEq"+a);!function(){const a=e.addFunction(t+"_pairing");a.addParam("p","i32"),a.addParam("q","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.i32_const(e.alloc(b));a.addCode(c.call(t+"_prepareG1",c.getLocal("p"),c.i32_const($))),a.addCode(c.call(t+"_prepareG2",c.getLocal("q"),c.i32_const(q))),a.addCode(c.call(t+"_millerLoop",c.i32_const($),c.i32_const(q),f)),a.addCode(c.call(t+"_finalExponentiation",f,c.getLocal("r")))}(),e.exportFunction(t+"_pairing"),e.exportFunction(t+"_prepareG1"),e.exportFunction(t+"_prepareG2"),e.exportFunction(t+"_millerLoop"),e.exportFunction(t+"_finalExponentiation"),e.exportFunction(t+"_finalExponentiationOld"),e.exportFunction(t+"__cyclotomicSquare"),e.exportFunction(t+"__cyclotomicExp_w0"),e.exportFunction(N+"_mul1"),e.exportFunction(N+"_mul01"),e.exportFunction(P+"_mul014"),e.exportFunction(g+"_inGroupAffine"),e.exportFunction(g+"_inGroup"),e.exportFunction(y+"_inGroupAffine"),e.exportFunction(y+"_inGroup")};function ba(e,a){let t=e;void 0===a&&0==(a=Math.floor((r(e)-1)/8)+1)&&(a=1);const c=new Uint8Array(a),f=new DataView(c.buffer);let d=0;for(;d>=BigInt(32)):d+2<=a?(f.setUint16(d,Number(t&BigInt(65535)),!0),d+=2,t>>=BigInt(16)):(f.setUint8(d,Number(t&BigInt(255)),!0),d+=1,t>>=BigInt(8));if(t)throw new Error("Number does not fit in this length");return c}const oa=[];for(let e=0;e<256;e++)oa[e]=sa(e,8);function sa(e,a){let t=0,c=e;for(let e=0;e>=1;return t}function la(e,a){return(oa[e>>>24]|oa[e>>>16&255]<<8|oa[e>>>8&255]<<16|oa[255&e]<<24)>>>32-a}function ua(e){return(4294901760&e?(e&=4294901760,16):0)|(4278255360&e?(e&=4278255360,8):0)|(4042322160&e?(e&=4042322160,4):0)|(3435973836&e?(e&=3435973836,2):0)|!!(2863311530&e)}function ha(e,a){const t=e.byteLength/a,c=ua(t);if(t!=1<t){const c=e.slice(f*a,(f+1)*a);e.set(e.slice(t*a,(t+1)*a),f*a),e.set(c,t*a)}}}function pa(e,a){const t=new Uint8Array(a*e.length);for(let c=0;c0;)t>=4?(t-=4,a+=BigInt(f.getUint32(t))<=2?(t-=2,a+=BigInt(f.getUint16(t))<0;)d-4>=0?(d-=4,f.setUint32(d,Number(t&BigInt(4294967295))),t>>=BigInt(32)):d-2>=0?(d-=2,f.setUint16(d,Number(t&BigInt(65535))),t>>=BigInt(16)):(d-=1,f.setUint8(d,Number(t&BigInt(255))),t>>=BigInt(8));if(t)throw new Error("Number does not fit in this length");return c},bitReverse:la,buffReverseBits:ha,buffer2array:ga,leBuff2int:function(e){let a=BigInt(0),t=0;const c=new DataView(e.buffer,e.byteOffset,e.byteLength);for(;t{t[c]=e(a[c])})),t}return a},stringifyFElements:function e(a,t){if("bigint"==typeof t||void 0!==t.eq)return t.toString(10);if(t instanceof Uint8Array)return a.toString(a.e(t));if(Array.isArray(t))return t.map(e.bind(this,a));if("object"==typeof t){const c={};return Object.keys(t).forEach((f=>{c[f]=e(a,t[f])})),c}return t},unstringifyBigInts:function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return BigInt(a);if("string"==typeof a&&/^0x[0-9a-fA-F]+$/.test(a))return BigInt(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){if(null===a)return null;const t={};return Object.keys(a).forEach((c=>{t[c]=e(a[c])})),t}return a},unstringifyFElements:function e(a,t){if("string"==typeof t&&/^[0-9]+$/.test(t))return a.e(t);if("string"==typeof t&&/^0x[0-9a-fA-F]+$/.test(t))return a.e(t);if(Array.isArray(t))return t.map(e.bind(this,a));if("object"==typeof t){if(null===t)return null;const c={};return Object.keys(t).forEach((f=>{c[f]=e(a,t[f])})),c}return t}});const xa=1<<30;class ya{constructor(e){this.buffers=[],this.byteLength=e;for(let a=0;a0;){const e=r+n>xa?xa-r:n,a=new Uint8Array(this.buffers[d].buffer,this.buffers[d].byteOffset+r,e);if(e==t)return a.slice();f||(f=t<=xa?new Uint8Array(t):new ya(t)),f.set(a,t-n),n-=e,d++,r=0}return f}set(e,a){void 0===a&&(a=0);const t=e.byteLength;if(0==t)return;const c=Math.floor(a/xa);if(c==Math.floor((a+t-1)/xa))return e instanceof ya&&1==e.buffers.length?this.buffers[c].set(e.buffers[0],a%xa):this.buffers[c].set(e,a%xa);let f=c,d=a%xa,r=t;for(;r>0;){const a=d+r>xa?xa-d:r,c=e.slice(t-r,t-r+a);new Uint8Array(this.buffers[f].buffer,this.buffers[f].byteOffset+d,a).set(c),r-=a,f++,d=0}}}function Aa(e,a,t,c){return async function(f){const d=Math.floor(f.byteLength/t);if(d*t!==f.byteLength)throw new Error("Invalid buffer size");const r=Math.floor(d/e.concurrency),n=[];for(let i=0;i=0;e--)this.w[e]=this.square(this.w[e+1]);if(!this.eq(this.w[0],this.one))throw new Error("Error calculating roots of unity");this.batchToMontgomery=Aa(e,a+"_batchToMontgomery",this.n8,this.n8),this.batchFromMontgomery=Aa(e,a+"_batchFromMontgomery",this.n8,this.n8)}op2(e,a,t){return this.tm.setBuff(this.pOp1,a),this.tm.setBuff(this.pOp2,t),this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op2Bool(e,a,t){return this.tm.setBuff(this.pOp1,a),this.tm.setBuff(this.pOp2,t),!!this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp2)}op1(e,a){return this.tm.setBuff(this.pOp1,a),this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op1Bool(e,a){return this.tm.setBuff(this.pOp1,a),!!this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp3)}add(e,a){return this.op2("_add",e,a)}eq(e,a){return this.op2Bool("_eq",e,a)}isZero(e){return this.op1Bool("_isZero",e)}sub(e,a){return this.op2("_sub",e,a)}neg(e){return this.op1("_neg",e)}inv(e){return this.op1("_inverse",e)}toMontgomery(e){return this.op1("_toMontgomery",e)}fromMontgomery(e){return this.op1("_fromMontgomery",e)}mul(e,a){return this.op2("_mul",e,a)}div(e,a){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,a),this.tm.instance.exports[this.prefix+"_inverse"](this.pOp2,this.pOp2),this.tm.instance.exports[this.prefix+"_mul"](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}square(e){return this.op1("_square",e)}isSquare(e){return this.op1Bool("_isSquare",e)}sqrt(e){return this.op1("_sqrt",e)}exp(e,a){return a instanceof Uint8Array||(a=E(d(a))),this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,a),this.tm.instance.exports[this.prefix+"_exp"](this.pOp1,this.pOp2,a.byteLength,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}isNegative(e){return this.op1Bool("_isNegative",e)}e(e,a){if(e instanceof Uint8Array)return e;let t=d(e,a);n(t)?(t=g(t),y(t,this.p)&&(t=x(t,this.p)),t=p(this.p,t)):y(t,this.p)&&(t=x(t,this.p));const c=ba(t,this.n8);return this.toMontgomery(c)}toString(e,a){return I(_(this.fromMontgomery(e),0),a)}fromRng(e){let a;const t=new Uint8Array(this.n8);do{a=C;for(let t=0;t{this.reject=a,this.resolve=e}))}}const Ba="data:application/javascript;base64,"+globalThis.btoa('(function thread(self) {\n const MAXMEM = 32767;\n let instance;\n let memory;\n\n if (self) {\n self.onmessage = function(e) {\n let data;\n if (e.data) {\n data = e.data;\n } else {\n data = e;\n }\n\n if (data[0].cmd == "INIT") {\n init(data[0]).then(function() {\n self.postMessage(data.result);\n });\n } else if (data[0].cmd == "TERMINATE") {\n self.close();\n } else {\n const res = runTask(data);\n self.postMessage(res);\n }\n };\n }\n\n async function init(data) {\n const code = new Uint8Array(data.code);\n const wasmModule = await WebAssembly.compile(code);\n memory = new WebAssembly.Memory({initial:data.init, maximum: MAXMEM});\n\n instance = await WebAssembly.instantiate(wasmModule, {\n env: {\n "memory": memory\n }\n });\n }\n\n\n\n function alloc(length) {\n const u32 = new Uint32Array(memory.buffer, 0, 1);\n while (u32[0] & 3) u32[0]++; // Return always aligned pointers\n const res = u32[0];\n u32[0] += length;\n if (u32[0] + length > memory.buffer.byteLength) {\n const currentPages = memory.buffer.byteLength / 0x10000;\n let requiredPages = Math.floor((u32[0] + length) / 0x10000)+1;\n if (requiredPages>MAXMEM) requiredPages=MAXMEM;\n memory.grow(requiredPages-currentPages);\n }\n return res;\n }\n\n function allocBuffer(buffer) {\n const p = alloc(buffer.byteLength);\n setBuffer(p, buffer);\n return p;\n }\n\n function getBuffer(pointer, length) {\n const u8 = new Uint8Array(memory.buffer);\n return new Uint8Array(u8.buffer, u8.byteOffset + pointer, length);\n }\n\n function setBuffer(pointer, buffer) {\n const u8 = new Uint8Array(memory.buffer);\n u8.set(new Uint8Array(buffer), pointer);\n }\n\n function runTask(task) {\n if (task[0].cmd == "INIT") {\n return init(task[0]);\n }\n const ctx = {\n vars: [],\n out: []\n };\n const u32a = new Uint32Array(memory.buffer, 0, 1);\n const oldAlloc = u32a[0];\n for (let i=0; i0;e++)if(0==this.working[e]){const a=this.actionQueue.shift();this.postAction(e,a.data,a.transfers,a.deferred)}}queueAction(e,a){const t=new Ma;if(this.singleThread){const a=this.taskManager(e);t.resolve(a)}else this.actionQueue.push({data:e,transfers:a,deferred:t}),this.processWorks();return t.promise}resetMemory(){this.u32[0]=this.initalPFree}allocBuff(e){const a=this.alloc(e.byteLength);return this.setBuff(a,e),a}getBuff(e,a){return this.u8.slice(e,e+a)}setBuff(e,a){this.u8.set(new Uint8Array(a),e)}alloc(e){for(;3&this.u32[0];)this.u32[0]++;const a=this.u32[0];return this.u32[0]+=e,a}async terminate(){for(let e=0;esetTimeout(e,200)))}}function Sa(e,a){const t=e[a],c=e.Fr,f=e.tm;e[a].batchApplyKey=async function(e,d,r,n,i){let b,o,s,l,u;if(n=n||"affine",i=i||"affine","G1"==a)"jacobian"==n?(s=3*t.F.n8,b="g1m_batchApplyKey"):(s=2*t.F.n8,b="g1m_batchApplyKeyMixed"),l=3*t.F.n8,"jacobian"==i?u=3*t.F.n8:(o="g1m_batchToAffine",u=2*t.F.n8);else if("G2"==a)"jacobian"==n?(s=3*t.F.n8,b="g2m_batchApplyKey"):(s=2*t.F.n8,b="g2m_batchApplyKeyMixed"),l=3*t.F.n8,"jacobian"==i?u=3*t.F.n8:(o="g2m_batchToAffine",u=2*t.F.n8);else{if("Fr"!=a)throw new Error("Invalid group: "+a);b="frm_batchApplyKey",s=t.n8,l=t.n8,u=t.n8}const h=Math.floor(e.byteLength/s),p=Math.floor(h/f.concurrency),g=[];r=c.e(r);let m=c.e(d);for(let a=0;a=0;e--){if(!t.isZero(p))for(let e=0;eb&&(p=b),p<1024&&(p=1024);const g=[];for(let a=0;a(n&&n.debug(`Multiexp end: ${i}: ${a}/${s}`),e))))}const m=await Promise.all(g);let x=t.zero;for(let e=m.length-1;e>=0;e--)x=t.add(x,m[e]);return x}t.multiExp=async function(e,a,t,c){return await d(e,a,"jacobian",t,c)},t.multiExpAffine=async function(e,a,t,c){return await d(e,a,"affine",t,c)}}function Pa(e,a){const t=e[a],c=e.Fr,f=t.tm;async function d(e,n,i,b,o,s){let l,u,h,p,g,m,x,y;i=i||"affine",b=b||"affine","G1"==a?("affine"==i?(l=2*t.F.n8,p="g1m_batchToJacobian"):l=3*t.F.n8,u=3*t.F.n8,n&&(y="g1m_fftFinal"),x="g1m_fftJoin",m="g1m_fftMix","affine"==b?(h=2*t.F.n8,g="g1m_batchToAffine"):h=3*t.F.n8):"G2"==a?("affine"==i?(l=2*t.F.n8,p="g2m_batchToJacobian"):l=3*t.F.n8,u=3*t.F.n8,n&&(y="g2m_fftFinal"),x="g2m_fftJoin",m="g2m_fftMix","affine"==b?(h=2*t.F.n8,g="g2m_batchToAffine"):h=3*t.F.n8):"Fr"==a&&(l=t.n8,u=t.n8,h=t.n8,n&&(y="frm_fftFinal"),m="frm_fftMix",x="frm_fftJoin");let A=!1;Array.isArray(e)?(e=pa(e,l),A=!0):e=e.slice(0,e.byteLength);const v=e.byteLength/l,w=ua(v);if(1<1<<28?new ya(2*s[0].byteLength):new Uint8Array(2*s[0].byteLength),l.set(s[0]),l.set(s[1],s[0].byteLength),l}(e,i,b,o,s):await async function(e,a,t,f,n){let i,b;i=e.slice(0,e.byteLength/2),b=e.slice(e.byteLength/2,e.byteLength);const o=[];[i,b]=await r(i,b,"fftJoinExt",c.one,c.shift,a,"jacobian",f,n),o.push(d(i,!1,"jacobian",t,f,n)),o.push(d(b,!1,"jacobian",t,f,n));const s=await Promise.all(o);let l;return l=s[0].byteLength>1<<28?new ya(2*s[0].byteLength):new Uint8Array(2*s[0].byteLength),l.set(s[0]),l.set(s[1],s[0].byteLength),l}(e,i,b,o,s),A?ga(a,h):a}let _,I,E;n&&(_=c.inv(c.e(v))),ha(e,l);let C=Math.min(16384,v),M=v/C;for(;M=16;)M*=2,C/=2;const B=ua(C),L=[];for(let a=0;a(o&&o.debug(`${s}: fft ${w} mix end: ${a}/${M}`),e))))}E=await Promise.all(L);for(let e=0;e(o&&o.debug(`${s}: fft ${w} join ${e}/${w} ${r+1}/${a} ${n}/${t/2}`),c))))}const r=await Promise.all(d);for(let e=0;e0;a--)I.set(E[a],e),e+=C*h,delete E[a];I.set(E[0].slice(0,(C-1)*h),e),delete E[0]}else for(let e=0;e65536&&(A=65536);const v=[];for(let a=0;a(s&&s.debug(`${l}: fftJoinExt End: ${a}/${y}`),e))))}const w=await Promise.all(v);let _,I;y*g>1<<28?(_=new ya(y*g),I=new ya(y*g)):(_=new Uint8Array(y*g),I=new Uint8Array(y*g));let E=0;for(let e=0;ec.s+1)throw i&&i.error("lagrangeEvaluations input too big"),new Error("lagrangeEvaluations input too big");let u=e.slice(0,e.byteLength/2),h=e.slice(e.byteLength/2,e.byteLength);const p=c.exp(c.shift,s/2),g=c.inv(c.sub(c.one,p));[u,h]=await r(u,h,"prepareLagrangeEvaluation",g,c.shiftInv,f,"jacobian",i,b+" prep");const m=[];let x;return m.push(d(u,!0,"jacobian",n,i,b+" t0")),m.push(d(h,!0,"jacobian",n,i,b+" t1")),[u,h]=await Promise.all(m),x=u.byteLength>1<<28?new ya(2*u.byteLength):new Uint8Array(2*u.byteLength),x.set(u),x.set(h,u.byteLength),x},t.fftMix=async function(e){const d=3*t.F.n8;let r,n;if("G1"==a)r="g1m_fftMix",n="g1m_fftJoin";else if("G2"==a)r="g2m_fftMix",n="g2m_fftJoin";else{if("Fr"!=a)throw new Error("Invalid group");r="frm_fftMix",n="frm_fftJoin"}const i=Math.floor(e.byteLength/d),b=ua(i);let o=1<=0;e--)u.set(l[e][0],h),h+=l[e][0].byteLength;return u}}async function Ra(e){const a=await async function(e,a){const t=new La;t.memory=new WebAssembly.Memory({initial:Ca}),t.u8=new Uint8Array(t.memory.buffer),t.u32=new Uint32Array(t.memory.buffer);const c=await WebAssembly.compile(e.code);if(t.instance=await WebAssembly.instantiate(c,{env:{memory:t.memory}}),t.singleThread=a,t.initalPFree=t.u32[0],t.pq=e.pq,t.pr=e.pr,t.pG1gen=e.pG1gen,t.pG1zero=e.pG1zero,t.pG2gen=e.pG2gen,t.pG2zero=e.pG2zero,t.pOneT=e.pOneT,a)t.code=e.code,t.taskManager=function(){const e=32767;let a,t;async function c(c){const f=new Uint8Array(c.code),d=await WebAssembly.compile(f);t=new WebAssembly.Memory({initial:c.init,maximum:e}),a=await WebAssembly.instantiate(d,{env:{memory:t}})}function f(a){const c=new Uint32Array(t.buffer,0,1);for(;3&c[0];)c[0]++;const f=c[0];if(c[0]+=a,c[0]+a>t.buffer.byteLength){const f=t.buffer.byteLength/65536;let d=Math.floor((c[0]+a)/65536)+1;d>e&&(d=e),t.grow(d-f)}return f}function d(e){const a=f(e.byteLength);return n(a,e),a}function r(e,a){const c=new Uint8Array(t.buffer);return new Uint8Array(c.buffer,c.byteOffset+e,a)}function n(e,a){new Uint8Array(t.buffer).set(new Uint8Array(a),e)}function i(e){if("INIT"==e[0].cmd)return c(e[0]);const i={vars:[],out:[]},b=new Uint32Array(t.buffer,0,1)[0];for(let t=0;t64&&(a=64),t.concurrency=a;for(let e=0;e>8n&0xFFn)),a.push(Number(t>>16n&0xFFn)),a.push(Number(t>>24n&0xFFn)),a}function Qa(e){const a=function(e){for(var a=[],t=0;t>6,128|63&c):c<55296||c>=57344?a.push(224|c>>12,128|c>>6&63,128|63&c):(t++,c=65536+((1023&c)<<10|1023&e.charCodeAt(t)),a.push(240|c>>18,128|c>>12&63,128|c>>6&63,128|63&c))}return a}(e);return[...qa(a.length),...a]}function Ua(e){const a=[];let t=Oa(e);if(Ta(t))throw new Error("Number cannot be negative");for(;!Da(t);)a.push(Number(0x7Fn&t)),t>>=7n;0==a.length&&a.push(0);for(let e=0;e0xFFFFFFFFn)throw new Error("Number too big");if(a>0x7FFFFFFFn&&(a-=0x100000000n),a<-2147483648n)throw new Error("Number too small");return ja(a)}function $a(e){let a=Oa(e);if(a>0xFFFFFFFFFFFFFFFFn)throw new Error("Number too big");if(a>0x7FFFFFFFFFFFFFFFn&&(a-=0x10000000000000000n),a<-9223372036854775808n)throw new Error("Number too small");return ja(a)}function qa(e){let a=Oa(e);if(a>0xFFFFFFFFn)throw new Error("Number too big");return Ua(a)}function Ga(e){return Array.from(e,(function(e){return("0"+(255&e).toString(16)).slice(-2)})).join("")}class za{constructor(e){this.func=e,this.functionName=e.functionName,this.module=e.module}setLocal(e,a){const t=this.func.localIdxByName[e];if(void 0===t)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[...a,33,...qa(t)]}teeLocal(e,a){const t=this.func.localIdxByName[e];if(void 0===t)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[...a,34,...qa(t)]}getLocal(e){const a=this.func.localIdxByName[e];if(void 0===a)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[32,...qa(a)]}i64_load8_s(e,a,t){return[...e,48,void 0===t?0:t,...qa(a||0)]}i64_load8_u(e,a,t){return[...e,49,void 0===t?0:t,...qa(a||0)]}i64_load16_s(e,a,t){return[...e,50,void 0===t?1:t,...qa(a||0)]}i64_load16_u(e,a,t){return[...e,51,void 0===t?1:t,...qa(a||0)]}i64_load32_s(e,a,t){return[...e,52,void 0===t?2:t,...qa(a||0)]}i64_load32_u(e,a,t){return[...e,53,void 0===t?2:t,...qa(a||0)]}i64_load(e,a,t){return[...e,41,void 0===t?3:t,...qa(a||0)]}i64_store(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=3,r=a):Array.isArray(t)?(f=a,d=3,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,55,d,...qa(f)]}i64_store32(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=2,r=a):Array.isArray(t)?(f=a,d=2,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,62,d,...qa(f)]}i64_store16(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=1,r=a):Array.isArray(t)?(f=a,d=1,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,61,d,...qa(f)]}i64_store8(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=0,r=a):Array.isArray(t)?(f=a,d=0,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,60,d,...qa(f)]}i32_load8_s(e,a,t){return[...e,44,void 0===t?0:t,...qa(a||0)]}i32_load8_u(e,a,t){return[...e,45,void 0===t?0:t,...qa(a||0)]}i32_load16_s(e,a,t){return[...e,46,void 0===t?1:t,...qa(a||0)]}i32_load16_u(e,a,t){return[...e,47,void 0===t?1:t,...qa(a||0)]}i32_load(e,a,t){return[...e,40,void 0===t?2:t,...qa(a||0)]}i32_store(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=2,r=a):Array.isArray(t)?(f=a,d=2,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,54,d,...qa(f)]}i32_store16(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=1,r=a):Array.isArray(t)?(f=a,d=1,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,59,d,...qa(f)]}i32_store8(e,a,t,c){let f,d,r;return Array.isArray(a)?(f=0,d=0,r=a):Array.isArray(t)?(f=a,d=0,r=t):Array.isArray(c)&&(f=a,d=t,r=c),[...e,...r,58,d,...qa(f)]}call(e,...a){const t=this.module.functionIdxByName[e];if(void 0===t)throw new Error(`Function not defined: Function: ${e}`);return[...[].concat(...a),16,...qa(t)]}call_indirect(e,...a){return[...[].concat(...a),...e,17,0,0]}if(e,a,t){return t?[...e,4,64,...a,5,...t,11]:[...e,4,64,...a,11]}block(e){return[2,64,...e,11]}loop(...e){return[3,64,...[].concat(...e),11]}br_if(e,a){return[...a,13,...qa(e)]}br(e){return[12,...qa(e)]}ret(e){return[...e,15]}drop(e){return[...e,26]}i64_const(e){return[66,...$a(e)]}i32_const(e){return[65,...Ha(e)]}i64_eqz(e){return[...e,80]}i64_eq(e,a){return[...e,...a,81]}i64_ne(e,a){return[...e,...a,82]}i64_lt_s(e,a){return[...e,...a,83]}i64_lt_u(e,a){return[...e,...a,84]}i64_gt_s(e,a){return[...e,...a,85]}i64_gt_u(e,a){return[...e,...a,86]}i64_le_s(e,a){return[...e,...a,87]}i64_le_u(e,a){return[...e,...a,88]}i64_ge_s(e,a){return[...e,...a,89]}i64_ge_u(e,a){return[...e,...a,90]}i64_add(e,a){return[...e,...a,124]}i64_sub(e,a){return[...e,...a,125]}i64_mul(e,a){return[...e,...a,126]}i64_div_s(e,a){return[...e,...a,127]}i64_div_u(e,a){return[...e,...a,128]}i64_rem_s(e,a){return[...e,...a,129]}i64_rem_u(e,a){return[...e,...a,130]}i64_and(e,a){return[...e,...a,131]}i64_or(e,a){return[...e,...a,132]}i64_xor(e,a){return[...e,...a,133]}i64_shl(e,a){return[...e,...a,134]}i64_shr_s(e,a){return[...e,...a,135]}i64_shr_u(e,a){return[...e,...a,136]}i64_extend_i32_s(e){return[...e,172]}i64_extend_i32_u(e){return[...e,173]}i64_clz(e){return[...e,121]}i64_ctz(e){return[...e,122]}i32_eqz(e){return[...e,69]}i32_eq(e,a){return[...e,...a,70]}i32_ne(e,a){return[...e,...a,71]}i32_lt_s(e,a){return[...e,...a,72]}i32_lt_u(e,a){return[...e,...a,73]}i32_gt_s(e,a){return[...e,...a,74]}i32_gt_u(e,a){return[...e,...a,75]}i32_le_s(e,a){return[...e,...a,76]}i32_le_u(e,a){return[...e,...a,77]}i32_ge_s(e,a){return[...e,...a,78]}i32_ge_u(e,a){return[...e,...a,79]}i32_add(e,a){return[...e,...a,106]}i32_sub(e,a){return[...e,...a,107]}i32_mul(e,a){return[...e,...a,108]}i32_div_s(e,a){return[...e,...a,109]}i32_div_u(e,a){return[...e,...a,110]}i32_rem_s(e,a){return[...e,...a,111]}i32_rem_u(e,a){return[...e,...a,112]}i32_and(e,a){return[...e,...a,113]}i32_or(e,a){return[...e,...a,114]}i32_xor(e,a){return[...e,...a,115]}i32_shl(e,a){return[...e,...a,116]}i32_shr_s(e,a){return[...e,...a,117]}i32_shr_u(e,a){return[...e,...a,118]}i32_rotl(e,a){return[...e,...a,119]}i32_rotr(e,a){return[...e,...a,120]}i32_wrap_i64(e){return[...e,167]}i32_clz(e){return[...e,103]}i32_ctz(e){return[...e,104]}unreachable(){return[0]}current_memory(){return[63,0]}comment(){return[]}}const Ka={i32:127,i64:126,f32:125,f64:124,anyfunc:112,func:96,emptyblock:64};class Va{constructor(e,a,t,c,f){if("import"==t)this.fnType="import",this.moduleName=c,this.fieldName=f;else{if("internal"!=t)throw new Error("Invalid function fnType: "+t);this.fnType="internal"}this.module=e,this.fnName=a,this.params=[],this.locals=[],this.localIdxByName={},this.code=[],this.returnType=null,this.nextLocal=0}addParam(e,a){if(this.localIdxByName[e])throw new Error(`param already exists. Function: ${this.fnName}, Param: ${e} `);const t=this.nextLocal++;this.localIdxByName[e]=t,this.params.push({type:a})}addLocal(e,a,t){const c=t||1;if(this.localIdxByName[e])throw new Error(`local already exists. Function: ${this.fnName}, Param: ${e} `);const f=this.nextLocal++;this.localIdxByName[e]=f,this.locals.push({type:a,length:c})}setReturnType(e){if(this.returnType)throw new Error(`returnType already defined. Function: ${this.fnName}`);this.returnType=e}getSignature(){return[96,...qa(this.params.length),...this.params.map((e=>Ka[e.type])),...this.returnType?[1,Ka[this.returnType]]:[0]]}getBody(){const e=this.locals.map((e=>[...qa(e.length),Ka[e.type]])),a=[...qa(this.locals.length),...[].concat(...e),...this.code,11];return[...qa(a.length),...a]}addCode(...e){this.code.push(...[].concat(...e))}getCodeBuilder(){return new za(this)}}class Za{constructor(){this.functions=[],this.functionIdxByName={},this.nImportFunctions=0,this.nInternalFunctions=0,this.memory={pagesSize:1,moduleName:"env",fieldName:"memory"},this.free=8,this.datas=[],this.modules={},this.exports=[],this.functionsTable=[]}build(){return this._setSignatures(),new Uint8Array([...Fa(1836278016),...Fa(1),...this._buildType(),...this._buildImport(),...this._buildFunctionDeclarations(),...this._buildFunctionsTable(),...this._buildExports(),...this._buildElements(),...this._buildCode(),...this._buildData()])}addFunction(e){if(void 0!==this.functionIdxByName[e])throw new Error(`Function already defined: ${e}`);const a=this.functions.length;return this.functionIdxByName[e]=a,this.functions.push(new Va(this,e,"internal")),this.nInternalFunctions++,this.functions[a]}addIimportFunction(e,a,t){if(void 0!==this.functionIdxByName[e])throw new Error(`Function already defined: ${e}`);if(this.functions.length>0&&"internal"==this.functions[this.functions.length-1].type)throw new Error(`Import functions must be declared before internal: ${e}`);let c=t||e;const f=this.functions.length;return this.functionIdxByName[e]=f,this.functions.push(new Va(this,e,"import",a,c)),this.nImportFunctions++,this.functions[f]}setMemory(e,a,t){this.memory={pagesSize:e,moduleName:a||"env",fieldName:t||"memory"}}exportFunction(e,a){const t=a||e;if(void 0===this.functionIdxByName[e])throw new Error(`Function not defined: ${e}`);const c=this.functionIdxByName[e];t!=e&&(this.functionIdxByName[t]=c),this.exports.push({exportName:t,idx:c})}addFunctionToTable(e){const a=this.functionIdxByName[e];this.functionsTable.push(a)}addData(e,a){this.datas.push({offset:e,bytes:a})}alloc(e,a){let t,c;(Array.isArray(e)||ArrayBuffer.isView(e))&&void 0===a?(t=e.length,c=e):(t=e,c=a),t=1+(t-1>>3)<<3;const f=this.free;return this.free+=t,c&&this.addData(f,c),f}allocString(e){const a=(new globalThis.TextEncoder).encode(e);return this.alloc([...a,0])}_setSignatures(){this.signatures=[];const e={};if(this.functionsTable.length>0){const a=this.functions[this.functionsTable[0]].getSignature();e["s_"+Ga(a)]=0,this.signatures.push(a)}for(let a=0;a=0)c=await async function(e,a){if(!e&&globalThis.curve_bn128)return globalThis.curve_bn128;const t=new Za;t.setMemory(25),na(t),a&&a(t);const c={};c.code=t.build(),c.pq=t.modules.f1m.pq,c.pr=t.modules.frm.pq,c.pG1gen=t.modules.bn128.pG1gen,c.pG1zero=t.modules.bn128.pG1zero,c.pG1b=t.modules.bn128.pG1b,c.pG2gen=t.modules.bn128.pG2gen,c.pG2zero=t.modules.bn128.pG2zero,c.pG2b=t.modules.bn128.pG2b,c.pOneT=t.modules.bn128.pOneT,c.prePSize=t.modules.bn128.prePSize,c.preQSize=t.modules.bn128.preQSize,c.n8q=32,c.n8r=32,c.q=t.modules.bn128.q,c.r=t.modules.bn128.r;const f={name:"bn128",wasm:c,q:d("21888242871839275222246405745257275088696311157297823662689037894645226208583"),r:d("21888242871839275222246405745257275088548364400416034343698204186575808495617"),n8q:32,n8r:32,cofactorG2:d("30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d",16),singleThread:!!e},r=await Ra(f);return r.terminate=async function(){f.singleThread||(globalThis.curve_bn128=null,await this.tm.terminate())},e||(globalThis.curve_bn128=r),r}(a,t);else{if(!(["BLS12381"].indexOf(f)>=0))throw new Error(`Curve not supported: ${e}`);c=await async function(e,a){if(!e&&globalThis.curve_bls12381)return globalThis.curve_bls12381;const t=new Za;t.setMemory(25),ia(t),a&&a(t);const c={};c.code=t.build(),c.pq=t.modules.f1m.pq,c.pr=t.modules.frm.pq,c.pG1gen=t.modules.bls12381.pG1gen,c.pG1zero=t.modules.bls12381.pG1zero,c.pG1b=t.modules.bls12381.pG1b,c.pG2gen=t.modules.bls12381.pG2gen,c.pG2zero=t.modules.bls12381.pG2zero,c.pG2b=t.modules.bls12381.pG2b,c.pOneT=t.modules.bls12381.pOneT,c.prePSize=t.modules.bls12381.prePSize,c.preQSize=t.modules.bls12381.preQSize,c.n8q=48,c.n8r=32,c.q=t.modules.bls12381.q,c.r=t.modules.bls12381.r;const f={name:"bls12381",wasm:c,q:d("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),r:d("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),n8q:48,n8r:32,cofactorG1:d("0x396c8c005555e1568c00aaab0000aaab",16),cofactorG2:d("0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5",16),singleThread:!!e},r=await Ra(f);return r.terminate=async function(){f.singleThread||(globalThis.curve_bls12381=null,await this.tm.terminate())},e||(globalThis.curve_bls12381=r),r}(a,t)}return c}globalThis.curve_bn128=null,globalThis.curve_bls12381=null,d("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),d("21888242871839275222246405745257275088548364400416034343698204186575808495617"),d("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),d("21888242871839275222246405745257275088696311157297823662689037894645226208583");const Wa=B,Ya=ma;class Xa{constructor(e){this.F=e,this.p=Wa.fromString("21888242871839275222246405745257275088548364400416034343698204186575808495617"),this.pm1d2=Wa.div(Wa.sub(this.p,Wa.e(1)),Wa.e(2)),this.Generator=[e.e("995203441582195749578291179787384436505546430278305826713579947235728471134"),e.e("5472060717959818805561601436314318772137091100104008585924551046643952123905")],this.Base8=[e.e("5299619240641551281634865583518297030282874472190772894086521144482721001553"),e.e("16950150798460657717958625567821834550301663161624707787222815936182638968203")],this.order=Wa.fromString("21888242871839275222246405745257275088614511777268538073601725287587578984328"),this.subOrder=Wa.shiftRight(this.order,3),this.A=e.e("168700"),this.D=e.e("168696")}addPoint(e,a){const t=this.F,c=[],f=t.mul(e[0],a[1]),d=t.mul(e[1],a[0]),r=t.mul(t.sub(e[1],t.mul(this.A,e[0])),t.add(a[0],a[1])),n=t.mul(f,d),i=t.mul(this.D,n);return c[0]=t.div(t.add(f,d),t.add(t.one,i)),c[1]=t.div(t.add(r,t.sub(t.mul(this.A,f),d)),t.sub(t.one,i)),c}mulPointEscalar(e,a){const t=this.F;let c=[t.e("0"),t.e("1")],f=a,d=e;for(;!Wa.isZero(f);)Wa.isOdd(f)&&(c=this.addPoint(c,d)),d=this.addPoint(d,d),f=Wa.shiftRight(f,1);return c}inSubgroup(e){const a=this.F;if(!this.inCurve(e))return!1;const t=this.mulPointEscalar(e,this.subOrder);return a.isZero(t[0])&&a.eq(t[1],a.one)}inCurve(e){const a=this.F,t=a.square(e[0]),c=a.square(e[1]);return!!a.eq(a.add(a.mul(this.A,t),c),a.add(a.one,a.mul(a.mul(t,c),this.D)))}packPoint(e){const a=this.F,t=new Uint8Array(32);a.toRprLE(t,0,e[1]);const c=a.toObject(e[0]);return Wa.gt(c,this.pm1d2)&&(t[31]=128|t[31]),t}unpackPoint(e){const a=this.F;let t=!1;const c=new Array(2);if(128&e[31]&&(t=!0,e[31]=127&e[31]),c[1]=a.fromRprLE(e,0),Wa.gt(a.toObject(c[1]),this.p))return null;const f=a.square(c[1]),d=a.div(a.sub(a.one,f),a.sub(this.A,a.mul(this.D,f))),r=a.exp(d,a.half);if(!a.eq(a.one,r))return null;let n=a.sqrt(d);return null==n?null:(t&&(n=a.neg(n)),c[0]=n,c)}}var et=t(72206),at=t(60654),tt=t(48287).Buffer;async function ct(){const e=await async function(){const e=await Ja("bn128",!0);return new Xa(e.Fr)}();return new ft(e)}class ft{constructor(e){this.babyJub=e,this.bases=[]}baseHash(e,a){return"blake"==e?at("blake256").update(a).digest():"blake2b"==e?tt.from(et(32).update(tt.from(a)).digest()):void 0}hash(e,a){(a=a||{}).baseHash=a.baseHash||"blake";const t=this.babyJub,c=this.buffer2bits(e),f=Math.floor((c.length-1)/200)+1;let d=[t.F.zero,t.F.one];for(let e=0;e>1,a[8*t+2]=(4&c)>>2,a[8*t+3]=(8&c)>>3,a[8*t+4]=(16&c)>>4,a[8*t+5]=(32&c)>>5,a[8*t+6]=(64&c)>>6,a[8*t+7]=(128&c)>>7}return a}}var dt=t(31176),rt=t.n(dt);let nt=!1,it=!1;const bt={debug:1,default:2,info:2,warning:3,error:4,off:5};let ot=bt.default,st=null;const lt=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((a=>{try{if("test"!=="test".normalize(a))throw new Error("bad normalize")}catch(t){e.push(a)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var ut,ht;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(ut||(ut={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(ht||(ht={}));const pt="0123456789abcdef";class gt{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,a){const t=e.toLowerCase();null==bt[t]&&this.throwArgumentError("invalid log level name","logLevel",e),ot>bt[t]||console.log.apply(console,a)}debug(...e){this._log(gt.levels.DEBUG,e)}info(...e){this._log(gt.levels.INFO,e)}warn(...e){this._log(gt.levels.WARNING,e)}makeError(e,a,t){if(it)return this.makeError("censored error",a,{});a||(a=gt.errors.UNKNOWN_ERROR),t||(t={});const c=[];Object.keys(t).forEach((e=>{const a=t[e];try{if(a instanceof Uint8Array){let t="";for(let e=0;e>4],t+=pt[15&a[e]];c.push(e+"=Uint8Array(0x"+t+")")}else c.push(e+"="+JSON.stringify(a))}catch(a){c.push(e+"="+JSON.stringify(t[e].toString()))}})),c.push(`code=${a}`),c.push(`version=${this.version}`);const f=e;let d="";switch(a){case ht.NUMERIC_FAULT:{d="NUMERIC_FAULT";const a=e;switch(a){case"overflow":case"underflow":case"division-by-zero":d+="-"+a;break;case"negative-power":case"negative-width":d+="-unsupported";break;case"unbound-bitwise-result":d+="-unbound-result"}break}case ht.CALL_EXCEPTION:case ht.INSUFFICIENT_FUNDS:case ht.MISSING_NEW:case ht.NONCE_EXPIRED:case ht.REPLACEMENT_UNDERPRICED:case ht.TRANSACTION_REPLACED:case ht.UNPREDICTABLE_GAS_LIMIT:d=a}d&&(e+=" [ See: https://links.ethers.org/v5-errors-"+d+" ]"),c.length&&(e+=" ("+c.join(", ")+")");const r=new Error(e);return r.reason=f,r.code=a,Object.keys(t).forEach((function(e){r[e]=t[e]})),r}throwError(e,a,t){throw this.makeError(e,a,t)}throwArgumentError(e,a,t){return this.throwError(e,gt.errors.INVALID_ARGUMENT,{argument:a,value:t})}assert(e,a,t,c){e||this.throwError(a,t,c)}assertArgument(e,a,t,c){e||this.throwArgumentError(a,t,c)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),lt&&this.throwError("platform missing String.prototype.normalize",gt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:lt})}checkSafeUint53(e,a){"number"==typeof e&&(null==a&&(a="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(a,gt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(a,gt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,a,t){t=t?": "+t:"",ea&&this.throwError("too many arguments"+t,gt.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:a})}checkNew(e,a){e!==Object&&null!=e||this.throwError("missing new",gt.errors.MISSING_NEW,{name:a.name})}checkAbstract(e,a){e===a?this.throwError("cannot instantiate abstract class "+JSON.stringify(a.name)+" directly; use a sub-class",gt.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",gt.errors.MISSING_NEW,{name:a.name})}static globalLogger(){return st||(st=new gt("logger/5.7.0")),st}static setCensorship(e,a){if(!e&&a&&this.globalLogger().throwError("cannot permanently disable censorship",gt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),nt){if(!e)return;this.globalLogger().throwError("error censorship permanent",gt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}it=!!e,nt=!!a}static setLogLevel(e){const a=bt[e.toLowerCase()];null!=a?ot=a:gt.globalLogger().warn("invalid log level - "+e)}static from(e){return new gt(e)}}gt.errors=ht,gt.levels=ut;const mt=new gt("bytes/5.7.0");function xt(e){return e.slice||(e.slice=function(){const a=Array.prototype.slice.call(arguments);return xt(new Uint8Array(Array.prototype.slice.apply(e,a)))}),e}function yt(e){return"number"==typeof e&&e==e&&e%1==0}function At(e,a){if(a||(a={}),"number"==typeof e){mt.checkSafeUint53(e,"invalid arrayify value");const a=[];for(;e;)a.unshift(255&e),e=parseInt(String(e/256));return 0===a.length&&a.push(0),xt(new Uint8Array(a))}if(a.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),function(e){return!!e.toHexString}(e)&&(e=e.toHexString()),function(e,a){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||a&&e.length!==2+2*a)}(e)){let t=e.substring(2);t.length%2&&("left"===a.hexPad?t="0"+t:"right"===a.hexPad?t+="0":mt.throwArgumentError("hex data is odd-length","value",e));const c=[];for(let e=0;e=256)return!1}return!0}(e)?xt(new Uint8Array(e)):mt.throwArgumentError("invalid arrayify value","value",e)}function vt(e){return"0x"+rt().keccak_256(At(e))}const wt=new gt("strings/5.7.0");var _t,It;function Et(e,a,t,c,f){if(e===It.BAD_PREFIX||e===It.UNEXPECTED_CONTINUE){let e=0;for(let c=a+1;c>6==2;c++)e++;return e}return e===It.OVERRUN?t.length-a-1:0}function Ct(e,a=_t.current){a!=_t.current&&(wt.checkNormalize(),e=e.normalize(a));let t=[];for(let a=0;a>6|192),t.push(63&c|128);else if(55296==(64512&c)){a++;const f=e.charCodeAt(a);if(a>=e.length||56320!=(64512&f))throw new Error("invalid utf-8 string");const d=65536+((1023&c)<<10)+(1023&f);t.push(d>>18|240),t.push(d>>12&63|128),t.push(d>>6&63|128),t.push(63&d|128)}else t.push(c>>12|224),t.push(c>>6&63|128),t.push(63&c|128)}return At(t)}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(_t||(_t={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(It||(It={})),Object.freeze({error:function(e,a,t,c,f){return wt.throwArgumentError(`invalid codepoint at offset ${a}; ${e}`,"bytes",t)},ignore:Et,replace:function(e,a,t,c,f){return e===It.OVERLONG?(c.push(f),0):(c.push(65533),Et(e,a,t))}});const Mt="mimcsponge";async function Bt(){const e=await Ja("bn128",!0);return new Lt(e.Fr)}class Lt{constructor(e){this.F=e,this.cts=this.getConstants(Mt,220)}getIV(e){const a=this.F;void 0===e&&(e=Mt);const t=vt(Ct(e+"_iv"));return Wa.e(t).mod(a.p)}getConstants(e,a){const t=this.F;void 0===e&&(e=Mt),void 0===a&&(a=220);const c=new Array(a);let f=vt(Ct(Mt));for(let e=1;e{"use strict";t.d(a,{r:()=>c});const c="6.13.2"},35273:(e,a,t)=>{"use strict";t.d(a,{y:()=>R});var c=t(57339),f=t(21228),d=t(30031),r=t(27033),n=t(19353);class i extends f.Ue{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,a){let t=n.V.dereference(a,"string");try{t=(0,d.b)(t)}catch(e){return this._throwError(e.message,a)}return e.writeValue(t)}decode(e){return(0,d.b)((0,r.up)(e.readValue(),20))}}var b=t(88081);class o extends f.Ue{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,a){return this.coder.encode(e,a)}decode(e){return this.coder.decode(e)}}function s(e,a,t){let d=[];if(Array.isArray(t))d=t;else if(t&&"object"==typeof t){let e={};d=a.map((a=>{const f=a.localName;return(0,c.vA)(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:a},value:t}),(0,c.vA)(!e[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:a},value:t}),e[f]=!0,t[f]}))}else(0,c.MR)(!1,"invalid tuple value","tuple",t);(0,c.MR)(a.length===d.length,"types/value length mismatch","tuple",t);let r=new f.AU,n=new f.AU,i=[];a.forEach(((e,a)=>{let t=d[a];if(e.dynamic){let a=n.length;e.encode(n,t);let c=r.writeUpdatableValue();i.push((e=>{c(e+a)}))}else e.encode(r,t)})),i.forEach((e=>{e(r.length)}));let b=e.appendWriter(r);return b+=e.appendWriter(n),b}function l(e,a){let t=[],d=[],r=e.subReader(0);return a.forEach((a=>{let f=null;if(a.dynamic){let t=e.readIndex(),d=r.subReader(t);try{f=a.decode(d)}catch(e){if((0,c.bJ)(e,"BUFFER_OVERRUN"))throw e;f=e,f.baseType=a.name,f.name=a.localName,f.type=a.type}}else try{f=a.decode(e)}catch(e){if((0,c.bJ)(e,"BUFFER_OVERRUN"))throw e;f=e,f.baseType=a.name,f.name=a.localName,f.type=a.type}if(null==f)throw new Error("investigate");t.push(f),d.push(a.localName||null)})),f.Q7.fromItems(t,d)}class u extends f.Ue{coder;length;constructor(e,a,t){super("array",e.type+"["+(a>=0?a:"")+"]",t,-1===a||e.dynamic),(0,b.n)(this,{coder:e,length:a})}defaultValue(){const e=this.coder.defaultValue(),a=[];for(let t=0;te||t<-(e+w))&&this._throwError("value out-of-bounds",a),t=(0,r.JJ)(t,8*f.Yx)}else(t(0,r.dK)(c,8*this.size))&&this._throwError("value out-of-bounds",a);return e.writeValue(t)}decode(e){let a=(0,r.dK)(e.readValue(),8*this.size);return this.signed&&(a=(0,r.ST)(a,8*this.size)),a}}var E=t(87303);class C extends g{constructor(e){super("string",e)}defaultValue(){return""}encode(e,a){return super.encode(e,(0,E.YW)(n.V.dereference(a,"string")))}decode(e){return(0,E._v)(super.decode(e))}}class M extends f.Ue{coders;constructor(e,a){let t=!1;const c=[];e.forEach((e=>{e.dynamic&&(t=!0),c.push(e.type)})),super("tuple","tuple("+c.join(",")+")",a,t),(0,b.n)(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach((a=>{e.push(a.defaultValue())}));const a=this.coders.reduce(((e,a)=>{const t=a.localName;return t&&(e[t]||(e[t]=0),e[t]++),e}),{});return this.coders.forEach(((t,c)=>{let f=t.localName;f&&1===a[f]&&("length"===f&&(f="_length"),null==e[f]&&(e[f]=e[c]))})),Object.freeze(e)}encode(e,a){const t=n.V.dereference(a,"tuple");return s(e,this.coders,t)}decode(e){return l(e,this.coders)}}var B=t(76124);const L=new Map;L.set(0,"GENERIC_PANIC"),L.set(1,"ASSERT_FALSE"),L.set(17,"OVERFLOW"),L.set(18,"DIVIDE_BY_ZERO"),L.set(33,"ENUM_RANGE_ERROR"),L.set(34,"BAD_STORAGE_DATA"),L.set(49,"STACK_UNDERFLOW"),L.set(50,"ARRAY_RANGE_ERROR"),L.set(65,"OUT_OF_MEMORY"),L.set(81,"UNINITIALIZED_FUNCTION_CALL");const S=new RegExp(/^bytes([0-9]*)$/),k=new RegExp(/^(u?int)([0-9]*)$/);let N=null,P=1024;class R{#Se(e){if(e.isArray())return new u(this.#Se(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new M(e.components.map((e=>this.#Se(e))),e.name);switch(e.baseType){case"address":return new i(e.name);case"bool":return new h(e.name);case"string":return new C(e.name);case"bytes":return new m(e.name);case"":return new A(e.name)}let a=e.type.match(k);if(a){let t=parseInt(a[2]||"256");return(0,c.MR)(0!==t&&t<=256&&t%8==0,"invalid "+a[1]+" bit length","param",e),new I(t/8,"int"===a[1],e.name)}if(a=e.type.match(S),a){let t=parseInt(a[1]);return(0,c.MR)(0!==t&&t<=32,"invalid bytes length","param",e),new x(t,e.name)}(0,c.MR)(!1,"invalid type","type",e.type)}getDefaultValue(e){const a=e.map((e=>this.#Se(B.aX.from(e))));return new M(a,"_").defaultValue()}encode(e,a){(0,c.dd)(a.length,e.length,"types/values length mismatch");const t=e.map((e=>this.#Se(B.aX.from(e)))),d=new M(t,"_"),r=new f.AU;return d.encode(r,a),r.data}decode(e,a,t){const c=e.map((e=>this.#Se(B.aX.from(e))));return new M(c,"_").decode(new f.mP(a,t,P))}static _setDefaultMaxInflation(e){(0,c.MR)("number"==typeof e&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),P=e}static defaultAbiCoder(){return null==N&&(N=new R),N}static getBuiltinCallException(e,a,t){return function(e,a,t,f){let r="missing revert data",n=null,i=null;if(t){r="execution reverted";const e=(0,p.q5)(t);if(t=(0,p.c$)(t),0===e.length)r+=" (no data present; likely require(false) occurred",n="require(false)";else if(e.length%32!=4)r+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===(0,p.c$)(e.slice(0,4)))try{n=f.decode(["string"],e.slice(4))[0],i={signature:"Error(string)",name:"Error",args:[n]},r+=`: ${JSON.stringify(n)}`}catch(e){r+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===(0,p.c$)(e.slice(0,4)))try{const a=Number(f.decode(["uint256"],e.slice(4))[0]);i={signature:"Panic(uint256)",name:"Panic",args:[a]},n=`Panic due to ${L.get(a)||"UNKNOWN"}(${a})`,r+=`: ${n}`}catch(e){r+=" (could not decode panic code)"}else r+=" (unknown custom error)"}const b={to:a.to?(0,d.b)(a.to):null,data:a.data||"0x"};return a.from&&(b.from=(0,d.b)(a.from)),(0,c.xz)(r,"CALL_EXCEPTION",{action:e,data:t,reason:n,transaction:b,invocation:null,revert:i})}(e,a,t,R.defaultAbiCoder())}}},21228:(e,a,t)=>{"use strict";t.d(a,{AU:()=>y,Q7:()=>g,Ue:()=>x,Yx:()=>n,mP:()=>A});var c=t(27033),f=t(57339),d=t(36212),r=t(88081);const n=32,i=new Uint8Array(n),b=["then"],o={},s=new WeakMap;function l(e){return s.get(e)}function u(e,a){s.set(e,a)}function h(e,a){const t=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw t.error=a,t}function p(e,a,t){return e.indexOf(null)>=0?a.map(((e,a)=>e instanceof g?p(l(e),e,t):e)):e.reduce(((e,c,f)=>{let d=a.getValue(c);return c in e||(t&&d instanceof g&&(d=p(l(d),d,t)),e[c]=d),e}),{})}class g extends Array{#ke;constructor(...e){const a=e[0];let t=e[1],f=(e[2]||[]).slice(),d=!0;a!==o&&(t=e,f=[],d=!1),super(t.length),t.forEach(((e,a)=>{this[a]=e}));const r=f.reduce(((e,a)=>("string"==typeof a&&e.set(a,(e.get(a)||0)+1),e)),new Map);if(u(this,Object.freeze(t.map(((e,a)=>{const t=f[a];return null!=t&&1===r.get(t)?t:null})))),this.#ke=[],null==this.#ke&&this.#ke,!d)return;Object.freeze(this);const n=new Proxy(this,{get:(e,a,t)=>{if("string"==typeof a){if(a.match(/^[0-9]+$/)){const t=(0,c.WZ)(a,"%index");if(t<0||t>=this.length)throw new RangeError("out of result range");const f=e[t];return f instanceof Error&&h(`index ${t}`,f),f}if(b.indexOf(a)>=0)return Reflect.get(e,a,t);const f=e[a];if(f instanceof Function)return function(...a){return f.apply(this===t?e:this,a)};if(!(a in e))return e.getValue.apply(this===t?e:this,[a])}return Reflect.get(e,a,t)}});return u(n,l(this)),n}toArray(e){const a=[];return this.forEach(((t,c)=>{t instanceof Error&&h(`index ${c}`,t),e&&t instanceof g&&(t=t.toArray(e)),a.push(t)})),a}toObject(e){const a=l(this);return a.reduce(((t,c,d)=>((0,f.vA)(null!=c,`value at index ${d} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),p(a,this,e))),{})}slice(e,a){null==e&&(e=0),e<0&&(e+=this.length)<0&&(e=0),null==a&&(a=this.length),a<0&&(a+=this.length)<0&&(a=0),a>this.length&&(a=this.length);const t=l(this),c=[],f=[];for(let d=e;d{this.#_e[e]=m(a)}}}class A{allowLoose;#_e;#Re;#Oe;#Te;#De;constructor(e,a,t){(0,r.n)(this,{allowLoose:!!a}),this.#_e=(0,d.Lm)(e),this.#Oe=0,this.#Te=null,this.#De=null!=t?t:1024,this.#Re=0}get data(){return(0,d.c$)(this.#_e)}get dataLength(){return this.#_e.length}get consumed(){return this.#Re}get bytes(){return new Uint8Array(this.#_e)}#Fe(e){if(this.#Te)return this.#Te.#Fe(e);this.#Oe+=e,(0,f.vA)(this.#De<1||this.#Oe<=this.#De*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#De} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,d.Lm)(this.#_e),offset:this.#Re,length:e,info:{bytesRead:this.#Oe,dataLength:this.dataLength}})}#Qe(e,a,t){let c=Math.ceil(a/n)*n;return this.#Re+c>this.#_e.length&&(this.allowLoose&&t&&this.#Re+a<=this.#_e.length?c=a:(0,f.vA)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,d.Lm)(this.#_e),length:this.#_e.length,offset:this.#Re+c})),this.#_e.slice(this.#Re,this.#Re+c)}subReader(e){const a=new A(this.#_e.slice(this.#Re+e),this.allowLoose,this.#De);return a.#Te=this,a}readBytes(e,a){let t=this.#Qe(0,e,!!a);return this.#Fe(e),this.#Re+=t.length,t.slice(0,e)}readValue(){return(0,c.Dg)(this.readBytes(n))}readIndex(){return(0,c.Ro)(this.readBytes(n))}}},76124:(e,a,t)=>{"use strict";t.d(a,{FK:()=>$,Pw:()=>V,Zp:()=>K,aX:()=>H,bp:()=>z,hc:()=>J});var c=t(27033),f=t(57339),d=t(88081),r=t(38264);function n(e){const a=new Set;return e.forEach((e=>a.add(e))),Object.freeze(a)}const i=n("external public payable override".split(" ")),b="constant external internal payable private public pure view override",o=n(b.split(" ")),s="constructor error event fallback function receive struct",l=n(s.split(" ")),u="calldata memory storage payable indexed",h=n(u.split(" ")),p=n([s,u,"tuple returns",b].join(" ").split(" ")),g={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},m=new RegExp("^(\\s*)"),x=new RegExp("^([0-9]+)"),y=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),A=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),v=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class w{#Re;#Ue;get offset(){return this.#Re}get length(){return this.#Ue.length-this.#Re}constructor(e){this.#Re=0,this.#Ue=e.slice()}clone(){return new w(this.#Ue)}reset(){this.#Re=0}#je(e=0,a=0){return new w(this.#Ue.slice(e,a).map((a=>Object.freeze(Object.assign({},a,{match:a.match-e,linkBack:a.linkBack-e,linkNext:a.linkNext-e})))))}popKeyword(e){const a=this.peek();if("KEYWORD"!==a.type||!e.has(a.text))throw new Error(`expected keyword ${a.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const a=this.peek();throw new Error(`expected ${e}; got ${a.type} ${JSON.stringify(a.text)}`)}return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const a=this.#je(this.#Re+1,e.match+1);return this.#Re=e.match+1,a}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const a=[];for(;this.#Re=this.#Ue.length)throw new Error("out-of-bounds");return this.#Ue[this.#Re]}peekKeyword(e){const a=this.peekType("KEYWORD");return null!=a&&e.has(a)?a:null}peekType(e){if(0===this.length)return null;const a=this.peek();return a.type===e?a.text:null}pop(){const e=this.peek();return this.#Re++,e}toString(){const e=[];for(let a=this.#Re;a`}}function _(e){const a=[],t=a=>{const t=r0&&"NUMBER"===a[a.length-1].type){const t=a.pop().text;e=t+e,a[a.length-1].value=(0,c.WZ)(t)}if(0===a.length||"BRACKET"!==a[a.length-1].type)throw new Error("missing opening bracket");a[a.length-1].text+=e}}else if(i=n.match(y),i){if(b.text=i[1],r+=b.text.length,p.has(b.text)){b.type="KEYWORD";continue}if(b.text.match(v)){b.type="TYPE";continue}b.type="ID"}else{if(i=n.match(x),!i)throw new Error(`unexpected token ${JSON.stringify(n[0])} at position ${r}`);b.text=i[1],b.type="NUMBER",r+=b.text.length}}return new w(a.map((e=>Object.freeze(e))))}function I(e,a){let t=[];for(const c in a.keys())e.has(c)&&t.push(c);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function E(e,a){if(a.peekKeyword(l)){const t=a.pop().text;if(t!==e)throw new Error(`expected ${e}, got ${t}`)}return a.popType("ID")}function C(e,a){const t=new Set;for(;;){const c=e.peekType("KEYWORD");if(null==c||a&&!a.has(c))break;if(e.pop(),t.has(c))throw new Error(`duplicate keywords: ${JSON.stringify(c)}`);t.add(c)}return Object.freeze(t)}function M(e){let a=C(e,o);return I(a,n("constant payable nonpayable".split(" "))),I(a,n("pure view payable nonpayable".split(" "))),a.has("view")?"view":a.has("pure")?"pure":a.has("payable")?"payable":a.has("nonpayable")?"nonpayable":a.has("constant")?"view":"nonpayable"}function B(e,a){return e.popParams().map((e=>H.from(e,a)))}function L(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return(0,c.Ab)(e.pop().text);throw new Error("invalid gas")}return null}function S(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}const k=new RegExp(/^(.*)\[([0-9]*)\]$/);function N(e){const a=e.match(v);if((0,f.MR)(a,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(a[2]){const t=parseInt(a[2]);(0,f.MR)(0!==t&&t<=32,"invalid bytes length","type",e)}else if(a[3]){const t=parseInt(a[3]);(0,f.MR)(0!==t&&t<=256&&t%8==0,"invalid numeric width","type",e)}return e}const P={},R=Symbol.for("_ethers_internal"),O="_ParamTypeInternal",T="_ErrorInternal",D="_EventInternal",F="_ConstructorInternal",Q="_FallbackInternal",U="_FunctionInternal",j="_StructInternal";class H{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,a,t,c,r,n,i,b){if((0,f.gk)(e,P,"ParamType"),Object.defineProperty(this,R,{value:O}),n&&(n=Object.freeze(n.slice())),"array"===c){if(null==i||null==b)throw new Error("")}else if(null!=i||null!=b)throw new Error("");if("tuple"===c){if(null==n)throw new Error("")}else if(null!=n)throw new Error("");(0,d.n)(this,{name:a,type:t,baseType:c,indexed:r,components:n,arrayLength:i,arrayChildren:b})}format(e){if(null==e&&(e="sighash"),"json"===e){const a=this.name||"";if(this.isArray()){const e=JSON.parse(this.arrayChildren.format("json"));return e.name=a,e.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(e)}const t={type:"tuple"===this.baseType?"tuple":this.type,name:a};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.isTuple()&&(t.components=this.components.map((a=>JSON.parse(a.format(e))))),JSON.stringify(t)}let a="";return this.isArray()?(a+=this.arrayChildren.format(e),a+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?a+="("+this.components.map((a=>a.format(e))).join("full"===e?", ":",")+")":a+=this.type,"sighash"!==e&&(!0===this.indexed&&(a+=" indexed"),"full"===e&&this.name&&(a+=" "+this.name)),a}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,a){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const t=this;return e.map((e=>t.arrayChildren.walk(e,a)))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const t=this;return e.map(((e,c)=>t.components[c].walk(e,a)))}return a(this.type,e)}#He(e,a,t,c){if(this.isArray()){if(!Array.isArray(a))throw new Error("invalid array value");if(-1!==this.arrayLength&&a.length!==this.arrayLength)throw new Error("array is wrong length");const f=this.arrayChildren,d=a.slice();return d.forEach(((a,c)=>{f.#He(e,a,t,(e=>{d[c]=e}))})),void c(d)}if(this.isTuple()){const f=this.components;let d;if(Array.isArray(a))d=a.slice();else{if(null==a||"object"!=typeof a)throw new Error("invalid tuple value");d=f.map((e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in a))throw new Error(`missing value for component ${e.name}`);return a[e.name]}))}if(d.length!==this.components.length)throw new Error("array is wrong length");return d.forEach(((a,c)=>{f[c].#He(e,a,t,(e=>{d[c]=e}))})),void c(d)}const f=t(this.type,a);f.then?e.push(async function(){c(await f)}()):c(f)}async walkAsync(e,a){const t=[],c=[e];return this.#He(t,e,a,(e=>{c[0]=e})),t.length&&await Promise.all(t),c[0]}static from(e,a){if(H.isParamType(e))return e;if("string"==typeof e)try{return H.from(_(e),a)}catch(a){(0,f.MR)(!1,"invalid param type","obj",e)}else if(e instanceof w){let t="",c="",f=null;C(e,n(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",f=e.popParams().map((e=>H.from(e))),t=`tuple(${f.map((e=>e.format())).join(",")})`):(t=N(e.popType("TYPE")),c=t);let d=null,r=null;for(;e.length&&e.peekType("BRACKET");){const a=e.pop();d=new H(P,"",t,c,null,f,r,d),r=a.value,t+=a.text,c="array",f=null}let i=null;if(C(e,h).has("indexed")){if(!a)throw new Error("");i=!0}const b=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new H(P,b,t,c,i,f,r,d)}const t=e.name;(0,f.MR)(!t||"string"==typeof t&&t.match(A),"invalid name","obj.name",t);let c=e.indexed;null!=c&&((0,f.MR)(a,"parameter cannot be indexed","obj.indexed",e.indexed),c=!!c);let d=e.type,r=d.match(k);if(r){const a=parseInt(r[2]||"-1"),f=H.from({type:r[1],components:e.components});return new H(P,t||"",d,"array",c,null,a,f)}if("tuple"===d||d.startsWith("tuple(")||d.startsWith("(")){const a=null!=e.components?e.components.map((e=>H.from(e))):null;return new H(P,t||"",d,"tuple",c,a,null,null)}return d=N(e.type),new H(P,t||"",d,d,c,null,null,null)}static isParamType(e){return e&&e[R]===O}}class ${type;inputs;constructor(e,a,t){(0,f.gk)(e,P,"Fragment"),t=Object.freeze(t.slice()),(0,d.n)(this,{type:a,inputs:t})}static from(e){if("string"==typeof e){try{$.from(JSON.parse(e))}catch(e){}return $.from(_(e))}if(e instanceof w)switch(e.peekKeyword(l)){case"constructor":return V.from(e);case"error":return z.from(e);case"event":return K.from(e);case"fallback":case"receive":return Z.from(e);case"function":return J.from(e);case"struct":return W.from(e)}else if("object"==typeof e){switch(e.type){case"constructor":return V.from(e);case"error":return z.from(e);case"event":return K.from(e);case"fallback":case"receive":return Z.from(e);case"function":return J.from(e);case"struct":return W.from(e)}(0,f.vA)(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,f.MR)(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return V.isFragment(e)}static isError(e){return z.isFragment(e)}static isEvent(e){return K.isFragment(e)}static isFunction(e){return J.isFragment(e)}static isStruct(e){return W.isFragment(e)}}class q extends ${name;constructor(e,a,t,c){super(e,a,c),(0,f.MR)("string"==typeof t&&t.match(A),"invalid identifier","name",t),c=Object.freeze(c.slice()),(0,d.n)(this,{name:t})}}function G(e,a){return"("+a.map((a=>a.format(e))).join("full"===e?", ":",")+")"}class z extends q{constructor(e,a,t){super(e,"error",a,t),Object.defineProperty(this,R,{value:T})}get selector(){return(0,r.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((a=>JSON.parse(a.format(e))))});const a=[];return"sighash"!==e&&a.push("error"),a.push(this.name+G(e,this.inputs)),a.join(" ")}static from(e){if(z.isFragment(e))return e;if("string"==typeof e)return z.from(_(e));if(e instanceof w){const a=E("error",e),t=B(e);return S(e),new z(P,a,t)}return new z(P,e.name,e.inputs?e.inputs.map(H.from):[])}static isFragment(e){return e&&e[R]===T}}class K extends q{anonymous;constructor(e,a,t,c){super(e,"event",a,t),Object.defineProperty(this,R,{value:D}),(0,d.n)(this,{anonymous:c})}get topicHash(){return(0,r.id)(this.format("sighash"))}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((a=>JSON.parse(a.format(e))))});const a=[];return"sighash"!==e&&a.push("event"),a.push(this.name+G(e,this.inputs)),"sighash"!==e&&this.anonymous&&a.push("anonymous"),a.join(" ")}static getTopicHash(e,a){return a=(a||[]).map((e=>H.from(e))),new K(P,e,a,!1).topicHash}static from(e){if(K.isFragment(e))return e;if("string"==typeof e)try{return K.from(_(e))}catch(a){(0,f.MR)(!1,"invalid event fragment","obj",e)}else if(e instanceof w){const a=E("event",e),t=B(e,!0),c=!!C(e,n(["anonymous"])).has("anonymous");return S(e),new K(P,a,t,c)}return new K(P,e.name,e.inputs?e.inputs.map((e=>H.from(e,!0))):[],!!e.anonymous)}static isFragment(e){return e&&e[R]===D}}class V extends ${payable;gas;constructor(e,a,t,c,f){super(e,a,t),Object.defineProperty(this,R,{value:F}),(0,d.n)(this,{payable:c,gas:f})}format(e){if((0,f.vA)(null!=e&&"sighash"!==e,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===e)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((a=>JSON.parse(a.format(e))))});const a=[`constructor${G(e,this.inputs)}`];return this.payable&&a.push("payable"),null!=this.gas&&a.push(`@${this.gas.toString()}`),a.join(" ")}static from(e){if(V.isFragment(e))return e;if("string"==typeof e)try{return V.from(_(e))}catch(a){(0,f.MR)(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof w){C(e,n(["constructor"]));const a=B(e),t=!!C(e,i).has("payable"),c=L(e);return S(e),new V(P,"constructor",a,t,c)}return new V(P,"constructor",e.inputs?e.inputs.map(H.from):[],!!e.payable,null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[R]===F}}class Z extends ${payable;constructor(e,a,t){super(e,"fallback",a),Object.defineProperty(this,R,{value:Q}),(0,d.n)(this,{payable:t})}format(e){const a=0===this.inputs.length?"receive":"fallback";if("json"===e){const e=this.payable?"payable":"nonpayable";return JSON.stringify({type:a,stateMutability:e})}return`${a}()${this.payable?" payable":""}`}static from(e){if(Z.isFragment(e))return e;if("string"==typeof e)try{return Z.from(_(e))}catch(a){(0,f.MR)(!1,"invalid fallback fragment","obj",e)}else if(e instanceof w){const a=e.toString(),t=e.peekKeyword(n(["fallback","receive"]));if((0,f.MR)(t,"type must be fallback or receive","obj",a),"receive"===e.popKeyword(n(["fallback","receive"]))){const a=B(e);return(0,f.MR)(0===a.length,"receive cannot have arguments","obj.inputs",a),C(e,n(["payable"])),S(e),new Z(P,[],!0)}let c=B(e);c.length?(0,f.MR)(1===c.length&&"bytes"===c[0].type,"invalid fallback inputs","obj.inputs",c.map((e=>e.format("minimal"))).join(", ")):c=[H.from("bytes")];const d=M(e);if((0,f.MR)("nonpayable"===d||"payable"===d,"fallback cannot be constants","obj.stateMutability",d),C(e,n(["returns"])).has("returns")){const a=B(e);(0,f.MR)(1===a.length&&"bytes"===a[0].type,"invalid fallback outputs","obj.outputs",a.map((e=>e.format("minimal"))).join(", "))}return S(e),new Z(P,c,"payable"===d)}if("receive"===e.type)return new Z(P,[],!0);if("fallback"===e.type){const a=[H.from("bytes")],t="payable"===e.stateMutability;return new Z(P,a,t)}(0,f.MR)(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[R]===Q}}class J extends q{constant;outputs;stateMutability;payable;gas;constructor(e,a,t,c,f,r){super(e,"function",a,c),Object.defineProperty(this,R,{value:U}),f=Object.freeze(f.slice());const n="view"===t||"pure"===t,i="payable"===t;(0,d.n)(this,{constant:n,gas:r,outputs:f,payable:i,stateMutability:t})}get selector(){return(0,r.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((a=>JSON.parse(a.format(e)))),outputs:this.outputs.map((a=>JSON.parse(a.format(e))))});const a=[];return"sighash"!==e&&a.push("function"),a.push(this.name+G(e,this.inputs)),"sighash"!==e&&("nonpayable"!==this.stateMutability&&a.push(this.stateMutability),this.outputs&&this.outputs.length&&(a.push("returns"),a.push(G(e,this.outputs))),null!=this.gas&&a.push(`@${this.gas.toString()}`)),a.join(" ")}static getSelector(e,a){return a=(a||[]).map((e=>H.from(e))),new J(P,e,"view",a,[],null).selector}static from(e){if(J.isFragment(e))return e;if("string"==typeof e)try{return J.from(_(e))}catch(a){(0,f.MR)(!1,"invalid function fragment","obj",e)}else if(e instanceof w){const a=E("function",e),t=B(e),c=M(e);let f=[];C(e,n(["returns"])).has("returns")&&(f=B(e));const d=L(e);return S(e),new J(P,a,c,t,f,d)}let a=e.stateMutability;return null==a&&(a="payable","boolean"==typeof e.constant?(a="view",e.constant||(a="payable","boolean"!=typeof e.payable||e.payable||(a="nonpayable"))):"boolean"!=typeof e.payable||e.payable||(a="nonpayable")),new J(P,e.name,a,e.inputs?e.inputs.map(H.from):[],e.outputs?e.outputs.map(H.from):[],null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[R]===U}}class W extends q{constructor(e,a,t){super(e,"struct",a,t),Object.defineProperty(this,R,{value:j})}format(){throw new Error("@TODO")}static from(e){if("string"==typeof e)try{return W.from(_(e))}catch(a){(0,f.MR)(!1,"invalid struct fragment","obj",e)}else if(e instanceof w){const a=E("struct",e),t=B(e);return S(e),new W(P,a,t)}return new W(P,e.name,e.inputs?e.inputs.map(H.from):[])}static isFragment(e){return e&&e[R]===j}}},73622:(e,a,t)=>{"use strict";t.d(a,{KA:()=>y});var c=t(15539),f=t(38264),d=t(88081),r=t(57339),n=t(36212),i=t(27033),b=t(35273),o=t(21228),s=t(76124),l=t(19353);class u{fragment;name;signature;topic;args;constructor(e,a,t){const c=e.name,f=e.format();(0,d.n)(this,{fragment:e,name:c,signature:f,topic:a,args:t})}}class h{fragment;name;args;signature;selector;value;constructor(e,a,t,c){const f=e.name,r=e.format();(0,d.n)(this,{fragment:e,name:f,args:t,signature:r,selector:a,value:c})}}class p{fragment;name;args;signature;selector;constructor(e,a,t){const c=e.name,f=e.format();(0,d.n)(this,{fragment:e,name:c,args:t,signature:f,selector:a})}}class g{hash;_isIndexed;static isIndexed(e){return!(!e||!e._isIndexed)}constructor(e){(0,d.n)(this,{hash:e,_isIndexed:!0})}}const m={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},x={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let a="unknown panic code";return e>=0&&e<=255&&m[e.toString()]&&(a=m[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${a})`}}};class y{fragments;deploy;fallback;receive;#$e;#qe;#Ge;#ze;constructor(e){let a=[];a="string"==typeof e?JSON.parse(e):e,this.#Ge=new Map,this.#$e=new Map,this.#qe=new Map;const t=[];for(const e of a)try{t.push(s.FK.from(e))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(e)}:`,a.message)}(0,d.n)(this,{fragments:Object.freeze(t)});let c=null,f=!1;this.#ze=this.getAbiCoder(),this.fragments.forEach(((e,a)=>{let t;switch(e.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void(0,d.n)(this,{deploy:e});case"fallback":return void(0===e.inputs.length?f=!0:((0,r.MR)(!c||e.payable!==c.payable,"conflicting fallback fragments",`fragments[${a}]`,e),c=e,f=c.payable));case"function":t=this.#Ge;break;case"event":t=this.#qe;break;case"error":t=this.#$e;break;default:return}const n=e.format();t.has(n)||t.set(n,e)})),this.deploy||(0,d.n)(this,{deploy:s.Pw.from("constructor()")}),(0,d.n)(this,{fallback:c,receive:f})}format(e){const a=e?"minimal":"full";return this.fragments.map((e=>e.format(a)))}formatJson(){const e=this.fragments.map((e=>e.format("json")));return JSON.stringify(e.map((e=>JSON.parse(e))))}getAbiCoder(){return b.y.defaultAbiCoder()}#Ke(e,a,t){if((0,n.Lo)(e)){const a=e.toLowerCase();for(const e of this.#Ge.values())if(a===e.selector)return e;return null}if(-1===e.indexOf("(")){const c=[];for(const[a,t]of this.#Ge)a.split("(")[0]===e&&c.push(t);if(a){const e=a.length>0?a[a.length-1]:null;let t=a.length,f=!0;l.V.isTyped(e)&&"overrides"===e.type&&(f=!1,t--);for(let e=c.length-1;e>=0;e--){const a=c[e].inputs.length;a===t||f&&a===t-1||c.splice(e,1)}for(let e=c.length-1;e>=0;e--){const t=c[e].inputs;for(let f=0;f=t.length){if("overrides"===a[f].type)continue;c.splice(e,1);break}if(a[f].type!==t[f].baseType){c.splice(e,1);break}}}}if(1===c.length&&a&&a.length!==c[0].inputs.length){const e=a[a.length-1];(null==e||Array.isArray(e)||"object"!=typeof e)&&c.splice(0,1)}if(0===c.length)return null;if(c.length>1&&t){const a=c.map((e=>JSON.stringify(e.format()))).join(", ");(0,r.MR)(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return c[0]}return this.#Ge.get(s.hc.from(e).format())||null}getFunctionName(e){const a=this.#Ke(e,null,!1);return(0,r.MR)(a,"no matching function","key",e),a.name}hasFunction(e){return!!this.#Ke(e,null,!1)}getFunction(e,a){return this.#Ke(e,a||null,!0)}forEachFunction(e){const a=Array.from(this.#Ge.keys());a.sort(((e,a)=>e.localeCompare(a)));for(let t=0;t=0;e--)c[e].inputs.length=0;e--){const t=c[e].inputs;for(let f=0;f1&&t){const a=c.map((e=>JSON.stringify(e.format()))).join(", ");(0,r.MR)(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return c[0]}return this.#qe.get(s.Zp.from(e).format())||null}getEventName(e){const a=this.#Ve(e,null,!1);return(0,r.MR)(a,"no matching event","key",e),a.name}hasEvent(e){return!!this.#Ve(e,null,!1)}getEvent(e,a){return this.#Ve(e,a||null,!0)}forEachEvent(e){const a=Array.from(this.#qe.keys());a.sort(((e,a)=>e.localeCompare(a)));for(let t=0;t1){const t=a.map((e=>JSON.stringify(e.format()))).join(", ");(0,r.MR)(!1,`ambiguous error description (i.e. ${t})`,"name",e)}return a[0]}if("Error(string)"===(e=s.bp.from(e).format()))return s.bp.from("error Error(string)");if("Panic(uint256)"===e)return s.bp.from("error Panic(uint256)");return this.#$e.get(e)||null}forEachError(e){const a=Array.from(this.#$e.keys());a.sort(((e,a)=>e.localeCompare(a)));for(let t=0;t"string"===e.type?(0,f.id)(a):"bytes"===e.type?(0,c.S)((0,n.c$)(a)):("bool"===e.type&&"boolean"==typeof a?a=a?"0x01":"0x00":e.type.match(/^u?int/)?a=(0,i.up)(a):e.type.match(/^bytes/)?a=(0,n.X_)(a,32):"address"===e.type&&this.#ze.encode(["address"],[a]),(0,n.nx)((0,n.c$)(a),32));for(a.forEach(((a,c)=>{const f=e.inputs[c];f.indexed?null==a?t.push(null):"array"===f.baseType||"tuple"===f.baseType?(0,r.MR)(!1,"filtering with tuples or arrays not supported","contract."+f.name,a):Array.isArray(a)?t.push(a.map((e=>d(f,e)))):t.push(d(f,a)):(0,r.MR)(null==a,"cannot filter non-indexed parameters; must be null","contract."+f.name,a)}));t.length&&null===t[t.length-1];)t.pop();return t}encodeEventLog(e,a){if("string"==typeof e){const a=this.getEvent(e);(0,r.MR)(a,"unknown event","eventFragment",e),e=a}const t=[],d=[],n=[];return e.anonymous||t.push(e.topicHash),(0,r.MR)(a.length===e.inputs.length,"event arguments/values mismatch","values",a),e.inputs.forEach(((e,r)=>{const i=a[r];if(e.indexed)if("string"===e.type)t.push((0,f.id)(i));else if("bytes"===e.type)t.push((0,c.S)(i));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");t.push(this.#ze.encode([e.type],[i]))}else d.push(e),n.push(i)})),{data:this.#ze.encode(d,n),topics:t}}decodeEventLog(e,a,t){if("string"==typeof e){const a=this.getEvent(e);(0,r.MR)(a,"unknown event","eventFragment",e),e=a}if(null!=t&&!e.anonymous){const a=e.topicHash;(0,r.MR)((0,n.Lo)(t[0],32)&&t[0].toLowerCase()===a,"fragment/topic mismatch","topics[0]",t[0]),t=t.slice(1)}const c=[],f=[],d=[];e.inputs.forEach(((e,a)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(c.push(s.aX.from({type:"bytes32",name:e.name})),d.push(!0)):(c.push(e),d.push(!1)):(f.push(e),d.push(!1))}));const i=null!=t?this.#ze.decode(c,(0,n.xW)(t)):null,b=this.#ze.decode(f,a,!0),l=[],u=[];let h=0,p=0;return e.inputs.forEach(((e,a)=>{let t=null;if(e.indexed)if(null==i)t=new g(null);else if(d[a])t=new g(i[p++]);else try{t=i[p++]}catch(e){t=e}else try{t=b[h++]}catch(e){t=e}l.push(t),u.push(e.name||null)})),o.Q7.fromItems(l,u)}parseTransaction(e){const a=(0,n.q5)(e.data,"tx.data"),t=(0,i.Ab)(null!=e.value?e.value:0,"tx.value"),c=this.getFunction((0,n.c$)(a.slice(0,4)));if(!c)return null;const f=this.#ze.decode(c.inputs,a.slice(4));return new h(c,c.selector,f,t)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const a=this.getEvent(e.topics[0]);return!a||a.anonymous?null:new u(a,a.topicHash,this.decodeEventLog(a,e.data,e.topics))}parseError(e){const a=(0,n.c$)(e),t=this.getError((0,n.ZG)(a,0,4));if(!t)return null;const c=this.#ze.decode(t.inputs,(0,n.ZG)(a,4));return new p(t,t.selector,c)}static from(e){return e instanceof y?e:"string"==typeof e?new y(JSON.parse(e)):"function"==typeof e.formatJson?new y(e.formatJson()):"function"==typeof e.format?new y(e.format("json")):new y(e)}}},19353:(e,a,t)=>{"use strict";t.d(a,{V:()=>b});var c=t(57339),f=t(88081);const d={};function r(e,a){let t=!1;return a<0&&(t=!0,a*=-1),new b(d,`${t?"":"u"}int${a}`,e,{signed:t,width:a})}function n(e,a){return new b(d,`bytes${a||""}`,e,{size:a})}const i=Symbol.for("_ethers_typed");class b{type;value;#ee;_typedSymbol;constructor(e,a,t,r){null==r&&(r=null),(0,c.gk)(d,e,"Typed"),(0,f.n)(this,{_typedSymbol:i,type:a,value:t}),this.#ee=r,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map((e=>e.format())).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return this.#ee}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===this.#ee?-1:!1===this.#ee?this.value.length:null}static from(e,a){return new b(d,e,a)}static uint8(e){return r(e,8)}static uint16(e){return r(e,16)}static uint24(e){return r(e,24)}static uint32(e){return r(e,32)}static uint40(e){return r(e,40)}static uint48(e){return r(e,48)}static uint56(e){return r(e,56)}static uint64(e){return r(e,64)}static uint72(e){return r(e,72)}static uint80(e){return r(e,80)}static uint88(e){return r(e,88)}static uint96(e){return r(e,96)}static uint104(e){return r(e,104)}static uint112(e){return r(e,112)}static uint120(e){return r(e,120)}static uint128(e){return r(e,128)}static uint136(e){return r(e,136)}static uint144(e){return r(e,144)}static uint152(e){return r(e,152)}static uint160(e){return r(e,160)}static uint168(e){return r(e,168)}static uint176(e){return r(e,176)}static uint184(e){return r(e,184)}static uint192(e){return r(e,192)}static uint200(e){return r(e,200)}static uint208(e){return r(e,208)}static uint216(e){return r(e,216)}static uint224(e){return r(e,224)}static uint232(e){return r(e,232)}static uint240(e){return r(e,240)}static uint248(e){return r(e,248)}static uint256(e){return r(e,256)}static uint(e){return r(e,256)}static int8(e){return r(e,-8)}static int16(e){return r(e,-16)}static int24(e){return r(e,-24)}static int32(e){return r(e,-32)}static int40(e){return r(e,-40)}static int48(e){return r(e,-48)}static int56(e){return r(e,-56)}static int64(e){return r(e,-64)}static int72(e){return r(e,-72)}static int80(e){return r(e,-80)}static int88(e){return r(e,-88)}static int96(e){return r(e,-96)}static int104(e){return r(e,-104)}static int112(e){return r(e,-112)}static int120(e){return r(e,-120)}static int128(e){return r(e,-128)}static int136(e){return r(e,-136)}static int144(e){return r(e,-144)}static int152(e){return r(e,-152)}static int160(e){return r(e,-160)}static int168(e){return r(e,-168)}static int176(e){return r(e,-176)}static int184(e){return r(e,-184)}static int192(e){return r(e,-192)}static int200(e){return r(e,-200)}static int208(e){return r(e,-208)}static int216(e){return r(e,-216)}static int224(e){return r(e,-224)}static int232(e){return r(e,-232)}static int240(e){return r(e,-240)}static int248(e){return r(e,-248)}static int256(e){return r(e,-256)}static int(e){return r(e,-256)}static bytes1(e){return n(e,1)}static bytes2(e){return n(e,2)}static bytes3(e){return n(e,3)}static bytes4(e){return n(e,4)}static bytes5(e){return n(e,5)}static bytes6(e){return n(e,6)}static bytes7(e){return n(e,7)}static bytes8(e){return n(e,8)}static bytes9(e){return n(e,9)}static bytes10(e){return n(e,10)}static bytes11(e){return n(e,11)}static bytes12(e){return n(e,12)}static bytes13(e){return n(e,13)}static bytes14(e){return n(e,14)}static bytes15(e){return n(e,15)}static bytes16(e){return n(e,16)}static bytes17(e){return n(e,17)}static bytes18(e){return n(e,18)}static bytes19(e){return n(e,19)}static bytes20(e){return n(e,20)}static bytes21(e){return n(e,21)}static bytes22(e){return n(e,22)}static bytes23(e){return n(e,23)}static bytes24(e){return n(e,24)}static bytes25(e){return n(e,25)}static bytes26(e){return n(e,26)}static bytes27(e){return n(e,27)}static bytes28(e){return n(e,28)}static bytes29(e){return n(e,29)}static bytes30(e){return n(e,30)}static bytes31(e){return n(e,31)}static bytes32(e){return n(e,32)}static address(e){return new b(d,"address",e)}static bool(e){return new b(d,"bool",!!e)}static bytes(e){return new b(d,"bytes",e)}static string(e){return new b(d,"string",e)}static array(e,a){throw new Error("not implemented yet")}static tuple(e,a){throw new Error("not implemented yet")}static overrides(e){return new b(d,"overrides",Object.assign({},e))}static isTyped(e){return e&&"object"==typeof e&&"_typedSymbol"in e&&e._typedSymbol===i}static dereference(e,a){if(b.isTyped(e)){if(e.type!==a)throw new Error(`invalid type: expecetd ${a}, got ${e.type}`);return e.value}return e}}},30031:(e,a,t)=>{"use strict";t.d(a,{b:()=>l});var c=t(15539),f=t(36212),d=t(57339);const r=BigInt(0),n=BigInt(36);function i(e){const a=(e=e.toLowerCase()).substring(2).split(""),t=new Uint8Array(40);for(let e=0;e<40;e++)t[e]=a[e].charCodeAt(0);const d=(0,f.q5)((0,c.S)(t));for(let e=0;e<40;e+=2)d[e>>1]>>4>=8&&(a[e]=a[e].toUpperCase()),(15&d[e>>1])>=8&&(a[e+1]=a[e+1].toUpperCase());return"0x"+a.join("")}const b={};for(let e=0;e<10;e++)b[String(e)]=String(e);for(let e=0;e<26;e++)b[String.fromCharCode(65+e)]=String(10+e);const o=15;const s=function(){const e={};for(let a=0;a<36;a++)e["0123456789abcdefghijklmnopqrstuvwxyz"[a]]=BigInt(a);return e}();function l(e){if((0,d.MR)("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const a=i(e);return(0,d.MR)(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||a===e,"bad address checksum","address",e),a}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,d.MR)(e.substring(2,4)===function(e){let a=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>b[e])).join("");for(;a.length>=o;){let e=a.substring(0,o);a=parseInt(e,10)%97+a.substring(e.length)}let t=String(98-parseInt(a,10)%97);for(;t.length<2;)t="0"+t;return t}(e),"bad icap checksum","address",e);let a=function(e){e=e.toLowerCase();let a=r;for(let t=0;t{"use strict";t.d(a,{$C:()=>d,PW:()=>r,tG:()=>i});var c=t(57339),f=t(30031);function d(e){return e&&"function"==typeof e.getAddress}function r(e){try{return(0,f.b)(e),!0}catch(e){}return!1}async function n(e,a){const t=await a;return null!=t&&"0x0000000000000000000000000000000000000000"!==t||((0,c.vA)("string"!=typeof e,"unconfigured name","UNCONFIGURED_NAME",{value:e}),(0,c.MR)(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),(0,f.b)(t)}function i(e,a){return"string"==typeof e?e.match(/^0x[0-9a-f]{40}$/i)?(0,f.b)(e):((0,c.vA)(null!=a,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),n(e,a.resolveName(e))):d(e)?n(e,e.getAddress()):e&&"function"==typeof e.then?n(e,e):void(0,c.MR)(!1,"unsupported addressable value","target",e)}},98982:(e,a,t)=>{"use strict";t.d(a,{j:()=>c});const c="0x0000000000000000000000000000000000000000"},24391:(e,a,t)=>{"use strict";t.d(a,{NZ:()=>Q});var c=t(19353),f=t(73622),d=t(41442),r=t(43948),n=t(88081),i=t(57339),b=t(27033),o=t(36212),s=t(99381);class l extends r.tG{interface;fragment;args;constructor(e,a,t){super(e,e.provider);const c=a.decodeEventLog(t,e.data,e.topics);(0,n.n)(this,{args:c,fragment:t,interface:a})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class u extends r.tG{error;constructor(e,a){super(e,e.provider),(0,n.n)(this,{error:a})}}class h extends r.z5{#Ze;constructor(e,a,t){super(t,a),this.#Ze=e}get logs(){return super.logs.map((e=>{const a=e.topics.length?this.#Ze.getEvent(e.topics[0]):null;if(a)try{return new l(e,this.#Ze,a)}catch(a){return new u(e,a)}return e}))}}class p extends r.uI{#Ze;constructor(e,a,t){super(t,a),this.#Ze=e}async wait(e,a){const t=await super.wait(e,a);return null==t?null:new h(this.#Ze,this.provider,t)}}class g extends s.z{log;constructor(e,a,t,c){super(e,a,t),(0,n.n)(this,{log:c})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class m extends g{constructor(e,a,t,c,f){super(e,a,t,new l(f,e.interface,c));const d=e.interface.decodeEventLog(c,this.log.data,this.log.topics);(0,n.n)(this,{args:d,fragment:c})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const x=BigInt(0);function y(e){return e&&"function"==typeof e.call}function A(e){return e&&"function"==typeof e.estimateGas}function v(e){return e&&"function"==typeof e.resolveName}function w(e){return e&&"function"==typeof e.sendTransaction}function _(e){if(null!=e){if(v(e))return e;if(e.provider)return e.provider}}class I{#H;fragment;constructor(e,a,t){if((0,n.n)(this,{fragment:a}),a.inputs.lengthnull==t[a]?null:e.walkAsync(t[a],((e,a)=>"address"===e?Array.isArray(a)?Promise.all(a.map((e=>(0,d.tG)(e,f)))):(0,d.tG)(a,f):a)))));return e.interface.encodeFilterTopics(a,c)}()}getTopicFilter(){return this.#H}}function E(e,a){return null==e?null:"function"==typeof e[a]?e:e.provider&&"function"==typeof e.provider[a]?e.provider:null}function C(e){return null==e?null:e.provider||null}async function M(e,a){const t=c.V.dereference(e,"overrides");(0,i.MR)("object"==typeof t,"invalid overrides parameter","overrides",e);const f=(0,r.VS)(t);return(0,i.MR)(null==f.to||(a||[]).indexOf("to")>=0,"cannot override to","overrides.to",f.to),(0,i.MR)(null==f.data||(a||[]).indexOf("data")>=0,"cannot override data","overrides.data",f.data),f.from&&(f.from=f.from),f}function B(e){const a=async function(a){const t=await M(a,["data"]);t.to=await e.getAddress(),t.from&&(t.from=await(0,d.tG)(t.from,_(e.runner)));const c=e.interface,f=(0,b.Ab)(t.value||x,"overrides.value")===x,r="0x"===(t.data||"0x");!c.fallback||c.fallback.payable||!c.receive||r||f||(0,i.MR)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),(0,i.MR)(c.fallback||r,"cannot send data to receive-only contract","overrides.data",t.data);const n=c.receive||c.fallback&&c.fallback.payable;return(0,i.MR)(n||f,"cannot send value to non-payable fallback","overrides.value",t.value),(0,i.MR)(c.fallback||r,"cannot send data to receive-only contract","overrides.data",t.data),t},t=async function(t){const c=e.runner;(0,i.vA)(w(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await c.sendTransaction(await a(t)),d=C(e.runner);return new p(e.interface,d,f)},c=async e=>await t(e);return(0,n.n)(c,{_contract:e,estimateGas:async function(t){const c=E(e.runner,"estimateGas");return(0,i.vA)(A(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await a(t))},populateTransaction:a,send:t,staticCall:async function(t){const c=E(e.runner,"call");(0,i.vA)(y(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await a(t);try{return await c.call(f)}catch(a){if((0,i.E)(a)&&a.data)throw e.interface.makeError(a.data,f);throw a}}}),c}const L=Symbol.for("_ethersInternal_contract"),S=new WeakMap;function k(e){return S.get(e[L])}async function N(e,a){let t,c=null;if(Array.isArray(a)){const c=function(a){if((0,o.Lo)(a,32))return a;const t=e.interface.getEvent(a);return(0,i.MR)(t,"unknown fragment","name",a),t.topicHash};t=a.map((e=>null==e?null:Array.isArray(e)?e.map(c):c(e)))}else"*"===a?t=[null]:"string"==typeof a?(0,o.Lo)(a,32)?t=[a]:(c=e.interface.getEvent(a),(0,i.MR)(c,"unknown fragment","event",a),t=[c.topicHash]):(f=a)&&"object"==typeof f&&"getTopicFilter"in f&&"function"==typeof f.getTopicFilter&&f.fragment?t=await a.getTopicFilter():"fragment"in a?(c=a.fragment,t=[c.topicHash]):(0,i.MR)(!1,"unknown event name","event",a);var f;return t=t.map((e=>{if(null==e)return null;if(Array.isArray(e)){const a=Array.from(new Set(e.map((e=>e.toLowerCase()))).values());return 1===a.length?a[0]:(a.sort(),a)}return e.toLowerCase()})),{fragment:c,tag:t.map((e=>null==e?"null":Array.isArray(e)?e.join("|"):e)).join("&"),topics:t}}async function P(e,a){const{subs:t}=k(e);return t.get((await N(e,a)).tag)||null}async function R(e,a,t){const c=C(e.runner);(0,i.vA)(c,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:a});const{fragment:f,tag:d,topics:r}=await N(e,t),{addr:n,subs:b}=k(e);let o=b.get(d);if(!o){const a={address:n||e,topics:r},i=a=>{let c=f;if(null==c)try{c=e.interface.getEvent(a.topics[0])}catch(e){}if(c){const d=c,r=f?e.interface.decodeEventLog(f,a.data,a.topics):[];T(e,t,r,(c=>new m(e,c,t,d,a)))}else T(e,t,[],(c=>new g(e,c,t,a)))};let s=[];o={tag:d,listeners:[],start:()=>{s.length||s.push(c.on(a,i))},stop:async()=>{if(0==s.length)return;let e=s;s=[],await Promise.all(e),c.off(a,i)}},b.set(d,o)}return o}let O=Promise.resolve();async function T(e,a,t,c){try{await O}catch(e){}const f=async function(e,a,t,c){await O;const f=await P(e,a);if(!f)return!1;const d=f.listeners.length;return f.listeners=f.listeners.filter((({listener:a,once:f})=>{const d=Array.from(t);c&&d.push(c(f?null:a));try{a.call(e,...d)}catch(e){}return!f})),0===f.listeners.length&&(f.stop(),k(e).subs.delete(f.tag)),d>0}(e,a,t,c);return O=f,await f}const D=["then"];class F{target;interface;runner;filters;[L];fallback;constructor(e,a,t,c){(0,i.MR)("string"==typeof e||(0,d.$C)(e),"invalid value for Contract target","target",e),null==t&&(t=null);const r=f.KA.from(a);let b;(0,n.n)(this,{target:e,runner:t,interface:r}),Object.defineProperty(this,L,{value:{}});let s=null,l=null;if(c){const e=C(t);l=new p(this.interface,e,c)}let u=new Map;if("string"==typeof e)if((0,o.Lo)(e))s=e,b=Promise.resolve(e);else{const a=E(t,"resolveName");if(!v(a))throw(0,i.xz)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});b=a.resolveName(e).then((a=>{if(null==a)throw(0,i.xz)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return k(this).addr=a,a}))}else b=e.getAddress().then((e=>{if(null==e)throw new Error("TODO");return k(this).addr=e,e}));var h;h={addrPromise:b,addr:s,deployTx:l,subs:u},S.set(this[L],h);const g=new Proxy({},{get:(e,a,t)=>{if("symbol"==typeof a||D.indexOf(a)>=0)return Reflect.get(e,a,t);try{return this.getEvent(a)}catch(e){if(!(0,i.bJ)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,a)=>D.indexOf(a)>=0?Reflect.has(e,a):Reflect.has(e,a)||this.interface.hasEvent(String(a))});return(0,n.n)(this,{filters:g}),(0,n.n)(this,{fallback:r.receive||r.fallback?B(this):null}),new Proxy(this,{get:(e,a,t)=>{if("symbol"==typeof a||a in e||D.indexOf(a)>=0)return Reflect.get(e,a,t);try{return e.getFunction(a)}catch(e){if(!(0,i.bJ)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,a)=>"symbol"==typeof a||a in e||D.indexOf(a)>=0?Reflect.has(e,a):e.interface.hasFunction(a)})}connect(e){return new F(this.target,this.interface,e)}attach(e){return new F(e,this.interface,this.runner)}async getAddress(){return await k(this).addrPromise}async getDeployedCode(){const e=C(this.runner);(0,i.vA)(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const a=await e.getCode(await this.getAddress());return"0x"===a?null:a}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(null!=await this.getDeployedCode())return this;const a=C(this.runner);return(0,i.vA)(null!=a,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise(((e,t)=>{const c=async()=>{try{if(null!=await this.getDeployedCode())return e(this);a.once("block",c)}catch(e){t(e)}};c()}))}deploymentTransaction(){return k(this).deployTx}getFunction(e){return"string"!=typeof e&&(e=e.format()),function(e,a){const t=function(...t){const c=e.interface.getFunction(a,t);return(0,i.vA)(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a,args:t}}),c},f=async function(...a){const f=t(...a);let r={};if(f.inputs.length+1===a.length&&(r=await M(a.pop()),r.from&&(r.from=await(0,d.tG)(r.from,_(e.runner)))),f.inputs.length!==a.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const i=await async function(e,a,t){const f=E(e,"resolveName"),r=v(f)?f:null;return await Promise.all(a.map(((e,a)=>e.walkAsync(t[a],((e,a)=>(a=c.V.dereference(a,e),"address"===e?(0,d.tG)(a,r):a))))))}(e.runner,f.inputs,a);return Object.assign({},r,await(0,n.k)({to:e.getAddress(),data:e.interface.encodeFunctionData(f,i)}))},r=async function(...e){const a=await o(...e);return 1===a.length?a[0]:a},b=async function(...a){const t=e.runner;(0,i.vA)(w(t),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await t.sendTransaction(await f(...a)),d=C(e.runner);return new p(e.interface,d,c)},o=async function(...a){const c=E(e.runner,"call");(0,i.vA)(y(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const d=await f(...a);let r="0x";try{r=await c.call(d)}catch(a){if((0,i.E)(a)&&a.data)throw e.interface.makeError(a.data,d);throw a}const n=t(...a);return e.interface.decodeFunctionResult(n,r)},s=async(...e)=>t(...e).constant?await r(...e):await b(...e);return(0,n.n)(s,{name:e.interface.getFunctionName(a),_contract:e,_key:a,getFragment:t,estimateGas:async function(...a){const t=E(e.runner,"estimateGas");return(0,i.vA)(A(t),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await t.estimateGas(await f(...a))},populateTransaction:f,send:b,staticCall:r,staticCallResult:o}),Object.defineProperty(s,"fragment",{configurable:!1,enumerable:!0,get:()=>{const t=e.interface.getFunction(a);return(0,i.vA)(t,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a}}),t}}),s}(this,e)}getEvent(e){return"string"!=typeof e&&(e=e.format()),function(e,a){const t=function(...t){const c=e.interface.getEvent(a,t);return(0,i.vA)(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a,args:t}}),c},c=function(...a){return new I(e,t(...a),a)};return(0,n.n)(c,{name:e.interface.getEventName(a),_contract:e,_key:a,getFragment:t}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const t=e.interface.getEvent(a);return(0,i.vA)(t,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:a}}),t}}),c}(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,a,t){null==a&&(a=0),null==t&&(t="latest");const{addr:c,addrPromise:f}=k(this),d=c||await f,{fragment:n,topics:b}=await N(this,e),o={address:d,topics:b,fromBlock:a,toBlock:t},s=C(this.runner);return(0,i.vA)(s,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await s.getLogs(o)).map((e=>{let a=n;if(null==a)try{a=this.interface.getEvent(e.topics[0])}catch(e){}if(a)try{return new l(e,this.interface,a)}catch(a){return new u(e,a)}return new r.tG(e,s)}))}async on(e,a){const t=await R(this,"on",e);return t.listeners.push({listener:a,once:!1}),t.start(),this}async once(e,a){const t=await R(this,"once",e);return t.listeners.push({listener:a,once:!0}),t.start(),this}async emit(e,...a){return await T(this,e,a,null)}async listenerCount(e){if(e){const a=await P(this,e);return a?a.listeners.length:0}const{subs:a}=k(this);let t=0;for(const{listeners:e}of a.values())t+=e.length;return t}async listeners(e){if(e){const a=await P(this,e);return a?a.listeners.map((({listener:e})=>e)):[]}const{subs:a}=k(this);let t=[];for(const{listeners:e}of a.values())t=t.concat(e.map((({listener:e})=>e)));return t}async off(e,a){const t=await P(this,e);if(!t)return this;if(a){const e=t.listeners.map((({listener:e})=>e)).indexOf(a);e>=0&&t.listeners.splice(e,1)}return null!=a&&0!==t.listeners.length||(t.stop(),k(this).subs.delete(t.tag)),this}async removeAllListeners(e){if(e){const a=await P(this,e);if(!a)return this;a.stop(),k(this).subs.delete(a.tag)}else{const{subs:e}=k(this);for(const{tag:a,stop:t}of e.values())t(),e.delete(a)}return this}async addListener(e,a){return await this.on(e,a)}async removeListener(e,a){return await this.off(e,a)}static buildClass(e){return class extends F{constructor(a,t=null){super(a,e,t)}}}static from(e,a,t){return null==t&&(t=null),new this(e,a,t)}}class Q extends(function(){return F}()){}},8180:(e,a,t)=>{"use strict";t.d(a,{n1:()=>x,Gz:()=>y,T_:()=>A,po:()=>v});var c=t(4655),f=t(84877),d=t(3439),r=t(37171),n=t(86558),i=t(10750);const[b,o]=(()=>n.Ay.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),s=new Uint32Array(80),l=new Uint32Array(80);class u extends r.D{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:a,Bh:t,Bl:c,Ch:f,Cl:d,Dh:r,Dl:n,Eh:i,El:b,Fh:o,Fl:s,Gh:l,Gl:u,Hh:h,Hl:p}=this;return[e,a,t,c,f,d,r,n,i,b,o,s,l,u,h,p]}set(e,a,t,c,f,d,r,n,i,b,o,s,l,u,h,p){this.Ah=0|e,this.Al=0|a,this.Bh=0|t,this.Bl=0|c,this.Ch=0|f,this.Cl=0|d,this.Dh=0|r,this.Dl=0|n,this.Eh=0|i,this.El=0|b,this.Fh=0|o,this.Fl=0|s,this.Gh=0|l,this.Gl=0|u,this.Hh=0|h,this.Hl=0|p}process(e,a){for(let t=0;t<16;t++,a+=4)s[t]=e.getUint32(a),l[t]=e.getUint32(a+=4);for(let e=16;e<80;e++){const a=0|s[e-15],t=0|l[e-15],c=n.Ay.rotrSH(a,t,1)^n.Ay.rotrSH(a,t,8)^n.Ay.shrSH(a,t,7),f=n.Ay.rotrSL(a,t,1)^n.Ay.rotrSL(a,t,8)^n.Ay.shrSL(a,t,7),d=0|s[e-2],r=0|l[e-2],i=n.Ay.rotrSH(d,r,19)^n.Ay.rotrBH(d,r,61)^n.Ay.shrSH(d,r,6),b=n.Ay.rotrSL(d,r,19)^n.Ay.rotrBL(d,r,61)^n.Ay.shrSL(d,r,6),o=n.Ay.add4L(f,b,l[e-7],l[e-16]),u=n.Ay.add4H(o,c,i,s[e-7],s[e-16]);s[e]=0|u,l[e]=0|o}let{Ah:t,Al:c,Bh:f,Bl:d,Ch:r,Cl:i,Dh:u,Dl:h,Eh:p,El:g,Fh:m,Fl:x,Gh:y,Gl:A,Hh:v,Hl:w}=this;for(let e=0;e<80;e++){const a=n.Ay.rotrSH(p,g,14)^n.Ay.rotrSH(p,g,18)^n.Ay.rotrBH(p,g,41),_=n.Ay.rotrSL(p,g,14)^n.Ay.rotrSL(p,g,18)^n.Ay.rotrBL(p,g,41),I=p&m^~p&y,E=g&x^~g&A,C=n.Ay.add5L(w,_,E,o[e],l[e]),M=n.Ay.add5H(C,v,a,I,b[e],s[e]),B=0|C,L=n.Ay.rotrSH(t,c,28)^n.Ay.rotrBH(t,c,34)^n.Ay.rotrBH(t,c,39),S=n.Ay.rotrSL(t,c,28)^n.Ay.rotrBL(t,c,34)^n.Ay.rotrBL(t,c,39),k=t&f^t&r^f&r,N=c&d^c&i^d&i;v=0|y,w=0|A,y=0|m,A=0|x,m=0|p,x=0|g,({h:p,l:g}=n.Ay.add(0|u,0|h,0|M,0|B)),u=0|r,h=0|i,r=0|f,i=0|d,f=0|t,d=0|c;const P=n.Ay.add3L(B,S,N);t=n.Ay.add3H(P,M,L,k),c=0|P}({h:t,l:c}=n.Ay.add(0|this.Ah,0|this.Al,0|t,0|c)),({h:f,l:d}=n.Ay.add(0|this.Bh,0|this.Bl,0|f,0|d)),({h:r,l:i}=n.Ay.add(0|this.Ch,0|this.Cl,0|r,0|i)),({h:u,l:h}=n.Ay.add(0|this.Dh,0|this.Dl,0|u,0|h)),({h:p,l:g}=n.Ay.add(0|this.Eh,0|this.El,0|p,0|g)),({h:m,l:x}=n.Ay.add(0|this.Fh,0|this.Fl,0|m,0|x)),({h:y,l:A}=n.Ay.add(0|this.Gh,0|this.Gl,0|y,0|A)),({h:v,l:w}=n.Ay.add(0|this.Hh,0|this.Hl,0|v,0|w)),this.set(t,c,f,d,r,i,u,h,p,g,m,x,y,A,v,w)}roundClean(){s.fill(0),l.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const h=(0,i.ld)((()=>new u));var p=t(57339);const g=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}(),m=g.crypto||g.msCrypto;function x(e){switch(e){case"sha256":return d.s.create();case"sha512":return h.create()}(0,p.MR)(!1,"invalid hashing algorithm name","algorithm",e)}function y(e,a){const t={sha256:d.s,sha512:h}[e];return(0,p.MR)(null!=t,"invalid hmac algorithm","algorithm",e),c.w.create(t,a)}function A(e,a,t,c,r){const n={sha256:d.s,sha512:h}[r];return(0,p.MR)(null!=n,"invalid pbkdf2 algorithm","algorithm",r),(0,f.A)(n,e,a,{c:t,dkLen:c})}function v(e){(0,p.vA)(null!=m,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,p.MR)(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const a=new Uint8Array(e);return m.getRandomValues(a),a}},15539:(e,a,t)=>{"use strict";t.d(a,{S:()=>E});var c=t(27125),f=t(86558),d=t(10750);const[r,n,i]=[[],[],[]],b=BigInt(0),o=BigInt(1),s=BigInt(2),l=BigInt(7),u=BigInt(256),h=BigInt(113);for(let e=0,a=o,t=1,c=0;e<24;e++){[t,c]=[c,(2*t+3*c)%5],r.push(2*(5*c+t)),n.push((e+1)*(e+2)/2%64);let f=b;for(let e=0;e<7;e++)a=(a<>l)*h)%u,a&s&&(f^=o<<(o<t>32?(0,f.WM)(e,a,t):(0,f.P5)(e,a,t),x=(e,a,t)=>t>32?(0,f.im)(e,a,t):(0,f.B4)(e,a,t);class y extends d.Vw{constructor(e,a,t,f=!1,r=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=t,this.enableXOF=f,this.rounds=r,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,c.ai)(t),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,d.DH)(this.state)}keccak(){!function(e,a=24){const t=new Uint32Array(10);for(let c=24-a;c<24;c++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const c=(a+8)%10,f=(a+2)%10,d=t[f],r=t[f+1],n=m(d,r,1)^t[c],i=x(d,r,1)^t[c+1];for(let t=0;t<50;t+=10)e[a+t]^=n,e[a+t+1]^=i}let a=e[2],f=e[3];for(let t=0;t<24;t++){const c=n[t],d=m(a,f,c),i=x(a,f,c),b=r[t];a=e[b],f=e[b+1],e[b]=d,e[b+1]=i}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)t[c]=e[a+c];for(let c=0;c<10;c++)e[a+c]^=~t[(c+2)%10]&t[(c+4)%10]}e[0]^=p[c],e[1]^=g[c]}t.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,c.t2)(this);const{blockLen:a,state:t}=this,f=(e=(0,d.ZJ)(e)).length;for(let c=0;c=t&&this.keccak();const d=Math.min(t-this.posOut,f-c);e.set(a.subarray(this.posOut,this.posOut+d),c),this.posOut+=d,c+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,c.ai)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,c.CG)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:t,outputLen:c,rounds:f,enableXOF:d}=this;return e||(e=new y(a,t,c,d,f)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=f,e.suffix=t,e.outputLen=c,e.enableXOF=d,e.destroyed=this.destroyed,e}}const A=((e,a,t)=>(0,d.ld)((()=>new y(a,e,t))))(1,136,32);var v=t(36212);let w=!1;const _=function(e){return A(e)};let I=_;function E(e){const a=(0,v.q5)(e,"data");return(0,v.c$)(I(a))}E._=_,E.lock=function(){w=!0},E.register=function(e){if(w)throw new TypeError("keccak256 is locked");I=e},Object.freeze(E)},68650:(e,a,t)=>{"use strict";t.d(a,{s:()=>s});var c=t(8180),f=t(36212);const d=function(e){return(0,c.n1)("sha256").update(e).digest()},r=function(e){return(0,c.n1)("sha512").update(e).digest()};let n=d,i=r,b=!1,o=!1;function s(e){const a=(0,f.q5)(e,"data");return(0,f.c$)(n(a))}function l(e){const a=(0,f.q5)(e,"data");return(0,f.c$)(i(a))}s._=d,s.lock=function(){b=!0},s.register=function(e){if(b)throw new Error("sha256 is locked");n=e},Object.freeze(s),l._=r,l.lock=function(){o=!0},l.register=function(e){if(o)throw new Error("sha512 is locked");i=e},Object.freeze(s)},20260:(e,a,t)=>{"use strict";t.d(a,{t:()=>p});const c="0x0000000000000000000000000000000000000000000000000000000000000000";var f=t(36212),d=t(27033),r=t(57339);const n=BigInt(0),i=BigInt(1),b=BigInt(2),o=BigInt(27),s=BigInt(28),l=BigInt(35),u={};function h(e){return(0,f.nx)((0,d.c4)(e),32)}class p{#Je;#We;#Ye;#Xe;get r(){return this.#Je}set r(e){(0,r.MR)(32===(0,f.pO)(e),"invalid r","value",e),this.#Je=(0,f.c$)(e)}get s(){return this.#We}set s(e){(0,r.MR)(32===(0,f.pO)(e),"invalid s","value",e);const a=(0,f.c$)(e);(0,r.MR)(parseInt(a.substring(0,3))<8,"non-canonical s","value",a),this.#We=a}get v(){return this.#Ye}set v(e){const a=(0,d.WZ)(e,"value");(0,r.MR)(27===a||28===a,"invalid v","v",e),this.#Ye=a}get networkV(){return this.#Xe}get legacyChainId(){const e=this.networkV;return null==e?null:p.getChainId(e)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=(0,f.q5)(this.s);return this.yParity&&(e[0]|=128),(0,f.c$)(e)}get compactSerialized(){return(0,f.xW)([this.r,this.yParityAndS])}get serialized(){return(0,f.xW)([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,a,t,c){(0,r.gk)(e,u,"Signature"),this.#Je=a,this.#We=t,this.#Ye=c,this.#Xe=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new p(u,this.r,this.s,this.v);return this.networkV&&(e.#Xe=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:null!=e?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const a=(0,d.Ab)(e,"v");return a==o||a==s?n:((0,r.MR)(a>=l,"invalid EIP-155 v","v",e),(a-l)/b)}static getChainIdV(e,a){return(0,d.Ab)(e)*b+BigInt(35+a-27)}static getNormalizedV(e){const a=(0,d.Ab)(e);return a===n||a===o?27:a===i||a===s?28:((0,r.MR)(a>=l,"invalid v","v",e),a&i?27:28)}static from(e){function a(a,t){(0,r.MR)(a,t,"signature",e)}if(null==e)return new p(u,c,c,27);if("string"==typeof e){const t=(0,f.q5)(e,"signature");if(64===t.length){const e=(0,f.c$)(t.slice(0,32)),a=t.slice(32,64),c=128&a[0]?28:27;return a[0]&=127,new p(u,e,(0,f.c$)(a),c)}if(65===t.length){const e=(0,f.c$)(t.slice(0,32)),c=t.slice(32,64);a(!(128&c[0]),"non-canonical s");const d=p.getNormalizedV(t[64]);return new p(u,e,(0,f.c$)(c),d)}a(!1,"invalid raw signature length")}if(e instanceof p)return e.clone();const t=e.r;a(null!=t,"missing r");const n=h(t),i=function(e,t){if(null!=e)return h(e);if(null!=t){a((0,f.Lo)(t,32),"invalid yParityAndS");const e=(0,f.q5)(t);return e[0]&=127,(0,f.c$)(e)}a(!1,"missing s")}(e.s,e.yParityAndS);a(!(128&(0,f.q5)(i)[0]),"non-canonical s");const{networkV:b,v:o}=function(e,t,c){if(null!=e){const a=(0,d.Ab)(e);return{networkV:a>=l?a:void 0,v:p.getNormalizedV(a)}}if(null!=t)return a((0,f.Lo)(t,32),"invalid yParityAndS"),{v:128&(0,f.q5)(t)[0]?28:27};if(null!=c){switch((0,d.WZ)(c,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}a(!1,"invalid yParity")}a(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),s=new p(u,n,i,o);return b&&(s.#Xe=b),a(null==e.yParity||(0,d.WZ)(e.yParity,"sig.yParity")===s.yParity,"yParity mismatch"),a(null==e.yParityAndS||e.yParityAndS===s.yParityAndS,"yParityAndS mismatch"),s}}},15496:(e,a,t)=>{"use strict";t.d(a,{h:()=>be});var c={};t.r(c),t.d(c,{OG:()=>x,My:()=>b,Ph:()=>l,lX:()=>u,Id:()=>m,fg:()=>v,qj:()=>g,aT:()=>s,lq:()=>h,z:()=>p,Q5:()=>_});var f=t(3439);BigInt(0);const d=BigInt(1),r=BigInt(2),n=e=>e instanceof Uint8Array,i=Array.from({length:256},((e,a)=>a.toString(16).padStart(2,"0")));function b(e){if(!n(e))throw new Error("Uint8Array expected");let a="";for(let t=0;te+a.length),0));let t=0;return e.forEach((e=>{if(!n(e))throw new Error("Uint8Array expected");a.set(e,t),t+=e.length})),a}const x=e=>(r<new Uint8Array(e),A=e=>Uint8Array.from(e);function v(e,a,t){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof a||a<2)throw new Error("qByteLen must be a number");if("function"!=typeof t)throw new Error("hmacFn must be a function");let c=y(e),f=y(e),d=0;const r=()=>{c.fill(1),f.fill(0),d=0},n=(...e)=>t(f,c,...e),i=(e=y())=>{f=n(A([0]),e),c=n(),0!==e.length&&(f=n(A([1]),e),c=n())},b=()=>{if(d++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const t=[];for(;e{let t;for(r(),i(e);!(t=a(b()));)i();return r(),t}}const w={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,a)=>a.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function _(e,a,t={}){const c=(a,t,c)=>{const f=w[t];if("function"!=typeof f)throw new Error(`Invalid validator "${t}", expected function`);const d=e[a];if(!(c&&void 0===d||f(d,e)))throw new Error(`Invalid param ${String(a)}=${d} (${typeof d}), expected ${t}`)};for(const[e,t]of Object.entries(a))c(e,t,!1);for(const[e,a]of Object.entries(t))c(e,a,!0);return e}const I=BigInt(0),E=BigInt(1),C=BigInt(2),M=BigInt(3),B=BigInt(4),L=BigInt(5),S=BigInt(8);function k(e,a){const t=e%a;return t>=I?t:a+t}function N(e,a,t){if(t<=I||a 0");if(t===E)return I;let c=E;for(;a>I;)a&E&&(c=c*e%t),e=e*e%t,a>>=E;return c}function P(e,a,t){let c=e;for(;a-- >I;)c*=c,c%=t;return c}function R(e,a){if(e===I||a<=I)throw new Error(`invert: expected positive integers, got n=${e} mod=${a}`);let t=k(e,a),c=a,f=I,d=E,r=E,n=I;for(;t!==I;){const e=c/t,a=c%t,i=f-r*e,b=d-n*e;c=t,t=a,f=r,d=n,r=i,n=b}if(c!==E)throw new Error("invert: does not exist");return k(f,a)}BigInt(9),BigInt(16);const O=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function T(e,a){const t=void 0!==a?a:e.toString(2).length;return{nBitLength:t,nByteLength:Math.ceil(t/8)}}function D(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const a=e.toString(2).length;return Math.ceil(a/8)}function F(e){const a=D(e);return a+Math.ceil(a/2)}var Q=t(4655),U=t(10750);const j=BigInt(0),H=BigInt(1);function $(e){return _(e.Fp,O.reduce(((e,a)=>(e[a]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),_(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...T(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:q,aT:G}=c,z={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:a}=z;if(e.length<2||2!==e[0])throw new a("Invalid signature integer tag");const t=e[1],c=e.subarray(2,t+2);if(!t||c.length!==t)throw new a("Invalid signature integer: wrong length");if(128&c[0])throw new a("Invalid signature integer: negative");if(0===c[0]&&!(128&c[1]))throw new a("Invalid signature integer: unnecessary leading zero");return{d:q(c),l:e.subarray(t+2)}},toSig(e){const{Err:a}=z,t="string"==typeof e?G(e):e;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let c=t.length;if(c<2||48!=t[0])throw new a("Invalid signature tag");if(t[1]!==c-2)throw new a("Invalid signature: incorrect length");const{d:f,l:d}=z._parseInt(t.subarray(2)),{d:r,l:n}=z._parseInt(d);if(n.length)throw new a("Invalid signature: left bytes after parsing");return{r:f,s:r}},hexFromSig(e){const a=e=>8&Number.parseInt(e[0],16)?"00"+e:e,t=e=>{const a=e.toString(16);return 1&a.length?`0${a}`:a},c=a(t(e.s)),f=a(t(e.r)),d=c.length/2,r=f.length/2,n=t(d),i=t(r);return`30${t(r+d+4)}02${i}${f}02${n}${c}`}},K=BigInt(0),V=BigInt(1),Z=(BigInt(2),BigInt(3));function J(e){const a=function(e){const a=$(e);return _(a,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...a})}(e),{Fp:t,n:c}=a,f=t.BYTES+1,d=2*t.BYTES+1;function r(e){return k(e,c)}function n(e){return R(e,c)}const{ProjectivePoint:i,normPrivateKeyToScalar:o,weierstrassEquation:y,isWithinCurveOrder:A}=function(e){const a=function(e){const a=$(e);_(a,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:c,a:f}=a;if(t){if(!c.eql(f,c.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof t||"bigint"!=typeof t.beta||"function"!=typeof t.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...a})}(e),{Fp:t}=a,c=a.toBytes||((e,a,c)=>{const f=a.toAffine();return m(Uint8Array.from([4]),t.toBytes(f.x),t.toBytes(f.y))}),f=a.fromBytes||(e=>{const a=e.subarray(1);return{x:t.fromBytes(a.subarray(0,t.BYTES)),y:t.fromBytes(a.subarray(t.BYTES,2*t.BYTES))}});function d(e){const{a:c,b:f}=a,d=t.sqr(e),r=t.mul(d,e);return t.add(t.add(r,t.mul(e,c)),f)}if(!t.eql(t.sqr(a.Gy),d(a.Gx)))throw new Error("bad generator point: equation left != right");function r(e){return"bigint"==typeof e&&Kt.eql(e,t.ZERO);return f(a)&&f(c)?u.ZERO:new u(a,c,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(u.fromAffine)}static fromHex(e){const a=u.fromAffine(f(g("pointHex",e)));return a.assertValidity(),a}static fromPrivateKey(e){return u.BASE.multiply(i(e))}_setWindowSize(e){this._WINDOW_SIZE=e,o.delete(this)}assertValidity(){if(this.is0()){if(a.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:c}=this.toAffine();if(!t.isValid(e)||!t.isValid(c))throw new Error("bad point: x or y not FE");const f=t.sqr(c),r=d(e);if(!t.eql(f,r))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(t.isOdd)return!t.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){s(e);const{px:a,py:c,pz:f}=this,{px:d,py:r,pz:n}=e,i=t.eql(t.mul(a,n),t.mul(d,f)),b=t.eql(t.mul(c,n),t.mul(r,f));return i&&b}negate(){return new u(this.px,t.neg(this.py),this.pz)}double(){const{a:e,b:c}=a,f=t.mul(c,Z),{px:d,py:r,pz:n}=this;let i=t.ZERO,b=t.ZERO,o=t.ZERO,s=t.mul(d,d),l=t.mul(r,r),h=t.mul(n,n),p=t.mul(d,r);return p=t.add(p,p),o=t.mul(d,n),o=t.add(o,o),i=t.mul(e,o),b=t.mul(f,h),b=t.add(i,b),i=t.sub(l,b),b=t.add(l,b),b=t.mul(i,b),i=t.mul(p,i),o=t.mul(f,o),h=t.mul(e,h),p=t.sub(s,h),p=t.mul(e,p),p=t.add(p,o),o=t.add(s,s),s=t.add(o,s),s=t.add(s,h),s=t.mul(s,p),b=t.add(b,s),h=t.mul(r,n),h=t.add(h,h),s=t.mul(h,p),i=t.sub(i,s),o=t.mul(h,l),o=t.add(o,o),o=t.add(o,o),new u(i,b,o)}add(e){s(e);const{px:c,py:f,pz:d}=this,{px:r,py:n,pz:i}=e;let b=t.ZERO,o=t.ZERO,l=t.ZERO;const h=a.a,p=t.mul(a.b,Z);let g=t.mul(c,r),m=t.mul(f,n),x=t.mul(d,i),y=t.add(c,f),A=t.add(r,n);y=t.mul(y,A),A=t.add(g,m),y=t.sub(y,A),A=t.add(c,d);let v=t.add(r,i);return A=t.mul(A,v),v=t.add(g,x),A=t.sub(A,v),v=t.add(f,d),b=t.add(n,i),v=t.mul(v,b),b=t.add(m,x),v=t.sub(v,b),l=t.mul(h,A),b=t.mul(p,x),l=t.add(b,l),b=t.sub(m,l),l=t.add(m,l),o=t.mul(b,l),m=t.add(g,g),m=t.add(m,g),x=t.mul(h,x),A=t.mul(p,A),m=t.add(m,x),x=t.sub(g,x),x=t.mul(h,x),A=t.add(A,x),g=t.mul(m,A),o=t.add(o,g),g=t.mul(v,A),b=t.mul(y,b),b=t.sub(b,g),g=t.mul(y,m),l=t.mul(v,l),l=t.add(l,g),new u(b,o,l)}subtract(e){return this.add(e.negate())}is0(){return this.equals(u.ZERO)}wNAF(e){return p.wNAFCached(this,o,e,(e=>{const a=t.invertBatch(e.map((e=>e.pz)));return e.map(((e,t)=>e.toAffine(a[t]))).map(u.fromAffine)}))}multiplyUnsafe(e){const c=u.ZERO;if(e===K)return c;if(n(e),e===V)return this;const{endo:f}=a;if(!f)return p.unsafeLadder(this,e);let{k1neg:d,k1:r,k2neg:i,k2:b}=f.splitScalar(e),o=c,s=c,l=this;for(;r>K||b>K;)r&V&&(o=o.add(l)),b&V&&(s=s.add(l)),l=l.double(),r>>=V,b>>=V;return d&&(o=o.negate()),i&&(s=s.negate()),s=new u(t.mul(s.px,f.beta),s.py,s.pz),o.add(s)}multiply(e){n(e);let c,f,d=e;const{endo:r}=a;if(r){const{k1neg:e,k1:a,k2neg:n,k2:i}=r.splitScalar(d);let{p:b,f:o}=this.wNAF(a),{p:s,f:l}=this.wNAF(i);b=p.constTimeNegate(e,b),s=p.constTimeNegate(n,s),s=new u(t.mul(s.px,r.beta),s.py,s.pz),c=b.add(s),f=o.add(l)}else{const{p:e,f:a}=this.wNAF(d);c=e,f=a}return u.normalizeZ([c,f])[0]}multiplyAndAddUnsafe(e,a,t){const c=u.BASE,f=(e,a)=>a!==K&&a!==V&&e.equals(c)?e.multiply(a):e.multiplyUnsafe(a),d=f(this,a).add(f(e,t));return d.is0()?void 0:d}toAffine(e){const{px:a,py:c,pz:f}=this,d=this.is0();null==e&&(e=d?t.ONE:t.inv(f));const r=t.mul(a,e),n=t.mul(c,e),i=t.mul(f,e);if(d)return{x:t.ZERO,y:t.ZERO};if(!t.eql(i,t.ONE))throw new Error("invZ was invalid");return{x:r,y:n}}isTorsionFree(){const{h:e,isTorsionFree:t}=a;if(e===V)return!0;if(t)return t(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:t}=a;return e===V?this:t?t(u,this):this.multiplyUnsafe(a.h)}toRawBytes(e=!0){return this.assertValidity(),c(u,this,e)}toHex(e=!0){return b(this.toRawBytes(e))}}u.BASE=new u(a.Gx,a.Gy,t.ONE),u.ZERO=new u(t.ZERO,t.ONE,t.ZERO);const h=a.nBitLength,p=function(e,a){const t=(e,a)=>{const t=a.negate();return e?t:a},c=e=>({windows:Math.ceil(a/e)+1,windowSize:2**(e-1)});return{constTimeNegate:t,unsafeLadder(a,t){let c=e.ZERO,f=a;for(;t>j;)t&H&&(c=c.add(f)),f=f.double(),t>>=H;return c},precomputeWindow(e,a){const{windows:t,windowSize:f}=c(a),d=[];let r=e,n=r;for(let e=0;e>=l,c>n&&(c-=s,d+=H);const r=a,u=a+Math.abs(c)-1,h=e%2!=0,p=c<0;0===c?b=b.add(t(h,f[r])):i=i.add(t(p,f[u]))}return{p:i,f:b}},wNAFCached(e,a,t,c){const f=e._WINDOW_SIZE||1;let d=a.get(e);return d||(d=this.precomputeWindow(e,f),1!==f&&a.set(e,c(d))),this.wNAF(f,d,t)}}}(u,a.endo?Math.ceil(h/2):h);return{CURVE:a,ProjectivePoint:u,normPrivateKeyToScalar:i,weierstrassEquation:d,isWithinCurveOrder:r}}({...a,toBytes(e,a,c){const f=a.toAffine(),d=t.toBytes(f.x),r=m;return c?r(Uint8Array.from([a.hasEvenY()?2:3]),d):r(Uint8Array.from([4]),d,t.toBytes(f.y))},fromBytes(e){const a=e.length,c=e[0],r=e.subarray(1);if(a!==f||2!==c&&3!==c){if(a===d&&4===c)return{x:t.fromBytes(r.subarray(0,t.BYTES)),y:t.fromBytes(r.subarray(t.BYTES,2*t.BYTES))};throw new Error(`Point of length ${a} was invalid. Expected ${f} compressed bytes or ${d} uncompressed bytes`)}{const e=l(r);if(!(K<(n=e)&&nb(h(e,a.nByteLength));function I(e){return e>c>>V}const C=(e,a,t)=>l(e.slice(a,t));class M{constructor(e,a,t){this.r=e,this.s=a,this.recovery=t,this.assertValidity()}static fromCompact(e){const t=a.nByteLength;return e=g("compactSignature",e,2*t),new M(C(e,0,t),C(e,t,2*t))}static fromDER(e){const{r:a,s:t}=z.toSig(g("DER",e));return new M(a,t)}assertValidity(){if(!A(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!A(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new M(this.r,this.s,e)}recoverPublicKey(e){const{r:c,s:f,recovery:d}=this,b=N(g("msgHash",e));if(null==d||![0,1,2,3].includes(d))throw new Error("recovery id invalid");const o=2===d||3===d?c+a.n:c;if(o>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const s=1&d?"03":"02",l=i.fromHex(s+w(o)),u=n(o),h=r(-b*u),p=r(f*u),m=i.BASE.multiplyAndAddUnsafe(l,h,p);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return I(this.s)}normalizeS(){return this.hasHighS()?new M(this.r,r(-this.s),this.recovery):this}toDERRawBytes(){return s(this.toDERHex())}toDERHex(){return z.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return s(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}const B={isValidPrivateKey(e){try{return o(e),!0}catch(e){return!1}},normPrivateKeyToScalar:o,randomPrivateKey:()=>{const e=F(a.n);return function(e,a,t=!1){const c=e.length,f=D(a),d=F(a);if(c<16||c1024)throw new Error(`expected ${d}-1024 bytes of input, got ${c}`);const r=k(t?l(e):u(e),a-E)+E;return t?p(r,f):h(r,f)}(a.randomBytes(e),a.n)},precompute:(e=8,a=i.BASE)=>(a._setWindowSize(e),a.multiply(BigInt(3)),a)};function L(e){const a=e instanceof Uint8Array,t="string"==typeof e,c=(a||t)&&e.length;return a?c===f||c===d:t?c===2*f||c===2*d:e instanceof i}const S=a.bits2int||function(e){const t=l(e),c=8*e.length-a.nBitLength;return c>0?t>>BigInt(c):t},N=a.bits2int_modN||function(e){return r(S(e))},P=x(a.nBitLength);function O(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(K<=e&&ee in f)))throw new Error("sign() legacy options not supported");const{hash:d,randomBytes:b}=a;let{lowS:s,prehash:l,extraEntropy:u}=f;null==s&&(s=!0),e=g("msgHash",e),l&&(e=g("prehashed msgHash",d(e)));const h=N(e),p=o(c),x=[O(p),O(h)];if(null!=u){const e=!0===u?b(t.BYTES):u;x.push(g("extraEntropy",e))}const y=m(...x),v=h;return{seed:y,k2sig:function(e){const a=S(e);if(!A(a))return;const t=n(a),c=i.BASE.multiply(a).toAffine(),f=r(c.x);if(f===K)return;const d=r(t*r(v+f*p));if(d===K)return;let b=(c.x===f?0:2)|Number(c.y&V),o=d;return s&&I(d)&&(o=function(e){return I(e)?r(-e):e}(d),b^=1),new M(f,o,b)}}}(e,c,f),s=a;return v(s.hash.outputLen,s.nByteLength,s.hmac)(d,b)},verify:function(e,t,c,f=Q){const d=e;if(t=g("msgHash",t),c=g("publicKey",c),"strict"in f)throw new Error("options.strict was renamed to lowS");const{lowS:b,prehash:o}=f;let s,l;try{if("string"==typeof d||d instanceof Uint8Array)try{s=M.fromDER(d)}catch(e){if(!(e instanceof z.Err))throw e;s=M.fromCompact(d)}else{if("object"!=typeof d||"bigint"!=typeof d.r||"bigint"!=typeof d.s)throw new Error("PARSE");{const{r:e,s:a}=d;s=new M(e,a)}}l=i.fromHex(c)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(b&&s.hasHighS())return!1;o&&(t=a.hash(t));const{r:u,s:h}=s,p=N(t),m=n(h),x=r(p*m),y=r(u*m),A=i.BASE.multiplyAndAddUnsafe(l,x,y)?.toAffine();return!!A&&r(A.x)===u},ProjectivePoint:i,Signature:M,utils:B}}function W(e){return{hash:e,hmac:(a,...t)=>(0,Q.w)(e,a,(0,U.Id)(...t)),randomBytes:U.po}}BigInt(4);const Y=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),X=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ee=BigInt(1),ae=BigInt(2),te=(e,a)=>(e+a/ae)/a;const ce=function(e,a,t=!1,c={}){if(e<=I)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:f,nByteLength:d}=T(e,a);if(d>2048)throw new Error("Field lengths over 2048 bytes are not supported");const r=function(e){if(e%B===M){const a=(e+E)/B;return function(e,t){const c=e.pow(t,a);if(!e.eql(e.sqr(c),t))throw new Error("Cannot find square root");return c}}if(e%S===L){const a=(e-L)/S;return function(e,t){const c=e.mul(t,C),f=e.pow(c,a),d=e.mul(t,f),r=e.mul(e.mul(d,C),f),n=e.mul(d,e.sub(r,e.ONE));if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}}return function(e){const a=(e-E)/C;let t,c,f;for(t=e-E,c=0;t%C===I;t/=C,c++);for(f=C;fk(a,e),isValid:a=>{if("bigint"!=typeof a)throw new Error("Invalid field element: expected bigint, got "+typeof a);return I<=a&&ae===I,isOdd:e=>(e&E)===E,neg:a=>k(-a,e),eql:(e,a)=>e===a,sqr:a=>k(a*a,e),add:(a,t)=>k(a+t,e),sub:(a,t)=>k(a-t,e),mul:(a,t)=>k(a*t,e),pow:(e,a)=>function(e,a,t){if(t 0");if(t===I)return e.ONE;if(t===E)return a;let c=e.ONE,f=a;for(;t>I;)t&E&&(c=e.mul(c,f)),f=e.sqr(f),t>>=E;return c}(n,e,a),div:(a,t)=>k(a*R(t,e),e),sqrN:e=>e*e,addN:(e,a)=>e+a,subN:(e,a)=>e-a,mulN:(e,a)=>e*a,inv:a=>R(a,e),sqrt:c.sqrt||(e=>r(n,e)),invertBatch:e=>function(e,a){const t=new Array(a.length),c=a.reduce(((a,c,f)=>e.is0(c)?a:(t[f]=a,e.mul(a,c))),e.ONE),f=e.inv(c);return a.reduceRight(((a,c,f)=>e.is0(c)?a:(t[f]=e.mul(a,t[f]),e.mul(a,c))),f),t}(n,e),cmov:(e,a,t)=>t?a:e,toBytes:e=>t?p(e,d):h(e,d),fromBytes:e=>{if(e.length!==d)throw new Error(`Fp.fromBytes: expected ${d}, got ${e.length}`);return t?u(e):l(e)}});return Object.freeze(n)}(Y,void 0,void 0,{sqrt:function(e){const a=Y,t=BigInt(3),c=BigInt(6),f=BigInt(11),d=BigInt(22),r=BigInt(23),n=BigInt(44),i=BigInt(88),b=e*e*e%a,o=b*b*e%a,s=P(o,t,a)*o%a,l=P(s,t,a)*o%a,u=P(l,ae,a)*b%a,h=P(u,f,a)*u%a,p=P(h,d,a)*h%a,g=P(p,n,a)*p%a,m=P(g,i,a)*g%a,x=P(m,n,a)*p%a,y=P(x,t,a)*o%a,A=P(y,r,a)*h%a,v=P(A,c,a)*b%a,w=P(v,ae,a);if(!ce.eql(ce.sqr(w),e))throw new Error("Cannot find square root");return w}}),fe=function(e,a){const t=a=>J({...e,...W(a)});return Object.freeze({...t(a),create:t})}({a:BigInt(0),b:BigInt(7),Fp:ce,n:X,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const a=X,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),c=-ee*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),f=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),d=t,r=BigInt("0x100000000000000000000000000000000"),n=te(d*e,a),i=te(-c*e,a);let b=k(e-n*t-i*f,a),o=k(-n*c-i*d,a);const s=b>r,l=o>r;if(s&&(b=a-b),l&&(o=a-o),b>r||o>r)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:s,k1:b,k2neg:l,k2:o}}}},f.s);BigInt(0),fe.ProjectivePoint;var de=t(57339),re=t(36212),ne=t(27033),ie=t(20260);class be{#ea;constructor(e){(0,de.MR)(32===(0,re.pO)(e),"invalid private key","privateKey","[REDACTED]"),this.#ea=(0,re.c$)(e)}get privateKey(){return this.#ea}get publicKey(){return be.computePublicKey(this.#ea)}get compressedPublicKey(){return be.computePublicKey(this.#ea,!0)}sign(e){(0,de.MR)(32===(0,re.pO)(e),"invalid digest length","digest",e);const a=fe.sign((0,re.Lm)(e),(0,re.Lm)(this.#ea),{lowS:!0});return ie.t.from({r:(0,ne.up)(a.r,32),s:(0,ne.up)(a.s,32),v:a.recovery?28:27})}computeSharedSecret(e){const a=be.computePublicKey(e);return(0,re.c$)(fe.getSharedSecret((0,re.Lm)(this.#ea),(0,re.q5)(a),!1))}static computePublicKey(e,a){let t=(0,re.q5)(e,"key");if(32===t.length){const e=fe.getPublicKey(t,!!a);return(0,re.c$)(e)}if(64===t.length){const e=new Uint8Array(65);e[0]=4,e.set(t,1),t=e}const c=fe.ProjectivePoint.fromHex(t);return(0,re.c$)(c.toRawBytes(a))}static recoverPublicKey(e,a){(0,de.MR)(32===(0,re.pO)(e),"invalid digest length","digest",e);const t=ie.t.from(a);let c=fe.Signature.fromCompact((0,re.Lm)((0,re.xW)([t.r,t.s])));c=c.addRecoveryBit(t.yParity);const f=c.recoverPublicKey((0,re.Lm)(e));return(0,de.MR)(null!=f,"invalid signautre for digest","signature",a),"0x"+f.toHex(!1)}static addPoints(e,a,t){const c=fe.ProjectivePoint.fromHex(be.computePublicKey(e).substring(2)),f=fe.ProjectivePoint.fromHex(be.computePublicKey(a).substring(2));return"0x"+c.add(f).toHex(!!t)}}},38264:(e,a,t)=>{"use strict";t.d(a,{id:()=>d});var c=t(15539),f=t(87303);function d(e){return(0,c.S)((0,f.YW)(e))}},64563:(e,a,t)=>{"use strict";t.d(a,{Wh:()=>Ee,kM:()=>Ie});var c=t(15539),f=t(57339),d=t(87303),r=t(36212),n="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 i=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),b=4;function o(e){return function(e){let a=0;return()=>e[a++]}(function(e){let a=0;function t(){return e[a++]<<8|e[a++]}let c=t(),f=1,d=[0,1];for(let e=1;e>--i&1}const s=2**31,l=s>>>1,u=l>>1,h=s-1;let p=0;for(let e=0;e<31;e++)p=p<<1|o();let g=[],m=0,x=s;for(;;){let e=Math.floor(((p-m+1)*f-1)/x),a=0,t=c;for(;t-a>1;){let c=a+t>>>1;e>>1|o(),r=r<<1^l,n=(n^l)<<1|l|1;m=r,x=1+n-r}let y=c-4;return g.map((a=>{switch(a-y){case 3:return y+65792+(e[n++]<<16|e[n++]<<8|e[n++]);case 2:return y+256+(e[n++]<<8|e[n++]);case 1:return y+e[n++];default:return a-1}}))}(function(e){let a=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((e,t)=>a[e.charCodeAt(0)]=t));let t=e.length,c=new Uint8Array(6*t>>3);for(let f=0,d=0,r=0,n=0;f=8&&(c[d++]=n>>(r-=8));return c}(e)))}function s(e){return 1&e?~e>>1:e>>1}function l(e,a){let t=Array(e);for(let c=0,f=0;c{let a=u(e);if(a.length)return a}))}function p(e){let a=[];for(;;){let t=e();if(0==t)break;a.push(x(t,e))}for(;;){let t=e()-1;if(t<0)break;a.push(y(t,e))}return a.flat()}function g(e){let a=[];for(;;){let t=e(a.length);if(!t)break;a.push(t)}return a}function m(e,a,t){let c=Array(e).fill().map((()=>[]));for(let f=0;fc[a].push(e)));return c}function x(e,a){let t=1+a(),c=a(),f=g(a);return m(f.length,1+e,a).flatMap(((e,a)=>{let[d,...r]=e;return Array(f[a]).fill().map(((e,a)=>{let f=a*c;return[d+a*t,r.map((e=>e+f))]}))}))}function y(e,a){return m(1+a(),1+e,a).map((e=>[e[0],e.slice(1)]))}function A(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function v(e){let a=e.length;if(a<4096)return String.fromCodePoint(...e);let t=[];for(let c=0;c>24&255}function O(e){return 16777215&e}let T,D,F,Q;function U(e){return e>=I&&e=E&&e=C&&aM&&ae.map((e=>[e,a+1<<24]))))),D=new Set(u(e)),F=new Map,Q=new Map;for(let[a,t]of p(e)){if(!D.has(a)&&2==t.length){let[e,c]=t,f=Q.get(e);f||(f=new Map,Q.set(e,f)),f.set(c,a)}F.set(a,t.reverse())}}();let a=[],t=[],c=!1;function f(e){let t=T.get(e);t&&(c=!0,e|=t),a.push(e)}for(let c of e)for(;;){if(c<128)a.push(c);else if(U(c)){let e=c-I,a=e%L/B|0,t=e%B;f(E+(e/L|0)),f(C+a),t>0&&f(M+t)}else{let e=F.get(c);e?t.push(...e):f(c)}if(!t.length)break;c=t.pop()}if(c&&a.length>1){let e=R(a[0]);for(let t=1;t0&&f>=e)0==e?(a.push(c,...t),t.length=0,c=r):t.push(r),f=e;else{let d=j(c,r);d>=0?c=d:0==f&&0==e?(a.push(c),c=r):(t.push(r),f=e)}}return c>=0&&a.push(c,...t),a}(H(e))}const G=45,z=".",K=65039,V=1,Z=e=>Array.from(e);function J(e,a){return e.P.has(a)||e.Q.has(a)}class W extends Array{get is_emoji(){return!0}}let Y,X,ee,ae,te,ce,fe,de,re,ne,ie,be;function oe(){if(Y)return;let e=o(n);const a=()=>u(e),t=()=>new Set(a()),c=(e,a)=>a.forEach((a=>e.add(a)));Y=new Map(p(e)),X=t(),ee=a(),ae=new Set(a().map((e=>ee[e]))),ee=new Set(ee),te=t(),ce=t();let f=h(e),d=e();const r=()=>{let e=new Set;return a().forEach((a=>c(e,f[a]))),c(e,a()),e};fe=g((a=>{let t=g(e).map((e=>e+96));if(t.length){let c=a>=d;return t[0]-=32,t=v(t),c&&(t=`Restricted[${t}]`),{N:t,P:r(),Q:r(),M:!e(),R:c}}})),de=t(),re=new Map;let i=a().concat(Z(de)).sort(((e,a)=>e-a));i.forEach(((a,t)=>{let c=e(),f=i[t]=c?i[t-c]:{V:[],M:new Map};f.V.push(a),de.has(a)||re.set(a,f)}));for(let{V:e,M:a}of new Set(re.values())){let t=[];for(let a of e){let e=fe.filter((e=>J(e,a))),f=t.find((({G:a})=>e.some((e=>a.has(e)))));f||(f={G:new Set,V:[]},t.push(f)),f.V.push(a),c(f.G,e)}let f=t.flatMap((e=>Z(e.G)));for(let{G:e,V:c}of t){let t=new Set(f.filter((a=>!e.has(a))));for(let e of c)a.set(e,t)}}ne=new Set;let b=new Set;const s=e=>ne.has(e)?b.add(e):ne.add(e);for(let e of fe){for(let a of e.P)s(a);for(let a of e.Q)s(a)}for(let e of ne)re.has(e)||b.has(e)||re.set(e,V);c(ne,$(ne)),ie=function(e){let a=[],t=u(e);return function e({S:t,B:c},f,d){if(!(4&t&&d===f[f.length-1])){2&t&&(d=f[f.length-1]),1&t&&a.push(f);for(let a of c)for(let t of a.Q)e(a,[...f,t],d)}}(function a(c){return{S:e(),B:g((()=>{let c=u(e).map((e=>t[e]));if(c.length)return a(c)})),Q:c}}([]),[]),a}(e).map((e=>W.from(e))).sort(w),be=new Map;for(let e of ie){let a=[be];for(let t of e){let e=a.map((e=>{let a=e.get(t);return a||(a=new Map,e.set(t,a)),a}));t===K?a.push(...e):a=e}for(let t of a)t.V=e}}function se(e){return(he(e)?"":`${le(ue([e]))} `)+A(e)}function le(e){return`"${e}"‎`}function ue(e,a=1/0,t=A){let c=[];var f;f=e[0],oe(),ee.has(f)&&c.push("◌"),e.length>a&&(a>>=1,e=[...e.slice(0,a),8230,...e.slice(-a)]);let d=0,r=e.length;for(let a=0;a{let f=function(e){let a=[];for(let t=0,c=e.length;t0;)if(95!==e[--a])throw new Error("underscore allowed only at start")}(n),!(d.emoji=r>1||c[0].is_emoji)&&n.every((e=>e<128)))!function(e){if(e.length>=4&&e[2]==G&&e[3]==G)throw new Error(`invalid label extension: "${v(e.slice(0,4))}"`)}(n),e="ASCII";else{let a=c.flatMap((e=>e.is_emoji?[]:e));if(a.length){if(ee.has(n[0]))throw xe("leading combining mark");for(let e=1;eJ(e,t)));if(!e.length)throw fe.some((e=>J(e,t)))?me(a[0],t):ge(t);if(a=e,1==e.length)break}return a}(t);!function(e,a){for(let t of a)if(!J(e,t))throw me(e,t);if(e.M){let e=$(a);for(let a=1,t=e.length;ab)throw new Error(`excessive non-spacing marks: ${le(ue(e.slice(a-1,c)))} (${c-a}/${b})`);a=c}}}(f,a),function(e,a){let t,c=[];for(let e of a){let a=re.get(e);if(a===V)return;if(a){let c=a.M.get(e);if(t=t?t.filter((e=>c.has(e))):Z(c),!t.length)return}else c.push(e)}if(t)for(let a of t)if(c.every((e=>J(a,e))))throw new Error(`whole-script confusable: ${e.N}/${a.N}`)}(f,t),e=f.N}else e="Emoji"}d.type=e}catch(e){d.error=e}return d}))}function ge(e){return new Error(`disallowed character: ${se(e)}`)}function me(e,a){let t=se(a),c=fe.find((e=>e.P.has(a)));return c&&(t=`${c.N} ${t}`),new Error(`illegal mixture: ${e.N} + ${t}`)}function xe(e){return new Error(`illegal placement: ${e}`)}function ye(e){return e.filter((e=>e!=K))}function Ae(e,a){let t,c=be,f=e.length;for(;f&&(c=c.get(e[--f]),c);){let{V:d}=c;d&&(t=d,a&&a.push(...e.slice(f).reverse()),e.length=f)}return t}const ve=new Uint8Array(32);function we(e){return(0,f.MR)(0!==e.length,"invalid ENS name; empty component","comp",e),e}function _e(e){const a=(0,d.YW)(function(e){try{if(0===e.length)throw new Error("empty label");return function(e){return function(e){return e.map((({input:a,error:t,output:c})=>{if(t){let c=t.message;throw new Error(1==e.length?c:`Invalid label ${le(ue(a,63))}: ${c}`)}return v(c)})).join(z)}(pe(e,q,ye))}(e)}catch(a){(0,f.MR)(!1,`invalid ENS name (${a.message})`,"name",e)}}(e)),t=[];if(0===e.length)return t;let c=0;for(let e=0;e{(0,f.MR)(a.length<=t,`label ${JSON.stringify(e)} exceeds ${t} bytes`,"name",e);const c=new Uint8Array(a.length+1);return c.set(a,1),c[0]=c.length-1,c}))))+"00"}ve.fill(0)},43948:(e,a,t)=>{"use strict";t.d(a,{J9:()=>s,VS:()=>l,eB:()=>u,tG:()=>h,uI:()=>g,z5:()=>p});var c=t(88081),f=t(36212),d=t(27033),r=t(57339),n=t(8177);const i=BigInt(0);function b(e){return null==e?null:e}function o(e){return null==e?null:e.toString()}class s{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,a,t){(0,c.n)(this,{gasPrice:b(e),maxFeePerGas:b(a),maxPriorityFeePerGas:b(t)})}toJSON(){const{gasPrice:e,maxFeePerGas:a,maxPriorityFeePerGas:t}=this;return{_type:"FeeData",gasPrice:o(e),maxFeePerGas:o(a),maxPriorityFeePerGas:o(t)}}}function l(e){const a={};e.to&&(a.to=e.to),e.from&&(a.from=e.from),e.data&&(a.data=(0,f.c$)(e.data));const t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const c of t)c in e&&null!=e[c]&&(a[c]=(0,d.Ab)(e[c],`request.${c}`));const c="type,nonce".split(/,/);for(const t of c)t in e&&null!=e[t]&&(a[t]=(0,d.WZ)(e[t],`request.${t}`));return e.accessList&&(a.accessList=(0,n.$)(e.accessList)),"blockTag"in e&&(a.blockTag=e.blockTag),"enableCcipRead"in e&&(a.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(a.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(a.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(a.kzg=e.kzg),"blobs"in e&&e.blobs&&(a.blobs=e.blobs.map((e=>(0,f.f)(e)?(0,f.c$)(e):Object.assign({},e)))),a}class u{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#aa;constructor(e,a){this.#aa=e.transactions.map((e=>"string"!=typeof e?new g(e,a):e)),(0,c.n)(this,{provider:a,hash:b(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:b(e.prevRandao),extraData:e.extraData,baseFeePerGas:b(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#aa.map((e=>"string"==typeof e?e:e.hash))}get prefetchedTransactions(){const e=this.#aa.slice();return 0===e.length?[]:((0,r.vA)("object"==typeof e[0],"transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:a,extraData:t,gasLimit:c,gasUsed:f,hash:d,miner:r,prevRandao:n,nonce:i,number:b,parentHash:s,parentBeaconBlockRoot:l,stateRoot:u,receiptsRoot:h,timestamp:p,transactions:g}=this;return{_type:"Block",baseFeePerGas:o(e),difficulty:o(a),extraData:t,gasLimit:o(c),gasUsed:o(f),blobGasUsed:o(this.blobGasUsed),excessBlobGas:o(this.excessBlobGas),hash:d,miner:r,prevRandao:n,nonce:i,number:b,parentHash:s,timestamp:p,parentBeaconBlockRoot:l,stateRoot:u,receiptsRoot:h,transactions:g}}[Symbol.iterator](){let e=0;const a=this.transactions;return{next:()=>enew h(e,a))));let t=i;null!=e.effectiveGasPrice?t=e.effectiveGasPrice:null!=e.gasPrice&&(t=e.gasPrice),(0,c.n)(this,{provider:a,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:t,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#ta}toJSON(){const{to:e,from:a,contractAddress:t,hash:c,index:f,blockHash:d,blockNumber:r,logsBloom:n,logs:i,status:b,root:s}=this;return{_type:"TransactionReceipt",blockHash:d,blockNumber:r,contractAddress:t,cumulativeGasUsed:o(this.cumulativeGasUsed),from:a,gasPrice:o(this.gasPrice),blobGasUsed:o(this.blobGasUsed),blobGasPrice:o(this.blobGasPrice),gasUsed:o(this.gasUsed),hash:c,index:f,logs:i,logsBloom:n,root:s,status:b,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(b)return null;const{blockNumber:e,nonce:a}=await(0,c.k)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(a{if(null==e||0!==e.status)return e;(0,r.vA)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:e.to,from:e.from,data:""},receipt:e})},l=await this.provider.getTransactionReceipt(this.hash);if(0===t)return s(l);if(l){if(await l.confirmations()>=t)return s(l)}else if(await o(),0===t)return null;const u=new Promise(((e,a)=>{const c=[],n=()=>{c.forEach((e=>e()))};if(c.push((()=>{b=!0})),f>0){const e=setTimeout((()=>{n(),a((0,r.xz)("wait for transaction timeout","TIMEOUT"))}),f);c.push((()=>{clearTimeout(e)}))}const i=async c=>{if(await c.confirmations()>=t){n();try{e(s(c))}catch(e){a(e)}}};if(c.push((()=>{this.provider.off(this.hash,i)})),this.provider.on(this.hash,i),d>=0){const e=async()=>{try{await o()}catch(e){if((0,r.bJ)(e,"TRANSACTION_REPLACED"))return n(),void a(e)}b||this.provider.once("block",e)};c.push((()=>{this.provider.off("block",e)})),this.provider.once("block",e)}}));return await u}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}removedEvent(){return(0,r.vA)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),x(this)}reorderedEvent(e){return(0,r.vA)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,r.vA)(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),m(this,e)}replaceableTransaction(e){(0,r.MR)(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const a=new g(this,this.provider);return a.#ca=e,a}}function m(e,a){return{orphan:"reorder-transaction",tx:e,other:a}}function x(e){return{orphan:"drop-transaction",tx:e}}},8177:(e,a,t)=>{"use strict";t.d(a,{$:()=>n});var c=t(30031),f=t(57339),d=t(36212);function r(e,a){return{address:(0,c.b)(e),storageKeys:a.map(((e,a)=>((0,f.MR)((0,d.Lo)(e,32),"invalid slot",`storageKeys[${a}]`,e),e.toLowerCase())))}}function n(e){if(Array.isArray(e))return e.map(((a,t)=>Array.isArray(a)?((0,f.MR)(2===a.length,"invalid slot set",`value[${t}]`,a),r(a[0],a[1])):((0,f.MR)(null!=a&&"object"==typeof a,"invalid address-slot set","value",e),r(a.address,a.storageKeys))));(0,f.MR)(null!=e&&"object"==typeof e,"invalid access list","value",e);const a=Object.keys(e).map((a=>{const t=e[a].reduce(((e,a)=>(e[a]=!0,e)),{});return r(a,Object.keys(t).sort())}));return a.sort(((e,a)=>e.address.localeCompare(a.address))),a}},20415:(e,a,t)=>{"use strict";t.d(a,{K:()=>r,x:()=>n});var c=t(30031),f=t(15496),d=t(15539);function r(e){let a;return a="string"==typeof e?f.h.computePublicKey(e,!1):e.publicKey,(0,c.b)((0,d.S)("0x"+a.substring(4)).substring(26))}function n(e,a){return r(f.h.recoverPublicKey(e,a))}},79453:(e,a,t)=>{"use strict";t.d(a,{Z:()=>T});var c=t(30031),f=t(98982),d=t(68650),r=t(20260),n=t(15539),i=t(15496),b=t(57339),o=t(27033),s=t(36212);function l(e){let a=e.toString(16);for(;a.length<2;)a="0"+a;return"0x"+a}function u(e,a,t){let c=0;for(let f=0;f{(0,b.vA)(a<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:a})};if(e[a]>=248){const c=e[a]-247;t(a+1+c);const f=u(e,a+1,c);return t(a+1+c+f),h(e,a,a+1+c,c+f)}if(e[a]>=192){const c=e[a]-192;return t(a+1+c),h(e,a,a+1,c)}if(e[a]>=184){const c=e[a]-183;t(a+1+c);const f=u(e,a+1,c);return t(a+1+c+f),{consumed:1+c+f,result:(0,s.c$)(e.slice(a+1+c,a+1+c+f))}}if(e[a]>=128){const c=e[a]-128;return t(a+1+c),{consumed:1+c,result:(0,s.c$)(e.slice(a+1,a+1+c))}}return{consumed:1,result:l(e[a])}}function g(e){const a=(0,s.q5)(e,"data"),t=p(a,0);return(0,b.MR)(t.consumed===a.length,"unexpected junk after rlp payload","data",e),t.result}var m=t(65735),x=t(8177),y=t(20415);const A=BigInt(0),v=BigInt(2),w=BigInt(27),_=BigInt(28),I=BigInt(35),E=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),C=131072;function M(e,a){let t=e.toString(16);for(;t.length<2;)t="0"+t;return t+=(0,d.s)(a).substring(4),"0x"+t}function B(e){return"0x"===e?null:(0,c.b)(e)}function L(e,a){try{return(0,x.$)(e)}catch(t){(0,b.MR)(!1,t.message,a,e)}}function S(e,a){return"0x"===e?0:(0,o.WZ)(e,a)}function k(e,a){if("0x"===e)return A;const t=(0,o.Ab)(e,a);return(0,b.MR)(t<=E,"value exceeds uint size",a,t),t}function N(e,a){const t=(0,o.Ab)(e,"value"),c=(0,o.c4)(t);return(0,b.MR)(c.length<=32,"value too large",`tx.${a}`,t),c}function P(e){return(0,x.$)(e).map((e=>[e.address,e.storageKeys]))}function R(e,a){(0,b.MR)(Array.isArray(e),`invalid ${a}`,"value",e);for(let a=0;aObject.assign({},e)))}set blobs(e){if(null==e)return void(this.#ma=null);const a=[],t=[];for(let c=0;ce.data)),t.map((e=>e.commitment)),t.map((e=>e.proof))])]):(0,s.xW)(["0x03",(0,m.R)(c)])}(this,t,a?this.blobs:null)}(0,b.vA)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#xa(!0,!0)}get unsignedSerialized(){return this.#xa(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=null!=this.gasPrice,a=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,t=null!=this.accessList,c=null!=this.#ha||this.#pa;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&(0,b.vA)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,b.vA)(!a||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,b.vA)(0!==this.type||!t,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const f=[];return null!=this.type?f.push(this.type):a?f.push(2):e?(f.push(1),t||f.push(0)):t?(f.push(1),f.push(2)):(c&&this.to||(f.push(0),f.push(1),f.push(2)),f.push(3)),f.sort(),f}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return T.from(this)}toJSON(){const e=e=>null==e?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(null==e)return new T;if("string"==typeof e){const a=(0,s.q5)(e);if(a[0]>=127)return T.from(function(e){const a=g(e);(0,b.MR)(Array.isArray(a)&&(9===a.length||6===a.length),"invalid field count for legacy transaction","data",e);const t={type:0,nonce:S(a[0],"nonce"),gasPrice:k(a[1],"gasPrice"),gasLimit:k(a[2],"gasLimit"),to:B(a[3]),value:k(a[4],"value"),data:(0,s.c$)(a[5]),chainId:A};if(6===a.length)return t;const c=k(a[6],"v"),f=k(a[7],"r"),d=k(a[8],"s");if(f===A&&d===A)t.chainId=c;else{let e=(c-I)/v;e{"use strict";t.d(a,{Lm:()=>r,Lo:()=>n,X_:()=>g,ZG:()=>u,c$:()=>o,f:()=>i,nx:()=>p,pO:()=>l,q5:()=>d,xW:()=>s});var c=t(57339);function f(e,a,t){if(e instanceof Uint8Array)return t?new Uint8Array(e):e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const a=new Uint8Array((e.length-2)/2);let t=2;for(let c=0;c>4]+b[15&c]}return t}function s(e){return"0x"+e.map((e=>o(e).substring(2))).join("")}function l(e){return n(e,!0)?(e.length-2)/2:d(e).length}function u(e,a,t){const f=d(e);return null!=t&&t>f.length&&(0,c.vA)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:f,length:f.length,offset:t}),o(f.slice(null==a?0:a,null==t?f.length:t))}function h(e,a,t){const f=d(e);(0,c.vA)(a>=f.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(f),length:a,offset:a+1});const r=new Uint8Array(a);return r.fill(0),t?r.set(f,a-f.length):r.set(f,0),o(r)}function p(e,a){return h(e,a,!0)}function g(e,a){return h(e,a,!1)}},57339:(e,a,t)=>{"use strict";t.d(a,{E:()=>n,MR:()=>o,SP:()=>u,bJ:()=>r,dd:()=>s,gk:()=>h,vA:()=>b,xz:()=>i});var c=t(99529),f=t(88081);function d(e){if(null==e)return"null";if(Array.isArray(e))return"[ "+e.map(d).join(", ")+" ]";if(e instanceof Uint8Array){const a="0123456789abcdef";let t="0x";for(let c=0;c>4],t+=a[15&e[c]];return t}if("object"==typeof e&&"function"==typeof e.toJSON)return d(e.toJSON());switch(typeof e){case"boolean":case"symbol":case"number":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const a=Object.keys(e);return a.sort(),"{ "+a.map((a=>`${d(a)}: ${d(e[a])}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function r(e,a){return e&&e.code===a}function n(e){return r(e,"CALL_EXCEPTION")}function i(e,a,t){let r,n=e;{const f=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${d(t)}`);for(const e in t){if("shortMessage"===e)continue;const a=t[e];f.push(e+"="+d(a))}}f.push(`code=${a}`),f.push(`version=${c.r}`),f.length&&(e+=" ("+f.join(", ")+")")}switch(a){case"INVALID_ARGUMENT":r=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(e);break;default:r=new Error(e)}return(0,f.n)(r,{code:a}),t&&Object.assign(r,t),null==r.shortMessage&&(0,f.n)(r,{shortMessage:n}),r}function b(e,a,t,c){if(!e)throw i(a,t,c)}function o(e,a,t,c){b(e,a,"INVALID_ARGUMENT",{argument:t,value:c})}function s(e,a,t){null==t&&(t=""),t&&(t=": "+t),b(e>=a,"missing arguemnt"+t,"MISSING_ARGUMENT",{count:e,expectedCount:a}),b(e<=a,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:a})}const l=["NFD","NFC","NFKD","NFKC"].reduce(((e,a)=>{try{if("test"!=="test".normalize(a))throw new Error("bad");if("NFD"===a){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}e.push(a)}catch(e){}return e}),[]);function u(e){b(l.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}function h(e,a,t){if(null==t&&(t=""),e!==a){let e=t,a="new";t&&(e+=".",a+=" "+t),b(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:a})}}},99381:(e,a,t)=>{"use strict";t.d(a,{z:()=>f});var c=t(88081);class f{filter;emitter;#ya;constructor(e,a,t){this.#ya=a,(0,c.n)(this,{emitter:e,filter:t})}async removeListener(){null!=this.#ya&&await this.emitter.off(this.filter,this.#ya)}}},27033:(e,a,t)=>{"use strict";t.d(a,{Ab:()=>s,Dg:()=>h,JJ:()=>b,Ro:()=>g,ST:()=>i,WZ:()=>p,c4:()=>x,dK:()=>o,nD:()=>y,up:()=>m});var c=t(36212),f=t(57339);const d=BigInt(0),r=BigInt(1),n=9007199254740991;function i(e,a){const t=l(e,"value"),c=BigInt(p(a,"width"));return(0,f.vA)(t>>c===d,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),t>>c-r?-((~t&(r<=-n&&e<=n,"overflow",a||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(t){(0,f.MR)(!1,`invalid BigNumberish string: ${t.message}`,a||"value",e)}}(0,f.MR)(!1,"invalid BigNumberish value",a||"value",e)}function l(e,a){const t=s(e,a);return(0,f.vA)(t>=d,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),t}const u="0123456789abcdef";function h(e){if(e instanceof Uint8Array){let a="0x0";for(const t of e)a+=u[t>>4],a+=u[15&t];return BigInt(a)}return s(e)}function p(e,a){switch(typeof e){case"bigint":return(0,f.MR)(e>=-n&&e<=n,"overflow",a||"value",e),Number(e);case"number":return(0,f.MR)(Number.isInteger(e),"underflow",a||"value",e),(0,f.MR)(e>=-n&&e<=n,"overflow",a||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return p(BigInt(e),a)}catch(t){(0,f.MR)(!1,`invalid numeric string: ${t.message}`,a||"value",e)}}(0,f.MR)(!1,"invalid numeric value",a||"value",e)}function g(e){return p(h(e))}function m(e,a){let t=l(e,"value").toString(16);if(null==a)t.length%2&&(t="0"+t);else{const c=p(a,"width");for((0,f.vA)(2*c>=t.length,`value exceeds width (${c} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});t.length<2*c;)t="0"+t}return"0x"+t}function x(e){const a=l(e,"value");if(a===d)return new Uint8Array([]);let t=a.toString(16);t.length%2&&(t="0"+t);const c=new Uint8Array(t.length/2);for(let e=0;e{"use strict";function c(e,a,t){const c=a.split("|").map((e=>e.trim()));for(let t=0;tPromise.resolve(e[a]))))).reduce(((e,t,c)=>(e[a[c]]=t,e)),{})}function d(e,a,t){for(let f in a){let d=a[f];const r=t?t[f]:null;r&&c(d,r,f),Object.defineProperty(e,f,{enumerable:!0,value:d,writable:!1})}}t.d(a,{k:()=>f,n:()=>d})},65735:(e,a,t)=>{"use strict";t.d(a,{R:()=>n});var c=t(36212);function f(e){const a=[];for(;e;)a.unshift(255&e),e>>=8;return a}function d(e){if(Array.isArray(e)){let a=[];if(e.forEach((function(e){a=a.concat(d(e))})),a.length<=55)return a.unshift(192+a.length),a;const t=f(a.length);return t.unshift(247+t.length),t.concat(a)}const a=Array.prototype.slice.call((0,c.q5)(e,"object"));if(1===a.length&&a[0]<=127)return a;if(a.length<=55)return a.unshift(128+a.length),a;const t=f(a.length);return t.unshift(183+t.length),t.concat(a)}const r="0123456789abcdef";function n(e){let a="0x";for(const t of d(e))a+=r[t>>4],a+=r[15&t];return a}},99770:(e,a,t)=>{"use strict";t.d(a,{ck:()=>y,g5:()=>A,XS:()=>x});var c=t(57339),f=t(36212),d=t(27033),r=t(88081);const n=BigInt(-1),i=BigInt(0),b=BigInt(1),o=BigInt(5),s={};let l="0000";for(;l.length<80;)l+=l;function u(e){let a=l;for(;a.length=-a&&ei?(0,d.ST)((0,d.dK)(e,f),f):-(0,d.ST)((0,d.dK)(-e,f),f)}else{const a=b<=0&&enull==d[e]?t:((0,c.MR)(typeof d[e]===a,"invalid fixed format ("+e+" not "+a+")","format."+e,d[e]),d[e]);a=r("signed","boolean",a),t=r("width","number",t),f=r("decimals","number",f)}return(0,c.MR)(t%8==0,"invalid FixedNumber width (not byte aligned)","format.width",t),(0,c.MR)(f<=80,"invalid FixedNumber decimals (too large)","format.decimals",f),{signed:a,width:t,decimals:f,name:(a?"":"u")+"fixed"+String(t)+"x"+String(f)}}class g{format;#Aa;#va;#wa;_value;constructor(e,a,t){(0,c.gk)(e,s,"FixedNumber"),this.#va=a,this.#Aa=t;const f=function(e,a){let t="";e0?t*=u(c):c<0&&(a*=u(-c)),at?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#va;return this.#vai&&(e+=this.#wa-b),e=this.#va/this.#wa*this.#wa,this.#Ia(e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const a=this.decimals-e,t=o*u(a-1);let c=this.value+t;const f=u(a);return c=c/f*f,h(c,this.#Aa,"round"),new g(s,c,this.#Aa)}isZero(){return this.#va===i}isNegative(){return this.#va0){const a=u(b);(0,c.vA)(n%a===i,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),n/=a}else b<0&&(n*=u(-b));return h(n,r,"fromValue"),new g(s,n,r)}static fromString(e,a){const t=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,c.MR)(t&&t[2].length+t[3].length>0,"invalid FixedNumber string value","value",e);const f=p(a);let d=t[2]||"0",r=t[3]||"";for(;r.length=0,"invalid unit","unit",a),t=3*e}else null!=a&&(t=(0,d.WZ)(a,"unit"));return g.fromString(e,{decimals:t,width:512}).value}function y(e){return function(e){let a=18;return a=(0,d.WZ)(18,"unit"),g.fromValue(e,a,{decimals:a,width:512}).toString()}(e)}function A(e){return x(e,18)}},87303:(e,a,t)=>{"use strict";t.d(a,{YW:()=>n,_v:()=>i});var c=t(36212),f=t(57339);function d(e,a,t,c,f){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let c=a+1;c>6==2;c++)e++;return e}return"OVERRUN"===e?t.length-a-1:0}const r=Object.freeze({error:function(e,a,t,c,d){(0,f.MR)(!1,`invalid codepoint at offset ${a}; ${e}`,"bytes",t)},ignore:d,replace:function(e,a,t,c,r){return"OVERLONG"===e?((0,f.MR)("number"==typeof r,"invalid bad code point for replacement","badCodepoint",r),c.push(r),0):(c.push(65533),d(e,a,t))}});function n(e,a){(0,f.MR)("string"==typeof e,"invalid string value","str",e),null!=a&&((0,f.SP)(a),e=e.normalize(a));let t=[];for(let a=0;a>6|192),t.push(63&c|128);else if(55296==(64512&c)){a++;const d=e.charCodeAt(a);(0,f.MR)(a>18|240),t.push(r>>12&63|128),t.push(r>>6&63|128),t.push(63&r|128)}else t.push(c>>12|224),t.push(c>>6&63|128),t.push(63&c|128)}return new Uint8Array(t)}function i(e,a){return function(e,a){null==a&&(a=r.error);const t=(0,c.q5)(e,"bytes"),f=[];let d=0;for(;d>7)){f.push(e);continue}let c=null,r=null;if(192==(224&e))c=1,r=127;else if(224==(240&e))c=2,r=2047;else{if(240!=(248&e)){d+=a(128==(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",d-1,t,f);continue}c=3,r=65535}if(d-1+c>=t.length){d+=a("OVERRUN",d-1,t,f);continue}let n=e&(1<<8-c-1)-1;for(let e=0;e1114111?d+=a("OUT_OF_RANGE",d-1-c,t,f,n):n>=55296&&n<=57343?d+=a("UTF16_SURROGATE",d-1-c,t,f,n):n<=r?d+=a("OVERLONG",d-1-c,t,f,n):f.push(n))}return f}(e,a).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}},27125:(e,a,t)=>{"use strict";function c(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function f(e,...a){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(a.length>0&&!a.includes(e.length))throw new Error(`Expected Uint8Array of length ${a}, not of length=${e.length}`)}function d(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");c(e.outputLen),c(e.blockLen)}function r(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function n(e,a){f(e);const t=a.outputLen;if(e.lengthn,ai:()=>c,ee:()=>f,t2:()=>r,tW:()=>d})},37171:(e,a,t)=>{"use strict";t.d(a,{D:()=>d});var c=t(27125),f=t(10750);class d extends f.Vw{constructor(e,a,t,c){super(),this.blockLen=e,this.outputLen=a,this.padOffset=t,this.isLE=c,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,f.O8)(this.buffer)}update(e){(0,c.t2)(this);const{view:a,buffer:t,blockLen:d}=this,r=(e=(0,f.ZJ)(e)).length;for(let c=0;cd-n&&(this.process(t,0),n=0);for(let e=n;e>f&d),n=Number(t&d),i=c?4:0,b=c?0:4;e.setUint32(a+i,r,c),e.setUint32(a+b,n,c)}(t,d-8,BigInt(8*this.length),r),this.process(t,0);const i=(0,f.O8)(e),b=this.outputLen;if(b%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const o=b/4,s=this.get();if(o>s.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e{"use strict";t.d(a,{Ay:()=>s,B4:()=>i,P5:()=>n,WM:()=>b,im:()=>o,lD:()=>r});const c=BigInt(2**32-1),f=BigInt(32);function d(e,a=!1){return a?{h:Number(e&c),l:Number(e>>f&c)}:{h:0|Number(e>>f&c),l:0|Number(e&c)}}function r(e,a=!1){let t=new Uint32Array(e.length),c=new Uint32Array(e.length);for(let f=0;fe<>>32-t,i=(e,a,t)=>a<>>32-t,b=(e,a,t)=>a<>>64-t,o=(e,a,t)=>e<>>64-t,s={fromBig:d,split:r,toBig:(e,a)=>BigInt(e>>>0)<>>0),shrSH:(e,a,t)=>e>>>t,shrSL:(e,a,t)=>e<<32-t|a>>>t,rotrSH:(e,a,t)=>e>>>t|a<<32-t,rotrSL:(e,a,t)=>e<<32-t|a>>>t,rotrBH:(e,a,t)=>e<<64-t|a>>>t-32,rotrBL:(e,a,t)=>e>>>t-32|a<<64-t,rotr32H:(e,a)=>a,rotr32L:(e,a)=>e,rotlSH:n,rotlSL:i,rotlBH:b,rotlBL:o,add:function(e,a,t,c){const f=(a>>>0)+(c>>>0);return{h:e+t+(f/2**32|0)|0,l:0|f}},add3L:(e,a,t)=>(e>>>0)+(a>>>0)+(t>>>0),add3H:(e,a,t,c)=>a+t+c+(e/2**32|0)|0,add4L:(e,a,t,c)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0),add4H:(e,a,t,c,f)=>a+t+c+f+(e/2**32|0)|0,add5H:(e,a,t,c,f,d)=>a+t+c+f+d+(e/2**32|0)|0,add5L:(e,a,t,c,f)=>(e>>>0)+(a>>>0)+(t>>>0)+(c>>>0)+(f>>>0)}},4655:(e,a,t)=>{"use strict";t.d(a,{w:()=>r});var c=t(27125),f=t(10750);class d extends f.Vw{constructor(e,a){super(),this.finished=!1,this.destroyed=!1,(0,c.tW)(e);const t=(0,f.ZJ)(a);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const d=this.blockLen,r=new Uint8Array(d);r.set(t.length>d?e.create().update(t).digest():t);for(let e=0;enew d(e,a).update(t).digest();r.create=(e,a)=>new d(e,a)},84877:(e,a,t)=>{"use strict";t.d(a,{A:()=>r});var c=t(27125),f=t(4655),d=t(10750);function r(e,a,t,r){const{c:n,dkLen:i,DK:b,PRF:o,PRFSalt:s}=function(e,a,t,r){(0,c.tW)(e);const n=(0,d.tY)({dkLen:32,asyncTick:10},r),{c:i,dkLen:b,asyncTick:o}=n;if((0,c.ai)(i),(0,c.ai)(b),(0,c.ai)(o),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const s=(0,d.ZJ)(a),l=(0,d.ZJ)(t),u=new Uint8Array(b),h=f.w.create(e,s),p=h._cloneInto().update(l);return{c:i,dkLen:b,asyncTick:o,DK:u,PRF:h,PRFSalt:p}}(e,a,t,r);let l;const u=new Uint8Array(4),h=(0,d.O8)(u),p=new Uint8Array(o.outputLen);for(let e=1,a=0;a{"use strict";t.d(a,{s:()=>o});var c=t(37171),f=t(10750);const d=(e,a,t)=>e&a^e&t^a&t,r=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]),n=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);class b extends c.D{constructor(){super(64,32,8,!1),this.A=0|n[0],this.B=0|n[1],this.C=0|n[2],this.D=0|n[3],this.E=0|n[4],this.F=0|n[5],this.G=0|n[6],this.H=0|n[7]}get(){const{A:e,B:a,C:t,D:c,E:f,F:d,G:r,H:n}=this;return[e,a,t,c,f,d,r,n]}set(e,a,t,c,f,d,r,n){this.A=0|e,this.B=0|a,this.C=0|t,this.D=0|c,this.E=0|f,this.F=0|d,this.G=0|r,this.H=0|n}process(e,a){for(let t=0;t<16;t++,a+=4)i[t]=e.getUint32(a,!1);for(let e=16;e<64;e++){const a=i[e-15],t=i[e-2],c=(0,f.Ow)(a,7)^(0,f.Ow)(a,18)^a>>>3,d=(0,f.Ow)(t,17)^(0,f.Ow)(t,19)^t>>>10;i[e]=d+i[e-7]+c+i[e-16]|0}let{A:t,B:c,C:n,D:b,E:o,F:s,G:l,H:u}=this;for(let e=0;e<64;e++){const a=u+((0,f.Ow)(o,6)^(0,f.Ow)(o,11)^(0,f.Ow)(o,25))+((h=o)&s^~h&l)+r[e]+i[e]|0,p=((0,f.Ow)(t,2)^(0,f.Ow)(t,13)^(0,f.Ow)(t,22))+d(t,c,n)|0;u=l,l=s,s=o,o=b+a|0,b=n,n=c,c=t,t=a+p|0}var h;t=t+this.A|0,c=c+this.B|0,n=n+this.C|0,b=b+this.D|0,o=o+this.E|0,s=s+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(t,c,n,b,o,s,l,u)}roundClean(){i.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const o=(0,f.ld)((()=>new b))},10750:(e,a,t)=>{"use strict";t.d(a,{Vw:()=>l,$h:()=>b,tY:()=>h,Id:()=>s,O8:()=>r,po:()=>g,Ow:()=>n,ZJ:()=>o,DH:()=>d,ld:()=>p});const c="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,f=e=>e instanceof Uint8Array,d=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),r=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),n=(e,a)=>e<<32-a|e>>>a;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");const i=async()=>{};async function b(e,a,t){let c=Date.now();for(let f=0;f=0&&ee+a.length),0));let t=0;return e.forEach((e=>{if(!f(e))throw new Error("Uint8Array expected");a.set(e,t),t+=e.length})),a}class l{clone(){return this._cloneInto()}}const u={}.toString;function h(e,a){if(void 0!==a&&"[object Object]"!==u.call(a))throw new Error("Options should be object or undefined");return Object.assign(e,a)}function p(e){const a=a=>e().update(o(a)).digest(),t=e();return a.outputLen=t.outputLen,a.blockLen=t.blockLen,a.create=()=>e(),a}function g(e=32){if(c&&"function"==typeof c.getRandomValues)return c.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},63837:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},72079:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},3219:e=>{"use strict";e.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"}}')},62951:e=>{"use strict";e.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"}}')},64589:e=>{"use strict";e.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"}')},23241:e=>{"use strict";e.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"}}')},1636:e=>{"use strict";e.exports={rE:"6.5.7"}},15579:e=>{"use strict";e.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"}')}},__webpack_module_cache__={};function __webpack_require__(e){var a=__webpack_module_cache__[e];if(void 0!==a)return a.exports;var t=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(t.exports,t,t.exports,__webpack_require__),t.loaded=!0,t.exports}__webpack_require__.amdO={},__webpack_require__.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(a,{a}),a},__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{BatchBlockService:()=>d.B3,BatchEventsService:()=>d.JY,BatchTransactionService:()=>d.AF,Deposit:()=>r.dA,ENS__factory:()=>f.p2,ERC20__factory:()=>f.Xc,GET_DEPOSITS:()=>t.GET_DEPOSITS,GET_ECHO_EVENTS:()=>t.GET_ECHO_EVENTS,GET_ENCRYPTED_NOTES:()=>t.GET_ENCRYPTED_NOTES,GET_GOVERNANCE_APY:()=>t.GET_GOVERNANCE_APY,GET_GOVERNANCE_EVENTS:()=>t.GET_GOVERNANCE_EVENTS,GET_NOTE_ACCOUNTS:()=>t.GET_NOTE_ACCOUNTS,GET_REGISTERED:()=>t.GET_REGISTERED,GET_STATISTIC:()=>t.GET_STATISTIC,GET_WITHDRAWALS:()=>t.GET_WITHDRAWALS,Invoice:()=>r.qO,MAX_FEE:()=>g.KN,MAX_TOVARISH_EVENTS:()=>x.o,MIN_FEE:()=>g.Ss,MIN_STAKE_BALANCE:()=>g.pO,MerkleTreeService:()=>b.s,Mimc:()=>o.p,Multicall__factory:()=>f.Q2,NetId:()=>l.zr,NoteAccount:()=>n.Ad,OffchainOracle__factory:()=>f.Hk,OvmGasPriceOracle__factory:()=>f.Ld,Pedersen:()=>u.Hr,RelayerClient:()=>g.OR,ReverseRecords__factory:()=>f.Rp,TokenPriceOracle:()=>h.T,TornadoBrowserProvider:()=>p.D2,TornadoFeeOracle:()=>i.o,TornadoRpcSigner:()=>p.Vr,TornadoVoidSigner:()=>p.Gd,TornadoWallet:()=>p.nA,TovarishClient:()=>x.E,_META:()=>t._META,addNetwork:()=>l.AE,addressSchemaType:()=>c.SC,ajv:()=>c.SS,base64ToBytes:()=>y.Kp,bigIntReplacer:()=>y.gn,bnSchemaType:()=>c.iL,bnToBytes:()=>y.jm,buffPedersenHash:()=>u.UB,bufferToBytes:()=>y.lY,bytes32BNSchemaType:()=>c.i1,bytes32SchemaType:()=>c.yF,bytesToBN:()=>y.Ju,bytesToBase64:()=>y.if,bytesToHex:()=>y.My,calculateScore:()=>g.zy,calculateSnarkProof:()=>A.i,chunk:()=>y.iv,concatBytes:()=>y.Id,convertETHToTokenAmount:()=>i.N,createDeposit:()=>r.Hr,crypto:()=>y.Et,customConfig:()=>l.cX,defaultConfig:()=>l.sb,defaultUserAgent:()=>p.mJ,depositsEventsSchema:()=>c.CI,digest:()=>y.br,echoEventsSchema:()=>c.ME,enabledChains:()=>l.Af,encryptedNotesSchema:()=>c.XW,factories:()=>f.XB,fetch:()=>p.hd,fetchData:()=>p.Fd,fetchGetUrlFunc:()=>p.uY,getActiveTokenInstances:()=>l.oY,getActiveTokens:()=>l.h9,getAllDeposits:()=>t.getAllDeposits,getAllEncryptedNotes:()=>t.getAllEncryptedNotes,getAllGovernanceEvents:()=>t.getAllGovernanceEvents,getAllGraphEchoEvents:()=>t.getAllGraphEchoEvents,getAllRegisters:()=>t.getAllRegisters,getAllWithdrawals:()=>t.getAllWithdrawals,getConfig:()=>l.zj,getDeposits:()=>t.getDeposits,getEncryptedNotes:()=>t.getEncryptedNotes,getEventsSchemaValidator:()=>c.ZC,getGovernanceEvents:()=>t.getGovernanceEvents,getGraphEchoEvents:()=>t.getGraphEchoEvents,getHttpAgent:()=>p.WU,getInstanceByAddress:()=>l.Zh,getMeta:()=>t.getMeta,getNetworkConfig:()=>l.RY,getNoteAccounts:()=>t.getNoteAccounts,getProvider:()=>p.sO,getProviderWithNetId:()=>p.MF,getRegisters:()=>t.getRegisters,getRelayerEnsSubdomains:()=>l.o2,getStatistic:()=>t.getStatistic,getStatusSchema:()=>c.c_,getSupportedInstances:()=>g.XF,getTokenBalances:()=>m.H,getWeightRandom:()=>g.c$,getWithdrawals:()=>t.getWithdrawals,governanceEventsSchema:()=>c.FR,hexToBytes:()=>y.aT,initGroth16:()=>A.O,isNode:()=>y.Ll,jobsSchema:()=>c.Us,leBuff2Int:()=>y.ae,leInt2Buff:()=>y.EI,mimc:()=>o.f,multicall:()=>s.C,packEncryptedMessage:()=>n.Fr,pedersen:()=>u.NO,pickWeightedRandomRelayer:()=>g.sN,populateTransaction:()=>p.zr,proofSchemaType:()=>c.Y6,queryGraph:()=>t.queryGraph,rBigInt:()=>y.ib,registeredEventsSchema:()=>c.dX,sleep:()=>y.yy,substring:()=>y.uU,toFixedHex:()=>y.$W,toFixedLength:()=>y.sY,unpackEncryptedMessage:()=>n.ol,validateUrl:()=>y.wv,withdrawalsEventsSchema:()=>c.$j});var e=__webpack_require__(94513),a={};for(const t in e)"default"!==t&&(a[t]=()=>e[t]);__webpack_require__.d(__webpack_exports__,a);var t=__webpack_require__(52049),c=__webpack_require__(59511),f=__webpack_require__(21278),d=__webpack_require__(9723),r=__webpack_require__(7240),n=__webpack_require__(33298),i=__webpack_require__(37182),b=__webpack_require__(5217),o=__webpack_require__(22901),s=__webpack_require__(48486),l=__webpack_require__(59499),u=__webpack_require__(85111),h=__webpack_require__(34525),p=__webpack_require__(68434),g=__webpack_require__(57194),m=__webpack_require__(7393),x=__webpack_require__(96838),y=__webpack_require__(67418),A=__webpack_require__(26746)})(),__webpack_exports__})())); \ No newline at end of file diff --git a/src/events/schema.ts b/src/events/schema.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/schemas/ajv.ts b/src/schemas/ajv.ts new file mode 100644 index 0000000..fa94d9e --- /dev/null +++ b/src/schemas/ajv.ts @@ -0,0 +1,31 @@ +import Ajv from 'ajv'; +import { BigNumberish, isAddress } from 'ethers'; + +export const ajv = new Ajv({ allErrors: true }); + +ajv.addKeyword({ + keyword: 'BN', + // eslint-disable-next-line @typescript-eslint/no-explicit-any + validate: (schema: any, data: BigNumberish) => { + try { + BigInt(data); + return true; + } catch { + return false; + } + }, + errors: true, +}); + +ajv.addKeyword({ + keyword: 'isAddress', + // eslint-disable-next-line @typescript-eslint/no-explicit-any + validate: (schema: any, data: string) => { + try { + return isAddress(data); + } catch { + return false; + } + }, + errors: true, +}); diff --git a/src/schemas/events.ts b/src/schemas/events.ts new file mode 100644 index 0000000..e93a300 --- /dev/null +++ b/src/schemas/events.ts @@ -0,0 +1,185 @@ +import { DEPOSIT, WITHDRAWAL } from '../events'; +import { ajv } from './ajv'; +import { addressSchemaType, bnSchemaType, bytes32SchemaType } from './types'; + +const baseEventsSchemaProperty = { + blockNumber: { + type: 'number', + }, + logIndex: { + type: 'number', + }, + transactionHash: bytes32SchemaType, +} as const; + +const baseEventsSchemaRequired = Object.keys(baseEventsSchemaProperty) as string[]; + +export const governanceEventsSchema = { + type: 'array', + items: { + anyOf: [ + { + type: 'object', + properties: { + ...baseEventsSchemaProperty, + event: { type: 'string' }, + id: { type: 'number' }, + proposer: addressSchemaType, + target: addressSchemaType, + startTime: { type: 'number' }, + endTime: { type: 'number' }, + description: { type: 'string' }, + }, + required: [ + ...baseEventsSchemaRequired, + 'event', + 'id', + 'proposer', + 'target', + 'startTime', + 'endTime', + 'description', + ], + additionalProperties: false, + }, + { + type: 'object', + properties: { + ...baseEventsSchemaProperty, + event: { type: 'string' }, + proposalId: { type: 'number' }, + voter: addressSchemaType, + support: { type: 'boolean' }, + votes: { type: 'string' }, + from: addressSchemaType, + input: { type: 'string' }, + }, + required: [...baseEventsSchemaRequired, 'event', 'proposalId', 'voter', 'support', 'votes', 'from', 'input'], + additionalProperties: false, + }, + { + type: 'object', + properties: { + ...baseEventsSchemaProperty, + event: { type: 'string' }, + account: addressSchemaType, + delegateTo: addressSchemaType, + }, + required: [...baseEventsSchemaRequired, 'account', 'delegateTo'], + additionalProperties: false, + }, + { + type: 'object', + properties: { + ...baseEventsSchemaProperty, + event: { type: 'string' }, + account: addressSchemaType, + delegateFrom: addressSchemaType, + }, + required: [...baseEventsSchemaRequired, 'account', 'delegateFrom'], + additionalProperties: false, + }, + ], + }, +} as const; + +export const registeredEventsSchema = { + type: 'array', + items: { + type: 'object', + properties: { + ...baseEventsSchemaProperty, + ensName: { type: 'string' }, + relayerAddress: addressSchemaType, + }, + required: [...baseEventsSchemaRequired, 'ensName', 'relayerAddress'], + additionalProperties: false, + }, +} as const; + +export const depositsEventsSchema = { + type: 'array', + items: { + type: 'object', + properties: { + ...baseEventsSchemaProperty, + commitment: bytes32SchemaType, + leafIndex: { type: 'number' }, + timestamp: { type: 'number' }, + from: addressSchemaType, + }, + required: [...baseEventsSchemaRequired, 'commitment', 'leafIndex', 'timestamp', 'from'], + additionalProperties: false, + }, +} as const; + +export const withdrawalsEventsSchema = { + type: 'array', + items: { + type: 'object', + properties: { + ...baseEventsSchemaProperty, + nullifierHash: bytes32SchemaType, + to: addressSchemaType, + fee: bnSchemaType, + timestamp: { type: 'number' }, + }, + required: [...baseEventsSchemaRequired, 'nullifierHash', 'to', 'fee', 'timestamp'], + additionalProperties: false, + }, +} as const; + +export const echoEventsSchema = { + type: 'array', + items: { + type: 'object', + properties: { + ...baseEventsSchemaProperty, + address: addressSchemaType, + encryptedAccount: { type: 'string' }, + }, + required: [...baseEventsSchemaRequired, 'address', 'encryptedAccount'], + additionalProperties: false, + }, +} as const; + +export const encryptedNotesSchema = { + type: 'array', + items: { + type: 'object', + properties: { + ...baseEventsSchemaProperty, + encryptedNote: { type: 'string' }, + }, + required: [...baseEventsSchemaRequired, 'encryptedNote'], + additionalProperties: false, + }, +} as const; + +export function getEventsSchemaValidator(type: string) { + if (type === DEPOSIT) { + return ajv.compile(depositsEventsSchema); + } + + if (type === WITHDRAWAL) { + return ajv.compile(withdrawalsEventsSchema); + } + + if (type === 'governance') { + return ajv.compile(governanceEventsSchema); + } + + if (type === 'registered') { + return ajv.compile(registeredEventsSchema); + } + + if (type === 'echo') { + return ajv.compile(echoEventsSchema); + } + + if (type === 'encrypted_notes') { + return ajv.compile(encryptedNotesSchema); + } + + throw new Error('Unsupported event type for schema validation'); +} diff --git a/src/schemas/index.ts b/src/schemas/index.ts index bfbc360..f01c441 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -1,21 +1,5 @@ -import Ajv from 'ajv'; -import type { BigNumberish } from 'ethers'; - -export const ajv = new Ajv({ allErrors: true }); - -ajv.addKeyword({ - keyword: 'BN', - // eslint-disable-next-line @typescript-eslint/no-explicit-any - validate: (schema: any, data: BigNumberish) => { - try { - BigInt(data); - return true; - } catch { - return false; - } - }, - errors: true, -}); - +export * from './ajv'; +export * from './events'; export * from './status'; export * from './jobs'; +export * from './types'; diff --git a/src/schemas/status.ts b/src/schemas/status.ts index 5b9cb3e..b41536e 100644 --- a/src/schemas/status.ts +++ b/src/schemas/status.ts @@ -1,4 +1,5 @@ import { Config, NetId, NetIdType } from '../networkConfig'; +import { addressSchemaType, bnSchemaType } from '.'; export type statusInstanceType = { type: string; @@ -6,11 +7,11 @@ export type statusInstanceType = { instanceAddress: { type: string; properties: { - [key in string]: typeof addressType; + [key in string]: typeof addressSchemaType; }; required: string[]; }; - tokenAddress?: typeof addressType; + tokenAddress?: typeof addressSchemaType; symbol?: { enum: string[] }; decimals: { enum: number[] }; }; @@ -28,7 +29,7 @@ export type statusInstancesType = { export type statusEthPricesType = { type: string; properties: { - [key in string]: typeof bnType; + [key in string]: typeof bnSchemaType; }; required?: string[]; }; @@ -36,7 +37,7 @@ export type statusEthPricesType = { export type statusSchema = { type: string; properties: { - rewardAccount: typeof addressType; + rewardAccount: typeof addressSchemaType; instances?: statusInstancesType; gasPrices: { type: string; @@ -91,14 +92,10 @@ export type statusSchema = { required: string[]; }; -const addressType = { type: 'string', pattern: '^0x[a-fA-F0-9]{40}$' }; - -const bnType = { type: 'string', BN: true }; - const statusSchema: statusSchema = { type: 'object', properties: { - rewardAccount: addressType, + rewardAccount: addressSchemaType, gasPrices: { type: 'object', properties: { @@ -110,7 +107,7 @@ const statusSchema: statusSchema = { netId: { type: 'integer' }, tornadoServiceFee: { type: 'number', maximum: 20, minimum: 0 }, latestBlock: { type: 'number' }, - latestBalance: { type: 'string', BN: true }, + latestBalance: bnSchemaType, version: { type: 'string' }, health: { type: 'object', @@ -151,8 +148,8 @@ export function getStatusSchema(netId: NetIdType, config: Config, tovarish: bool properties: { instanceAddress: { type: 'object', - properties: amounts.reduce((acc: { [key in string]: typeof addressType }, cur) => { - acc[cur] = addressType; + properties: amounts.reduce((acc: { [key in string]: typeof addressSchemaType }, cur) => { + acc[cur] = addressSchemaType; return acc; }, {}), required: amounts.filter((amount) => !optionalInstances.includes(amount)), @@ -166,7 +163,7 @@ export function getStatusSchema(netId: NetIdType, config: Config, tovarish: bool }; if (tokenAddress) { - instanceProperties.properties.tokenAddress = addressType; + instanceProperties.properties.tokenAddress = addressSchemaType; } if (symbol) { instanceProperties.properties.symbol = { enum: [symbol] }; @@ -198,8 +195,8 @@ export function getStatusSchema(netId: NetIdType, config: Config, tovarish: bool if (_tokens.length) { const ethPrices: statusEthPricesType = { type: 'object', - properties: _tokens.reduce((acc: { [key in string]: typeof bnType }, token: string) => { - acc[token] = bnType; + properties: _tokens.reduce((acc: { [key in string]: typeof bnSchemaType }, token: string) => { + acc[token] = bnSchemaType; return acc; }, {}), required: _tokens, diff --git a/src/schemas/types.ts b/src/schemas/types.ts new file mode 100644 index 0000000..1e0621f --- /dev/null +++ b/src/schemas/types.ts @@ -0,0 +1,9 @@ +export const addressSchemaType = { + type: 'string', + pattern: '^0x[a-fA-F0-9]{40}$', + isAddress: true, +} as const; +export const bnSchemaType = { type: 'string', BN: true } as const; +export const proofSchemaType = { type: 'string', pattern: '^0x[a-fA-F0-9]{512}$' } as const; +export const bytes32SchemaType = { type: 'string', pattern: '^0x[a-fA-F0-9]{64}$' } as const; +export const bytes32BNSchemaType = { ...bytes32SchemaType, BN: true } as const; diff --git a/src/tovarishClient.ts b/src/tovarishClient.ts index 8cd3cbf..f825360 100644 --- a/src/tovarishClient.ts +++ b/src/tovarishClient.ts @@ -10,6 +10,7 @@ import { } from './relayerClient'; import { fetchData } from './providers'; import { CachedRelayerInfo, MinimalEvents } from './events'; +import { getEventsSchemaValidator } from './schemas'; // Return no more than 5K events per query export const MAX_TOVARISH_EVENTS = 5000; @@ -181,6 +182,8 @@ export class TovarishClient extends RelayerClient { }: TovarishEventsQuery): Promise> { const url = `${this.selectedRelayer?.url}events`; + const schemaValidator = getEventsSchemaValidator(type); + try { const events = []; let lastSyncBlock = fromBlock; @@ -203,6 +206,11 @@ export class TovarishClient extends RelayerClient { }), })) as BaseTovarishEvents; + if (!schemaValidator(fetchedEvents)) { + const errMsg = `Schema validation failed for ${type} events`; + throw new Error(errMsg); + } + lastSyncBlock = currentBlock; if (!Array.isArray(fetchedEvents) || !fetchedEvents.length) {